array for transfer function
27 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have created a transfer function demonstrating the movement of a robotic arm for a course that I am doing using matlab. I have been told to apply reference signals to the transfer function using matlab the reference signals are to be in the form of an array. Ref signal 1 rotates the arm to the several specified locations and ref signal 2 moves the arm grabber vertically down to pick up and place boxes. I have no idea how to do this in matlab, can anyone help?
0 commentaires
Réponse acceptée
Jarrod Rivituso
le 3 Avr 2011
I'm not sure if your question is a basic "how do I create arrays" question, or if you are more interested in performing the simulation of your transfer function. I've assumed the latter here.
How are you representing the transfer function in MATLAB? Are you using the Control System Toolbox, such as shown below?
>> sys = tf(1,[1 2 1]);
If so, you could use the lsim function to perform a linear simulation using input data. For example
>> t = 0:0.1:2*pi;
>> u = sin(t);
>> lsim(sys,u,t);
However, I might recommend that you also consider using Simulink. You can model the transfer function using a single block (the Transfer Function block) and you can use either MATLAB to define your input signals or you can design them graphically using the Signal Builder block.
2 commentaires
Jarrod Rivituso
le 3 Avr 2011
Hi Tim,
For such a controls application, I feel like you would be well off using Simulink, provided that you have access to it. There are even some demo models, such as rct_robotarm0, that provide an example of a similar application.
If you take the Simulink approach, you will can add two separate transfer function blocks to your model and then provide separate inputs to each one. There are lots of Simulink demo models you can view to get a feel for this.
http://www.mathworks.com/products/simulink/demos.html
If you do not have access to Simulink, you can do this using the transfer function objects in the Control System Toolbox. However, IMO, it is less intuitive (I personally favor the graphical modeling environment of Simulink for controls applications).
For reference, a way you could do this is similar to as follows, except where you would define t and u to be different based on your desired inputs.
>> fullSys(1,1) = sys1;
>> fullSys(2,2) = sys2;
>> t = (0:0.1:2*pi)';
>> u = [sin(t), cos(t)];
>> lsim(fullSys,u,t)
Hope this helps!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Classical Control Design dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!