• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Pumpkin drop event

setting up single axis tilt with Naze32 + OSDoge - motor ctrl six in use

#1
Hello all,

I have an interesting issue where i'd like to use the gimbal mode, but ONLY for the pitch. I have read through sever areas where folks turn on the servo gimbal mode but that moves the four motor controls to slots 3,4,5, and 6. Currently 6 is connected to the OSD on the power and ground. I could power the system differently but real all I want to do is control the single axis tilt from one of the ports.

Two things are on my mind here:
1) Setting up ctrl 5 as a servo control and then map a transmitter channel to change the tilt or
2) setup the servo gimbal mode to only care about the pitch

Any thoughts on how I would do either, and/or any other suggestions?

Thanks.
 

joshuabardwell

Senior Member
Mentor
#2
Use the command set gimbal_flags=4. This will cause Aux1-4 to be mirrored out onto pins RC5-8. Then use one of those channels to control a servo manually. You can't do this if you are using SoftSerial or LED features, because those features also need to use pins RC5-8.

Another approach would be to use servo gimbal mode and take power/ground from the motor header that would be for the roll servo, which you don't want to use anyway. It doesn't matter which motor header you pull power/ground from, as they are all parallel with each other.
 
#3
Thanks!
I did a bit more digging in the code and noticed this:



510 // forward AUX1-4 to servo outputs (not constrained)
511 if (gimbalConfig->gimbal_flags & GIMBAL_FORWARDAUX) {
512 forwardAuxChannelsToServos(servoIndex);
513 servoIndex += AUX_FORWARD_CHANNEL_TO_SERVO_COUNT;
514 }

Looked here:


434 STATIC_UNIT_TESTED void forwardAuxChannelsToServos(uint8_t firstServoIndex)
435 {
436 // start forwarding from this channel
437 uint8_t channelOffset = AUX1;
438

439 uint8_t servoOffset;
440 for (servoOffset = 0; servoOffset < AUX_FORWARD_CHANNEL_TO_SERVO_COUNT; servoOffset++) {
441 pwmWriteServo(firstServoIndex + servoOffset, rcData[channelOffset++]);
442 }
443 }

Looking here:
90 #define AUX_FORWARD_CHANNEL_TO_SERVO_COUNT 4

It seems I should be able to keep the LED setup for data output on 5 and forward the single servo I need to 6.
Or make servo on 1, move motor control to 2-5, leave 6 as it is, then use the LED output.

Maybe this is a request I need to post to the cleanflight folks.

Interesting...

Thanks!
 

joshuabardwell

Senior Member
Mentor
#4
I don't mean to presume, but I don't understand why you're set on plugging your OSD into header 6. What does it matter which one it pulls power/ground off of, as long as there is one spare header somewhere?
 
#5
Great question - I'm not 100% set on it, the boards are built to connect that way in a stack. I've already put it all together so I'm wondering if there is a way to avoid resoldering the boards.

A few thoughts:
1) it felt as though this should be doable in software but after reading a bit I did overlook how they have the timers hooked up.
2) there is an ongoing discussion on how to support it in the future of cleanflight and (best of all they put in a temp solution... that brings me to three...)
3) on the naze board if you set the led strip on, and turn on forwarding it will forward aux1 and aux2 to the motor output pins 5&6. - this will solve what I would like to try for today. Sweet! see this link.. https://github.com/cleanflight/cleanflight/pull/675
4) I think I have a way to solder on large enough angle pins to still allow the connection and power it from the OSD. If need be I'll go that way as well.

A note on the OSD board, I really like that it has all of the needed power for the cam, the video transmitter, and the main board because it makes for a clean low wire installation with the ability to run OPTO ESCs.

Thank you for the thoughts and questions as I greatly appreciate them.