None
While it is possible to sketch a Bode diagram for a system with a known transfer function, it is often useful to establish the frequency response of a system experimentally in order to either confirm its behavior matches your expectations, or to determine its transfer function in cases where a step response test is either not practical or would not yield enough information to fully explore or characterize a system's behavior. To practice obtaining frequency response data experimentally, you will examine the steady state sinusoidal response of a system under closed loop control. For this experiment you will use the PI controller for angular velocity that you designed and implemented in Lab 6 to control the benchtop motor-shaft-load system's angular velocity. However, in addition to giving the system a step input to verify its behavior under closed-loop control, you will provide it a sinusoidal input.
You will be using the MOTOR-RIGID SHAFT-LOAD configuration that you used in Lab 7:
You can make use of the angular velocity plant you developed in Lab 7 to design an angular velocity PI controller. You will need to design for closed loop behavior with the following characteristics:
If you aren't confident in the plant you constructed in Lab 7, take a minute to generate a new one now! You can revisit your code from lab 6 where you designed a PI controller or also take this opportunity to practice by constructing a new one.
Perform all of the required calculations in the code block below. Output the following:
% YOUR CODE HERE
error('No Answer Given!')
To date, you have applied a step input to the system using the use buttons. However, with a few modifications the Arduino code can generate a sinusoidal input with adjustable amplitude and frequency.
If you are using code from Lab 6, MAKE A COPY and implement the following modifications.
startTime = millis();
**WITHIN void loop**
elapsedTime = (millis()-startTime)/1000.0;
f = 1.0; //Hz.
// You can also use a potentiometer to set the frequency.
//The code below replaces the existing code that calculates your desired velocity "r"
//Use one of the potentiometers to adjust the "desiredVelocityAmplitude" to be between 0-30 rad/s
r = desiredVelocityAmplitude*sin(f*2*PI*elapsedTime)+shift; //set "shift" so the sine wave output is always positive;
*Ensure you declare any new variables appropriately*
logspace()
select a set of frequencies throughout the range of "interesting" behavior you identified.In the code cell below construct the Bode plot of your experimental data. On your plot, identify the measured and theoretically predicted closed loop natural frequency.
% YOUR CODE HERE
error('No Answer Given!')
Include in the cell below a copy of your completed Arduino code. Double-click on this cell to see how to properly format your code as shown below:
//sample Arduino code
//properly formated for display
</font>
YOUR ANSWER HERE
The closed loop controllers you have implemented this semester have all been digital controllers. The Arduinos you are using are one example of a microcontroller which is a small computer that typically perform a single function.
Unlike a controller made from analog electronic amplifiers that essentially respond continuously to changes in the system (op-amps are a common example), microcontrollers respond at descrete times. To date you have been implicitly assuming that the response of the microcontroller is modeled accurately by continuous-time math. This lab will explore the limitations of that assumption.
Using the same PI controller from the first part of this lab, perform the following experiment. Make sure to make a new copy of the file so the original is preserved.
Capture the velocity response to a step input and compare it to your model's prediction in Matlab to confirm your controller is working properly and plot below.
Although you did this at the start of the lab, you've made changes since. This is an important step to confirm the entire system is set up and working as expected!
% YOUR CODE HERE
error('No Answer Given!')
To assess the impact of the sampling time for the microcontroller:
Plot the response when the system JUST becomes unstable in the code cell below.
% YOUR CODE HERE
error('No Answer Given!')
Report the sampling time that causes the system to become unstable and describe the instability in the Markdown cell below.
YOUR ANSWER HERE
Now record the system response to a step input (magnitude is your choice) *at several sampling times up to the sampling time that causes the system to become unstable.
% YOUR CODE HERE
error('No Answer Given!')
YOUR ANSWER HERE
With the system at the minimum sample time required to cause instability, adjust the $k_{sum}$ value until the closed-loop response is stable again, and has a similar overshoot to the original design.
% YOUR CODE HERE
error('No Answer Given!')
YOUR ANSWER HERE