Error on controller.input_vel = 0

Following the Hoverboard tutorial, I was able to make my wheels spinning :slight_smile:

However, I am getting errors when setting input_vel to 0 before changing state to IDLE as described in the tutorial.

odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_vel = 2
# Your motor should spin here
odrv0.axis0.controller.input_vel = 0
odrv0.axis0.requested_state = AXIS_STATE_IDLE

But I don’t get errors when running commands in this order:

...
# Your motor should spin here
odrv0.axis0.requested_state = AXIS_STATE_IDLE
odrv0.axis0.controller.input_vel = 0

So, I need to switch state first bevor setting velocity to 0.

Those are the errors I get:

In [30]: dump_errors(odrv0)                                                                                                                                       
system: no error
axis0
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_UNKNOWN_TORQUE
    MOTOR_ERROR_UNKNOWN_VOLTAGE_COMMAND
  sensorless_estimator: no error
  encoder: Error(s):
    ENCODER_ERROR_ILLEGAL_HALL_STATE
  controller: no error

In my application, the robot will stop and move very often. I am using Jetson Nano which sends commands (velocity) by UART. Ideally, I could set velocity between 0 and 2 without changing the state.

Note: I can make my wheels spinning from input_vel = 0.3. Below, the state switches to IDLE and throws errors like above.

Is this a bug or did I something wrong ?

I just figured out that I only get this error on M0. It works like a charm on M1. But I have two wheels … :smiley:

I just compared the config for axis 0 and 1. The only difference I found is

axis0.encoder.config.phase_offset_float = 0.5585030317306519
axis1.encoder.config.phase_offset_float = 0.541111409664154

Should those values be the same?

Can it be related to a noise issue? The error only appears when velocity is below 0.3 and on M0 only.

Yes, noise can be an issue. Do you have the recommended capacitors on the input pins?

Today, capacitors and protoboard arrived. But I just realized that I ordered the wrong ones…
I got 0.22uF instead of 22uF. The set includes caps from 0.1 to 10uF. Those ones won’t work right?

22uF would be huge. You want 22nF, or 0.022uF

1 Like

Ok, I bought correct caps but I realized that it’s really difficult to solder. I also tried it with a protoboard but it’s just a mess. So I have to find someone with expert soldering skills or take a different motor controller. I am just a bit frustrated because it is working except this little noise/issue on M0 which makes the ODRIVE useless. I also don’t understand why this board doesn’t come with caps by default.

Wellllll it was never designed to use HALL sensors in the first place, basically. They will be present on v4, as we have dedicated HALL inputs.

Ah ok… I think it will be a great enhancement for v4. :+1:

By the way, my encoder (AEDR-8300) also has A/B wires. I tried to calibrate ODRIVE following the normal instructions without hall support. However, I didn’t get any signal/feedback. Do you know if this encoder is not supported by ODRIVE or can I make it supportive somehow? :slight_smile:

Finally, I ordered a proper soldering station trying to solder caps again. Hopefully, I will be more lucky this time. :smiley:

Alright, after some soldering practice I was dared to solder caps directly to the ODRIVE and it works like a charm. Puh, I hope that was the final challenge.

1 Like

Yeah that encoder looks like it should work fine with the AB mode (and encoder.config.mode = ENCODER_MODE_INCREMENTAL)

When running this command odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION I get the following error:

system: no error
axis0
  axis: no error
  motor: no error
  sensorless_estimator: no error
  encoder: Error(s):
    ENCODER_ERROR_NO_RESPONSE
  controller: no error
axis1
  axis: no error
  motor: no error
  sensorless_estimator: no error
  encoder: no error
  controller: no error

Alright, I was able to fix it. I forgot to add some parameters. Nice, now I can run my motor in Hall or Encoder/Incremental Mode. That is amazing. Thanks a lot for supporting :slight_smile:

1 Like