dmbb-manavaal-potluri.pdf

9
1 Dual-motor ball-beam setup Design, development, and control Manavaalan Gunasekaran and Ramprasad Potluri I. I NTRODUCTION In the Department of Electrical Engineering at IIT Kanpur, we founded a new laboratory in the summer of 2007 devoted to the study of ne tworked cont rol systems (NCS), a new area for us. We wished to devote the laboratory to practical applications of control theory that would have a positive effect on the li fe of the common ma n. We ha d two compet ing mod els for the exper ime nta l set ups that we cou ld ha ve in thi s laborator y of f-t he- she lf (OTS) and build you r own (BYO) (the abbre via tio ns are from [1]). The advant age s of each type of setup have been described in detail in [ 1]. Our considerations in going the BYO way were as follows: 1. Des ir e to bui ld a commercia lly-vi abl e pr odu ct. We wished to carry our development all the way through to a prototype that could be commercialized. This meant that the produc t ha ve onl y tho se fea tur es tha t are nee ded by the end user. An OTS setup usually has many features that we pay for but do not use. Thus, by using an OTS setup and developing our algorithms around it, we may develop a false estimate of the cost of our control application. We may obtain a better estimate by developing the product on our own using only those building blocks that we need. 2. Nat ur e of pr oduct prevents out sourc ing . Ev en if we have the option of outsourcing building of the hardware, when the application has multiple control loops that have to be congured one after the other, the development of the hardware has to go hand in hand with the development of the control algorithm. This means that we need to perform a hardware-algorithm co-design. Thus, we concluded that BYO was the way to go to build a prototype of a practically useful application. 3. Time const raints . The pr oblems we wi shed to st udy needed to determine the experimental setups that we would have. We would identify the problems in collaboration with our graduate students. Thus, the sequence of steps would be: pro vid e gra dua te stu den ts lab /of ce space, ide nti fy proble ms wit h them, acq uir e the setup s. At the time we had funds, we were at the rst step, and the funds needed to be spent within a few months. So, we could not commit our available funds to any par tic ula r se tup at tha t time. Instead, we decided to invest in basic building blocks such as motors, gears, encoders, components, and a few eZdsp TM kits. We would use these building blocks to build our own setups once the second step was complete. 4. V ersati lity desir ed from the lab . We wante d the NCS laboratory to quickly become conversant in the hardware that is needed to build control systems, instead of conning itself to the plane of algorithm-development. We wanted it to be a resource center in all aspects of whatever control systems we developed (the following advice from [ 1] was an impor tant inspirati on towards this goal: “Get yours elf a good con trol proces sor wit h rel iab le sof tware, build yourself a simple plant, collect some data to identify the system, and close some loops. You’ll never look back.”). 5. Our capab ilitie s. We had a Ph.D. student (Manav aalan ) who wa s more eager towa rds har dwa re tha n towa rds al- gori thms . We fe lt that the ea si est way to wa rm hi m to alg ori thms would be to ha ve him build someth ing tha t he wou ld ha ve to mak e work thr oug h sui tab le con trol algorithms. Multi -agent coord inati on combi nes communica tion net- works with control systems. We were able to visualize sev- era l pra cti cal ly use ful app lic ati ons in thi s are a. Thus, we de ci ded that this woul d br oa dl y be the focus ar ea of the NCS laboratory. Before attempting to build these practically useful applications, in order to gain experience with hardware– algorithm co-design we decided to build a simpler setup that would help easily visualize human-like coordination such as when two humans hold a table at opposite ends and try to carry it through a door. A dual-motor ball and beam (DMBB) system struck us as such a setup. The single-mo tor ball and beam (SMBB) system, simply called “ball and beam system” in the literature, has been a testbed for control algorithms in numerous research articles. There are two variants of the SMBB system: 1. One end of the beam is hin ged to a xe d bas e, whil e the other end is driven by a motor. 2. The beam piv ots on the motor shaft that is locat ed at the beam’s center of gravity. In con tra st to the SMBB, in our DMBB syst em, each end of the be am is dr iv en by a motor. Such a setup ca n serve as a learning stage, for example, for the more difcult dual- manip ulato r coope rati ve cont rol task (for exa mple, [ 2], [3]), and for the more general multi-agent cooperative control (for example, [4]). In general, a cooperative control system comprises multiple subsystems that share information or tasks to accomplish an objective that is common to them [5]. In the DMBB setup, we can identify the following three subsystems: ball position subs ystem, motor-1 subs ystem, and motor-2 subsy stem. In the pr esent wo rk, as a rst st ep, we impl ement the thre e subs ystems using a singl e proce ssor, inste ad of using three separate processors with inter-processor communication. DMB B set ups ha ve bee n report ed by two oth er sou rce s: [6] and [7]. In contrast to them, we explain the details of the construction of our DMBB setup. We hope that these details will be useful to anyone that wishes to build such a setup.

