Вы находитесь на странице: 1из 8

Closed loop Speed Control of a Brushless DC Motor via Ethernet

L. Samaranayake1, S. Alahakoon2
1
Ph.D Student Royal Institute of Technology, Stockholm,Sweden
2
Senior Lecturer, Faculty of Engineering, University of Peradeniya, Sri Lanka
In section 4.0, the test rig implementation is described.
Obtaining a control system model of the partial system
Ethernet is nowadays being focused by various is described in section 5.0. Finally results and
automation system developers over other field bus conclusion are presented in sections 6.0 and 7.0.
systems due to its cheap hardware availability,
straightforward integration to the Internet and support 2.0 TIMING ASPECTS OF ETHERNET
for the higher bandwidth requirements in the future. It
is already being used at higher levels of plant Ethernet is a shared-media broadcast technology. Its
automation. However, on a lower level of the control media access control method CSMA/CD (Carrier Sense
hierarchy, it is yet to be investigated. This paper Multiple Access with Collision Detection) performs
describes
the
theoretical
background
and three functions [2]:
implementation of a Real-Time speed control scheme
1. transmitting and receiving data packets
for a Brushless DC (BLDC) motor set-up, closed via an
2. decoding data packets and checking them for
Ethernet network and investigates the Hard Real-Time
valid addresses before passing them to the
capability of Ethernet within the scope of TCP/IP.
upper layers of the OSI model
3.
detecting
errors within data packets or on the
1.0 INTRODUCTION
network
In a distributed system, the control loop formed by the
sensor, controller and actuator of the controlled process In CSMA/CD, networking devices with data to transmit
is closed via a communication network. PROFIBUS, over the network work in a listen-before-transmit
INTERBUS, and CAN (Control Area Network) are mode. The device must check whether there are any
such commercially available dedicated Fieldbus signals on the networking media, before transmission.
systems. They are commonly in need of dedicated As soon as the networking media is vacant, it begins
hardware resulting inherited incompatibility among transmission. While transmitting, the device listens to
different bus systems and high capital cost. Ethernet on the network to ensure that no other stations are
the other hand, is rich in this context, if it could be used transmitting simultaneously. At the end of data
effectively as a field bus system to control Hard Real- transmission, the device returns to listening mode.
Time applications within the scope of TCP/IP Networking devices detect a collision by the increased
(Transport Control Protocol / Internet Protocol). There signal amplitude on the networking media. At a
exist a lot of cheap hardware (i.e., single chip solutions) collision, each device involved will continue to
that integrate Ethernet and TCP/IP stack. Also the transmit data for a short time. This is done to ensure
integration with Internet is straightforward. With the that all devices see the collision. Once all devices on
presence of TCP, it is possible to use all the the network have seen that a collision has occurred,
conventional protocols such as FTP, HTTP, SMTP etc. each device invokes a back off algorithm. This
Ethernet already supports future requirements in makes all devices on the network to stop transmitting
bandwidth. As everybody is using the same protocol for a maximum duration of twice the slot time, at first.
set, the solution is universal and thus compatibility Slot time is the length of time that one transmitting
issues are solved. Vendors will only have to support a station waits before attempting to retransmit, following
single solution instead of multiple field buses. On the a collision. On a 10Mbps network, maximum possible
other hand the capacity of existing field busses is back off time comes to 51.2s and for 100Mbps fast
reaching its limits [1]. Hence even at higher bit rates, it Ethernet, it is 5.12s. The back off time doubles every
is unlikely that dedicated Fieldbuses would fulfill the time the nodes repeat to collide. The doubling stops at
future needs of bandwidth. On top of all the above, the the 10th attempt (after 1024 slot times) and declares an
market is asking for Ethernet [1].
error after 16 attempts. Also the devices that were
involved in the collision do not have priority to
This paper addresses the theoretical aspects and transmit data.
practical possibilities to use Ethernet as the
communication network to control a Brushless DC Hence it is clear that Media Access Control (MAC)
(BLDC) motor. The paper is organized as follows. makes Ethernet in - deterministic. This makes one to
Section 2.0 describes the timing aspects of Ethernet. In think further about Hard Real-Time capabilities of
section 3.0, Inverter fed operation of the BLDC motor Ethernet. The theoretical analysis in [3] shows that
is described.
Ethernet with CSMA/CD can be used reliably for time

ABSTRACT

