Home Contents ContactItalian site
Hardware and Software for Microelectronics

 

Frequently asked questions

  1. What is a stepper motor controller?
  2. What other do I need?
  3. Which software can I use with the controller?
  4. Where can I find information about the controller?
  5. Does the controller interpret the ISO GCodes format?
  6. Does the controller have the closed loop?
  7. Which resolution can I obtain from a stepper motor?

  8. How can I set the acceleration?

  9. What is the maximum speed for a stepper motor?

What is a stepper motor controller?

A stepper motor controller, more generally called Motion controller, is a system that control the rotation of motors (stepper, brushless, sevomotors) with the purpose of moving a mechanical (axis in CNC machines) to a determined position. Motion controller must not be confused with motors drivers that are the power part of a positioning system.

 Stepper motors controllers can be divided in two main category:

            Software controllers (PC based)
            Hardware controller (Microcontroller based)

The firsts are those systems based on a PC that give the signals for the motors through the parallel port. Those systems are constituted by a software that read, interpret visualize and handle vector files and generate a sequence of steps for several axes (up to 4) on the standard printing peripheral.

The principal advantage of those systems is the cost. It is determined by the only software planning and did not comprise any added electronic device. The system is completed by the motors drivers that can be stepper or brushless.

The principal disadvantage is that the software that are made under the Windows platform have the problem of giving holes on the frequency given for stepping the motors. Windows is a multitasking operating system and any running application suffer of interruption that cause delays of tenths and sometime hundreds of millisecond while executing. This kind of driving with “holes” are unacceptable for stepper motor and cause loss of steps. The software that runs under DOS are better because this problem is not present and the running program has complete and continuous control of machine peripherals.

 The seconds controllers for CNC machines are the hardware based systems, those systems that are based on a microcontroller and on the communication with a PC for the vectors data file transfer. With those systems the files related to the positions and machine commands are loaded and viewed on a PC in a multitasking platform like Windows and the execution come with the transfer of data through communication ports like the RS232, USB LAN, CAN. Those systems allows the continuous execution of paths without the interruptions that come from the operating system. A such system is more costly because it require a complex hardware planning based on a microprocessor or microcontroller. Those systems can have up to 8 (and more) interpolated and a better capacity to interact with peripherals  (inputs and outputs), they can be closed or open loop. In systems with closed loop there are inputs for optical encoders that permit the control of the effective position of the axis or motor. The communication with the PC is a fundamental part of a such system and must be planned with care accordingly with the destination, industrial ambient, that is very subject to give disturbance and so creating communication errors.

Step generation.
    The nucleus of those two systems is the function that generate the steps, on the parallel port for the software systems and on the outputs for the microcontroller systems. The objective of this function is to bring the motors, through step and direction commands on the drivers, at the desired position and with the desired speed and acceleration.

    This function use generally the Bresenham algorithm for the linear interpolation that is largely used by video systems for the line representation on a screen, in systems more complete there is also the circular interpolation that allow execution of arcs and circle. The function is called by a periodical interrupt  generated by a timer or a software routine, generally with a 16 bit resolution timer, that allow precise and continuous frequencies. The algorithm determine which axis have to be moved by a step at the time t. The result is a succession of steps, that can be of different frequency for each axis, according with the angle of the position vector and above all of an uniform and linear motion. The curved paths are realized with a succession of positions, the more the definition of the path is required the more the position are closer one which another.
It must be considered that in a system with several axis, that mechanical the motion is determined by the single components of the motion of several motors, the resulting speed is V=sqrt(v1˛+v2˛+vn˛)  thus the controller have to set the correct frequency value calculating the vector angle. For example if applying a step frequency of 1000Hz. to an axis we have a speed of 5cm/s, if the motion of the system is composed by two axis and the vector have an angle of 45° it will be applied a frequency of 1000*cos(45°)=707 Hz to obtain the desired speed.
Another important point is the acceleration. This is usually achieved using a timer that interrupt the execution at regular intervals and change the value of the timer supposed to generate the steps creating a linear ascending or descending ramp.

Contouring.
    The ability to execute continuous vectors without accelerating and decelerating every vector but making a continuous path is called “Contouring” and it is generally possible to set the angle or the velocity that will trigger a deceleration to stop and a restart with an acceleration. This parameter avoid position mistake by loosing steps due to an excessive angular acceleration. To make a practical example: an angle of 90 degree must force the controller to decelerate at the end of the first vector and to reaccelerate in the direction of the second vector, if the angle is 12 degree then is possible to execute both vectors in succession at constant speed, with great advantages for the works that require constant speed: laser cutting, plasma cutting, milling, adhesive distribution etc.

