# Simulating a moving coil meter with Simulink

I have to model/simulate a moving iron meter with Simulink, more specifically, I need to build a Simulink model for the equation of motion, wich is given as: $$\theta\ddot{\alpha} = T_\phi - T_S$$ where $$\theta$$ denotes the pointers moment of Inertia, $$\alpha$$ is the pointers angle, $$T_S = c_S\alpha$$ the springs torque pushing the pointer back to it's initial position, with $$c_S$$ as the spring constant $$T_\phi = c_\phi i$$ as the Torque generated by the current i and i is from the following equation: $$Ri = v - c_i\dot{\alpha}$$, where $$R$$ denotes the resistance in $$\Omega$$, $$v$$ the DC voltage that's supposed to be measured, $$c_i$$ the coils conductance.

$$\theta=6.4*10^{-6}\frac{kgm^2}{rad}$$; $$c_S=6*10^{-4}\frac{Nm}{rad}$$; $$c_\phi = 8*10^{-2} \frac{Nm}{A}$$; $$c_i=1.2\frac{Vs}{A}$$; $$R=2*10^3 \Omega$$

The reason I'm posting here asking you for help is that I don't know if I did this correctly since I don't have any reference values to verify my result. The meter is supposed to measure the DC voltage $$v$$ and to get a proper result I think I need to multiply the resulting angle $$\alpha$$ by a certain factor.

To build my Simulink model I put in all the variables and get this $$\theta \ddot{\alpha} = c_\phi i-c_S\alpha \Leftrightarrow \theta \ddot{\alpha} = c_\phi \frac {v-c_i\alpha}{R}-c_S\alpha$$

after a Laplace Transform and some math I get: $$\theta s^2X(s) = \frac {c_\phi}{R}v-\frac{c_\phi c_i}{R}sX(s)-c_SX(s)$$ then I rearranged the equation so I can build the model using integrators: $$\frac{1}{s}\left(\frac{1}{s}\frac{\frac{c_\phi}{R}v-c_SX(s)}{\theta} - \frac{c_\phi c_i}{\theta R}\right)$$

So in the end, it seems pretty similar to a damped harmonic oscillator...

Attached below you find my Simulink model and the workspace I'm using.

• The Laplace transform of a constant $C$ should be $C/s$ not $C$. And you are missing one dot when you wrote the expression for $i$ on the $\alpha$ term. And is $v$ supposed to be the output of your system and $\alpha$ the input? – Dinno Koluh Oct 29 at 23:51

I would personally do the problem in an other way. I guess that your input is the DC voltage and the output is the angle. The differential equation of the system as you wrote it is: $$\theta \ddot{\alpha}(t) = \frac{c_\phi}{R}v(t) -\frac {c_\phi c_i}{R}\dot{\alpha}(t)-c_S\alpha(t)$$

after the Laplace Transform finding the ratio of the output to the input you get the following transfer function: $$\theta s^2Y(s) = \frac {c_\phi}{R}X(s)-\frac {c_\phi c_i}{R}sY(s)-c_SY(s)$$ $$G(s) = \frac{Y(s)}{X(s)} = \frac{\frac {c_\phi}{R}}{\theta s^2+\frac {c_\phi c_i}{R}s+c_S} = \frac{\frac {c_\phi}{R\theta}}{s^2+\frac {c_\phi c_i}{R\theta}s+\frac{c_S}{\theta}}$$ Note that the transfer function of a second order system is in the form: $$G(s) = \frac{K\omega_0^2}{s^2+2\xi\omega_0s+\omega_0^2}$$ By comparing the forms you can easily get the gain($$K$$), natural frequency($$\omega_0$$) and damping factor ($$\xi$$). You can easily calculate these values (ex. $$\omega_0 = \sqrt{\frac{c_S}{\theta}}$$) and check if your Simulink model behaves well with these mentioned values (in this way you can know for sure if your model is correct). In my opinion you should just place this transfer function and pass it an input and read the output. This would be the easiest way.

EDIT: Had some typos in my transfer function and now I get the same results from my transfer function model!

Thank you for your answer! I tried to compare the two forms, but I think something must've gone wrong. For 𝜉 , I get $$\frac{c_\phi c_i}{2R \theta \omega_0}=0.3873$$ For K, I get $$\frac{c_\phi}{R \theta \omega_0^2}=0.0667$$. For $$\omega_0 =9.6825$$

When I plug these into a transfer function and compare the resulting scope output with the one from my Simulink model, I get two very different results. The first image is from my integrator model and just intuitively speaking, this seems to make sense; the meter's pointer overshoots, goes back a little, but eventually stays stationary at a certain angle $$\alpha$$

• Can you post a screenshot of the Simulink model for the second picture with the transfer function? What is the amplitude of your step input signal? – Dinno Koluh Nov 3 at 21:06

As far as I know, I can't post images in comments, so here we go.

This is the Simulink model and a screenshot of the scope. I renamed $$𝜔_0$$ as $$f$$ and $$𝜉$$ as $$D$$. Their numerical values are the same as in the answer before. The input's amplitude is 20.

EDIT: I just took a quick screesnshot and didn't adjust the solver, so the graph is somewhat rough.

• Ok, as I see you have the same result as on the first picture from your previous post. What is the second picture from your previous post supposed to represent? And one more observation. The final value of your output should be $20\cdot K$ and I see that in the picture from this post but on the pictures from the previous post it is not! – Dinno Koluh Nov 4 at 23:04
• How did you actually get the second picture in the previous answer? – Dinno Koluh Nov 4 at 23:05
• I got the second picture's answer by forgetting to put in some factors. I solved for 𝐾, 𝜉 and 𝜔0 and didn't put these into the Transfer Function correctly. – Pilotf4 Nov 10 at 18:46
• But now, everything is OK? – Dinno Koluh Nov 10 at 19:03
• I assume so, the output like in the above answer seems right to me! Thank you for all your help! – Pilotf4 Nov 10 at 19:12