MT2: comunication protocol

 

 

The Serial Communication of the axisis control unit takes place through a serial interface at a fixed 9600 baud rate. The exchanged command strings are in ASCII code, terminated with <CR> ; other controll characters (like <LF>, <VT>) are ignored. The protocol is not case sensitive.
Command Summary:

  • U: Requests the current global status of the unit. (See further how the status is coded).
  • Pa,b: Moves the axes to an a and b coordinate position: a and b are the absolute position in half-steps. Both a and b values must to be included between -1.289.999 and +1.279.999.
  • Xa: Moves the X axis to an a coordinate position (absolute position in micro-steps). The a parameter must to be included between -1.289.999 and +1.279.999.
  • Ya: Moves the Y axis to an a coordinate position (absolute position in micro-steps). The a parameter must to be included between -1.289.999 and +1.279.999.
  • Da,b: Moves the axes for an a and b run (relative movement), where a and b are the runs values in half steps (Both values must to be included between -1.289.999 and +1.279.999). It is possible to ignore the “b” parameter to move the first axis only.
  • H: Moves the two axes to the home position (limit detection).
  • HX: Moves the X axis to the Home position (limit detection)
  • HY: Moves the Y axis to the Home position (limit detection)
  • K: Stops immediately the run of both axes
  • KX: Stops the run of the X axis
  • KY: Stops the run of the Y axis
  • CX,n: Supply mode of the X axis when it is not running (braking action):
    • n=0: no current (factory default)
    • n= 1: current is 1/8 of the max
    • n= 2: maximum current
  • CX?: Requests of the supply procedure of the X axis motor.
  • CY,n: Supply mode of the Y axis when it is not running (braking action):
    • n=0: no current (factory default)
    • n= 1: current is 1/8 of the max
    • n= 2: maximum current
  • CY?: Requests of the supply procedure of the Y axis motor.
  • FX,n: Sets the position of the X axis. The n parameter has to be includeed between -1.289.999 and +1.279.999.
  • FY,n: Sets the position of the Y axis. The n parameter has to be includeed between -1.289.999 and +1.279.999.
  • GX,n: Perpetual motion of the X axis; when n>0 or it is omitted, this command allows the forward movement, when n < 0 it allows the backward movement.
  • GY,n: Perpetual motion of the Y axis; when n>0 or it is omitted, this command allows the forward movement, when n < 0 it allows the backward movement.
  • L1: Actives the auxiliary exit.
  • L0: Deactivates the auxiliary exit.
  • W: Requests the current position: (X,Y) coordinates
  • ?: Requests the current firmware version
  • SX,n: Sets to n half-steps/s the speed for the X axis. This speed has to be includeed between 35 and 1.000. This command must to be executed only when both the axes are stopped.
  • SY,n: Sets to n half-steps/s the speed for the Y axis. This speed has to be includeed between 35 and 1.000. This command must to be executed only when both the axes are stopped.
  • SX?: Requests the X axis current speed
  • SY?: Requests the Y axis current speed
  • M: Stores in non-volatile memory the current X and Y speed settings

 

 

 

 

It is also possible, for commands using X and Y characters, repleacing X with 1 and Y with 2: for instance, the command FX,100 is equivalent to F1,100.

The status request message ("U") forces the microC to return a byte (2 hex characters) representing the actual status of the MT2 unit. Return message interpretation table:

  • bit 7: error;
  • bit 6: Y axis status position;
  • bit 5: X axis status position;
  • bit 4: light source status (1=on, 1=off);
  • bit 3: Y axis home position;
  • bit 2: X axis home position;
  • bit 1: running;
  • bit 0: ready (Known position after an home position).

If the error bit is high (i. e. if it answers with a code as the 81), then another error code is added after a comma (for example 81,02). The possible codes are:

  • bit 0: Command not acknowledged
  • bit 1: Illegal command (i.e. an absolute movement request when the positions are unknown or during a running ).
  • bit 2: Out of range parameter (i. e. the set speed is out of the fixed ranges).
  • bit 3: Time out or error during the home position search.
  • bit 4: Invalid number stored in non-volatile memory.
  • bit 5: Checksum of the stored data in the non-volatile memory invalid.
  • bit 6: Reached the X axis home position during the backward movement when the negative run is disabled with the appropiate jumper.
  • bit 7: Reached the Y axis home position during the backward movement when the negative run is disabled with the appropiate jumper.

The message request of the position gives the answer of the X, Y coordinates value. If the position is unknow, then the character will be #.

The message request of the speed gives the aswer of the current speed value in halfstep/sec.

 

 

Configuration

Demo software

 

 


[info @ ipses.com] Copyright © 2003-2007 by IPSES S.r.l.