Section One: Using Control Blocks for PID Controllers In this section, the use of control blocks will be used to compensate for a Plant Given by the transfer function: Open a new Simplorer, rename the Project to be Control_Blocks, rename the Design to be PID_control, File -> Save As to a desired location Insert two blocks onto the schematic Basic Elements/Blocks/Sources Blocks/STEP: Step Function (one) Basic Elements/Blocks/Continuous Blocks/GS: S-Transfer Function (one) Connect them as shown below (this represents an open loop system) Add an AC analysis from the Project Manager Window by selecting Analysis then RMB -> Solution Setup -> Add AC leave values at the default settings. -1
Insert two plots on the schematic, one will be for a TR analysis and the other will be a Bode Plot for the AC analysis Draw -> Report -> Rectangular Plot (size it, don t give signals simply close) Draw -> Report -> Bode Plot (size it, don t give signals, simply close) The schematic should now appear as shown below Double click on the STEP block, use following; this block provides a step function from a value of 0 to a value of 1, at time = 0 when the simulation starts. Select the AC Parameters tab and define Magnitude = 1 (this will be the value of the source during an AC analysis. Double click on the GS block and define the transfer function for the Plant -2
Double click on the Rectangular Plot, select GS1.VAL, Add Trace, Close Double click on the Bode Plot to define the transfer function that will be plotted Select Solution to be AC Select the Base (or reference) signal to be STEP1.VAL Select the GS1.VAL to be the Signal Select Add Trace then Close Set up each plot to display the header only by selecting each plot, RMB -> View - > Visibility, go to the Legends tab, and select only the Header box Rename each plot in the Project Manager window under the Results section to be G(s) TR Output and G(s) Transfer Function (for the Bode Plot) -3
Set up the TR and AC analysis as follows Run the TR analysis, then Run the AC analysis, the results should appear as shown below. File -> Save Note the output ramps up to 4.87V (As shown on TR plot due to gain of 4.87) Note the DC gain of 4.87 => 13.75dB (as shown on the Bode Plot) Note the phase goes to -180 degrees due to the double pole -4
Note the original Plant G(s) can be re-written, then factored to determine the frequency of the poles (double pole at w = 0.4, where F = w/2pi = 0.064Hz) Double click the Bode plot from the Program Manager window under the Results section Move the mouse into the plot area and RMB - > Marker -> Add X Marker This will add a marker that can be moved along the X axis by placing the curser over the yellow box on the X axis and moving it (note can also select it and move it with the keyboard -> ) move the X marker to 0.064Hz (location of double pole) -5
Add another marker using RMB -> Marker -> add Marker Place the marker at the very beginning of the plot to display the DC gain, then hit Esc to get out of place marker mode. The DC gain should be approx. 13.75dB Double click on the G(s) TR Output plot in the same Results section in the Program Manager window, move the mouse into the plot area RMB -> Trace Characteristic -> Add Select Math and max, and leave the Range to be full, then select Add, this will place a marker at the max value within defined range -6
Close out the plot windows to get back to the schematic Note the markers appear on the schematic plots, these can be moved for better visibility of the plot Select the Bode Plot, RMB -> edit in place (this puts the plot in edit mode, (similar to when it is opened in the Project Manager window under the Results section). Select the marker box and move it to a desired location as shown below Select both the STEP and GS block by drawing a box around them, copy (Ctrl + C), then paste (Ctrl + V) Delete the connection between this new pair Add a SUM block into the circuit Basic Elements/Blocks/Signal Processing Blocks/SUM: Summation Flip the SUM block Vertically Add a new Plot Draw -> Report -> Rectangular, do not add signal, simply close Move the SUM block in-between the STEP and GS block and connect as shown -7
Double click on the SUM block and select the sign for the feedback from the GS block to be - which would represent negative feedback Double click on the new plot, make sure to chose the TR solution select GS2.VAL, Add Trace, Close Note this configuration now represent a closed loop system with no compensation. Run the TR analysis, the results should appear as shown below Note the output is now less than 1V and has associated transients File -> Save -8
Copy the latest configuration by drawing a box around it, (Ctrl + C), then paste it below (Ctrl + V) Remove all connections Add the following blocks into the schematic and arrange them as shown Basic Elements/Blocks/Signal Processing Blocks/SUM: Summation Double click on this SUM block and add input pin by selecting another box for the input Basic Elements/Blocks/Continuous Blocks/GAIN: Gain Basic Elements/Blocks/Continuous Blocks/INTG: Integrator Basic Elements/Blocks/Continuous Blocks/DIFF: Derivative Connect the blocks as shown below -9
Add a plot by this new configuration Draw -> Report -> Rectangular Plot Select the Solution to be TR, select GS3.VAL, Add Trace, Close Add another plot, Draw -> Report -> Bode Plot Select the Base signal to be SUM2.VAL, and the Signal to be SUM3.VAL Add Trace, Close (this will plot the transfer function of the PID control section) File -> Save -10
Several types of control will now be evaluated Double click on each block in the PID Control section (GAIN, INTG, and DIFF), and note the gain term associated with each (KP, KI, and KD respectively) The transfer function for a PID controller is shown below with the associated gain terms Adjust the Gain terms as follows, run both the TR and AC analysis and note the results (note the AC analysis shows the transfer function of the PID controller) Set Kp =1, Ki = 0, KD = 0 (yields a Proportional control only) Run TR and AC, note results Set Kp =1, Ki = 0.1, KD = 0 (yields a PI control) Run TR and AC, note results Set Kp =1, Ki = 0.1, KD = 1 (yields a PID control) [Optimal Design] Run TR and AC, note results File -> Save -11
Section Two: Active Filters and G(s) blocks In this section, a G(s) Transfer function block will be used to show the implementation of an Active Filter design. Create a new Design in the Control_Blocks Project; Project -> insert simplorer design Rename the new Design to be Active_Filter Add the following components to the new Active_Filter Design 4 Resistors 1 capacitor 1 voltage source 1 opamp Basic Elements/Circuit/Semiconductors Device/Operational Amplifier/OPV5: Dynamic Op Amp Flip the Op Amp vertically so - input is on top Relax the Grid set up for more versatile placements of values on schematic Schematic -> Grid Setup, un select box for Snap Text and Graphics Rotate, connect and display values of the Active filter using the Op Amp as shown. note the names and values of each component -12
Double click on the Voltage source and define parameters as shown below Time Controlled Sine, Spice Compatible, Amplitude = 10, Frequency = 1000Hz Select the AC Parameters tab and set Magnitude = 1 (this is the magnitude for the AC analysis) Add an AC analysis via the Project Manager window for the Active_Filter design, set it up as shown -13
Double click on the TR Analysis and set it up as shown below Zoom out on the schematic and add two plots onto the schematic Draw -> Report -> Rectangular Plot Define the signals to be the voltage across the output (Rload_opamp.v), and input E1.V, Add Trace, Close Draw -> Report -> Bode Plot Define the base signal to be E1.V and the Signal to be Rload_opamp.V (note the - sign is there to compensate for the fact this active filter has a 180 phase shift as in inverting op amp configuration. Add Trace, Close -14
Run both the TR and AC anlaysis, the results should be as shown below File -> Save Adjust the TR plot to view the X axis from 35ms to 40ms Adjust the Bode (AC plot) so it only displays the Header, and change the name of the Header to Op Amp Active Filter Transfer Function, the results should appear as shown below -15
Evaluation of the results DC Gain of the filter is given by Av(dc) = RF/Rin = 10k/1k = 10 => 20dB Break frequency for the pole (Fp) of the filter is given by w = 1/(RF*CF) = 100rad wp = 2PiFp => Fp = wp/2pi = 100/2pi = 15.9Hz Open the Bode plot (for the AC analysis) from the Results section in the Program Manager window Add markers for the DC gain (RMB -> Marker -> Add Marker) Add X marker for Fp (RMB -> Marker -> Add X Marker) NOTE from the Bode Plot, the DC gain is 20dB, and the Fp is 15.9Hz Note Fp occurs at approx 3dB from the DC gain (17dB) Move the X Marker to 1000Hz, and note the Gain of the Op Amp Filter at 1kHz is approx. -16dB where voltage gain is given by 20log(ratio) = -16, therefore ratio = 0.158 Note also the final phase is -90 degrees (validates a single pole) Clear all markers using Marker -> Clear All -16
Open the Rectangular Plot for the TR analysis and measure the peak value of the input and output voltages using RMB -> Trace Characteristic -> Add. Select Math, max, range as shown below, then select Add this should yield the following Note the output voltage at 1000Hz is 1.56 Vp where the input voltage is 10Vp which yields the gain of 1.56/10 = 0.156 (as shown by the Bode Plot at 1kHz of approx -16dB) File -> Save -17
A G(s) transfer function block will now be created to represent the Op Amp Active filter. Add the following components to the Active Filter design Basic element/blocks/continuous Blocks/GS: S-Transfer function (one) Voltage Source (two) Resistor (one) Voltage Meter (one) -> Basic Element/Measurement/Electrical/VM Arrange them as shown below Double click on the VM1 Voltage meter, select the Output/Display tab and select the box to Show Pin for the Voltage V (this represents the voltage that is being measured). Flip the Voltage Meter Horizontally Double click on the E3 Voltage source shown above, and select the EMF value to be a pin (this pin will determine the voltage of the source) Connect the circuit as shown below, note the G(s) block will represent the Active Filter (Op Amp), E2 will be the input to the filter, VM1 will interface with the control blocks because the voltage at its output pin represents a non-conserved node which is compatible with the control blocks. In order to interface the non-conserved node output of the control block with conserved components, it will be connected as the input pin to a voltage source as shown. -18
Double click on the voltage source E2, define it to be the same as E1: Time Controlled Sine, Spice Compatible, Amplitude = 10, Frequency = 1000Hz Change the name of the Resistor to be Rload_Gs, leave it at default value of 1000 Ohms Define the G(s) block, from the Op Amp Bode plot it was found that the Frequency of the pole Fp was 15.9Hz (wp = 100), and DC gain = 20dB (10) therefore we have for the transfer function G(s) = 1000/(s + 100) Note the use of -1000 for the numerator to account for the 180 phase shift of the Op Amp configuration where the input signal is connect to the - input -19
Add a Rectangular plot, make sure to select the TR as the Solution in the upper left, define the signals to be E2.V and Rload_Gs.V Add a Bode plot, define the base to be E2.V and the Signal to be GS1.VAL Run both the TR and AC analysis, adjust the Rectangular TR plot to display only from 35mS to 40mS as was done for the other one. The results should appear as shown below. Note results are the same as for the Op Amp implementation File -> Save -20