Encoder error ERROR_ILLEGAL_HALL_STATE

The capacitors have to be mounted very close to the ODrive, you can’t have it out on a breadboard.

1 Like

Hi,

I tried this out recently with some 47nF and also with 22nF as suggested, but it didn’t seem to fix the issue. I instead ignored the error, but I now get “ERROR_NO_RESPONSE” when I run a full calibration or encoder offset calibration. Not sure if that helps in terms of debugging, but I’d be happy to provide more info if needed.

Just got a couple of Q85 motors working after getting this error. 47nF were needed (at least on M1).

Tried 22nF on both motors, but kept getting the error so replaced the 22nF with 47nF on M1 and that solved the problem.

3 Likes

A nice solution that is less difficult to solder and still keeps the capacitors close to the ODrive board:

2 Likes

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.

3 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.

3 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?