» S

Gimbal Passthrough & Triggering

New functions & features were introduced in firmware 6.7 r214: flexible selection of passthrough channels for the camera gimbal and event triggering based on time and distance.

Please do note that this release changes the current behavior of the GMBL_PITCH_PORT setting.
See below for details.

New/changed params with default values:

GMBL_PITCH_PORT 0 // Gimbal pitch stabilization output port. 0 == disabled
GMBL_TILT_PORT 0 // Gimbal manual/PoI tilt control output port (can be same as PITCH_PORT to combine the 2 functions). 0 == disabled
GMBL_TRIG_PORT 0 // Triggering output port. 0 == disabled
GMBL_TRIG_CH_NEU 0 // Trigger radio channel AQ value at neutral position (to allow automated triggering)
GMBL_TRIG_ON_PWM 2100 // PWM output of trigger at full-press (on) position (for automated triggering)
GMBL_TRIG_ON_TIM 1000 // Time to keep shutter at on position, in ms
GMBL_TRIG_DIST 0.0f // Activate trigger every this many meters. 0 == disabled
GMBL_TRIG_TIME 0 // Activate trigger every this many seconds. 0 == disabled
GMBL_PSTHR_CHAN 0 // Pure passthrough radio channel (eg. camera zoom, pan axis, lights, etc). 0 == disabled
GMBL_PSTHR_PORT 0 // Pure passthrough output port. 0 == disabled

Stabilized pitch control vs. AUX3 tilt passthrough:

GMBL_PITCH_PORT – Provides only stabilization output. * New behavior *
GMBL_TILT_PORT – Provides manual tilt control via AUX3, mixed with PoI tilt (when active).

You can enable either or both ports at once. To combine the 2 functions to one output (which is the old GMBL_PITCH_PORT behavior), configure BOTH params for the SAME port number. This is a change from the old behavior which may require current users to reconfigure. But it is very flexible, with minimum amount of configuration.

GEAR channel passthrough:

GMBL_TRIG_PORT – Output port for the camera trigger (same PWM freq. as roll/pitch outputs). For basic usage, this is simply a direct passthrough for GEAR channel. If not needing automated triggering, there is nothing else to configure.

For automated triggering based on time/distance (or custom code, eg. wpt triggering):

GMBL_TRIG_CH_NEU – This defines the “neutral” state of the GEAR channel when no manual triggering is being done. It is used by the automated triggering to determine when it is OK to fire (it can also be thought of as the “on” position for auto-triggering). This can be set to any “AQ” radio value (-1024 – +1024), for example zero for a middle switch position, or -500 for switch low. The actual radio value must be within ( GMBL_TRIG_CH_NEU +/- p[CTRL_DEAD_BAND] ). So if zero is defined for this param, the actual channel value would need to be within +/- 40 (by default).

GMBL_TRIG_ON_PWM – Pulse width to output when trigger is active. _This is for automatic mode only_ (manual mode is completely passthrough).

GMBL_TRIG_ON_TIM – How long to keep the trigger output level active, in ms. After this, the output returns to whatever GEAR channel is sending. Which would typically be back to the neutral (trigger off) position, unless the user has moved the GEAR channel on purpose (which overrides auto mode anyway).

GMBL_TRIG_DIST & GMBL_TRIG_TIME – Set one/both to a value to enable automatic triggering. The triggering starts/runs only when in FLYING state. If both are set, whichever condition is met first will fire the trigger (time is checked first). Manual (GEAR channel) control has priority over automatic triggering. If manual override is active, the next auto-trigger will happen right after GEAR is moved back to neutral position, or when the next time/distance interval is reached, whichever is later.

To use the GEAR channel to turn automatic triggering on/off, simply keep the channel at a non-neutral position, and move it to neutral when you want auto triggering to run. If your manual trigger device (IR/USB/servo/etc) would normally react to that channel position, you may need to adjust your trigger channel end-points so that the device does not react to the manual position.  For example if your neutral position is zero (middle), and to trigger the shutter device requires an AQ radio value of 700, then to avoid manual activation set the end point on your radio lower, say to 500.  This should still activate automatic triggering (since the AQ will see the channel position as non-neutral), but not the manual shutter control.

To activate trigger from within custom code, be sure to include gimbal.h and then simply set gimbalData.trigger = 1 when needed.

Extra Passthrough option:

GMBL_PSTHR_CHAN & GMBL_PSTHR_PORT – Simply provide an auxiliary passthrough port for any use. It runs at the same PWM freq. as roll/pitch outputs. To enable, configure input radio channel and output PWM port number.

Trigger Logging:

Each activation of the trigger, automatic or manual, is logged as an incrementing number in LOG_GMBL_TRIGGER. While the trigger is active (automatically held at GMBL_TRIG_ON_PWM, or when GEAR is not at neutral), the current trigger count is logged. When no trigger is active (and channel at neutral), a zero value is logged. This logs multiple things at once– exactly when the trigger was activated, the duration of activation, plus the activation count. It does not distinguish between auto triggers and manual, but that data is available via the GEAR channel log. Exact position of photo could be derived by taking the initial activation time and adding the time it takes for your camera to fire. Export options will be added to LogDump, including KML/GPX waypoint markers.

NOTE: These are preliminary info. You can follow the discussion here.

This page was created on 9-Sep-13 by kinderkram. Last modified on 17-Oct-14 by jussi.