takijo
February 18, 2021, 12:15am
1
Hi, I struggle to run a brushed motor with ODrive.
I add a function to run brushed motor in motor.cpp.
I can run brushed motor if I set torque_setpoint directly(set as “12” in below picture).
But, I cannot do that if I set torque_setpoint through controller.
odrv0.axis0.controller.input_torque=12;
What is the problem?
My ODrive configuration is below.
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL;
odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH;
regard.
takijo
February 19, 2021, 2:55pm
2
Sorry, I had set vel_lim and torque_lim very small.
It works now.
1 Like
Awesome! Can you submit a pull request to the github?
takijo
February 21, 2021, 3:45am
4
OK, I submit a pull request after refactoring.
My code is made from this one.
Hello!
I have an application that requires control of one brushless motor and one brushed motor. I’ve already got an Odrive V3.6 driving the brushless motor, but I see that brushed motors don’t appear to be part of the software. I’m familiar with embedded C/C++ programming and github pull requests.
Would anyone be able to generally advise me on what would need to change? Commutation is easy, but I suppose auto-identification may need to change.
If someone could point me in the right direction…
1 Like
takijo
February 25, 2021, 3:46pm
5
@Wetmelon
I finished to refactring and I up my brushed control code.
My code supports torque,velocity,and position cotrol in closed loop.
you can use it in the same way as bldc motor.
Please note that this does not support sensorless control.
If you want to use
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_BRUSHED
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
and you can set the setpoint you like.
If not work well ,please tune PID gain.
2 Likes
This is great, I can’t wait to check it out!