[ieee 2009 6th international symposium on mechatronics and its applications (isma) - sharjah, united...

6
Proceeding of the 6 th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26, 2009 REAL-TIME MACIDNE CONTROLLER VERIFICATION AND SIMULATION USING CONTROL SIGNALS EMULATION Mohamed Hussein Universiti Teknologi Malaysia Faculty of Mechanical Engineering 81300, Skudai, Johor, Malaysia [email protected] Robiah Ahmad Universiti Teknologi Malaysia Faculty of Mechanical Engineering 81300, Skudai, Johor, Malaysia [email protected] ABSTRACT The research study explores different types of controller simulation and verification methods and proposes a new method which employs the use of a control signals emulator. The research study has formulated a novel technique for emulating quadrature encoder signals to provide virtual closed loop control of servomotors. The deployment of a control signal emulator technique makes the system unique and removes its dependency on proprietary hardware or software. Enabling the real-time data from the signal emulation environment eases the task of realising a real-time machine simulator. 1. INTRODUCTION Having a fully tested control system is vital [1]. The only certain way to test how a control system handles every possible situation is to write the code, install it in the controller, and try it out on the system. Normally, testing takes place during the start- up phase of the system to be controlled which is an expensive, risky and error-prone way of developing control systems [2]. This is also a very costly means of uncovering design flaws. A control system failure can shut down the plant and require expensive modifications. In the worst case, the entire control system may have to be scrapped, redesigned, and rebuilt [3]. One of the most important questions that have arisen since is how to verify control systems and control logic. Methods for off-line programming and verification of industrial control systems have been developed over recent years (see [4], [5] and [6]). Although off-line simulation can be used to help address the control system verification requirements, additional desired features for system verification (such as real-time capabilities, auto code generation etc.) still have not been fully accomplished. Several researchers ([7], [8] and [9]) have explored improved methods for industrial control verification but almost all the projects reported are solutions for specific application or for particular development Mohd Zarhamdy Md Zain Universiti Teknologi Malaysia Faculty of Mechanical Engineering 81300, Skudai, Johor, Malaysia [email protected] Mohd Yunus Abdullah Universiti Teknologi Malaysia Faculty of Mechanical Engineering 81300, Skudai, Johor, Malaysia [email protected] frameworks. Several successful implementations have been realised of industrial control system emulators (see [1], [10] and [11]), however these systems only partially address the following important areas: ability to provide real-time off-line programming, verification and optimisation simulation/emulation of the system with discrete, analogue and hybrid control signals software and hardware independent architecture, i.e. the architecture is not dependent on any specific simulation software or industrial control system manufacturer. In other words, the ability to mix and match simulation software and control systems from different vendors in one application. full synchronisation between the simulated environment and the real system. A system is said to be real-time only if it is correct in operation dependent upon not only its logical, but also its temporal behaviour. Since the advancement of computer technology (software and hardware) efforts have been made to close the gap between the virtual and physical environment. In general, there are four possible approaches to test control systems which can be distinguished based on the possible combinations between reality and simulation as shown in Fig.1 and can be described as follows [1, 2]: i. The traditional way: Both the controller and system already exist. The controI system is tested after installation. ii. Offline simulation: Both the controller and the system are simulated. iii. Real System Virtual Controller: Combination of a simulated control system and a real system. iv. Real Controller Virtual System: Combination of a real controller and a simulated system. ISMA09-1 978-1-4244-3481-7/09/$25.00 ©2009 IEEE

Upload: mohd-yunus

Post on 02-Mar-2017

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [IEEE 2009 6th International Symposium on Mechatronics and its Applications (ISMA) - Sharjah, United Arab Emirates (2009.03.23-2009.03.26)] 2009 6th International Symposium on Mechatronics

Proceeding ofthe 6th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26, 2009

REAL-TIME MACIDNE CONTROLLER VERIFICATION AND SIMULATION USING CONTROLSIGNALS EMULATION

Mohamed Hussein

Universiti Teknologi MalaysiaFaculty ofMechanical Engineering

81300, Skudai, Johor, [email protected]

Robiah Ahmad

Universiti Teknologi MalaysiaFaculty ofMechanical Engineering

81300, Skudai, Johor, [email protected]

ABSTRACT

The research study explores different types of controllersimulation and verification methods and proposes a new methodwhich employs the use of a control signals emulator. The researchstudy has formulated a novel technique for emulating quadratureencoder signals to provide virtual closed loop control ofservomotors. The deployment of a control signal emulatortechnique makes the system unique and removes its dependencyon proprietary hardware or software. Enabling the real-time datafrom the signal emulation environment eases the task of realisinga real-time machine simulator.

1. INTRODUCTION

Having a fully tested control system is vital [1]. The onlycertain way to test how a control system handles every possiblesituation is to write the code, install it in the controller, and try itout on the system. Normally, testing takes place during the start­up phase of the system to be controlled which is an expensive,risky and error-prone way of developing control systems [2]. Thisis also a very costly means of uncovering design flaws. A controlsystem failure can shut down the plant and require expensivemodifications. In the worst case, the entire control system mayhave to be scrapped, redesigned, and rebuilt [3]. One of the mostimportant questions that have arisen since is how to verify controlsystems and control logic. Methods for off-line programming andverification of industrial control systems have been developedover recent years (see [4], [5] and [6]). Although off-linesimulation can be used to help address the control systemverification requirements, additional desired features for systemverification (such as real-time capabilities, auto code generationetc.) still have not been fully accomplished. Several researchers([7], [8] and [9]) have explored improved methods for industrialcontrol verification but almost all the projects reported aresolutions for specific application or for particular development

Mohd Zarhamdy Md Zain

Universiti Teknologi MalaysiaFaculty ofMechanical Engineering

81300, Skudai, Johor, [email protected]

Mohd Yunus Abdullah

Universiti Teknologi MalaysiaFaculty ofMechanical Engineering

81300, Skudai, Johor, [email protected]

frameworks. Several successful implementations have beenrealised of industrial control system emulators (see [1], [10] and[11]), however these systems only partially address the followingimportant areas:

ability to provide real-time off-line programming,verification and optimisationsimulation/emulation of the system with discrete,analogue and hybrid control signalssoftware and hardware independent architecture, i.e. thearchitecture is not dependent on any specific simulationsoftware or industrial control system manufacturer. Inother words, the ability to mix and match simulationsoftware and control systems from different vendors inone application.full synchronisation between the simulated environmentand the real system. A system is said to be real-timeonly if it is correct in operation dependent upon not onlyits logical, but also its temporal behaviour.

Since the advancement of computer technology (software andhardware) efforts have been made to close the gap between thevirtual and physical environment. In general, there are fourpossible approaches to test control systems which can bedistinguished based on the possible combinations between realityand simulation as shown in Fig. 1 and can be described as follows[1, 2]:

i. The traditional way: Both the controller and systemalready exist. The controI system is tested afterinstallation.

ii. Offline simulation: Both the controller and the systemare simulated.

iii. Real System Virtual Controller: Combination of asimulated control system and a real system.

iv. Real Controller Virtual System: Combination of a realcontroller and a simulated system.

ISMA09-1

978-1-4244-3481-7/09/$25.00 ©2009 IEEE

Page 2: [IEEE 2009 6th International Symposium on Mechatronics and its Applications (ISMA) - Sharjah, United Arab Emirates (2009.03.23-2009.03.26)] 2009 6th International Symposium on Mechatronics

Proceeding ofthe 6th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26,2009

..........

..........

Fig. 1 Testing controller system approaches

(i) traditional

(iii) real system virtual

(ii) offiine

(iv) real controller virtual

rp};Motioocootron~---------1~~I " I ' ....: motion :I control commands motion I servo: program generator I driverI II II I

