Circular SetPoint Range

Ok, I know Im being stupid but can someone explain the Circular Setpoint range.

I need step/dir positional control with ideally 1024 steps per rev and no limit on the number of turns the motor can do.

When I use:

odrv0.axis1.controller.config.circular_setpoint_range = 2048
odrv0.axis1.controller.config.steps_per_circular_range = 1024

When I enter closed loop control the drive just spins for ages (2048 turns?)
If I use a small number for the setpoint range then when it’s completed the number of turns it reverses.

Neither of these are workable…

What should the settings be?

circular_setpoint_range is in turns. What you want is just:

odrv0.axis1.controller.config.circular_setpoint_range = 1
odrv0.axis1.controller.config.steps_per_circular_range = 1024

The trouble is, when it gets to the end of the first turn it reverses back to the zero position, I need it to keep going as it recieves more steps (Position control for a CNC measuring machine, small gimball motors)

No it doesn’t. pos_estimate might, but axis won’t actually move back to 0. If it is doing that, please let me know what input_mode, control_mode, and commands you’re sending it, then drop some data in here (plot / record input_pos, pos_setpoint, shadow_count, and pos_estimate)

They are all the default values:
input_mode = INPUT_MODE_PASSTHROUGH
Control mode = Position control.

I can’t get the plots to change (running on raspi, no anaconda) but the std plot shows the position moving up then dropping back to the zero position and starting again.

It worked quite happily before the firmware update. I added the braking resistor and GPIO modes to the step dir lines to get it working.

This is how I’ve set it up:

odrv0.config.enable_brake_resistor = True
odrv0.axis1.encoder.config.cpr=2000
odrv0.axis1.controller.config.vel_limit=60
odrv0.axis1.motor.config.torque_constant=0.043
odrv0.axis1.motor.config.pole_pairs=2
odrv0.axis1.motor.config.calibration_current=1.5
odrv0.axis1.motor.config.current_lim=2
odrv0.axis1.controller.config.vel_gain=.01
odrv0.axis1.controller.config.pos_gain = 60
odrv0.axis1.controller.config.vel_integrator_gain = 0.15
odrv0.axis1.motor.config.motor_type=MOTOR_TYPE_GIMBAL

odrv0.config.gpio1_mode = GPIO_MODE_DIGITAL
odrv0.config.gpio2_mode = GPIO_MODE_DIGITAL

odrv0.axis1.config.step_gpio_pin = 8
odrv0.axis1.config.dir_gpio_pin = 7
odrv0.axis1.config.enable_step_dir = True

odrv0.axis1.controller.config.circular_setpoints = True
odrv0.axis1.controller.config.circular_setpoint_range = 1
odrv0.axis1.controller.config.steps_per_circular_range = 1024

Yeah, that’s expected as the axis turns. Is the axis itself physically moving back and forth, or just the data?

The axis spins back to the start position…

Can you confirm you’re on 0.5.4?

odrv0.fw_version_minor
odrv0.fw_version_revision