Gimbal motor mode


@tokol0sh has made a PR for the first revision of voltage control for high resistance motors (Gimbal type motors).

Awesome, thanks for your contribution. I’ll have a look, will take me a couple of days before I have a time slot to set up a gimbal motor test rig.
Just out of curiosity, what is the motor you are using? I see some interesting things like POLE_PAIRS is 1.

Also, I saw that you changed the position control to use the encoder directly. I see that you are using a 200PPR encoder? If so, you may wish to substantially reduce the PLL gain, and that may improve the smoothness. That said, I was actually conflicted myself weather to use the encoder directly or the PLL filtered version for the position control, I think the argument for both are valid.
Maybe you can describe the symptoms you were having with using the PLL pos as feedback? Maybe I can make a code hack to emulate a low resolution encoder on my rig, and test it out too.

Gimbal motors: Inductance out of range

The motor I have is a Maxon EC-max 2 pole (1 pair) motor.
The encoder is pretty low resolution and I will be getting a much better one soon (just what I had on hand)

The PLL pos feedback ‘problems’ might not have been real but rather side effects of poor current mode control. I will do some tests over the weekend now that I have voltage control going.


Gimbal motor for me too, 70mm ebay motor, no spec’s. Fitted with an AS5304 encoder and 40-pole pair ring, 1600ppr. It beeps at the start but thats all.


I hear you ;D
I have been busy setting up the paperwork to form a US company, which I am required to do right now.
I am really looking forward to when I can get back to development.
Gimbal mode will be my first task.
I’ll keep you posted.


I want to rewind my gimbal motor for high current, thats why your board is of interest, very high impulse torque,high accuracy , under 360 rotation . no gimbal motor has that, no driver has that. jumping robot legs.
good luck with the paperwork, I understand .


I have now implemented gimbal motor mode, please try it. In this branch only motor 0 is set up to be a gimbal motor.

Please check what’s different in the configuration of the motor struct.
Just like @tokol0sh did it, the tunings are reinterpreted such that Amps are interpreted as Volts, and then the control is done in voltage mode. Hence the default tunings are slightly different. You can still follow the tuning guide.

Thanks @tokol0sh for your contribution. I decided that for gimbal motors what we need is slightly different, i.e. bypass resistance and inductance measurement completely, and some other things.
I did leave provision for MOTOR_TYPE_LOW_CURRENT to handle motors of your type, but it’s not implemented yet. What I’m thinking is to include current feedback, but at a low gain, and to do full feed forward, including inductance, resistance and back-emf.

Gimbal motors: Inductance out of range


Gimbal motor mode revived my motor, “make flash” led to running test: motor slowly rotated forth and back accompanied by audible PWM sound. But there is another problem: USB connection seems not activated (no new USB device listed by “lsusb”, and produces “ODrive BulkDevice Not Found”). What may cause such situation?

I use Linux and changed only mandatory parameters:
ENCODER_CPR = 360*4,
brake_resistance=0f (no brake resistor)


Interesting. I will take a look at this.
Unfortunately I will be away for a week, so I can only take a look a week from now. Sorry about that!


Great it moves . Using the gimbal motor code, yes I now get the initial forward back slow movenemt calibration then it seems to snap and holds position. Great . need to look into the port, it doesnt move to position from the gitbash echo command. will investigate error codes. AS5304 with 44 pole ring Encoder_CPR 22404 , polepairs 12, brake 0.22 Ohms.


@beautifulsmall, Please tell us about your investigation