CNC RS-232 interface. Four Axes Simultaneous Contouring


The SP1A (not available for SP1 controller) controller makes no G or M code interpretation. Instead of this it enables fast contouring for 4 axes simultaneously by low level binary command. Host computer should do all necessary calculations to draw circles, ellipses and other figures. Then it sends command which affects 4 or less controllers (axes) simultaneously and instantly. Corresponding controller increments or decrements step counter and moves stepper motor by one step clockwise or reverse. The command format is presented below. It consists of 2 Bytes (16 bits) and affects only controllers with controller number (or axes number) 1,2,3,4. Before using controller with another number, it number must be renamed to one of numbers (1,2,3,4) by command xNMy and contouring should be enabled with command xCOy.
First byte is command (ASCII Device Control 4 = 20 decimal, or 00010100 binary) , and second byte is parameter with information for all 4 axes. See command format below.


Low Level command

NOTE: SP1A makes no response to the binary contouring command.
 
Example1: Binary bytes: 20, 01 = move 1 step Clockwise for controller number 1 (Axis 1)
Example2: 20, 195 = move 1 step Counterclockwise for controller number 1 (Axis 1), and move 1 step Counterclockwise for controller number 4 (Axis 4)
Example3: 20, 67 = move 1 step Counterclockwise for controller number 1 (Axis 1), and move 1 step Clockwise for controller number 4 (Axis 4)
Example4: 20, 253 = move 1 step Clockwise for controller number 1 (Axis 1), move 1 step Counterclockwise for controller number 2 (Axis 2), move 1 step Counterclockwise for controller number 3(Axis 3), and move 1 step Counterclockwise for controller number 4 (Axis 4)

Typical Configuration 

Typical configuration is shown below. High level commands and Low level binary contouring command can be mixed to obtain maximum efficiency. If USB port is used as output interface, then USB-to-Serial converter must be attached just before first controller in chain. It is possible to set different configurations of 4 controllers groups on fly if more than 4 SP1A controllers are used.

By command xNMy you can set address 1 to controller1, address 2 to controller2, address 3 to controller3, address 4 to controller4, and to make some contouring operations. Then you can reset their addresses to 10, 11, 12, 13 and set another group for contouring: address 1 to controller6, address 2 to controller8, address 3 to controller15, address 4 to controller5. Do not forget to enable contouring by xCOy command.

RS-232 Communication speed and Contouring speed Correlation

This 2 Bytes command is executed instantly, then it is received. The execution takes less than 25 microseconds delay. It is short enough to process all commands at maximum 115200 bits/second communication rate, which gives stepping rate of 115200/20 = 5760 microsteps/second, where 1 transferred Byte = 8 Bits + 1 start bit + 1 stop bit.

NOTE1: Actual speed may be slower for Windows applications, as Windows reserves some time for other applications and system processes. It is important to put commands into data buffer before sending them to serial port, as non-buffered data are transferred few times slower. We measured actual stepping rate for Windows 2000 application at 115200 bits/s communication rate and obtained 3.6 Hz (3.6 revolutions/second) rate for 1.8deg stepper motor, when 1 microstep resolution is 1.8deg/8 = 0.225 deg.

NOTE2: Stepping speed can be reduced by inserting empty commands or bytes into sequence of commands, like this: 20, 0.