You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Programming Framework.md
+48-10Lines changed: 48 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,17 +52,22 @@ IPF can be edited using INAV Configurator user interface, of via CLI
52
52
| 19 | GVAR INC | Increase the GVAR indexed by `Operand A` with value from `Operand B`|
53
53
| 20 | GVAR DEC | Decrease the GVAR indexed by `Operand A` with value from `Operand B`|
54
54
| 21 | IO PORT SET | Set I2C IO Expander pin `Operand A` to value of `Operand B`. `Operand A` accepts values `0-7` and `Operand B` accepts `0` and `1`|
55
-
| 22 | OVERRIDE_ARMING_SAFETY | Allows to arm on any angle even without GPS fix |
56
-
| 23 | OVERRIDE_THROTTLE_SCALE | Override throttle scale to the value defined by operand. Operand type `0` and value `50` means throttle will be scaled by 50%. |
57
-
| 24 | SWAP_ROLL_YAW | basically, when activated, yaw stick will control roll and roll stick will control yaw. Required for tail-sitters VTOL during vertical-horizonral transition when body frame changes |
58
-
| 25 | SET_VTX_POWER_LEVEL | Sets VTX power level. Accepted values are `0-3` for SmartAudio and `0-4` for Tramp protocol |
59
-
| 26 | INVERT_ROLL | Inverts ROLL axis input for PID/PIFF controller |
| 29 | OVERRIDE_THROTTLE | Override throttle value that is fed to the motors by mixer. Operand is scaled in us. `1000` means throttle cut, `1500` means half throttle |
| 22 | OVERRIDE_ARMING_SAFETY | Allows to arm on any angle even without GPS fix |
56
+
| 23 | OVERRIDE_THROTTLE_SCALE | Override throttle scale to the value defined by operand. Operand type `0` and value `50` means throttle will be scaled by 50%. |
57
+
| 24 | SWAP_ROLL_YAW | basically, when activated, yaw stick will control roll and roll stick will control yaw. Required for tail-sitters VTOL during vertical-horizonral transition when body frame changes |
58
+
| 25 | SET_VTX_POWER_LEVEL | Sets VTX power level. Accepted values are `0-3` for SmartAudio and `0-4` for Tramp protocol |
59
+
| 26 | INVERT_ROLL | Inverts ROLL axis input for PID/PIFF controller |
| 29 | OVERRIDE_THROTTLE | Override throttle value that is fed to the motors by mixer. Operand is scaled in us. `1000` means throttle cut, `1500` means half throttle |
| 33 | SIN | Computes SIN of `Operand A` value in degrees. Output is multiplied by `Operand B` value. If `Operand B` is `0`, result is multiplied by `500`|
67
+
| 34 | COS | Computes COS of `Operand A` value in degrees. Output is multiplied by `Operand B` value. If `Operand B` is `0`, result is multiplied by `500`|
68
+
| 35 | TAN | Computes TAN of `Operand A` value in degrees. Output is multiplied by `Operand B` value. If `Operand B` is `0`, result is multiplied by `500`|
69
+
| 36 | MAP_INPUT | Scales `Operand A` from [`0` : `Operand B`] to [`0` : `1000`]. Note: input will be constrained and then scaled |
70
+
| 37 | MAP_OUTPUT | Scales `Operand A` from [`0` : `1000`] to [`0` : `Operand B`]. Note: input will be constrained and then scaled |
66
71
67
72
68
73
### Operands
@@ -173,3 +178,36 @@ Sets Thhrottle output to about `50%` when Logic Condition `0` evaluates as `true
173
178
174
179
If Logic Condition `0` evaluates as `true`, motor throttle control is bound to RC channel 7 instead of throttle channel
175
180
181
+
### Set VTX channel with a POT
182
+
183
+
Set VTX channel with a POT on the radio assigned to RC channel 6
184
+
185
+
```
186
+
logic 0 1 -1 15 1 6 0 1000 0
187
+
logic 1 1 -1 37 4 0 0 7 0
188
+
logic 2 1 -1 14 4 1 0 1 0
189
+
logic 3 1 -1 31 4 2 0 0 0
190
+
```
191
+
192
+
Steps:
193
+
1. Normalize range `[1000:2000]` to `[0:1000]` by substracting `1000`
194
+
2. Scale range `[0:1000]` to `[0:7]`
195
+
3. Increase range by `1` to have the range of `[1:8]`
196
+
4. Assign LC#2 to VTX channel function
197
+
198
+
### Set VTX power with a POT
199
+
200
+
Set VTX power with a POT on the radio assigned to RC channel 6. In this example we scale POT to 4 power level `[1:4]`
201
+
202
+
```
203
+
logic 0 1 -1 15 1 6 0 1000 0
204
+
logic 1 1 -1 37 4 0 0 3 0
205
+
logic 2 1 -1 14 4 1 0 1 0
206
+
logic 3 1 -1 25 4 2 0 0 0
207
+
```
208
+
209
+
Steps:
210
+
1. Normalize range [1000:2000] to [0:1000] by substracting `1000`
211
+
2. Scale range [0:1000] to [0:3]
212
+
3. Increase range by `1` to have the range of [1:4]
0 commit comments