________________ 1

feedbackencoderssignals

Beside the traditional way (offline simulation), the otherthree methods described above make use of simulation as a toolfor system verification and validation.

For long, offiine simulation has been accepted as a goodtool to verify and validate control program. However most of thetime the program generated in virtual environment is not directlyapplicable to the real controller. Time and again the program hasto be modified and refine before it can be used. Moreover, thereare thousands of controllers using a variety of in-house developedsoftware to adapt to the market conditions. Current trends suggestthe use of combination between reality and simulation. Theadoption of reality into simulation has been proven to be veryuseful and can also be used beyond program verification andvalidation.

2. MACIDNE CONTROL

Machines are controlled by devices called controllers.Modem industrial controllers which are used in industriesbasically are microprocessor based equipment which requiresprogram instructions, make the control calculation and execute theinstructions by transmitting the proper commands to actuatingdevices. in machine system, servo control is more prominent andvital because a lot of servomechanisms are being used and thesampling rate is very fast (milliseconds).

For servo axis movement in modem automated machineapplications, the set point needs to be generated automatically.Modem industrial controller is equipped with motion controlsystem which is used to generate set points over time. An exampleof a motion control system is shown in Fig. 2. The motioncontroller accepts commands or other inputs to generate a motionprofile using parameters such as distance to move, maximumacceleration and maximum velocity. The motion profile is thenused to generate a set of set points, and times they should beoutput. The set point scheduler will then use a real time clock tooutput these set points to the motor drive [11].