The analysis where N is the number of delay slots required to exceed


Tmax, is given by
N
1
1. An isolated subnet within the same broadcast
(6)
Perror = n
n=1 2 + 1
domain
where
2. Light network traffic load.
3. Packets are small and of equal size
N
Number of collisions to incur Tmax
Perror Probability of error (N collisions to occur)
The "error" is defined as an event in which there are
enough delays through repeated back-off s to cause the
time to begin transmission of a packet to exceed the Table 1 shows Perror until the error event
maximum acceptable delay ( Tmax ) in ms.
critical Hard Real-Time applications.
assumes

If packets arrive the network randomly from a large


number of nodes within the subnet, then the probability
distribution of their arrival could be described by
Poisson distribution as
k
f f
(1)
F (x ) = e
u (k x)

x
k = 0 k!
f =

8S p
Bw

(2)

1
2
3
4
5
6
7
8
9
10

Maximum
Slots
2
4
8
16
32
64
128
256
512
1024

10Mbps
delay (s)
0.1
0.2
0.4
0.8
1.6
3.2
6.4
12.8
25.6
51.2

100Mbps
delay(s)
0.01
0.02
0.04
0.08
0.16
0.32
0.64
1.28
2.56
5.12

Perror

3.3x10-1
6.7 x10-2
7.4 x10-3
4.0 x10-4
1.3 x10-5
2.0 x10-7
1.5 x10-9
6.0 x10-12
1.1 x10-14
1.2 x10-17

Table 1

where
Sp

The probability of one transmission without an error


Size of packets (bytes)
i.e. back off time has not exceeded Tmax is 1-Perror.

Rate of arrival of packets (packets/sec)


Thus, the probability of not occurring an error in M
Net bandwidth (bits/sec)
Bw
transmissions is
u
Unit step function
M
Pok = (1 Perror ) , (7)
f
Fraction of utilized net bandwidth
Probability distribution of packet arrival to where
Fx
media
Pok Probability of no delay greater than Tmax
The probability of having three nodes trying to transmit
M
Number of packets sent before error
at the same time (one active and two waiting) is simply
Solving for M results in
one minus the probability that none, one, or two
ln Pok
packets arrive. Therefore the probability of waiting can
.
(8)
M =
be given by,
ln (1 Perror )
M could be identified as the number of packets
Pwait = 1 Fx (2 )
(3)
transmitted before exceeding Tmax. This can be
converted
to a time as
2
f
f
Fx (2 ) = e
1
+
f
+
(4)
M

Terror =
, (9)
2!

( )

where Terror is the time until error occurs

Thus, it is expected at least two nodes waiting for a


fraction Pwait s of time. On a lightly loaded network, the The above theoretical analysis, with the conservative
probability of more than two nodes waiting is assumptions, results Terror variation as shown in the
negligible compared to Pwait. Then it is conservative to Table 2.
assume that the two waiting nodes will experience a
collision with equal probability. From this point on, the
Packet
Bandwidth
Message rate
Tmax
size
Terror
contending packets will follow the CSMA/CD rules.
(Mbps)
(ms)
(packets/sec)
(bytes)
First each of them choose a number from the set {0, 1,
100
128
1000
0.5
9years
2}. If they choose the same number i.e. a collision, then
100
1024
1000
1
2years
they choose a number from {0, 1, 2, 3, 4}, and so on.
10
64
1000
7
9years
This will continue until an error event occurs when the
total back off time exceeds Tmax. Probability that the
10
64
1000
2
10hours
nodes choose the same number out of the three at the
10
128
1000
7
1year
first instance is 1/3. At the second instance, it is 1/5,
10
128
1000
2
1hour
and so on. The probability of continuing this N times,
Table 2

As far as Terror is concerned, the theoretical results


sound excellent. But it is heavily dependant upon Tmax,
which is essentially a function of minimum valid
packet size and maximum valid cable length.
Therefore prior to recommending Ethernet with
CSMA/CD for Hard Real-Time applications,
acceptability of the magnitude of Tmax has to be
investigated. For applications that demand Tmax less
than 1ms, this seems not to be a good solution.
The application considered here is speed control of a
Brush less DC motor, where the rise time of the closed
speed control loop is in the range of 10-100ms. The
experimental timing aspects have been presented in
section 6.1.

Figure 1 - Inverter fed operation of BLDC motor

3.0 INVERTER FED OPERATION OF


