Hello All,There are many small, off-the-shelf boards which can accept TTL or RS232 serial data and control/drive multiple RC servo motor. What I am looking for is the reverse of this operations. That is, I want to measure multiple servo pulses with one small unit, and send the measured values via a TTL or RS232 port.

Do you know if there is any small, off-the-shelf solution for this?Roberto
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Dear John Arne Birkeland,
    Thank you for sharing the code. I am sure it will help me to better understand the solution.
    Thanks,
    Roberto
  • Developer
    Just wrote some code to show the principle for reading type-2 pulses using interrupt on pin change using atmel. BE WARNED! The code will compile (attiny2113), but I have not tested at all in hardware. It's just a pointer for a possible solution. The pin change interrupt should also be rewritten in asm for faster execution (better pulse timing resolution).
    servo_to_rs232.c
  • 3D Robotics
    Type 1 requires access to the PPM signal, which is typically only used inside a RX. That means opening it up, hunting around for the right pin and soldering a wire, which is too much for people. Any generalizable solution to this challenge would use Type 2, which is the way signal actually come out of a RX, with each PWM signal on a different wire.
  • John Arne Birkeland,
    Thank you for your post. I don't have experience with Propeller and Spin. But, I am very much interested with its capabilities and considering to get one to play and learn.

    On the other hand It is interesting to learn your view on Attiny2313. And you think it can handle measurement of 8 servo pulses concurrently altough it has only one 16-bit timer/counter.
    Can I ask a bit more detail how to use Attiny2313 (I use ArduinoMega with ATmega1280, so assume it can be used as weill?)?
    Following figure shows two different possibilities how servo pulses may be input to the "Multi-channel RC servo signal to RS232 converter";


    If servo pulses are in the form of Type-1 then I can imagine that one counter. But can we use 8 I/O lines to be interrupted on pin changes? Or should the inputs "OR"ed together and use one interrupt?
    And how to handle if servo pulses are generated in the form of Type-2?

    It it is not too difficult for you (or some other member) can you please give us C code example how to do "Multi-channel RC servo signal to RS232 convertertion on any ATMEL processor? And can you draw a simple figure to illustrate how to connect the servo pulses to the processor?

    Thanks,
    Roberto
  • Developer
    The Propeller chip can be a real performance beast with 8 x 20mhz cores each with 1:1 clock direct i/o access, dedicated fast memory and a ring access hub for shared main memory. I think maybe Jay Kickliter was referring to my RC receiver module (http://forums.parallax.com/forums/default.aspx?f=25&m=231689). I wrote that way back when I was looking into the Propeller. It had no problems at all decoding 8 servo pulses in a single core. Add one more core for rs232 communication and you still have 6 cores left to play with. So the prop can definitively do servo -> rs232 for as many servo channels as you need (48 channels using 6 cores).

    I have since left the Propeller for more streamlined and faster development using Atmel chips (mature & free C coding environment with hardware interrupts and timers). If using Atmel, I think the Attiny2313 would be well suited for the job. Get a 16bit timer running for timing reference and use interrupt on pin change to detect the servo pulse changes. The rs232 part is plug&play since it's hardwired into the 2313.
  • Analog Mind,

    I think there are many possible use of the "Multi-channel RC servo signal to RS232 converter". As you mentioned, mising servo signals is one of them.
    Thank you for mentioning your experie with PIXACE 28 and using "PULSIN" to measure servo pulses. Does PULSIN a blocking function? ie. it waits for pulse to coplete before issuing another PULSIN. If it waits for the pulse to complete, it can not measure servo pulses smultaneously but sequencially.
    Can you elaborate your PIXACE 28 experience a bit further?
  • Roberto,
    I've not seen an off-the-shelf solution for this, but, like you, I've wanted this capability. I'm not sure if you're goal was like mine, but I wanted to read the servo signals from my 8 ch recevier, mix them with the output of other sensors and then send the new value out to the actual control servo.
    My solution was to use one of the new PICAXE 28 pin chips. I use the "PULSIN" to measure the incoming servo width, cycling thru all 8 ch. The PICAXE has serial out. I run the result thru some math to convert the pulse value back to a usable servo value. My current program runs 32 lines.
    http://servo.My/
  • @Roberto: Yes - the Parallax Propeller can easily do what you want. It would be quite simple to read 8 (or more) channels and output their values to one (or more) serial ports.

    If you really do mean RS232 (as opposed to TTL serial) you would need to add a level shifter (say, a MAX3232), since the Propeller can only do 3.3V TTL serial on its own.
  • PPM signal carry multiple RC channel data in one stream. Therefore it is simple to measure muliple RC channel values in one go. However, not all RC receiver/transmitter use PPM and furthermore it is not easy to find out PPM signal point on the receiver.

    Therefore a generic solution for the "Multi-channel RC servo signal to RS232 converter" should no assumption on the usage of PPM.

    As suggested by Jay Kickliter, the Propeller chip seems to be an interesting approach. The Propeller chip itself costs around $8. I never use it. Can it simultaneously measure 8 (or more) RC pulse and also have an RS232 (or TTL) serial port to communicate?

    Paparazzi "PPM Encoder" is also an interesting product. I could not understand from its page whether it perform as "Multi-channel RC servo signal to RS232 converter" or not?

    Curt Olson's comments is also very interesting. I am sure many people wanting to see his code and learn more about his experiments.
  • I meant to say usb -> serial (not ubs -> serial) :-)
This reply was deleted.