View Single Post
  #3   Spotlight this post!  
Unread 16-01-2008, 20:54
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: How do you make the robot turn a perfect 90

During the initial debugging of the code I would start by only printf-ing the values that I would send to the motors, but keep the motors stopped by sending them 127's instead. That way I could be sure the code was doing something reasonable. You could manually rotate the robot and watch how the code reacts.

When the printf-ed values look reasonable, change the code to send the values to the motors and PUT THE ROBOT UP ON BLOCKS so the wheels can't touch the floor. Then you can see which way the wheels are spinning (it's easy to get things backwards!) Again, you can manually rotate the robot and see what happens.

Only when everything looked reasonable after those tests would I let the robot spin for real.

Here's another important tip: don't screw the serial cable into your computer -- just push it in and leave it loose. That way, if the robot yanks on it, the computer won't go flying. The same goes for the serial connection to the robot -- don't screw it in, or it may yank the RC hard and do some damage.

Consider looping the serial cable around something solid on the robot so the force of a "yank" doesn't make it all the way to the RC. And likewise on the computer end: strain-relieve the cable to something solid so your computer won't feel the yank.

We've ordered a $99 wireless interface kit from Digi (was MaxStream). If it works it will get rid of that cable altogether!
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.