Step / Direction control inconsistent with different Odrive board


I’m trying to setup step/dir communication from a Duet 2 Wifi board to Odrive boards (3x v3.6 56v and 2x v3.5 48V). My problem is that some Odrives act like they should, but others not. The two older Odrives have a shorter comm cable (0.5m), so that might explain it partly why they work properly.

The newer board have much longer comm cable ( around 5m)

So, thing is that once I connect the Step signal to the control board (Duet) the motors start spinning with constant velocity. If I unplug the cable the rotation stops immediately. But, somehow I managed to get one of the newer Odrives configured correctly since it behaves the way it should. And because of that I think it is a configuration issue. Is it somehow possible to copy the working config from one board to the other?

Any ideas?

Oh, and I’m using the v0.4.11 firmware for compatibility reasons.

This is my config:

odrv0.config.enable_uart = False

odrv0.axis0.config.counts_per_step = 0.01
odrv0.axis0.config.step_gpio_pin = 1
odrv0.axis0.config.dir_gpio_pin = 2

odrv0.axis1.config.counts_per_step = 0.01
odrv0.axis1.config.step_gpio_pin = 7
odrv0.axis1.config.dir_gpio_pin = 8

odrv0.axis0.config.enable_step_dir = True
odrv0.axis1.config.enable_step_dir = True

odrv0.config.brake_resistance = 2

odrv0.axis0.config.startup_motor_calibration = True
odrv0.axis0.config.startup_encoder_offset_calibration = True
odrv0.axis0.config.startup_closed_loop_control = True
odrv0.axis0.motor.config.current_lim = 50
odrv0.axis0.motor.config.pole_pairs = 7
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis0.encoder.config.cpr = 8192
odrv0.axis0.controller.config.vel_limit = 130000
odrv0.axis0.motor.config.calibration_current = 40
odrv0.axis0.encoder.config.bandwidth = 1000

odrv0.axis1.config.startup_motor_calibration = True
odrv0.axis1.config.startup_encoder_offset_calibration = True
odrv0.axis1.config.startup_closed_loop_control = True
odrv0.axis1.motor.config.current_lim = 50
odrv0.axis1.motor.config.pole_pairs = 7
odrv0.axis1.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis1.encoder.config.cpr = 8192
odrv0.axis1.controller.config.vel_limit = 130000
odrv0.axis1.motor.config.calibration_current = 40
odrv0.axis1.encoder.config.bandwidth = 1000

Yes, you can use backup_config:

It sounds like you’re picking up noise on the step / dir pins. Watch out for ground loops, too!

Thanks! I will try to copy the configs today.

In our setup the Odrives are powered by their own PSU’s. The Duet has it’s own. Both Odrive and Duet are connected by signal GND.

So, does this also make a ground loop?

I saw in some thread an isolator breakout board based on the Texas Instrument chip, I think. Would this be something worth to try?

Config copying worked flawless!

I also found the issue. For some reason the shield/GND cable had a faulty connection with the pin. Now, I have 2 working Odrives :grinning:
One to go.

1 Like