2.1.0 Brick Worker - lokokung/Starburst-Front-End-Control-System GitHub Wiki

Communication Specifications

Communication with the GeoBrick is dependent on TCP connection. That said, command strings are packed using struct.pack() prior to pushing them through TCP sockets. In order to robustly implement some of the command routines, the python code is dependent on the built-in programming language in the GeoBrick to build on-the-fly scripts and execute them afterwards. While generally the GeoBrick should return some sort of response after a command is pushed, since the python code pushes large chunks of code, the response is often null.

Constants

The constants defined at the top of the source is subject to change, specifically the MOTOR3POS_CTS and MOTOR4POS_CTS which designate how many motor counts to move during calibration. Other constants may be added later on in order to define specific positions to go to.

The description of the device such as the hostname and port are also defined as constants at the top of the source in order to allow for changing if necessary.

Commands

Command Parameters Description
BRICKCAL Runs the calibration routine in order to set up the motor counts to be consistent with measurements.
BRICKHALT {motor_num} Routine to kill a motor and reset it so that it can be moved again as necessary. This does not immediately stop the motors, rather it brakes them and resets them.
BRICKMOVE {motor_num} {abs_pos} Routine to move a designated motor to an absolute position. The value associated with the absolute position is in physical units rather than motor counts. In other words, for motor 1 and 4, the units is mm and for motor 3 the units is in degrees.
BRICKOFF {motor_num} {offset} Routine to move a designated motor by some offset. The value of offsets is in physical units.
BRICKLOC {pos_1} {pos_3} {pos_4} Routine to move all three motors to an absolute position in physical units.
BRICKANGLE {angle} Routine to move motor 3 to an absolute angle.
BRICKRESET Routine to reset the GeoBrick.