In feedback control system the motor angular displacementand speed is measured by mean of motor encoder and is comparedwith the motion profile. Any mismatch between the measuredprofile and the motion profile will trigger the error routine of thecontrol program.

Fig.2 Typical motion control system

a. Controller Signals ClassificationThe type of signal existing in machine operation can be divided

into three types and are classified into three categories. They are:

• Discrete Digital SignalThese are signals from sensors which are normally usedfor discrete events. They only have two states; ON andOFF or HIGH and LOW. Examples of this type ofsignal are from limit switches, proximity sensors, pushbuttons, etc.

• Analogue SignalThese are sensors/transducers signals which typicallyvary smoothly and continuously over time. In mostcontrol applications, analogue signals rangecontinuously over a specified current or voltage range.Examples of these types of signals are frompotentiometers, tachogenerators, LVDTs, etc.

• Continuous Digital SignalThese are signals from sensors which have two statesHIGH and LOW but are produced continuously.Examples of these types of signals are from incrementalencoders, absolute encoders, etc.

It should be noted, if these controls signals are to be emulated,the emulation of the first two types of signals is relatively straightforward; emulation of the third is found to be very challenging.Continuous digital signals are considered more important thananalogue signal for machine applications especially wheninvolving encoders [12].

3. CONTROLLER VERIFICATION USING CONTROLSIGNAL EMULATION

In this study, the use of control signal emulation issuggested for real-time controller verification and machinesimulation. In the integrated system the dynamics of the machine

ISMA09-2

Page 3: [IEEE 2009 6th International Symposium on Mechatronics and its Applications (ISMA) - Sharjah, United Arab Emirates (2009.03.23-2009.03.26)] 2009 6th International Symposium on Mechatronics

Proceeding ofthe 6th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26,2009

controller and will crash the whole system program. Thus, theability to mimic the encoder behaviour is crucial.

In order to achieve the above, the hardware for the encodersignal emulation was designed based on the schematic diagramshown in Fig. 4. Within the circuit, based on a single clock signal,

two outputs A and B are generated. Output A is based on thefalling edge of the clock signal and B on the rising edge. A signaldivider is used in such one output signal is produced after two

clock signal edges (either rising or falling) has occurred.

system is not a concern. What are of concern are the real-timeinteractions between the target machine system to be controlled

and the control system. In this case, both the target machinesystem and the associated control system are of interest. Theultimate objective was to realise machine system solutions with

the receptivity, rapidity and agility required by control systemdevelopers and machine builders. The simplified systemarchitecture is shown in Fig. 3. Within the system the Signal

Emulator Module provides real-time feedback signal accuratelyand timely. Thus, no error will be triggered in the controlprogram. The emulated signals information is then used to drive

the 3-D virtual machine. invertersignaldivider switch amplifier

