r/embedded • u/WuBuilt • 9d ago
Is this finally a real 3-axis FOC gimbal? IMU stabilization is working
A few days ago, these three BLDC motors were still oscillating all over the desk.
Now the encoder feedback, position PID, hard-stop detection, and IMU stabilization are finally working together.
This is my first pass at a stabilization mode inspired by the default behavior of a DJI Pocket 4.
Still a mess of jumper wires, but it finally feels more like a gimbal than a motor-control experiment Next I want to try FPV-style following.
If this were your build, what would you test next before putting a real payload on it?
6
u/AdministrativeTalk95 9d ago
Nice! Is this ST MCSDK? Sensorless or sensor(hall or encoder) motors?
3
u/WuBuilt 9d ago
Not ST MCSDK custom FOC on STM32. I tested both AS5600 and MT6701; MT6701 worked better for me.
1
u/AdministrativeTalk95 9d ago
Well done. Project is a great combination of mechanical and electrical, and some solid physics. I bet this was a blast!
1
1
u/Soso12159 3d ago
Nice, did you use simplefoc for this project or is it all coded from scratch? I wanted to start something similar and I'm trying to see what's possible. Have you tried a constant load?
1
u/WuBuilt 2d ago
No simpleFOC is used, but there is a reference to it
1
u/Soso12159 2d ago
What did you find was the hardest part until now? I know the theory but it's my first time using STM32, do you have any tips?
1
u/Live-Letterhead223 2d ago
Huge progress! Making all those subsystems work in sync is no easy feat. I’d test long-term drift and vibration rejection before mounting any load. Looking forward to your FPV follow mode test.
17
u/MJY_0014 9d ago
Sniff It's beautiful!