Upload: jason-cameron

Post on 04-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 1/9

1

Dual-motor ball-beam setupDesign, development, and control

Manavaalan Gunasekaran and Ramprasad Potluri

I. INTRODUCTION

In the Department of Electrical Engineering at IIT Kanpur,

we founded a new laboratory in the summer of 2007 devoted

to the study of networked control systems (NCS), a new

area for us. We wished to devote the laboratory to practical

applications of control theory that would have a positive effect

on the life of the common man. We had two competing

models for the experimental setups that we could have in

this laboratory — off-the-shelf (OTS) and build your own

(BYO) (the abbreviations are from [1]). The advantages of

each type of setup have been described in detail in [1]. Ourconsiderations in going the BYO way were as follows:

1. Desire to build a commercially-viable product. We

wished to carry our development all the way through to

a prototype that could be commercialized. This meant that

the product have only those features that are needed by

the end user. An OTS setup usually has many features that

we pay for but do not use. Thus, by using an OTS setup

and developing our algorithms around it, we may develop

a false estimate of the cost of our control application. We

may obtain a better estimate by developing the product on

our own using only those building blocks that we need.

2. Nature of product prevents outsourcing. Even if wehave the option of outsourcing building of the hardware,

when the application has multiple control loops that have

to be configured one after the other, the development of the

hardware has to go hand in hand with the development of

the control algorithm. This means that we need to perform

a hardware-algorithm co-design. Thus, we concluded that

BYO was the way to go to build a prototype of a practically

useful application.

3. Time constraints. The problems we wished to study

needed to determine the experimental setups that we would

have. We would identify the problems in collaboration with

our graduate students. Thus, the sequence of steps would

be: provide graduate students lab/office space, identify

problems with them, acquire the setups. At the time we

had funds, we were at the first step, and the funds needed

to be spent within a few months. So, we could not commit

our available funds to any particular setup at that time.

Instead, we decided to invest in basic building blocks such

as motors, gears, encoders, components, and a few eZdspTM

kits. We would use these building blocks to build our own

setups once the second step was complete.

4. Versatility desired from the lab. We wanted the NCS

laboratory to quickly become conversant in the hardware

that is needed to build control systems, instead of confining

itself to the plane of algorithm-development. We wanted it

to be a resource center in all aspects of whatever control

systems we developed (the following advice from [1] was

an important inspiration towards this goal: “Get yourself

a good control processor with reliable software, build

yourself a simple plant, collect some data to identify the

system, and close some loops. You’ll never look back.”).

5. Our capabilities. We had a Ph.D. student (Manavaalan)

who was more eager towards hardware than towards al-

gorithms. We felt that the easiest way to warm him to

algorithms would be to have him build something that

he would have to make work through suitable control

algorithms.

Multi-agent coordination combines communication net-

works with control systems. We were able to visualize sev-

eral practically useful applications in this area. Thus, we

decided that this would broadly be the focus area of the

NCS laboratory. Before attempting to build these practically

useful applications, in order to gain experience with hardware–

algorithm co-design we decided to build a simpler setup that

would help easily visualize human-like coordination such as

when two humans hold a table at opposite ends and try to

carry it through a door. A dual-motor ball and beam (DMBB)

system struck us as such a setup.

The single-motor ball and beam (SMBB) system, simplycalled “ball and beam system” in the literature, has been a

testbed for control algorithms in numerous research articles.

There are two variants of the SMBB system:

1. One end of the beam is hinged to a fixed base, while the

other end is driven by a motor.

2. The beam pivots on the motor shaft that is located at the

beam’s center of gravity.

In contrast to the SMBB, in our DMBB system, each end

of the beam is driven by a motor. Such a setup can serve

as a learning stage, for example, for the more difficult dual-

manipulator cooperative control task (for example, [2], [3]),

and for the more general multi-agent cooperative control (for

example, [4]).

In general, a cooperative control system comprises multiple

subsystems that share information or tasks to accomplish an

objective that is common to them [5]. In the DMBB setup,

we can identify the following three subsystems: ball position

subsystem, motor-1 subsystem, and motor-2 subsystem. In

the present work, as a first step, we implement the three

subsystems using a single processor, instead of using three

separate processors with inter-processor communication.

DMBB setups have been reported by two other sources:

[6] and [7]. In contrast to them, we explain the details of the

construction of our DMBB setup. We hope that these details

will be useful to anyone that wishes to build such a setup.

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 2/9

2

Fig. 1. The dual-motor ball and beam system.

In the following sections, we describe the equipment that

went into building our DMBB setup, and modeling and

control of this setup. We compare the expected and actual

results, list the mismatches between the results, explain the

differences, and report the improvements. We list the lessons

that we learned from our exercise of building and operating the

DMBB testbed that we could not have learned from a purely

simulation-based study of the control strategies.

