DC motor control simulation

12 0 0 10 Kp:
Ki:
Kd:

About: This is a Javascript online simulation of DC motor control. Use sliders to set params.

Motor model

Motor model:
Kt = 0.2 	// Torque constant [Nm/A] 
Kv = 0.2	// Motor velocity constant or back EMF constant [V/(rad/s)] 
R = 2.5 	// Phase Resistance [Ohm]
L = 2.5e-3 	// Phase Inductance [H]
J = 1e-3  	// Rotor Inertia [kg·m^2]
B = 1.0e-4	// Rotor Friction [Nm/(rad/s)]

tm = 62.5e-3	// mechanical time constant tm = R·J/(Kt·Kv) [s]
te = 1e-3	// electrical time constant te = L/R [s]

Motor equations:
v = R·i + L·di/dt + ve 
ve = Kv·ω

Te = Kt·i
Te = TL + B·ω + JL·dω/dt;

where:
v - voltage [V]
i - current [A]
ve - back electromotive force [V]  
ω - angular velocity [rad/s] 
TL - Load torque [Nm]
JL - Load inertia + Rotor inertia [kg·m^2]

PID control algorithm

v = PID(speed_ref-rpm)*Vbus;

Keywords: HTML5, canvas, DC motor, PID, speed control.

Stats: