My VESC with AS5047 sensor setup

Great to see someone diving into the magnetic encoder support of the VESC. I have heard that the non linearity of the AS5047 leads to problems with higher RPMs. Can you confirm that? Comparing the hybrid mode (where the VESC uses the magnetic encoder for lower RPMs and then switch to sensorless mode for higher speeds) with the complete sensored mode should show that.

Isn’t it bad to stick the magnet directly into the steel pulley? I think that results into a different magnetic field which maybe decline the accuracy of the encoder. Are you using a 6mm shaft (so a 6mm pulley) because the magnet used for the AS encoder have a 6mm diameter when I am not mistaken?

2 Likes

@JTAG I’ve been following your work on the forum here, Just when I think that you have reached maximum awesomeness, you amaze me once again. :thumbsup:

I think you don’t get it. The support is already implemented by Benjamin Vedder. So you will see the code in his github. @JTAG just build the supported hardware in his board.

Oh yeah, I didn’t check out the link before I posted! Got it. :wink:

Yes it was benjammins work implementing the encoder. I was to lazy to design and build a PCB that fitted my exact needs so I just ordered the development boards since they were so cheap. It was surprisingly easy to make really, most of the effort went into designing the 3D model and printing it (and that was the contribution of @MrEpiquad ^^ ).

@hexakopter Non linearity in what sense? I havent noticed anything bad, the board is now so much more fun starting from standstill. Low/zero speed is the only reason to use an encoder since at higher speed the observer does a much better job of determine the rotor flux angle.

Yes for sure the metal pully will bent/guide the magnetic field making it less ideal. I think this will result in a bit more noise on the encoder output, but hey we have 14 bits to spare xD. Yeah the magnet is 6mm and coincidentally the motor shaft is as well.

1 Like

Did you remove the filters on the sensor port or does it work fine without doing that?

Yes, remove the filters like you would when using an encoder. I noticed that when using cables that have their wires right next to each other without separate shielding (like USB cables) a series resistor of 47R instead of 0R is needed to prevent cross talk (needed for the chip select and clock signal ).

Hi JTAG, I removed R11, R12, R13, C5, C6, C7 and replaced R8, R9, R10 by 0 Ohm resistors. Unfortunately it does not work yet, therefore the question: Is the wiring as indicated in this Image correct? Might this be a problem of Cross Talk?

1 Like

Hmmm, everything looks OK. Did you change te sensor mode to AS5047 in the bldc tool? Cross talk is a serious problem indeed with these high speed SPI line. Also take special care in the alignment of the magnet (de datasheet / reference design manual tells the criteria).

Any easy way to verify the basic functionality is to measure on the AB (or I) output, a toggling signal should be visible when the magnet rotates.

You probably know this already, just to state the obvious: the type of magnet used has a specific north / south pole orientation, please make sure yours has something similar.

Good luck and keep us posted!

1 Like

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!!