BLDC MOTOR
Brushless dc motor considered here is basically a
surface mounted, non-salient pole, permanent magnet
(PM) synchronous machine with trapezoidal flux
distribution in the air gap due to concentrated full pitch
windings in the stator. This is becoming increasingly
attractive in servo and variable speed applications since
it can produce a torque speed characteristic similar to
that of a Permanent Magnet DC motor while avoiding
the problems of failure of brushes and mechanical
commutation [4], hence ensuring long term
maintenance free operation.
Figure 1 shows the closed loop speed control system of
the BLDC motor fed by an inverter. As in many three
phase motor applications, the inverter here too acts like
an electronic commutator. It receives PWM switching
signals from the drive circuit, based on the converted
current and speed feedback signal of the low cost Hall
sensors.

Figure 2 - BLDC motor speed controller coupled to the


current controller via Ethernet network

turned off at the same instant to initiate current


feedback through the free wheeling diodes, i.e., D1 to
D6 in Figure 1. The outer speed controller can be
closed externally or internally within the servo
amplifier before coupling to the inner current controller
as shown in Figure 1. Here the speed control loop is
In the torque mode operation, current reference signal
closed externally via an Ethernet network as shown in
Iref is the external input to the closed loop system
Figure 2.
formed by the decoder, hysteresis comparator and
PWM generator. There are three Hall sensors placed
4.0 TEST RIG
on the stator of the BLDC motor that give 1200 phase
shifted square waves in phase with respective phase
voltages. These waves represent the rotor position.
The decoder circuit converts the latter waves into the
six-step signals as shown in the Figure 1. These
converted signals with appropriate polarities are then
used to drive the gates of the MOSFET s (Q1 to Q6 in
figure) of the respective phases. The actual phase
currents of the motor, track the command currents by
hysteresis-band current control. In this motor, at any
instant, only two of the phase currents are enabled, one
with positive polarity and the other with negative
polarity. Hence make the currents of adjacent phases
equal in magnitude but opposite in direction. When
these currents (equal in magnitude) tend to exceed the
Figure 3 - Test Rig
hysteresis band, both the respective MOSFET s are

In the test rig, decoder circuit, current control loop and


the MOSFET driven inverters are present within the
local servo amplifier for the BLDC motor. Rotor speed
is calculated by means of frequency to voltage
converting and differentiating the hall sensor position
signals. The speed controller denoted by G in Figure
2, which is closed externally, is implemented in
software within the network connected control
computer.
The rotor speed signal r is the main incoming data
signal while reference current signal Iref is the main out
going signal from the speed controller to the servo
amplifier via the network. In addition, synchronizing
and acknowledgement signals of connection oriented
TCP, are present back and forth. In order to monitor
the traffic in the Ethernet local area network, another
monitoring computer with the software Ethereal, is
connected to the local area same network. Since this
does not generate any network traffic but just monitors
what is available on the wire, traffic monitoring does
not disturb the system at all

the measured speed information and computed control


signal output. These delays are of stochastic nature.
This critical environment demands exact representation
of all the components in the open loop system, namely
the Ethernet network from sensor to controller and
controller to actuator and the rest of the system, which
we call the plant. The plant comprises a Brushless DC
motor, an inverter, a gate drive circuit, current
controller in the servo amplifier and a Micro Controller to interface the servo to the network.

There are two possibilities in modeling such a system.


