Getting Started: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
No edit summary
 
(490 intermediate revisions by 6 users not shown)
Line 1: Line 1:
You have a Gimbal, the StorM32-BGC board, the IMU and all cables. So what is next?
<span style="font-size:88%">''by Yang/wdaehn and OlliW, descriptions refer to firmwares v2.xx''</span>
This page is intended to guide you through the essential steps (based on the 0.56 firmware version) and contains references to the detail pages in case you need to know more. Basically the steps are
 
You have a gimbal, the STorM32 controller 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 want or need to know more.


<div class="toclimit-2">__TOC__</div>
<div class="toclimit-2">__TOC__</div>


== Ordering information ==
== Opening Remarks ==
 
If you are new to gimbals, then the [https://www.rcgroups.com/forums/showthread.php?2818200-Gimbals-101 Gimbal 101] by rcgroups user mike_kelly is a much recommended reading. It provides a wealth of information in a very readable way.
 
The following tutorial is for users of a conventional STorM32 NT setup (= non-encoder setup).
 
If you are using a T-STorM32 setup (= encoder setup), then not all info given here does apply. Please read the article [[Getting Started with T-STorM32]], and in case of conflicting info go with the info given there.
 
== Ordering Information ==
 
Things to order at minimum:
* STorM32 controller board (v1.3x, v3.3 or v4.1, and compatible boards; older boards are not supported)
* NT IMU module and matching cable
* USB-to-TTL adapter (not required for some v3.x and the v4.x boards, but always handy to have anyway)
 
Users of v3.x STorM32 boards (all variants) in addition need to order:
* three NT Motor modules or NT Motor-Encoder modules
 
The STorM32 controller board can be obtained from various sources. There are several hardware revisions around. The 50x50 mm-sized v1.3 and v1.32 boards or one of the various v3.3 boards (available in 40x25 mm and 25x25 mm sizes) or the 40x28 mm-sized v4.1 board are the best options. The wide-spread v1.31 board is a good starting point too, but when used in a NT setup issues with its too weak 3.3 V power were reported (see [[Boards#GLB_STorM32_v1.31|Boards: GLB STorM32 v1.31]]). For other boards you may want to check the [[Boards]] page or the internet. A v1.3 board is used exemplarily below.
 
{{COMMENT|Vendors sell all sorts of boards and call them v1.3, v1.31, or v1.32, but they may not be identical to the "legit" versions but show hardware variations. This can result in different behavior than described in this wiki, and thus user irritations, but that's how it is.}} 
 
In addition to the STorM32 controller board you also need a NT IMU module and a matching cable. The plug on the v1.3x STorM32 boards is a [http://www.molex.com/molex/products/family?key=picoblade&channel=products&chanName=family&pageTitle=Introduction&parentKey=wire_to_board_connectors Picoblade] connector (often incorrectly called JST 1.25). The standard plug on the v3.x and v4.x boards is a [http://www.jst-mfg.com/product/detail_e.php?series=231 JST SH] connector (often called JST 1.0); however, which plug is used on STorM32 derivatives depends a lot on the manufacturer.
 
Finally, users of a v1.3x STorM32 board also require a USB-TTL adapter with a matching cable for upgrading the STorM32 board to the latest firmware. It can be any USB-TTL adapter with FTDI or CP2102 or CH340 chip, but NOT a PL2303-based adapter (for details please see [[STorM32_FAQ#Which USB-TTL adapter should I use.3F|FAQ: Which USB-TTL adapter should I use?]]). If you do not happen to have one already, then buy one together with the other parts. Users of the Micro STorM32 board or STorM32 RaspberyPi Hat also need a USB-TTL adapter. Users of v3.x or v4.x STorM32 boards do not need a USB-TTL adapter (these boards do have the adapter integrated on board).
 
Users of v3.x STorM32 boards (all variants) need three NT Motor modules in addition (the v3.x boards do not have motor drivers on board).
 
'''Related wiki articles:'''
* [[Where to buy STorM32 boards]]
* [[Where to get NT Modules]]
* [[STorM32_FAQ#What_are_the_differences_between_the_boards.3F|FAQ: What are the differences between the boards?]]
* [[STorM32_FAQ#Will_my_motors_work_with_my_STorM32_board.3F|FAQ: Will my motors work with my STorM32 board?]]
* [[STorM32_FAQ#Which USB-TTL adapter should I use.3F|FAQ: Which USB-TTL adapter should I use?]]
 
== Dos and Don'ts ==
 
  {{WARNING|Read and comprehend the [[Dos and Don'ts]].}}
 
== Supported Gimbals ==


The StorM32-BGC board can be found at various shops. As of today there are three hardware revisions but frankly, they do not differ much. Hence nothing wrong with buying a v1.1 board, just keep in mind that some pins are placed at different places. Since the v1.3 hardware revision is the one you get everywhere these days, this page is using it as example.
The STorM32 controller currently supports the following setups:
Together with the board buy an IMU and matching cable from the same vendor. There are tons of IMUs available but the connectors can be different. The plug on the StorM board is a so called Picoblade connector.
And finally an USB-to-serial adapter with a matching cable is required for flashing the latest firmware. It can be any FTDI, CP2102, ..., but NOT a PL2303 based adapter. Again, if you do not have one already, I recommend getting this with the other parts. Personally I prefer those where the drivers come from the Windows Update Site automatically.


Things to watch out for when comparing prices
* '''''3-axis with camera IMU''''': Uses only one IMU (aka camera IMU), which is connected to the NT bus and mounted to the camera.
* Bluetooth module included? The StorM board is designed to solder an HC06 bluetooth module on it. Then you can run the config tool on your laptop via bluetooth. The range of these modules is quite low, so do not expect to use it to remote monitor the gimbal values in flight. If in future there will be a smartphone app available, this might be realyl cool for changing configurations, on the other hand, how often will you be doing that?
* '''''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.  
* Connectors soldered on it? Having connectors already soldered allows to simply plug in the motors and go. On the other hand, the RC and motor connectors are quite large, hence might be placed on the opposite side or motor cables being soldered directly to the board. Consider your preferences before buying.
* '''''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.  
* IMU and cable included already? Or does it come without the IMU?
* '''''2-axis and 1-axis''''': For some 2-axis gimbal configurations a 2nd IMU is supported (either on-board or separate 2nd NT IMU); for some not or only partially. For 1-axis gimbals a 2nd IMU is not supported. All 2- and 1-axis configurations can work with only a camera IMU. Unused motors must be disabled.


In this article a 3-axis gimbal is assumed throughout.


== Flash Firmware ==
In the following, a 2nd IMU is not needed. However, if you plan to use one, then you may want to have it installed and connected, so that the {{GUI|Configure Gimbal Tool}} can auto-determine its orientation, but it should be disabled for the following.


Because the StorM board has a very active community, new firmware versions with new enhancements are released on about monthly basis these days, so the first step will be to flash the newest firmware.
The gimbal should be in '''''pitch-roll-yaw''''' configuration. {{WARNING|''Other configurations such as pitch-yaw-roll or roll-pitch-yaw are not officially supported''}} by the STorM32 controller (for further details you may read [https://www.rcgroups.com/forums/showpost.php?p=39183865&postcount=10801]).
This description here assumes the board used was bought by a vendor with a firmware already uploaded and it should be updated only. Else refer to the [[How to flash firmware]] page.
Very quickly, there are three typical traps when flashing
# The board has no power
# The pins labeled UART is used for flashing instead of the RC labeled pins
# Wrong serial port is selected in the tool


In order to flash a new firmware the following steps are recommended.
The gimbal can be in the "down-hanging" or the "up-standing" position, it works perfectly fine either way.


# Get your USB-to-serial adapter to work by installing all windows drivers as requested by the vendor. [[File:Usb-to-uart-driver.png|none|300px]]
{{COMMENT|The support of 2- and 1-axis gimbals is somewhat varying. That is, they all can be operated, but due to the large manifold of operating situations testing is challenging and the firmware might not be totally bug free, and also features may be missing depending on the specific configuration. Please report any bugs or missing feature to the rcgroups discussion thread. Also note that the {{GUI|Configure Gimbal Tool}} does not support all possible gimbal configurations, but just a subset.}}
# Unplug(!) the USB-to-serial adapter again
# Connect the USB-to-serial adapter to the StorM board to the pins labeled RC(!). The firmware is not programmed via the UART labeled port, not via USB but via the RC pins. In other words, when the board is brought into the bootload mode, the RC pins are re-assigned to microcontroller's UART1, in normal mode these pins are assigned to the PWM timer. And the pins labeled as UART are the mcu's UART0. All of this is a security measure to avoid people programming the board via e.g. bluetooth and end up with an nonoperational board. [[File:Stom32-bgc-flashing-w-usbttladapter-connections-02.jpg|none|300px]]
# Connect the StorM board via USB to the computer. We are not using this connection yet but we power the board via USB. Although we do not need it yet, this might trigger Windows to install a driver for the STM processor's USB connection.
# Download the newest firmware, unzip it and run the exe file, in this example the o323BGCTool_v056.exe program. It does not matter what the current firmware installed is, you use the tool that comes with the firmware zip file. Get the zip file from here: [[Downloads]].
# In the tool select the {{GUI|Flash Firmware 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. [[File:Firmware_selector.png|none|300px]]
# In step two, the middle of the screen, there is a {{GUI|com port selector}} for flashing. NOT the com port selector at the bottom! Click on the drop down box to see all currently available com ports. Since we do not have connected the USB-to-serial adapter to the computer yet, the new one appearing when plugging in the adapter will be the one to use. Hence remember that list of ports to identify the new one in the next step. [[File:Firmware_comport1.png|none|300px]]
# Plugin the USB-to-serial adapter and click again on the drop down box of the serial connector for programming. Select the new one. [[File:Firmware_comport2.png|none|300px]]
# The board has two buttons, the boot and reset button. When the board is started, the very first thing the software does is checking if the boot button is currently pressed. If it is, the bootloader mode is entered, else the normal operation starts. The best way of entering the bootloader mode is hence to press the boot button and while it is pressed press and release the reset button to initiate a hard reset. [[File:Firmware-bootloadermode.jpg|none|300px]]
# Check if the board is in bootloader mode or in operational mode. If the boards appears to be dead, then it is brought into bootloader mode successfully, if the Leds are blinking, it is in normal operation and obviously the boot button was not pressed while the reset button was released. [[File:Firmware-bootloadermode-leds.jpg|none|300px]]
# Now the board is listening on the RC pins for serial data, the usb adapter is connected, the firmware tool is using the Windows COM port of the serial adapter, hence you can click on {{GUI|Flash Firmware}} button. [[File:Firmware_start_flash.png|none|300px]]
# A dos box will open and either return an error that the UART connection is not responding or a sequence of downloading and verifying the firmware is shown. [[File:Flash.png|none|300px]]
# After the reset your board is operational and can be reached via the USB cable. Hence disconnect both, the USB cable and the USB-to-serial adapter and click on the com port selector at the very bottom. Again, remember the list. [[File:Board read 0.png|none|300px]]
# Then plugin the StorM board via the USB cable to power it. Either the matching driver was installed already or it will be installed now. Either way once windows has installed the driver when clicking on the drop down for the com port selector, it should now show an additional one.[[File:Board read 1.png|none|300px]]
# Jump back to the {{GUI|Main tab}} and click on {{GUI|Read}} to validate the connection with the board. [[File:Board_read_2.png|none|300px]]


== Calibration ==


In case you have troubles with the StorM's USB driver, it can be found here: [http://www.st.com/web/en/catalog/tools/PF257938|STM download page].  
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. calibration is not mandatory for the setup steps to work. You thus can freely decide if you prefer to do the calibration now or later - as long as you do a calibration at some point in time!


'''Related wiki articles:'''
* [[Calibration]]


== Flashing Firmware ==


== Hardware setup ==
As first step it is recommended to flash the latest firmware.


=== The camera IMU ===
Your STorM32 board may or may not come with a firmware loaded; this depends on the vendor (nowadays they usually come with firmware loaded). If a firmware is already loaded then you could skip the flashing 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. If no firmware is loaded then you must go through the flashing steps; without firmware the board obviously won't work.


This IMU is to be mounted in a way so that it does measure 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 axis are aligned with the camera axis. Each axis has to be either horizontal or vertical. Just imagine, the sensor would read that the horizon is level but because of an misalignment the camera does hang slightly to one side and hence the horizon in the video is not level.  
During the flashing procedure the USB driver for the STorM32 board may be installed by Win 7/8/10/11; see the red warnings in the descriptions. {{WARNING|''It is crucial to '''not''' interrupt the USB driver install process''}}. It can take several minutes, so please be patient; let Windows do its job, for however long it takes.


=== Mounting the StorM board ===
The flashing procedure is quite different for the v1.3x and v3.x/v4.x STorM32 boards:
* v1.3x STorM32 boards: Follow the description in [[How_to_flash_v1.x_STorM32_boards#Flashing_Firmware_using_a_USB-TTL_Adapter|How to flash v1.x STorM32 boards: Flashing Firmware using a USB-TTL Adapter]]
* v3.x and v4.x STorM32 boards: Please refer to the article [[How to flash firmware]].
<!--
For v1.3x boards, the flashing process is also nicely described in this video by rcgroups user alcurtis93:
::{{#ev:youtube|HwaHjRw1Qqg|480}}-->


One of the outstanding features of the StorM board is its 2nd IMU support. In fact the board has such IMU itself already and to make use of it, the board should hence be mounted on the copter frame. The direction does not matter as long as it is the frame. In case this is not possible, either the 2nd IMU support has to be disabled or another external IMU is mounted to the frame and connected to the frame I2C connector.
'''Related wiki articles:'''
Again, the IMU axis have to be either vertical or horizontal.
* [[STorM32_FAQ#Which_drivers_are_needed_for_the_USB.3F|FAQ: Which drivers are needed for the USB]]


=== Electric connection and insulation ===
== Checking Connection to the GUI ==


All the IMUs go to their corresponding I2C plug, that is the I2C labeled Picoblade connector next to the USB connector for the camera IMU.
Next, let's check if the STorM32 controller is indeed operational, and communicates with the GUI. Note that the firmware and GUI versions must match. If they do not match, the GUI will tell you the versions it expects, but may refuse to work.
[[File:Stom32-bgc-v130-ports-and-connections-01.jpg|none|300px]]


On the backside of the board is a I2C#2 connector for the optional frame IMU.
This is a good occasion to also learn about the usage of the {{GUIFIELD|Read}}, {{GUIFIELD|Write}} and {{GUIFIELD|Write+Store}} buttons: Please read the [[STorM32_FAQ#How_does_Read.2C_Write.2C_and_Store_work.3F|FAQ: How does Read, Write, and Store work?]].


One thing we found out the hard way is to never mount the board or the IMUs with metal screws and distance sleeves, always use plastic ones. Not only does that enhance the probability of survival in case of an electric defect but also the I2C bus might use the entire metal frame and motors as antenna. Which leads to massive amounts of errors on the I2C bus. And without constant readings of the IMU positions the entire purpose of the gimbal is forfeit.
To check the connection, follow these steps:
Make sure the IMUs are mounted rigidly also so they measure the actual position.


=== Gimbal mechanics ===
# If a USB cable is connected to the STorM32 board, disconnect it. Click on the {{GUIFIELD|Port}} selector in the left bottom and memorize the list. [[File:Storm32-wiki-gettingstarted-checkconnection-1.jpg|none|360px]]
# Now plug in the STorM32 board via the USB cable to power it. When clicking on the drop down for the {{GUIFIELD|Port}} selector, it should show an additional one.<br> {{WARNING|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.}} [[File:Storm32-wiki-gettingstarted-checkconnection-2.jpg|none|360px]]
# Go to the {{GUI|Main}} tab and click on {{GUIFIELD|Connect}} or {{GUIFIELD|Read}} to validate the connection with the board. [[File:Storm32-wiki-gettingstarted-checkconnection-3.jpg|none|360px]]


Before using the gimbal, it is absolutely necessary to balance it and to ensure minimum resistance to rotations (friction in bearings, stiff cables, etc). 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 axis. 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, all the motor has to compensate is copter rotations, wind resistance and inertia when rotating the camera to point to somewhere else.
'''Quick Trouble Shooting:'''
* Wrong COM port selected.
* Firmware and GUI version numbers do not match.


=== Powering the Gimbal ===
'''Related wiki articles:'''
* [[STorM32_FAQ#Which_drivers_are_needed_for_the_USB.3F|FAQ: Which drivers are needed for the USB?]]
* [[STorM32_FAQ#How_does_Read.2C_Write.2C_and_Store_work.3F|FAQ: How does Read, Write, and Store work?]]
* [[STorM32_FAQ#How_to_enter_precise_parameter_values.3F|FAQ: How to enter precise parameter values?]]
 
== Hardware Setup ==
 
=== 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.


For the motors the 5V supply of the USB bus is not enough for sure. So the motors will work only if the battery connector provides the power. That is the reason why e.g. flashing the firmware is done via USB power only as we do not want to motors to get power at that time. The battery connector can handle any voltage from 6V to 18V. 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 reverse, both will work.
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).


=== Motor connector ===
=== Mounting the STorM32 Board ===


The board has three connectors for the motors labeled Mot0 to Mot2. Before connecting any motor, it might be a good idea to measure the resistance of the motor windings and the motor frame. The three motor cables should have an electrical resistance of 12 Ohm or more and 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 board driver to handle. And if one of the motor cables is connected to the motor housing, the entire gimbal and maybe even the frame gets the motor voltage.
One of the outstanding features of the STorM32 board is its 2nd IMU support. In fact, most STorM32 boards do have a 2nd IMU on-board already. To make use of it, the STorM32 board needs to be mounted such that it measures the movements of the copter frame ("above" the yaw axis). The board's location does not matter, as long as it measures the frame's movements. In case this is not possible, another external IMU can be mounted to the frame and connected to the STorM32 board. As for the camera IMU, also the axes of the 2nd IMU have to be vertical or horizontal, respectively.
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


{{COMMENT|T-STorM32 does not make use of a 2nd IMU, and the STorM32 board can thus be placed in any location or orientation which is convenient.}}


=== Summary ===
'''Related wiki articles:'''
* [[Using a 2nd IMU]]


Motors are connected, IMU(s) are connected, battery power cable is ready and its polarity doublechecked.
=== Electric Connection and Insulation ===


[[File:0connections.JPG|none|480px]]
The IMUs go to their corresponding plugs: The camera IMU, which must be a NT IMU module, goes to the NT bus. If a 2nd IMU shall be used, then you have 2 options: (i) A further NT IMU module connected to the NT bus in parallel to the camera IMU; (ii) if an extrenal 2nd IMU is not found the on-board IMU is selected, if available.


Make sure that the IMUs are mounted rigidly, so that they measure the actual position.


== First Configuration ==
{{COMMENT|Check that the NT IMU modules are configured properly, i.e., that the ID solder bridge is closed for the 2nd IMU.}}


The last steps in the firmware flashing section had been to check if the StorM32-BGC is operational.
{{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 [[What_is_STorM32_NT_about%3F|pinout of the NT bus]]. Releasing the pins on a picoblade connector is best done using a needle, a craft knife, or similar tool that can lift the release catch holding the crimped picoblade connector.}}
* Disconnect the USB cable and click on the com port selector at the very bottom. Remember the list. [[File:Board read 0.png|none|300px]]
* Plugin the StorM board via the USB cable to power it. Either the matching driver was installed already or it will be installed now. Either way once windows has installed the driver when clicking on the drop down for the com port selector, it should now show an additional one.[[File:Board read 1.png|none|300px]]
* Jump back to the {{GUI|Main tab}} and click on {{GUI|Read}} to validate the connection with the board. [[File:Board_read_2.png|none|300px]]


Now it's time to set the most important parameters, namely the IMU orientations and motor parameter values. Without that the controller can't perform the basic operations even.
::[[File:Storm32-nt-v130-ports-and-connections-01.jpg|600px]]
With the Gimbal Configuration tool this is very simple.


# Change to the {{GUI|Gimbal Configuration tab}}. There you can enter the values for the motor poles, the motor directions and the IMU orientation manually, or run the {{GUI|Configure Gimbal Tool}}. [[File:Gimbal config tool 1.png|none|300px]]
'''Related wiki articles:'''
# In the welcome screen you can select what to configure, we want to do all and hence click on {{GUI|Continue}}. [[File:Gimbal config tool 2.png|none|300px]]
* [[Dos and Don'ts]]
# Next we are asked to position the gimbal to look forward. So you manually adjust the camera so that it points into the forward direction of your copter. You might not be able to do that perfectly because of the motor magnets, 15° is more than enough. Once the camera is in forward position click on {{GUI|Continue}}. [[File:Gimbal config tool 3.png|none|300px]] [[File:|none|300px]]
* [[Pins and Connectors]]
# Now you are asked to pitch the frame, the entire copter, by 45° downward, as if the goal would film the ground in front of the copter. So you lift the frame accordingly and both, frame and camera should point downwards. To be more precise, the camera should not move relative to the frame. If it does you should consider balancing the camera better. Anyway, the entire goal in this task is to get a clear reading of which axis of each IMU are all impacted by this 45° degree movement. The IMU does measure the accelarion values, as we are static its only acceleration is the earth gravity. For example the reading in the forward position might be x/y/z=0g/1g/0g. When pitching downward, the value could change to 0.7g/0.7g/0g and therefore we know that the pitch axis is along the z axis, its reading did not change (much). This plus the +/- sign allows to derive the IMU orientation by simply measuring it. [[File:Gimbal config tool 4a.png|none|300px]] [[File:|none|300px]]
* [[Pins and Connectors of NT Modules]]
# Once the IMU orientation was read, the values are shown and we can continue with the next step. [[File:Gimbal config tool 4.png|none|300px]]
# This is just informational that the motor direction values are all being set to Auto. [[File:Gimbal config tool 5.png|none|300px]]
# Last step is the motor pole counts for each motor. [[File:Gimbal config tool 6.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:Gimbal config tool 1.png|none|300px]]
[[File:|none|300px]]


=== Gimbal Mechanics ===


Before using a gimbal, it is absolutely mandatory to balance it and to ensure minimum resistance to rotations (friction in bearings, stiff cables, etc). {{WARNING|''The importance of these points cannot be overstressed''}}. Any improper balance or resistance to rotation will compromise the performance of the gimbal, and 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:'''
* [[Tuning_Recipe#Balancing_the_Gimbal|Balancing the Gimbal]]


The tab called {{GUI|Configure IMU}} is meant to support you in setting up the IMU orientation. There are so many different ways in which you can attach the IMU to your camera (above the camera, below, at the backside, with the axis up, down, left, right, and so on) but the controller does not know. Hence you have to tell.
=== Powering the Gimbal ===


'''It is of outmost importance to set the IMU orientation correctly, else the controller has no chance to work correctly. Please double and triple check that you got the IMU stetting right!'''
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. This is btw the reason why the firmware should be flashed using USB power only, as we do not want the motors to get power in this 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.  


=== Determining the IMU Orientation ===
The 3.3 V power supply on the v1.3x 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%3F]]). Power limitations seem to be reported more often for v1.31 boards than for v1.3 boards.
The first thing is to ensure that all motors are shut off to avoid any motor movements. Then investigate the IMU board, there is usually an arrow printed on it for the x axis. If not, you may use the little dot marker on the IMU chip as reference (see the [[Getting_Started#Appendix|Appendix]] below). Now hold the gimbal and camera in front of you, as if you would be taking a picture. {{GUIPARAM|Up}} refers to the top of the camera, {{GUIPARAM|forward}} to its front with the lense, and {{GUIPARAM|right}} to the right-hand side of the camera. The questions to answer in the IMU orientation dialog are where the z axis and x arrow point to.


The IMU's z axis points outwards of the surface of the IMU chip, i.e., comes straight out of the IMU board. In the example below, as the IMU board is mounted upside down, it points downwards the camera, so you specify the {{GUI|z axis points}} {{GUIPARAM|down}}. For the x axis we use the printed arrow on the IMU board. In the example below it is pointing in the camera's forward (shooting) direction, hence in the GUI you set that the {{GUI|x axis points}} {{GUIPARAM|forward}}. The little graphic on the right displays your setting, i.e., the IMU's x-y-z axes with respect to the camera's up-right-forward orientations.
This does not apply to v3.x and v4.x STorM32 boards; they do have a 5 V BEC capable of 0.6 A (or more) on board.


To send these setting to the board click on the {{GUI|Write}} button. In order to make the changes permanent, the menu option {{GUI|Store to EEPROM}} can be used. Alternatively, click on the check box next to the {{GUI|Write}} button, which causes the button label to change to {{GUI|Write+Store}}, and hit the button. Both methods are fine.
=== Motor Connectors ===


Please note that the {{GUI|Configure IMU}} page is for your support only. Its sole purpose is to help you determining the IMU orientation index, here no. 15, and writing it into the {{GUI|Imu Orientation}} parameter field located on the {{GUI|Gimbal Setup}} tab.
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 about 10 Ohm 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 or NT Motor module which is used; the 10 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 and the electronics may be destroyed.


{{COMMENT|In older firmware versions (v0.27 and lower) the meaning of {{GUIPARAM|right}} and {{GUIPARAM|left}} is reversed. The orientation index number however has not changed.}}
The v1.3x and v4.1 STorM32 boards have three connectors with three pins each 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


[[File:6configureimu.png|480px]]
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.


[[File:3imuorientation.JPG|480px]]
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.


=== Checking the IMU Orientation ===
Users of a v3.x STorM32 board, or of T-STorM32, need to use NT Motor modules in any case.
In order to ensure a correct IMU Orientation you should test it. Write the setting to the controller (temporarily or into the EEPROM) and then click on the {{GUI|Data Display}} button. This will open a realtime monitor window. In the top you can see the current Pitch, Roll, and Yaw angles once you did click on {{GUI|Start}} in the window.


As the motors are (hopefully) disabled still, you can move the camera by hand. The following behavior must be observed:
{{COMMENT|Ensure that the NT Motor modules are properly configured, i.e., that the ID solder pads are closed/opened as needed.}}
* When you tilt the camera downwards (lens points to the ground), the Pitch value has to get more positive (the red line in the middle panel of the Data Display has to move upwards).
* When you roll the camera like in flying a right turn (clockwise when standing behind the camera), the Roll value has to get more positive (the green line in the middle panel of the Data Display has to move upwards).
* When you rotate the camera around the yaw axis anti-clock wise, the Yaw value hast to get more positive (the blue line in the middle panel of the Data Display has to move upwards).


If you do not observe that, then go back and repeat the IMU orientation setting.
=== Summary ===


[[File:9datadisplay.png|480px]]
Now all motors and the IMU(s) are connected, the battery power cable is ready, and its polarity double-checked. You are ready for the next steps.


=== Appendix ===
::[[File:Storm32-wiki-a-1-02.jpg|480px]]
In case your IMU board has no arrow printed on it or you are uncertain then you can use the white dot in one of the corners on the IMU chip (MPU6050) as well for the orientation. In the diagram below the axes and their orientation in relationship to the dot are shown.  


As said before, the z axis comes out of the top surface of the chip and the x axis points away from the dot. Check the chip labels, the x axis runs in the reading direction of the labeling.
== Basic Controller Configuration ==


The diagram below provides some examples of the IMU orientation.
{{COMMENT|T-STorM32 users please refer to the article [[Getting Started with T-STorM32]]}}.


[[File:5IMUorientation.JPG|600px]]
{{COMMENT|The {{GUI|Configure Gimbal Tool}} can be used also for 2- and 1-axis gimbals; in the following a 3-axis gimbal is assumed.}}


== Motor Settings ==
Now it's time to set the most important parameters, namely the IMU orientations and motor parameter values, which are located in the {{GUI|Gimbal Configuration}} tab. 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 {{GUI|Configure Gimbal Tool}}, which makes this very simple.


''the procedure is still valid, but an easier procedure is available in v0.56''
Again: The parameters in the {{GUI|Gimbal Configuration}} tab must all be configured correctly; otherwise the gimbal will just not work correctly.


For the motor settings there is a separate tab as well, the {{GUI|Configure Motors}} tab. Again, ensure that the motors are disengaged.
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 example below the Mot0 port on the controller is connected to the Pitch motor, which lets the camera look up or down. Mot1 is connected to the Roll motor, which keeps the horizon level. Remember, Mot2 has to be used for Yaw always.
{{WARNING|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. {{WARNING|Also, a camera must be installed in the gimbal.}} Without camera gimbals don't work properly.  


The motor poles are best read from the motor's datasheets found in the internet. A common value is 14 poles for smaller motors. Large motors may have 22 poles or even more. Self-wound motors often have 12 poles.
# Change to the {{GUI|Gimbal Configuration}} tab. There you find the parameter fields for the IMU orientations, motor poles, motor directions and motor startup positions. To set them, run the {{GUI|Configure Gimbal Tool}} by hitting the so named button. [[File:Storm32-wiki-c-1-01.jpg|none|360px]]
# 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 {{GUIFIELD|Continue}}. [[File:Storm32-wiki-c-2-01.jpg|none|360px]]
# 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 {{GUIFIELD|Continue}}. [[File:Storm32-wiki-c-3-01.jpg|none|360px]] [[File:Gimbal config tool forward.jpg| none | 500px]]
# 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. <!--The IMUs do measure the acceleration values, and as we are static its the earth gravity. For example, the reading in normal position might be x/y/z = 0 g/1 g/0 g. When pitching downwards, the values may change to 0.7 g/0.7 g/0 g, and from that we know the IMU's orientations.--> [[File:Storm32-wiki-c-4-01.jpg|none|360px]] [[File:Gimbal config tool 45.jpg| none | 500px]]
# 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. [[File:Storm32-wiki-c-5-01.jpg|none|360px]]
# 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. [[File:Storm32-wiki-c-6-01.jpg|none|360px]]
<!--
# We are now informed that all motor direction values will be set to {{PARAMVALUE|auto}}. [[File:Storm32-wiki-c-7-01.jpg|none|360px]]-->
# On the next screen you are informed that all motor direction values will be set to {{PARAMVALUE|auto}}. Click {{GUIFIELD|Continue}}.
# This completes the settings of '''Steps I''', and you can proceed with adjusting the parameters of '''Steps II'''. [[File:Storm32-wiki-c-8-01.jpg|none|360px]]
# 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. [[File:Storm32-wiki-c-9-01.jpg|none|360px]]
# 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.<br>{{WARNING|If this step doesn't complete or an error occurs see the [[#Basic_Controller_Configuration_Quick_Trouble_Shooting|Quick Trouble Shooting]] section below, and please take any recommendations from there seriously.}}  [[File:Storm32-wiki-c-10-01.jpg|none|360px]]
<!--
# We are now informed that the motor direction values will be set for all motors. [[File:Storm32-wiki-c-11-01.jpg|none|300px]]
-->
# On the next screen you are informed that the motor direction values will be determined for all motors. Click {{GUIFIELD|Continue}}.
<!--# We are now informed that the motor startup positions for the pitch and roll motors are set. [[File:Storm32-wiki-c-12-01.jpg|none|300px]]
-->
# In a further screen you are informed that the motor startup positions for the pitch and roll motors are determined. Click {{GUIFIELD|Continue}}.
# 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. [[File:Storm32-wiki-c-13-01.jpg|none|360px]]
# This completes the settings of '''Steps II'''. What is left is to store all values in non-volatile memory, and to restart the gimbal. [[File:Storm32-wiki-c-14-01.jpg|none|360px]]
# The results of the above steps can be seen in the {{GUI|Gimbal Configuration}} tab, which got updated with the new IMU orientations and motor parameters. Also the motors are enabled, and the system is functional now. [[File:Storm32-wiki-c-16-01.jpg|none|360px]]


The last setting of importance is the motor direction. However, the STorM32 controller provides you an {{GUIPARAM|auto}} setting, which is recommended to be used. With {{GUIPARAM|auto}} the initialization phase of the gimbal takes few seconds longer - who cares (you can avoid that later if you like).


With these few steps the most important fields in the {{GUI|Gimbal Setup}} tab are properly set, and you are ready to go!
<span id="Basic_Controller_Configuration_Quick_Trouble_Shooting">'''Quick Trouble Shooting:'''</span><br>
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 [[#First_Startup_Quick_Trouble_Shooting|Quick Trouble Shooting]] section in the next chapter!


[[File:7configuremotors.png|480px]]
'''Related wiki article:'''
* [[Quick Start Guide]]


== First Startup ==
== First Startup ==


Once you have completed the above steps, the motors can be turned on. In the {{GUI|Expert}} tab check that the {{GUI|Pitch Usage}}, {{GUI|Roll Usage}} and {{GUI|Yaw Usage}} parameter fields are all set to {{GUIPARAM|normal}} (the default is {{GUIPARAM|disabled}}). If not, set them to "normal" (or click on {{GUI|Enable all Motors}}), and write and store the changed setting.
After the above steps were completed, the STorM32 controller was reset and hence will start up now (the following applies to any startup however).
 
At startup, the controller goes through its initialization steps, which typically takes about 20 - 25 seconds (after configuration and tuning has been finished, the startup time can be cut down massively with proper parameter settings). 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
* {{PARAMNAME|strtMOTOR}}: The motors are turned on, and moved into the position specified by the startup motor position parameters.
* {{PARAMNAME|SETTLE}}: 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.
* {{PARAMNAME|CALIBRATE}}: Calibrates the sensors. Takes a second or so.
* {{PARAMNAME|LEVEL}}: This is the point where the motors are moved such as to level the camera in the pitch and roll axis. The yaw motor is under power, so you can feel some resistance, but it is not moved.
* {{PARAMNAME|AUTODIR}}: Here the motors are moved slightly around and from the sensor changes the controller determines the motor directions.
* {{PARAMNAME|RELEVEL}}: Since autodir moved the camera, it is quickly brought back in a horizontal position.
* {{PARAMNAME|NORMAL}}: 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 the 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 either case the roll angle is limited to maximal +-80° or so. Larger roll angles are not possible due to [http://en.wikipedia.org/wiki/Gimbal_lock gimbal lock] (either mechanically or electronically).
 
{{COMMENT|T-STorM32 gimbals have a much larger operational range, and do not need a 2nd IMU.}}
 
'''Yaw Axis Alignment''':
 
With a 2nd IMU enabled, it is very important that the camera is aligned properly with respect to the gimbal support '''''before''''' the gimbal is powered up. You typically do this by hand. It is sufficient to have the camera aligned to within typically +-25° (for a 14 pole yaw motor). When the controller is powered up, it first moves the motors, and the camera should now precisely point forward (to within a degree or so).


{{COMMENT|If you are using the STorM32-BGC for a 2 axis gimbal, set {{GUI|Yaw Usage}} to {{GUIPARAM|disabled}} (and maybe set {{GUI|Yaw P}}, {{GUI|Yaw I}}, and {{GUI|Yaw D}} to zero).}}
{{COMMENT|Does not apply to T-STorM32 gimbals, these do nicely align the camera themselves from any starting position.}}


Now connect a battery to the controller (it is assumed that you did follow the above advice of powering the board via USB). The gimbal should go through a number of initialization steps (the green led blinks, with increasing frequency), and finally should start with normal operation (the green led goes solid).  
<span id="First_Startup_Quick_Trouble_Shooting">'''Quick Trouble Shooting:'''</span>
* 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.


{{COMMENT|During the initialization the gimbal needs to be at rest.}}
== Next Step - PID Tuning ==


In short, after power up keep the gimbal at rest until the green led goes solid. Holding the gimbal e.g. in the hands is not keeping it at rest.
At this point the gimbal may already stabilize the camera. However, usually, the camera is not yet stabilized perfectly, since the PID parameters in the {{GUI|PID}} tab 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.


== Next step - PID Tuning ==
See the PID parameter [[Tuning Recipe|Tuning Recipe]] for adjusting those.


At this point the gimbal may already stabilize the camera. However, usually, the camera is not yet stabilized perfectly, or the gimbal may even start to show weird shaking or make high frequency noises. This indicates that the PID values in the {{GUI|Main}} tab are not proper.
You are also '''''strongly''''' encouraged to check out the [[Video Tutorials|Video Tutorials]]; there is a collection of some quite good videos available.


See the PID parameter [[Tuning Guide|Tuning Guide]] for adjusting those.
{{COMMENT|{{WARNING|'''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.}}

Latest revision as of 18:39, 18 June 2024

by Yang/wdaehn and OlliW, descriptions refer to firmwares v2.xx

You have a gimbal, the STorM32 controller 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 want or need to know more.

Opening Remarks

If you are new to gimbals, then the Gimbal 101 by rcgroups user mike_kelly is a much recommended reading. It provides a wealth of information in a very readable way.

The following tutorial is for users of a conventional STorM32 NT setup (= non-encoder setup).

If you are using a T-STorM32 setup (= encoder setup), then not all info given here does apply. Please read the article Getting Started with T-STorM32, and in case of conflicting info go with the info given there.

Ordering Information

Things to order at minimum:

  • STorM32 controller board (v1.3x, v3.3 or v4.1, and compatible boards; older boards are not supported)
  • NT IMU module and matching cable
  • USB-to-TTL adapter (not required for some v3.x and the v4.x boards, but always handy to have anyway)

Users of v3.x STorM32 boards (all variants) in addition need to order:

  • three NT Motor modules or NT Motor-Encoder modules

The STorM32 controller board can be obtained from various sources. There are several hardware revisions around. The 50x50 mm-sized v1.3 and v1.32 boards or one of the various v3.3 boards (available in 40x25 mm and 25x25 mm sizes) or the 40x28 mm-sized v4.1 board are the best options. The wide-spread v1.31 board is a good starting point too, but when used in a NT setup issues with its too weak 3.3 V power were reported (see Boards: GLB STorM32 v1.31). For other boards you may want to check the Boards page or the internet. A v1.3 board is used exemplarily below.

Comment: Vendors sell all sorts of boards and call them v1.3, v1.31, or v1.32, but they may not be identical to the "legit" versions but show hardware variations. This can result in different behavior than described in this wiki, and thus user irritations, but that's how it is.

In addition to the STorM32 controller board you also need a NT IMU module and a matching cable. The plug on the v1.3x STorM32 boards is a Picoblade connector (often incorrectly called JST 1.25). The standard plug on the v3.x and v4.x boards is a JST SH connector (often called JST 1.0); however, which plug is used on STorM32 derivatives depends a lot on the manufacturer.

Finally, users of a v1.3x STorM32 board also require a USB-TTL adapter with a matching cable for upgrading the STorM32 board to the latest firmware. It can be any USB-TTL adapter with FTDI or CP2102 or CH340 chip, but NOT a PL2303-based adapter (for details please see FAQ: Which USB-TTL adapter should I use?). If you do not happen to have one already, then buy one together with the other parts. Users of the Micro STorM32 board or STorM32 RaspberyPi Hat also need a USB-TTL adapter. Users of v3.x or v4.x STorM32 boards do not need a USB-TTL adapter (these boards do have the adapter integrated on board).

Users of v3.x STorM32 boards (all variants) need three NT Motor modules in addition (the v3.x boards do not have motor drivers on board).

Related wiki articles:

Dos and Don'ts

 Read and comprehend the Dos and Don'ts.

Supported Gimbals

The STorM32 controller currently supports the following setups:

  • 3-axis with camera IMU: Uses only one IMU (aka camera IMU), which is connected to the NT bus and mounted to the camera.
  • 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.
  • 2-axis and 1-axis: For some 2-axis gimbal configurations a 2nd IMU is supported (either on-board or separate 2nd NT IMU); for some not or only partially. For 1-axis gimbals a 2nd IMU is not supported. All 2- and 1-axis configurations can work with only a camera IMU. Unused motors must be disabled.

In this article a 3-axis gimbal is assumed throughout.

In the following, a 2nd IMU is not needed. However, if you plan to use one, then you may want to have it installed and connected, so that the [GUI:Configure Gimbal Tool] can auto-determine its orientation, but it should be disabled for the following.

The gimbal should be in pitch-roll-yaw configuration. Other configurations such as pitch-yaw-roll or roll-pitch-yaw are not officially supported by the STorM32 controller (for further details you may read [1]).

The gimbal can be in the "down-hanging" or the "up-standing" position, it works perfectly fine either way.

Comment: The support of 2- and 1-axis gimbals is somewhat varying. That is, they all can be operated, but due to the large manifold of operating situations testing is challenging and the firmware might not be totally bug free, and also features may be missing depending on the specific configuration. Please report any bugs or missing feature to the rcgroups discussion thread. Also note that the [GUI:Configure Gimbal Tool] does not support all possible gimbal configurations, but just a subset.

Calibration

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. calibration is not mandatory for the setup steps to work. You thus can freely decide if you prefer to do the calibration now or later - as long as you do a calibration at some point in time!

Related wiki articles:

Flashing Firmware

As first step it is recommended to flash the latest firmware.

Your STorM32 board may or may not come with a firmware loaded; this depends on the vendor (nowadays they usually come with firmware loaded). If a firmware is already loaded then you could skip the flashing 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. If no firmware is loaded then you must go through the flashing steps; without firmware the board obviously won't work.

During the flashing procedure the USB driver for the STorM32 board may be installed by Win 7/8/10/11; see the red warnings in the descriptions. It is crucial to not interrupt the USB driver install process. It can take several minutes, so please be patient; let Windows do its job, for however long it takes.

The flashing procedure is quite different for the v1.3x and v3.x/v4.x STorM32 boards:

Related wiki articles:

Checking Connection to the GUI

Next, let's check if the STorM32 controller is indeed operational, and communicates with the GUI. Note that the firmware and GUI versions must match. If they do not match, the GUI will tell you the versions it expects, but may refuse to work.

This is a good occasion to also learn about the usage of the [Read], [Write] and [Write+Store] buttons: Please read the FAQ: How does Read, Write, and Store work?.

To check the connection, follow these steps:

  1. If a USB cable is connected to the STorM32 board, disconnect it. Click on the [Port] selector in the left bottom and memorize the list.
    Storm32-wiki-gettingstarted-checkconnection-1.jpg
  2. Now plug in the STorM32 board via the USB cable to power it. When clicking on the drop down for the [Port] selector, it should 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.
    Storm32-wiki-gettingstarted-checkconnection-2.jpg
  3. Go to the [GUI:Main] tab and click on [Connect] or [Read] to validate the connection with the board.
    Storm32-wiki-gettingstarted-checkconnection-3.jpg

Quick Trouble Shooting:

  • Wrong COM port selected.
  • Firmware and GUI version numbers do not match.

Related wiki articles:

Hardware Setup

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, most STorM32 boards do have a 2nd IMU on-board already. To make use of it, the STorM32 board needs to be mounted such that it measures the movements of the copter frame ("above" the yaw axis). The board's location does not matter, as long as it measures the frame's movements. In case this is not possible, another external IMU can be mounted to the frame and connected to the STorM32 board. As for the camera IMU, also the axes of the 2nd IMU have to be vertical or horizontal, respectively.

Comment: T-STorM32 does not make use of a 2nd IMU, and the STorM32 board can thus be placed in any location or orientation which is convenient.

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. If a 2nd IMU shall be used, then you have 2 options: (i) A further NT IMU module connected to the NT bus in parallel to the camera IMU; (ii) if an extrenal 2nd IMU is not found the on-board IMU is selected, if available.

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 needle, a craft knife, or similar tool that can lift the release catch holding the crimped picoblade connector.

Storm32-nt-v130-ports-and-connections-01.jpg

Related wiki articles:

Gimbal Mechanics

Before using a gimbal, it is absolutely mandatory 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 compromise the performance of the gimbal, and 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. This is btw the reason why the firmware should be flashed using USB power only, as we do not want the motors to get power in this 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 v1.3x 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.

This does not apply to v3.x and v4.x STorM32 boards; they do have a 5 V BEC capable of 0.6 A (or more) on board.

Motor Connectors

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 about 10 Ohm 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 or NT Motor module which is used; the 10 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 and the electronics may be destroyed.

The v1.3x and v4.1 STorM32 boards have three connectors with three pins each 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.

Users of a v3.x STorM32 board, or of T-STorM32, need to use NT Motor modules in any case.

Comment: Ensure that the NT Motor modules are properly configured, i.e., that the ID solder pads are closed/opened as needed.

Summary

Now all motors and the IMU(s) are connected, the battery power cable is ready, and its polarity double-checked. You are ready for the next steps.

Storm32-wiki-a-1-02.jpg

Basic Controller Configuration

Comment: T-STorM32 users please refer to the article Getting Started with T-STorM32.

Comment: The [GUI:Configure Gimbal Tool] can be used also for 2- and 1-axis gimbals; in the following a 3-axis gimbal is assumed.

Now it's time to set the most important parameters, namely the IMU orientations and motor parameter values, which are located in the [GUI:Gimbal Configuration] tab. 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 [GUI:Configure Gimbal Tool], which makes this very simple.

Again: The parameters in the [GUI:Gimbal Configuration] tab must all be configured correctly; otherwise the gimbal will just not work correctly.

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, a camera must be installed in the gimbal. Without camera gimbals don't work properly.

  1. Change to the [GUI:Gimbal Configuration] tab. There you find the parameter fields for the IMU orientations, motor poles, motor directions and motor startup positions. To set them, run the [GUI:Configure Gimbal Tool] by hitting the so named button.
    Storm32-wiki-c-1-01.jpg
  2. 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 [Continue].
    Storm32-wiki-c-2-01.jpg
  3. 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 [Continue].
    Storm32-wiki-c-3-01.jpg
    Gimbal config tool forward.jpg
  4. 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.
    Storm32-wiki-c-4-01.jpg
    Gimbal config tool 45.jpg
  5. 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.
    Storm32-wiki-c-5-01.jpg
  6. 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.
    Storm32-wiki-c-6-01.jpg
  7. On the next screen you are informed that all motor direction values will be set to “auto”. Click [Continue].
  8. This completes the settings of Steps I, and you can proceed with adjusting the parameters of Steps II.
    Storm32-wiki-c-8-01.jpg
  9. 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.
    Storm32-wiki-c-9-01.jpg
  10. 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.
    Storm32-wiki-c-10-01.jpg
  11. On the next screen you are informed that the motor direction values will be determined for all motors. Click [Continue].
  12. In a further screen you are informed that the motor startup positions for the pitch and roll motors are determined. Click [Continue].
  13. 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.
    Storm32-wiki-c-13-01.jpg
  14. This completes the settings of Steps II. What is left is to store all values in non-volatile memory, and to restart the gimbal.
    Storm32-wiki-c-14-01.jpg
  15. The results of the above steps can be seen in the [GUI:Gimbal Configuration] tab, which got updated with the new IMU orientations and motor parameters. Also the motors are enabled, and the system is functional now.
    Storm32-wiki-c-16-01.jpg


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:

First Startup

After the above steps were completed, the STorM32 controller was reset and hence will start up now (the following applies to any startup however).

At startup, the controller goes through its initialization steps, which typically takes about 20 - 25 seconds (after configuration and tuning has been finished, the startup time can be cut down massively with proper parameter settings). 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

  • strtMOTOR: The motors are turned on, and moved into the position specified by the startup motor position parameters.
  • SETTLE: 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.
  • CALIBRATE: Calibrates the sensors. Takes a second or so.
  • LEVEL: This is the point where the motors are moved such as to level the camera in the pitch and roll axis. The yaw motor is under power, so you can feel some resistance, but it is not moved.
  • AUTODIR: Here the motors are moved slightly around and from the sensor changes the controller determines the motor directions.
  • RELEVEL: Since autodir moved the camera, it is quickly brought back in a horizontal position.
  • NORMAL: 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 the 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 either case the roll angle is limited to maximal +-80° or so. Larger roll angles are not possible due to gimbal lock (either mechanically or electronically).

Comment: T-STorM32 gimbals have a much larger operational range, and do not need a 2nd IMU.

Yaw Axis Alignment:

With a 2nd IMU enabled, it is very important that the camera is aligned properly with respect to the gimbal support before the gimbal is powered up. You typically do this by hand. It is sufficient to have the camera aligned to within typically +-25° (for a 14 pole yaw motor). When the controller is powered up, it first moves the motors, and the camera should now precisely point forward (to within a degree or so).

Comment: Does not apply to T-STorM32 gimbals, these do nicely align the camera themselves from any starting position.

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 the [GUI:PID] tab 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.