ContentHub
Stepper-67X_12052026_916_EN.mp4
12 views
View transcript
Hello, in this WAGO tutorial we demonstrate how to use WAGO stepper controllers on a PLC in CODESYS 3.5. In this example, we are using the following setup: a PFC200 with firmware 31, the potential multiplication module 750-614, the stepper controller module 750-672, and of course the 750-600 end module. A stepper motor is connected to the stepper controller. In addition, DI 1 is wired with 24 V; this serves as the enable input. If everything is wired correctly, the I/O LED on the controller lights up green, the DI1 LED is also green – meaning enable is active the 24 VDC supply at the module is green, and the motor supply voltage UDC is also green. A ready-to-run CODESYS project has already been created and is linked in the video description. However, we will go through everything step by step so that you can quickly adapt the project for your own application. First, in CODESYS 3.5 we require the library WagoAppStepper. From this library, we use two function blocks: FbStepperControlBasic, which is used to operate the stepper motor FbConfigurationTable, in which the motor is configured For the input and output variables, we have created global variable structures and bundled them into a DUT. We now compile and download the program to the controller and start it. Initially, we want to check the I/O level. We can see that a warning is present. This always occurs after a restart. We now want to reset it for the I/O check. For this, the input Enable must of course be TRUE. The reset is carried out via the input xTriggerErrorReset. We write the values once; the output xResetWarning becomes FALSE, meaning there is no longer any warning, and the I/O level is functioning correctly. We can now start an initial positioning move. To do this, we set the job type to Move Relative. This means we want to move from the current position to a relative value, for example 12,800, which corresponds to one full revolution. You can also see that there are many additional job types available; these are explained in detail in the manual. We set the three values for velocity, acceleration, and deceleration to 1000 each, and as mentioned, the position to 12,800 to perform one full turn. To start the positioning move, xTriggerStart must be TRUE. Press Ctrl+F7 to write the values, and the motor performs one full rotation. This can be repeated until the motor reaches the virtual end stop of approximately plus or minus 8.3 million. To return the motor to zero, we can set the job type to Absolute, set the position to 0, and the motor moves back to the zero position. When a motor is connected, the corresponding positions are reached without any faults or warnings. However, during programming or commissioning, it can be useful to run a program without a connected motor, so we will now disconnect it. When starting a positioning move, the error code TMS Bridge A Low is now generated. This message originates from motor monitoring, as no motor is connected. These and many other parameters can be configured using the second function block, FbConfigurationTable. First, we read the current configuration of the stepper controller. To do this, set xExecute and xRead to TRUE. Since the parameter set is quite large, this takes a moment while the output Busy is TRUE. Once everything has been read, Busy becomes FALSE and the output Done becomes TRUE. As we will need a rising edge on xExecute later, we reset both xExecute and xRead to FALSE. The parameter set can be found in the declaration section of the function block. All parameters are explained in the manual. We are now looking for parameter 113, CFG_DiagReport, which controls motor monitoring. It is currently set to 6; we change it to 2, which disables motor monitoring. We must now write the modified configuration back to the stepper controller using xWriteFlash and xExecute. However, the error message TMS Bridge A Low is still present, and even a reset does not clear it. The reason is that some error messages and parameter changes require a restart of the stepper controller. Therefore, we interrupt the control voltage and restart the controller. This can be done without issue, as a successful parameter change is stored remanently and remains after a restart. The error message is no longer present, and we can now start the positioning move without a motor and without any fault. With the motor reconnected, we will now demonstrate another frequently used parameter: parameter 4, the frequency divisor. This parameter configures the operating frequency of the stepper controller. As a result, it also influences the motor speed. For example, if we set the motor speed to maximum, the motor does not rotate particularly fast. By choosing a smaller divisor, the motor turns significantly faster. In other words, we have shifted the speed range. The speed window can also be calculated – how to do this and which parameters are required is described in the manual. In this example, we have only modified two parameters so far. However, it is easy to imagine that in a real system many more parameters need to be configured and tested. There is therefore a risk of losing track of the default values, or after testing, you may wish to reset everything. Or you have worked through a test setup and do not want to manually reset all parameters. For this purpose, the WagoAppStepper library provides the function block FbRestoreDefault. When this is inserted and executed, all parameters are reset to their default values. This tutorial is primarily intended to provide an overview of using WAGO stepper controllers and to explain the basic operating principle. However, it also clearly demonstrates that there are many parameters and aspects which must be worked out for the specific application using the manual. Finally, please note that operating the stepper controller on a fieldbus coupler differs slightly from operation directly on the controller. For this case, we recommend the tutorial: WagoSysFieldbusModule | Commissioning complex modules on a fieldbus coupler. A link is provided in the video description. If you found this video helpful, please give us a thumbs up, subscribe to the channel, and contact us via the WAGO Support Center if you have any further questions.