How do I design a close-loop controller on my simulink of piezo bender of energy harvester
10 views (last 30 days)
Show older comments
The aim is to design a more sophisticated close-loop controller to optimize the transfer of power and improve the efficiency of the energy harvester in different conditions.
4 Comments
Sam Chak
on 16 Jun 2022
Thanks. Found it. Now, what type of "sophistication" that you want to design for ?
Accepted Answer
Sam Chak
on 16 Jun 2022
Edited: Sam Chak
on 17 Jun 2022
Hi @Fajwa Noor
Generally, the optimization should come later once you have successfully designed the basic structure of the mathematical law that stabilizes the closed-loop system. If the state-feedback mathematical law is acceptable to you, then you may consider designing multiple Linear Quadratic Regulators (LQRs) for the piezobender when the vibration source have different frequencies.
Basic info about using the K = LQR(A, B, Q, R) command in MATLAB can be found here:
See the example of designing a family of PID controllers for multiple operating points (which I think it is similar to your case of having a vibration source with different frequencies)
EDIT: To include some educational materials.
Part 1: Mathematical preliminaries
But first, we need to rewrite the equations in a compact form called the matrix differential equation:
where the vector and the generalized force vector .
Rearranging the matrix differential equation yields
.
Now, we want to express the matrix differential equation in state-space representation so that the LQR can be designed in MATLAB as described above
.
Note that is chosen as the math notation for the identity matrix.
The problem is reformulated to designing a state-feedback mathematical law given by
,
such that
is a Hurwitz matrix, having the characteristic polynomial with all its roots have strictly negative real part. The design process can be fairly tedious in pen and paper, noting that the size of the state matrix is . So, in such situation, the LQR algorithm can be used to calculate the optimal Gain matrix so that the following quadratic cost function
is minimized. The LQR algorithm requires and to be defined. As a starter (to see how well the LQR performs), we can select
... matching the size of matrix
... due to has 4 inputs.
Part 2: LQR design
% Parameters
rho = 7804.89;
l = 3.175e-2;
w = 1.72e-2;
d = 5.084e-4;
E = 1.36628e11;
I = 1.3907e-14;
e31 = 7.5459;
epsl = 1.38965e-8;
bm = 0;
kb = 1e-5;
% Mass matrix
m = (rho*l*w*d)/420;
M1 = [156 22*l 54 -13*l;
22*l 4*l^2 13*l -3*l^2;
54 13*l 156 -22*l;
-13*l -3*l^2 -22*l 4*l^2];
M = m*M1;
% Stiffness matrix
K = [12*E*I/l^3 6*E*I/l^2 -12*E*I/l^3 6*E*I/l^2;
6*E*I/l^2 4*E*I/l -6*E*I/l^2 2*E*I/l;
-12*E*I/l^3 -6*E*I/l^2 12*E*I/l^3 -6*E*I/l^2;
6*E*I/l^2 2*E*I/l -6*E*I/l^2 4*E*I/l];
% Damping matrix
B = kb*K + bm*M;
State-space
n = size(M, 1);
a11 = zeros(n);
a12 = eye(n);
a21 = - M\K;
a22 = - M\B;
b1 = zeros(n);
b2 = M\a12;
A = [a11 a12; a21 a22];
B = [b1; b2];
C = [eye(n) zeros(n)];
D = zeros(n);
sys1 = ss(A, B, C, D)
step(sys1, 10)
The piezobender is clearly unstable in the open loop.
Calculate the optimal Gain matrix
q = 1.0e0; % to make the response faster, increase exponent of q with r fixed at 1
Q = q*eye(2*n);
r = 1.0e0; % to reduce the energy consumption, increase exponent of r with q fixed at 1
R = r*eye(n);
G = lqr(A, B, Q, R)
Check the step responses of the closed-loop MIMO system
H = A - B*G;
sys2 = ss(H, B, C, D)
step(sys2, 10)
The piezobender is now stable in closed-loop.
If we define row vectors in the Gain matrix as
,
then we know that
.
.
.
Hence, solving for ,
.
Similarly, we can also get
.
In order to tune the Gain matrix until the desired closed-loop response is obtained, adjust the values of q and r. See comments above in the MATLAB code.
9 Comments
Sam Chak
on 23 Jun 2022
Hi @Fajwa Noor
It's alright. However, I didn't use any finite element method in the code. I merely used the a kind of matrix algebra manipulation method to obtain the values in the gain matrix G to stabilize the piezobender system as described by the mathematics that you showed to me.
G = lqr(A, B, Q, R)
I also took a look into your recent question:
It seems like the piezobender system is only a part of a much larger system that is modeled in Simscape. The piezobender is connected to the Vibration system on the left and the Full wave rectifier on the right. But I don't see Ctr, Cro, Rtr, Rro in the piezobender dynamics above. Would you clarify? You can also check with someone in your lab who is familiar with the system.
More Answers (0)
See Also
Categories
Find more on Classical Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!