Desprate help on hoverboard project

Hello complete noob here, im completely lost on what im doing. I have gotten as far as to do a motor test and succeeded but now im getting a lot of issues with the coding. Specifically with the Phase_offset_float. It says it should be -.5, -1.5,.5, or 1.5 but im at 0 and don’t know how to change it. Also, when completing the last step before the pwm input the motor doesnt do anything when it should be running. Also what pwm controller would anyone recommend to use as a beginner (I have to finish the project in 2 weeks). Is the rc pwm easy to setup? Do i need a arduino or raspberry pie? Help is greatly appreciated as this is my first time coding.

1 Like

phase_offset_float is something that is set automatically when you run the calibration. Assuming the calibration is successful (the motor should turn forwards and then backwards) then you should have those values.
If it only turns in one direction, then something went wrong (maybe the Hall sensors are not connected properly, or maybe you have the wrong counts per rev) so you should use dump_errors(odrv0) to find out what is going on.

If you are controlling from a raspberry pi, I would highly recommend to use the USB interface from python rather than PWM. If you are using an Arduino, then I’d suggest to use the UART serial interface.
The RC PWM is really only useful if your controller is a radio control transmitter & receiver.
But what is best depends on what you are trying to do and what you have available. ODrive is pretty flexible.

When you say “hoverboard project” do you mean that you are using hoverboard motors for something else, (e.g. something like Oskar’s shopping trolley) or are you trying to make your own self-balancing hoverboard?
Because for a first-time coder who only has two weeks to complete, it would be quite a challenge to make a self-balancer. :grimacing:

1 Like

I’m making somthing similar to the to the rc trolley. I would like to use a pwm rc controller so I can drive other people around but I’m not sure what rc receiver and transmitter I should purchase. I will check the code when I am home and see what is going on. thx for the help so far.

1 Like

ok so then RC PWM should work for you. You should be able to use any transmitter and receiver that has PWM output (most of them have PWM output, one channel per wire. A few of the extremely tiny receivers designed for small drones have PPM output only - this is a way to have multiple channels on one wire and it is not supported by ODrive)

1 Like

So i typed in dump_errors(odrv0) and got back

encoder: Error(s):
     ENCODER_ERROR_ILLEGAL_HALL_STATE
     ENCODER_ERROR_HALL_NOT_CALLIBRATED_YET

Also when running AXIS_STATE_ENCODER_HALL_POLARITY_CALIBRATION The motor only turns forward. My Phase offset float is still at 0 if that matters.

also one more question, do i need to have either a rasberry pi or arduino or can i run it without them from just the odrive and rc pwm input?

Here are some pictures of my setup.
Should I add the 22nf capacitors as I’ve seen people having a similar issue with similar code and they added them as a solution.

Please check the value of encoder.hall_state repeatedly while you move the motor slowly by hand. Or use start_liveplotter(lambda: [odrv0.axis0.encoder.hall_state])
You should see all of the numbers 1 through 6, but not 0 or 7.