Based on its recent analysis of the global active harmonic filters/power quality market, Frost & Sullivan recognizes Schneider Electric SE (Schneider) with the 2020 Global Product Leadership Award. Strasbourg is a city in the historic Alsace region on the left bank of the Rhine.Founded by the Romans in 12 BC, the city passed under the control of the Merovingians in the eighth century, and then became part of the Holy Roman Empire.Flourishing throughout the middle ages and Renaissance, it was conquered by Louis XIV in 1681. After having changed nationality four times between 1870 and 1945.
EFB Example - PIDFFExample History: (1) Feb 17, 2015 (2) Feb 18, 2015 (3) Feb 22, 2015 (4) Feb 23, 2015 (5) Feb 25, 2015 NOTE: All images on this page can be enlarged by clicking on them. The PIDFF Complete PID Controller is based on a PID algorithm with parallel or mixed structure (series / parallel). The PIDFF EFB can be used (and is recommended) for the majority of closed loop control needs and also includes a feed forward component for disturbance compensation, but use of this component is not required. Another benefit of the PIDFF EFB is that it supports use of the AUTOTUNE Unity Pro EFB. This project was developed to demonstrate a Level Control solution that is typical in industrial control systems. The requirement of the Level Control is to maintain the level in a Water Storage Tank (or buffer tank) that supplies water to a system with continuous variation of water usage. Controlling the level is accomplished by the use of a Variable Frequency Drive which will control the speed of an electric motor connected to the pump that fills the tank.The example project also includes many features which demonstrate other capabilities of Unity Pro. These include:
The example project was built with Unity Pro V8.0 and on a PC using 1280x720 resolution. Using the following Unity Pro Option settings will provide the intended user experience. The example project was built for use in the Unity Pro Simulator, but it can be adapted and run in hardware. After downloading the application and opening it in Unity Pro, execute the following steps to run the application in the Simulator:
To analyze the behavior of a faster reacting system, values similar to r=5.0, h=10.0 and f=5,871 can be used. These result in a 100% per minute maximum change rate. With this rate (and anything greater) the system will begin to behave more like a pressure or flow control loop. The application also includes an automated configuration for a Fast Loop, and to facilitate ease of use and demonstrations, this loop can be Auto Tuned automatically within the application. The dynamics of the system for the Fast Loop are set to r=1.0, h=5.0 and f=500.0. These result in a 427% per minute (or ~7% per second) maximum change rate. This rate essentially nullifies the Tank Buffering and the loop will behave much like a liquid pressure control loop. To run the application using the default or modified values, simply check the Checkbox 'RUN' (as shown here) on the 'PIDFF Example' Operator Screen. The horizontal slider control (shown above, and is on both the 'PIDFF Example' and 'Introduction' Operator Screens) allows the user to change the rate of the Tank Water Usage. There are also two additional automated methods of varying the Tank Water Usage (on the 'PIDFF Example' Operator Screen):
The PIDFF Level Control code is demonstrated within the Unity Pro Project in both Function Block Diagram (FBD) and IEC Ladder Diagram (LD). The execution of FBD or LD is mutually exclusive and which Section to execute is user select-able on the 'Introduction' Operator Screen. Here is the FBD code. Demonstration of Application Diagnostics is included, to enable the intended experience, use the 'Tools' pull-down menu and open the 'Diagnostic Viewer'. Then Right-Click on any of the field column headers and select 'Diag Viewer Properties', then check the Checkbox 'Automatic opening'. When TOD Mode is Enabled, a digital clock face is displayed (with the time starting at midnight) and the Storage Tank Water Usage rate is set according to the hour and the associated TOD_WaterUsage_Table element. Also displayed is the Time Warp adjustments. The Time Warp allows the user to speed up time. Here are the relationships between the Time Warp values and the simulated time. By setting the Time Warp Factor to '9', the entire 24 hour cycle of the TOD_WaterUsage_Table can be simulated in 24 minutes. When TOD Mode is Enabled, the Time Warp Factor is used as the source time for cycling through the TOD_WaterUsage_Table and for the TOTALIZER EFBs used to calculate the Energy Data. When TOD Mode is enabled the Trend Zones of the 'PIDFF Example' Operator Screen are also sped up according to the Time Warp Factor. The 3 Hour Trend shows 3 Hours of data when the Time Warp = '0' and 180 Hours when the Time Warp = '9'. The Process Disturbance trend shows 2 Hours of data when the Time Warp = '0' and 120 Hours when the Time Warp = '9'. The 10 Minute Trend shows 10 minutes of data when the Time Warp = '0' and 10 Hours when the Time Warp = '9'. The Tank Water Usage also has a 'Mixed Mode' option (shown here). When TOD Mode is enabled with 'Mixed Mode', the user controls the Tank Water Usage via the horizontal slider control and the TOD Time Warp Factor is applied only to the Energy Use Calculations. This combination of settings can be used to analyze energy usage with different PID Tuning Parameters, an explanation of how to accomplish this is below under Energy Data Options. The Process Disturbance feature consists of a Sine Wave Generator with configurable settings (shown here) for adjusting the frequency and amplitude of the generated output and an option to use one of two tables defining an automated cycling of the frequency and amplitude values. Application of the Process Disturbance to the current value of the Tank Water Usage is controlled by the 'Enable' Checkbox and there are two modes available (Manual and Auto) that are controlled by the 'Auto' Checkbox.
Automatic Mode Selection of which set of tables to use is by the 'Table 1/2' Checkbox. The default values contained in these tables can be considered as: 'Table 1' is moderate disturbances and 'Table 2' is aggressive disturbances. The Energy Use Analysis Viewer is displayed by the Checkbox 'Show Energy Data' on the 'PIDFF Example' Operator Screen. Energy Data is calculated, in the application, by the integration of the PIDFF Output value (assumed equal to Pump Speed) for time periods: Hourly and Daily. The time source for the integration periods is linked to TOD Mode; if Disabled then the time is source is the PLC RTC (PC Time if using the Unity Simulator), if Enabled then the time source is the TOD Mode Clock Face Time. This method of Energy Use Calculation is not an absolutely accurate but, it does provide the ability to compare relative values over two time periods, and included in the Energy Use Analysis Viewer are values for the current period and periods -1 and -2. There are two options included: 'Pause' and 'Reset' Checkboxes. Using the TOD Mixed Mode (with a Time Warp = '9') and a Manual Mode for the Process Disturbance, the Energy Data for various PID Tuning values (and other settings like Deadband) can be compared by analyzing the Energy Hourly Data collected in 1 minute of real time execution. Disabling the TOD Mode at the end of an Hour and the using the 'Pause' option will maintain the last two values of the Hourly data for this analysis. Important NOTE: Except for the above use description, any changes to the TOD Mode or Time Warp Factor will render the Energy Use Data invalid until two complete hours or two complete 24 Hour cycles (depending on which values you wish to compare) have been completed. The 'Introduction' Operator Screen includes two Checkboxes that cause the execution of a Subroutine (SR). These Checkboxes are under the heading 'Prepare the Loop for:' and are identified as: 'Auto Tuning at Cold Start' and 'Auto Tuning at Warm Start'. To understand the meaning of these two phrases, please refer to the Unity Pro Help for the AUTOTUNE EFB. The executed SR presets several values that insure the successful execution of an Auto Tune (when the default application configuration is set). If the Tank dimensions or Max Flow settings are modified, then the Auto Tune parameters (step_ampl, tmax and perf) and the Loop Setpoint may require different values than are set by the SR, for an Auto Tune to be successful. At the successful completion or termination of an Auto Tune cycle, the Auto Tune Diagnostics are automatically displayed. These are hidden/displayed by the Checkbox 'Show Diags' in the Auto Tune zone of the PIDFF Controller zone on the 'PIDFF Example' Operator Screen. NOTE: If the 'Show Energy Data' Checkbox is checked, then the Auto Tune Diagnostics are not visible. |
Requirements
- Modbus & OPC Client DA Edition or Ultimate Edition
- Schneider Unity Pro
Downloads
Unity Schneider Download
This tutorial gives you step-by-step instructions on how to use Schneider Unity Pro SoftPLC to control Factory I/O through Modbus TCP/IP.We will be using Unity Pro simulation mode, which simulates an M340 PLC with a Modbus server.Factory I/O will be running as a Modbus TCP/IP client.
Setting up Factory I/O Modbus TCP/IP Client¶
Unity Pro Schneider Electric Free Download
Download the zip archive (top of this page), extract it and open the project in Schneider Unity Pro.
Start Factory I/O and open the Sorting by Height (Advanced) scene.
Press F4 to open the Driver Window. Note that I/O points are already setup with 17 digital inputs (sensors), 13 digital outputs (actuators) adn 1 input register (number shown by the display: Counter).
Modbus TCP/IP clients can only write to Coils.Read operations can be performed on Coils or Inputs according to settings chosen in the CONFIGURATION panel.
In Schneider Unity Pro, both Coils and Inputs are stored in internal Boolean memories (%M) and share the same memory space.We are setting an Offset of 17 to Outputs in order to have the first 17 addresses available for Coils (sensors).Also, in Schneider Unity pro, both Discrete Inputs and Holding Registers are stored in internal Word memories (%MW).
On this sample, digital input I/O points (sensors) are written to %M0 up to %M16, and digital outputs (actuators) are read from %M17 up to %M29.The discrete output point used by the display (Counter) is read from %MW0.
Unity Pro Schneider Free Download
Setting up Unity Pro¶
Start Unity Pro and create a new project (FILE > New). Then select a M340 PLC.
The project has been created and you are now ready to start writing the PLC program. But first, you must define the I/O variables that will be used.
Double Left-click on Elementary Variables and create 17 EBOOL variables named Sensor0 up to Sensor16. These will be the variables used for sensor values. On the Comment fields type in the name of the Factory I/O points they represent so you can easily relate one to another.
Next, create 13 EBOOL variables named Actuator0 up to Actuator12. These will be the variables used for actuators. As you did previously, fill the Comments fields with the name of the Factory I/O points they represent. At last, create 1 INT variable named Counter0 (which is to be used by the counter display).
Create a section for the PLC code by Right-clicking on Program > Tasks > MAST > Sections and selecting New section...
Give a name to the section (e.g. Prg) and choose a programming language (e.g. ST).
You can now start writing the PLC program using the programming language selected above. The next image shows an example of a program written in Structured Text.
For Factory I/O to work together with Unity Pro you must assign memory values to internal variables. You do this by creating a new section called Inputs_FIO_Reading where values of memories %M0 up to %M16 are assigned to Sensor0 up to Sensor16 variables. You must do the same for actuator variables by creating an Outputs_FIO_Writing section and assigning the 13 actuators (%M17 up to %M29) and the Counter0 variable to an Int memory %MW. Note that Inputs_FIO_Reading should be placed first on the section tree so the latest sensor values are available when the program is executed. On the other hand, Outputs_FIO_Writing should be placed last, so actuator values are assigned to memories after the program is executed.
Build the project by clicking on Build > Rebuild All Project.
Select Simulation Mode by clicking on PLC > Simulation Mode. Next, connect to the soft PLC by clicking on PLC > Connect and download the program by clicking on PLC > Transfer Project to PLC. Click on Transfer.
Now, switch the PLC to Run mode by clicking on PLC > Run. Click on OK.
You should select a scan time of 10ms by Right-clicking on the soft PLC icon (taskbar) and selecting Timing...
Go back to Factory I/O, click on CONNECT and close the driver window (Esc).
Finally, switch to Run mode and select Auto by clicking on the selector.