Hi,
I’m using the Odrive v3.6 56V with a D6374 right off of the ODrive Website. I’ve used this setup many times before, but for some reason I’m facing difficulties this time. I loaded the ODriveArduinoTest code, the motor calibration sequence runs successfully, but the sinusoidal test move does not execute. The motor does not move. I’m really not sure what to do to debug this issue.
I tried setting the velocity limit to 30 turns/s, the current limit to 30A, and setting the motor type and pole count to match the motor. Despite this, have not been able to get the sinusoidal move to run.
Would appreciate any advice.
I just tried another script using the odrivetool library and python. Here is the code:
from __future__ import print_function
import odrive
from odrive.enums import*
import time
import math
print("finding an odrive...")
drive = odrive.find_any()
print("starting calibration...")
drive.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
while drive.axis0.current_state != AXIS_STATE_IDLE:
time.sleep(0.1)
drive.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
print("Bus voltage is " + str(drive.axis0.controller.pos_setpoint))
for i in [1,2,3,4]:
print('voltage on GPIO{} is {} Volt'.format(i, drive.get_adc_voltage(i)))
t0 = time.monotonic()
while True:
setpoint = 4.0 * math.sin((time.monotonic() -t0)*2)
print("goto " + str(int(setpoint)))
drive.axis0.controller.input_pos = setpoint
time.sleep(0.01)
The calibration runs, and then the motor just spins clockwise a few times and then stops (very much not sinusoidal). I’m stumped as I’ve gotten this to work so many times in the past.
Did you do the normal setup?
odrv0.config.dc_max_negative_current = -1
odrv0.config.enable_brake_resistor = True
odrv0.axis0.controller.config.vel_limit = 20
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
Were you able to figure out the problem? Mine does the same thing.