(Test setup using a micro gimbal and STorM32-BGC v0.17 controller board, and first demo video using this setup)

(Demo video showing the advantages of a 2nd IMU.)

Selected User videos

Acknowledgements
I am pleased that Martinez agreed to do the layout of the (first, v0.17) STorM32-BGC board. I was also ‘allowed’ to move around some wires, but the hard part of the routing was done totally by him, and he indeed did a fantastic job!
A special thanks goes to hexakopter/Dario, for his endless hours of testing.
I also want to thank various individuals for support in different ways: erickwesz, KingDaKa, Marc, yang/wdaehn, careyer&TheBlindHawks, Greg Covey, fpvberlin, GekoCH.

I. STorM32-BGC: Concept

The board was in principle designed to serve “larger duties”. The current firmware doesn’t yet make full use of its potential, but that’s why the project is not yet at its end (please check the current feature list). Hardware-wise the STorM32 controller provides these, partially innovative, features (for the current version v1.3):

Processor: 32-bit microcontroller STM32F103RC or STM32F103RB or STM32F405RG
The board has been designed to accomodate the 32 bit microcontrollers STM32F103RC or STM32F103RB, which run at 72 Mhz, as well as STM32F405RG, which runs at 168 MHz and in addition provides a floating point unit. Currently the STM32F103RC is recommended.

Motor drivers: TC4452
The TC4452 drivers are actually designed as Mosfet drivers, but it turned out that they are also well suited for our purposes. They allow for a maximum voltage of 18 V, and hence operation at up to 4 S. The data sheet specifies a maximum current of 13 A peak and 2.6 A continuous per motor phase, but that’s unrealistic (heat!). A realistic maximal value is 1.5 A per motor (for DFN8 packages); fortunately more is rarely needed. The disadvantage of the drivers is its limitation to 18 V or 4 S. The great advantage however is its – in comparison to discrete drivers – high fault tolerance (or, as it is expressed so nicely in the data sheet: “These devices are essentially immune to any form of upset.”).

Interfaces: USB, UART, and Bluetooth
The board provides a USB port, which shows up as virtual com port on the PC. It also provides the usual serial UART port (a USB-TTL adapter is needed to connect to a PC). In addition, the board can be equipped with a HC06 bluetooth module hence providing wireless connection (which is cool!).

Ports: PWM, Sum-PPM, Spektrum, Futaba S-Bus, IR Led, Joystick, Button, AUX
The board provides 7 ports (3 ports with STM32F103RB), which can be used as inputs or outputs for RC signals (PWM/Sum-PPM). These ports are 5 V tolerant. A Spektrum satellite as well as the Futaba S-bus is supported. In addition 3 further ports (7 ports with STM32F103RB) are available as general inputs/outputs (they too are 5 V tolerant). The board also provides 3 analog-digital converter inputs (3.3 V maximal), to connect e.g. a joystick. A further port is offered for connecting a button. Finally, one port is available for connecting a IR led.

Saftey
The motor drivers, the usage of the microcontroller ports, and the voltage supply are designed for a safe operation, inclusive a reverse voltage protection. Furthermore, a voltage devider is integrated for measuring the battery voltage; in case of e.g. too low voltage the motor drivers are shut down.

On-board 6DOF IMU
The STorM32 controller has a separate 6DOF IMU chip MPU6050 integrated on the board. Alternatively a second IMU can be connected to an additional I2C port. This should allow for exciting novel features in the future.

Magnetometer or 10DOF IMU
Instead of the common MPU6050 module mounted on the camera, also the GY-86 10DOF IMU module can be installed, which provides an additional magnetometer for compensating the drift in the yaw axis. However, in praxis, this doesn’t (yet) work really well because of some fundamental issues with the working principle. And in fact a magnetometer is not really needed..

TERMS OF USAGEThe STorM32-BGC board is open source hardware, under the terms of the TAPR Open Hardware License as published by the Free Hardware Foundation, see http://www.tapr.org/ohl.html. The Eagle and Gerber files can be downloaded below. The TAPR licence explicitely permits a commercial use, with some (easily accomplished) conditions, such as e.g. that copyright logos are not removed. The firmwares/softwares are subject to the licences/terms of usages given below.

Build
The placement of the parts is shown in the next picture, which gives the values of the resistors and capacitors. The other parts are not labelled since there shouldn’t be any confusion about their locations.

Build (v1.2)
The placement of the parts is shown in the next picture, which gives the values of the resistors and capacitors. The other parts are not labelled since there shouldn’t be any confusion about their locations.

Build (v1.1)
The placement of the parts is shown in the next picture, which gives the values of the resistors and capacitors. The other parts are not labelled since there shouldn’t be any confusion about their locations.

