# Behaviour of DC series motors

I'm having trouble implementing a DC series motor simulation, and I think this is due to the fact that I do not understand the motor behaviour itself.

Notice that the mechanical part of the simulation is completely functional, so I don't have to bother with this. I have a DC series motor (motor constant G, internal resistance R) which get some voltage V applied on its terminal, and a mechanical load (Torque T, angular speed w) applied on the shaft.

Here's what I currently do:

1. Evaluate the current in the circuit: that'd be $I = \dfrac{V - BackEMF}{R}$
2. Get the torque from that current: $T = G \cdot I^2$
3. The mechanical simulation spits out the speed based on this torque and the load, and I compute the $BackEMF = G \cdot I \cdot w$
4. Back to 1

The issue is getting to the steady state: I can't see what will prevent my motor to diverge.

The way I see it, when going to steady state, BackEmf gets close to V -> the torque gets very small...But so does the current, which means BackEmf becomes small on the next simulation step -> (V - BackEmf) grows again, the torque increases, etc.

So: what actually prevents that? Is it inherent to my step-by-step simulation? How can I circumvent this?

What I have tried so far, without success:

• the magnetic flux is actually not linear but should saturate at some point (when?)
• I tried to add a small friction torque so the motor isn't "perfect"

I also have the same (related, I think) instability issues when I reduce the applied voltage V.

If I understand you correctly, you have a function $I\mapsto \omega(I)$ (the mechanical simulation) and you are looking for $I$ that solves $I = { V - G I \omega(I) \over R }$.
One hack you could try is to update the current $I$ incrementally, which introduces some numerical 'damping'.