Using sticks for multiple things

More
12 Nov 2015 16:35 #39986 by mwm
One survey response was:

It would be really nice if when in Loiter mode i could flick a switch and then my right stick (Roll/Pitch) became Pan/Tilt on the camera gimbal


This is possible, assuming that there are four channels involved: the two standard elevator and aileron channels, and two more for gimbal roll & pitch control.

First step is to get the switch working. What we want is a switch that is "on" if some control is on when in loiter mode, and off if that other control is off and you aren't in loiter mode. So two more assumptions: flight mode is controlled by the FMODE switch with loiter mode being FMODE2, and we're going to enable gimbal control with the GEAR1 switch.

To "and" two controls this way, we need a virtual channel that goes on when they are both on, and is off otherwise. So set a virtual channel to have a complex mix and two mixers. The first mixer has a mux type of replace, a fixed curve and a scale of -100. This is our default state of "off". The second mixer uses GEAR1 as a source, with a switch of FMODE2. The mux type is replace and the curve is min/max. When FMODE2 is on - so you're in loiter mode - this will replace the -100 output with the value of GEAR1, which will be on if GEAR1 is on and off otherwise.

Next step - we want to ignore the sticks when this switch is on. This is easy. In the channel config (what you get when you select the channel name in the mixer page), set the safety switch to the virtual channel created above, and the safety value to 0. That will cause zeros to be sent on the cyclic channel when you're in loiter mode, which for some flight controllers is required to stay in loiter mode.

Finally, we want to enable the gimbal channels when the switch goes on So we need a complex mix on those channels. You may have some other controls on those - fixed positions, or follow a switch, or whatever. One option is to hold their old position. To do that, make the first mixer a replace mixer, source is the channel it's on, curve is 1-1, scale 100, offset 0. To get the sticks to control it, add a mixer after whatever you're doing on that channel when you're not controlling it with the stick. Set that mixer to have a mux type of replace, a source of appropriate cyclic, and a switch of the virtual channel created above, You can then set up the curve to properly control the gimbal with the stick.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

Time to create page: 0.027 seconds
Powered by Kunena Forum