Get Intermediate Signal of Block Diagram for Control System
Afficher commentaires plus anciens
Hi, I have a block diagram (included below) of a control system for a mass damped cart and a PID control system. I have set up the system and solved for the output (X position), but am now looking to solve for the actual voltage applied to the system and cannot figure out how to get that data from MATLAB.

Additionally here is my code that I currently have:
% Cart Transfer Function
s = tf('s');
G = 1.5531/(s^2+10.0938*s);
G.u = 'V'; %input (voltage)
G.y = 'X'; % ouput (x position)
% PID Controller Transfer Function
H = pid(120,10,40);
H.u = 'e'; % input (error)
H.y = 'V'; % output (voltage)
% Combined Transfer Function for R to X (X/R)
Sum = sumblk('e = R - X'); % solve for error in terms of R and X
XR = connect(H,G,Sum,'R','X');
% Solve for step response
[x1, t1] = step(XR,1.5);
My attempted solution was as follows:
% Combined Transfer Function for R to V (V/R)
VR = connect(H,G,Sum,'R','V');
% [V, t2] = step(VR,1.5); % Commented out because it throws error:
% Error using DynamicSystem/step
% Cannot simulate the time response of improper (non-casual) models.
However this results in an improper model (More zeros than poles). I feel like there should be a function in MATLAB, but I have spent hours searching and nothing seems to fit what I am looking for.
Any help is greatly appreciated, and let me know if there is anything I forgot or anything I can clarify.
Thank you
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Control System Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

