My VESC with AS5047 sensor setup

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

@JTAG Does anyone know if this encoder can work with the focbox without any modification to focbox? Would I just have to use the latest firmware from Vedder?

Good question. Since the original 4.12 VESC needed changes and the FocBox is based on that design I would assume it needs some modifications as well. But I am no expert on the foxbox so I don’t know for sure :frowning: .

Ok then it’s a good bet to say it probably needs some modification.

So lets get this thread active again. :slight_smile: Trying to setup an AS5048A.

I modified the VESC (flier model) removing R11-13. Solder jumper on R8-10 and removing C5-C7.

The encoder works and I can run the encoder detection, I receive the values: ofs: 264.10 Rat: 7

Problem is when I try to run the motor it makes very funny noises. And I don’t know where to start the troubleshooting?

For encoder count on advance tab in BLDC tool. what should I set this value to? I put 16384.

Any suggestions?

1 Like

Some videos:

Does anyone have the developmental board on hand? Looks like it’ll be a while on mouser, does this one work as well? https://www.digikey.com/product-detail/en/ams/AS5047P-TS_EK_AB/AS5047P-TS_EK_AB-ND/5452344

How do I get a hold of it now?

@JTAG thanks

I have 2 of them (the one you linked), but I didn’t try yet.

@JTAG Do you know how can i get 50rpm on my VESC with AS5407? Thanks

If you use HALL sensors you should not remove the filters and not configure the AS5047 section but the HALL sensor section.

Both rotor sensing methods use the same inputs on the VESC, the sensor signal is different and therefore you should configure them different.

Good luck!

1 Like

If it works, don’t touch it :nerd_face:. Just kidding, good luck!

1 Like

@JTAG or @ykoval I appreciate you two sharing your journey with the AS5047.

I’m trying to achieve low speed smooth rotation by integrating the encoder with my FlipSky FSESC6.6 dual right now and not able to connect the dots. Hope someone here can help. I wired the AS5047P-TS_EK_AB dev board to the VESC using SPI, using the 3V3 power supply, and confirmed that I’m getting reliable sensor input when rotating the motors.

I can’t for the life of me figure out what my settings in the VESC Tool need to be in order to achieve PID speed control using the encoder. I’ve read and re-read this topic, reviewed others on Esk8. Several people post about their hang-ups from the sensor to the VESC, but few people have mentioned any issues happening after they get a reliable signal from the encoder. Maybe I’m missing something obvious?

Clicking the FWD button on the Local VESC (Motor Settings > General > General > Refresh > FWD) rotates the motor about 1/4 rotation, then jitters violently as can be seen below. image

Watching the video ykoval posted of his problem, he ran into a similar issue of not getting correct commutation. His symptom was a locked rotor, less jittery than mine. JTAGs suggestion of running the motor in sensorless mode and watching the encoder output didn’t seem to help either. Using the FWD button again, the motors spun up as expected and the encoder output below looks as would be expected. The post suggested that noise would be visible but I don’t see any noise - it’s smooth like the image above.

I’ve tried sensorless, and sensored (PID Speed control, current control, DC). I can’t use the keyboard arrows to spin up the motors without a bunch of jitter either.

Am I missing something obvious? How did y’all who have been successful with the AS5047 encoder get smooth control? Would love to understand the settings involved in VESC Tool to get my motors to work as expected and share that with the community here for anyone else trying to make this work. Thanks!

If it won’t spin smoothly with keyboard input (duty cycle and current control modes), I doubt your problem has anything to do with PID settings. I’ve used the AS5047 with FSESC 6.6 single several times now successfully in both position and speed control modes, and before tuning the PID gains, it always rotates smoothly with the keyboard in duty cycle or current control modes. If it doesn’t do that correctly, then I know something else is wrong and I run the motor setup again. I’ve had the luxury of spare motors, controllers, and encoders, and usually switching one of them fixes the problem if it gets that far. Usually just running commutation again fixes the problem though.

One jitter problem I’ve had similar to what you’re describing was related to sensor wire harness EMI. I was using unshielded jumper wires, and simple moving the wires around made the encoder signal go from tons of noise like you’re showing, to perfectly stable. Motors were uncontrollable and the temporary fix was to empirically tape one of the wires away from the rest. It worked rather well, but shielded cable might help. I’d move the sensor wires in question around and see if it affects the signal. It was the same result with multiple harnesses, so I don’t think it was a loose wire problem.

Can you confirm that when you say “I’m getting reliable sensor input”, the encoder setup is successful, and as you rotate the motor by hand it shows smooth, 14 bit data that doesn’t jump around? Also, what motor are you using? I had some issues a while ago trying to drive small motors with the VESC 4.8, because the current sensing shunts don’t do well with small currents.

Thanks for the reply. I’m using a pair of FlipSky 6368 / 140KV outrunners. The sensor data looked smooth and consistent for the entire rotation.

I believe I found the solution. Once I had setup the encoder and ran the calibration, the part I was missing was to rerun the FOC motor setup with sufficient d and I values to commutate the motor. I thought I only had to run the motor setup first, then the encoder setup, but it seemed to work better for me the other way around.

Thanks for the help @jgeating! Hope this helps the next person stuck in troubleshooting mode.

2 Likes

Hmm. I don’t think I’ve ever run encoder setup prior to motor detection, with similar sized 6374/80-150kV motors. But whatever works - I’m glad the problem is fixed.

Good Day, Did you make a holder for the magnet also. Do you have the stp files by chance. I would like to try it out.