6. Configure your routerbot
Unfortunately most servos you can get for a reasonable price are not exactly precise. Each servo has its own parameters and the many of them (in our price range) do not allow any adjustments. For instance when you send a command to the servo to return to its middlepoint (or stop rotating in the case of continuous rotation servos) the parameters of this command will be different for different servos even if they have the same model number. Some will stop at 1500 PWM, some at 1570. Fortunately in the “Routerbot OS” your can easily fix that problem and here is how you can do that. Before you proceed please make sure you have read the Routerbot v1 project outline.
(If you haven’t read the project outline you can find it here)
In order to tune the routerbot find an appropriate stand to put the routerbot on top of it so its moving parts do not touch anything. A large juice box would make a great stand, for instance. Then telnet or ssh to your routerbot and cd to /routerbot directory in two shells (or in two cmd windows in Microsoft Windows). Open config.sh file in one shell/window (let’s call it “config” window and the other windows will be “command” window) and adjust the parameters using the following procedure:
- Change the numbers in *_SERVO parameters if you want to connect the servos not as it was described in this guide, but in some other order
- In the command window run the following command in the command prompt:
stop. Both wheels should stop. If they don’t keep modifying parameters ENGINE_LEFT_STOP and ENGINE_RIGHT_STOP until stop command works correctly. There is about 30 PWM tolerance for the servos I recommended, but you need to be very precise. Send the routerbot forward and if it doesn’t go straight adjust the STOP parameters again.
- In the command window issue this command:
look forward. The camera should turn so it looks straight. If it doesn’t then adjust CAMERA_PAN_FWD parameter.
- In the command window exec the following:
look leftand then
look right. These commands should make the camera look left and then right. In those positions the servos should not rattle, otherwise decrease CAMERA_PAN_DELTA parameter
- In the command window try these three commands:
look ahead, look up, look down, look back. Issue those commands one by one and after each command listen if the servos are silent or not. If they rattle then adjust the following parameters correspondently: CAMERA_ELEVATION_FWD, CAMERA_ELEVATION_UP, CAMERA_ELEVATION_MAX, CAMERA_ELEVATION_MIN. You might also want to adjust those parameters to increase angles if your servos support more then 180 degree rotation. (In v2 replace _ELEVATION_ with _TILT_)
- Put the routerbot to the floor and issue the following command:
turn right90. The routerbot should turn exactly 90 degrees to the right. If it doesn’t then adjust RIGHT_ANGLE_TURN_SPEED parameter a little.
That’s basically it. When you’re done with this step you’ll have something like you can see in the original routerbot video. I also recommend you to backup your config file. If you reflash the router later your config file will be lost without the backup.
If you want to extend the set of commands the routerbot understands take a look at the /routerbot/util.sh file. I’d be happy to incorporate your mods into the next version of the routerbot OS if you send them to me.
If you used v2 for reflshing the routeryou will get the web interface. Click on the Help tab and you will see the basic set of commands the routerbot understands. You can run them in the command line (via SSH or Telnet) or use them to program the routerbot via web interface or batch files.
9 Responses to “6. Configure your routerbot”
Leave a Reply
You must be logged in to post a comment.