|   | |||||||||||||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
  |
S100SMC Software Instructions and Communications Protocol
This page covers the features and use of the S100SMC Standard Windows Software, as well as the
communications protocol that this software and other devices that will control the S100SMC must use.
To download our free software, click here and follow the installation instructions at the bottom of the page. Standard Control Software Features The S100SMC software has features for controlling every component of the S100SMC board. A brief list of things you can control from this software includes:
Software Instructions To better understand the following instructions you may want to click on the above image. This will open a new window containing a full-sized image of the software interface. Or, you can just run the software if you have already installed it on your computer. The S100SMC Software uses the communications protocol of the S100SMC to send commands to the board for execution. The basic process for executing a command involves sending the various settings for rotation to the board, such as half step mode, CCW direction, etc., and then sending a signal to tell the board to execute the parameters it has been given. Upon completion of the roation the board then sends a character to the PC indicating that movement has stopped, as well as information on the number of steps completed, if requested. The S100SMC Software GUI shows a number of buttons that each send a different setting to the S100SMC board. Following is a brief explanation of each of these buttons: Software Buttons and Settings Characters M0, M1, M2 - These are used to select the motor that you would like to send commands for. You have to click on one of these buttons to enable the other settings buttons for each motor. Clicking "M0", for example, sends the character "M" and "0" to the S100SMC, letting it know that the following settings apply to M0. C, c - These buttons send "C" and "c" to the S100SMC. When a "C" is received the S100SMC sets the rotation direction for the current motor (selected by the M0, M1, or M2 buttons, above) to CW. When a "c" is received, the S100SMC sets the rotation direction for the current motor to CCW. F, f - These buttons send "F" and "f" to the S100SMC. When a "F" is received the S100SMC sets the current motor to rotate in full steps, and when a "f" is received the S100SMC sets teh current motor to rotate in half steps. H, h - These buttons send "H" and "h" to the S100SMC. When a "H" is received the S100SMC sets the current motor to apply holding torque after rotation has completed. This means that the windings that were energized on the last step of the rotation will continue to be energized until another movement is executed. When a "h" is received the S100SMC sets the current motor to not apply holding torque. This means that after the rotation is completed none of the windings of the motor will be energized, and the shaft of the motor will spin freely. R, r - These buttons send "R" and "r" to the S100SMC. When a "R" is received the S100SMC sets the current motor begin rotation using the speed set for Max Delay and accelerate to the speed set for Min Delay. When a "r" is received the S100SMC begins rotation with the speed set for Min Delay and rotates at this speed for the duration of the rotation. I, D - These buttons send "I" and "D" + the value in the field just to the right of the "D" button. When a "I" is received by the S100SMC the current motor is set to infinite rotation--the motor will rotate until at stop signal (covered below) is received from the PC or limit inputs if they are active (also covered below). Clicking on the "D" button sends a "D" to the S100SMC, followed by two bytes that represent the number of steps to be executed. These two bytes are calculated from the numerical value in the text box just to the right of the "D" button--this will be covered more later. t - This button sends a "t" and the value in the field just to the right of the "t" button to the S100SMC. The value in the text field is convereted to two bytes that represent the minimum delay that the current motor will rotate at. More on this later. T - This button sends a "T" and the value in the field just to the right of the "T" button to the S100SMC. The value in the text field is convereted to two bytes that represent the maximum delay that the current motor will rotate at. More on this later. E - This button sends a "E" to the S100SMC. When a "E" is received the S100SMC begins rotation with the current settings if no rotation is currently executing. S - This button sends a "S" to the S100SMC. When a "S" is received the S100SMC halts any rotation is currently executing, and sends a "S" back to the PC to indicate that movement has stopped. O0, 01 - These buttons send the character "O" followed by the number "0" or "1" to turn on the corresponding output. When a "O" is received the S100SMC looks for either a number "0" or "1" to follow and then sets the state of the corresponding output to On. o0, o1 - These buttons send the character "o" followed by the number "0" or "1" to turn off the corresponding output. When a "o" is received the S100SMC looks for either a number "0" or "1" to follow and then sets the state of the corresponding output to Off. L0C, L1C, L2C, L0c, L1c, L2c - These buttons send the character "L" followed by the number "0", "1", or "2", followed by "C" to the S100SMC. When the S100SMC received a "L" it knows that an input is about to be activated. It then looks for either "0", "1", or "2" to tell it which input will be activated, and then either a "C" or "c" to tell it CW or CCW rotation, respectively. More on inputs later. l0C, l1C, l2C, l0c, l1c, l2c - These buttons send the character "l" followed by the number "0", "1", or "2", followed by "C" to the S100SMC. When the S100SMC received a "l" it knows that an input is about to be de-activated. It then looks for either "0", "1", or "2" to tell it which input will be de-activated, and then either a "C" or "c" to tell it CW or CCW rotation, respectively. More on inputs later. ? - This button sends a "?" to the S100SMC. When the S100SMC receives a "?" it send back a "?" followed by a total of nine bytes. These nine bytes correspond to the number of steps completed by each motor on the last rotation. Three bytes are received for each motor, for a maximum step count for each motor of 16777215 steps. If the checkbox beside "Report # of Steps After Each Rotation" is checked, the software automatically sends a "?" to the S100SMC after receiving the "S" character from the S100SMC, and then displays the number of steps completed in the three text boxes just to the right. This may seem like a large number of buttons and commands, but after a brief learning curve sending and executing commands with the software or with your own software is very simple. All of the settings are stored by the S100SMC from one execution to the next, so that you can change the settings you want to change and leave the settings you want to leave and just send "E" or click the "E" button to begin the next execution. This brings us to actually setting up a command on the board, which we will cover next. When the software is first started, the default state of the S100SMC board on power-up is shown. For example, you will find for each motor the "C" button is light red and the "c" button is gray. This is because when the S100SMC is powered on all three motors are set to CW direction. Also, they are all set to full step, no holding torque after rotation, and no ramping. The default number of steps to execute is 100, and the default min and max delays are 30 and 60, respectively. Thus, when you first power on the S100SMC and you start the software, if you click the "E" button, the S100SMC will rotate all three motors for 100 steps in the CW direction at a delay value of 30 (no ramping). To execute another command though, you will need to click the appropriate buttons/send the appropriate characters to the board. To change the settings for a motor, you must first click on either M0, M1, or M2. This will send "M" followed by either "0", "1", or "2" to the S100SMC, to let it know that any settings that follow are to be applied to the corresponding motor/axis. Also, clicking on one of these three buttons enables the settings buttons to the right for that motor and disables the ones for the other two motors. After clicking on the M0, M1, or M2 buttons you can then click on any of the settings buttons, such as "C" for CW rotation, or "H" to enable holding torque after the rotation. You can also enter a value for the number of steps you would like to execute, from 0 to 65535, and then click the D button to let the S100SMC know that on the next rotation that's how many steps you would like that motor to rotate. You can also enter values from 1 to 65535 for t or T and then click on the corresponding button. These values actually represent the number of times a timer on the S100SMC reloads in between steps. This timer reloads 3840 times a second, so a delay value of 1 corresponds to a step rate of 3840 steps per second (too fast for almost any stepper motor with the S100SMC). Also, if the motor is in half step mode, then this delay value is the delay between half steps, so that the motor will be turning half as fast as it would be if in full step mode. The S100SMC has 3 limit switch inputs. The limit switch inputs can be set to stop rotation (for all three motors simultaneously) when they are brought to ground, through, for example, the closure of a limit switch. Each of the three limit switches operates off of one of the three motors, and the corresponding motor must be rotating when the limit is activated for rotation to stop. Further, the limits can be set to stop rotation when the corresponding motor is rotating either clockwise, counter-clockwise, or both directions. To enable the limit inputs, you simply click on the corresponding button in the software. The buttons with a "L" send a "L" to the S100SMC first, to let it know that a limit is being enabled. The buttons with a "l" send a "l" to the S100SMC first, letting it know that a limit is being disabled. The number following either the "L" or "l" lets the S100SMC know which of the three limits will be enable or disabled, and the "C" or "c" lets the S100SMC know which direction the limit will be enabled or disabled for. The yellow LED's on the software interface next to the limit buttons light up when a limit is enabled and the red LED's next to the limit buttons light up when an enabled limit has been activated. The S100SMC also sends back "L" followed by "0", "1", or "2", followed by "C" or "c" after a limit has been activated, to let you know which limit was brought to ground, resulting in the halt of rotation. The output buttons are simply used to turn the outputs on and off. You can use these outputs to sink up to 200mA through the 2N7000 transistors on the board. You can find more info on connecting devices to the S100SMC outputs here. The green LED's on the software next to the output buttons light up to show the status of the outputs, either off or on. When you click on the corresponding output button and instruct the board to turn an output on, that output's LED will light in the software. once you click on the button to turn the output off the output's LED will go dark. Once the "E" button is clicked and an "E" is sent to the S100SMC, the red LED on the board will light while the rotation is being executed. After the command is completed the green LED on the board will light and an "S" will be sent to the PC. The green and red LED's in the software beside board status will behave the same way. Further Information For Custom Communications For custom communications all that is necessary is a device capable of sending bytes using the RS232 protocol. The port settings for communicating with the S100SMC are:
The bytes that need to be sent follow the same communications that the standard control software uses, as explained above. Please note that there are no commas or spaces in between the bytes. If an incorrect byte is sent to the controller, the red and green lights on the S100 flash, indicating an error, and the board then waits for the next byte to be sent. The only area that requires much calculation on the part of the controlling device is sending the appropriate bytes to follow "D", "t", or "T" -- the number of steps, minimum delay value, and maximum delay value, respectively. Also, all settings on the S100SMC are retained by the board from one execution to the next, as long as the power to the board is not lost. In other words, if you send "M0CIE" to instruct motor 0 ("M0") to rotate clockwise ("C"), infinitely ("I", and "E" starts the execution), and then later send "S" to stop the rotation, all that you have to do to repeat this exact movement is send "E" once more. The only exception is when ramping is disabled, as is explained below. Along these same lines, to change multiple settings for the same motor, you only have to send the motor selection bytes ("M", followed by either "0", "1", or "2") once. After that all bytes that are sent will be applied to the motor you last selected, until you select another by sending "M" followed by another number. After sending either "D", "t", or "T", the S100SMC then expects two bytes that will correspond to a 16-bit value on the board. The first byte that is sent represents the high byte on the controller, and the second represents the low byte. For example, here is a sample calculation to find the two bytes to send for a value of 19307:
Thus, to insrtuct the board to rotate motor 0 19307 steps, you would send the character "M", the character "0", the character "D", the value 75 (ASCII character "K"), and the value 107 (ASCII character "k"). The number of steps that can be executed is from 0 to 65535, and the min and max delay values must be from 1 to 65535. Also, the max delay value is not used unless ramping in enabled, and the max delay value must be equal to or larger than the min delay value when ramping is enabled or unexpected delays could occur between steps. To explain why this would happen, it is necessary to explain what actually takes place when a motor is ramping up to or down from it's max speed. The delay values actually represent the number of times a timer on the S100SMC reloads in between steps. This timer reloads 3840 times a second, so a delay value of 1 corresponds to a step rate of 3840 steps per second (too fast for almost any stepper motor with the S100SMC). Also, if the motor is in half step mode, then this delay value is the delay between half steps, so that the motor will be turning half as fast as it would be if in full step mode. When a motor begins its rotation, the first delay setting is the value that was sent following "T", or the max delay. For each step that is executed the delay is decreased by 1 until the delay equals the min delay value. At this point the motor executes the number of steps sent after the "D" value. Once these steps have been executed, the delay value increases by 1 after each step until the delay value again equals the max delay, and rotation stops. To send the min or max delay values, you would send a "t" or "T" followed by two bytes calculated in the same way as the example above. If ramping has been disabled (an "r" has been sent) and a movement executed by the board, the maximum delay will be set equal to the minimum delay. Therefore, if you want to go back to ramping mode by sending an "R" to the controller, you have to also send a new value for the max delay. If you have any questions about this protocol or otherwise, please feel free to contact us at info@steppercontrol.com.   |
  |
|
|||||||||||||||||
|   | |||||||||||||||||||||
|
Copyright © 2004, Mill-Shaf Technologies, Inc. All Rights Reserved |
|||||||||||||||||||||