Gimbal 3-Axis with STM32 and MPU6050

What are you developing?
Post Reply
Teppista99
Posts: 3
Joined: Tue Sep 07, 2021 12:02 pm

Gimbal 3-Axis with STM32 and MPU6050

Post by Teppista99 »

Hi I have been thinking about making a 3 axis gimbal with Arduino and an MPU6050 for some time now. I went around the internet for a while and saw that there is a project that manages to control three brushless motors only with arduino as if they were servos, making them a modification on the windings. In this project, however, many PWM signals, I believe 3, are required for each axis and therefore an arduino MEGA was used for the project. At home for another project I find myself an SMT32 that seeing from the pin-out has many PWM pins. Would anyone know if it is possible and how I should modify the code.



Here is the link: https://www.instructables.com/DIY-Brush ... h-Arduino/ 1
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Gimbal 3-Axis with STM32 and MPU6050

Post by ag123 »

The main thing about using brushless motors is due to the fast response and agility. Hence, I'd guess those are made with tightly tuned PID control with accelerometer / gyro inputs to correct the deviations. If a fast response isn't needed, I'd think 'ordinary' servos could do the job, that could make it significantly easier because you could kind of PWM the angle and is simpler.

Brushless motors aren't the easiest to control, as normally u'd need some sort of feedback on the motor position and vary the motor currents in the 3 phase combinations accordingly. It normally takes like 3 hall sensors in strategic positions in the motor to do that.
Teppista99
Posts: 3
Joined: Tue Sep 07, 2021 12:02 pm

Re: Gimbal 3-Axis with STM32 and MPU6050

Post by Teppista99 »

With the servant he trembles a little. I saw that in the attached link above there is a way to use the brushless motor as a servo by changing the internal configuration of the coils. And then I don't understand why three gyros are used and not just one.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Gimbal 3-Axis with STM32 and MPU6050

Post by ag123 »

If speed isn't an issue, you can try servos
there are some servos e.g. the sg90 variety which is moderately low cost from the 'usual' places Adafruit, Sparkfun, eBay, Amazon, AliExpress etc
there are various tutorials on the web on how to work them
https://www.electronics-lab.com/project ... r-arduino/

If you go from 'first principles', if a gyro accelerometer register a 30 degree tilt, perhaps u'd tilt the motor back up -30 deg, so by which point, it is 0 tilt again.
Don't expect speeds to match anywhere close to those agile brushless motors, those are quite a bit more difficult to control, more sensors and all. Those are also more prone to oscillations and require quite a lot of tuning on the PID control etc.
Teppista99
Posts: 3
Joined: Tue Sep 07, 2021 12:02 pm

Re: Gimbal 3-Axis with STM32 and MPU6050

Post by Teppista99 »

I have already tried to do a two axis gimbal with the servo, but it shakes.
Post Reply

Return to “Projects”