Gimbal motor overheating

I keep seeing this question over and over, perhaps it is good to put it to rest, hopefully others will read this and try it before giving up in frustration.

My motor overheats, my motor vibrates but doesn’t move, my motor is griding and skipping, etc.

Remember that the voltage AND velocity for an open loop, no feedback algorithm for a particular unknown motor work in a very narrow band.


The best way to handle this is to attach two potentiometers to A0 and A1 or whatever analog signal input pins you are using, and scale them to the min/max voltage and velocity and read within the open velocity loop, and set the voltage and velocity within each loop iteration, then start tuning the motion manually.

Turn the voltage knob up a bit, turn the velocity knob a bit until you get some movement, then start slowly increasing both. Also, depending on the motor, some motors cannot just start turning when you apply fixed voltage, you need to “spin them up” first following that green curve, else if you just hit them with some voltage and try to spin them, you are just going up and down that narrow velocity green to orange region and eventually hit the red above and below and the motor stops, and the back EMF shoots into the driver and if your motor is really spun up to the top at a very high speed you kill the driver, because most hobby driver boards have absolutely no protection for all that mechanical energy which suddenly converts to EMF and uses the naked driver as a brake.

If I get some more time I’ll post sample code. Using manual physical knobs for voltage and velocity tuning is superior to any Serial command tuning because it gives you immediate haptic feedback.

Below is the STM32 code loop, to give you an idea.

void loop() {

  analog_read_A0 = analogRead(PA0);
  analog_read_A1 = analogRead(PA1);
 
  target_velocity = float(map(analog_read_A0, 0, 4096, 0, 10000))/100.0;
  
  target_voltage = float(map(analog_read_A1, 0, 4096, 0, 1200))/100.0;

  motor.voltage_limit = target_voltage;

  motor.move(target_velocity);
}
5 Likes