Throughout this article, all physical quantities are in SI

units.

II . BUILDING THE DMBB SYSTEM

A. The DMBB mechanism

We fabricated the mechanical portion of the DMBB system

in our departmental workshop. The DMBB system is shown in

Figure 1. It comprises a steel ball rolling on top of a rail that

is 0.5 m in length. The rail is made up of two parallel bars —

one of negligibly low resistance (a steel rod in our case), and

the other of a much larger resistance. We built the latter from

a 0.25 mm nichrome wire that runs along the entire length

of a plexiglass rod. A voltage is applied to the ends of the

steel rod. As the ball rolls on the rail, it contacts the steel rod

and the nichrome wire, forming a voltage divider as shown in

Figure 2. This voltage divider is used to sense the location of

the ball on the beam.

Each end of the beam hangs from an arm. The arm hangs

from a spur gear. The spur gear is mounted on the shaft of

each of two planetary gears. Each planetary gear is mounted

on the shaft of each of the two brushed DC servomotors.

This entire configuration is shown in Figure 3. We restrict

in software the output shaft of each of the planetary gears to

rotate through 90

. We sense the angular displacement of eachspur gear using a potentiometer as shown in Figure 3. Each

potentiometer is of 10 k Ω, and is powered by a 3.3 V supply.

B. Summary of equipment used

We use the following equipment:

1. Spectrum Digital’s eZDSP kit for Texas Instruments’ DSP

TMS320F2812.

Though this DSP is an overkill for our application, we

use this DSP as it comes as part of a convenient-to-use

package called the eZDSP kit. We may reuse this kit in

other applications that may place greater requirements on

the processor.

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 3/9

3

steel rodnichrome wire

V in

V out

ball

Fig. 2. The voltage divider. V in = 0.5 V. End-to-end resistance of thenichrome wire is 48 Ω.

Brushed dc motor

Planetary gear

Steel rod

Plexi glass rodBallSpur gear

Potentiometer Nichrome wire

Arm

Fig. 3. Top view of the DMBB system.

2. A potentiometer to sense the position of each DC motor.3. Maxon’s motor units containing permanent magnet DC ser-

vomotors (ratings: 24 V, 11 W, 0.0172 Nm) and planetary

gears (gear ratio 62 : 1, 3-Stage).

In selecting the motor units, we had the following con-

sideration. First, we estimated that each end of the beam

requires a continuous torque of at least 0.1 Nm. Second,

the motor units would be reused in other applications that

would not need more than 10 W of power.

4. MOSFETs IRF540, and MOSFET driver IR2110 to realize

an H-bridge circuit.

We use a pulse width modulated (PWM) amplifier, realized

as an H-bridge circuit that we built, to drive the DC motor.

We could generate the desired DC voltage of variable

magnitude for the DC motor using a high power operational

amplifier or transistor. The advantage of our design is that

the H-bridge circuit can be used in future for four quadrant

operation of the DC motor. Thus, an H-bridge is more

efficient than a linear amplifier.

5. Op-amps, resistors, capacitors, diodes.

6. The ball-beam mechanism fabricated in our department’s

workshop.

7. We reported the DMBB setup earlier in [8]. Since then, we

have made a few enhancements. One is that we now have

an instrumentation amplifier to boost the voltage V out of

Figure 2 upto 2.5 V while rejecting common mode noise.

T M S 3 2 0 F 2 8 1 2

ADC

PWM

Direction

PWM

DirectionAmplifier

Amplifier

Instrumentation amp.

4

4

4

4

2Q H-bridge

2Q H-bridge

Motor1

Motor1

B a l l - b e a m

θ 1

θ 2

x

Fig. 4. Block diagram of the DMBB system. θ1 and θ2 are the angular dis-

placements of the left and right spur gears respectively. x is the displacementof the ball on the beam. The amplifier boosts the voltage output by the PWMmodule from 3 V to 9.5 V.

M O S F E T d r i v e r

( I R 2 1 1 0 )

M O S F E T d r i v e r

( I R 2 1 1 0 )

G N D

S D

F

P W M

R

S D

R

P W M

F

M

+ 2 4 V

