The governing equation of this system is
(3)
Taking the Laplace transform of the governing equation, we get
(4)
The transfer function between the input force and the output displacement then becomes
(5)
Let
Substituting these values into the above transfer function
(6)
The goal of this problem is to show how each of the terms, , , and , contributes to obtaining the common goals of:
- Fast rise time
- Minimal overshoot
- Zero steady-state error
Open-Loop Step Response
Let's first view the open-loop step response. Create a new m-file and run the following code:
The DC gain of the plant transfer function is 1/20, so 0.05 is the final value of the output to a unit step input. This corresponds to a steady-state error of 0.95, which is quite large. Furthermore, the rise time is about one second, and the settling time is about 1.5 seconds. Let's design a controller that will reduce the rise time, reduce the settling time, and eliminate the steady-state error.
Proportional Control
From the table shown above, we see that the proportional controller () reduces the rise time, increases the overshoot, and reduces the steady-state error.
The closed-loop transfer function of our unity-feedback system with a proportional controller is the following, where is our output (equals ) and our reference is the input:
(7)
Let the proportional gain () equal 300 and change the m-file to the following:
The above plot shows that the proportional controller reduced both the rise time and the steady-state error, increased the overshoot, and decreased the settling time by a small amount.
Proportional-Derivative Control
Now, let's take a look at PD control. From the table shown above, we see that the addition of derivative control () tends to reduce both the overshoot and the settling time. The closed-loop transfer function of the given system with a PD controller is:
(8)
Let equal 300 as before and let equal 10. Enter the following commands into an m-file and run it in the MATLAB command window.
This plot shows that the addition of the derivative term reduced both the overshoot and the settling time, and had a negligible effect on the rise time and the steady-state error.
Proportional-Integral Control
Before proceeding to PID control, let's investigate PI control. From the table, we see that the addition of integral control () tends to decrease the rise time, increase both the overshoot and the settling time, and reduces the steady-state error. For the given system, the closed-loop transfer function with a PI controller is:
(9)
Let's reduce to 30, and let equal 70. Create a new m-file and enter the following commands.
Run this m-file in the MATLAB command window and you should generate the above plot. We have reduced the proportional gain () because the integral controller also reduces the rise time and increases the overshoot as the proportional controller does (double effect). The above response shows that the integral controller eliminated the steady-state error in this case.
Proportional-Integral-Derivative Control
Now, let's examine PID control. The closed-loop transfer function of the given system with a PID controller is:
(10)
After several iterations of tuning, the gains = 350, = 300, and = 50 provided the desired response. To confirm, enter the following commands to an m-file and run it in the command window. You should obtain the following step response.
Now, we have designed a closed-loop system with no overshoot, fast rise time, and no steady-state error.
General Tips for Designing a PID Controller
When you are designing a PID controller for a given system, follow the steps shown below to obtain a desired response.
- Obtain an open-loop response and determine what needs to be improved
- Add a proportional control to improve the rise time
- Add a derivative control to reduce the overshoot
- Add an integral control to reduce the steady-state error
- Adjust each of the gains , , and until you obtain a desired overall response. You can always refer to the table shown in this 'PID Tutorial' page to find out which controller controls which characteristics.
Lastly, please keep in mind that you do not need to implement all three controllers (proportional, derivative, and integral) into a single system, if not necessary. For example, if a PI controller meets the given requirements (like the above example), then you don't need to implement a derivative controller on the system. Keep the controller as simple as possible.
An example of tuning a PI controller on an actual physical system can be found at the following link. This example also begins to illustrate some challenges of implementing control, including: control saturation, integrator wind-up, and noise amplification.
Automatic PID Tuning
MATLAB provides tools for automatically choosing optimal PID gains which makes the trial and error process described above unnecessary. You can access the tuning algorithm directly using pidtune or through a nice graphical user interface (GUI) using pidTuner.
The MATLAB automated tuning algorithm chooses PID gains to balance performance (response time, bandwidth) and robustness (stability margins). By default, the algorithm designs for a 60-degree phase margin.
Let's explore these automated tools by first generating a proportional controller for the mass-spring-damper system by entering the command shown below. In the shown syntax, P is the previously generated plant model, and 'p' specifies that the tuner employ a proportional controller.
The pidTuner GUI window, like that shown below, should appear.
Notice that the step response shown is slower than the proportional controller we designed by hand. Now click on the Show Parameters button on the top right. As expected, the proportional gain, , is smaller than the one we employed, = 94.86 < 300.
We can now interactively tune the controller parameters and immediately see the resulting response in the GUI window. Try dragging the Response Time slider to the right to 0.14 s, as shown in the figure below. This causes the response to indeed speed up, and we can see is now closer to the manually chosen value. We can also see other performance and robustness parameters for the system. Note that before we adjusted the slider, the target phase margin was 60 degrees. This is the default for the pidTuner and generally provides a good balance between robustness and performance.
Now let's try designing a PID controller for our system. By specifying the previously designed or (baseline) controller, C, as the second parameter, pidTuner will design another PID controller (instead of P or PI) and will compare the response of the system with the automated controller with that of the baseline.
We see in the output window that the automated controller responds slower and exhibits more overshoot than the baseline. Now choose the Domain: Frequency option from the toolstrip, which reveals frequency domain tuning parameters.
Now type in 32 rad/s for Bandwidth and 90 deg for Phase Margin, to generate a controller similar in performance to the baseline. Keep in mind that a higher closed-loop bandwidth results in a faster rise time, and a larger phase margin reduces the overshoot and improves the system stability.
Finally, we note that we can generate the same controller using the command line tool pidtune instead of the pidTuner GUI employing the following syntax.
Published with MATLAB® 9.2
Last week, we introduced you to the Sonic USB 3.0 flash drive from PremiumUSB. Today we're going to do a speed test comparison between the Sonic USB 3.0 and a USB 2.0 drive and see what kind of performance gains we find.
Before we begin, let me give you some information about our test computer:
Processor: AMD Phenom II X4 970 BE 3.5GHz
Motherboard: ASUS M5A88-M
Memory: Kingston 4GB (2 x 2GB) DDR3-1333
Hard Drive: Samsung 830 Series SATA III 64GB SSD
Graphics: Integrated ATI Radeon™ HD 4250 GPU
Operating System: Windows 7 Professional 64-bit w/Service Pack 1
This computer has four regular USB 2.0 ports on the back plus two USB 3.0 SuperSpeed ports, which are designated by their special blue color. We thought this would be a great opportunity to test out the speed of our new Sonic USB 3.0 flash drive against a USB 2.0 flash drive of the same capacity.
Testing Procedures
We conducted four different tests in order to find out how different types of USB drives performed in different ports. For the baseline test, we tried an 8GB USB 2.0 drive in a standard USB 2.0 port. Next, we tried the same drive in a USB 3.0 port to see if it would perform any differently. Then, we took our 8GB Sonic USB drive and tried it in a USB 2.0 port to see how it would perform. Finally, we tried it out in a USB 3.0 SuperSpeed port to see just how fast this little guy would go.
We measured the performance of these two drives using two different programs: HD Tune and CrystalDiskMark. HD Tune is a hard drive benchmarking program that tests the drive's data transfer rate and gives you a minimum, maximum, and average value in megabytes per second.
The other program, CrystalDiskMark, breaks it down even further into separate read and write speeds. We left the software in its default configuration, which meant that it performed 5 passes using a 1,000MB file on our drives. Now then, on to the results!
Speed Read 2 0 1 – Reading Technique Examples Printable
Test 1: USB 2.0 Drive in a USB 2.0 Port
Regular 8 GB USB 2.0 Drive
- HDTune Min: 17.4 MB/sec
- HDTune Max: 20.2 MB/sec
- HDTune Avg: 19.3 MB/sec
- CDM Read: 21.91 MB/sec
- CDM Write: 8.27 MB/sec
This test was performed with a regular 8GB flash drive, much like what you would get if you placed an order for custom USB flash drives from PremiumUSB. As you can see, the data transfer speeds are not bad. HDTune recorded an average transfer rate of 19.3 MB/sec, with a minimum of 17.4 MB/sec and a maximum of 20.2 MB/sec.
CrystalDiskMark tested a much larger file size, and as a result the read and write speeds should be compared across each program for this test. In this case, CrystalDiskMark reported a read speed of 21.9 MB/sec and a write speed of 8.2 MB/sec.
Test 2: USB 2.0 Drive in a USB 3.0 Port
Regular 8 GB USB 2.0 Drive
- HDTune Min: 18.7 MB/sec
- HDTune Max: 22.2 MB/sec
- HDTune Avg: 21.2 MB/sec
- CDM Read: 23.28 MB/sec
- CDM Write: 8.60 MB/sec
As we have reported in the past, the USB 3.0 interface supports much higher data transfer speeds than USB 2.0. So we wondered: would there be any increase in read/write speeds by using the same drive in a faster port?
As it turns out, HDTune did report that the data transfer speeds were ever-so-slightly higher. The average speed was 21.2 MB/sec, with a minimum of 18.7 MB/sec and a maximum of 22.2 MB/sec. That's a 9.8% increase in average transfer speeds just by using a SuperSpeed port! Wow!
CrystalDiskMark came back with slightly higher numbers also, clocking in at 23.2 MB/sec read and 8.6 MB/sec write. That's an increase of 5.9% for read operations and 4.8% for write operations.
Test 3: USB 3.0 Drive in a USB 2.0 Port
Speed Read 2 0 1 – Reading Technique Examples
USDM Sonic 8 GB USB 3.0 Drive
- HDTune Min: 31.1 MB/sec
- HDTune Max: 31.9 MB/sec
- HDTune Avg: 31.2 MB/sec
- CDM Read: 33.72 MB/sec
- CDM Write: 13.33 MB/sec
For this test, we wanted to find out how a SuperSpeed 3.0 drive would do when connected to a standard USB 2.0 port. Would it fare the same as a regular 2.0 drive of the same size, or would it do better?
As it turns out, HDTune did come back with higher numbers! The SuperSpeed drive in the 2.0 port had an average transfer rate of 31.2 MB/sec with a minimum of 31.1 MB/sec and a maximum of 31.9 MB/sec. While plugging a SuperSpeed drive into a 2.0 port won't give you the full benefit of USB 3.0's speed, it does seem to be somewhat faster.
Once again, CrystalDiskMark also showed an improvement with our Sonic drive in a standard USB 2.0 port. The program recorded a 33.2 MB/sec read speed and a 12.3 MB/sec write speed, which is a pretty substantial increase over our 2.0 drive in the same port! That means read speeds were 51% faster and write speeds were 50% faster with the USDM Sonic USB 3.0 drive!
Test 4: USB 3.0 Drive in a USB 3.0 Port
USDM Sonic 8 GB USB 3.0 Drive
- HDTune Min: 54.7 MB/sec
- HDTune Max: 55.0 MB/sec
- HDTune Avg: 54.9 MB/sec
- CDM Read: 57.55 MB/sec
- CDM Write: 13.30 MB/sec
Speed Read 2 0 1 – Reading Technique Examples Worksheets
Finally, we arrive at what we hope will be the top speed portion of our test: the Sonic 3.0 drive in a USB 3.0 port.
For this test, HDTune took off and never slowed down. The transfer rate averaged 54.9 MB/sec with a minimum of 54.7 MB/sec and a maximum of 55.0 MB/sec. When compared with our baseline test, we see that USB 3.0 is 184% faster on average than USB 2.0.
To no one's surprise, CrystalDiskMark also reflected a huge speed boost with the Sonic drive. Our final read speed was 57.5 MB/sec and 13.3 MB/sec for write speeds. Compared to our initial test, that is a 162% increase in read speeds and a 62% increase in write speeds. Wow!
Conclusion
Speed Read Techniques
These tests tell us a number of interesting things about how to achieve the highest data transfer speeds. Having a 3.0 SuperSpeed port on your computer can make a regular drive perform slightly better. Using a high-quality SuperSpeed drive on a regular port also makes a big difference. But in order to get the fastest possible speeds, you'll definitely want to use a USB 3.0 drive in the proper SuperSpeed port.