Two Channel RC Pulse to PWM converter

Control Systems & Robotics Topics
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Two Channel RC Pulse to PWM converter

Post by Neo » Sun Nov 29, 2009 10:49 pm

10/28/00 - Changed the code base to integrate Mixed mode with normal mode operation. This modification uses DB0 jumper to select between normal 2 channel mode and a mode where the A and B channels are mixed to allow one joystick to control two motors for speed and direction.

A common problem for hobby robotics is controlling the drive level to a motor. Often hacked R/C servo's are used, but they typically have poor control range. Many micro-controllers don't have built in PWM or the PWM is very slow and makes for lots of motor buzz. This paper describes an AVR chip and software that converts two easily formed R/C pulse signals (often directly supported by inexpensive controllers like the Basic Stamp) and converts them into a PWM signal suitable for driving small motors.

This AVR application and the reference board design is very much like the hobby shop ESC (Electronic Speed Controller) for Electric R/C cars, etc. The value of this AVR software application is that one can interface the output signals of the AVR chip to a wide variety of H-Bridge driver chips with a current capacity from 600ma to 5+ amps. Or, it could drive a discrete FET bridge for even higher capacities.

The software runs on an Atmel AT90S1200 chip with a 16mhz clock and has the following characteristics:
  • Converts R/C pulses to 0-100% forward/reverse PWM signal @ ~1.4 kHz.
  • Forward/Reverse and Enable outputs for each channel
  • Output disable input for each channel
  • In-circuit programmable via an Atmel STK200 dongle and ISP software
  • Missing pulse detection kills output if R/C signal fails
  • Jumper selectable options:
    Zero drive dead-band (0, 4, 8 and 12 us.)
    Brake/Coast at zero drive
    1.3-1.8 ms. or 1.0-2.0 ms. pulse range
I created a reference design board for the chip that uses an sn754410 chip as the output driver. Any H-Bridge motor driver chip or circuit could be driven by this design (within the limits of the converter chip output drive). The TI chip is an improved drop-in replacement for the standard L293D chip. The TI chip has a 1 Amp output capacity per channel with a maximum motor supply voltage of 35v.

The following users guide describes how the reference board works when loaded with this version.
readme.pdf
(104.12 KiB) Downloaded 405 times
referenceboard.jpg
referenceboard.jpg (20.92 KiB) Viewed 3576 times
The software is written for the GNU avr-gcc assembler.
The schematic and circuit board were designed using the Eagle cad package.
A demo/evaluation copy can be downloaded from http://www.cadsoft.de.
RC Speed Control brd.gif
RC Speed Control brd.gif (80.8 KiB) Viewed 3576 times
The following attached file contains the software, makefile, schematic and printed circuit board design.
rcspeed.zip
(1.17 MiB) Downloaded 480 times
The primary code file is main.s. The code is very simple and should be easily ported to your favourite development environment (Atmel assembler, ICC, IAR, etc). The software includes two version: Mixed and straight. Mixed mode is intended for applications where one wants to use a single joystick, on R/C radio gear, to steer a differential drive robot (e.g tank). One channel controls forward/reverse and the other channel controls the differential drive between the wheels. Straight mode just does two independent channel conversion.

All my designs and code are available for any non-commercial or non-profit use without restrictions. If you want to use them commercially, you need to contact me and get permission.

Courtesy: Larry Barello
Post Reply

Return to “Control Systems & Robotics”