Fig. 5. The 2-quadrant H-bridge circuit (2Q H-bridge). SDF (stands for “shutdown forward”) and SDR (stands for “shut down reverse” are the directioncontrol signals.

The overall cost of our DMBB setup is about USD 1200.00

including fabrication. This price does not include the cost of

manpower. This price can be reduced by another USD 200.00

if we replace the eZDSP kit with a dsPIC-based microcon-

troller board that we designed, fabricated, and extensively

tested in our lab.

C. Digital control of DC motor

Figure 4 shows how the various components described

in the previous paragraph are used for the digital control.

The DSP computes a control signal based on its setpoint

and feedback signals. A PWM signal proportional to the

control signal is output from the DSP to a two-quadrant DC

chopper (implemented as an H-bridge, shown in Figure 5)

which supplies a DC voltage of the required magnitude to the

armature of each DC motor.

The switching time of each MOSFET in the H-bridge is

of the order of µs. Therefore, during the transition from one

direction of rotation of the motor to the other, each arm of the

H-bridge may potentially short-circuit the DC voltage source.

To avoid this shorting, two PWM signals, that are 180 out of

phase with respect to each other, are used for each motor —

one to run the motor in clockwise direction, and the other to

run it in the counter-clockwise direction. A direction control

signal is used to enable the appropriate MOSFET driver of the

DC chopper, as shown in Figure 5.

The position of the ball is sensed using the voltage divider.

The angular displacement of each motor unit’s shaft is sensed

using a potentiometer which is attached to the shaft as shown

in Figure 3 via an external spur gear of ratio 150 : 90.

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 4/9

4

F

α

mg

x

L

mg sinα

ω

a

Fig. 6. Free body diagram of the ball-beam mechanism.

III . MODELING AND CONTROL OF THE DMBB SYSTEM

The control task is to automatically regulate the position

of the ball by suitably adjusting the slope of the beam using

the motors. The DMBB and SMBB systems are open-loop

unstable because the ball does not stay in any desired position

on the beam when the beam is tilted and no control effort is

applied.

The DMBB system resembles two SMBB systems working

together such that the net slope of the beam is the sum of

the angles contributed by the individual motors. Therefore, a

starting point for developing control strategies for the DMBB

system may be the work that exists for the SMBB systems.In most of the literature, the SMBB system has been approxi-

mated by a linear model, and various linear, nonlinear, fuzzy,

neuro-fuzzy, and other strategies have been applied to it (for

example, [9], [10], [11]). Nonlinear models too exist for the

SMBB system (for example, [12]), and are more accurate. In

our work, we have adopted a linear model. We control each

motor’s angular position using a PD controller, while we try

various controllers for the ball position control.

A. Physics-based model

The basic mathematical description of this system comprises

the DC motor dynamics and the ball-beam model.1) DC motor dynamics: For each motor unit, the transfer

function (TF) from the armature voltage E i to the angular

displacement θi of the shaft is

θi(s)

E i(s)=

K ms(τ ms + 1)

, i = 1, 2, (1)

where, K m is the motor gain constant and τ m is the motor

time constant in seconds

K m =K T

(RaB + K T K b)Rg

, τ m =RaJ

RaB + K T K b

Here, K T is the torque constant in N-m/A, Ra is the armature

resistance in ohms, B is the viscous-friction coefficient of the

motor rotor with attached mechanical load in N-m/(rad/sec),

J is the moment of inertia of the motor rotor with attached

mechanical load kg-m2, Rg = 62 is the planetary gear’s ratio,

K b is the back emf constant in V/(rad/sec). We calculate

K m and τ m using Maxon’s data sheets. Armature inductance

(La = 0.7 mH) is small enough to be negligible.

2) Ball-beam dynamics: The ball-beam dynamics are the

relation between the beam angle α and ball position x. These

dynamics can be understood as follows using the free body

diagram of the ball-beam mechanism shown in Figure 6.

As the ball (of mass m and radius r) is let loose on the

inclined beam, a force of friction F = µN comes into play

M20o

-45o

45o

θ 2

0oM1

45o

-45o

θ 1

Fig. 7. Sign convention for θi: θi is positive for motor Mi in the directionshown.

lL/2

θ 1

θ 2

l

Fig. 8. Diagram to understand the relation between θi and α

to oppose the motion of the ball relative to the beam. Here,

µ is the coefficient of static friction between the ball and the

beam, and N = mg cos α is the normal reaction of the beam

to the force mg cos α applied by the ball (g is the acceleration

due to gravity). The force F applies a torque F r on the ball

that causes the ball to roll with angular velocity ω = β whose

rate of change is related to F r as follows:

J dω

dt= F r (2)

By Newton’s second law the sum of all the forces acting on

the ball accelerates the ball as per the following equation:

ma = mg sin α− F (3)

Assuming that the ball rolls without slipping (pure rollingcondition: x = −βr), the acceleration of its center of mass xis related to the angular acceleration of the ball ω as follows:

x = −ωr (4)

Solving these equations to bring out the connection between

α and x, and working with small values of α, we obtain

X (s)

α(s)= −

5g

7(

1

s2) (5)

Here X (s) = Lx(t) and α(s) = Lα(t), are the Laplace

transforms of x(t)

andα(t)

.

3) Relating ball-beam dynamics to DC motor dynamics:

The sign convention for θi for each motor is as shown in

Figure 7.

The relationship between α and θi can be derived from

Figure 8 with l L as follows:

Case(i): If only one motor acts at a time, then αL ≈ −θil.

Case(ii): If both motors act at the same time, then αL2≈

− θ1+θ22 l.

