# What is the best method to model the input of an electro-mechanical system for control design and simulations?

In particular, say I have a dynamic model of the inverted pendulum / cart as described here. Instead of using the error difference in force to input into my controller, I want to take into consideration a motor driver (voltage input) to a DC motor for the force. Would the best method then to analytically describe the force relationship to the voltage input? If so, then would I need to include a voltage state variable so that I can build a controller based on that signal?

My motivation for asking is that I feel I have a fundamental disconnect with controls engineering. In my studies I've gone over classical and modern theory without the benefit of actually applying theory to application. Most of what I participate in deal with electromechanical systems, but most books, articles, etc I come across don't really delve into the physical interpretation of the plant input. I would appreciate any feedback on the matter.

There are various levels of plant models you can develop, depending on what you want to do. The model you mention is probably suitable for most of the cases in terms of designing a controller. However, it seems that in your case the level of abstraction is too high, so my suggestion would to break the plant model further into sensors + plant + actuators, which would allow you to model the details of the actual motor actuation.

There are various tools to do this, starting from first principles (pen & paper) and implementing in something like MATLAB/Simulink. If you want something slightly higher-level, where you can just drag and drop standard models, you can use something like Simscape, SimElectronics and SimMechanics, which are all add-on to Simulink.

• I'd like to add that DC motor voltage isn't linear with respect to motor torque. Cordless drills for instance, are variable-speed not by adjusting voltage, but instead by pulsing full battery voltage to it from 0 to 100%, usually around 1,000 times per second. This gives a nice, linear actuation for an otherwise, difficult-to-linearize device. AC synchronous motors are variable-speed if used with a variable-frequency driver. Induction, servo and other types typically use a speed/position feedback system. Commented Jun 8, 2015 at 21:20
• @rdtsc See this example for a well-established and accepted mathematical model of a DC motor. In all my years as an engineer, that is how most people model DC motors mathematically. Commented Jun 9, 2015 at 7:51
• @am304 yes its reasonable but ive seen the brushes, direction changes, capacitor slowness etc. modeled in. Commented Jun 9, 2015 at 20:13

I understand your motivation, and I've also seen the disconnect that can exist between the complexities of modern control theory and the relative simplicity of the control schemes implemented in many engineering applications. The answer by am304 gives some great suggestions. I would add to that the following points:

• Be very clear about which parts of your model are a representation of the plant (and therefore only useful for simulation) and which are a representation of the controller that you wish to practically implement. It may sound obvious but it can be easy to confuse the two when you're sitting behind a Simulink screen.

• Think about the units you're working in at each point in the system. If you know what sensor you will be using to measure output then this will specify a conversion factor, presumably between angle and voltage. You may need to include appropriate scaling factors on your desired position to get a sensible error signal.

• For a DC motor torque typically scales with current, and speed with voltage. For actuator type positioning applications torque control (and therefore current control) is usually desirable, so we can think of the motor as a current to torque converter. Unfortunately voltage modulation is generally the easiest motor input to control; however, current feedback is easy to achieve by placing sense resistors in the current path. Therefore a common technique is to implement a fast acting inner current control loop (based on an error signal between a desired current and the resistor sensed current), surrounded by a slower acting torque control loop (based on position error). This is referred to as cascade control and, provided the inner loop is sufficiently faster than the outer loop, allows the two controllers to be tuned relatively independently.

• If you don't fancy cascade control then you have two options for more complicated state-space methods. Either include a model of the torque output that the motor will achieve for a given voltage input within your control structure (although be clear that this is different to your actual plant model in simulation), or take a current measurement into your controller as well as a position measurement. This second approach is effectively combining the two cascaded controllers discussed above.

I hope that provides some useful information to get you started.