Fig.3 Simplified controller verification and simulation usingsignal emulation system architecture

1 At present there is encoder simulator available in the market. Theproduct is introduced in October 2006 by Plant Control and AutomationPty. Ltd., an Australian company. However the simulator can only beoperated manually which is not appropriate for proposed applications.

outputB

output A

amplifier

II I

--.......-....r1I I

! II II I__.-~""'---ILJ

signaldivider

n

Fig.4 Schematic diagram ofencoder signal emulator

ClockI

I I

output A ~~-+--I_-....-

I :output B --t :

I II I

output AiI _Fig.5 Timing diagram of input clock, output A, output B and

output A

A digital switch with external trigger is used to produced aninverted A (A) signal. An inverted A signal will cause output A

leading output B. Hence, emulates the counter clockwise rotationof the encoder. The timing diagram of the clock, output A, output

B and inverted output A (Le. A) is illustrated in Fig. 5. Amplifiers

are used to strengthen the clock signals so that a perfect squarewave is maintained throughout the process.

The clock frequency is changing throughout the whole

encoder emulation process. Hence, the clock signal generatorshould able to change its frequencies timely and accordingly. Acommercial stepper motor driver is used to produce the clock

signal for the encoder signal emulator circuit. The stepper motordriver used is a PC-based. The use of stepper motor driver istwofold. Firstly, the stepper motor driver is capable to produce the

required clock frequencies. Secondly, there is similarity betweenstepper motor operation and servo motor operation. Thus, it iscapable to adapt with almost all motion commands.

• motion• control commands motion•• program generator••••

... ...----- .. ----------,

control signalsemulat~dfeedback

requestencode~ signals, ...

-~-----

signals:OJ•

.......3-D Signal . .

data ,. . .Virtual Emulator '" •

. ~

•Machine Module \ lIlIIl ______

:MOhooContrO[~----------1

• ••••:----~

•••I

Current trends shows that all modem machine uses servomotors which have digital encoders as their feedback element.These digital encoders produce continuous digital signals. Itshould be noted that the quadrature encoders are most prevalent inindustry because of their ability to provide direction of rotationbesides its ruggedness and simple wiring ([9] and [12]). Since, at

present1, there is no hardware yet available to mimic the

continuous digital signals behaviour of quadrature encoder incomparison to analogue signals; the ability to produce one is

considered novel and important to prove the feasibility of theemulated control signals system. In this paper, the emulation ofthe quadrature encoder will be discussed in detail.

a. Encoder Signal EmulationFor the system to function, it is important to be able to

emulate the behaviour of the quadrature incremental encodercorrectly. The produced emulated encoder signal is used as the

input signal to the real controller in continuous feedbackoperation; a defective signal can easily trigger an error in the

ISMA09-3

Page 4: [IEEE 2009 6th International Symposium on Mechatronics and its Applications (ISMA) - Sharjah, United Arab Emirates (2009.03.23-2009.03.26)] 2009 6th International Symposium on Mechatronics

Proceeding ofthe 6th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26,2009

Angular Velocity vs Time for Encoder Emulator (Axis 1)

Table 1: Encoder emulator configuration for accuracyevaluation

time (sec.)

(a)

5

o

-5

uQ)

~ 20Q)

~ 15~'uo~ 10..ca'3encca

25

4. RESULTS AND DISCUSSIONFig. 7 to Fig. 9 shows the graphs of velocity and

displacement in respect of time for the three axes of the encoder

emulators. Comparison is made on the time taken to reach thedesired position theoretically and from the tests. The results aretabulated in Table 2.

Axis SPEED ACCEL. DECEL. MOTION

Axis 1 20 1000 1000 0° to 100°

Axis 2 20 500 500 0° to 120°

Axis 3 10 1000 1000 Omm to 75mm

b. Control Signals Emulator Testing and EvaluationA demonstrator system was built to illustrate the use of the emulated

control signals system. The demonstrator is based on a six degree offreedom (OOF) Silver Reed ARX articulate robot. The robot consists offour moving axes (only three was used in the study) and nine sensors, and