For convenience, denote θ := θ1 + θ2. Then the approxi-

mated relationship between α and θ is

α = −

l

L θ (6)

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 5/9

5

Ѳ

2

Ѳ

1

x

d

Ѳ

d

δ Ѳ

d

( 1 - δ ) Ѳ

d

Ѳ

+

+

-

Ball Position

Controller

δ

x

+ _

+ _

Ѳ

1 d

Ѳ

2 d

1 – δ

δ

Motor-1

Controller

Motor

Module-1

MotorModule-2

Motor-2Controller

M o t o r - 1 s u b s y s t e m

M o t o r - 2 s u b s y s t e m

B a l l p o s i t i o n

s u b s y s t e m

G(s)

Fig. 9. Model of the dual motor ball and beam system with controllers. Each motor module comprises a PWM module, an amplifier, a 2Q H-bridge, and amotor as shown in Figure 4.

0 2 4 6 8 10 12 14 16 18 200

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

Time (sec)

B a l l P o s i t i o n ( m )

Simulation

Practical

Fig. 10. Simulation and practical results with the controller designed usingthe physics-based model with xd = 0.25 m and δ = 0 .5 [8].

Using equations (5) and (6), the TF between the ball position

x and angle θ is given by:

G(s) =X (s)

θ(s)=

5gl

7L

1

s2(7)

Equations (1) and (7) may be used to design feedback

controllers that will work in the control system structure shownin Figure 9. We then use bilinear transformation to discretize

these controllers.

4) How good is our physics-based model for control?: In

the work that we did in [8], we designed PD controllers for

the motor subsystems and lead compensator for the ball posi-

tion subsystem using the physics-based model. We conducted

multiple redesigns of the controllers until we obtained best

possible results. We observed a significant mismatch between

the simulation and practical results as shown in Figure 10.

This, we decided, may be due to the following factors:

1. The feedback signals contain noise. We concluded this as

follows. In Code Composer Studio (the integrated develop-

ment environment for the eZDSP kit), we observed that the

first three least significant bits (LSBs) of the value in the

12-bit ADC’s register changed much faster than the rate atwhich the ball moved on the beam or the spur gears turned.

As the feedback signal of the ball position is in the range

[0, 0.5] V, therefore for a 1 mm change in ball position the

corresponding change in voltage is 1 mV. Given that the

maximum decimal number 212 − 1 that is represented by

the 12 bits corresponds to an input of 3 V to the ADC, the

change in the three LSBs of the ADC’s value corresponds

roughly to ±5 mV error in the actual value. As EMI noise

is known to be in the mV range, we concluded that this

rapid change was due to EMI from other equipment in our

lab.

2. Even after we reduced the noise mentioned in item 1 aboveas described in 1 of the next subsubsection, the practical

response was significantly non-smooth (see Figure 10). We

attributed this non-smoothness to another kind of noise: that

due to the improper contact between the ball and the beam,

and possibly improper contact within the potentiometer.

3. We had neglected the presence and effect of the H-bridge

circuit in the TF of Equation (1).

4. We had neglected the effects of nonlinearities such as dead

zones and saturation that are inherent to the H-bridge circuit

and the motors.

5. We had neglected backlash effects that may be present in

our spur gears and any nonlinearities that are present in the

DMBB mechanism.

B. Measures to reduce the mismatch

In the present work, we try to reduce this mismatch men-

tioned in the previous subsection in the following ways:

1. To take care of item 1, with a view to smooth the change

in the three LSBs of the ADC’s value, in each system

sampling interval (T s = 0.01 s), we obtain eight samples

from the ADC and compute their average.

2. Even though we take the average of the past 8 digital

values as explained in the previous item, yet the feedback

has the noise discussed item 2 in the previous subsection.

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 6/9

6

Thus, the technique of averaging is not yielding significant

benefits. Therefore, we try another method: we use an

instrumentation amplifier to boost the voltage V out of

Figure 2 upto 2.5 V from the earlier maximum of 0.5 V.

This improves the resolution of the ball-position sensing

five times. The instrumentation amplifier also rejects the

common mode noise such as EMI.

3. Further, to remove the noise that the instrumentation am-plifier admitted, we add in software a low-pass filter. The

TF of the filter is

X o(s)

X i(s)=

ωh

(s + ωh)

where the cut-off frequency ωh is at least twice the desired

closed-loop bandwidth. As we want our ball to settle in

tsb = 3 s, the desired closed-loop bandwidth for the outer

loop works out to ωgb ≈ 5/tsb = 1.7 rad/s. We choose

ωhb = 5 rad/sec for the ball position feedback. Similarly,

we want the motor subsystems to settle in tsm = 0.5 s,

leading to ωgm ≈ 5/tsm = 10 rad/s. Therefore, we choose

ωhm = 30 rad/sec for the motor shaft position feedback.We obtain the discrete-time version of this TF by using

