# Suggestion to control a gimbal bldc motor for positioning

I try to understand what the PID controller of a gimbal stabilizer boards (e.g Storm32BGC) does influence?

From the IMU we get position and velocity after sensor funsion. The input variable of the plant seems to be the speed of the gimbal motor (since its driven by 3 sine waves), not the voltage as usual in a brushed dc motor setup. So one can not just implement a torque control for holding the position. When I investigated the Storm32BGC, it looks like the PID does influence the position and the speed at the same time: Fast movements leads to fast speed corrections, but also the deviation from the stationary position leads to a given speed. This two speed signals seems to add up. Has anyone an Idea how this is done? I could not find any papers about this topic.

I have not looked at the specific implementation, but many of the more advanced BLDC control schemes offer torque control:

The torque of a BLDC motor is directly related to the total current passing through the coils. A typical Field Oriented Control (FOC) gimbal system would have two cascaded PID controllers:

1. Outer PID, which takes input angle from IMU and setpoint for the desired angle, and outputs torque signal.
2. Inner PID, which takes current measurements from motor coils, and setpoint for the desired current (calculated from torque), and outputs the voltage signals. This inner PID usually operates in a rotating coordinate system and a mathematical transform is used to calculate the 3-phase output voltages.

For general information on BLDCs and field-oriented control schemes in particular, this thesis by James Mevey is a great source.

• Thank you, that seems reasonable, but as I can see, also the leader in gimbal control systems, the alexmos 32bit controller, does not use a current measurement technique as I saw, when I analysed the board (no shunt resistors, virtual GND connected to GND), but I dont unterstand why. The only thing to overcome is the friction of the motor in the motor gimbal system, and I think this motor friction is bounded by the maximum speed. So it should be enough to give high enough current and so a constant torque to overcome the maximum motor friction. Am I right with this? Nov 15, 2016 at 8:17
• It seems to me that the motor friction is insignificant, and the motor torque is needed only to counter dynamic forces, such as both linear and rotational inertia and acceleration, as well as any off-center weight. It is sometimes possible to skip the current measurement and integrate the coil voltages to get approximate value of the current. This is especially true at slow speed, such as one might find in a direct-drive gimbal system.
– jpa
Nov 15, 2016 at 13:06
• Thats an interesting Ansatz, what do you mean by integrating the coil voltages? I have some input voltage and and a lookup table for the sine pwm signals. I know now the voltage for each coil, when I scale the input voltage with the actual value from the Sine table. I also know the resistance of each coil from the datasheet. When I neglect the impedence of the inductivity because of slow speed, I can directly calculate the current, right? Nov 15, 2016 at 13:50
• I don't think you can omit the inductance; that is why you need to integrate. But perhaps if the changes are very slow, you can ignore it. This is also a good reading: krex.k-state.edu/dspace/bitstream/handle/2097/1507/…
– jpa
Nov 15, 2016 at 14:20
• Thank you, that was very helpful. I still wonder how it is possible to control the motor without taking any current measurements into account. Lets say I can control my sinusoidal commutation at various speed, but the sinusoidal peak voltages stay the same all the time, so I have overall a constant torque. If my peak voltage is now high enough and so my torque, the motor should follow the field open loop, right? Now lets say I add a Mass to the motor shaft, on what it depends now that the motor still can follow my applied sinusoidal commutation? Nov 17, 2016 at 18:54