View Full Version : SIOC USB Outputs controlled by elevator trim direction
dc8flightdeck
11-08-2012, 10:09 PM
<tbody>
0BC0
2
Elevator trim control input: 16383 to +16383
</tbody>
Is it possible to have an output activate whenever elevator trim moves +, and another output to activate when the trim is moving - ?
If so, I plan to use these outputs to toggle the relays that run a motor on a simulator 737 trim wheel. This will allow the autopilot to control the trim wheel.
Thanks!
fordgt40
11-09-2012, 05:00 AM
No problem at all. You just need to ensure that you get a relay that is sensitive enough to respond to TTL logic levels from the OC output card.
David
dc8flightdeck
11-09-2012, 05:16 PM
Thanks, The relay curcuit is the easy part, Ive used lots of relays with the USB Outputs cards.
However I dont have a clue how to write SIOC that uses directional values to toggle the output. If the value is moving from minus to plus then one output needs to activate as long as there is plus movement of the FSUIPC Elevator trim value. If there is plus to minus trim movement then a second output needs to activate as long as there is minus trim movement. The FSUIPC trim range is16383 to +16383. After taking a second look I see I probably need to use OBC2 rather than 0BC0
I hope that made sense :)
Justin
No problem at all. You just need to ensure that you get a relay that is sensitive enough to respond to TTL logic levels from the OC output card.
David
fordgt40
11-10-2012, 10:27 AM
Justin
A broad outline of the logic to convert the trim values into motor direction is roughly
Define a Null zone variable to avoid "hunting"
Get Trim variable from FSUIPC
If trim value is negative
If trim value < previous trim value
Direction = down
Else
direction = up
Trim movement = Trim value minus previous trim value
trim movement = ABS trim movement
If trim value is positive
If trim value > previous trim value
Direction = up
Else
direction = down
Trim movement = Trim value minus previous trim value
trim movement = ABS trim movement
Direction variable
If trim movement > null zone
If direction = up
Turn on output for up
turn off output for up after a suitable delay - use the DELAY function
Else
Turn on output for down
turn off output for down after a suitable delay - use the DELAY function
Note you could test the value of trim movement and use a variable argument to the DELAY function to vary the delay in turning off the motor according to the value of the trim movement
You will need to code this into SIOC syntax and I give no guarantees that it is correct!!! Just a starter to hopefully get you going
David