bilinear transformation s = 2T s

(z−1z+1

) with system sampling

time T s:X o(z)

X i(z)=

af (1 + z−1)

1 + bf z−1

where af = ωT sωT s+2

and bf = ωT s−2ωT s+2

. We obtain the

time-domain input-output relationship in the form of the

following difference equation by taking the inverse z-

transform:

xo(k) = af (xi(k) + xi(k − 1))− bf xo(k − 1)

4. To take care of items 3, 4, and 5, we determine the open-loop TF from the output of the controller (in the DSP)

of the DC motor Mi to the displacement θi using system

identification techniques as described in the following sub-

section.

C. System Identification

We first outline the system identification technique that we

wish to use here. Then, we will apply it to identifying the

motor dynamics, and the ball-beam dynamics.

1) The system identification technique: Consider the fol-

lowing second order TF:

Y (s)U (s) = K s2 + as + b (8)

The vector to be estimated is σ = ( K a b )T . We will

estimate it using the set of observed outputs and applied inputs

[y(0), y(1),....,y(N ), u(0), u(1),....,u(N )]. By using bilinear

transformation s = 2T s

( z−1z+1

) with sampling time T s, from

Equation (8), the TF in z-domain is

Y (z)

U (z)=

(z2 + 2z + 1)K 4T s

2 (z2 − 2z + 1) + 2T s

(z2 − 1)a + (z2 + 2z + 1)b

We obtain the following discrete equation via inverse z-

transform for n = 2, 3,....,N and k = n:

yn = φT nσ

where

yn =4

T s2 (y(k)− 2y(k − 1) + y(k − 2))

φn =

u(k) + 2u(k − 1) + u(k − 2)− 2

T s(y(k)− y(k − 2))

−(y(k) + 2y(k − 1) + y(k − 2))

(9)

Using Least Squares Estimation [13] the best estimate σ of

σ may be obtained as follows:

σ = (ΦT Φ)−1ΦT Y

with Y = [ yn yn+1 . . . yN ]T

and Φ = [ φn φn+1 . . . φN ]T

Next, we wish to perform system identification for each

motor’s dynamics and the ball-beam dynamics.

2) Identifying the motor dynamics: We use system iden-

tification to determine the transfer function from vi(t) —

the voltage applied to the i-th motor module — to the

displacement θi.Equation (1) represents the general form of TF of the DC

servomotor. Thus, consider the TF θi(s)V i(s)

= K s(s+a)

. Here,

V i(s) = Lvi(t). Plugging b = 0 in Equation (8), the

parameter vector becomes σ = ( K a )T . Then, φn is a

2 × 1 matrix (the third row of φn of Equation (9) is absent

here as b = 0). We apply a series of voltages to the armature

of the DC motor, and measure using the potentiometer the

angular displacement that each of these voltages causes. In this

manner, we collect 15 different data sets per motor subsystem

(examples are shown in Figure 11). Each set contains 250

input data and 250 output data samples with the sampling time

T s = 0.01 s. We observe that the computed parameter vector

is not always constant (a ∈ [1.5, 2] and K ∈ [7.2, 7.8]). We

take the average of these values. Thus, the identified modelfor the DC servo motor unit is

θi(s)

V i(s)=

7.5

s(s + 1.8)(10)

whereas, the TF obtained from physics-based modeling using

data from Maxon’s catalog isθ(s)E (s)

= 40s(s+63)

.

3) Identifying the ball-beam dynamics: The approximate

TF of the ball-beam from θ = θ1 + θ2 to the ball position is

shown in Equation (7). We assume that, in general, the TF is

of the form shown in Equation (8) with θ as the input and the

ball position x as the output. The signals used for identification

of the ball-beam system are shown in Figure 12. We collect

the data at sampling interval T s = 0.01 s. The identified TFfrom θ to x is

X (s)

θ(s)=

0.19

s2 + 0.08s− 0.014(11)

The length of the beam L = 0.5 m and the length of each

arm l = 0.025 m. Using these values in Equation (7), the

physics-based model for the ball-beam is a double integrator

with gain 0.35. In comparison, the identified model has a gain

of approximately half that of the physics-based model, and

with poles that are very close to the origin instead of being at

the origin.

In the remainder of this article, we will work with the model

of equations (10) and (11).

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 7/9

7

0 0.5 1 1.5 2 2.5-1

-0.5

0

0.5

1

Time (Se)

v i x 1 0 ( V o l t ) a n d θ i

( R a d )

0 0.5 1 1.5 2 2.5

-1.5

-1

-0.5

0

0.5

1

1.5

Time (Se)

v i x 1 0 ( V o l t ) a n d θ i

( R a d )

0 0.5 1 1.5 2 2.5-1.5

-1

-0.5

0

0.5

1

1.5

Time (Se)

v i x 1 0 ( V o l t ) a n d θ i

