My VESC with AS5047 sensor setup

Hi there, First off, let me say that i’m very impressed with the work that you’ve done here. So, after you’ve modified the VESC by essentially removing the filter and switching the resistors to around 0 ohms, what part of the code did you have to modify to allow the encoder to be recognized by the VESC? Any help will be much appreciated!

Thanks!

Hi ykoval,

Thanks! No need to change any code. AS5047 is already implemented in the latest available firmware (implemented by vedder himself).

Hi, So just to confirm, I would simply select the encoder from the BLDC tool without uploading any files onto the VESC? This will then allow me to detect the encoder without any firmware changes?

Thanks again!

Under advanced you can select the encoder type. Choose AS5047. Then do the encoder detection like demonstrated in my videos.

Nice work! Do you mind sharing the AS5047 CAP 3d printer file (STL)?

Maybe the question is better preserved here. Did you used the Encoders on all the kilometer driven with the board? On your other thread it looks like you are driving a lot and I am interested what your long term opinion about encoders is. Do you had any problems? Would be glad to hear about that topic.

Hi, and my apologies, I should have replied. Unfortunately no. the cable between de encoder and the VESC broke within about 100 kilometers or so, I never found the motivation to fix it. Although the response and feel of control is way way better I don’t really need them.

1 Like

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.