zuruck zur Themenseite

Articles and background information on the topic

Motion Control

Prof. Dr. Elmar Engels | Günter Herkommer,

Motion control with stepper motors via Sercos

Can complex motion control tasks be performed via the Sercos automation bus using comparatively inexpensive stepper motors? This question was investigated by an industry-related development project at Fulda University of Applied Sciences.

© Fulda University of Applied Sciences / Robert Gross

Low-power stepper motors are particularly suitable where more cost-effective solutions are to be implemented than would be possible with servo motors. Compared to the latter, however, stepper motors also have various disadvantages such as undesirable cogging torques or a sharp drop in torque at higher speeds. However, incremental encoders and high-resolution microstepping control can be used to avoid any step losses and greatly reduce torque ripple, so that the disadvantages mentioned are acceptable in the context of the required cost-benefit ratio.

However, if complex motion control tasks such as synchronous or coordinated axis movements are to be carried out with stepper motors using the automation bus Sercos, which is predestined for this purpose, it is helpful if the programming methods and drive functionalities of modern servo drives are available. Against this background, a project was initiated at Fulda University of Applied Sciences with the aim of investigating the possibility of commanding motors on stepper motor drives with Matlab using the motion kernel in the motion controller. A further sub-goal of the investigation was the development of a test environment that enables automated and reproducible test scenarios for reasons of development efficiency.

Advertisement

Figure 1: The test setup at Fulda University of Applied Sciences.

© Elmar Engels

In principle, the market only offers a very small selection of drive controllers for such applications. For the project implementation, those responsible ultimately decided to combine a Sercos stepper motor drive from Cannon Automata (SMC3) with an IndraMotion MLC motion controller from Bosch Rexroth using the rapid control prototyping software from Mathworks(Fig. 1). The IndraMotion MLC is a motion controller with Sercos master functionality that can take over the calculation of the drive movements in the controller. Examples of complex motion processes are electronic gear synchronization or cam disk movements. The SMC3 stepper motor controller is a relatively new product that supports the sercos parameters of the 'sercos function specific profile drive' (FSP-Drive).

Figure 2: Speed control can be commanded according to PLCopen via a function block by specifying the target movement speed and the movement limit values for the acceleration and deceleration ramps.

© Fulda University of Applied Sciences

Rapid control prototyping in automation technology

Figure 3: Matlab function for commanding a speed control.

© Fulda University of Applied Sciences

The motion controller used supports all interfaces of Bosch Rexroth's so-called Open Core Engineering and can be programmed using the programming languages C/C++, Java or Lua, in addition to classic IEC programming. Bosch Rexroth offers the mlpi4Matlab software package for the rapid control prototyping engineering environment Matlab, which is particularly suitable for fast and flexible software development in the context of prototype construction or for test setups. The motion library it contains includes over 50 functions for reading and writing configuration settings and over 30 functions for executing motion commands. The motion commands are based on the definition of the PLCopen function blocks. An example of this is the function block MC_MoveVelocity of PLCopen for speed control of a single axis(see Fig. 2). Figure 3 shows the syntax of the corresponding Matlab function m4MMotionMoveVelocity. This function has similar call parameters and returns, among other things, a function handle as a return value, which can be used to query information about the processing of the velocity control.

The functionalities of the mlpi4 Matlab software mentioned in the objective include commands for commanding individual axes as well as for commanding synchronous axis movements. The system requires at least two SMC3 drive controllers for these functionalities. Due to the range of the electrical motor signals - 19 to 48 V(DC) - low-cost motors in the Nema 17 size with 24 V motor voltage were used: A motor without an encoder was connected to the first SMC3, while a motor with an incremental encoder with a resolution of 1000 increments per revolution was used on the second controller.

Both drive controllers have an additional interface that enables digital signals (DIO) to be read and written. Reference marks, position limit switches or simple sensors and actuators can be addressed via this DIO. LED indicators with a touch function were chosen for the system, as they allow signals to be visualized very easily or quickly. Finally, the MLPI SDK 1.0 software development tool, which is also part of Bosch Rexroth's Open Core Engineering, was used to address the motion control system via a software interface from Matlab.

Project planning for the test facility

Figure 4: Project planning view of the test setup in IndraWorks.

© Fulda University of Applied Sciences

Project planning of the test system is always the first step in the development of a motion control application, followed by software programming in the second step (Fig. 4). Project planning of the test configuration is extremely simple. As the SMC3 drives are recognized as sercos drives by IndraWorks via the 'Scan bus configuration' function, they can be inserted into the project as such. Further settings, such as setting the microsteps, the phase current or the motor step resolution, can be made via IndraWorks or, alternatively, very simply and programmatically from Matlab.