( R a d )

0 0.5 1 1.5 2 2.5

-2

-1

0

1

2

Time (Se)

v i x 1 0 ( V o l t ) a n d θ i

( R a d )

vi

θi

vi

θi

vi

θi

vi

θi

Fig. 11. Input and output signals for identification of motor system. vi isthe input to the i-th motor module and θi is the corresponding response of this module.

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

Time (Sec)

θ 1 ,

θ 2

( R a d ) a n d b a l l p o s i t o n ( m )

θ1

θ2

x

Fig. 12. Input and output signals for identification of ball-beam system.To collect the x data, we actuate both motor subsystems simultaneously byapplying θid to the i-th motor subsystem. The ball position subsystem is inopen-loop mode.

D. Controller design and implementation

The feedback control system for the DMBB setup shown

in Figure 9 contains two inner loops and one outer loop. All

settling time specifications are with respect to a steady state

error of 5%.

1) Control of the inner loops: The inner loop tracks θid.

The angles θid are restricted in software to the interval

[−0.7857, 0.7857] rad. We know a priori that a PD controller

(K ds + K p) is good for motor position control. The unity

feedback closed-loop system built around each DC motor will

be type-1, and the PD controller will reduce overshoots in the

step response of this closed-loop system. Therefore, we will

use only a PD controller for each of the inner loops.

The specifications for the PD controller are settling time

ts ≤ 0.5 s and peak overshoot M p ≤ 15%. For the design

we use algebraic techniques so that the closed-loop TF is a

standard second order one. Hence the resultant controller is

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

Time (Sec)

θ 1

& θ

2

( R a d )

θ1

θ2

Simulation

Fig. 13. Output of motor unit Mi with PD controller for a reference inputθid = 1 rad.

1.89s + 14.42. We use bilinear transformation to convert the

controller into a discrete-time one. The simulation and the

practical closed-loop responses are shown in Figure 13.

2) Control of the outer loop: The ball position controller

in the outer loop computes the required θd that needs to

be shared by the two motors in a cooperate manner. If one

motor contributes a fraction δθd (0 ≤ δ ≤ 1), then the other

motor needs to contribute the remainder (1− δ )θd as shown

in Figure 9.

We try various controllers including PD, lead, PID, and

integral control with LQR. We obtain satisfactory results from

all these controllers. In the remainder of this section, wewill further investigate the PD controller only (the choice is

arbitrary).

The specifications for the PD controller are settling time

ts ≤ 3 s and peak overshoot M p ≤ 20%. The designed

controller is 13s + 17.5. The practical output of the DMBB

system with this PD controller is shown in Figure 14 for the

following arbitrary choices of δ :

1. plot 1 is observed with δ = 1,

2. plot 2 is observed with δ = 0.5, and

3. plot 3 is observed with

δ =

0.5, 0 ≤ t < 1 s

0.75, 1 ≤ t < 2 s0.5, 2 ≤ t < 3 s1, 3 ≤ t s

3) Analysis of the results:

1. Effect of δ : In Figure 14, the three plots (corresponding

to the three different values of δ (t)) seem to be approx-

imately the same. The seemingly small differences may

be attributed to the small differences that may exist in

the conditions under which the three experiments were

performed. Theoretically, should the three values of δ (t)give the same results? Or, should we expect that two motors

may do a quicker or more accurate job of positioning the

ball than a single motor?

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 8/9

8

0 1 2 3 4 5 6 7 8 9 100

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

Time (Sec)

B a l l p o

s i t i o n ( m )

1

2

3

Fig. 14. Practical results for the ball position with xd = 0.25 m. Each plotis one value of δ(t).

In Figure 9, if the section Σ of the block diagram between

θd and θ is of unity gain, then we see that the behavior of xwill be independent of δ (t), and all three plots in Figure 14

will be the same. That is, two motors will not do a quicker

or more accurate job of positioning the ball than a single

motor.

The differences among these three plots will arise when

Σ does not have unity gain, and contains nonlinearities,

as it does in our case. If δθd or (1 − δ )θd are in the

saturation regions of their respective nonlinearities, then we

may expect to find difference among the three plots. This

may happen, for example, in the case where we providexd 0.25 m.

2. Effect of our measures: A comparison of Figure 14 with

Figure 10 shows that our measures for reducing the mis-

match mentioned earlier have paid off.

IV. CONTROL-THEORETIC LESSONS LEARNED

1. Through a BYO testbed, one can learn to use the right

hardware for putting one’s control algorithms to practical

use.

For example, the data sheets of the op-amps LM741 and

uA741 assure of a minimum bandwidth of 400 kHz, but

in our experience they had bandwidths of only about 15

– 20 kHz and did not allow us to work with a PWM

frequency of 20 kHz. Thus, these did not support our

theoretically-proven algorithm. Instead, we found that the

