Controlling camera pitch with free AUX Channel

Post Reply
schnupperm
Posts: 31
Joined: Tue Jun 25, 2013 1:41 pm

Controlling camera pitch with free AUX Channel

Post by schnupperm »

Hello,

since I only have a six channel TX, there are only two channels left for selecting different flight modes. (like acro, horizon, RTH, PosHold...). To make the problem worse, I like to change the pitch angle for my flight cam. So I use the MULTIPLE_CONFIGURATION_PROFILES option to change the options for different flight modes and when AUX1 is not used for any boxoption, use it for controlling the cam.

Code:
in config.h added:

Code: Select all

#define TILT_PITCH_AUX_CH AUX1

in output.cpp changed:

Code: Select all

#if defined(SERVO_TILT)
    servo[0] = get_middle(0);
    if (rcOptions[BOXCAMSTAB]) {
      servo[0] += ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
      servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL])  /50L;
    }
#endif

to

Code: Select all

 #if defined(SERVO_TILT)
    servo[0] = get_middle(0);
    #if defined(TILT_PITCH_AUX_CH)
    uint16_t auxused = 0;
    for(i=0;i<CHECKBOXITEMS;i++) //check if AUX Channel is used to set any option (there must be a simpler way)
      auxused += ((7 << ((TILT_PITCH_AUX_CH - AUX1))) & conf.activate[i]) > 0;
    if (! (auxused))
      servo[0] += rcData[TILT_PITCH_AUX_CH] - 1500;
    #endif
    if (rcOptions[BOXCAMSTAB] || f.ARMED) { // activate CAMSTAB if copter is armed to save AUX option
      servo[0] += ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
      servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL])  /50L;
    }
#endif


I don't really understand how the different boxoptions are assigned to the AUX chanels. The above code works fine, but is there a simpler way to see which options are set by a specific AUX chanel?

Edit:
code base is MultiWii_2.3-navi-b4-xmas by EOSBandi

Sven
Posts: 32
Joined: Mon Feb 27, 2012 10:11 am

Re: Controlling camera pitch with free AUX Channel

Post by Sven »

Unfortunately I can not help you with your problem, though I bumped into your post looking for answers myself. ;)
Could you elaborate on the "MULTIPLE_CONFIGURATION_PROFILES" you mention?
Could this possibly be used to run tricopter or Y6 configurations at the flick of a switch?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Controlling camera pitch with free AUX Channel

Post by timecop »

Profiles only switch PIDs and a few other settings. Not mixer type.

Sven
Posts: 32
Joined: Mon Feb 27, 2012 10:11 am

Re: Controlling camera pitch with free AUX Channel

Post by Sven »

Thats unfortunate. :(
Is switching mixer types perhaps possible through other means?
I'm trying to make a Y6 switch between throttle and servo (tricopter style) yaw.

Post Reply