3D Robotics

Basic Stamp autopilot tutorial, part 2

Okay, now that we have the BASIC Stamp board driving the servos, let's now have it read the R/C receiver signals. This is a simple matter of plugging in two cables from the receiver to the board. I've shown two ways in the photo here: one is with a female-to-female cable, if you have one, plugged straight into the board servo ports (I used port 13 in this example); the other is to strip and tin the wires from a regular servo cable and push them into the breadboard, then connecting another wire to one of the Stamp pins (that's the white wire that goes from the breadboard to pin 5)

The code here will test your hardware and see if it's working. The aileron stick on your RC transmitter should drive the servo (it's a little jerky, due to processor delays, but nothing too serious). When you flip the gear switch (channel 5) on your transmitter, the board will go into "autonomous mode" and move the servos itself. Flip the switch back and you're back in manual control.

Next, we'll connect the GPS in this post.

Previous posts in this series:

--Getting started with servos
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Thank Chris!
    Ok, it means I shall move to design a chip that communicates with the receiver and then send data back via serial to another chip ( servo driver).
    It is curious that in robotics many people use PICs instead in aircraft RC many use Atmels, I don't understand the reason.... Anyway, thank Chris
    See you soon on this board.
    Bye!
  • 3D Robotics
    I don't know anything about PICs (we use Atmels), but the usual solution when you want to drive a lot of servos is to use a separate servo driver chip or board and just communicated with that via serial. See this post for examples.
  • Chris,
    thank you for your reply, trust me I have discovered this blog just this morning and soon I started loving it and its contents...:)
    Anyway... let me explain much better my problem. PICs have a "capture" mode in which it ios possible to capture exactly the timing between each pulse from a PWM source.
    Ok, as you already now (and me too from my experience with rc aircraft :D ) you have many outputs (at least 4 in entry radios/receiver) as many channel you have to drive as many servos you want to equip your aircraft to. Let's say: a specific channel for every servo on the aircraft. Now I come up with my dilemma, how it is possible to "capture" this signals, or much better, is it possible to implement a program that generates PWM output while reading a PWM input? In the same time I mean... Just to be clear, in most PICs you have only 2 pins that can capture those signals, but they are only 2!! So to drive up to 2 servos is not a big deal, I could write a so simple program in one hour...
    But what happens if I want to drive up to 5 different servos??? I didn't find any suitable link on google or code about this problem. I was thinking if it is possible to implement a "hardware" solution like for istance...a multiplexer after the receiver, or something like that...
    I hope you or other forum members could help me in this problem, perhaps simple for you experienced guys, very hard for a n00b...
    I'm going to take a look on internet anyway.
    Thank you very much.
    Bye!
  • 3D Robotics
    Just read this post and the code here: you just get the processor to read the RC PWM. We don't use PICs so I can't advise you on that, but Google "read PWM with PIC" and you should find plenty of code.
  • Dear Chris,

    I'm developing programs with PIC microcontrollers, your tutorial is veeeeery good, but please. could you explain how is it possible to interface a common FM receiver (for rc aircraft) with a microcontroller????
    I built many rc aircrafts (on my owm) and now I would like to build a UAV.
    If you can tell me how or forward me to any link on the net...
    I joined this group now, but I is what I was looking for... :)
    thank you in advance
  • 3D Robotics
    For Arduino, you just want to use the PWM out function. We use that in our ArduPilot code, and you can see other examples here.
  • Chris,

    Your tutorials have been extremely helpful, so far I have made it to moving servo's through my adruino and now finally able to read signals from my spektrum 6100 receiver, at this point i am not sure how to regenerate or forward them to the attached servo's ..

    understanding that this specific tutorial is for the parllax chip, would you recommend any place for me to view sample code to be able to do this? i already read the sections on arduino and the stuff that Jordi has but was not able to find anything that would help... thanks in advance!
  • 3D Robotics
    Simon,

    The transmitter you need is actually the FMA co-pilot that also handles "wing leveling" and other stabalization. You can read about the basics in this post: http://fmadirect.com/products.htm?cat=29&nid=7

    To answer your question, you need to start with a RC plane (transmitter, receiver [in this case the FMA co-pilot] and servos), which is how you'll take off and land, and then when you're in the air you can have the Basic Stamp takes over the navigation while the FMA co-pilot takes over stabalization (typically you'll use channel 5 to trigger one and channel 6 to trigger the other).

    Of course the Receiver is a servo controller, but we intercept its signals with the Basic Stamp and regenerate them so that the Stamp can generate its own commands when it's in control

    Do you have an airframe and Tx/Rx already?
  • Where can I buy a transmitter/receiver like that one?

    Chris, could you explain to me how this setup works? From what I've read, I always thought that the receiver could act as a servo controller by itself. If I had that receiver, and a Parallax Servo Controller, how would I interface it?
This reply was deleted.