> Next GUI
< Previous Level 2: Symbolic abstraction

5.3.1 Usage

The first thing you need to do at this level is to make some edits to the source file so that your robot has an approximately correct description. Once this is done, we will need to take some measurements of the actual robot itself so that we can make this description more accurate, and in turn the software will become more accurate and easier to use.

Initial configuration

Open the file level-2.scm in a text editor, and look for the line that begins (define default-robot …. You need to edit the bunch of numbers that comes after this. Note that the file is annotated to make this easier for you. The important things at this stage are the serial port device address through which communication with the robot control board takes place, and the motor numbers, corresponding to the ports on the control board that each motor (base, shoulder, elbow, wrist, wrist-rotate and grip) is connected to. If your robot is exactly an AL5A, this will do for now; otherwise you should find out the lengths of the main limbs from specifications, and check the angular dispositions of your motors relative to the microsecond pulse widths that the control board has to generate to create them.

Measurements

The next thing we want to do is determine the largest possible range of motion of each motor, and the central position. Use the Level-2 GUI to do this (if you are currently in the Guile REPL, issue the (park) command, (quit) to get out of Guile; at the terminal prompt run guile-gnome-2 level-2-gui.scm), and make corrections to the level-2.scm file accordingly.

Parking

One thing that you will have noticed by now is that the robot starts in an unpredictable state, and for the first few movements will jump around quite violently. The solution to this is to leave the robot in a mechanically neutral position before switching it off, and on switching back on to issue the same software commands to put it in this position; as it will not have to move anywhere there will be no jerking, and further movements will be calibrated against this park position.

In order to make parking work correctly, you must use the GUI to put the robot into a resting position, and read off the positions of the axes. Then you need to edit the level-2.scm file (just as you did before) to put these park coordinates into the default-robot specification. It would be nice if you could simply move the robot to a park position by hand, and then read off the axes’ positions; unfortunately there is no position feedback from the arm, hence we have to do it this way.

So, when you write software or use the library directly in the Guile REPL, you should always ensure that the first command you issue is park, and the last command you issue is park. Unless necessary, you should not move the robot in this state, but if you do move it you should try to put it approximately into this park position before restoring power and then issuing the park command.

> Next GUI
< Previous Level 2: Symbolic abstraction
Copyright © 2010, 2012 DM Bespoke Computer Solutions Ltd
All rights reserved