by Yang/wdaehn and OlliW, with videos by alcurtis93, descriptions refer to firmwares v2.xx
You have a gimbal, the STorM32-BGC board, the IMU module(s) and all cables. So what is next? This page is intended to guide you through the essential steps, provide you with the most relevant information, and give references to the more specific pages in case you need to know more. The essential steps for a basic configuration are:
- 1 Opening Remarks
- 2 Ordering Information
- 3 Dos and Don'ts
- 4 Supported Gimbals
- 5 Calibration
- 6 Flashing Firmware
- 7 Checking Connection to the GUI
- 8 Hardware Setup
- 9 Basic Controller Configuration
- 10 First Startup
- 11 Next Step - PID Tuning
If you are new to gimbals, then the Gimbal 101 by rcgroups user mike_kelly is a recommended reading. It provides a wealth of information in a very readable way.
Things to order at minimum:
- STorM32-BGC board
- NT IMU module and matching cable
- USB-to-serial adapter
The STorM32-BGC board can be obtained from various sources. There are several hardware revisions around, among them unfortunately some suspicious versions. The 50x50mm-sized v1.1, v1.3 and v1.32 boards or the 40x25mm-sized v2.4 board are the safest options. The wide-spread v1.31 board is a good starting point too, but issues with its too weak 3.3V power were reported when used in an NT application (see Boards:GLB STorM32 v1.31). For other boards you may want to check the Boards page or internet. A v1.3 board is used exemplarily below.
Together with the board, you need also a NT IMU module and a matching cable. The plug on the v1.x STorM32 boards is a Picoblade connector (often, but incorrectly, called JST 1.25), while the plug on the v2.4 board is a JST SH connector (often called JST 1.0). The type of the matching plug on the NT modules depends on the manufacturer; the NT "standard" is a JST SH connector.
Finally, a USB-to-serial adapter with a matching cable is required for upgrading the STorM32 boards to the latest firmware. It can be any USB-to-serial adapter with FTDI or CP2102 or CH340 chip (also known as USB-TTL adapters), but NOT a PL2303-based adapter (for details please see FAQ: Which USB-TTL adapter should I use?). If you do not have one already, then buy one together with the other parts.
Related wiki articles:
- Where to buy STorM32 boards
- Where to get NT Modules
- FAQ: What are the differences between the boards?
- FAQ: Will my motors work with my STorM32 board?
- FAQ: Which USB-TTL adapter should I use?
Dos and Don'ts
Read and comprehend the Dos and Don'ts.
The STorM32 controller currently supports the following setups:
- 3-axis with camera IMU: Only one IMU, connected to the NT bus and mounted to the camera, is used.
- 3-axis with camera & on-board IMU: In addition to the camera IMU the STorM32 on-board IMU is used as 2nd IMU. The STorM32 board must be mounted on the gimbal above the yaw motor.
- 3-axis with camera & separate 2nd NT IMU: In addition to the camera IMU a further NT IMU module connected to the NT bus is used as 2nd IMU. The STorM32 board can be mounted anywhere, but the 2nd IMU must be mounted on the gimbal above the yaw motor.
- 3-axis with camera & separate 2nd I2C-based IMU: In addition to the camera IMU a further I2C-based IMU module connected to the I2C#2 port is used as 2nd IMU. The STorM32 board can be mounted anywhere, but the 2nd IMU must be mounted on the gimbal above the yaw motor.
- 2-axis: This is not officially supported but users figured out that the controller can be set up to work fine with a 2-axis gimbal (see How to use 2 axis gimbals, or check the rcgroups thread). Only a camera IMU is attached to the NT bus. A 2nd IMU is not supported in this configuration, and must be disabled.
In this article a 3-axis gimbal is assumed throughout.
For the following, a 2nd IMU is not needed, and should in fact be disabled. However, if you plan to use one, then you may want that it is installed and connected, so that thecan auto-determine its orientation.
The gimbal can be in the "down-hanging" or the "up-standing" position, i.e. should be in a pitch-roll-yaw configuration. The pitch-yaw-roll configuration is not officially supported by the STorM32 controller.
The accelerometers within the IMU modules need to be calibrated for optimal performance, e.g. to achieve a good horizon behavior. The calibration is most easily done with the gimbal not yet fully assembled. However, the gimbal will work also with uncalibrated sensors, i.e., the setup steps below do not require calibrated IMU sensors. You thus can freely decide if you prefer to do the calibration now or later.
Related wiki articles:
New firmware versions are released relatively frequently . So as first step it is recommended to flash the latest firmware.
Your board may or may not come with a firmware loaded; this depends on the vendor. In the first case you could skip the following steps and just install the GUI, but it is recommended to carry them out nevertheless, in order to benefit from the latest firmware and GUI. In the latter case you must go through the steps; without firmware the board obviously won't work. The following description applies to both cases, only the USB driver gets installed by Win 7/8/10 in different steps; see the red warnings. It is crucial to NOT interrupt the USB driver install process. It can take several minutes, so please be patient.
In order to flash a firmware onto v1.x boards the following steps are recommended (the flash procedure for the v2.x boards is different).
- Get your USB-TTL adapter to work by installing all Windows drivers as requested by the vendor (usually it should be auto-installed by Win).
- Unplug (!) the USB-TTL adapter.
- You don't have to worry if your USB-TTL adapter is a 5 V adapter or not, the pins on the STorM32 board which we are going to use are 5 V tolerant.
- Connect the USB-TTL adapter to the STorM32 board at the pins labeled RC (!). The firmware is NOT programmed via the UART port, NOT via the USB port, but via the RC pins.
- Connect the STorM32 board via USB to the computer. We are not using this connection yet, but we power the board via USB.
If the board has already a firmware installed and this is the first-time connection to your PC, then Windows will install the USB driver for the STorM32 board. This can take quite some time. Do NOT interrupt the install process.
- Download the newest firmware, unzip it and run the GUI, in this example the o323BGCTool_v222e.exe program. It does not matter what the currently installed firmware is; you use the GUI that comes with the firmware zip file. Get the zip file from here: Downloads.
- In the GUI select the tab on the very right hand side and select the hardware revision of your board. This does change the firmware file to be used in the field below. Double-check that the latest firmware version is selected.
- Double-check that in the field the option "System Bootloader @ UART1" is selected.
- Now select the COM port of the USB-TTL adapter. This is done with the selector in the middle of the screen, NOT the selector in the bottom left! Click on the drop down box to see all currently available COM ports. Since we do not have connected the USB-TTL adapter to the computer yet, the new one appearing when plugging in the USB-TTL adapter will be the one to use. Hence remember that list of ports to identify the new one in the next step.
- Plug in the USB-TTL adapter and click again on the selector to see the updated list of available COM ports. Select the new one.
- The v1.x boards have two buttons, the boot and reset button. When the board is started, the very first thing the microcontroller does is to check if the boot button is currently pressed. If it is, then the bootloader mode is entered, else normal operation starts. The best way of entering the bootloader mode is to press the boot button and while it is pressed to press and release the reset button to initiate a hard reset.
- Check if the board is in bootloader mode. If the board appears to be dead, i.e. both the green and red LEDs are off (the yellow LED is irrelevant), then it has successfully been brought into bootloader mode. If the green and red LEDs are blinking, then it is in normal operation and obviously the boot button was not pressed while the reset button was released.
- Now the board is listening on the RC pins for data, the USB-TTL adapter is connected, and the correct COM port of the adapter is selected, so you can click the button.
- A black DOS box will open and a sequence of downloading and verifying the firmware is shown, if everything is OK.
If this is a first-time flash of a "virgin" board, then Windows will start with installing the USB driver directly after the flash has finished. This can take quite some time. Do NOT interrupt the install process.
- After the flashing is completed, the board is reset. It is now fully operational and you may disconnect the USB-TTL adapter.
The process is also nicely described in this video by rcgroups user alcurtis93:
Quick Trouble Shooting:
- It is strongly recommended to also read the How to flash firmware page for trouble shooting.
- The board has no power - connect the board to the computer via USB to power it.
- The pins labeled UART are used for flashing - which is wrong, the RC pins should be used.
- Wrong serial port is selected in the tool.
- The black DOS box doesn't show up, e.g. because the firmware .zip file was not extracted.
- The above steps run and the black DOS box shows the first two [OK] messages, but the downloading and verifying message lines are not be present and a firmware is not flashed. Go to Removing Read&Write Protections.
- In case of troubles with the USB driver, consult the FAQ: Which drivers are needed for the USB?.
Related wiki articles:
Checking Connection to the GUI
Let's next check if the STorM32-BGC is indeed operational, and communicates with the GUI. Note that firmware and GUI versions must match.
It's a good occasion now to also learn about the FAQ: How does Read, Write, and Store work?., and buttons and to read
- If connected, disconnect a USB cable and/or USB-TTL adapter. Click on the COM port selector in the left bottom and memorize the list.
- Then plug in the STorM32 board via the USB cable to power it. When clicking on the drop down for the COM port selector, it should now show an additional one.
If the board has a firmware installed and this is the first-time connection via USB to your PC, then Windows will install the USB driver for the STorM32 board. This can take quite some time. Do NOT interrupt the install process.
- Go to e.g. the tab and click on or to validate the connection with the board.
Quick Trouble Shooting:
- Wrong COM port selected.
- Firmware and GUI version numbers do not match.
Related wiki articles:
- FAQ: Which drivers are needed for the USB?
- FAQ: How does Read, Write, and Store work?
- FAQ: How to enter precise parameter values?
The Camera IMU
The camera IMU needs to be mounted such that it measures all camera movements. Its actual position does not matter, behind the camera, on the pitch arm, below the camera,... anything will work. The only thing to watch out for is that its axes are aligned with the camera axes. Each axis has to be either horizontal or vertical. Just imagine that the sensor would measure that the horizon is level but because of a misalignment the camera does hang slightly to one side and hence the horizon in the video is not level.
Thanks to the NT concept, there are essentially no limits on how to wire the cables (in contrast to the older I2C-based approach, which often was prone to I2C errors).
Mounting the STorM32 Board
One of the outstanding features of the STorM32 board is its 2nd IMU support. In fact the board has such an IMU on-board already. To make use of it, the board needs to be mounted such that it measures the movements of the copter frame ("above" the yaw axis). The board's orientation does not matter, as long as it measures the frame's movements. In case this is not possible, either the 2nd IMU support has to be disabled, or another external IMU can be mounted to the frame and connected to the STorM32. As for the camera IMU, also the axes of the 2nd IMU have to be vertical or horizontal, respectively.
Related wiki articles:
Electric Connection and Insulation
The IMUs go to their corresponding plugs: The camera IMU, which must be a NT IMU module, goes to the NT bus, which is available at the picoblade connector labeled I2C next to the USB connector. If a 2nd IMU shall be used, then you have 3 options: (i) A further NT IMU module connected to the NT bus in parallel to the camera IMU. (ii) A conventional I2C-based IMU module connected to the I2C#2 connector on the backside of the board. (iii) Neither (i) nor (ii), in which case the on-board IMU is selected.
Make sure that the IMUs are mounted rigidly, so that they measure the actual position.
Comment: Check that the NT IMU modules are configured properly, i.e., that the ID solder bridge is closed for the 2nd IMU.
Comment: If starting from a "classic" (non-NT) STorM32 gimbal kit with an I2C IMU module, it can be necessary to rewire one end of the stock I2C cable to match the pinout of the NT bus. Releasing the pins on a picoblade connector is best done using a blunted needle, a craft knife, or a similar implement that can lift the release catch holding the crimped picoblade connector.
Related wiki articles:
Before using a gimbal, it is absolutely necessary to balance it and to ensure minimum resistance to rotations (friction in bearings, stiff cables, etc). The importance of these points cannot be overstressed. Any improper balance or resistance to rotation will make setting up the gimbal more difficult or even impossible. The goal shall be to rotate the camera in the gimbal and it should stay in that position by itself. In other words, the center of gravity should be in the center of all gimbal motor axes. Just imagine the camera's center of gravity is way below the pitch axis (looking with the camera up and down). It would act like a pendulum. So just because your copter does accelerate forward, the gimbal pitch motor has to hold against the mass inertia. You will need very strong motors and lots of energy which is a waste. On the other hand, if the gimbal is balanced properly, the motor only has to compensate the copter rotations, wind resistance and inertia when rotating the camera to point to somewhere else.
Related wiki articles:
Powering the Gimbal
For the motors the 5 V supply of the USB bus is too low. So, the motors will work only if a battery with sufficient voltage is connected. That is the reason why e.g. flashing the firmware is done using USB power only, as we do not want the motors to get power in that case. Connecting the PC via the USB cable while the board is powered via a battery is no problem at all. The order does not matter, first USB then battery, or vice versa, both will work. The battery connector can handle any voltage from 6 V to 18 V. The 3.3 V power supply on the STorM32 boards is typically relatively weak and may not be able to power all accessories, such as the NT modules, Bluetooth module, and Spektrum satellite. A 5 V BEC should then be used for powering the NT modules (see also the scheme in What is STorM32 NT about?). Power limitations seem to be reported more often for v1.31 boards than for v1.3 boards.
Before connecting any motor, it is a good idea to measure the resistance of the motor windings and housing. The three motor cables should have an electrical resistance of 12 Ohm or more and be completely isolated from the motor housing. If the resistance is too low, the amount of amps flowing through the motor might be too high for the motor drivers. The current capability of course depends on the type of STorM32 board/NT motor module which is used; the 12 Ohms are a good figure-of-merit. If one of the motor cables has a short to the motor housing, the entire gimbal and maybe even the frame gets the motor voltage.
The board has three connectors for the motors labeled Mot0, Mot1 and Mot2. The usage of the three connectors is
- Mot0: Pitch motor to point the camera up/down
- Mot1: Roll motor to stabilize the horizon
- Mot2: Yaw motor to turn the camera left/right
The motors have to be connected in this order to the motor ports. The three wires of a motor in contrast can be connected to its port in any order, here the order does not matter.
Alternatively, one of course can use NT motor modules. Any combination is possible, one motor module for pitch and Mot1, Mot2 for roll and yaw, or two motor modules for pitch and roll, and Mot2 for yaw, or whatever fits your needs best.
Comment: Ensure that the NT motor modules are properly configured, i.e., that the ID solder pads are closed/opened as needed.
Now all motors and the IMU(s) are connected, the battery power cable is ready, and its polarity double-checked. Your ready for the next steps.
Basic Controller Configuration
Now it's time to set the most important parameters, namely the IMU orientations and motor parameter values, which are located on thetab. Without that, the controller can't do even the most basic operations. Setting these parameters correctly by hand is difficult, however, the GUI provides the , which makes that very simple.
You should be prepared to know the number of poles of your motors, as well as be ready to connect a battery on demand (if you haven't already plugged in a battery).
In the following the gimbal MUST be at rest and NOT be moved at any time (unless you're specifically asked to do differently). Specifically, don't hold the gimbal in your hands. Also, the camera must be installed in the gimbal.
- Change to the tab. There you find the parameter fields for the IMU orientations, motor poles, motor directions and motor startup positions. To set them, run the by hitting the so named button.
- In the welcome screen you can select what to configure. The individual steps are grouped into Steps I and Steps II, and some finishing steps. You want to do all, and hence just click on .
- You are now asked to position the gimbal and camera. The gimbal should be in its standard default position. Adjust the camera manually such that it is level and points to the forward direction of your copter. You might not be able to do that perfectly because of the motor magnets, but you should get that better than to within 15°. Once the camera is in forward position click on .
- Now you are asked to pitch the entire frame inclusive camera downwards by 45°, as if you would want to film the ground in front of the copter. So you lift the frame such that both, frame and camera, point downwards. Importantly, the camera should not move and keep its position relative to the frame. If it does move then you should consider balancing the camera better. Also, avoid roll movements. Anyway, the goal in this step is to measure the effect of a downturn by 45° degree on the IMU's signals.
- Once the IMU orientations were determined, their values are shown and you can (should) put the gimbal back to normal position. When you can continue with the next step.
- The next important step is to set the motor pole counts for each motor. This is information you should get from the motor vendor. Data like N12P14 means 14 poles.
- On the next screen you are informed that all motor direction values will be set to “auto”. Click .
- This completes the settings of Steps I, and you can proceed with adjusting the parameters of Steps II.
- For the next steps to work, the gimbal has to be started up with enabled motors, and a battery must be connected. The GUI will check for that, and will ask you to connect a battery if required. Do as advised.
- The gimbal will now go through it's initialization steps, which you can follow in the screen. Please wait until it reaches the NORMAL state. You should see the green LED go solid, as well as hear a beep. You are reminded to keep the gimbal in normal position and at rest during all this.
If this step doesn't complete or an error occurs see the Quick Trouble Shooting section below, and please take any recommendations from there seriously.
- On the next screen you are informed that the motor direction values will be determined for all motors. Click .
- In a further screen you are informed that the motor startup positions for the pitch and roll motors are determined. Click .
- Now you are asked for another important step, namely to align the camera such as to point forward. Use the buttons to turn the camera until you're satisfied. The goal of this step is to align the camera with the 2nd IMU. A precise alignment is required for the 2nd IMU function to work correctly. You don't have to overdo however, a visual accuracy of the alignment is sufficient.
- This completes the settings of Steps II. What is left is to store all values in non-volatile memory, and to restart the gimbal.
- The results of the above steps can be seen in the tab, which got updated with the new IMU orientations and motor parameters. Also the motors are enabled, and the system is functional now.
Quick Trouble Shooting:
It may happen that the tool gets stuck in step 10. This generally indicates a serious problem with the setup, and not the controller. Examples are:
- Motors are not connected to the correct ports.
- Motors are not working properly because of e.g. a broken wire or bad connection.
- The IMU(s) do not work properly because they are connected to the wrong ports, or step 4 wasn't done correctly.
- I2C errors occur because of inappropriate routing of motor and I2C cables (consult also the I2C Error Compendium).
- PID parameters are totally wrong for the gimbal.
- Read also the Quick Trouble Shooting section in the next chapter!
Related wiki article:
After the above steps were completed, the STorM32 controller was reset and hence will start up now.
At startup, the controller goes through its initialization steps, which typically takes about 20 - 25 seconds (with configuration and tuning finished, the startup time can be cut down massively later with proper parameters). Note that the gimbal must not be moved until the initialization is finished and the controller has reached normal operation. This is indicated by the green LED going solid, and - if enabled - by a beep.
Initialization Steps: strtMOTOR - SETTLE - CALIBRATE - LEVEL - AUTODIR - RELEVEL - NORMAL
- : The motors are turned on, and moved into the position specified by the startup motor position parameters.
- : In order to calibrate, the gimbal has to be stable, it should not be moved. For a copter that is quite simple as the copter is on the ground. A handheld device needs to be put at a table to remain in position for a few seconds.
- : Calibrates the sensors. Takes a second or so.
- : This is the point where the motors will moved such to level the camera in pitch and roll axis. The yaw motor is under power, so you can feel some resistance, but it is not moved.
- : Here the motors are moved slightly around and from the sensor changes the controller determines the motor directions.
- : Since autodir moved the camera, it is quickly brought back in a horizontal position.
- : This is the final stage; the PID controller is activated and the gimbal is operational. Whatever you do, the camera should remain now stable.
Led Signals: The progress of the initialization is also indicated by the green LED on the board: During initialization it flashes with varying frequency. When initialization has finished and NORMAL state been reached, it goes solid. If beeps are activated, then the motors will emit a sound at the end of initialization, which can be very convenient. The current state of the controller can also be seen in status line the GUI, or the Data Display. The red LED blinks with a frequency of 1 Hz, except in certain fault conditions or special states, in which case it blinks very fast.
Operational Range: With a 2nd IMU enabled you can pitch and yaw the camera indefinitely. Without 2nd IMU, the pitch range is limited to +-45°. In both cases the roll angle is maximal +-80° or so. Larger roll angles are not possible since then the pitch and yaw axes become aligned, leading to gimbal lock.
Quick Trouble Shooting:
- The gimbal controller levels the camera, but only very, very slowly: The gimbal had been moved before the initialization has finished. Wait until the NORMAL state has been reach (green LED = solid) before moving the gimbal.
- The gimbal moves constantly around, never finding the level position: The pitch and roll motors are not connected to Mot0 (Pitch) and Mot1 (Roll) but reverse. Hence the control logic does measure that pitch has to be changed by -5°, applies the proper movement sequence to the motor but all that happens is that suddenly the roll value is off by -5°. Make sure the motors are connected correctly.
- Camera turns upside down or things like that: The IMU orientation is wrong.
- Gimbal starts shaking, makes high frequency noises and things like that: This would be normal as we have not yet tuned the PID values for the motor control loop. In case that happens, set for all motors the P, I and D values to very low numbers but not zero (P=0.10; I=5.0; D=0.0050) and write them to the board. This will cause the gimbal to be slow when correcting movements but at least you can prove all is functional.
- The motors receive power only briefly after startup but are when shut off and the red and green led start blinking fast, and the controller remains in LEVEL state: The controller could not level the camera within a certain time and hence shut off the motors for safety. This can happen for various reasons, such as that there is a mechanical constraint to the camera, one or more motors do not operate properly because of e.g. a broken motor wire or bad connections, or that the gimbal has not been assembled fully.
Next Step - PID Tuning
At this point the gimbal may already stabilize the camera. However, usually, the camera is not yet stabilized perfectly, since the PID parameters in thetab are not yet optimal. The gimbal may even start to show weird shaking or make high frequency noises, which indicates that the PID values are totally off. So, in any case the next step should be to tune the gimbal.
See the PID parameter Tuning Recipe for adjusting those.
You are also strongly encouraged to check out the Video Tutorials; there is a collection of some quite good videos available.
Comment: For good camera stability you need to spend at least a minimum time with PID tuning. The default PID values are chosen such that they work with most gimbals in the sense that the gimbal doesn't freak out. They therefore are necessarily "bad" in terms of good PID control or camera stabilization, respectively.