# Scilab code: transfer function and performance of control systems using DC Motor Model

This post contains the simple code written for Scilab, associated with the modeling of permanent magnet dc motor. The code of this program are made by me and is for all who need it. So is open source, you can modify as appropriate. Do not forget you also include my name and my website link in your application or website, and do not forget me say thank you.

Source Code 1

DC motor used is a permanent magnet, with the default parameters are:

1. Moment of inertia of the rotor:  $\dpi{100}&space;(J)&space;=&space;0.01&space;kg.m^2/s^2$
2. Electromotive force constant:  $\dpi{100}&space;(K=Ke=Kt)&space;=&space;0.01&space;Nm/Amp$
3. Damping ratio of the mechanical system: $(b)&space;=&space;0.1&space;Nms$
4. Electric resistance: $(R)&space;=&space;1&space;\Omega$
5. Electric inductance: $(L)&space;=&space;0.5&space;H$

If you want another dc motor parameters, please edit that variable in the source program.  Enter the parameters of the control constants Kp, Ki, and Ki, then the dc motor transfer function and the total transfer function of each controller P,  PI, PD and PID will be displayed.

Also, the graphics performance of the control system for each controllers P, PI, PD and PID will be generated.

Last updated by at .