it represents a machine with mixed continuous and discrete operations.The controller used for the study is a NextMove; a commercial PC-basedindustrial controller produced by Baldor Corpomtion. Throughout the

building of the system, the robot is regarded as a generic machine forindustrial applications. IGRIP (Interactive Graphics Robot InstructionProgram) simulation package from Delmia Corpomtion is used for

constructing the virtual environment of the machine (the robot). Withinthe system, the real controller is used to drive the machine 3-D modelwith the assistance of the emulated control signals. Fig. 6 shows the

system prototype.

Fig.6 Prototype of controller verification and simulation usingsignal emulation system

Angular Displacement vs Time for Encoder Emulator (Axis 1)

Fig.7 The (a) angular velocity and (b) displacement profiles of

encoder emulator for Axis 1 (0° to 1000 movement)

The test and evaluation on the encoder emulator covers twomain aspects, firstly, to test and evaluate the capability of the

signal emulators to produce the required signals and secondly, todemonstrate that the encoder emulator is able to provide real-timecapabilities. The initial test was on the encoder emulator. Each

encoder emulator is initiated to produce a motion signal formovement between two positions. The individual emulator

encoder speed and position data are then recorded. The

configuration for each axis is as shown in Table 1. The speed,acceleration and deceleration units are correspond to themovement type ofeach individual axis.

To access the real-time capability of system, two identicalNextMove controllers were used to drive the emulated controlsignals system and the real machine separately. A five loop

kinematics test was carried on both systems. Both systems weregiven the same movement sequences. Comparison was then madebetween both sets of systems' data.

12o10o

~ ~~ 6-5 0c 4ca 0

2oo

20 time (sec.)

(b)

ISMA09-4

Page 5: [IEEE 2009 6th International Symposium on Mechatronics and its Applications (ISMA) - Sharjah, United Arab Emirates (2009.03.23-2009.03.26)] 2009 6th International Symposium on Mechatronics

Proceeding ofthe 6th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26,2009

5

o

Angular Velocity vs Time for Encoder Emulator (Axis 2)

U 25Q)

.!een 20Q)

:E..~ 15'uo~ 10..ca'3encca

-5time (sec.)

Table 2: Comparison between theoretical and actual timetaken for emulated encoder signal to reach a desired positionfor all axes.

Axis Movement teaL tactual o~

(sec.) (sec.) error

Axis 1 0° to 100° 5.020 5.012 0.159

Axis 2 0° to 120° 6.040 6.135 1.573

Axis 3 omm to 75 mm 7.510 7.498 0.160

(a)

time (sec.)

Velocity vs Time for Encoder Emulator (Axis 3)

Angular Displacement vs Time for Encoder Emulator (Axis 2)From the comparison it shows that the time difference to

reach a target position between theoretical (column 4) and actual(column 5) is not more than 0.1 second with the highest errorbeing 1.573%. If the percentage error can be regarded as thepercentage of servo error, then the emulator encoders' capabilityare considered acceptable because the satisfactory servo error isbetween 2% to 5% [10].

It should be noted that the encoder emulator for Axis 2produces the most error. It is apparent in the graph shown in Fig.8 (a) that instability exists within the Axis 2 encoder emulatoroutput. This instability was probably due to electrical noise and/orexternal interference.

Fig. 10(a) and (b) shows the results from five loops testscarried out on both the emulated control signals system and thereal system (for Axis 1 only). The position and velocity graphs ofthe real system are superimposed onto the encoder emulatorposition and velocity graphs.

From the graphs it clearly shows that the emulated controlsignals system motion profiles coincide perfectly with the realmachine motion profiles for the axis. Furthermore, the emulatedencoder produces perfectly clean motion profiles compared to thereal system.

The crudeness in tuning the control parameters (PIDparameters) result in unclean motion profile of the real machine.

20

o-20

140

120

""':' 100en! 80Q)

'5 60cca 40

(b)Fig.8 The (a) angular velocity and (b) displacement profiles of

encoder emulator for Axis 2 (0° to 120° movement)

