How to make a Robot - Dilbert II

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

How to make a Robot - Dilbert II

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

Dilbert II

Spring 2000, I decided to rebuild Dilbert on a printed circuit board using the Atmel AT90S8535 processor. This processor is very much like the 8515 in Dilbert with three significant exceptions: it contains an on-board 8 channel 10 bit A/D, it doesn't have memory expansion capability and there is a separate RTC timer/clock circuit.

The PCB was the first significant design I have done using the freeware version of EAGLE and the prototyping house of AP Circuits. AP Circuits is great: generate the Gerber and Excellon files from EAGLE and then FTP them to AP Circuits and have finished boards on your doorstep in 48 hours. It is even reasonably cheap: $70 got me two main boards for Dilbert. My second project, the RC Speed Controller, was even cheaper: I purchased 10 proto boards for $90. Almost all the money is in the setup and shipping fees. The boards are practically free.

Unfortunately, I had some errors and omissions in my original design so the main board has four or five cuts and jumpers. The other big problem is that I am now coding in C. C has a bit of overhead associated with it, but the real problem is that it is so much easier to generate functionality, that I have filled up the 8kb of the 8535. So, in the next generation board I will use the AT90MEGA103 part. It has plenty of I/O, interrupt pins, etc. and 128kb of code space: 16 times the 8535.

The current board and software supports the following hardware:
  • Three Sharp GP2D02 proximity detectors (left, right, forward) for navigating. See Multiplexing Sharp Proximity Sensors for details of how I used only four lines to control three units.
  • Two Pseudo Quadrature Encoder input channels (modified algorithm, only 2X). See Motion Control in Small Robots for more information.
  • Two PWM Locked-Antiphase running at ~18khz, driving an L293D motor driver chip.
  • 4x20 LCD display running in nibble mode.
  • Microphone input for fire-alarm detection (sound activation) using a Hardwired audio filter and peak detector circuit using an LM324 quad op amp and a handful of parts.
  • Single switch for user input (Tap: change menu, Hold: change option, Hold-long: reset)
  • 5 channels A/D for floor sensors comprising of 5 photo-reflex detectors (Digikey, #QRD1114QT-ND). I wrote a paper about line following floor sensor design
  • 2 channels A/D with 10v supply for PIN diode flame detectors
  • Switched 12v output for driving fire extinguisher fan.
  • LED for basic output (Flashes while everything is working properly).
  • Pseudo RS-232 drivers for connecting to host computer.
  • Circuit Programming dongle interface.
All I/O lines are used on this board.

Power:
  • Home made 12 cell NiMh battery pack. I used 650 mah AAA Batteries from Thomas Distributing. The motors draw about .15A when idle (Low inductance - oops) so I only get about four hours of run time from a pack.
  • National sells a Simple Switcher evaluation kit, which, is an $8 switcher power supply. I run both the raw battery power and the output of the switcher (+5v) for the logic into the controller board
Mechanical:
  • Two modified MAXON gear head motors.
  • Home made wheel hubs with press fit encoder wheels
  • Home made wheel with 2" O-Ring tires
  • Single contact forward caster made of Delrin
  • Less than 6" x 6" in dimension.
  • 1/16th" brass wire spring mounted floor detectors
  • Commercial 400 count encoder wheels and HP 9100 series detectors.
Software:
The complete package, as of 2/28/01 is attached below.
dilbert2.zip
(25.71 KiB) Downloaded 435 times
It requires the latest version of GCC AvrX 2.5b which, in turn requires avr-gcc 2.97

Picture Gallery
Here are front and rear quarter views along with a side view that shows the home made 12 cell battery pack. The wheels are 2" in diameter and the overall length is about 5 1/2". The Sharp GP2DO2 sensors are just mounted and not wired in yet. I'll simply lift the code from Dilbert when it comes time to use them.
frontquarter.jpg
frontquarter.jpg (40.49 KiB) Viewed 5628 times
sideview.jpg
sideview.jpg (41.09 KiB) Viewed 5628 times
Various views of the motor mounts, the commercial encoder wheels (400 lines, 1" in diameter!) and the home made wheels and o-ring tires.
encoder1.jpg
encoder1.jpg (31.7 KiB) Viewed 5628 times
encoder2.jpg
encoder2.jpg (39.78 KiB) Viewed 5628 times
bottomview.jpg
bottomview.jpg (41.09 KiB) Viewed 5628 times
Close up views of the floor sensor assembly and how it is mounted to the chassis. The wire spacers, that the sensor rides upon, are hand bent 1/16" brass rod material from a hobby shop.
frontview.jpg
frontview.jpg (40.91 KiB) Viewed 5628 times
floorsensor.jpg
floorsensor.jpg (40.32 KiB) Viewed 5628 times
Several views of the user interface and the controller board. The LCD is displaying the absolute X, Y and Theta position of the robot using floating point odometry in the motor control code. The "Off" in the corner is the status of the microphone audio detect circuitry. The small square chip to the lower right on the controller is the actual CPU with all the memory and I/O. The shiny square is an attempt at a heat sink for the motor driver chip. The other two chips are the hex inverter, used for various functions, and the quad op-amp used for the audio detect circuit.
lcddisplay.jpg
lcddisplay.jpg (38.15 KiB) Viewed 5628 times
userif.jpg
userif.jpg (40.47 KiB) Viewed 5628 times
controlboard.jpg
controlboard.jpg (40.86 KiB) Viewed 5628 times
As you can see, the switcher power supply is very tiny. To simplify replacing batteries, and looking forward to dual battery packs for a 28v supply, I built a little switch module with headers for two batteries (one replaced with a jumper) and the switcher.
switcher.jpg
switcher.jpg (39.96 KiB) Viewed 5628 times
powerswitch.jpg
powerswitch.jpg (34.78 KiB) Viewed 5628 times
Courtesy: Larry Barello
User avatar
Larry
Posts: 1
Joined: Mon Mar 29, 2010 9:14 pm
Location: Colorado Springs, CO

Re: How to make a Robot - Dilbert II

Post by Larry » Mon Mar 29, 2010 9:21 pm

Nice clean C code. Efficient fixed-point math. Probably too terse for someone who hasn't done this kind of thing before but I can probably save a good bit of time implementing a camera-control platform on a PIC18.
Post Reply

Return to “Control Systems & Robotics”