Hi all,
I'm using the CAMTRIG servo to release a mechanism but when I connect the multiwii always the initiation activates the servo for a couple of seconds.
There is a way to don't activate the servo (keep 1020 pwm) in the initialization of the board?
Regards,
CAMTRIG servo default state
Re: CAMTRIG servo default state
Look in output.cpp
Centering on init depending on the FC
for 328
volatile uint8_t atomicServo[8] = {125,125,125,125,125,125,125,125};
or for 2560
volatile uint16_t atomicServo[8] = {8000,8000,8000,8000,8000,8000,8000,8000};
Centering on init depending on the FC
for 328
volatile uint8_t atomicServo[8] = {125,125,125,125,125,125,125,125};
or for 2560
volatile uint16_t atomicServo[8] = {8000,8000,8000,8000,8000,8000,8000,8000};
Re: CAMTRIG servo default state
Thank you very much Patrick!
So if I understand well if I'm using a a32u4 board, the SERVO3 for CAMTRIG is this one:
#if defined(SERVO)
#if defined(HW_PWM_SERVOS)
// hw servo pwm does not need atomicServo[]
#elif defined(PROMINI) || (defined(PROMICRO) && defined(HWPWM6))
#if defined(AIRPLANE) || defined(HELICOPTER)
// To prevent motor to start at reset. atomicServo[7]=5 or 249 if reversed servo
volatile uint8_t atomicServo[8] = {125,125,125,125,125,125,125,5};
#else
====== (a32u4 board)==>>>> volatile uint8_t atomicServo[8] = {125,125,>>>125<<<<,125,125,125,125,125};
#endif
But why the initial value of the servo is 125? This value should be between 100 and 2000.
In the comment atomicServo[7]=5 means that is connected to channel 5 ?
I tried with atomicServo[3]=7 (my channel of camtrig) and atomicServo[3]=1024 (low pwm) but still activating the servo in the initialization.
Thank you very much for your help.
So if I understand well if I'm using a a32u4 board, the SERVO3 for CAMTRIG is this one:
#if defined(SERVO)
#if defined(HW_PWM_SERVOS)
// hw servo pwm does not need atomicServo[]
#elif defined(PROMINI) || (defined(PROMICRO) && defined(HWPWM6))
#if defined(AIRPLANE) || defined(HELICOPTER)
// To prevent motor to start at reset. atomicServo[7]=5 or 249 if reversed servo
volatile uint8_t atomicServo[8] = {125,125,125,125,125,125,125,5};
#else
====== (a32u4 board)==>>>> volatile uint8_t atomicServo[8] = {125,125,>>>125<<<<,125,125,125,125,125};
#endif
But why the initial value of the servo is 125? This value should be between 100 and 2000.
In the comment atomicServo[7]=5 means that is connected to channel 5 ?
I tried with atomicServo[3]=7 (my channel of camtrig) and atomicServo[3]=1024 (low pwm) but still activating the servo in the initialization.
Thank you very much for your help.
Re: CAMTRIG servo default state
The defines is In mwii.cpp
atomicServo range is 0 - 250.
atomicServo[7]=5 should init servo 7 close to the endpoint.
In this case as motor off.
If you look further down in output.c
ex. (1500-1000 )/4 = 125
servo[i] is transfered to atomicServo[i].
This mean the true resolution on the servos seems to be 250 steps?
Code: Select all
int16_t servo[8] = {1500,1500,1500,1500,1500,1500,1500,1000};
atomicServo range is 0 - 250.
atomicServo[7]=5 should init servo 7 close to the endpoint.
In this case as motor off.
If you look further down in output.c
Code: Select all
atomicServo[i] = (servo[i]-1000)>>2
servo[i] is transfered to atomicServo[i].
This mean the true resolution on the servos seems to be 250 steps?
Re: CAMTRIG servo default state
Thanks Patrick,
Even modifing the init value for servo[8] array:
And the atomicservo initialization:
Don't work
Still activating CAMTRIG servo in the initialization.
I'm thinking now about the MEGA_HW_PWM_SERVOS by default I had activate this parameter even if my board is a 32u4.
If I activate A32U4_4_HW_PWM_SERVOS there is a compile error:
I don't know if this change something, like not using atomicServo array.
Thanks,
Even modifing the init value for servo[8] array:
Code: Select all
int16_t servo[8] = {1500,1500,1000,1500,1500,1500,1500,1000};
And the atomicservo initialization:
Code: Select all
volatile uint8_t atomicServo[8] = {125,125,5,125,125,125,125,125};
Don't work

I'm thinking now about the MEGA_HW_PWM_SERVOS by default I had activate this parameter even if my board is a 32u4.
If I activate A32U4_4_HW_PWM_SERVOS there is a compile error:
for your protection: A32U4_4_HW_PWM_SERVOS was not tested with your coptertype"
I don't know if this change something, like not using atomicServo array.
Thanks,