©2001 IEEE. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes or for creating new collective works for resale or redistribution to servers or lists, or to reuse any copyrighted component of this work in other works must be obtained from the IEEE. 
Takashi Kenjo, Member, IEEE, Tatsuya Kikuchi, Member, IEEE, and Masatoshi Kubo
Abstract  The need for a mechatronics simulation software is pointed out with special reference to engineering education, after which we present a convenient approach. Our basic algorithm computes the electromechanical behavior of electric motors combined with mechanical components like inertial/frictional/torsional loads, including such transmission elements as gears or lead screw/nuts. The simplicity and utility of our mathematical treatment are discussed in terms of its educational merits. The major theory is developed using a brushtype permanent DC motor, but brushless DC and stepping motors are discussed as well. We present three sample software. One is a simple program which demonstrates the computational principles for the electric current in an LRC circuit or the velocity of a suspended mass. The other two simulate the dynamic behavior of a slide table powered by a DC motor via gears and a lead screw. One is written in Microsoft Visual Basic code reflecting the physical meaning of mechanical components and the other is a Visual C++ version using the class library concept. The merits and demerits of these two approaches are discussed from the vantage point of undergraduate education and the retraining of technical instructors and working engineers.
Meanwhile, in actual applications, the motor shaft carries a gearbox or a pulley; some motors have a hollow rotor construction to change its rotation to linear motion to drive the load, which often has a complex construction.
In the conventional curriculum of Japanese universities, perhaps in other countries as well, mechanical engineering students are only required to take a general electrical engineering course covering such topics as power transmission and alternating current theory. Meanwhile, electronic/electric engineering students need only enroll in an overview course on mechanical engineering. Clearly, this is not enough in terms of mechatronics or electromechanical education.
There are two approaches to the study of electromechanical systems. One is based on the analogy that holds between mechanical systems and electrical circuits (for instance between mass/inertia and inductance, or elasticity and capacitance); the other is the use of differential equations to compute physical quantities like position, angle, speed, and force.
Electrical engineering students are required to study the theory based on the analogy between electric circuits and dynamic systems, which provides a powerful analytical tool as seen in the work by Haskew and Schinstock [2]. To nonelectrical engineering majors, however, viewing mechanical systems as an electrical circuit, sometimes with a voltagesupply and at others with a currentsource, often causes confusion. Also, analogy is a convenient method for a system that can be represented as a combination of massspringdamper, but it is not almighty in practice.
Developing a simulation software that incorporates both methods  electromechanical analogy and numerical computation of differential equations  should provide a highly versatile and practical tool, being free from the limitations of either method used alone. Moreover, simulation programs may provide a better path into the electromechanical field for nonelectrical students in particular, since almost all engineering students today receive some computer training and have access to PCs. Such simulation techniques will naturally be much more effective if it takes advantage of the PC's visual environment.
In order to create numerical computation software on a PC, one must be capable of synthesizing knowledge from various scientific and engineering disciplines. Ideally, those who have studied mathematics, physics, electronic circuitry, mechanisms and computer programming should be able to create their own computation software for their design purposes. This is unrealistic, at least in Japan, for several reasons. First, most electronic and mechanical engineering students are unable to acquire a sufficient proficiency in all these fields during their fouryear undergraduate education; and many not even with the added twothree years of a Master's program. Furthermore, very few courses are offered in most universities that deal with the subject of synthesizing different areas of technology to predict the overall behavior of a mechatronics system. This situation can be considerably improved if there existed an educational simulation software, either as a "template" for program development or for effective instruction on the subject of mechatronics itself.
Consider now young engineers at corporate R&D labs, mostly engineering graduates including Master degree holders. They usually cannot afford the time to study such techniques on an individual basis. Meanwhile, they are given a relatively short time frame to design and develop products. Conventional design based on trialanderror strategies is timeconsuming, costly and inadequate for this task. Here too simulation techniques can prove to be powerful tools. Yet, to the authors' knowledge there are no effective software packages available.
Having recognized this situation, the authors have made some initial attempts over the past several years to meet our particular instructional needs. The resulting software is also being tested at a corporate R&D site. As its utility has come to be recognized, we have recently moved to a more systematic development of a simulation software for education and training purposes. This is the first report on its basic concepts and algorithm, including trainee reaction and discussions for future development. A few sample sourcelevel programs are also presented.
A. Permanentmagnet DC Motor
We consider a permanent magnet DC motor using the model shown in Fig.
1. The idea of an equivalent circuit for the DC motor is discussed
in reference [3]; here, we present a more expanded model.
The key features here are:
1) Brushes are simulated by two diodes placed in reverse parallel (see
Appendix
A).
2) Winding inductance L_{A} and resistance R_{A}
are represented in a straightforward manner.
3) Friction and hysteresis brake effects are represented by a current
source denoted by i_{F} and a special symbol resembling
a resistor. We prefer to call this path a 'current sink' because a constant
current
I_{o} is absorbed independent of the applied voltage.
Note, however, that it reverses polarity when the rotational direction
reverses (see Appendix B).
4) Eddycurrent and viscous losses are represented by R_{E}.
In a typical motor, R_{E} is larger than the armature resistance
R_{A}
by a factor of 10~20. Weissmantel [4] presented many
useful equations for computing a permanentmagnet DC motor, but he ignores
the effect due to R_{E }. While this is acceptable for
welldesigned motors, this term is included in our scheme (see Appendix
B).
5) The rotor inertia (rotor's moment of inertia) is represented by
a capacitor C_{M}.
6) Torque is given by K_{T}i, where i is the
current and K_{T} the torque constant, which is also equal
to the backemf constant K_{E}. The current in each parallel
path represents the torque needed (or consumed) in it; for example, K_{T}
multiplied by i_{M} (the current absorbed in the capacitor)
is the torque used to accelerate the rotor (armature), and K_{T}i_{F}
is the torque needed to overcome the mechanical friction and retarding
torque caused by magnetic hysteresis in the motor's armature core.
7) The voltage v across each element represents the speed w
as expressed by the simple equation:
The equations needed to describe the motor's behavior are as follows:
The electric relationship is governed by
Here
V = input voltage
v_{B} = brushvoltage drop
R_{A} = winding resistance
L_{A} = winding inductance, which is here assumed to
be independent of rotor's angular position
i_{A} = armature current which consists of i_{M},
i_{E}
and i_{F}:
e = backemf, which is proportional to the motor's angular speed
w_{M}
as expressed by
The torque T_{M} generated by the motor is computed
from the armature current by
The motor's dynamic equation is given by
Here, the three terms on the lefthand side correspond to the three
terms on the righthand side of (3) as follows:
1) Torque to accelerate the rotor:
where J_{M} is the rotor's moment of inertia.
2) Retarding torque due to mechanical/electric viscosity:
Since the braking torque caused by eddy current is proportional to
the speed, we let the viscous damping coefficient D_{M}
represent both mechanical and electric characteristics in this manner.
3) Friction torque as a function of w_{M}
Instead of noncontinuous characteristics we use for the frictional
torque a monotonouslyincreasing continuous function given by
By letting w_{Mo} take on very small values, i_{F}
assumes steplike characteristics.
By substituting (4), (5) and (9) into (6), we get the following motor
equation:
Meanwhile, the following relation applies to the circuit diagram of
Fig.1(b):
By comparing these two equations, we can find expressions for the effective
resistance R_{E} and effective capacitance C_{M}:
Thus, all components including mechanical elements are represented
by electric terms. Hence, it is basically possible to analyze a DC motor's
dynamic behavior using a circuit simulator. There are, however, at least
two problems not normally encountered with electric circuits. One is the
treatment for i_{F
}: it is necessary to use a rather complicated
function in the simulation code to represent this term. The other is the
cogging torque. As we have discussed elsewhere [5],
cogging is not a simple phenomenon, having at least two components: one
is related to the teethmagnet interaction, which is deeply related to
the magnetic circuit problem, and the other component arises from current
commutation taking place in the brushcommutator mechanism. It is difficult
to give an accurate description of cogging torque using either conventional
circuit simulation software or our present method. A relatively simple
treatment, possible with conventional simulator, is to treat K_{E}
as follows:
where K_{EO} is the center value and K_{E}
the ripple amplitude of the backemf coefficient.
The angular position _{M}
is the integration of motor speed:
z = typically twice the number of armature teeth [5]
= phase angle which
depends on motor construction
This means that K_{E} is actually not a constant but
fluctuates as a function of the rotor's position.
(b)
Fig. 1. (a) A DC motor and (b) Its equivalentcircuit model.
B. Direct Coupling with Inertial Load
We now discuss the case in which a load is directly coupled to the motor shaft, as modeled in Fig. 2(b). The torsion effect between the rotor and the load disk is represented by a coil, or inductance L_{S}, and the mechanical loss occurring in the load disk is represented by another current sink i_{F}_{2 }(= ±I_{oL}) and another parallel resistor R_{E}_{2}.
Such systems are known to generate highfrequency mechanical oscillations due to the interaction between the torsion torque and inertia in both rotor and load. This oscillation is damped or suppressed by a damping mechanism, which dissipates kinetic energy in the form of heat; this can also be represented by a resistor R_{R} and a current sink i_{FR} in parallel with L_{S },_{ }as shown in Fig. 2(b). The resistor represents viscous damping and the current sink the frictional cause, whose mathematical treatment is given below.
(b)
Fig. 2. (a) A DC motor with a directly coupled inertial load, and (b) Equivalent circuit expression.
C. Coupling via Gears
We next look at the case in which a load is coupled via a gearbox. Additional
factors that must be taken into account are:
1) Speed/torque conversion effect. This can be represented by a transformer
symbol, as shown in Fig. 3.
2) Transmission loss due to friction at the contacting surfaces.
3) Damper effect. Since collision and reflection between rack and pinion
occurs in the simulation, this can disturb computation. It is necessary
to incorporate some effects to absorb the kinetic energy and dampen this
type of oscillation.
The mathematical treatment is as follows. First, the dynamic equations
for the motor and load are written as:
Similar to the friction inside the motor, the load friction, which
corresponds to i_{F}_{2} in Figs. 2
and
3, is expressed using appropriate small values
of w_{Lo} as follows:
Here, we interpret that T_{S}
is the torque used to drive the gear as seen from the motor, but the torque
which is transmitted by the gear to drive the load is T_{S
}. If the gear's stepdown ratio is q (<1), the torque
ideally increases by the factor 1/q, but it is adjusted by the factor
g(<1). The transmission efficiency g is related
to gear construction, the surface's materials, finish and lubrication conditions,
and also differs for forward and backward conditions. As shown in Fig.
4(a), if the pinion is driving the rack, which is the normal condition,
the efficiency is forward, but if the rack is driving the pinion, the efficiency
is backward. As is well known, the forward efficiency is higher than the
backward one.
Coefficients
and depend
on the motor's rotational direction and the contact conditions between
the gear teeth. When the motor is driving the load, the forward efficiency
g_{F}
is used, but when the load is driving the motor, as when the motor is in
generator mode, the backward efficiency g_{B} is used. This
situation is rather complex and can be described as follows:
where
(This statement is not always necessary and can often be simplified
depending on the model.)
It is known that for a worm gear or a lead screw, g_{F}
and g_{B} are given by the following equations.
1) Forward. When the worm (lead) is driving the rack (nut), the
efficiency is:
Here, u is the coefficient of friction at the contacting surfaces,
which is said to normally range from 0.05 to 0.15, and
is the lead, as explained in Fig. 5.
2) Backward. When the rack (nut) is driving back the worm (lead
screw), the efficiency is:
In normal cases, this is less than unity and in this case we treat
it as 0.
Now, the major component of T_{S} , which we note by
T_{SA}, is the torque generated by the torsion in the pinion
and rack (or worm and rack), but the frictional and viscous torque caused
by relative motion between these two parts is added to work as a damper
effect. Using relative angle ()
and relative speed (qw_{M } w_{L}), we put these
as follows:
where
T_{SA} is such as illustrated in Fig.4(b).
When the backlash is very small, the model is effectively the same as in
Fig.
2. The second and third terms in (24b) respectively correspond to the
resistor and current sink in parallel with the spring symbol in Fig.2,
and the same functions are considered to be incorporated more effectively
in the gears represented by transformer symbols in Fig.3.
For F_{R} and D_{R} , we select appropriate
values as will be discussed in Section IV, and we set a small value
for w_{Ro} .
Fig. 3. A DC motor carrying a load via a gearbox and lead screw.
Fig. 4. (a) Rack and pinion coupling and (b) Torque vs. relative
angle. _{h}
is the backlash size, and the slope (k_{S}) of the straight
portions is the stiffness.
Fig. 5. A worm gear model and definition of lead.
A. LRC Circuit and Mechanically Damped Oscillation
The most basic dynamic equation is
When this is applied to the mechanical spring model of Fig.
6(a), where a body is suspended via a spring in a viscous liquid, the
parameters have the following meanings:
v = body velocity
m = body mass
D = viscous coefficient
k = spring stiffness
f = gravitational force(mG) minus floating force, where
G
is the acceleration of gravity
The electric circuit equation for the LRC circuit in Fig.
7, which corresponds to this model, is
Most conventional numerical methods for such equations divide it into
two firstorder equations. Instead of dividing, we write as follows:
From this, we obtain the numerical computation formula:
Certain special cases point to some interesting features. When L
is negligible, we let L = 0 to obtain:
This is the same as the normal Euler's forward method.
When the capacitance is infinite or 1/C=0 in (29), we obtain
which is the Euler backward solution for the LR circuit. Thus,
(29) contains both the forward and backward methods.
Another feature surfaces when R = 0. The equation for this case
is
or
It is known that the variable i or v displays an oscillation
with a constant amplitude and constant frequency
.
If Euler's forward method is applied for this case, the computed oscillation
will increase in amplitude with time; if the normal backward method is
applied, the amplitude will be damped with time. The smaller stepsize t
is, the more gradual the increase or decrease rate.
When R = 0, equation (29) becomes:
In this method, the oscillation amplitude neither increases or decreases,
i.e., stays constant as the analytic solution.
Our basic algorithm is based on the above theory, although we incorporated minor modifications when applying to our educational software. In Appendix C, we briefly discuss the numerical accuracy of (29).
(b)
Fig. 6. (a) Mechanical spring model and (b) Its equivalent circuit
expression.
Fig. 7. LRC circuit.
B. Relation to the DC Motor's Equivalent Circuit
Here we add a supplementary explanation to the relationship between
the DC motor's equivalent circuit, (26) and (27) and their circuits in
Figs.
6(b) and 7. The pendulum can be represented by
the parallel circuit shown in Fig.6(b). We assume that
the force f applied to the pendulum is divided into three components
and flow in the branches for the equivalent capacitor, resistor and inductor.
From the analogy to an electric circuit, we derive the following three
relationships:
By substituting these into (35), we obtain (26). Here, note that the
physical quantity across each element in Fig. 6(b)
has the dimension of velocity but in the DC motor circuits (Figs. 1
and 2) it is voltage and corresponds to speed. In the
DC motor circuit, the current is proportional to the torque. This fits
with the idea that force is flowing in the branches in Fig.
6(b). Thus, the DC motor circuits of Fig. 1 through 3 can be regarded
as a combination of a series electrical circuit of Fig.
7 and an equivalent parallel circuit for a mechanical system as in
Fig.6(b).
It is easy to see that motor's armature inductance
L_{A}
and resistance R_{A} can be represented respectively by
the inductance L and resistance R in Fig.
7. Furthermore, the rotor inertia can be represented by a capacitance
C.
Note that in Fig. 6(b), the mass m is also represented
by a capacitor. Just as the resistor written as 1/D is placed in
parallel with the capacitor, resistor R_{E} and a current
sink element are placed in parallel with the capacitor in the DC motor
circuit (see Fig. 1).
When the elastic element is fixed at one end, its equivalent element is in parallel with the capacitance in Fig. 6(b). On the other hand, if it exists between two inertial elements, its representation L_{S} appears between the corresponding capacitors, as in Fig. 2.
As stated earlier, these analogies may at first confuse nonelectrical majors. But once the basic concept is understood, they can prove highly useful when analyzing electromechanical systems.
C. Application to a Plain DC Motor
We now apply the above method to compute the motor's motional behavior.
Equation (2) is rewritten as
Referring to the form of (29), the numerical equation for the nth
current I_{n} becomes
Note that w_{Mn} corresponds to the current summation
term in (29).
For V_{Bn}, we derive from (A1)
It is often possible to ignore the motor's armature inductance L_{A}
because the delay of the current buildup due to this effect is very short
as compared with the motional effect due to the rotor's inertia. Brush
drop v_{B} is as negligibly low as 0.1V or so in a small
motor which uses metalized carbon brushes. In this case, (40) is simplified
to:
When the power supply or the driving circuit has a current limiter,
this function can be described as follows:
where I_{SETn} is a set value.
The dynamic equation of (6) is rewritten as
The numerical value for I_{Fn} is derived from (10)
as
From this, the numerical computation equation for w_{M}
is
where t
is the stepsize of time.
The rotor's angular position is computed simply as:
We then return to (39) to repeat the computation.
For a stepping motor, as well as a brushless DC motor, for which current must be computed for each phase winding, the backemf in each phase is a function of angular position and the overall computation is rather complicated. See Appendices D and E for these motors.
It is not a difficult task to write a program for a system having more mechanical elements based on the above idea, as long as the number of inertial loads is kept relatively low. We selected the slide table shown in Fig. 8(a) for producing sample software. Assembling this machine was a project for one of the overseas instructors' refresher courses in our university. We decided to present to the trainees its simulation software.
Since trainees enrolled in our overseas instructors’ retraining course were assembling, the slide table is driven via a lead screw by a conventional brush DC motor with gearbox. The equivalent circuit representation for this model is shown in Fig. 8(b).
The key components and their parameters are presented below.
1) Motor
The drive motor is a brushtype DC motor with a gearbox with a reduction
rate of 20. The estimated parameters are:
(b)
Fig. 8. (a) Photograph of sliding table and (b) Its equivalent circuit representation.
B. Expectations on the VB Version as a Teaching Material
The trainees were expected to learn some analytical skills in mechanics
and electronics. We felt, however, that a regular classroom lecture on
theory would not interest them so much, and thought a simulation could
serve as an effective learning tool in understanding the function of the
components comprising the tablemotor system. Our sample, shown in Fig.
9, was as follows:
The table is first set at the starting position and the motor is run
at a supply voltage of 24V.
When the table touches the limit switch placed at an appropriate position,
the motor voltage turns to 0, and the table comes to a stop after a short
time lag. The overshoot is observed. The parameters are then changed and
the overshoot is checked again. The purpose of this exercise is to determine
which factors are important (before any complicated feedback control is
introduced).
We wrote two program versions: one in VB and the other in Microsoft Visual C++ (VC++). The VB codes (sample program #2) were written following the flow of logic outlined above and referring to the equivalent circuit of Fig.8(b) so that students and instructors can actually "read" the physical or circuitry concepts within the program lists. Cogging is not dealt with in these samples.
In the VB version, the following parameters can be set in the text boxes
on the form and their default values near the quantities presented above.
1) Common
Fig. 9. Window of VB version showing simulation results.
C. Class Library Using VC++
We felt the need to develop a more powerful tool for mechatronics computation. One solution is to use C++ and prepare a class library for mechatronics components. Rather than writing a program for each individual system (as in the above samples), it becomes possible to construct various systems from this library. These systems can then be simulated by inputting the appropriate data. We thus took the alternative approach of developing a C++ program based on the classlibrary concept (sample program #3).
We believe that our basic algorithm for computing differential equations
is suited to building an objectoriented software, where mathematical or
algorithmic expressions can be manipulated as though they were "objects"
(i.e., physical components). However, the objectoriented class library
must be designed very carefully when authoring such software; that is,
families and classes must be set up carefully. After analyzing the system
of Fig. 8 and referring to some other systems, we decided
temporarily on a basic structure for the class library (see Fig.
10). The classes we set are:
1) Parts class (CParts). This is a superclass which has Drive class
(CDriver) and Transfer class (CTransfer) as its subclasses. CDriver is
defined as the class for something generating speed and position. CTransfer
is defined as the class for something generating torque.
2) Motor class (CMotor). This is under CDriver and only the permanent
magnet brushtype motor is considered for now. Powersupply parameters
are included in this. If we expand to include AC motors, it will be necessary
to treat the power supply as a separate class.
3) Gear class (CGear). This lies under CTransfer and includes stepdown
and stepup mechanisms together with a backlash. Under this class is Lead
nut class (CLeadNut).
4) Load class (CLoad). This is, under CDriver, for components having
mass or inertia.
5) Terminal class (CTerminal). This lies under CLoad. CTerminal indicates
what comes after the last load; there may be nothing, it may be a spring
with one end fixed to a stationary base or wall, or it could be assumed
as a constant gravitational weight or torque.
(Here class corresponds to the conventional concept of variable
type.)
The computation arrangement of objects within classes is shown in Fig.
10. Each class contains objects (conventional variables), and
is designed so that an object in a class can be connected to another object
in a different class. Each object remembers its torque, speed and position
and transmits them to the objects connected at left and right. The motor
is at the far left, and is coupled with the first load via a gear. The
first load is coupled with a second load (slide table in our sample), and
between them is a gear (lead screw/nut in sample). We set down the general
rule that a load is coupled with two transmission elements on each side.
These elements usually consist of gears, but on the far right comes a terminal.
The terminal for our slide table is an empty object.
(b)
Fig. 10. (a) Computation concept for the C++ version for the model shown in (b). Here, ALPHA and ALPHA2 correspond to coefficient in (17) and the similar coefficient for the coupling between the lead screw and nut, respectively. VISC_FRICT 1 denotes the function of the second and third terms of the righthand side of (24b). RATIO is the stepdown ratio of the gearbox, and PITCH the lead screw pitch per rotation.WM, WL and VW denote motor speed, lead screw speed and table speed, respectively. LANGL denotes the motor's angular postion, LANGL the lead screw angular postion, and WPOSITION the table position, respectively.
D. Reaction of Trainees
In our refresher course for technical instructors (five, from Malaysia, Mexico, Panama, Saudi Arabia and Tunisia), we first presented a BASIC simulation (sample program #1) which computes the current flowing in an LRC circuit, or the speed of a mass suspended in a viscous liquid by a spring. Its purpose was to review a simple, but important physical phenomenon common to electricity and dynamics, and to learn the computational principles of our algorithm. The simulation here is simply based on the analogy that holds between two separate systems, one mechanical and one electrical, and we are not yet considering an electromechanical system at this stage. We found this simple example to be a necessary step before moving on to actual electromechanical systems. As expected, the theoretical explanation given in Sections II and III seemed very dry to the trainees, even though they were technical instructors.
After this introductory example, we presented the two versions for the slide table. Fig. 9 shows computed samples for the VB version, and Fig. 11 a sample of the VC++ version. Both versions of visual software were very effective. The source files are given in Programs 2 and 3.
We present the reactions of three trainees. The first trainee, who showed a great interest in all technical subjects, quickly understood the initial BASIC program for the LRC circuit, and remarked "We heard (in our C language course) that C is superior to BASIC, but there are too many things that must be learned before one can actually write programs using C." He asked a good question about the function of a brake, since he was taking one back to his country to install it in his machine. He planned to mount it onto a load that was geared down from the motor shaft. By slightly altering the sample software, we were able to demonstrate in class that a brake is more effective when mounted on the motor shaft than on the load side. We knew from experience that while feedback control is a popular electromechanical technique, it is not always an appropriate subject at the introductory level, and that examples showing the effects of fundamental components (such as brakes, reduction rate, various motor parameters) are much more important.
Another trainee, who also showed interest in the BASIC program of the LRC circuit, was interested to see the source program for the VC++ version, but became discouraged when actually presented with it. The trainees were also enrolled in a course on C language, but the VC++ source program appeared to them as an entirely different language.
The third trainee was very interested in seeing how changing parameters
would affect the computational results. In her case, understanding the
source code was not a high priority.
Fig. 11. Windows of the C++ version.
A. Algorithm
First, we shall comment on our basic computation method. As we were aware of the accuracy limitation of the principle presented before, we also used a more accurate method in our research, but there were no significant differences as long as computation results did not diverge by setting a too large stepsize t. For accurate computation of the influence of resonance, t must be set at a value smaller than 1/100 of the cycle of the highest natural frequency, but five times this value is sufficient for obtaining an overall profile. However, a stepsize larger than this value may make the computation diverge. In the sample program, the minimum cycleperiod of natural angular frequency is around 2ms. Hence, t required for accurate computation is 0.02ms, but for the profile computation, it can be 0.1ms.
B. Note on Viscosity and K_{E}K_{T}/R_{E}
We shall comment on one matter about viscosity. This is about the viscosity
which is inherently involved in the motor itself. If L_{A}
and v_{B} are negligible, we get from (2) for i_{A}:
Therefore, (5) becomes as
By substituting this into (17) we obtain
It is seen in this expression that the armature resistance R_{A}
works effectively as viscosity in addition to D_{M}, the
component due to mechanical viscosity and magnetic hysteresis in the armature
core. It is seen in (13) that D_{M} is expressed as K_{E}K_{T}/R_{E}.
Since in most motors R_{E} is 1020 times larger than R_{A},
the inherent or effective viscosity due to the winding resistance is much
greater than the mechanical and magnetic effect. However, when the motor
is controlled in the current mode or the current limiter is working, the
viscosity due to R_{A} vanishes. For this reason, the undesirable
oscillation that results from the interaction between the motor's inertia
and shaft elasticity damps quickly in the voltage control mode, while it
may not damp in the current controlled mode. In our slidetable example,
this is evident if the maximum current is set, e.g,. at around 0.5A and
the screw's moment of inertia is set at a value larger than the default
value. It will be seen that the amplitude of this oscillation increases
with the backlash in the gearbox.
Although this damping mechanism is not apparent in (42), it is included in it implicitly, and its effect appears in the computation results. This may be a problem beyond the undergraduate level. However, the instructor shall be aware of this important technical matter and ready to answer questions if a student happens to notice this oscillation behavior.
C. Students
Undergraduates: Students in electrical/electronic engineering and mechanical engineering are the ones who have the opportunity to study mechatronics and then work in this area after they graduate. In Japan, most electrical/electronics students are required to take a course in general mechanical engineering, while mechanical engineering students must, in general, take a few subjects in electrical engineering, such as power generation, transmission or alternating current theory. Yet, this usually does not provide them with enough background knowledge to go on to further studies in mechatronics on their own. In particular, many students find it difficult to visualize how the electrical circuitry and mechanical components work together as a single system. It is in this area that we saw the need for an effective teaching aid. As a start, we chose the slide table simulation, thinking that it would serve as an effective visual demonstration which would arouse the interests of students studying mechatronics.
What is the role of commercial software, such as PSpice or Matlab, in the context of mechatronics education? These are used by many researchers who take advantage of their advanced functions to conduct research. If they are to be used in undergraduate instruction, an introductory course should be provided where students can become proficient with their use. Purchasing such commercial software for undergraduate purposes can be very costly. Another problem with these simulation software is that many of the algorithms are treated as black boxes, making it difficult for instructors to give a clear explanation to their students. Thus, in undergraduate instruction, the authors believe that it is better to use an algorithm that can be seen and understood by students, and for which source code can be accessed and modified by instructors. Such an educational tool would effectively complement classroom lectures and laboratory workshops.
Before establishing our simulation method in this fashion, we presented an early prototype to ten thirdyear students. In this class we explained the computation principle using the Euler forward method and gave them an assignment to simulate the squarewave oscillation produced in an astable multivibrator, which is composed of two transistors. DOS BASIC (BASIC) was used as the PC language. This was a difficult assignment for them, and we felt that even though the computer language was the easiest available, dealing with several aspects (PC language, mathematical principle and electronic circuit) at the same time is very inefficient. Wellorganized demonstrations are needed as a tool for undergraduates.
Graduates: Our basic method combined with instructive sample programs should provide the graduate student in mechatronics with a solid background in simulation techniques, thus enabling him/her to move on to further advanced subjects and tools. For example, a Master's candidate at our university acquired a good understanding of simulation using our program, which he applied toward his thesis project. Knowledge of our software also helped him to effectively utilize Matlab to simulate more complicated systems. For relatively simple systems, i.e., those with up to three or four inertial elements, computational results agree well between our program and Matlab. (For a relatively large system of five inertial elements, for example, Matlab was often easier to use.) We found that special cases, such as the inclusion of cogging torque, could be incorporated into our program much easier because we were already familiar with its limits and possibilities.
D. Instructors
As stated before, we asked overseas technical instructors to give their reactions to demonstrations of the VB and VC++ version simulations of the slide table. The visual presentation was received very favorably. We also found that instructors generally preferred a sample program from which computational principles can be "read" and understood (in this case, the VB version), instead of one which merely provided a convenient black box tool. Some of them expressed interest in our simple computational algorithm for differential equations.
Questionnaire results on familiar computer languages showed that most knew BASIC, while some were also familiar with C, Pascal or assembly. Since FORTRAN and BASIC were the major computer languages in the 1980s, most instructors who are now over the age of thirty received their computer training in these languages. Thus, this group of instructors responded more favorably to VB than VC++. Not being programming specialists, they were more at ease with the VB simulation.
For technical instructors, it makes more sense to prepare sample software which can be modified to suit specific instructional situations. From the initial reactions obtained from our overseas instructors, however, it would seem that a simpler example may have worked better in inciting their motivation. For example, the following items may be mentioned:
E. R&D Engineers
Corporate R&D sections demand a simulation tool that can be used for practical design purposes. There are two types of design engineers working in the mechatronics field: the first views simulation software as a purely utilitarian tool, regarding it as a black box but demanding from it a high functionality; the second type is not satisfied until he or she can comprehend the "logic" of the simulation process. For the latter engineers, simulation software developed originally as instructional aids may prove useful at a practical as well as educational level. The author's direct contact with some R&D engineers has shown that they see great value in Visual Basic as a tool for developing mechatronics software. The developed simulator, when combined with an interface to incorporate experimental data/design parameters, can be a highly effective design tool.
Most working engineers are of the first type, more interested in tools that can be put to immediate practical use in their daily tasks; they normally do not have the luxury of expanding their knowledge outside their specialized fields. Thus, it would be unrealistic to expect mechanical engineers to spend much time studying electricity and electronics from their theoretical foundations. What is important is to provide an environment that would allow engineers to obtain relevant knowledge rather quickly through practical exercises, and for this, appropriate tools are needed. We believe that the development of a VC++ based simulation program, the initial form of which we have proposed in this paper, could provide one solution in this respect. A truly practical VC++ mechatronics simulation software will be realized only after further efforts are spent in a thorough component analysis, their integration into a coherent system, and actual program development.
We wrote a sample program using VB with plain animation, and another version in VC++ combining sophisticated threedimensional (3D) animation; the latter represents an initial step towards the objectoriented approach.
The simulation programs were demonstrated to a class of overseas technical instructors, who showed a high enthusiasm toward their visual presentation. As educators themselves, they generally saw value in open software whose source codes can be directly accessed, while those in their thirties showed a higher interest in the VB version also for its familiarity and accessibility. Even so, the "virtual reality" effect produced by the 3D animation in the VC++ version seemed to them a highly attractive feature.
From the standpoint of future expandability, the authors feel that a program based on a C++ classlibrary is preferable; the sample program given here thus represents an initial attempt and we discussed issues related to its further development. Indeed, several problems must be addressed before a robust versatile package can be fully developed along this line.
The general approach presented here should help students and educators alike in deepening their understanding of electromechanical science, as well as providing a practical designandanalysis tool in the industrial R&D sector.
Fig. 12. Measurement of brush drop and approximation curve.
Fig. 13. If a hysteresis motor, which is a type of ac motor, is used for the load, the current consumed in the DC motor is expressed by a constant current corresponding to the hysteresisbrake effect, and a speeddependent portion caused mainly by the eddycurrent brake effect. The former is represented by I_{o} and the latter by R_{E}.
Fig. 14. Accuracy of our computation method for nondamped oscillation for large t: (a)t=and (b)t= slightly larger than .
Fig. 15. Accuracy of our computation method for: (a)Nonoscillatory damping. (b) and (c) Damped oscillation.
Sequence  V_{1}  V_{2}  V_{3} 






















where V_{o} is the power supply voltage and V_{D} the flyback diode's forward voltage, which is normally about 0.6V.
Torque T_{M} is computed from:
Here T_{COG} is the cogging torque, which is defined
as the fluctuating torque that is generated not by the exciting current
but by the interaction between tooth construction and the rotor's magnetization
[5].
We assume from some experimental results that it is given by :
where T_{G} is an appropriate cogging amplitude, which
may be negative. This simple expression is explained as follows. When the
two stacks are symmetric with respect to the center and have the same conditions
except for a quarterpitch shift, the major cogging component occurs 4p
cycles per revolution. This is normally very small, but if there is any
imbalance between stacks, a considerable cogging torque of 2p cycles
per revolution apperas; this is expressed by the above equation.
The speed is computed in a manner similar to the case of a DC motor, i.e., from (6). The numerical computation is based on the form of (46).
A major problem for beginners may be the algorithm for computing current
from the basic (D1) to (D4). There are several practical methods,
but the following one follows the concept presented before. By eliminating
i_{3}
from (D1) and (D2), we get
We obtain another equation
Similar to (29), the numerical solution for i_{1} and
i_{3}
are :
The function of the flyback diode can be incorporated in such a manner
that if the computed value of i_{1n} or i_{3n}
becomes negative, then it is replaced by zero. Similar forms are derived
for the currents i_{2} and i_{4} in the B
stack.
A source program produced on this concept will be obtained from our WEB site.
(a)
(b)
Fig. 16. (a) A driving circuit for a fourphase stepping motor and (b) A clawtooth stepping motor.
For accurate calculation of cogging torque, we must carry out direct computation of the total torque from magnetic circuit rules considering tooth construction, as shown in an example of a normal DC motor in Reference [5]. One type of brushless DC motor is dealt with in the Japanese paper [7], in which it is seen that though there are considerable phase differences between the magnetic circuit computation and that based on (E8), there are no big differences in the magnitude of total torque ripple as long as the fifthharmonic is appropriately included in the backemf wave forms.
Similar to a stepping motor, voltages V_{A }, V_{B }, V_{C} are dependent on the drive circuit topology and use of position sensors, and a program must be produced for each scheme. The normal circuit is such as shown in Fig. 17. We will provide the source program from our WEB site for the 120degree conduction mode, which is the most common method for driving memory disks in a computer.
Fig. 17. Bridge circuit for a threephase brushless DC motor.
[2] T. A. Haskew and D. E. Schinstock, "Optimal Design of Electromechanical Actuators for Active Loads," IEEE/ASME Trans. Mechatronics, vol. 3, no. 2, pp. 129137, June 1998.
[3] T. Kenjo and S. Nagamori, Permanentmagnet and Brushless DC motors, U.K.: Oxford Univ. Press, 1985.
[4] H. Weissmantel, "Einige Grundlagen zur Berechnung bei der Anwendung schnell hochlaufender, traegheitsarmer Gleichstromkleinstmotoren mit Glockenlaeufer," Feinwerktechnik & Messtechnik, vol. 84, pp. 165174, Germany: Carl Hanser Verlag, 1976.
[5] T. Kikuchi and T. Kenjo, "Indepth Learning of Cogging/Detenting Torque Through Experiments and Simulations," IEEE Trans. Educ., vol. 41, no. 4, CDROM12, Nov. 1998.
[6] T. Kenjo and A. Sugawara, Stepping Motors and their Microprocessor Controls, 2nd ed., U.K.: Oxford Univ. Press, 1993.
[7] T. Igarashi and T. Kenjo, "A Dynamic Simulation Method for Brushless DC Motor Considering Cogging Mechanism (In Japanese)," Proceedings of JIEE Rotary Machinery Symposium, RM9825, June 1998.
Tatsuya Kikuchi
Department of Electrical and Electronic Engineering
Tokyo Institute, Polytechnic University of Japan
2321, Ogawanishi, Kodaira, Tokyo 1870035 JAPAN
Phone: 81423467139
Fax: 81423445609
Email: tkikuchi@ieee.org
Masatoshi Kubo
Department of Information Technology
Kanagawa Prefectural Junior College for Industrial Technology of Japan
241, Nakao, Asahi, Yokohama, Kanagawa 2410815 JAPAN
Phone: 81453631992
Fax: 81453627141
Email: kubo@kanagawacit.ac.jp
Tatsuya Kikuchi (M'95) received the B.S. (1984) and M.S. degrees (1997) in electronic engineering from the Polytechnic University, Kanagawa, Japan. From 1985 to 1992, he worked as a design engineer of servomotor controls. From 1992 to 1998, he was an Instructor in the Department of Electrical Engineering and Electronics at the Polytechnic Centers in Aichi, then Kanagawa prefectures. Since 1998, he has been working at the Tokyo Institute of the Polytechnic University of Japan. His interests include mechatronics and multimedia computing.
Masatoshi Kubo received the B.S. degree in mathematics from Yokohama
City University, Kanagawa, Japan in 1988. From 1988 to 1995, he was instructor
at Fujisawa Vocational Training School in Kanagawa. Since 1995, he has
been teaching in the Department of Information Technology at Kanagawa Prefectural
Junior College of Industrial Technology. His main interests are computer
graphics and programming languages.