Using a 2nd IMU: Difference between revisions

From STorM32-BGC Wiki V1
Jump to navigation Jump to search
No edit summary
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
The STorM32 controller allows the use of a 2nd IMU, in addition to the camera IMU installed on the camera platform, for superior performance. It's usage and advantages are described here.
The STorM32 controller allows the use of a second IMU (2nd IMU), in addition to the camera IMU mounted to the camera platform, for superior performance. It's usage and advantages are described here.


== Installation Options ==
== Installation Options ==
The basic "rule" for installation is simple:
The primary rule for installation is:


  The second IMU must be mounted on the "gimbal support" above the yaw motor so it is not moved by any of the motors.  
  The 2nd IMU must be mounted on the gimbal support above the yaw motor so it is not moved by any of the motors.  


It must not be mounted on one of the gimbal axes or the camera platform.  
It must not be mounted on one of the gimbal axes or the camera platform.  


So you can either mount the controller mainboard on the gimbal support using the onboard IMU as 2nd IMU, or put the mainboard somewhere else (on the yaw axis for example) and mount an external IMU module above the yaw motor. These two options are shown as option (1) and (2) in the diagram below.
So you can either mount the controller board on the gimbal support using the on-board IMU as 2nd IMU, or put the controller board somewhere else (on the yaw axis for example) and mount an external IMU module above the yaw motor. These two options are shown as option (1) and (2) in the diagram below.


The external IMU module has to be connected to the I2C#2 connector on the bottom side of the STorM32 board. Doing so automatically selects the external IMU module as 2nd IMU. If no IMU module is connected to I2C#2, the onboard IMU is selected. So you don't have to change anything in the GUI, the external IMU is used automatically when connected.
The external IMU module would be connected to the I2C#2 connector on the bottom side of the STorM32 board. Doing so automatically selects the external IMU module as 2nd IMU. If no IMU module is connected to I2C#2, the on-board IMU is selected. So you don't have to change anything in the GUI, the external IMU module is used automatically when connected.