The definition of the test cases is based on the functionalities for motion control provided by the mlpi4Matlab toolbox. These are divided into configuration and motion functions. The latter were the central focus of the investigation. Of these more than 30 functions, some are not relevant for the SMC3, as this drive does not support torque-controlled operation, for example, but does support position and speed control as well as the transmission of cyclical speed or position setpoints. In addition to the configuration functions, the following functions are most important for single-axis and synchronous multi-axis operation:

  • m4MMotionFlexProfile, m4MMotionSynchronOut, m4MMotionGetAxisValues,
  • m4MMotionGearIn, m4MMotionGearInPos,
  • m4MMotionMoveAbsolute, m4MMotionMoveAdditive, m4MMotionMoveRelative,
  • m4MMotionMoveVelocity, m4MMotionPower, m4MMotionStop,
  • m4MMotionWriteCyclicPosition, m4MMotionWriteCyclicVelocity.

The entire test scenario comprises a total of around 60 individual tests, which in turn comprise completed test cases for both axes.

In general, functions with self-explanatory function names are the easiest and fastest way for users to create programs in Matlab. However, the drive controllers also include a large number of setting parameters which, although they cannot be called up directly via dedicated function names, are accessible via access to standard Sercos (S) or product-specific (P) parameters.

For the test scenario, this means that parameter access must also be tested via the m4M parameter functions. This can be done in a separate test; however, these functions are already required for the basic setting of the SMC3 for adaptation to the motors. This also applies to fundamental functions such as phase switching. Some of the S and P parameters are write-protected in communication phase 4 (CP4) of the sercos communication, so that the Matlab functions for phase switching between communication phase 2 (CP2) and CP4 are an integral component.

Finally, a test manager - the so-called mlpi4SMC3TestBuddy - was developed according to the system configuration, which takes over the execution of any programmed individual tests. All the individual tests have in common is an interface definition for the return values of the individual tests and the call parameters. An example of a test call is:

>> m4MMotionFlexProfile_smc3('192.168.178.123','FlexTest.log')

In this test, a FlexProfile cam disk is specified, transmitted to the motion controller for testing and then executed. For execution, a master axis and a slave axis must be defined and synchronized with the m4MMotionFlexProfile function. The master axis is then commanded in position or speed control, which the slave axis can follow if the cam plate parameterization is appropriate. The axes must then be stopped and synchronized again. The process also includes power switching and other movement commands.

The important thing about this procedure is that the tests are as complex as possible. As a result, they not only fulfill their actual task of carrying out tests close to the application, but are also a programming template for users. In total, individual tests were programmed for around 60 functions. With the help of these final successful tests, it was ultimately possible to prove that numerous motion functions of the motion controller can be realized with the stepper motor drive controller used.

Automatically generate C code from Matlab

Due to the fact that Matlab runs on an operating system that has no real-time properties in the sense of motion controllers, the programmed individual tests are not real-time capable at first glance. Nevertheless, synchronous axis movements can be programmed if cam disk functions or electronic gears are used. Positioning mode, in which the motion controller ensures movement in real time, is also easy to test. The mlpi4Matlab software is also largely coder-compatible. This means that code generation procedures can be integrated within a single test, which automatically generate C code from Matlab code, compile it, transfer it to the target and execute it there. This can be done automatically and without user intervention and is also freely programmable. As a further alternative, a PLC coder can be called from Matlab, which then generates the corresponding IEC source code for the PLC of the MLC.

In summary, it can be said that Especially when applications only require small motors that have cost requirements far below those of typical servo motors and at the same time do not require their dynamics, drive controllers with stepper motors on the Sercos automation bus are a superior alternative for motion control applications. Such applications are generally programmed in the IEC 61131-3 programming languages. However, prototype applications or tasks with lower real-time requirements can be programmed much faster and more efficiently using rapid control prototyping.

The reason for this is quite simply that with classic IEC programming, program changes usually have to be recompiled and transferred to the motion controller. The fact that the functionality of the online change can be executed significantly faster than a complete download changes little in this respect. Another efficiency advantage is the program manipulation options when debugging software. Although IEC programs can also be debugged using standard methods, i.e. setting breakpoints, analyzing or modifying variable values, it is not possible to insert or execute source code in the form of function calls or scripts or to change the type of variables during debugging. All these points are part of the exploratory programming approach and are often particularly advantageous when prototyping software.

In preliminary developments, robot applications have already been programmed with the system configuration described, so that the extension to robotics is an obvious next step.

Author:
Prof. Elmar Engels is responsible for the Department of Automation and Systems Engineering at Fulda University of Applied Sciences.

  • Xing Icon
  • LinkedIn Icon
Advertisement
Back to topic page
Advertisement

You might also be interested in

Advertisement
Advertisement
Advertisement
Advertisement

EUCHNER

Customized solutions for smart automation

In a world of increasing automation, functional safety is essential. Plant operators not only have to comply with legal requirements, but also ensure efficiency and availability. For more than 70 years, EUCHNER has been supplying customized...

read more...
Advertisement
Advertisement
Advertisement
Subscribe to our newsletter
Advertisement
Back to home