for a while I have been pondering how to take a spare channel on my RC receiver (Futaba for my Helicopter in this case) and use that spare channel to somehow send signals or binary ON/OFF messages to an onboard PICAXE which I could subsequently do something with. Like, enable NAV lights when greater than 25% throttle.. when greater than 35% then turn on Strobe light also - etc. - When less than 25% enable onboard glow plug!?
The output of a Servo channel is Pulse Width Modulation as far as I know (wiki) and the PICAXE has plenty of high resolution ADC inputs which will, at a given point in time, take a voltage sample and then give that a number to represent it's value - the higher the voltage, the higher the number - simple.
The PWM signal is too messy to try and sample with the ADC(wiki) inputs of the PICAXE direct. So all I did is put a capacitor across it, with a resistor accross the capacitor in turn. The resistor is doing it's best to dischange the capacitor whilst the PWM signal is coming in as charge accross the capacitor - the more the PWM's duty cycle(the more your transmitter stick is raised), the more effective charge gets into the capacitor therefore the higher the PICAXE ADC reads -comes sample time. You can then make programmatic decisions based upon the sampled level you get. I used a Cap which was much bigger than I needed(all I had lying around!).. you can experiment with the values of the Cap and resistor in the sample circuit. The challenge there is the have a value which is still responsive enough but there is no wavering to the ADC when it is sampling it - have a play, you'll see what I mean.
Take a look at the linked Video below on Youtube, or the higher resolution on direct from my blog (better).
Youtube : http://www.youtube.com/watch?v=r91yWyIxI6U
My Blog Host : http://vk3jap.net/media/PICAXE%208M%20SERVO%20PWM.mp4
imagine what you can do... just another cool use of a PICAXE Microcontroller..
- My blog : http://vk3jap.net/blog
The output of a Servo channel is Pulse Width Modulation as far as I know (wiki) and the PICAXE has plenty of high resolution ADC inputs which will, at a given point in time, take a voltage sample and then give that a number to represent it's value - the higher the voltage, the higher the number - simple.
The PWM signal is too messy to try and sample with the ADC(wiki) inputs of the PICAXE direct. So all I did is put a capacitor across it, with a resistor accross the capacitor in turn. The resistor is doing it's best to dischange the capacitor whilst the PWM signal is coming in as charge accross the capacitor - the more the PWM's duty cycle(the more your transmitter stick is raised), the more effective charge gets into the capacitor therefore the higher the PICAXE ADC reads -comes sample time. You can then make programmatic decisions based upon the sampled level you get. I used a Cap which was much bigger than I needed(all I had lying around!).. you can experiment with the values of the Cap and resistor in the sample circuit. The challenge there is the have a value which is still responsive enough but there is no wavering to the ADC when it is sampling it - have a play, you'll see what I mean.
Take a look at the linked Video below on Youtube, or the higher resolution on direct from my blog (better).
Youtube : http://www.youtube.com/watch?v=r91yWyIxI6U
My Blog Host : http://vk3jap.net/media/PICAXE%208M%20SERVO%20PWM.mp4
imagine what you can do... just another cool use of a PICAXE Microcontroller..
- My blog : http://vk3jap.net/blog