Camstab disable aux 3 and 4 and ideea SOLVED
Camstab disable aux 3 and 4 and ideea SOLVED
Hello
I'm test a camera gimbal on my hexa but don't want to use aux3 and 4 right now ( I need to use those to other functions) how can i disable this function in latest code v 2.1 ?
I think it is here in OUTPUT.pde i need to change but unfortunately im no coder lol
is it possible to get this settings in config file as an option to enable one or two aux and also an option to select what aux chans it use ...
/**************** Cam stabilize Sevos ******************/
#if defined(SERVO_TILT)
#if defined(A0_A1_PIN_HEX) && (NUMBER_MOTOR == 6) && defined(PROMINI)
#define S_PITCH servo[2]
#define S_ROLL servo[3]
#else
#define S_PITCH servo[0]
#define S_ROLL servo[1]
#endif
S_PITCH = TILT_PITCH_MIDDLE + rcData[AUX3]-1500;
S_ROLL = TILT_ROLL_MIDDLE + rcData[AUX4]-1500;
if (rcOptions[BOXCAMSTAB]) {
S_PITCH += TILT_PITCH_PROP * angle[PITCH] /16 ;
S_ROLL += TILT_ROLL_PROP * angle[ROLL] /16 ;
}
S_PITCH = constrain(S_PITCH, TILT_PITCH_MIN, TILT_PITCH_MAX);
S_ROLL = constrain(S_ROLL , TILT_ROLL_MIN, TILT_ROLL_MAX );
#endif
----------------------
//Tazzy
I'm test a camera gimbal on my hexa but don't want to use aux3 and 4 right now ( I need to use those to other functions) how can i disable this function in latest code v 2.1 ?
I think it is here in OUTPUT.pde i need to change but unfortunately im no coder lol
is it possible to get this settings in config file as an option to enable one or two aux and also an option to select what aux chans it use ...
/**************** Cam stabilize Sevos ******************/
#if defined(SERVO_TILT)
#if defined(A0_A1_PIN_HEX) && (NUMBER_MOTOR == 6) && defined(PROMINI)
#define S_PITCH servo[2]
#define S_ROLL servo[3]
#else
#define S_PITCH servo[0]
#define S_ROLL servo[1]
#endif
S_PITCH = TILT_PITCH_MIDDLE + rcData[AUX3]-1500;
S_ROLL = TILT_ROLL_MIDDLE + rcData[AUX4]-1500;
if (rcOptions[BOXCAMSTAB]) {
S_PITCH += TILT_PITCH_PROP * angle[PITCH] /16 ;
S_ROLL += TILT_ROLL_PROP * angle[ROLL] /16 ;
}
S_PITCH = constrain(S_PITCH, TILT_PITCH_MIN, TILT_PITCH_MAX);
S_ROLL = constrain(S_ROLL , TILT_ROLL_MIN, TILT_ROLL_MAX );
#endif
----------------------
//Tazzy
Last edited by Tazzy on Sat Sep 22, 2012 10:10 am, edited 1 time in total.
Re: Camstab disable aux 3 and 4 and ideea
Ha - I had the same issue. I made some changes. Was going to post next week as suggestion. Select which ones can use. Will dig out over weekend.
Re: Camstab disable aux 3 and 4 and ideea
I had the same issue: viewtopic.php?f=7&t=1507
Re: Camstab disable aux 3 and 4 and ideea
arne wrote:I had the same issue: viewtopic.php?f=7&t=1507
Thanks allot Arne
It was exactly what i was looking for hope this can be moved in to rel version.
// Tazzy
r1227 will result in compile error
r1227 should be changed so it is similar to the code for SERVO_TILT.
as it is now, it will result in compile error if TILT_PITCH_AUX_CH and/or TILT_ROLL_AUX_CH are not defined and SERVO_MIX_TILT is defined
the code for setting up S_PITCH and S_ROLL could be factored out as it is common to both SERVO_TILT and SERVO_MIX_TILT
like this
as it is now, it will result in compile error if TILT_PITCH_AUX_CH and/or TILT_ROLL_AUX_CH are not defined and SERVO_MIX_TILT is defined
the code for setting up S_PITCH and S_ROLL could be factored out as it is common to both SERVO_TILT and SERVO_MIX_TILT
like this
Code: Select all
#if defined(SERVO_TILT) || defined(SERVO_MIX_TILT)
#if defined(A0_A1_PIN_HEX) && (NUMBER_MOTOR == 6) && defined(PROMINI)
#define S_PITCH servo[2]
#define S_ROLL servo[3]
#else
#define S_PITCH servo[0]
#define S_ROLL servo[1]
#endif
#ifdef TILT_PITCH_AUX_CH
S_PITCH = TILT_PITCH_MIDDLE + rcData[TILT_PITCH_AUX_CH]-1500;
#else
S_PITCH = TILT_PITCH_MIDDLE;
#endif
#ifdef TILT_ROLL_AUX_CH
S_ROLL = TILT_ROLL_MIDDLE + rcData[TILT_ROLL_AUX_CH]-1500;
#else
S_ROLL = TILT_ROLL_MIDDLE;
#endif
#endif
#ifdef SERVO_TILT
if (rcOptions[BOXCAMSTAB]) {
S_PITCH += TILT_PITCH_PROP * angle[PITCH] /16 ;
S_ROLL += TILT_ROLL_PROP * angle[ROLL] /16 ;
}
S_PITCH = constrain(S_PITCH, TILT_PITCH_MIN, TILT_PITCH_MAX);
S_ROLL = constrain(S_ROLL , TILT_ROLL_MIN, TILT_ROLL_MAX );
#endif
#if defined(MEGA) && defined(MEGA_HW_PWM_SERVOS) && !defined(FIXEDWING) && !defined(HELICOPTER) && (RC_CHANS>8)
servo[3] = rcData[8];
servo[4] = rcData[9];
#endif
/************************************************************************************************************/
// Bledi Experimentals
/************************************************************************************************************/
#ifdef SERVO_MIX_TILT
// Simple CameraGimbal By Bledy http://youtu.be/zKGr6iR54vM
if (rcOptions[BOXCAMSTAB]) {
servo[0] = constrain(TILT_PITCH_MIDDLE - (-TILT_ROLL_PROP) * angle[PITCH] /16 - TILT_ROLL_PROP * angle[ROLL] /16 , TILT_PITCH_MIN, TILT_PITCH_MAX);
servo[1] = constrain(TILT_ROLL_MIDDLE + (-TILT_ROLL_PROP) * angle[PITCH] /16 - TILT_ROLL_PROP * angle[ROLL] /16 , TILT_ROLL_MIN, TILT_ROLL_MAX);
} else {
S_PITCH = constrain(S_PITCH, TILT_PITCH_MIN, TILT_PITCH_MAX);
S_ROLL = constrain(S_ROLL , TILT_ROLL_MIN, TILT_ROLL_MAX );
}
#endif
Re: Camstab disable aux 3 and 4 and ideea SOLVED
Ok will take a look later when on pc. I thought I uploaded config.h with it defined as default.
Re: Camstab disable aux 3 and 4 and ideea SOLVED
I recently installed a gimbal on my copter and was a little confused about the difference between SERVO_MIX_TILT and SERVO_TILT. I was able to get what each of those defines does from the code, but maybe there should be some documentation in form of comments
Re: Camstab disable aux 3 and 4 and ideea SOLVED
Yes .. Agree.
The tiltmix is is for when you have servos connected in the more unusual vtail type format. If that makes any sense!
The tiltmix is is for when you have servos connected in the more unusual vtail type format. If that makes any sense!
Re: r1227 will result in compile error
mmm. Can't find the issues...
I just tried enabling both tilt mix and tilt. Both compile fine with no errors for me.
config.h from r1219 had the tilt aux ch defined by default.
Possibly code could be reduced further. I'll take a look at your proposal.
I just tried enabling both tilt mix and tilt. Both compile fine with no errors for me.
config.h from r1219 had the tilt aux ch defined by default.
Possibly code could be reduced further. I'll take a look at your proposal.
doughboy wrote:r1227 should be changed so it is similar to the code for SERVO_TILT.
as it is now, it will result in compile error if TILT_PITCH_AUX_CH and/or TILT_ROLL_AUX_CH are not defined and SERVO_MIX_TILT is defined
the code for setting up S_PITCH and S_ROLL could be factored out as it is common to both SERVO_TILT and SERVO_MIX_TILT
Re: r1227 will result in compile error
if TILT_PITCH_AUX_CH and/or TILT_ROLL_AUX_CH are not defined and SERVO_MIX_TILT is defined, then this line is invalid.
you need to code it the way it is coded for SERVO_TILT. and since the code is essentially the same, you can factor it out. I already provided the correct code.
you need to code it the way it is coded for SERVO_TILT. and since the code is essentially the same, you can factor it out. I already provided the correct code.
Code: Select all
servo[2] = constrain(TILT_PITCH_MIDDLE + rcData[TILT_PITCH_AUX_CH]-1500 , TILT_PITCH_MIN, TILT_PITCH_MAX);
servo[3] = constrain(TILT_ROLL_MIDDLE + rcData[TILT_ROLL_AUX_CH]-1500, TILT_ROLL_MIN, TILT_ROLL_MAX);
shikra wrote:mmm. Can't find the issues...
I just tried enabling both tilt mix and tilt. Both compile fine with no errors for me.
config.h from r1219 had the tilt aux ch defined by default.
Possibly code could be reduced further. I'll take a look at your proposal.doughboy wrote:r1227 should be changed so it is similar to the code for SERVO_TILT.
as it is now, it will result in compile error if TILT_PITCH_AUX_CH and/or TILT_ROLL_AUX_CH are not defined and SERVO_MIX_TILT is defined
the code for setting up S_PITCH and S_ROLL could be factored out as it is common to both SERVO_TILT and SERVO_MIX_TILT
Re: Camstab disable aux 3 and 4 and ideea SOLVED
Hey Doughboy
I think I see what you refer too now....
If someone actually // the aux ch define out. Provide a default as per the text introduced previously.
I hadn't considered anyone would do that with the TILT MIX - since it will no longer work as a gimbal!! Both need to be working. Unlike the standard TILT.
This video explains the function well....
http://www.youtube.com/watch?v=zKGr6iR5 ... e=youtu.be
Does that make sense - or am I still missing something?
I think I see what you refer too now....
If someone actually // the aux ch define out. Provide a default as per the text introduced previously.
I hadn't considered anyone would do that with the TILT MIX - since it will no longer work as a gimbal!! Both need to be working. Unlike the standard TILT.
This video explains the function well....
http://www.youtube.com/watch?v=zKGr6iR5 ... e=youtu.be
Does that make sense - or am I still missing something?
Re: Camstab disable aux 3 and 4 and ideea SOLVED
thanks for the clarification. I see how it works now.
Re: Camstab disable aux 3 and 4 and ideea SOLVED
An example of how Multiwii CAMSTAB works on roll-pitch axes i show here
http://www.youtube.com/watch?v=XbEjQSneakk
Thanks everyone for supporting me.
http://www.youtube.com/watch?v=XbEjQSneakk
Thanks everyone for supporting me.
Re: Camstab disable aux 3 and 4 and ideea SOLVED
@doughboy - no problem - its an unusual config for sure. I think its worth a re-look at the code at some point. Most common comments I hear are around some anti-glitch / deadband for small errorangles.
@dramida - thats quite an impressive demo. I think best one I've seen on multiwii.
@dramida - thats quite an impressive demo. I think best one I've seen on multiwii.
Re: Camstab disable aux 3 and 4 and ideea SOLVED
dramida wrote:An example of how Multiwii CAMSTAB works on roll-pitch axes i show here
http://www.youtube.com/watch?v=XbEjQSneakk
Thanks everyone for supporting me.
can you do a demo using aux3 and aux4 on potentiometer and using aux3 and aux4 to control gimbal pitch and roll?
Re: Camstab disable aux 3 and 4 and ideea SOLVED
I was trying to have the mix tilt on the dev 1129 but it's completely broken, I had on my pc the dev1240 and it's broken when disabling the aux channels but your code fix it (I have to try if it's working really but at least, it compiles) .
Now I have just downloaded the latest 1317, defined mix tilt and undefined the aux channels and... it's broken too!
Can someone fix this definitely in the next dev release ?
Thanks, Federico
Now I have just downloaded the latest 1317, defined mix tilt and undefined the aux channels and... it's broken too!
Can someone fix this definitely in the next dev release ?
Thanks, Federico