AC.motion

July 08, 2006

Building the software

I started writing software that communicates with the Parallax servo controller. First, I had to get accustomed to the Comm API. Things I encountered:
  • There seems to be a Sun and a Gnu version. I work with the latter since this works with the GPS (tried that out some time ago).
  • When I read the response to a command, I get fed my own command as well.
  • It takes some time to get a reply. I actually keep polling the number of available chars until I get what I'm supposed to get.
  • I first used an unspecific comm adapter class, then changed to a specific serial adapter class. Much better: more options, including change of baud rate.
  • Alas, changing the baud rate does not work. I send the change command, change the port setting, and can't send or receive anything after that. For the time being I'm stuck to 2400 Baud.
  • At some point the serial port was not available any more. Ran into massive USB to serial driver problem. Tried a lot of things (Windows kept telling me the most current drivers are installed, and that the USB device is not recognized), than this worked: Installed the new FTDI (?) 2.0 drivers as EXE, not ZIP. Disconnected the USB cable on the board side - on the computer side did not help (what the?!).
  • Sent commands to rudder servo, but only half of the command were executed. Reason: Aaramp rate of 0 does not seem to work! Then, of course, if commands get sent rapid fire the commands don't get executed one after another only after the previous command has been finished, but as soon as possible. That makes sense; you don't want to wait for the servo to finish a turn if you changed your mind in between.
So after all that, querying the version ("1.4", not described in the manual!), sending servo commands, and polling servo positions does work, albeit at 2,400 Baud, and with a ramp rate of 1. Next step would be communicating with the Basic Stamp. On the other hand, none of the functions the BS provides is needed for operating the ship "with no brains" (i.e., no compass).

Found nice plywood leftovers in the Sperrmüll that I will convert into a cradle for transport, display, and work.

0 Comments:

Post a Comment

<< Home