cnpcshangbo / simscapeFOPD

Simscape drone altitude control with fractional order proportional derivate controller
Other
12 stars 5 forks source link

Using IRID #14

Open cnpcshangbo opened 6 years ago

cnpcshangbo commented 6 years ago

https://books.google.ru/books?id=G_T_cZuLA2ICpg=PA119lpg=PA119dq=impulse+response+invariant+discretization+(IRID)source=blots=WRHo-3lL8dsig=txwM9kUN8Q_Z9lwvt_Bwq0sXxwghl=zh-CNsa=Xved=0ahUKEwj2nYv93dTZAhVBDiwKHZrsBUgQ6AEIKDAA#v=onepageq=impulse%20response%20invariant%20discretization%20(IRID)f=false

“IRID” method YangQuan Chen

cnpcshangbo commented 6 years ago

impulse response invariant discretization (IRID) method

cnpcshangbo commented 6 years ago

I found where to download the code https://www.mathworks.com/matlabcentral/fileexchange/21342-impulse-response-invariant-discretization-of-fractional-order-integrators-differentiators

cnpcshangbo commented 6 years ago

Using this piece of code, I am able to get the controller in z domain.

gam=0.9693;
Ts=.01;
dfod=irid_fod(gam,Ts,5);

cd=7.9733+0.2238*dfod;

s=tf('s');
p=0.99217/(0.2486*s+1)/s;
pd=c2d(p,Ts,'tustin');%plant

phiz=cd*pd/(1+cd*pd);

num= [0.304491262548240,-0.937336830445012,1.08933728516398,-0.584146578665016,0.138183294173986,-0.0102548884710634]; den= [0.0101201839324044,-0.0228427827690589,0.0162967440497079,-0.00320636053105791,-0.000423005899049262,8.95094110425754e-05]; Also, we can prove the closed-loop stability from the closed-loop transfer function poles.

cnpcshangbo commented 6 years ago

By using parameters from https://github.com/cnpcshangbo/FOPD-tunner/blob/master/controller%20analysis%20with%20Simulink/run_simulink.m I made https://github.com/cnpcshangbo/simscapeFOPD/blob/f500473b7d768e2f9eb3667daec4031bb1b45925/QuadRotor/work/IRID/verify.slx

image

cnpcshangbo commented 6 years ago

So, the designed discrete controller is working well in numerical simulation. Next step, I am going to test it in Simscape Quadrotor.

cnpcshangbo commented 6 years ago

However, the performance is like this, when I put the controller in Simscape. image

cnpcshangbo commented 6 years ago

Closed-loop poles: [0.000102719520635084,-0.000865537908196629,0.00325800756133674,-0.00720132367524617,0.0103194622578090,-0.00996028888391507,0.00647724417673368,-0.00271339814764816,0.000622707859943362,-1.58357641906846e-05,-2.98124871203922e-05,6.18697332722469e-06,-4.03141517099768e-08,-9.84756134649096e-08,7.30629718690601e-09]

cnpcshangbo commented 6 years ago

What to do next? A. Try to fix roll and pitch. B. Read Professor Xue's book. C. Read FO motion control and ask Yingluo. D. Search literature.

cnpcshangbo commented 6 years ago

I corrected a bug in the code: 16f19cd55af437952547e5d1a670ba14784ef93e Then the performance in numerical simulation is getting better: image

cnpcshangbo commented 6 years ago

Then I am going to retry the Simscape simulation. image

cnpcshangbo commented 6 years ago

This is a comparison between IOPID and FOPD. image