time (sec.)

(a)

Displacement vs Time for Encoder Emulator (Axis 3)

Angular Velocity vs Time Graph for RePetitiveMovement (Position: 0 • 100 • 0) for Axis 1

80

70_ 60

~ 50

i 40c~ 30:s 20

10

o-10

time (sec.)

(b)Fig.9 The (a) angular velocity and (b) displacement profiles of

encoder emulator for Axis 2 (Omm to 75mm movement)(a)

ISMA09-5

Page 6: [IEEE 2009 6th International Symposium on Mechatronics and its Applications (ISMA) - Sharjah, United Arab Emirates (2009.03.23-2009.03.26)] 2009 6th International Symposium on Mechatronics

Proceeding ofthe 6th International Symposium on Mechatronics and its Applications (ISMA09), Sharjah, UAE, March 24-26,2009

Angular Displacement vs Time Graph for RePetitiveMovement (Position: 0 • 100 • 0) for Axis 1

(b)

Fig. 10 The (a)angular velocity and (b)displacement profilecomparison between emulated control signal system andreal system for Axis 1 (0° to 100° movement)

5 CONCLUSION

This paper has describes the general use of control signalemulation system which is intended to help machine designers andmachine builders to work with their machine in real-time althoughthe machine itself has not necessarily been built. This newapproach is based on control signal emulation. The study hasresulted in the formulation of a technique for emulation ofquadrature encoder signals. The proposed technique can be usedfor servomotor control testing and verification. The devisedencoder emulator is programmable; hence, it can help to providethe desired signals for the control feedback element.

6. ACKNOWLEDGEMENTS

The authors would like to thank the Malaysian Ministry ofHigher Education (MORE) and Universiti Teknologi Malaysia(UTM) for their continuous support in the research work.

7. REFERENCES

[1] F. Auinger, M. Vorderwinkler and G. Buchtela, "InterfaceDriven Domain-Independent Modeling Architecture for'Soft-Commissioning' and 'Reality in the Loop' ",Proceedings of the 1999 Winter Simulation Conference,1999, pp. 798-805.

[2] A. Pfeiffer, B. Kadar and L. Monostori, "Evaluating andImproving Production Control Systems by UsingEmulation", lASTED International Conference on AppliedSimulation and Modelling (ASM 2003), Spain, 2003.

[3] V. Van Doren, "Test Your Control System with Simulation",Control Engineering, September Issue, 2003.

[4] B. K. Min, A. Huang, Z. 1. Pasek, D. Yip-Hoi, F. Husted andS. Marker, "Integration of Real-time Control Simulation toVirtual Manufacturing Environment", Journal of AdvancedManufacturing Systems, Vol. 1, No.1, 2003, pp. 67-87.

[5] S. F. Scheiber, "Emulation and Control System Assurance",Control Engineering, November Issue, 2003.

[6] T. LeBaron and K.Thompson, "Emulation Of A MaterialDelivery System", Proceedings of the 1998 WinterSimulation Conference, 1998, pp 1055-1060.

[7] F. Danielsson and P.R. Moore, Validation, "Off-LineProgramming and Optimisation of Industrial Control Logic",Mechatronics, Vol. 13. Issue 6, 2003, pp. 571-585.

[8] R.1. Stone, "Virtual Reality: Definition, Technology andSelected Engineering Applications Overview", MechatronicsForum Paper, May 1998.

[9] Encoder Products Company (EPC), Product descriptions,http://www.encoder.com/products.html [Accessed: 1 March2007].

[10] National Instrument (NI), "Understanding Servo Tune",http://zone.nLcom/devzone/cda/tut/p/id/2923 [Accessed: 6June 2007]

[11] H. Jack, "Dynamic system modeling and control", Draft Ver.2.6, Unpublished, 2004.

[12] M. Hussein, P. Moore, 1. S. Pu and C. B. Wong, "QuadratureEncoder Signal Emulation for Integrated Real-VirtualEnvironments and Systems", International Conference onIntelligent and Advanced Systems, ICIAS 2007.

ISMA09-6