One way is to model each component individually and
cascade them to obtain the complete plant. The other
method, which is less prone to accumulate model
errors, is to model the entire system as a single module.
This can be done by observing the response of the
overall open loop system to a known input signal and
assuming a suitable order to the system. The advantage
here is the possibility of obtaining a simple model,
which depends only on the dominant modes of the
overall system. One disadvantage is the possibility of
some non-linear behaviors contained in the system
In order to realize the assumptions on the network affecting the linear input output relationship. However,
stated in section II, the following steps were taken on since the requirement here is to come up with a simple
the test rig.
linear model of the open loop process, the second
method is used and is described below.
1. Only the Control Computer and MicroController were networked using a Switch or a As the goal of this work is to build a linear control
Hub to create an isolated subnet within the system model, it has to be ensured the motor operates
same broadcast and collision domains.
in the linear region of its performance range. As
2. As there is no external communication traffic, pointed in [5], the linear operation of a BLDC motor is
the light load assumption is also satisfied.
badly affected by its inherent cogging torque specially
3. Frames were of 64 bytes equal size at 10Mbps at low speeds. In order to identify the linear operating
bandwidth.
region in practice, first a slow sinusoidal input of
typically 1.0Hz frequency and reasonable amplitude is
A constant load torque is applied on the motor shaft by applied to I in Figure 4. The corresponding speed
ref
means of a shaft coupled identical motor. When the response plotted against I gives the threshold I as
ref
ref
reference speed is set remotely at the control computer, shown in the Figure 5, which is approximately 1.1V.
the speed signal of the motor is read through the By gradually increasing the amplitude of I , the
ref
network for the first time. Then the corresponding saturation limits of the partial system also can similarly
control signal is calculated at the control computer and be identified. Next a constant voltage greater than the
is sent back to the motor. Hence the speed control loop threshold is applied to I and the motor speed is
ref
is closed via the isolated Ethernet network and the allowed to reach steady state after which, a step is
procedure repeats. Control computer is programmed superimposed whose upper bound is below the
using Borland C++ Version 5.02 and the Z-World saturation limit.
BL2100 Micro-Controller is programmed using
Dynamic C Premier 7.02. Both uses standard socket The corresponding speed response is assumed to be the
programming in connection oriented TCP.
The output in the correct linear operating region of the
physical arrangement of the entire test rig comprising BLDC motor This speed response is approximated
the Z-World BL2100 Micro-Controller, back to back using curve-fit functions of MATLABTM programming
connected BALDOR BLDC motor unit with servo language to derive the transfer function of the entire
amplifier, control computer and the 10/100 Mbps Fast open loop system except the micro-controller.
Ethernet Switch is shown in Figure 3.

5.0 CONTROL SYSTEM MODEL


It is important to have a linear model of the system in
order to design a suitable speed controller for the
network controlled operation of the BLDC motor.
With inherent indeterminism, the Ethernet network
plays the most prominent role, which may add delays to

Figure 4 - Block diagram of the plant to be modeled.

In Figures 8 and 9, controller to actuator needs more


frames in data transfer phase than in sensor to
controller data transfer. In Figure 9, the delay in data
transfer phase increases in later TCP sessions
degrading the performance due to missing samples.
Figures 10 shows the total frame delays for sensor to
controller, per session with both Switch and Hub
configurations. It is below 10ms for the first few
sessions as per the theoretical values given in Table 2.

Figure 5 - Speed response for a sinusoidal Iref


The constant voltage on Iref is 1.5V and the step is
0.6V. As the response resembles to be that of first
order the following function format proved to be
successful in fitting the speed response data to the
curve,

y (t ) = K1 + K 2 1 e at .

(10)

The corresponding transfer function in s domain is in


the format,

H (s) =

k
.
(s + a )

Figure 6 - Sensor to controller delay with Switch

(11)

Here, the steady state gain k/a can be found from speed
response and Iref data. Results are shown in section 6.2.

6.0 RESULTS
6.1 Timing aspects of Ethernet
Packet transport times of connection establishment,
data transfer and connection termination phases of
Transport Control Protocol (TCP) may vary from frame
to frame. Therefore, frame to frame delay profiles
were taken for Micro-Controller to Control Computer
and vice versa. i.e., sensor to controller and controller
to actuator.

Figure 7 - Sensor to controller delay with Hub

In Figures 6 to 9, TCP sessions are denoted by the


connection number, while the first and the last three on
the frame axis represent the delays of three-way hand
shaking of connection establishment and connection
termination phases of the TCP session.
The
intermediate frames represent data transfer phase.
In Figure 6, delay increases with increased network
congestion. Due to absence of virtual circuits as in the
case of Switch configuration in Figure 6, connection
establishment and connection termination phases in
Figure 7 takes longer time. Since communication takes
place within the same collision domain, delay in the
data transfer phase in the hub configuration is shorter
than that of the Switch configuration.

Figure 8 - Controller to actuator delay with Switch

Figure 9 - Controller to actuator delay with Hub

Figure 12 - Comparison of Switched networked and


non networked configurations
Results of the Switch connected configuration are
shown in Figure 12, where the current reference and the
speed response are delayed approximately seven and
four times respectively compared to non-networked
configuration.
Similarly, in the Hub connected configuration, current
reference and speed response are delayed
approximately eight and four times respectively and is
shown in the Figure 13.

Figure 10 - Sensor to controller total frame delay

