GIRC Distance Commands

In the above illustration, the first Command Element has a command code of 44, which tells us that it is a Move command, and that we are to move 360 plus whatever is in the second Command Element minus 33. Why this bit of complicated arithmetic?

Ironically, to simplify things. First of all, I don’t want to send raw segment coordinate data to the microcontroller, because then to do the math calculations in the microcontroller I would have to load the floating point trig libraries into it and that would take up a lot of memory that I may want for something else. Second, I want to limit the data I send over the serial port to the printable ASCII character set between 33 and 127 in byte values.

So I do all the heavy math in the computer and then encode the path/segment turn-and-move data into a format of a series of bytes ranging in value from 33 to 127. The convoluted but simple arithmetic can then be done by the microcontroller to convert back to the actual turns and moves.

Advertisements

About engineerzero

Once and future engineer.
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s