My VESC with AS5047 sensor setup

Nice work. I am using hoverboard hubmotors now with a vesc (see below) and want to add sensors that would be better than just the 3 existing hallsensors. Would you recommend this kind of magnetic encoder over the optical encoder method for low speed and position control, perhaps even for balancing. I would like to know how the original hoveboard does such nice control from the gyro (acceleromter) board it uses, if you have any idea. thanks, [email protected] http://neurowritings.blogspot.com/2017/03/hoverboard-hack-for-electric-skateboard.html

Anyone know what firmware versions will work for this? Since the bldc site went down, I’m having trouble finding firmware for 2.17 and 2.18. Anyone have these available for download? Thanks! I’m also up for hosting atchives of BLDC tool on my google drive if anyone has a repository.

Thanks!

Hi @JTAG, I have one more question for you and i’m hoping you could provide me some insight, or perhaps a solution. So I went ahead and added the same encoder that you’ve mentioned, the AS5047, removed the Capacitors and replaced the needed resistors with 10Ω ones on the VESC. But when I go into the settings, change the sensor type to the encoder option and do the detection I get a weird noise from the motor when I attempt to run them. The detection results seem to come in just fine and it gives some sort of value for the encoder, which I assume that the encoder position was successfully registered, but when I attempt to spin up the motors using the remote I get a noise that sounds like something is slipping. Would you have any insight to why this is? I can upload a video or photos of all the procedures that I’ve done if you’re willing to look into this.

Thanks again for motivating me into attempting this!!

I’ve personally had tons of issues with the encoder detection. Just because it spits out results doesn’t mean they’re correct. I often got a ratio of 500, which means the detection was unsuccessful. For my motor, the correct ratio was 7.

@JTAG Here is a link to the video of me configuring the encoder settings and attempting to run the setup with the encoder: https://drive.google.com/open?id=0B-CnAwEu9O1ndW55QjVkcTM0R0U

Hi,

Your received / detected ratio looks quite low. Mine was 7, but on the other hand your motor is also different so it might be correct.

Somewhere in BLDC tool you can read/visualise the encoder output. Can you try if the encoder output graph still shows encoder data when you select sensorless in FOC? If so check the noise on the encoder signal (when motor is actuated), it sounds like the motor actuation / current is corrupting your encoder signal. If not obvious that that might be the problem please share a picture.

Good Luck!

That did the trick! It looks like there was too much noise in the line and by simply readjusting the connector cable I was able to get a clean signal! Thanks again! I’ll try to insulate the connectors so that they don’t cause such issues down the road.

Noisy Signal:

Slightly Cleaned up signal Connector:

1 Like

Awesome!

I ended up using shielded cable, that got me to a 99.9% clean encoder signal, more then enough for a nice riding experience :grin:.

So this is basically what Boosted uses I guess?

Are there any benefits to having the sensor monitoring the shaft position compared to being inside the motor instead?

Hall sensors in the motor have multiple 100’s times lower angular resolution then the AS5047, therefore the low RPM flux angle has a way higher accuracy resulting in a way way smoother start from standstill.

2 Likes

Hello, Danny

@JTAG

Thank you very much for positng this great work here. I’m actually also working on a VESC encoder position control project. Can I ask you some questions about it?

Where can I purchase the motor in your video? Can you provide a link to it? My motor does not work with VESC encoder detection. It keeps giving me 0 ratio and the detection only stops when the detection is timeout. The BLDC-tool does not response after the detection. I have to restart the VESC and reconnect to the BLDC-tool. So I’m thinking use the same motor as yours.

Which firmware version did you use for VESC? Did you use version 2.18?

I watched the Benjamin’s video about position control. He used version 2.10, and also it is a bin file. So I’m really confused about which software to use right now.

Thanks very much

Michael

Hello ykoval,

@ykoval

Thanks very much for posting your video here. I actually have similiar problem as yours. My motor does not even work with the encoder detection. I’m using an ABI encoder which is 1000 pulses per revolution. The BLDC-tool can detect the ABI encoder and show the degree on the BLDC-tool.

Did you use Maytech 6374 motor in that video? Have you solve your problem now?

Best

Michael

Yes, I was able to successfully solve the encoder issue. As JTAG pointed out, I was getting too much noise in the signal which the BLDC tool didn’t like and which is why I wasn’t able to detect the reported encoder position properly. Just make sure that the BLDC tool is reporting a single clean line when it shows the encoder position. Those regular six pin connectors don’t seem to work well, which is why I replaced them with shielded wires. If your VESC can detect the motor parameters without the encoder, it should detect it with the encoder. That is of course if the encoder is wired correctly.

@ykoval Yes. I tried AS5048A encoder today and got a lot of noise. If you don’t mind, could you please post a picture of your wiring, connections and other stuffs so I can know how to fix my hardware?

Best

Michael

@hexakopter

Hello,

How you solve the spi noise problem? Did you just use normal wires?

Thanks very much

MIchael

I implemented twisted pair aka an ethernet cable which provided a ground for each signal wire.

As you can see, my original motor had hall sensors which I snipped.

The original encoder wires were replaced with twisted pair ethernet. Encoder cap reference to the actual wheel.

1 Like

That Senor sounds super cool! Can you tell me, why you are using AS5047P-TS? There are other options as well AS5047P-ATSM, AS5047P-ATST, AS5047D-TS, AS5047D-ATSM.

Nice wheels btw… are these onda wheels?.. Also the cover, which also holds encoder looks really nice… Do you pour epoxy into a mold to make these?

The encoder covers were 3D printed and the motor mounts were CNC machined and yes those are Onda wheels