Designing a standard, open source gimbal controller

Hey guys,
the following is an idea that has been brewing in my head for some time now, and I’d like to get community feedback!

Cameras are getting more and more common on (autonomous) drones, and along with them, gimbals. The most common type of gimbal used these days is a brushless gimbal - it uses similar motors to what most UAVs do. However, they are operated in a specific way, using sinusoidal motor control to achieve precise control.

This usually requires a brushless gimbal controller. I have found that the majority of these controllers (at least the reliable ones) are very expensive and completely proprietary. There is, of course, STorM32BGC - and while I mean no ill will to the developer OlliW of STorM32, I have a few problems with it; the biggest being that while the hardware schematic is open source, the firmware is not.

My idea is as follows: design an affordable (~$50 max) open source 3 axis brushless gimbal controller board which is standards compliant in terms of MAVLink. Here are the basic requirements:

  • Completely open source (hardware and software)
  • 3 axis
  • Reliable (of course)
  • Affordably priced

For the hardware, I’m thinking to base it off of the STorM32 design and take it from there (although, make a few modifications as far as what communication protocols it handles).

As far as implementation of software:

  • Some RTOS (Nuttx would probably be a nice choice, although it seems complicated, would appreciate some advice)
  • Speaks MAVLink (Parameter protocol, command protocol, Gimbal protocol, maybe even camera trigger)
  • Configured via MAVLink Parameter protocol.
  • QGC should be able to connect to it just like to any MAVLink device, although in the long term a special tab or another program might be useful for configuration?
  • MAVLink gimbal protocol for controlling the gimbal
  • Of course, I’d also like to support direct control via RC/PWM, for those who need it.

I have don some research on sinusoidal control; I need to do more reading to figure out a proper implementation. However, the basic idea is just a control loop that reads IMU values and uses PID to move the gimbal to a desired position.

Brushless gimbals are the target, but it shouldn’t be too difficult to implement control for a servo based gimbal either…

Let me know what you guys think, if you would like to see something like this! The use case, while primarily for MAVLink based UAVs, isn’t strictly limited to that - it will probably work fine in other scenarios.

Thanks!

2 Likes

Sounds like a fun project. Note that the MAVLink protocol for gimbals was recently updated - check out https://docs.google.com/document/d/16pekKRXLN2FhlL9YNFP983cjfBKAsDwN0gOSks8USo4/edit#heading=h.puw0mav7olx3

The messages are in common.xml as WIP. The proper docs are under construction for the library.

FYI @JulianOes ^^^^

1 Like

@hamishwillee thanks for the link! The new gimbal protocol looks really cool, I’ll read it in depth when I get a chance.

@olliw Hello OlliW, I was wondering if you would be interested in this? Please don’t take anything I might have said in a bad light against STorM32BGC, I’m simply trying to further open source and the dronecode project! If you’re at all interested in pursuing this, please get in touch! Even if you just have any comments/suggestions, anything would be appreciated!

Ollie has had an enormous amount do do with the new gimbal protocol, so I’m sure he won’t take offence and will have great implementation advice (he already did a lot of work on implementing this in Storm32).

@hamishwillee Glad to hear it!

@olliw Any implementation advice would be greatly appreciated, especially on low level control!
I googled sinusoidal motor control, which you pointed me to a while back on your RC group (thanks a lot for that by the way). My friend and I are still confused about how your half bridge works on your board, and how that allows you to connect to either GND or VCC?

@coder_kalyan about motor control, you will sink all your time if yous start to write an ESC firmware from scratch. There is an awesome open source FOC firmware and reference hardware called VESC: https://vesc-project.com/

2 Likes

@coder_kalyan

hey, I just now have seen your post and your references to me. Sorry for that. (I don’t log in often here)

I for sure don’t take this as offense or as shining bad light on STorM32. The hardware I’ve made os and so anyone is absolutely free to do whatever she/he wants to do with that :).

As regards to if I would be interested in this here, I’d like to answer honestly: not really. I would be interested in everything related to the MAVLink protocol, but not the other points. I don’t really want to go into the reasons, but kindly ask you to accept this and assume that I do have my reasons.

Even this might not be what you were hoping for, I though however since you asked you deserve an answer and so I now did answer.

I wish you all the best with your project however, in all sincerity.

Cheers, Olli