Simulation of plant dynamics are quite important when testing PLC/MCU controls that include state machines or active controllers such as PID controllers. The complexity of the simulation to test the controls depends on the following factors:
State machines typically require conditional static Boolean events to actuate controls on or off and to transition between control states. On the other hand, active continuous controllers such as PIDs, State space, LQR, Fuzzy logic, or Adaptive System ID or neural network controllers are required to run when the process or motion dynamics are running. Some understanding and modelling of the dynamics to test the controls in a simulated test environment is required. The dynamics may be modelled as a linear nth order differential equation in the time domain, or the equations of motion can be easily modelled with MATLAB Simulink function blocks in the frequency s-domain. Of course they can be static (the dynamics are either on or off) for the static simulation case. In general, simulation environments can be classified as three types which will be discussed in the next section: - Software in the Loop (SIL) - Hardware in the Loop (HIL) - Static simulation (typically on the controls PLC itself) Software in the Loop (SIL): Software in the loop consists of modelling the dynamics in software on a real-time system such as another PLC, NI PXI/CRIO system or a real-time hardware platform such as the MATLAB SpeedGoat platform where software cycle times are deterministic. The dynamics can be modelled, and the inputs and outputs of the plant dynamics can run deterministically and interface with the PLC controller. An example of the dynamics for a simple servo drive/motor coupled & driving a rotary ball valve modelled in MATLAB Simulink is shown below. The equations of motion in the time domain are converted to the frequency s-domain and modelled in Simulink FBD format: With SIL systems, the controller can be modelled with the dynamics in a software environment to provide a proof-of-concept control system application. For instance, a state space feedback controller with the same rotary ball valve dynamics modelled in MATLAB Simulink is shown below with a step input and negative torque sinusoidal fluid pulsations on the valve: And response of the controller with valve, motor, and fluid dynamics in the time domain is shown below: SIL systems are very versatile in that the dynamics and fidelity of the modelled dynamics can be easily changed and improved upon, and various types of controller applications can be switched out and tested for various dynamics. This allows for tabular system response comparisons between different types of controllers with different simulations. Hardware in the Loop simulation (HIL): A HIL consists of creating a scaled model of the actual dynamics with actuators and sensors wired into the Control system. This simulation setup can be used to test new control type applications before deploying it out to the field where the machine controls must function the first or second time with minor tuning. An example of the hardware for a drilling rig HIL system from the University of Houston is shown below: The overall controls and instrumentation diagram of the above HIL system with rotational and axial motion systems is shown below: The advantages of the HIL system are that the actual dynamics are modelled albeit scaled down, and the control system team gets better insight and understanding of the dynamics and the control system. Some Disadvantages is that it can be more costly compared to a SIL system and less flexible hardware wise when the application changes.
Static software simulation: Static simulation involves mimicking the behavior of the equipment and dynamics to test the basic control system functionality. Typically, the simulation consists of test variables already existing on the control system PLC/MCU, where these variables and values are manually toggled or ramped up or pre-described test scripts are executed to toggle these events and values. This method is used to test the basic functionality of state machines and active controllers and is the most basic & simplest form of simulation. Static simulation cannot be used to model more complicated dynamics and does not provide any deep insights into the dynamics. But this type of simulation is the most cost effective and nearly any control system engineer can develop this type of simulation with visualization.
2 Comments
|
AuthorGraham is a control system engineer enthusiastic about controls, design, hockey, and art! Archives
April 2023
Categories |