ContentHub
Codesys_DC_Drive_636-1205202605_916_EN.mp4
11 views
View transcript
Hello, in this WAGO tutorial, we’ll show you how to use the WAGO DC Drive Controller with a PLC in CODESYS 3.5. For this demonstration, we are using the following setup: a PFC300 running Firmware 31, the DC Drive Controller 750-636, and of course, the 600 series end module. A simple 24 V DC motor without any position feedback is connected to the DC Drive Controller. If everything is wired correctly, the I/O LED on the PFC will be illuminated green, and the “D” LED on the DC Drive Controller will also be green. We have already created a functional CODESYS project, which is linked in the video description. However, we will go through the configuration step by step so that you can quickly adapt the project to your own application. First, we need the WagoAppDCDriveController library in CODESYS 3.5. The library contains only two function blocks: FbControlBasic and FbPWM. Both have already been added to the program. Either function block can be used to control the connected motor, so they should be interlocked to prevent simultaneous operation. For the input and output variables, we have created separate global variable structures and combined them into a DUT as well. We can now compile the application, download it to the controller, and start it. First, we want to verify the I/O level, so we enable the PWM function block. If a fault is present, for example due to installation or wiring issues, it can be reset at this stage as well. We write the values once using Ctrl + F7, and the output xValid becomes TRUE. This confirms that the I/O level is functioning correctly and that the function block is ready for operation. We can now start the motor. Set the Speed parameter to 100. Valid values range from 0 to 255. The motor can be started either via the xDirPos input or the xDirNeg input. As soon as we write the values, the motor begins to rotate. However, after three seconds, the motor stops and the xError output indicates a fault. This is because, by default, a Motion Detection Timeout of three seconds is configured. Our connected motor does not provide any feedback that could report its position within that time period, so we need to adjust this parameter for our application. To do this, we use the second function block, FbControlBasic, and first read the parameters using xReadConfiguration. In the declaration section, you will find the configuration parameters, including DC Motion Detection Timeout, which is currently set to three seconds. The parameter can be disabled by setting its value to zero. Using xWriteConfiguration, we write the modified parameter set to the controller. Please note that this parameter change is not retentive. This means that after a restart, for example, the parameters will revert to their default values. To store the parameter change permanently, you must also set the xStoreUserData input. If we start the motor again, it now runs as expected. During operation, changing the speed or similar parameters is not possible. The motor must first be stopped. However, after another rising edge on xDirPos, the motor starts again and now runs at full speed. The more comprehensive FbControlBasic function block would typically be used to implement positioning applications, as it allows parameters such as the target position to be specified. For this, however, position feedback and a homing procedure are required. It is also recommended to optimise the positioning behaviour, including ramp configuration, using the IO-Check tool. This provides a clear and convenient interface for accessing and adjusting the relevant parameters. The primary purpose of this tutorial is to provide an overview of how to use the WAGO DC Drive Controller and to explain its basic operating principles. For more specialised applications, we recommend consulting the user manual. Finally, please note that operating the DC Drive Controller on a fieldbus coupler differs slightly from operation directly on the controller. For this scenario, we recommend the tutorial: “WagoSysFieldbusModule | Commissioning Complex Modules on a Fieldbus Coupler.” A link can be found in the video description. If you found this video helpful, please give it a thumbs up, subscribe to the channel, and contact us via the WAGO Support Centre if you have any further questions.