op-amp TL074N allowed us to work at a PWM frequency

of 20 kHz, and thus was adequate for our purpose.

2. In case of failure of the BYO testbed, one can quickly

perform repairs oneself, instead of waiting for the vendor.

3. If the needed testbed is not available as an OTS one, then

a BYO is the only option, as, for example, in the case of

our DMBB setup.

4. A BYO setup can always be modified to accommodate

newer tasks or functionality. An OTS setup may not permit

modifications.

5. We conducted our experimental work by simultaneously

designing (and simulating) the controller as well as imple-

menting it on the actual system. The fact that the control

system of our DMBB contained two loops — the inner

motor angular position control loop, and the outer ball

position control loop — required us to design and test the

outer loop only after the inner loop worked satisfactorily

not just in simulation, but also in actuality.6. While we agree with almost all the lessons listed in [14],

the one that stands out with respect to our work is the

following: “An ounce of identification is worth 10 pounds

of modeling”.

V. CONCLUSIONS AND DIRECTIONS FOR FUTURE

RESEARCH

In this article, we described a DMBB setup that we built,

and demonstrated the coordination of two motors to achieve

a task. The results are an improvement over our earlier tests.

We used identified linear models for designing controllers. The

practical results met our requirements.One control strategy we plan to test is that of cooperation

through information exchange by assigning one controller

(DSP) to each motor, and having the two controllers exchange

information through a communication network that uses, for

example, the controller area network (CAN) protocol. This

experiment will be in line with the goals of the NCS laboratory.

Using the motor control experience gained in the course

of building the DMBB setup, during the Fall 2009 semester,

we floated six new experiments in a third year undergraduate

laboratory course (EE380) in Electrical Engineering at IIT

Kanpur. We will report the experience of developing and

implementing these experiments in another article.With the confidence and experience gathered through build-

ing and controlling the DMBB setup, we are currently working

on the problem of coordinating the multiple driving and

steering motors of a lunar rover so that this rover may follow

the desired path with minimum of slip and power consumption.

REFERENCES

[1] D.S. Bernstein, “Setting up and running a control research laboratory,” IEEE Control Systems Magazine, October 2003.

[2] H. Osumi and T. Arai, “Cooperative control between two position-controlled manipulators,” in proceedings of the IEEE International

Conference on Robotics and Automation, 1994, vol. 2, pp. 1509–1514.

[3] M. Uchiyama, N. Lwasawa, and K. Hakomori, “Hybrid position/forcecontrol for coordination of a two-arm robot,” in Proceedings of IEEE

International Conference on Robotics and Automation, 1987, vol. 4, pp.1242– 1247.

[4] R. Wei, R.W. Beard, and E.M. Atkins, “Information consensus inmultivehicle cooperative control,” IEEE Control Systems Magazine, vol.27, no. 2, pp. 71–82, 2007.

[5] R. Murphey and P.M. Pardalos, Eds., Cooperative Control and Opti-

mization, Springer, 2002.

[6] Q. Zhao and C. Cheng, “Robust state feedback for actuator failureaccommodation,” in Proceedings of 2003 American Control Conference,June 2003, vol. 5, pp. 4225–4230.

[7] Aalbo rg University Esb jerg, “Control of a b all-beamsystem,” http://www.cs.aaue.dk/contribution/semesters/fall2009/ DE5/Control%20of%20beam%20ball.pdf.

[8] M. Gunasekaran and R. Potluri, “Cooperative control of a dual-motorball and beam system,” in Proceedings of the IEEE Conference on

Control, Communication and Automation (INDICON-2008), 2008.

7/29/2019 dmbb-manavaal-potluri.pdf

http://slidepdf.com/reader/full/dmbb-manavaal-potluripdf 9/9

9

[9] W. Yu and F. Ortiz, “Stability analysis of pd regulation for ball andbeam systems,” in Proceedings of the IEEE Conference on Contol

Applications, 2005, pp. 517–522.[10] Y.C. Chu and J. Hung, “A neural-network method for the nonlinear

servomechanism problem,” IEEE Trans. Neural Networks, vol. 10, no.6, pp. 1412–1423, 1999.

[11] L.X. Wang, “Stable and optimal fuzzy control of linear systems,” IEEE

Trans. Fuzzy Systems, vol. 6, no. 1, pp. 137–143, 1998.[12] J. Hauser, S. Sastry, and P. Kokotovic, “Nonlinear control via approx-

imate input-output linearization: ball and beam example,” IEEE Trans.

Automatic Control, vol. 37, no. 3, pp. 392–398, 1992.[13] G.F. Franklin, J.D. Powell, and M.L. Workman, Digital Control of

Dynamic Systems, Addison-Wesley, 3 edition, 1998.[14] D.S. Bernstein, “Control experiments and what I learned from them: A

personal journey,” IEEE Control Systems Magazine, pp. 81 – 88, April1998.