This example shows how to control motor speed, torque and angle of BLDC gimbal motors using the Field Oriented Control (FOC) algorithm (or not) in C++/Python.
BLDC motors have become increasingly popular due to their smooth operation, high torque, and precise control. In this guide, we will explore the use of BLDC motors using SaraKIT, and compare them to other commonly used motors such as stepper motors and servos.
In this video, I demonstrate how easy it is to control BLDC gimbal motors, and also discuss the advantages and disadvantages of solutions based on servos or stepper motors. I also show the difference in controlling gimbal motors that have a decoder and those that do not.
We try to simplify the program code as much as possible, we show many examples of use. For example, what you see in the video above is implemented literally in a few lines of the program:
or knowing the diameter of the wheel, we can move the vehicle by a certain number of centimeters or meters (c++,python):
BLDCMotor_DriveMeters(uchar motorId, float centimeters, float speed, uchar torque, float WhellDiameter);