A couple of weeks ago I asked how you guys would stabilize and navigate.

Chris Anderson said FMA-Copilot and use the rudder to navigate

I must say first... FMA rocks, keeps it extremely stable, there might be a tiny amount of elevation loss, but overall it's an amazing little package for it's cost. Our only problem with it had been obtaining one.

Anyways, now that we have it stabilizing I've been attempting to control the rudder using the microcontroller as well as the radio. I have a switch setup on the radio to change from auto mode to manual mode.... but i've been trying to read the signals sent by the receiver (Hitec QPCM) and then send them out on another pin for manual control, or just ignore them for automode. However my limited knowledge of programming is hindering me. I'm currently using CCP capture mode, to read the period inbetween signals. However i'm not sure how to get the duty cycle of the PWM.

software help would be appreciated.

ways around the software would be even better.

Tags: CCP, receiver, servos

Views: 7

Reply to This

Replies to This Discussion

what processor are you using? usually i use pulsein . you dont want duty cycle you want the pulse width.
PIC18F8520
pulse width = duty cycle i believe.

the microchip manual defines duty cycle as time that the signal is high compared to time that the signal is.
servos work on pulse width modulation . "pulse width " is how long the pulse stays high. duty cycle is a comparison between the high and the low time of a pulse
_----------------------______________----------------_____________-------____
| pulse width | |duty cycle(%of hi&lo pulse) |
read more here http://www.seattlerobotics.org/guide/servos.html
exactly.
Alright i just did it with a relay.

I just took the signal wires and hooked them into a SPDT and then sent a signal from the processor to the relay to decide which way to go.

DOH! Should have thought of that one a while ago.
alright so the SPDT switch didn't work... because there wasn't enough current coming out of the micro controller to cause a switch.

instead I just made a resistor capacitor circuit that changed the square wave into an analog aka sine wave.

much easier to interpret now. :)

RSS

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The third round was a reliablilty/aerial photography round for both planes and copters, which is now closed. Stay tuned for the next round, beginning soon.

A list of all T3 contests is here

 

Groups

© 2012   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service