A good hardware controller must have:

            High communication speed.
            A communication protocol secure and reliable.
            High speed interpreting commands.
            High speed in terms of Step/Second.
            Read and Write commands for input and outputs.
            Timing commands.
            Position read and status read commands.
            A discrete number of IO and an optional communication port.

The Language.
The controller receive the commands through the communication port but can receive directly the files considered that there are some file formats specifics to CNC machines. The simpler is the HPGL format developed from HP for the pen plotters. This format is 2D ˝ because the third axis is actuated by a command of type ON/OFF. More complex is the ISO G-codes format that comprise of a set of specific commands for the CNC machines. So it must be distinguished two kind of controllers: those that have a format interpreter and those that use a command based proprietary language. In the first case the controller accept the file with the format HPGL or ISO G-codes and it translate them into internal commands. In the second case it is the PC software that interpret the files and communicate with the controller with specific commands.

The commands of a controller can be divided into two group:

            Sequential command.
            Immediate command.
The firsts are the commands that form the motion of the machine. They will be executed in succession. The seconds are all that commands that must be executed at the moment of their reception and are, for example, immediate outputs commands, position or status query, stop, pause and restart.

What other do I need?

The stepper motors dimensioned for the application that must be realized.
The motor drivers dimensioned respecting the motors features
A power supply system that deliver power for all involved boards.
Summary

Which software can I use?

We have developed software that allow working with different  kind of machines. With Twincam and  Twincam3D, that are distributed for free with the Twintec controller you can import 2D and 3D files as HPGL, DXF ISO-GCodes and sent to the machine. We distribute also DeskCNC software that go with DeskCNC controller.

Summary

Where can I found information about the controller?

The controller manual contains the commands list and the relative syntax.

Summary

Does the controller support ISO-GCodes?

The controller doesn't interpret the format. The controller have a proprietary language, it is the software on the PC that translate the ISO GCodes lines into controller commands.

Summary

Does the controller have the closed loop?

When working at slow speed (10cm/s) and with stepper motors the use of a closed loop is not necessary. Loss of step at low speed can happen only if the motors and drivers are not well suited to the mechanical or when an axis collide with an obstacle. This allow a considerable save, economical and of build complexity. The controller is open loop.

Summary

Which resolution can I obtain from a stepper motor?

    The resolution of an axis system moved by stepper motors depend uniquely by the mechanical. The stepper motors have generally a 1.8° step angle so they make a complete rotation with 200 step when drive at full step. For example, if the motor drive a screw of 4 mm., a complete turn will make a displacement of 4 mm. and so the resolution will be 4/200 mm= 0.02 mm. Obtaining a mechanical with backslash less than this is very difficult. It is very important to choose a resolution not in excess because the backslash can make that value not effective, it must be considered also that choosing an high resolution penalise the maximal speed that the system can reach.

Summary

How can I set the acceleration?

 The acceleration of a system moved by stepper motors must be chosen with the following simple principle: "The higher possible". The reason of this chose is that almost applications (cutting, milling etc.) require constant speed to obtain cutting and milling uniformity. This value must be set to reach the final speed in the less time possible. It is generally necessary to make some try starting at low value and incrementing the value since the motor lose step in the acceleration phase, maintaining a security value below the last as final one.

Summary

What is the maximum speed of a stepper motor?

The moderns stepper motors can reach rotation speed of 1500 RPM. It must be considered that the motor torque curve decrease considerably with the increasing of the step frequency. If we take a screw of 4 mm and we run it at 1500 RPM we obtain a displacement speed of 1500*4mm=6000mm/min or 6 m/min. In practice the stepper motors runs at max 600 RPM because the torque decrease above that values. In other words we must chose a motor with a nominal torque higher than the necessary to reach the maximum speed. It's good practice know first the specification required by the machine before purchasing the motors.

In the picture above we can see that the torque of a stepper motor is almost constant until 2000Hz that correspond to 200/400=5 RPS or 600 RPM (note that the motor is driven at HALF STEP). Until 10000Hz the motor is still operating but the torque have reduced to 1/5 of his nominal value.

Copyright © 2002-2005 all rights reserved  [Twintec]. Last update: 11-04-05.