how can i imploy pid on a mass spring damper showing a car model in m file using oe45

10 views (last 30 days)
Rizwan Latif
Rizwan Latif on 9 Mar 2013
mean when i make an equation i.e. m*v(dot)+bv=u and solve it using ode45 in m file how can i employ PID there for a cruise contol. I can find the same solution on net in crise control tutorials but they use either transfer function or state space, but i dnt find the same solution using ode45. can any body suggest how to use PID with ode45.two m files are listed below. please any body can suggest how to controll the out put using a PID controller for a cruise control
first m file
function ydot=cruise(t,y)
2nd m file to run the above one is as:
clear all;
close all;
tspan=[0 20];
grid on

Answers (1)

Arkadiy Turevskiy
Arkadiy Turevskiy on 18 Mar 2013
It would be easier to do with state space or a transfer function, like you saw in the tutorials. If you want to use ode45, you will have to formulate the differential equations for the system with PID included.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by