views:

117

answers:

3

I would like to control an RC model via USB from my computer. I don't need a real radio control, so controlling the servos directly through cables is sufficitent (yes, there will be cables between the model and the controlling unit). I thought I would build some microcontroller-based device which would be connected to the computer via USB and the servos would be connected to this device.

I'm asking for some hint where I should start. I know how servos are controlled and how should I eventually program the microcontroller to control the servos, but the thing I really don't know much about is the USB communication neither on the device side nor the computer side (which will be Linux).

I would like to do the progamming in C (maybe Assembler for the microcontroller).

Thanks for every hint.

+6  A: 

The easiest way will be to use an RS232 to USB bridge, like the chipsets offered from FTDI. This will simplify both your hardware and pc software design (no USB driver required). Most microcontrollers have at least one RS232 port to connect to.

Some micro-controllers offer USB support. In that case you would need to do some USB programming in them and use libusb on the PC side.

kgiannakakis
+1 The FTDI chip is exactly what i was going to recommend.
Kevin
Some of the FTDI chips have a few GPIO pins that can be used for on/of controls. Some can be configured to provide a simple address/data/control hardware bus. Either of those can avoid the need for a microcontroller as well. But an FTDI plus a PIC or ATTiny to do the servo PWM control may be the simplest approach.
RBerteig
Just remember to `sudo apt-get purge brltty` on Ubuntu.. if you use Ubuntu. That is the braille terminal which is installed by default and assumes that all FTDI chips in the universe are connected to braille terminals.
slebetman
+5  A: 

You might want to start with something like an Arduino, which is a microcontroller on a separate board that you can talk to over USB. There's great development environments and community for Arduino projects.

If you use an FTDI chip alone, you will still need something to understand the RS232 serial instructions from the computer and to control the servo lines. This is where the Arduino will be really helpful.

Greg Hewgill
...and you can even program the Arduino in C.
caf
I'm a little bit unsure about the Arduino - Can I talk to it via USB and have servos connected directly to Arduino board? Do I have to program the board (and write a driver for the computer) for USB communication?
Gandalv
You can connect servos directly to the Arduino. You can write your software (as long as it's small enough) to execute self-contained on the Arduino, or you could have your computer communicate with the Arduino live over a serial port. The Arduino shows up as a regular serial port on the computer, no special PC drivers needed, if you want to go that route.
Greg Hewgill
+2  A: 

USB is a fairly complicated to manage system, and many people choose to use an existing serial over USB chip to avoid having to write OS drivers and also avoid the complexities of programming the gadget side of USB. If you're interested in robots and not already familiar with USB then this is probably the best route.

nategoose