I am trying to model a DC motor driving a load in Simulink by implementing a transfer function block.
I model the system as follows:
From the electrical perspective, I consider a simple equivalent series circuit consisting of input voltage , resistance , inductance , and motor back-emf . Applying KVL around this loop, I obtain the equation . From the mechanical perspective, I consider a motor torque , motor moment of inertia , damping term (due to bearings), and angular displacement . The motor is connected to a load with moment of inertia by a shaft of stiffness , resulting in displacement of the load by . Applying Newton's second law to , I obtain the equation Applying Newton's second law to , I obtain the equation
To couple the electrical and mechanical elements, I use 2 relations:
1. for some back-emf constant 2. for some motor torque constant Eliminating and and solving for the transfer function , I obtain
To manipulate this transfer function into a form usable in Simulink (i.e., with unity leading coefficient) will be analytically tedious. Is there an easy workaround for cases like this that I am unaware of?
I know that I can create a state-space model by substituting the coupling relations directly into the differential equations. This is usally my preferred method, but I am hoping to expand my skillset by solving the problem a different way.
Edit: Figured it out! I'll leave the (really obvious) answer here in case someone searches for a similar issue.
can be used to define a transfer function as a rational expression.
Jm = 3E-6;
Bm = 3.5E-6;
J1 = 5;
R = 4;
L = 2.75E-6;
K1 = 1;
K = 0.0275;
s = tf('s');
sys = K/((J1*s^2+K1)/K1*(Jm*s^2 + Bm*s + K1 + (K^2/(s*L+R)))-K1)