Reading pulses from RC receiver
Meistro
Posts: 12
Hey folks,
I'm working on something where I would like to view and record the values that my Futaba receiver is sending my servo as I'm moving it with the radio. Realtime data is what I'm looking for. I messed around with Stamplot but I can't seem to figure it out. I'm using a BS2 and I'm trying to do a learning mode type scenerio to record the data that the servo is recieving.
Thanks
meistro
I'm working on something where I would like to view and record the values that my Futaba receiver is sending my servo as I'm moving it with the radio. Realtime data is what I'm looking for. I messed around with Stamplot but I can't seem to figure it out. I'm using a BS2 and I'm trying to do a learning mode type scenerio to record the data that the servo is recieving.
Thanks
meistro
Comments
To receive such a pulse train, the Stamp can measure the width of the pulses coming in by using a PULSIN statement in a loop (to measure successive pulses). Read the section in the Stamp Basic Manual on PULSIN for details.
Will this remain true with the digital R/C transmitters/receivers?
I assume that it will, as long as they're controlling the kinds of servos we're already using (though maybe not with those "digital servos"?).
My next question is, how can I log this data?
2) Most digital servos still use the same control pulses, they just use digital circuitry rather than analog circuitry to run the servo (and/or the receiver).
3) What do you actually want to log? The problem is that these pulses are coming in quickly (every 20ms or so) and the Stamp has to be ready to measure the next pulse or it will be missed. If you use a BS2p or BS2pe instead of a BS2, you will easily be able to attach some I2C EEPROMs. You can attach up to 4 of these to a pair of I/O pins (for a total of 512K bytes using a 24LC1025 from Microchip or a 24C1024 from Atmel). They can write in about 5ms leaving enough time for the next R/C pulse to be measured. You can use I2C EEPROMs with a BS2, but the I/O has to be done by subroutine and is much slower than with the BS2p series devices.
Another thing: GPS is accurate in the Y direction to only several meters, so you can't really use it as a ground avoidance mechanism. You'll have to figure out how to see the ground (hint: pretty much laser is the only viable option if you want high speeds.)
Assuming that the helicopter can carry all the electronics, it would be possible to do all the simple actions (hover, take off, land) relatively simply with respect to actions such as "Do flip" or "Fly to New York".
If you can get it to hover autonomously, post some pictures! I'd love to see some...