Figure 13 - Comparison of Hub networked and


nonnetworked configurations
Figure 11 - Controller to actuator total frame delay

6.2 Control system model

But in later sessions as the network congestion The resulting parameter values of the control system
increases, it exceeds even 30ms degrading the closed model identification are shown in Table 3.
loop operation considerably due to missing samples.
Parameter
Value
Figure 11 shows total frame delays from controller to
K1
0.2229
actuator. They are well within the range of theoretical
values except for one session with the hub.
K2
0.6180
a
3.4272
Response of rotor speed r to reference current signal
k
0.3870
Iref with both Switch and Hub configurations are
Table 3
compared with non-networked configuration, where the To evaluate the success of the curve fit, the two open
speed controller directly coupled to the current loop speed responses from the motor and the modeled
controller.
transfer function is compared as shown in Figure 14.

7.0 CONCLUSION AND FUTURE WORK


Delays in connection establishment and connection
termination phases of TCP sessions are constants and
the values depend on the configuration and the
direction of traffic flow.
Observed Controller to Actuator delays agree with the
theoretical delay values derived in the Section 2.0. But
the Sensor to Controller delay values deviate
considerably, missing a continuous set of samples,
resulting poor performance in the network connected
operation in both configurations.

Figure 14 - Open loop speed response

The solution to this problem can follow two different


approaches. One software engineering approach is to
modify the TCP/IP stack of Ethernet to make it
deterministic, so that it can handle Hard Real-Time
applications.
The other remedy, from control engineering
perspective is to make the speed controller robust
enough to handle the Hard Real-Time system by means
of predicting the corrupted i.e., missing or delayed
control signals and speed data signals in the actuator
and controller respectively.

In deriving the complete open loop system model that


comprises the networking part and the open loop
process i.e., plant, one can follow two approaches. One
is to assume the network delays to be constant and is a
certain integer multiple of the sampling period. Then
Figure 15 - Close loop speed response with P controller the derived first order model can be used for any design
with the network delays augmented to it. This
approach is taken first and its effectiveness and
limitations will be investigated. The other approach is
to go for stochastic modeling of the complete system
This will also be done later in this research project.

8.0 ACKNOWLEDGEMENTS
Authors greatly acknowledge the financial support
granted to the date, by the Swedish International
Development Corporation Agency (SIDA) for
conducting this research

9.0 REFERENCES
1.

J. D Decotignie., A Perspective On Ethernet


TCP/IP as a Fieldbus, Proceedings
Fet2001, Nancy, France, 2001, pp.138-142.

2.

R. Perlman, Interconnections Bridges,


Routers, Switches and Internetworking
Protocols, 2nded., vol.1.Addison Wisley, 2000,
pp 1 40.

3.

S. Schneider., Gerardo Pardo-Castellote.,


Mark Hamilton., Can Ethernet be Real-Time
?, Real-Time Innovations, Sunnyvale,
CA94089.

Figure 16 - Close loop speed response with PI


controller
Inserting the first order model and replacing other
major components such as analog to digital converter,
saturation limiter, digital to analog converter, etc., of
the micro-controller with the standard models found in
the MATLABTM - SIMULINKTM library, resulted in
closed loop performance shown in Figure 15 and 16. A
simple proportional (P) controller is used for the speed
controller in Figure 15,while a simple proportional
integral (PI) controller is used in Figure 16.

4.

B. K Bose., Modern Power Electronics and


AC Drives, Prentice Hall, pp 483 492.

5.

S.Bentouati, Z.Q. Zhu, D.Howe., Permanent


Magnet Brushless DC Motors for Consumer
Products , University of Sheffield, U.K.

6.

C.K. Lee, W.H. Pang., A Brushless DC


Motor Speed Control System Using Fuzzy
Rules, Proceedings Power Electronics and
Variable-Speed Drives Conference, pp.101106, October 1994

7.

T. S Low et al., Servo performance of a


BLDC drive with instantaneous torque
control, Proceedings IEEE Control and
Drives conference 1990, pp.454-459

8.

Advanced Motion Controls, PWM Servo


Amplifiers 1999-2000 Catalog and Technical
Manual., pp C-11 C-16

APPENDIX
The parameters of the brushless dc motor are
Rs = 4.07, Ls = 8.9mH, J = 0.12kgcm2, B =
0.0353Nms-2, r = 2000 rpm.

Вам также может понравиться