Hall Sensor Noise

Hi I’m controlling a hoverboard motor with odrive 3.6.
I successfully finished calibrating the motor parameters and was one step before fully controlling the motor.

However, I got errors while doing this:
dev0.axis0.requested_state = AXIS_STATE_ENCODER_HALL_POLARITY_CALIBRATION

the error says: ILLEGAL_HALL_STATE

I went over the docs to find what makes the error and it was because the signals from the hall sensor was 000 or 111.

so I checked the hall sensor signal with my oscilloscope and compared to see the noise when the motor was rotating.

When I rotated with my hand:

When the motor was rotating:

It seems like there’s a significant noise generated by the motor since the hall sensor is really close to the runner and stator.

I used 100nF caps to filter some noise but I couldn’t eliminate it completely. (recommended cap value was 22nF but I didn’t have them near me)

So, will this problem be fixed with 22nF caps or are there any other solutions?

+)
I also live plotted the hall_state and it looks like this:

It seems fine and I can never see any 000 or 111 which is 0 and 7 in decimals.
Can other reasons make this issue?

Hi! This will likely be fixed with the 22nF capacitors, yes. I would use ferrite rings for good measure.

Hi solomondg and thanks for the advice!
I have two additional questions.

  1. why should it be 22nF? why is my 100nF caps insufficient?(Is there any mathematical explanation?)

  2. should I buy three ferrite rings and wind them to each of the phase wires?

  1. The ODrive has 3.3kΩ encoder pull-up resistors. 22nF capacitors create a 2.2kHz low pass filter, 100nF capacitors create a 480Hz low pass filter. The goal is to filter out the motor switching noise (24kHz and above), which the 22nF capacitors are adequate for. Any higher capacitance (and thus lower filter cutoff frequency) will introduce phase lag and reduce control stability. Especially because it’s theoretically possible for the ODrive to rotate the motor faster than 480Hz, which would lead to a 100nF capacitor filtering out all hall signals :slight_smile:

  2. No, please see the image on the shop page. The phase wires must be passed through and wound together around the ferrite ring. This helps the noise from each of the phase leads “cancel each other out” .

Wow thanks for the details!
I’ll try your suggestions thanks:)

Let us know how it goes!