Encoder error ERROR_ILLEGAL_HALL_STATE

I like the protoboard solution. Any thoughts on also adding some additional resistors to create low pass filters? Would that improve things even more?

@wtip not necessarily. If the pass band of the filter is too low, then it will cause errors at high speeds, especially if using a high resolution encoder.
The filter should probably have a passband up to about 1MHz to avoid attenuating genuine encoder signals.

1 Like

I ended up using this board.

2 Likes

I’m so glad the board is helpful! :slight_smile:

1 Like

If all the capacitors are doing is smoothing the signal from the hall sensors, then could this not be done more elegantly (more configurably etc.) in code rather than hardware?

An exponentially-weighted average reading would only require one extra double for each encoder input, and other than the exponent (calculated once across all inputs per same) is very cheap to compute. The rate of smoothing could be a configuration option, which makes it easy to turn on/off and vary the level of smoothing to match the device.

If this is a terrible idea, then please say so. Otherwise, if someone can add this feature, I’d be delighted. Otherwise, if I can work out how to get the firmware source code, I’ll have a go myself.

2 Likes

wow, that’s fancy; I didn’t want to spend that much and have to wait for it to ship; I had a ton of these proto-boards sitting around, so it was free, fast, same amount of soldering. For that price it should come with the capacitors and headers on the board to just plug in.

I ended up using this PCB: https://oshpark.com/shared_projects/1WRsMdeT. The hall effect signals plug in with a JST PH.

Super small and cheap, but certainly not as polished as what you all can make (I’m not an EE). Due to the small size, it doesn’t interfere with any other header pins on the odrive.

2 Likes

A post was split to a new topic: Where can I find schematics and documentation?

I wanted to ask what the ODrive expects as logically low and logically high. What are the limits?

1 Like

I have the same question. I’m having a really hard time with a HE sensor, I have confirmed signals when rotated on an analog oscilloscope, but since it’s not digital, I don’t know if they have enough chutzpah. The signals seem kinda wide and gracefully float up and down at least a few volts with sharp and noticeable U shaped dip between what I presume are the poles aligning. I originally installed 22uf caps, but then installed 47uf (axis1 only). A similar motor works on Axis0, however, the condition moves when I move the motor to Axis0, so I have to assume that the HE is not doing it’s job. What are the voltages, signal levels, current levels, whatever levels, for the encoder input circuits? I’m thinking of removing the pullups and soldering 47uf across those points. Is that too extreme?

Hmm. I’m not sure what you mean by ‘chutzpah’. Can you post a photo of your scope when you see this condition?
Most Hall sensors have a ‘digital’ output of some sort. Usually they have a built-in Schmitt-trigger comparator, so they shouldn’t “gracefully float up and down”.
It’s possible (but unusual) that your Hall sensors have “open collector” outputs, and therefore you need a pull-up resistor on each output.
What kind of Hall sensor do you have? Do you have a datasheet?

1 Like

They’re just high impedance 3.3v digital CMOS inputs… pretty normal stuff.

2 Likes

I use the DRV5053VA from Texas Instruments. I implemented different combinations of low pass filters to differ the signal voltage and noise reduction. Therefore I want to know what low and high signal is required.

datasheet:
https://www.ti.com/lit/ds/symlink/drv5053.pdf?ts=1601975252661

May I suggest to anyone attempting to put low-pass filters on a digital Hall sensor: Don’t. This is a hack and should not be required. Fix your wiring first.
The “22nF capacitor mod” is there to conduct away noise in the 5-50MHz region, which can be present around inverters, especially where there is no passive filtering on the power side (common-mode chokes etc). It’s not a low-pass filter as such.
I’d expect that rise/fall time for Hall sensors needs to be <<1us, otherwise it’s likely that the chip will sample during a transition, and trigger the ILLEGAL_HALL_STATE error.

Chutzpah = amplitude or voltage or sharp enough peak or level or Joules or whatever is needed to drive the input.

After some tweaks, I found that no amount of input filtering would have done the trick. I’m glad you asked me to post the photo of the scope, because a thorough test revealed that it was indeed one of my hall sensors is jacked-up.

Here’s the clips:

Hall Effect Troubleshooting Hoverboard Phases ODRIVE Error error = 0x0010 ERROR_ILLEGAL_HALL_STATE

How much should the voltage of the capacitors be?

Should I consider 50 or 100 volt capacitors since I have the 56 volt board version.
Which one do u think is best of those?
https://www.elfa.se/en/ceramic-capacitor-22nf-50v-20-kemet-c317c223m5u5ta7301/p/16572598?q=22nf+ceramic+capacitor&pos=10&origPos=10&origPageSize=50&track=true

https://www.elfa.se/en/ceramic-capacitor-22nf-50vdc-0805-rnd-components-rnd-1500805b223j500nt/p/30086666?q=22nf+ceramic+capacitor&pos=1&origPos=1&origPageSize=50&track=true

https://www.elfa.se/en/ceramic-capacitor-22nf-50v-10-kemet-ck05bx223k7301/p/16573588?q=22nf+ceramic+capacitor&pos=27&origPos=27&origPageSize=50&track=true

Hi and tx for your great engineering work.

I run into ERROR_ILLEGAL_HALL_STATE as well. It is a skateboard sensed bldc. The hall states encode like this when checking on arduno. You say all 0 or all 1 are illegal states. With this sensor setting it seems i cannot avoid it. Tx and best

0 0 0 =0
1 0 0 =1
1 1 0 =3
1 1 1 =7
0 1 1 =6
0 0 1 =4
0 0 0 =0
1 0 0 =1
1 1 0 =3
1 1 1 =7
0 1 1 =6
0 0 1 =4
0 0 0 =0
1 0 0 =1
1 1 0 =3

Want to +1 this solution for others.

I was using 3d printed parts and everything was fine. Once I switched to metal the motors would stop with ERROR_ILLEGAL_HALL_STATE after a few seconds. I used 100nF caps (didn’t have 22nF) as per the photo in this thread. Problem fixed.

2 Likes

Hi all,
I am not an bldc motorcontroller expert but could it possible to filter out some hall state errors by the software
For example ingore the error if it is just for a short period of time (noise) or count the errors to an defined limit ?