Not having worked with servos on arduino I'm not sure how to go about this or if an arduino is the best solution. I have looked at servo actuation tutorials and can get a servo to move but rather than waste hours on the wrong approach,possibly someone has a suggestion on how best to achieve this? :
I have a tilt rotor quad, and have a mix on the pitch of the craft and the servo, which works quite well and allows some very fast forward flight. The issue is that although I can limit the servo range with trims, I cannot make the servo move full throw in half a stick of movement. Sometimes I wish to just control tilt, and sometimes just pitch. With expos you can almost achieve this but you only get about 50% of the servo movement before pitch sets in and this makes using acro with tilt impossible.
My idea is to use an arduino pro mini, (or something smaller?) to take the incoming PWM signal, and double it, outputting to the servo so that I have the full range of linear motion on half of my pitch stick input, but the servo PWM is not over driven (or doubled) when it goes to full stick.
I would also like the arduino to respond to another PWM high value which would maintain the last set pwm so that I can initiate a 'cruise control' off another switch on my TX.
- Arduino translates range of input PWM to output pwm
- Arduino also maintains last set output PWM, when second incoming PWM is high.
- Nice to have: programmable input to output ranges
- Nice to have: Arduino control two input and output pwms with third and fourth input pwm (or a combination of both)
Anyone know if the arduino would be fast enough to intercept and relay an s-bus signal? modifying as appropriate... and breaking out the servo channels (s-bus to pwm)... This is obviously more involved, but infinately more camable if I can intercept comms before they get to the flight controller.
Edit: The closest example of code I can find is as follows, and this will do one side of sbus for me (i.e. i will get sbus in and pwm out, which would work for me. however I cant see in the code any variables I can use to manually manipulate values of channels before they are sent out as PWM?
// Arduino pro mini 16 mhz decode sbus or CPPM // detects automatically CCCPM or a SBUS signal.
CODE HERE as I dont have enough space to post: http://openrcforums.com/forum/viewtopic.php?t=6361