Build (v0.17)
The placement of the parts is shown in the next picture, which gives the values of the resistors and capacitors. The other parts are not labelled since there shouldn’t be any confusion about their locations.

(the two pictures to the right show a functional v0.17 board without MPU6050 but with optional Bluetooth module)

III. Firmware o323BGC

For how to use the firmware see the STorM32-BGC wiki. Here only some technical infos are given.

To the best of my knowledge the o323BGC firmware/STorM32-BGC board is the only functional free/open source 3-axis gimbal controller providing these features:

Firmware features (v0.46):

unique* 2nd IMU support, either on-board or external, for extended angle range, enhanced precision, and ultimative stability even in the pan modes

this is one of the best features: the motor direction is determined automatically… this removes quite a lot of issues in setting up the gimbal, in particular of the yaw axis

the IMU/MPU6050 module can be mounted in any of the 24 possible orientations, the GUI makes setting this up very simple

bluetooth: the firmware together with the GUI provides an auto configuration tool for a one-click setup of the optional on-board bluetooth module

battery voltage measurement: it is used for a lipo saver function (I wouldn’t want to be without that anymore!) and an automatic voltage drop compensation feature of the PID controller

pan/follow mode for each axis; the mode can be choosen individually, and it can be changed any time (“during a shoot”)

camera orientation can be controlled by external rc signals (PWM, sum-PPM) and/or a joystick in all three axes

external control of camera orientation can be adjusted precisely, speed limits as well as acceleration limits can be set

IR led remote control of camera: shutter, shutter delayed, video on/off, time sequences

Mavlink-type commands for a remote control of the camera by e.g. an app

the startup procedure includes a dedicated no-oscillation detection scheme, is crucial for a good gyro calibration in particular of the yaw axis (minimizes drift in the yaw axis)

quaternion based IMU algorithm (Mahony type), with unique* mechanism for suppresing the drift in the yaw axis without magnetometer

* “unique” means that the developped algorithm is not found in any other DIY/open source project, and provides advanced perfomance.

Motor PWM frequency: 23.4 kHz
The STM32 allows to choose the motor PWM frequency freely in a relatively large range. I have choosen 23.4 kHz. This corresponds to a resolution of the PWM signal of about 10.5 bits.

Control frequency: 0.67 kHz
The main loop is repeated every 1.5 ms.

Angular resolution: 10 bits
This number depends to some extend on how it is exactly calculated. In comparison to 8 bit BGC boards the angular resolution is however significantly larger.

TERMS OF USAGEThe o323BGC firmware is free (but not open source). Besides unlimited private use you are also granted the permission to use it for commercial purposes under the condition that (1) you don’t modify the firmware, e.g. remove or change copyright statements, (2) provide it for free, i.e. don’t charge any explicit or implicit fees to your customers, and (3) correctly and clearly cite the origin of the firmware and the project web page in any product documentation or web page.

IV. Windows GUI o323BGCTool

For the description of the Windows GUI o323BGCTool see the STorM32-BGC wiki. Here just some “teaser” screenshots of a preliminary version are shown to indicate the rich set of features:

TERMS OF USAGEThe o323BGCTool software is open source (but see below). Besides unlimited private use you are also granted the permission to use it for commercial purposes under the condition that (1) you don’t modify the software, e.g. remove or change copyright statements, (2) provide it for free, i.e. don’t charge any explicit or implicit fees to your customers, and (3) correctly and clearly cite the origin of the firmwares and the project web page in any product documentation or web page. The GUI software is based on libraries, which I am using since nearly 10 years and which I have modified over time in several places I can’t remember anymore. Furthermore, it is written in Perl using Win32::Gui, which is not maintained anymore. It would take me an enormous effort to build a working distribution. I hence don’t publish the complete code but just the “master” perl source file, which however contains all relevant code.

153 Kommentare

hello, dear OlliW , i use the futaba 14sg and R2008SB receiver can not use the sbus sinal to control the gimbal, but my flight controller can use the sbus,so i think the sbus sinal is no problem . but it is strange, i do not know what is the problem here.

I am building one of these: https://www.youtube.com/watch?v=n_6p-1J551Y (without the jump-up capability) for a graduate project, and I feel your BGC would be great for it since it combines a processor, IMU, and 3 motor drivers into a single package. However, my knowledge of programming microprocessors is limited to the Arduino. As such, I was wondering what IDE and programming language you use and if it would be at all possible to get a hold of any of your source code, such as the IMU and motor driver libraries. I’d also be interested in hearing you thoughts about using your BGC with my project.