{{COMMENT|The onboard mpu6050 IMU is connected to the I2C#2 connector internally and is set to a non default i2c adress. If you connect an external IMU to the I2C#2 connector it hence can be recognised by its default i2c adress. }}
{{COMMENT|The on-board mpu6050 IMU is connected to the I2C#2 connector internally and is set to a non default i2c address. If you connect an external IMU to the I2C#2 connector it can be recognized by its default i2c address and is selected. }}


{{COMMENT|The configuration (3) in the diagram is NOT supported by the STorM32 firmware, as by principle it provides only very limited benefits}}.
{{COMMENT|The configuration (3) in the diagram is NOT supported by the STorM32 firmware, as by principle it provides only very limited benefits}}.


[[File:Storm32-wiki-2nd-imu-configurations-01.jpg|640px]]
[[File:Storm32-wiki-2nd-imu-configurations-01.jpg|640px]]
== Calibration ==
As with the camera IMU, also the 2nd IMU, be it the on-board IMU or an external IMU module, needs to be calibrated for optimal performance.
However, fortunately, for the 2nd IMU it's not critical to get the most accurate calibration, and a good 1-point calibration should be enough for most situations. Exceptions are then motors with high motor pole counts, larger than 14, are used.
The calibration of the 2nd IMU works similar to the camera IMU; one just has to select the 2nd IMU in the respective fields.


== IMU Orientation ==
== IMU Orientation ==


For a correct function it is extremly important to set the IMU orientation correctly, i.e., to choose the parameter field {{PARAMNAME|Imu2 Orientaion}} in the {{GUI|Gimbal Configuration}} tab.
For a correct functioning it is very important to set the IMU orientation correctly, i.e., the parameter field {{PARAMNAME|Imu2 Orientation}} in the {{GUI|Gimbal Configuration}} tab.


This is most conveniently achieved by using the {{GUI|Configure Gimbal Tool}}. Alternatively, it may be set manualy following the recipe described in [[Manually Setting the IMU Orientation]].
This is most conveniently achieved by using the {{GUI|Configure Gimbal Tool}}. Alternatively, it may be set manually following the recipe described in [[Manually Setting the IMU Orientation]].


== Calibration ==
== Yaw Axis Alignment ==


As with the camera IMU, also the 2nd IMU, be it the onboard IMU or an external IMU module, needs to be calibrated for optional performance.
It is also very important to ensure that at startup the camera is aligned properly with respect to the gimbal support; it needs to point forward to within a degree or so.


However, fortunately, for the 2nd IMU it's not critical to get the most accurate calibration, and a good 1-point calibration should be enough for most situations. Exceptions are then motors with high motor pole counts, larger than 14, are used.
This is most conveniently achieved by using the {{GUI|Configure Gimbal Tool}}, which in one step allows you to adjust the camera orientation. Alternatively, the yaw axis orientation at startup may be adjusted manually by setting the {{PARAMNAME|Yaw Startup Motor Pos}} parameter in the {{GUI|Gimbal Configuration}} tab.


The calibration of the 2nd IMU works similar to the camera IMU, one only has to select the 2nd IMU in the respctive fields.
{{COMMENT|It is '''not''' required to orient the camera precisely by hand '''before''' the controller is switched on. Here it is sufficient to have the camera aligned to within typically +-25° (for a 14 pole yaw motor). However, when the controller is powered up, it first moves the motors to default startup positions, and after this step the camera must precisely point to the forward.}} 


== IMU Configuration ==
== IMU Configuration ==


The 2nd IMU support is activated via the parameter {{PARAMNAME|Imu2 Configuration}} found in the {{GUI|Setup}} tab. To activate the 2nd IMU, set it to
The 2nd IMU support is determined by the parameter {{PARAMNAME|Imu2 Configuration}} found in the {{GUI|Setup}} tab. To activate the 2nd IMU, set it to
* {{PARAMVALUE|gimbal support}}: activate 2nd IMU above the yaw motor
* {{PARAMVALUE|full}}: activate 2nd IMU above the yaw motor
* {{PARAMVALUE|gimbal support xy}}: activate 2nd IMU ybove the yaw motor rotated by 45°.
* {{PARAMVALUE|full xy}}: activate 2nd IMU above the yaw motor, with the IMU rotated by 45°.
 
== PID Tuning ==
 
The initial PID tuning should be done with the 2nd IMU deactivated.
 
When the 2nd IMU is now activated, the pitch and yaw axis often work "out of the box", but on roll vibrations might occur at smaller roll angles than expected. The reasons are the imperfections in the gimbal, such as the balance, the motor quality or insufficiently stiff gimbal arms. With the 2nd IMU activated the controller is much faster and can compensate gimbal motions much better, as a view on the {{GUI|DataDisplay}} impressively demonstrates. The downside is that imperfections get amplified. Especially the balance of the yaw axis and play in the motor bearings are typical culprits.
 
If these points cannot be further improved, it can be very successful to down-tune the roll and yaw PID controllers, i.e., to reduce their values. You need to experiment. The control precision is then reduced, but since with 2nd IMU it is much higher anyhow it overall will be still better. Another point to try is to change the {{PARAMNAME|Motor Vmax}} values by some digits.


== Benefits of a 2nd IMU ==
== Benefits of a 2nd IMU ==


Nowadays any advanced brushless gimbal controller provides 2nd IMU support, but there are marked differences in how and to what extend the 2nd IMU is used. The STorM32 controller is - to the best of the knowledge of the firmware author - unique in that it is the only controller which provides (i) a '''stable''' operation with the 2nd IMU above the yaw motor and (ii) a '''distortion rejection''' for the yaw axis also in the pan/follow mode. Usually these features would require the installation of a poti or angle encoder on yaw.
Nowadays advanced brushless gimbal controller provide 2nd IMU support, but there are marked differences in how and to what extend the 2nd IMU is used. The STorM32 controller is - to the best of the knowledge of the firmware author - unique in that it provides (i) a '''stable''' operation with the 2nd IMU above the yaw motor and (ii) a '''distortion rejection''' for the yaw axis also in the pan/follow mode. Usually these features would require the installation of a poti or angle encoder on yaw.


The benefits provided by the STorm§2 controller are
The benefits provided by the STorM32's 2nd IMU support are
* significantly improved accuracy, i.e., the position of the camera is held constant with a much smaller error bandwidth much higher degree
* significantly improved accuracy, i.e., the camera is held in position with a much smaller error bandwidth
* drastically larger range of operation, essentially any pitch and yaw angle is possible (for a more detailed discussion of the possibilities and limitations see here)
* drastically larger range of operation, essentially any pitch and yaw angle is possible (for a more detailed discussion of the possibilities and limitations see here)
* stable operation of teh 2nd IMU above the yaw axis without dterioration over time due to gyro drift
* stable operation of the 2nd IMU above the yaw axis without deterioration over time due to gyro drift
* always keeps or returns to the correct yaw orientation, also when in pan/follow mode
* returns to the correct yaw orientation after an external distortion, also when in pan/follow mode


These features were demonstrated for an early test version of the firmware (the features became better since then) in this video:
These features were demonstrated in this video for an early test version of the firmware (the features became better since then):


{{#ev:youtube|XeKQRgV_V9Q|480}}
{{#ev:youtube|XeKQRgV_V9Q|480}}

Latest revision as of 02:02, 20 June 2015

The STorM32 controller allows the use of a second IMU (2nd IMU), in addition to the camera IMU mounted to the camera platform, for superior performance. It's usage and advantages are described here.

Installation Options

The primary rule for installation is:

The 2nd IMU must be mounted on the gimbal support above the yaw motor so it is not moved by any of the motors. 

It must not be mounted on one of the gimbal axes or the camera platform.

So you can either mount the controller board on the gimbal support using the on-board IMU as 2nd IMU, or put the controller board somewhere else (on the yaw axis for example) and mount an external IMU module above the yaw motor. These two options are shown as option (1) and (2) in the diagram below.

The external IMU module would be connected to the I2C#2 connector on the bottom side of the STorM32 board. Doing so automatically selects the external IMU module as 2nd IMU. If no IMU module is connected to I2C#2, the on-board IMU is selected. So you don't have to change anything in the GUI, the external IMU module is used automatically when connected.

Comment: The on-board mpu6050 IMU is connected to the I2C#2 connector internally and is set to a non default i2c address. If you connect an external IMU to the I2C#2 connector it can be recognized by its default i2c address and is selected.

Comment: The configuration (3) in the diagram is NOT supported by the STorM32 firmware, as by principle it provides only very limited benefits.

Storm32-wiki-2nd-imu-configurations-01.jpg

Calibration

As with the camera IMU, also the 2nd IMU, be it the on-board IMU or an external IMU module, needs to be calibrated for optimal performance.

However, fortunately, for the 2nd IMU it's not critical to get the most accurate calibration, and a good 1-point calibration should be enough for most situations. Exceptions are then motors with high motor pole counts, larger than 14, are used.

The calibration of the 2nd IMU works similar to the camera IMU; one just has to select the 2nd IMU in the respective fields.

IMU Orientation

For a correct functioning it is very important to set the IMU orientation correctly, i.e., the parameter field Imu2 Orientation in the [Gimbal Configuration] tab.

This is most conveniently achieved by using the [Configure Gimbal Tool]. Alternatively, it may be set manually following the recipe described in Manually Setting the IMU Orientation.

Yaw Axis Alignment

It is also very important to ensure that at startup the camera is aligned properly with respect to the gimbal support; it needs to point forward to within a degree or so.

This is most conveniently achieved by using the [Configure Gimbal Tool], which in one step allows you to adjust the camera orientation. Alternatively, the yaw axis orientation at startup may be adjusted manually by setting the Yaw Startup Motor Pos parameter in the [Gimbal Configuration] tab.

Comment: It is not required to orient the camera precisely by hand before the controller is switched on. Here it is sufficient to have the camera aligned to within typically +-25° (for a 14 pole yaw motor). However, when the controller is powered up, it first moves the motors to default startup positions, and after this step the camera must precisely point to the forward.

IMU Configuration

The 2nd IMU support is determined by the parameter Imu2 Configuration found in the [Setup] tab. To activate the 2nd IMU, set it to

  • "full": activate 2nd IMU above the yaw motor
  • "full xy": activate 2nd IMU above the yaw motor, with the IMU rotated by 45°.

PID Tuning

The initial PID tuning should be done with the 2nd IMU deactivated.

When the 2nd IMU is now activated, the pitch and yaw axis often work "out of the box", but on roll vibrations might occur at smaller roll angles than expected. The reasons are the imperfections in the gimbal, such as the balance, the motor quality or insufficiently stiff gimbal arms. With the 2nd IMU activated the controller is much faster and can compensate gimbal motions much better, as a view on the [DataDisplay] impressively demonstrates. The downside is that imperfections get amplified. Especially the balance of the yaw axis and play in the motor bearings are typical culprits.

If these points cannot be further improved, it can be very successful to down-tune the roll and yaw PID controllers, i.e., to reduce their values. You need to experiment. The control precision is then reduced, but since with 2nd IMU it is much higher anyhow it overall will be still better. Another point to try is to change the Motor Vmax values by some digits.

Benefits of a 2nd IMU

Nowadays advanced brushless gimbal controller provide 2nd IMU support, but there are marked differences in how and to what extend the 2nd IMU is used. The STorM32 controller is - to the best of the knowledge of the firmware author - unique in that it provides (i) a stable operation with the 2nd IMU above the yaw motor and (ii) a distortion rejection for the yaw axis also in the pan/follow mode. Usually these features would require the installation of a poti or angle encoder on yaw.

The benefits provided by the STorM32's 2nd IMU support are

  • significantly improved accuracy, i.e., the camera is held in position with a much smaller error bandwidth
  • drastically larger range of operation, essentially any pitch and yaw angle is possible (for a more detailed discussion of the possibilities and limitations see here)
  • stable operation of the 2nd IMU above the yaw axis without deterioration over time due to gyro drift
  • returns to the correct yaw orientation after an external distortion, also when in pan/follow mode

These features were demonstrated in this video for an early test version of the firmware (the features became better since then):