I have been tweaking the tuning and parameters for a couple days, but keep getting a Spinout error. Running 2 8" hoverboard motors on Odrive 3.6, firmware and odrivetools updated to 0.5.2. Power is from 2 Milwaukee LiPo batteries in series for about 40V. This is on a lawnmower frame with casters in front and motors on rear.
Have completed initial motor and encoder calibration, and subsequent tuning.
I see in the release notes for 0.5.2 that there are these new parameters, but I don’t know where to begin changing them: mechanical_power_bandwidth, electrical_power_bandwidth, spinout_electrical_power_threshold, spinout_mechanical_power_threshold added to controller.config for spinout detection.
The problem arises when driving on bumpy lawn and one of the motors loses traction and spins.
This is the error I’m getting:
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: no error
controller: Error(s):
CONTROLLER_ERROR_SPINOUT_DETECTED
axis1
axis: no error
motor: Error(s):
MOTOR_ERROR_UNKNOWN_TORQUE
MOTOR_ERROR_UNKNOWN_VOLTAGE_COMMAND
sensorless_estimator: no error
encoder: no error
controller: Error(s):
CONTROLLER_ERROR_SPINOUT_DETECTED
I found this from issue #462 during implementation of Spinout detection:
Incorrect encoder offset can lead to an uncontrolled spinout situation due to inadvertent flipped sign of torque production. Incorrect encoder offset can occur due to missed pulses in an incremental encoder, or general incorrect calibration.
I don’t believe I am missing encoder pulses (am using the built in Hall sensors), as both motors will produce the same error, under the same conditions.
I have running two 6.5’ hoverboard motors on Odrive 3.6 56V, and had same issue.
When I was using the 0.5.1 firmware, spinout detection was not happened and was able to do drifting with those motors.
But when I upgraded to 0.5.4 firmware, the motor stops working after slip the tire, and error dump was same as first post above.
And I finally find this thread, I had a test to change new parameter, “spinout_electrical_power_threshold” and “spinout_mechanical_power_threshold”.
spinout_electrical_power_threshold was 10 at default , changed to 1000
spinout_mechanical_power_threshold was -10 at default, changed to -1000
after changed those two parameters for each axis, I never see the spinout detection that stop the motor.
I don’t know about how those parameter works(it seems unit is watt), but the motor does not spinout under load, rather it stops with another error. ( MOTOR_ERROR_UNKNOWN_CURRENT_MEASUREMENT)
It’s a safety detection. We calculate the mechanical power and compare it to the electrical power, if it’s too different then we error out. It’s designed to fault the odrive if it loses control of the motor. Changing the spinout parameters could be a safety issue, please only do so carefully.
@firtel, if you simply replaced the spinout error with the MOTOR_ERROR_UNKNOWN_CURRENT_MEASUREMENT error, what have you gained?
@Wetmelon, I understand that spinout could be a safet issue and it is great to be able to detect it, but we NEED to be able to change the parameters and continue operation in certain conditions. Almost any parameter could be considered a safety issue.
So, what is the proper way to disable spinout detection, so that operation can continue despite having some spin??
I have mostly resolved my issues just by using bigger tires and a little spring suspension on the lawnmower so the drive wheels do not become airborne over bumps.
@rhauff , When I got MOTOR_ERROR_UNKNOWN_CURRENT_MEASUREMENT, motor will stop until clearing the error. but this error seems only occurs when high load is applied to the motor. The error frequency of MOTOR_ERROR_UNKNOWN_CURRENT_MEASUREMENT is much less than spinout detection error at default spinout detection threshold.
@rosendhr I just looked at the source code controller.cpp, and found if I change this threshold, it will not get into statement that makes ERROR_SPINOUT_DETECTED.
Also spinout detection was not implemented at 0.5.1, So I just wanted to make it behavior like 0.5.1. The reason why I want to use 0.5.4 is to change PID gain from CAN BUS.
Can you please define “mechanical power”
My application is using motor as a force feedback controller, so it is constantly stalled, while I violently spin it the opposite way it wants to go, in some extreme conditions it is triggering SPINOUT_DETECTED.
Could my counter spinning be confusing spinout detection and it should be disabled or is it a bandwidth thing due to my 40K PPR encoder?
Ps:I have gone all out on reducing noise on the encoder and even installing a low latency differential signal receiver and have been monitoring it with a multi-channel scope, so I am pretty certain it is not an actual spinout nor noise.