Hey all,
I just received my 3.5 and I’m trying to figure out how to use it in sensorless mode. I’m using the Python ODriveTool for now.
This is the reported FW version info:
fw_version_major = 0
fw_version_minor = 4
fw_version_revision = 1
fw_version_unreleased = 1
Here’s the configuration steps that I settled upon:
# The included 50W brake resistor
odrv0.config.brake_resistance = 2.0
# Counted by running current through two leads of the motor and counting
# cogging positions. Motor is a Tacon 96M936 2250kV inrunner.
odrv0.axis0.motor.config.pole_pairs = 2
# Start the motor calibration process
odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
# Seems to allows skipping of motor calibration after saving config
odrv0.axis0.motor.config.pre_calibrated = True
# Configure blind spin-up to sensorless estimator takeover
# Values same as default for now
odrv0.axis0.config.spin_up_current = 10.0
odrv0.axis0.config.spin_up_acceleration = 1000.0
odrv0.axis0.config.spin_up_target_vel = 1000.0
odrv0.save_configuration()
After configuration, the startup sequence that I’ve been trying:
odrv0.axis0.controller.set_vel_setpoint(1000, 0.2)
odrv0.axis0.requested_state = AXIS_STATE_SENSORLESS_CONTROL
After requesting the state, the motor usually spins up a bit and then stops with no errors.
Occasionally, it will spin up, hesitate, then rapidly accelerate before stopping with the axis0 error 0x31, which looks like the following:
ERROR_INVALID_STATE
ERROR_BRAKE_RESISTOR_DISARMED
ERROR_MOTOR_DISARMED
Very occasionally, it will spin up and then slowly oscillate around the target velocity.
I tried changing the controller’s “current_feed_forward” value by increments of 0.1; decreases seem to make the immediate stop behavior more likely and increases seem to make the rapid accel then error behavior more likely.
I’ve also tried increasing the spin up target to 2000 or 3000, or trying current control instead. I’ve gotten the same behavior with those.
I’m guessing after this that I’m missing some tuning parameters. What should I look for, and what’s the best way to tune them?
Also, a couple more questions:
First, when something goes wrong and I try to reset the error codes, I have tried
odrv0.axis0.error = 0
odrv0.axis0.motor.error = 0
etc
and this gets rid of most of them. But odrv0.axis0.error usually stays stuck on ERROR_INVALID_STATE, and the only way I’ve found to start over is to reboot. What’s the proper way to reset errors?
Second, is there a way to have ODriveTool print all currently-existing errors in human-readable format? Scanning through the states by hand and then comparing error codes to the firmware is really slow.
Edit: Third, how do you figure out the target speed for spin-up? It’s based on the lowest back-EMF voltage that the board can sense, right?
Thanks!