Let's Make Robots!

RasPi and RC

Hi

This is a bit of a repetition of a question I added to this post, but I tought I'd repost as I don't think anyone will see the other.

I've managed to get my hands on a raspberry pi, and I was wondering; Is it worth using for a transmitter, or would I be better off using a standard microcontroller? Could it handle working in real-time? Is it possible to output PPM on one of the GPIO pins, or would I be better off using a secondary microcontroller?

If I use the pi, how hard would it be to strip back the OS to just run the RC program, so it will boot and run quicker?

Also, does anyone know what the best (and cheapest) way to connect a small phone-type LCD to it? I know that it's got a DSI connector, but I don't know whether that is usable at the moment.

I know I'd need to connect at least 4 analogue inputs to it (probably more like 6), so what's the best way to do this without eating too much into my pins? I'd probably want to add about the same amount of toggle switches and stuff, too.

 

More info

 

If possible, this is what I'd like to wire up to the pi;

 

A PPM transmitter module (extra questions: 1; could I connect 2 types to the same pin, and then select which type by switching the power to the modules on and off, or would this cause interference?  2; could two 2.4ghz modules (one in use, one switched off) share an aerial without problems, or would I be better with 2 seperate aerials?)

A display (Monochrome, preferably graphic)

Probably about 6 anologue inputs (2 sticks, and 2 extra pots)

Probably about 6 toggle switches

Display input; Ideally a rotary encoder (jogwheel), although probably a few push buttons

Possibly a space for an xbee-type radio

Serial in, for telemetry from the transmitter module

 

These are what I've thought of so far. Any links to information about interfacing to these would be really useful.

One more question; although I probably won't be doing a project like this for a while, would the Pi have the grunt to work as a groundstation for a UAV/UGV (probably based around the ardupilot setup)?

Thanks in advance.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Sorry, I was meaning one like with an interface like this one. I know these work with the pi (there's a tutorial on adafruit's website), although I'm not sure about the nokia-type graphic ones.

birdmun's picture

Standing back and letting your idea sink in for a few days, says to me that maybe if remote control builders could get a hold of a computing platform of the RPi size and cost,  they would find a way to incorporate it into their design. I personally can't imagine how having a SBC in a transmitter can be used/useful, but, that doesn't mean there isn't a way.

Re: PPM. Why are you considering PPM when you will be working on your own TX/RX setup. Unless you are transimitting on standard RC frequencies, I would believe that you will have to have your own receiver in whatever you are controlling. That being the case, it shouldn't matter how you send the data to the receiver as long as it is error corrected.

Re: dual transmitters. Are you considering using different technologies that transmit in the 2.4Ghz spectrum?

From the requirements you have mentioned so far, it would seem a standard microcontroller could handle everything you want to do (for now). It looks like a PICAXE 40x2 should have all the I/O you would require to accomplish your current task, as you lay it out.

I have even seen a remote control setup that used a joystick and an xbee as the base and then the vehicle had the other xbee and a microcontroller. The xbee's have digital I/O pins and to a point could be used to probably control a display of some type, as long as they got the proper data from the microcontroller on the other end of the line. :)

Thanks for the comment. I'll try and work through and answer your questions. Forgive me if my reasons don't make sense.

1;same as the answer to 4.

2; I'm considering using PPM as I'll probably use an already-availiable transmitter/reciver setup, at least at the start. I'd like to use something that's allready availiable as; 1, I'll be using this at an RC club, and don't want to cause interference. A ready-made transmitter-reciver setup will be designed to avoid this, wheras an XBEE-type system may not be. 2, With the systems I'm looking at using (FrSky/Flysky), the recivers are cheap, and small. As of yet, I don't think I can manage to manufacture something suficiently small, or for similar/less cost. This doesn't mean I'm not going to try, but that would be a bit more of a separate project.

3; Simple answer here. Although this is just an idea I've been throwing around, I may want to be able to switch between the FrSky and FlySky modules as the flysky ones are cheap, but the FrSky ones have telemetry etc. and are more reliable.

4; I may yet use a standard microcontroller, it's just that I have a Pi, and I'd be intrested to see if I can get it to work with it. the pi has more processing power, so I can use it for more advanced things like, (possibly) acting as a UAV ground station, graphing/recording/analysing telemetry data, etc. I'm still just flinging ideas around here, and trying to come up with a plan.

RobotFreak's picture

At Campus Party some guys from the UK showed their Raspberry Pi robot. They use an expansion board with a PCF9685 I2C PWM controller to get more PWM channels to control servos and motors.

More infos here:

http://www.cl.cam.ac.uk/~db434/raspi/

Thanks for the link. I don't need to drive servos from the board for this project, however the site looks really useful. I might yet use it to make a robot...

6677's picture

The pi only has a single PWM capable pin.

It runs linux so really with a little editing of your linux settings you should be able to stop it from booting select other programs and then add your program to the startup application list, theres posts about that on the raspberry pi forums.

The DSI connector isn't enabled on the device firmware, also DSI devices aren't always standardised. Currently both CSI and DSI connectors are basically useless. You could use one of these: http://www.adafruit.com/products/910  The pi has an RCA output on it which you would use (and these have been tested with the pi)

There are NO analogue inputs and I don't think the pins can read a PWM type signal if you were to use an analogue to digital converter.

 

Your best bet if you want to use the pi is to connect a microcontroller over the serial pins (which is does possess at least), recommended is a 3.3v microcontroller as those are the logic levels the pi uses, you could use a 2 way level shifter though instead if you want to use a 5v microcontroller.

Thanks for the reply. I know the RasPi only has one pwm pin, I was wondering if this (or any other pin, for that matter) could be used as a PPM output, and fed into something like this.

Do you have any links to the posts about cutting down the OS? They'd come in handy. I found this set of tutorials, but to develop this into what I'd need would go well beyond my capabilities.

I'd considered one of those screens, but they're a bit pricey, and I'd like to keep the costs down. I'll probably rig it up to a cheap monochrome display (something like this), if possible. I know that it's possible to wire up a cheap character LCD, but I'd prefer something that can do some graphics.

So far as anologue inputs go, I was thinking probably a digital to analogue converter, or a resistor-capacitor network (like this). I'm not sure whether an R/C network would be high enough resolution, though.

I probably will end up connecting an external microcontroller, although possibly using i2c or somethign if possible, as I'd like to use the serial for telemetry and possibly an xbee-type module.

6677's picture

That display connects via serial so it would have to be either the display or the xbee. Also the pi won't recognise serially attached displays as being an actual display if thats what you wanted, you would have to have your application outputting specific data to the display but thats not really an issue. I believe theres a USB board for xbee modules which might be useful.

The reason why your tutorial goes into too much depth is because its about scratch building an OS that will be running on the pi. The default pi OS is rasbian which is just a version of debian. Theres tonnes of resources out there on debian and how to change which programs are loaded on startup. Rasbian by default doesn't load into the desktop environment as far as I'm aware so I assume the tutorials on the pi forums on how to make it load the desktop would apply (as the desktop is essentially an application)

I'll probably use a paralel interface LCD if possible, as they are usually way cheaper. I know the display won't show the same as the main display, so I'll have to write the GUI for the LCD. the USB XBEE board might be handy, as I'm not too fussed about that, so I can easily add that later.

I'll probably follow the tutorial on building the OS, but for this a stripped down version of this is, I think, my best bet.

Thanks for the reply

6677's picture
The pi has no usable parallel interface