Interfacing a PICAXE with an RC Servo

P4080399_-_sml.jpg

test_code.bas (48Bytes)
2.0.bas (330Bytes)

Update 26/04/2009

I have added a video to show the picaxe modifying the servo signal based on the output from a Maxbotix EZ0 (EZ1 version here at LMR). The following image is also from that setup. The new code is attached (test code 2.0).

picopter_-close-_build.jpg

Summary

A small, cheap and light-weight PICAX-08M can be used to interface/interfere with the signals sent from an RC receiver to a Servo, allowing for all sorts of autopilot-style projects with your existing RC toys/new projects.

The fiddly-bits

I have been wanting to play around with some sort of flying and semi-autonomous robot for quite a while. The only problem for me has been the weight of the microcontroller(s) and sensor(s) to facilitate this on a reasonably small flying platform (small RC Helicopter etc).

I had used PICAXE-08M's in previous projects, and loved the simplicity (and the lack of weight) of their packaging (8-pin DIL). The thing that worried me was the processing speed/accuracy of the chip in an environment as physically "harsh" as an RC Helicopter being flown by yours-truly :)

So, a test was in order. I cobbled together the following circuit on a piece of vero-board (see main pic), downloaded a simple program (attached at top) to the 08M, fired up my RC Helicopter and...

picaxe-lama-circuit.gif

...it worked!!!

The 08M was perfectly capable of reading the servo-control pulses, and repeating them. It did this in a completely transparent way, with no change to the handling of the helicopter (see video). As an added bonus, the Servos on my particular helicopter (LAMA V4) require a 5 volt supply, hence the simplicity of the above circuit because I can directly connect the 08M inline.

Now, it is up to you. Turn this into something really interesting (RC autopilot...).

If you are interested, there is a bit more information on this and some of my other projects over at my blog.

https://www.youtube.com/watch?v=35R-mz66_vc

Nice…
This looks like it will be a really fun, interesting project. One question - have you done any experiments to see how much extra weight the LAMA can lift?

cool! might be a good way to
cool! might be a good way to make a fail saif for rc stuff?

I2C

Could you make an I2C slave device which, when queried, would return the position of the control stick on the transmitter?

Could you make an device which would be an I2C interface to a servo?

This would be the start of something pretty cool. A bunch of I2C devices hanging off a bus controlled by an I2C master…

it would
Yes, it would. I want to get a decent range ultrasonic distance sensor and hook it up to the picaxe. Then, it could back off the forward tilt as it got close to something. That will be my next step at least. It could just as easily do the same intercepting the speed control to an RC car, stopping crashes etc.

not sure
i am not sure about the max weight, but I will be testing that soon. I will pm you when I work it out.

re i2c

I haven’t played with i2c, but I am sure it would be easy to do. The picaxe I used doesn’t support it, but the 18X does, I think. It would be easy to encode the pulse size from the servo, and transmit it via i2c. If sending/recieving is as easy with i2c as it is with rs232/485 (which I have played with), it should be doable in a small number lines of code. It would be very cool to connect servos to controllers using i2c! I will look into the i2c when I get a bigger picaxe chip, soon.

Follow up
I just bought one of these: http://www.maxbotix.com/downloads.html#Order_EZ0 - the Maxbotix EZ0 sonar range-finder. I will be posting a proper robot post, and a sensor info post, when this gets hooked up and working on the helicopter, as it looks to be a phenomenally awesome sonar range-finder.

I made a PCB layout that
I made a PCB layout that should hold a Picaxe 08, connector from receiver and to servo and a connector for an analogue distance sensor. Dont know how to put it up but if somebody wants it just ask.

Sounds cool, see if you can
Sounds cool, see if you can convert it to jpg or pdf and post it. Your program might do that for you.

I’m new to this so hope this

Picaxe_08_for_RC.jpg

I'm new to this so hope this works!

Open Servo

Sounds like the open servo project:

http://openservo.org/

Looks good, have you tried
Looks good, have you tried it out yet? What kind of robot is it for?

not yet, i dont have the
not yet, i dont have the materials to make the PCB so i need to find some way to get it fabricated. It isnt for a robot, it,s for my rc car, I need some security because it keeps crashing…