Let's Make Robots!

Robot Project #1, Take 1: Drunken Vampire Robot

Trundles around attempting to avoid obstacles (and sunlight).

This is the basic Start Here! robot, whose job is to move forward until it detects an obstacle and then stop and decide which direction it should turn.  So far I haven't varied anything from the instructions or added anything of my own to it; this is my first robot project ever and I just needed to get my feet wet.  (Thanks, LMR, for making it so easy to get started!)

I call it the drunken vampire robot because it can't move in a straight line (drunken) and it avoids bright sunlight (vampire).  The sunlight issue doesn't concern me right now, but I would like to have better control over the robot's motion.  One of the motors rotates faster than the other, which is apparently not an uncommon problem.  I do wonder if it's a problem with the motors themselves or if it could be caused by wire splicing (small contact area in connection between spliced wires = more resistance = smaller current = slower motor speed?).  In any case, solutions I've considered are:

  1. Increase the radius of the slower wheel until its speed matches the faster one.  Not a great option, since I'd have to increase the radius by about 5 mm to makes the speeds match, which would make the robot significantly lopsided and could cause other problems with the motion.
  2. Learn a general method for controlling motor speed.  This seems to involve pulse width modulation (PWM), which is unfamiliar to me but seems very useful, so this is the route I plan to take.

Next step: Learn what this PWM business is all about.  I get the general idea behind pulse width modulation: Approximate an analog voltage by turning a digital signal on/off, adjusting frequency and duty cycle appropriately.  Most of it seems to be programming, but it requires a timer.  So I need to investigate: Does my Picaxe 28X1 have a timer in it?  Or will I need to get more/different electronics hardware?

In any case, hopefully I will soon be posting another version of this robot that involves some modifications of my own.

Comment viewing options

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

like it.good luck!

The best description yet!

Yes, motors with different speeds can be a challenge. I've solved the problem (once) by taking the motors apart and reassembling with copious gear grease while making sure nothing binds when they're reassembled.

Besides that, you're correct. You can solve with hardware (increased diameter) or in the software with PWM. Regarding PWM, with the 28X1 it's a challenge. It does have a timer for PWM but it's shared with the servo so it's kind of one or the other. A couple links with some more info...

http://letsmakerobots.com/node/7453

http://letsmakerobots.com/node/20374

On my one "drunken bot" I've considered putting a proper wattage resistor or a potentiometer on the output for the fast motor to slow it down. That project is so back-burner though.. a long time since I dusted it off.

Also, rubber bands FTW! :)

Thanks for the info!  Based on your comments and what I saw in the discussions you linked, probably what I'll do is forget about the servo for a while and just see if I can use the Picaxe 28X and PWM to control a motor.  Best to start simple, I think.  Then I can reassess and decide where to go from there.