Design of a Motion Control IC

105
i 中文摘要 本論文旨在研究線性X-Y平台上之運動控制晶片。此線性X-Y平台採用兩 支永磁式同步線性馬達來驅動。第一、先定義X-Y平台及馬達驅動系統之數學模 式。第二、本文將推導類神經網路控制器並用在X-Y平台各軸之位置控制迴路上 以提升X-Y平台之控制性能。第三、應用有限狀態機器來實現上述控制器電路, 並以VHDL語言來描述此有限狀態機器及以FPGA晶片來實現。FPGA 晶片採用 ALTERA Stratix II EP2S60F672C5 。此晶片具有48,352 ALUTs ,最多492 I/O 腳,36 DSP方塊功能與總共2,544,192 RAM位元。另外、有一顆Nios II 處理器能 嵌入FPGA 晶片內。故此FPGA 晶片相當適合發展X-Y平台之運動控制器。第四、 X-Y平台運動軌跡規劃將在Nios II 處理器內以軟體實現。步級響應及圓形、窗 形、星形、波浪形運動軌跡響應等將用來評估運動控制性能。最後,透過Matlab FPGA模擬系統來分析並證實本論文提出類神經模糊控制器在X-Y平台上的有效 性及正確性。

Transcript of Design of a Motion Control IC

i

中文摘要

本論文旨在研究線性X-Y平台上之運動控制晶片。此線性X-Y平台採用兩

支永磁式同步線性馬達來驅動。第一、先定義X-Y平台及馬達驅動系統之數學模

式。第二、本文將推導類神經網路控制器並用在X-Y平台各軸之位置控制迴路上

以提升X-Y平台之控制性能。第三、應用有限狀態機器來實現上述控制器電路,

並以VHDL語言來描述此有限狀態機器及以FPGA晶片來實現。FPGA 晶片採用

ALTERA Stratix II EP2S60F672C5。此晶片具有48,352 ALUTs,最多492 I/O 接

腳,36 DSP方塊功能與總共2,544,192 RAM位元。另外、有一顆Nios II 處理器能

嵌入FPGA 晶片內。故此FPGA 晶片相當適合發展X-Y平台之運動控制器。第四、

X-Y平台運動軌跡規劃將在Nios II 處理器內以軟體實現。步級響應及圓形、窗

形、星形、波浪形運動軌跡響應等將用來評估運動控制性能。最後,透過Matlab

及FPGA模擬系統來分析並證實本論文提出類神經模糊控制器在X-Y平台上的有效

性及正確性。

ii

Abstract

The aim of this thesis is to study the principles of a motion control IC for a

linear X-Y table which is driven by two Permanent Magnet Linear Synchronous Motors

(PMLSMs). Firstly, a mathematical model of PMLSM drive is defined. And for

increasing the performance of the PMLSM drive system, a NFC (Neural Fuzzy

Controller) is derived and applied to the position control loop of PMLSM drive.

Secondly, the FPGA by using FSM (Finite State Machine) method is presented to

realize the aforementioned controllers, and the VHDL (VHSIC Hardware Description

Language) is adopted to describe the circuit of the FSM. However, a mathematical X-Y

table constructed by two NFCs and two PMLSM models is described and set up in

FPGA. Thirdly, the motion trajectory planning for X-Y table is implemented by

software using Nios II processor. The motion trajectory evaluated in this thesis includes

the step response, sinusoid response, circular trajectory tracking, window trajectory

tracking, star trajectory tracking and flexuous trajectory tracking, etc. The program in

Nios II processor is coded using C language. Fourthly, the simulation is carried out by

using MATLAB package and FPGA (Field Programmable Gate Array) developed

environment-QUARTUS II, respectively. The FPGA chip adopts ALTERA Stratix II

EP2S60F672C5 and a Nios II processor can be embedded into this FPGA chip. Finally,

the simulation results verified the effectiveness of the proposed motion control IC for

linear X-Y table under different motion trajectories.

iii

Acknowledgments

The work was carried out at Southern Taiwan University (STU) during the

period from 2008 to 2010. I would like to thank all of my teachers in Department of

Electrical Engineering.

I wish to express my deepest appreciation to my advisor professor Ying-Shieh

Kung for his guidance and support throughout my research.

I want to thank my labmates: Yang Chih Yuan, Hsieh Nan Hui, Yang Feng

Ming, Sarah, Blanca and Bui Thi Hai Linh for their help and advice. And I also thank

all friends who make have unforgettable time and sweet memories in Taiwan.

I also wish to express my gratitude to my family and my wife’s family for their

support.

Finally, I am grateful to my parents and my wife Catarina for their constant love,

support, encouragement. And special send my love to my son.

iv

Contents 摘要 ................................................................................................................................... i

Abstract ............................................................................................................................ ii

Acknowledgments ......................................................................................................... iiii

Contents .......................................................................................................................... iv

List of tables .................................................................................................................... v

List of figures .................................................................................................................. vi

Chapter 1 Introduction .................................................................................................... 1

1.1 Research background & Literature review ............................................................... 1

1.2 Chapter outline ......................................................................................................... 4

Chapter 2 Mathematical model of PMLSM drive and neural fuzzy controller design ... 5

2.1 Mathematical model of PMLSM .............................................................................. 5

2.1.1 The structure of PMLSM ................................................................................. 6

2.1.2 Modelling of PMLSM ..................................................................................... 8

2.2 Neural Fuzzy Controller (NFC) design .................................................................. 10

2.2.1 PI type Fuzzy Controller (FC) ....................................................................... 10

2.2.2 Reference Model (RM) .................................................................................. 12

2.2.3 Radial Basic Function Neural Network (RBFNN) ........................................ 12

2.4 Fuzzy parameters adjusting mechanism ................................................................. 14

Chapter 3 Hardware and software co-design of the servo control system using SoPC

technology ....................................................................................................................... 16

3.1 Description of SoPC builder design ....................................................................... 16

3.1.1 Stratix II EP2S60F672C5 .............................................................................. 16

3.1.2 Nios II embedded processor .......................................................................... 18

3.2 Hardware and software co-design for a closed-loop servo control system ............ 20

Chapter 4 Hardware realization of the neural fuzzy controller for X-Y table .............. 33

4.1 Plant IP ................................................................................................................... 33

4.2 Speed controller IP ................................................................................................. 35

4.3 Position controller IP .............................................................................................. 36

4.3.1 Reference model ............................................................................................ 39

v

4.3.2 PI type fuzzy controller.................................................................................. 41

4.3.3 Radial basis function neural network............................................................. 42

4.3.4 Adjusting mechanism .................................................................................... 47

Chapter 5 Software realization of the motion trajectory for linear X-Y table .............. 48

5.1 The Nios II software ............................................................................................... 49

5.2 Motion trajectory .................................................................................................... 52

5.2.1 Point to point motion trajectory ..................................................................... 52

5.2.2 Circular motion trajectory .............................................................................. 54

5.2.3 Star motion trajectory .................................................................................... 55

5.2.4 Window motion trajectory ............................................................................. 56

5.2.5 Flexuous motion trajectory ............................................................................ 57

5.3 Perfomance measures ............................................................................................. 59

Chapter 6 Simulation results of the motion controller .................................................. 60

6.1 Simulation in MATLAB......................................................................................... 60

6.1.1 One dimensional motion trajectory................................................................ 60

6.1.2 Two dimensional motion trajectory ............................................................... 65

6.2 Simulation in FPGA ............................................................................................... 76

6.2.1 One dimensional motion trajectory.............................................................. 76

6.2.2 Two dimensional motion trajectory ............................................................. 79

Chapter 7 Conclusion and future works ........................................................................ 89

7.1 Overview ................................................................................................................ 89

7.2 Future works ........................................................................................................... 89

REFERENCES .............................................................................................................. 90

BIOGRAPHY ................................................................................................................ 95

vi

List of tables

Table 3.1: Stratix II EP2S60F672C5 device features ..................................................... 17

Table 3.2: The simulation results using method 1 .......................................................... 29

Table 3.3: The simulation results using method 1 and 2 ................................................ 32

Table 5.1: Utility evaluation of motion control IC for Linear X-Y table in FPGA ........ 49

Table 6.1: The tracking error of trajectory response in case using FC(MATLAB) ....... 68

Table 6.2: The rule table after adjusted in the circular simulation case(MATLAB) ...... 70

Table 6.3: The rule table after adjusted in the star simulation case(MATLAB) ............ 71

Table 6.4: The rule table after adjusted in the window simulation case ......................... 72

Table 6.5: The rule table after adjusted in the flexuous simulation case ........................ 73

Table 6.6: The tracking error of trajectory response in case using NFC ........................ 74

Table 6.7: The tracking error of trajectory response in the case using FC(FPGA) ........ 82

Table 6.8: The tracking error of trajectory response in the case using NFC(FPGA) ..... 87

vii

List of figures

Figure 2.1: The block diagram of the motion controller system for PMLSM .................. 5

Figure 2.2: Unrolling a rotary electric machine ................................................................ 9

Figure 2.3: Halving and squashing a rotary electric machine ......................................... 10

Figure 2.4: The structure of PMLSM ............................................................................... 7

Figure 2.5: Motor Axis d & q Mode ................................................................................. 8

Figure 2.6: Simplified control block diagram for PMLSM .............................................. 9

Figure 2.7: The architecture of a neural-fuzzy controller system for PMLSM .............. 10

Figure 2.8: Fuzzification and fuzzy rule table ................................................................ 11

Figure 2.9: RBF neural network ..................................................................................... 13

Figure 3.1: FPGA development board ............................................................................ 17

Figure 3.2: The Nios Embedded Processor .................................................................... 19

Figure 3.3: The Nios Development Tool Flow ............................................................... 20

Figure 3.4: Closed-loop control system .......................................................................... 21

Figure 3.5: Circuit and the separate block diagram of overall control system ............... 22

Figure 3.6: VHDL code of overall closed-loop control system ...................................... 22

Figure 3.7: The circuit design of plant using Finite State Machine (FSM) .................... 23

Figure 3.8: VHDL code of Plant ..................................................................................... 24

Figure 3.9: The circuit design of PID controller using Finite State Machine ................. 24

Figure 3.10: VHDL code of PID controller .................................................................... 26

Figure 3.11: Simulation results in QUARTUS II (case 1) .............................................. 27

Figure 3.12: Simulation results in MATLAB (case 1) ................................................... 28

Figure 3.13: Simulation result in Quartus II (case 2) ..................................................... 28

Figure 3.14: Simulation result in MATLAB (case 2) ..................................................... 29

Figure 3.15: Hardware and software co-design of closed-loop servo control system .... 30

Figure 3.16: The C languages for PID controller ........................................................... 31

Figure 3.17: Simulation results when using hardware and software co-design .............. 32

Figure 4.1: FPGA-realization of single axis position controller .........................................

based on neural fuzzy control ...................................................................... 33

Figure 4.2: State diagram of FSM for describing the Plant ............................................ 34

Figure 4.3: The block of Plant ........................................................................................ 35

Figure 4.4: State diagram of FSM for describing the Speed P controller ....................... 35

viii

Figure 4.5: The block of Speed controller ...................................................................... 36

Figure 4.6: The block diagram of neural fuzzy controller .............................................. 36

Figure 4.7: State diagram of FSM for describing the overall position controller IP ...... 37

Figure 4.8: The function block of neural fuzzy Controller ............................................. 39

Figure 4.9: State diagram of FSM for describing the reference model .......................... 41

Figure 4.10: State diagram of FSM for describing the Fuzzy + PI controller ................ 42

Figure 4.11: Structure of the proposed RBF NN ............................................................ 42

Figure 4.12: State diagram of FSM for describing the RBF NN .................................... 43

Figure 4.13: State diagram of FSM for describing the radial-basic function ................. 43

Figure 4.14: State diagram of FSM for describing the norm .......................................... 44

Figure 4.15: State diagram of FSM for describing the exponential function ................. 45

Figure 4.16: The block of exponential function ............................................................. 45

Figure 4.17: State diagram of FSM for describing the training RBF NN ...................... 46

Figure 4.18: State diagram of FSM for describing jacobian ........................................... 47

Figure 4.19: State diagram of FSM for describing jacobian ........................................... 47

Figure 5.1: The architecture of a motion controller for X-Y table ................................. 48

Figure 5.2: Nios II IDE development system diagram ................................................... 50

Figure 5.3: Exception handling process .......................................................................... 51

Figure 5.4: Typical initialization settings 2 kHz interrupts ............................................ 51

Figure 5.5: Flow chart of main and ISR program ........................................................... 52

Figure 5.6: Point-to-point trapezoidal velocity profile ................................................... 54

Figure 5.7: Circular motion trajectory ............................................................................ 54

Figure 5.8: Star motion trajectory ................................................................................... 55

Figure 5.9: Window motion trajectory ........................................................................... 57

Figure 5.10 Flexuous motion trajectory .......................................................................... 58

Figure 6.1: Diagram of fuzzy control for PMLSM drive ............................................... 60

Figure 6.2: Diagram of Neural fuzzy control for PMLSM drive .................................... 61

Figure 6.3: Membership functions, fuzzy rule table and control effort surface ............. 61

Figure 6.4: Radial basis function neural network ........................................................... 63

Figure 6.5: Position response and control effort when using .............................................

Fuzzy controller (MATLAB) ....................................................................... 64

Figure 6.6: Position response and control effort when using .............................................

Neural-Fuzzy controller (MATLAB) .......................................................... 64

ix

Figure 6.7: Rule table after adjusted and the control effort surface for ..............................

Step response with neuron fuzzy controller (MATLAB) ............................ 65

Figure 6.8: Diagram of fuzzy control for linear X-Y table ............................................. 66

Figure 6.9: FC using circular trajectory tracking response (MATLAB) ........................ 66

Figure 6.10: FC using star trajectory tracking response (MATLAB) ............................. 67

Figure 6.11: FC using window trajectory tracking response (MATLAB) ..................... 67

Figure 6.12: FC using flexuous trajectory tracking response (MATLAB) ..................... 68

Figure 6.13: Diagram of neural fuzzy control for linear X-Y table ................................ 69

Figure 6.14: NFC using circular trajectory tracking response (MATLAB) ................... 70

Figure 6.15: NFC using star trajectory tracking response (MATLAB) .......................... 71

Figure 6.16: NFC using window trajectory tracking response (MATLAB) ................... 72

Figure 6.17: NFC using flexuous trajectory tracking response (MATLAB) .................. 73

Figure 6.18: Average of the tracking error (MATLAB) ................................................. 75

Figure 6.19: Standard deviation of the tracking error (MATLAB) ................................ 75

Figure 6.20: Rule table and the control effort surface (FPGA) ...................................... 76

Figure 6.21: Step response and control effort when using FC (FPGA) .......................... 78

Figure 6.22: Step response and control effort when using NFC (FPGA) ....................... 78

Figure 6.23: Rule table after adjusted and the control effort surface for ............................

Step response (simulation in FPGA) ......................................................... 79

Figure 6.24: FC using circular trajectory tracking response (FPGA) ............................. 80

Figure 6.25: FC using star trajectory tracking response (FPGA) ................................... 80

Figure 6.26: FC using window trajectory tracking response (FPGA) ............................ 81

Figure 6.27: FC using flexuous trajectory tracking response (FPGA) ........................... 81

Figure 6.28: NFC using circular trajectory tracking response (FPGA) .......................... 83

Figure 6.29: Rule table after adjusted and the control effort surface for ............................

Circular motion trajectory .......................................................................... 83

Figure 6.30: NFC using star trajectory tracking response (FPGA) ................................ 84

Figure 6.31: Rule table after adjusted and the control effort surface for ............................

star motion trajectory ................................................................................. 84

Figure 6.32: NFC using circular trajectory tracking response (FPGA) .......................... 85

Figure 6.33: Rule table after adjusted and the control effort surface for ............................

Window motion trajectory ......................................................................... 85

Figure 6.34: NFC using flexuous trajectory tracking response (FPGA) ........................ 86

x

Figure 6.35: Rule table after adjusted and the control effort surface for ............................

Flexuous motion trajectory ........................................................................ 86

Figure 6.36: The average tracking error (FPGA) ........................................................... 88

Figure 6.37: Standard deviation of the tracking error (FPGA) ....................................... 88

1

Chapter 1

Introduction

1.1 Research background & Literature review

Nowadays, modern control systems, such as semiconductor manufacturing

equipment, transportation, X-Y driving devices and robots have become important

systems which usually require high speed and high accuracy linear motions [1]. These

systems can be divided into two parts includes the mechanical parts with servo drive

systems and the servo controllers that control the multi axis motion of the mechanical

parts. In general, the system is composed of an X-Y table, where each motion axis is

driven by an individual actuator system, such as DC or AC motors [2]. DC motors used

to be popular in the industry because of their simple control; you only need to control

the armature voltage to vary the motor’s speed. Because the motor’s carbon brush and

convertor were mechanical components, they would produce sparks and cause damage

when the motor was running, which was one major shortcoming of the DC motor. In

addition, the DC motor posed a threat to the environment, had a short life cycle, and

was expensive to maintain. And AC motors can be classified into three different types:

the synchronous motor, the induction motor, and the reluctance motor. The stator and

rotor of an AC motor are the only contact bearing components. The spinning of the rotor

is caused by the stator’s magnetic field, and needs more complicated control technology

(such as the magnetic field guide control) to implement different movements. With the

development of semiconductor control devices, the computation required for AC motor

control is met easily. Because of this advantage, AC motors are very popular today [3].

The motion mechanisms using motor drives usually lead to the existence of

unknown dynamics, coupled interferences, unmeasured friction, and disturbance among

each other, which often significantly deteriorates the system performance in machining

processes [4]. Therefore, in order to improve the tracking performance in machining

processes, many studies have been presented [5]–[7]. First, the stability of CNC

machines with output time delay and the measurement error are studied in [5]. Phase

margin and frequency response analyses are used for controller design to determine

regions of system stability. However, cross-coupled dynamics, disturbance load torque,

2

and uncertainties among each axis mechanism were not considered in the stability

analysis. Second, the dead zone nonlinearity due to the mechanical motion system was

compensated using an adaptive fuzzy controller with the estimation of the dead zone

nonlinearity [6]. From the results shown in [6], it is obvious that the dead zone

nonlinearity can be effectively compensated, but the linear state feedback control used

in [5] for position tracking control was designed without robustness consideration. Then,

due to the cross-coupled effect of the X-Y table, the nonlinear friction compensation

based on single axis motion dynamics was presented in [7]. The nonlinear friction with

integrated disturbance load torque was represented by an approximated nonlinear

function. Moreover, the compensator design was presented using the input/output

relations of the nonlinear function. Unfortunately, robustness to variations of system

parameters was not considered simultaneously in the design of the compensator. In

modern manufacturing, the design of a two axis motion control with high performance

and high precision machining is required. Therefore, the motion control of an X-Y table,

which is composed of two permanent-magnet linear synchronous motors (PMLSMs), is

considered in this thesis. Such a system can be found in many applications, e.g.,

machine tools and integrated circuit (IC) manufacturing equipment. Moreover, The

advantages of superior power density, high performance motion control with fast speed

as well as better accuracy, are such that permanent magnet linear synchronous motors

(PMLSMs) are being increasingly used [8-10]. At the same time, the end effect of

PMLSM can be controlled more easily than linear induction motor. Therefore, PMLSM

is suitable for high-performance servo applications and has been used widely for

industrial robots, machine tools, semiconductor manufacturing systems, X-Y driving

devices, etc. [11]–[14]. However, the PMLSM does not use conventional gears or ball

screws, so uncertainties, such as parameter variations, external load disturbance, friction

force and unknown dynamics, in the drive system greatly affect servo performance and

diminish the performance of the pre-designed PMLSM driving system [5]. In addition,

since the operation of PMLSM involves two contacting bodies, nonlinear friction force

is inevitable among the forces of motion. The friction characteristic may be easily

varied due to the change of normal forces in contact, temperature, and humidity [15],

[16]. In addition, in a closed-loop control system, the nonlinear friction force often

results in steady state error, limit cycle, and low bandwidth [15], [16]. Furthermore,

friction is a natural phenomenon that is quite difficult to model and is not completely

3

understood. Therefore, in order to obtain high performance motion control system, the

compensation of the mentioned uncertainties and nonlinear friction force, which directly

impose on the mover of the PMLSM, quickly and directly is very important. Recently,

many researchers have focused on this area and have employed different control

algorithms for PMLSM drives to improve their performance. For instance, some

researchers have proposed a robust control for the PMLSM. The robust control design is

based on the parameters and model of the PMLSM. However, measuring the parameters

of the PMLSM is very difficult [17]. Some researchers have used conventional adaptive

control [1, 18, and 19] for the PMLSM. Conventional adaptive control method does not

depend on accurate knowledge of the parameters. In recent years, intelligent control

techniques [20-21,22-26] such as fuzzy control, neural networks control, adaptive fuzzy

control, and neural fuzzy controller have been developed and applied to the position

control of servo motor drives to yield high operating performance. A high performance

motor control system should have a fast dynamic response to adjustments in its control

parameters, so the motor outputs influenced by the disturbances can recover to their

original status as soon as possible [28]. Specially, neural fuzzy systems have been

largely considered by researchers as they employ the learning ability of the neural

network with the advantage of the rule base structure of fuzzy logic [29]. For example,

if the domain knowledge or human expert knowledge of the controller is only partially

available, such integration can automatically be incorporated into the adaptive system in

which the remaining unknown control knowledge can then be acquired through the

learning process by the neural network. Other advantages include fine-tuning and

automatic setting of the fuzzy controller parameters, which are often obtained

heuristically rather than analytically and as such can eliminate laborious and time

consuming procedures [30-31].

In many neural-control paradigms, the back-propagation algorithm has been

popularly used. However, being a gradient descent method, such algorithm has many

drawbacks which include slow convergence, local minimum, etc [32]. In this study, the

Radial Basis Function neural network (RBF) [33-34] is implemented as a neural-fuzzy

controller (NFC) and identifies PMLSM to tune parameters of fuzzy controller.

Nevertheless, the execution of the intelligent control techniques requires a lot of

computations, so implementation of these highly complex control algorithms depend on

the PC systems in most studies [35-36]. Nowadays, owing to the progress of VLSI

4

technology, the FPGA provides a compromise between the special purpose application

specific integrated circuit hardware and general purpose processors. Therefore, using an

FPGA to form a compact, low cost, and high performance servo system for precision

machine has become an important issue. However, in many research works, the FPGA

is merely used to realize the hardware part of the overall control system [38], [39]. In

recent years, an embedded processor Intellectual Property (IP) and an application IP can

now be developed and downloaded into the FPGA to construct a System-on-a-

Programmable-Chip (SoPC) environment [37].

The FPGA chip employed herein is an Altera Stratix II EP2S60F672C5 with

48,352 ALUTs, maximum 492 user I/O pins, 36 DSP blocks, 2,544,192 bits of RAM,

and a Nios II embedded processor. Therefore, it is suitable for the development of the

servo motion controller of the X-Y table. Finally, the simulation results verified the

correctness and effectiveness of the controllers show that the neural fuzzy controller for

XY table was the best.

1.2 Chapter outline

The thesis is divided into seven chapters. The outlines of chapters are as follow:

Chapter 1: Gives research background and review the literatures.

Chapter 2: Introduces to mathematic model of PMLSM and neural fuzzy controller

design.

Chapter 3: Shows the SoPC design methodology of servo control system

Chapter 4: Presents hardware design of the neural fuzzy controller for linear X-Y table

in FPGA

Chapter 5: Presents software realization of the motion trajectory for linear X-Y table in

FPGA

Chapter 6: Simulates the control system in MATLAB and in FPGA

Chapter 7: Gives a conclusion which gives the summary and some future work.

5

Chapter 2

Mathematical model of PMLSM drive and neural

fuzzy controller design

The overall architecture of the control system for PMLSM is shown in Figure 2.1

which includes two control loops:

- Speed loop: P controller is presented.

- Position loop: neural fuzzy controller is adopted.

Figure 2.1: The block diagram of the motion controller system for PMLSM

2.1 Mathematical model of PMLSM [43-44]

Linear motors (LMs) fall into two main types: linear synchronous motors (LSM)

and linear induction motors (LIM). In linear induction motors the rotor magnetic field is

produced by the induced current, when in linear synchronous motors rotor field is

produced by the permanent magnets or by the independently generated current. Linear

motors could be applied in many areas. Industrial automation systems are the main field

of application of the linear motors. Linear induction motors have found applications in

the following areas: conveyor systems; liquid metal pumping; material handling; low

and medium speed trains. Linear synchronous motors are successfully utilized in any

application where high precision motion control is required: machining tools; welding

robots; laser scribing systems; industrial laser cutting systems; industrial robots. Linear

motors are used for high-speed ground transportation as propulsion and levitation

6

systems. Also extensive use of LMs could be found in building and factory

transportation systems. LMs are applied as elevator hoisting machines, ropeless

elevators in ultra-high buildings, horizontal transportation systems at factories. There

are several types of LSMs which are classified according to the following items:

• Short primary / short secondary

• Ironcore / ironless

• Moving primary / moving secondary

• Tubular / flat

• Permanent magnet excitation / electromagnetic excitation

• Single sided / double sided

• Transverse flux / longitudinal flux

Nowadays flat brushless permanent magnet (PM) linear synchronous motors are

dominating. The main reasons for the PM-machine popularity are higher force density,

efficiency and faster response due to existing magnetic field than in LIMs.

2.1.1 The structure of PMLSM

Linear Motors (LMs) develop directly magnetic forces between a stator and a

translator, or mover, acting upon a linear prime mover (for generating) or on a mover

machine (for actuation). No mechanical transmission is required between the translator

and the prime mover. Since there is a linear counterpart for every rotary electromagnetic

machine, we expect to encounter numerous conventional or easy to visualize LMs.

Figure 2.2 illustrates the now classic birth of the linear counterpart of a rotary induction

machine by simply unrolling it. A flat single sided topology is thus obtained.

Alternatively, if the stator and rotor of a rotary machine are halved and "squashed"

subsequently, a flat double sided configuration results, as shown in Figure 2.3.

Figure 2.2: Unrolling a rotary electric machine

(a) Profile of motor rotation (b) Single sided-type linear motor

7

Figure 2.3: Halving and squashing a rotary electric machine

(a) Profile of motor rotation (b) Double sided-type linear motor

Analysis of LMs, one traditional way to describe the construction of PMLSM is

to cut and unroll a PM rotary synchronous motor to produce a flattened configuration as

shown in Figure 2.4. So we have a lying plate with permanent magnets and a stator

winding which slides in a straight line. The slider which consists of a slotted armature

and three-phase windings is termed moving primary, or mover, or slide, while the fixed

magnet plate could be named as secondary, or exciter, or, somewhat confusingly, stator.

The primary and the secondary are separated by a flat air gap. The constant value of the

air gap is maintained by guide rail and bearings.

Figure 2.4: The construction of a PMLSM

When the coils of the mover are excited by 3-phase alternating current and armature

magnetic field is generated. This field produces a travelling flux wave along the main

axis of the linear motor. This flux wave interacts with the flux produced by the

permanent magnets of the stationary fixed magnet plate. Interaction results in an

electromagnetic force which moves the primary in positive or negative direction in

dependence of the alignment of the permanent magnets along the magnet plate. In this

8

case such a force is called thrust, or traction force, or propulsion force. The linear

motion is obtained directly by electromagnetic force.

2.1.2 Modelling of PMLSM [3]

The equivalent electric circuit of the permanent magnet synchronous motor is

shown in Figure 3, where the voltage equation’s reference coordinates are settled on the

synchronous rotation coordinates.

(a) Axis d mode

(b) Axis q mode

Figure 2.5: Motor Axis d & q mode

According to Figure 2.4, the axis d-q voltage can be shown as:

0

fe

ds

qs

dssqse

dseqss

ds

qs

i

i

sLrL

LsLr

v

v

(2.1)

The voltage is calculated to:

ds

ds

qs

feqs

ds

qs

ds

s

ds

qs

e

qs

ds

e

qs

s

ds

qs

L

v

L

v

i

i

L

r

L

L

L

L

L

r

i

i

dt

d

(2.2)

9

From (2.2), the mathematical model of a typical PMLSM is described as following

ds

d

qsp

ds

qs

d

d

sdsv

Lix

L

Li

L

r

dt

di 1.

(2.3)

qs

qs

p

qs

f

qs

qs

s

dsp

qs

dsqsv

Lx

Li

L

rix

L

L

dt

di 1..

(2.4)

Where vds, vqs are the d and q axis voltages; ids, iqs, are the d and q axis currents, rs is the

phase winding resistance; Lds, Lqs are the d and q axis inductance; p

x is the translator

speed; f

is the permanent magnet flux linkage; is the pole pitch. The developed

electromagnetic thrust force is given by [3]

qsfdsqsdseiiLLF ))((

2

3

(2.5)

The current control of a PMLSM drive is based on a vector control approach. That is, if

we control ids to 0, the PMLSM will be decoupled, so that control a PMLSM will

become easy as to control a DC linear motor. After simplification and considering the

mechanical load, the model of a PMLSM can be written as the following equations,

qstqfeiKiF

2

3 (2.6)

with

ftK

2

3 (2.7)

and the mechanical dynamic equation of PMLSM is

dt

dxB

dt

xdMFF

p

m

p

mLe

2

2

(2.8)

wheree

F is the motor thrust force,t

K is force constant, m

M is the total mass of the

moving element,m

B is viscous friction coefficient and L

F is the external force. And the

control block diagram in current loop can be simplified as the Figure 2.6.

*i q

K t

F L

F e+-

BsM mm

1

s

1 X P

Figure 2.6: Simplified control block diagram for PMLSM

10

2.2 Neural Fuzzy Controller (NFC) design

The solid rectangular area in Figure 2.7 presents the structure of a fuzzy

controller based on RBFNN identification for PMLSM drive. It consists of a fuzzy

controller, a reference model, a radial basis function neural networks and an adjusting

mechanism. Neural fuzzy control is similar to conventional adaptive control, but they

differ in some ways. The main differences are that (i) the fuzzy controller has a special

nonlinear structure that is suitable for various plant conditions, and (ii) engineer

experience about motor dynamics and control knowledge can be incorporated into an

NFC based on RBFNN identification. Detailed description of a neural fuzzy controller

is as follows.

Inference

Mechanism DFIFI

Reference model

1-Z-1

1-Z-1

Z-1

neural fuzzy controller

Radial Basis Function Neural Networks

PI

cmd_speed

u

xe

info_position

xe

xm

+

X*e

-

e

de

uf

yrbf

+-

Jacobian transformationcmd_speed

info_position

Adjusting Mechanism

Kv kt

FL

Fe

+-

+-

Xp

PMLSM drive

mm BSM

1

S

1KeKe

Xe

1/Ke

11 Z

Figure 2.7: The architecture of a neural fuzzy controller system for PMLSM

2.2.1 PI type Fuzzy Controller (FC)

In Figure 2.8, the tracking error and the change of the error, e , e are defined as

)()()( kxkxkeem

(2.9)

)1()()( kekeke (2.10)

and e, de and uf are input and output variables of FC, respectively.

The design procedure of the FC is as follows:

(a) Take e, de as the input variables of FC, and define their linguist variables as E

and dE. The linguist value of E and dE are {A0, A1, A2, A3, A4, A5, A6} and {B0,

B1, B2, B3, B4, B5, B6}, respectively. Each linguist value of E and dE is based on

11

the symmetrical triangular membership function which is shown in Figure 2.4.

(b) Compute the membership degree of e and de. Figure 2.8 shows that the only two

linguistic values are excited (resulting in a non-zero membership) in any input

value, and it’s the membership degree )( eAi

and )( deB j

can be straightforward

derived from Figure 2.8.

(c) Select the initial fuzzy control rules by referring to the dynamic response

characteristics , such as

ij,jic is THEN B is e and A is IF

fue (2.11)

where i and j = 0~6, Ai and Bj are fuzzy number, and cj,i is real number. The graph of

fuzzification and fuzzy rule table is also shown in Figure 2.4.

Figure 2.8: Fuzzification and fuzzy rule table

(d) Construct the fuzzy system uf(e,de) by using the singleton fuzzifier, product-

inference rule, and central average defuzzifier method. Although there are totally 49

fuzzy rules in Figure 2.4 will be inferred, actually only 4 fuzzy rules can be

effectively excited to generate a non-zero output. Therefore, the output of FC can be

expressed as follows:

12

*

)(*)(

)](*)([

),(,

1 1

,1 1

1 1

,

mn

i

in

j

jmnmi

in

j

jmBA

i

in

j

jmBAnm

fdc

dee

deec

deeu

mn

mn

(2.12)

where )(*)( ,

deedmn BAmn

. And thosen,m

c are adjustable parameters. In addition, it

is straightforward to obtain 1 1 1

,

i

in

j

jmmn

d in (2.10).

The output of FC is:

)(*)()1()( kukkkukufipi

(2.13)

)1()()( kukuku (2.14)

2.2.2 Reference Model (RM)

Second order system with natural frequency, n and damping ratio, is usually as

the RM in the neural fuzzy control system and as follow

22

2

*2)(

)(

nn

n

r

r

ss

s

(2.15)

Applying the bilinear transformation, the second order system can be transformed to a

discrete model by

2

2

1

1

2

2

1

10

1*

1

1)(

)(

zbzb

zazaa

zx

zx

r

r (2.16)

Furthermore, the difference equation is written as:

)2()1()()2()1()(*

2

*

1

*

021 kxakxakxakxbkxbkx

rrrrrr (2.17)

2.2.3 Radial Basic Function Neural Network (RBFNN)

2.2.3.1 RBF network architecture

The architecture of the RBFNN is presented in Figure 2.9. The network consists of

three layers: an input layer, a hidden layer and an output layer.

Input layer: An input vector x, are applied to all neurons in the hidden layer.

T

nxxxx ,...,

21 (2.18)

In Figure 2.10, input of RBF neural network is

13

Tkxkxkux 1,, (2.19)

Hidden layer: The hidden layer is composed of number n RBFs that are

connected directly to all the elements in the output layer. A node in the hidden

layer will produce a greater output when the input pattern presented is close to

its center. The basis function for the jth

hidden node is often defined by a

Gaussian exponential function shown as follows:

mjx

b

cx

hj

j

j....,4,3,2,1,

2exp

2

2

(2.20)

Where b jthe width of the j

th neuron is, cccc jnjj

T

j,...,, 21 is the center of j

th

RBF unit.

Output layer: The network output yrbf

is formed by a linearly weighted sum of

the number of basic functions in the hidden layer. The values for the output

nodes can be calculated as

h jw jx

m

j

rbf

1

(2.21)

Where w jis the weight from the j

th hidden layer neuron to the output layer

neuron and hj is the output of the jth

node in the hidden layer.

Figure 2.9: RBF neural network

14

2.2.3.2 Training algorithm in RBFNN

The instantaneous cost function is defined as

22

2

1)(

2

1nnprbf

exxJ (2.22)

Then according to the gradient descent method, the learning algorithm of weights, node

center and variance are adjusted by following equations:

)()()()1( khkekwkwjnnjj

(2.23)

k

kkkkkekk

b

cxhwcc

j

jii

jjjiji 21

(2.24)

kkkkekk

b

kckxhwbb

j

jjjj

jii

3

2

1

(2.25)

Where j=1,2,..m, i=1,2,3 and is a learning rate. Further, the u

xp

is Jacobian

transformation and can be derived from Figure 2.3:

b

chw

xx

j

jm

j

jj

rbfpku

uu2

1

1

(2.26)

2.4 Fuzzy parameters adjusting mechanism

The gradient descent method is used to derive the FC control law in Figure 2.3.

The adjusting of fuzzy controller parameters is to minimize the square error between the

mover position and the output of the RM. The instantaneous cost function is defined by

22)

2

1

2

1pme

xxeJ (2.27)

and the parameters of nmc , are adjusted according to

c

Jc

nm

e

nm

,

,

(2.28)

with m = j, j+1, n = i,i+1 and where represents learning rate. The chain rule is used

and the partial differential equation for e

J in (2.25) can be written as

nm

f

f

p

nm

e

c

u

u

xe

c

J

,,

(2.29)

From (2.10), we can get

15

mn

nm

fd

kc

ku

,

,)(

)(

(2.30)

and using Jacobian formulation from (2.24)

b

chw

xx

j

jm

j

jjip

rbf

ip

f

pu

KKu

KKu

2

1

1

)()(

(2.31)

Therefore, (2.28) is substituted into (2.27), and then the parameters nmc ,

of fuzzy

controller described by (2.10) can be adjusted using the following expression.

2

1

1

,,

)())(()(

j

j

j

m

j

jmnipnmb

kuchwdkkkekc

(2.32)

with m = j, j+1 and n = i, i+1.

16

Chapter 3

Hardware and software co-design of the servo

control system using SoPC technology

In this chapter, the SoPC design methodology for closed-loop servo control

system is presented. The Altera System-on-a-Programmable-Chip (SoPC) Builder

provides the capability to rapidly define and generate complex SoPC architectures. And

a simple GUI driven interface allows component selection, customization, and

integration. Further, the SoPC enables to integrate an embedded processor IP (Nios II

processor) and a user application IP into an FPGA. Therefore, in this section, a closed-

loop servo control system design will be emulated and discussed based on the SoPC

environment.

3.1 Description of SoPC builder design

SoPC Builder is an automated system development tool that dramatically

simplifies the task of creating high performance SoPC designs. The tool accelerates

time-to-market by automating the system definition and integration phases of SoPC

development. Using SoPC Builder, system designers can define a complete system,

from hardware to software, within one tool and in a fraction of the time of traditional

system-on-a-chip (SoC) design. SoPC Builder is integrated within the Altera Quartus II

software to give Programmable Logic Device (PLD) designers immediate access to a

revolutionary new development tool.

3.1.1 Stratix II EP2S60F672C5

With a size range of from about 10K to 180K gates, the Stratix II is one of the

biggest, fastest chips in FPGA chip’s family. With this device, it can be implement a

high density logic design and get high performance and great signal integrity in the most

efficient device possible. Table 3.1 lists the Stratix II P2S60F672C5 device features [10]:

17

Table 3.1: Stratix II EP2S60F672C5 device features

Figure 3.1: FPGA development board

18

3.1.2 Nios II embedded processor

The Nios processor is the soft-core IP. Its can configure some parameters by

software. Following that, users can embed this processor into Altera’s FPGA to

construct a SoPC environment. The Novel FPGA technology provides users with

flexible design of methodology. In this section, we will describe the features and

functionality of the Nios embedded processor development board which included the

Excalibur

Development Kit [21], [22].

3.1.2.1 Development Board Features

The Nios development board with Stratix II Edition provides a hardware

platform for developing embedded systems. This board provides the following features:

A Stratix II FPGA with more than 13,500 Adaptive Logic Modules (ALM)

and 1.3 million bits of on-chip memory

16 Mbytes of flash memory

1 Mbyte of static RAM

16 Mbytes of SDRAM

On board logic for configuring the Stratix II device from flash memory

On-board Ethernet MAC/PHY device

Two 5V-tolerant expansion/prototype headers each with access to 41 Stratix

II user I/O pins

CompactFlashTM connector for Type I CompactFlash cards

Mictor connector for hardware and software debug

Two RS-232 DB9 serial ports

Four push-button switches connected to Stratix II user I/O pins

Eight LEDs connected to Stratix II user I/O pins

Dual 7-segment LED display

JTAG connectors to Altera® devices via Altera download cables

50 MHz oscillator and zero-skew clock distribution circuitry

Power-on reset circuitry

19

3.1.2.2 The Nios Development Tool Flow

The Excalibur

Development Kit (EDK) provides rapidly design flow in Nios

development system. The Nios development system can be builded up rapidly and

easily by software. The Nios is configurable soft core embedded processor. The

embedded processor can be customized rapidly some peripherals as the Figure 3.2

shown. Figure 3.3 shows the design flow of Nios development tool. The embedded

processor and peripherals can configure easily by System Builder. Therefore, the

hardware and software design can be separated and paralleled work in the same time.

Figure 3.2: The Nios Embedded Processor

20

Figure 3.3: The Nios Development Tool Flow

3.2 Hardware and software co-design for a closed-loop

servo control system

Based on the SoPC technology, a closed-loop servo control system by mixing

hardware and software implementation in FPGA chip will be discussed. The circuits

requiring fast processing but simple computation are suitable to be implemented by

hardware in the FPGA, and the complicated control algorithm with heavy computation

can be realized by software in the FPGA [16][17]. The results of the software/hardware

co-design increase the programmability and the flexibility of the designed digital system,

enhance the system performance by parallel processing, and reduce development time.

To exploit the features, a plant with first-order system and a PID controller to form a

closed loop control system is taken as a design example and shown in Figure 3.4. The

sampling time frequency using in plant system is 500 Hz but in digital controller is 1

kHz. The plant and the PID controller are described as follow:

21

Discrete type plant model:

)1(*)1(*)( nxnyny (3.1)

PID controller:

)(*)( neknupp

(3.2)

)1(*)1()( neknunuii

(3.3)

))1()((*)( neneknudd

(3.4)

))1()((*)1(*)(*)1()()()()( neneknekneknununununudipdip

(3.5)

Figure 3.4: Closed-loop control system

Implementation can be divided into two methods:

(1) Full hardware implementation: the plant and the PID controller are implemented

by hardware.

(2) Hardware and software implementation: The plant is implemented by hardware,

but the PID controller is implemented by software.

Method 1: All hardware realization

In this method, the closed-loop control system is implemented by hardware. In Figure

3.5 shows block diagram of PID controller, plant and the overall integrated program,

respectively. Firstly, implement coding of the PID controller and the implement coding

of the plant. Secondly, connect the PID controller block with the plant block.

22

Figure 3.5: Circuit and the separate block diagram of overall control system

(a) Overall control system (b) PID controller (c) Plant

Figure 3.6: VHDL code of overall closed-loop control system

23

Hardware design has two kinds of implementation: The parallel processing and

sequential processing using Finite state machine(FSM). But in this case does not

require fast operation. So we can use Finite state machine (FSM) to simplify and

consume at least chip resources.

Figure 3.7 show the circuit design of plant using FSM method and seven-step machine

to carry out the overall computation of plant which mathematical model are shown in

(3.1).

Figure 3.7: The circuit design of plant using Finite State Machine (FSM)

In Figure 3.8 shows the VHDL code of plant follow the circuit design in Figure 3.7.

From the code’s lines 1 to 27 declare all of input, output of plant, the signals, one

multiplier and one adder are used to compute for plant execution. The code’s line 28

and 29 initial the parameters of plant Teta ( ) and phi ( ). And from the code’s lines

30 to 56 execute the process to implement seven steps from S0 to S6.

24

Figure 3.8: VHDL code of Plant

25

Figure 3.9 show the circuit design of PID controller using FSM method in 12 steps to

execute the PID controller which mathematical model are shown in (3.2), (3.3), (3.4),

(3.5).

e1mulr(30..15)

Ki

-e1

Ui

e1<=en

mulr(30..15)

mulr(30..15)en

-Yn

Xn en

de

Yn

Kp

S1S0 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12

Kd

Ui

Figure 3.9: The circuit design of PID controller using Finite State Machine (FSM)

In Figure 3.10 shows the VHDL code of PID controller follow the circuit design in

Figure 3.9. We execute steps S0 ~ S12 from the code’s lines 40 to 72.

26

Figure 3.10: VHDL code of PID controller

27

Simulation in QUARTUS II and MATLAB

To investigate the correctness of the proposed closed loop control algorithm, three

simulation cases with different conditions are carried out.

- Case 1: The parameters of PID as Kp=0.15, Ki=0.1, Kd=0.01 and the parameters of

plant is as 8.0 , 5.0 . And the input of closed loop control is Xn=0.5

- Case 2: The parameters of PID as Kp=0.22, Ki=0.1, Kd=0.01 and the parameters of

plant is as 8.0 , 5.0 . And Xn=0.5

We simulate the closed loop control in QUARTUS II and the values are transferred to

Q15 format values and the simulation results are shown in Figure 3.11(case 1) and

Figure 3.13(case 2).

(Case 1) PID values: Kp = 0.15, Ki = 0.05, Kd = 0.01 (4915, 1638 and 328 for Q15)

Figure 3.11: Simulation results in QUARTUS II (case 1)

End value of output Yn: 16376 for Q15 after 170 ns, maximum value = 20430 (0.4997

and 0.6234 for real value).

And at the same time, we use the simulation result in MATLAB to compare with the

result in QUARTUS II. The MATLAB’s simulation results are shown in Figure 3.12 for

case 1 and Figure 3.14 for case 2.

28

Figure 3.12: Simulation results in MATLAB (case 1)

(Case 2) PID values: Kp = 0.15, Ki = 0.22, Kd = 0.01 (4915, 7209 and 328 for Q15)

Figure 3.13: Simulation result in Quartus II (case 2)

End value of output Yn: 16384 for Q15 after 560 ns, maximum value = 28777,

minimum value = 6975(0.5, 0.878 and 0.212 for real value)

29

Figure 3.14: Simulation result in MATLAB (case 2)

We can summarize the results of our simulation as follows:

Table 3.2: The simulation results using method 1

Case

2

QUARTUS II MATLAB

1

End valueMax value End valueMax value

Software

0.623 0.499 0.587 0.5

0.878 0.5 0.718 0.5

The overshoot in case of the QUARTUS II simulation is greater than the one in the

MATLAB simulation case. And we can observe that when Ki increases, the final value

of the output will be closer to that of the input. We can also see that during the first

steps, the initial error is greater.

30

Method 2: Hardware and software co-design

In this section, hardware and software co-design method is presented. The plant is

implemented by hardware in FPGA, while the PID controller is implemented by

software using Nios II processor. The closed loop control is implemented with interrupt

time 1 kHz. And overall structure is shown in Figure 3.15. It can be divided into two

parts: Nios system and plant. In Nios system, the controller operation can be done and

control signal is transferred to the plant through FPGA Avalon Bus’s I/O. After the

feedback signal and the response results are buffered to the memory, wait until the

interrupt active.Then they can be printed on the screen of the PC and can be collected.

Then, the response results are plotted by using the MATLAB software. Therefore, under

the procedure, the response result is shown in Figure 3.17.

Figure 3.15: Hardware and software co-design of closed-loop servo control system

31

PID controller software is written by C language in Nios II software in Figure 3.16.

Figure 3.16: The C languages for PID controller

32

Figure 3.17: Simulation results when using hardware and software co-design

Summarize all of simulation results as follow:

Table 3.3: The simulation results using method 1 and 2

Case

2

All hardware

realizationMATLAB

1

End valueMax value

Method

0.623 0.499 0.587 0.5

0.878 0.5 0.718 0.5

Min valueEnd valueMax value Min valueEnd valueMax value Min value

Hardware and software

co-design

0.618 0.5

0.727 0.5

0.471

0.397 0.418

0.489

0.212

0.324

Conclusions: Compared with all hardware realization method, the hardware and

software co-design implementation in the closed loop control system has the following

benefits.

1) The speed processing is faster than the one done by hardware realization.

2) The overshoot is smaller than the one in the hardware realization case.

3) We can observe that the values of the hardware and software co-design method

are very similar with the values in MATLAB simulation.

However, when we implement hardware/software co-design method (8% LEs resource)

the Chip resource is occupied more than using all hardware realization (1% LEs

resource). Because the Nios II processor occupy with 3,652/40,877 LEs chip resource.

33

Chapter 4

Hardware realization of the neural fuzzy

controller for linear X-Y table

In this chapter, the FPGA-realization of neural fuzzy controller for the X-Y table

is introduced. However, only the single-axis table is considered, and the hardware

architecture is shown in Figure 4.1. In this figure, it includes three IPs which one is

position controller IP, another is speed controller IP and the other is plant IP. Detailed

circuit design of these three IPs will be presented at the following sections.

Figure 4.1: FPGA-realization of single axis position controller

based on neural fuzzy controller

4.1 Plant IP

The Plant is modelled by mathematical model of PMLSM has been described in

(2.6). Taking Laplace transformation of (2.4) and (2.6) and applying the bilinear

transformation, the digital transfer function of the drive system of single axis can be

obtained as

34

)1)(*1(

*

)(

)(

11

1

*

zz

z

ki

kx

q

p (4.1)

with Φ = exp(−BmT / Jm) , Ψ = Kt (1−Φ)/Bm . The z−1

is a back-shift operator and T is the

sampling period. In Figure 4.2, ke is represent an encoder factor, which transforms the

displacement of the table to the pulse number, and xe is represent the pulse number

generated from the linear encoder. Therefore,

epekxx * (4.2)

In hardware realization, (4.1) needs to be transformed to the difference equation form as

follows:

)1()1(*)2(*)1(*)(*

kxkxkxkikxpppqp

(4.3)

and its digital circuit design using the FSM method is shown in Figure 4.2, which uses

only one 12-b multiplier, one 12-b adder, and seven-step machine to carry out the

overall computation of PMLSM. Inputs and outputs of the block diagram of plant are

defined as follows:

Clk : clock signal with frequency 50MHz

Clk_200n : clock signal with frequency 5MHz

Uk_in ( )1(*

kiq

) : values of input

fi (Ф) : The parameter of plant

kr (Ψ) : The parameter of plant

rate (ke) : The parameter of plant

xp_out (xp) : Output of plant

xe : Output of plant (Transform from xp)

16 bits

(Q0)

I*q(k-1)

Xp (k-2)

Ф

-

Ф

Xp (k-1)

mulr(22..11)

mulr(22..11)

Xp (k-1)

S0 S1 S2 S3 S4 S5 S6

Ke gain and

Q format Transform

Xp(k) Xe(k)

Xp (k-1)=>Xp(k-2)

Xp (k)=>Xp(k-1)

I*q (k)=>I*q(k-1)

12 bits

(Q11)

12 bits

(Q11)

*

* Note that: Xe(15..0) = Xp(11)&Xp(11)&Xp(11)&leftshift((11..0)*0.9,1)&’0'

Ψ

Figure 4.2: State diagram of FSM for describing the Plant

35

Figure 4.3: The block of Plant

4.2 Speed controller IP

The inputs of speed loop are the speed command (cmd_speed) and the feedback

signal. And the feedback speed signal (info_speed) is calculated as follow

)1()(_. kxkxspeedfoinpp

(4.4)

The digital P controller in the speed controller is formulated as follows.

ekkispeedpq

*)(_

(4.5)

where the kp_speed is the P controller gain and the e is the error between command speed

and feedback speed value (e = cmd_speed*speed_gain- info_speed), the iq is the P

controller output.

Figure 4.4 is state diagram of FSM to describe how to calculate the feedback

speed signal from encoder (info_speed) in steps S0~S1 and execute the speed P

controller in steps S2~S5.

Speed_gain

Iq

Cmd_speed

Info_speed_out

S1S0 S2 S3 S4 S5

Kp_speed

_

xp(k)

xp(k-1)

xp(k)=>xp(k-1)

info_speed

e

_

Figure 4.4: State diagram of FSM for describing the Speed P controller

36

Figure 4.5: The block of Speed controller

4.3 Position controller IP

Inference

Mechanism DFIFI

Reference

model

1-Z-1

1-Z-1

Z-1

neural fuzzy controller based on RBF identification

Radial Basis Function

Neural Networks

PI

cmd_speed

u

xe

xe

xm

+-

e

de

uf

yrbf

+-

Jacobian

transformationcmd_speed

info_position

Adjusting

Mechanism

Figure 4.6: The block diagram of neural fuzzy controller

Position controller is shown in Figure 4.6 which includes a fuzzy controller, a

reference model, a RBF neural network and an adjusting mechanism. The sampling

frequency of position loop is designed with 2 kHz. To implement the overall control

system, FSM technology is used and shown in Figure 4.7. Here, overall 112 steps are

needed to complete the computation of neural fuzzy controller. Steps s0~s6 execute the

computation of reference model output; steps s6~s9 are for the computation of mover

velocity, position error and error change; steps s9~s12 execute the function of the

37

fuzzification; s13~s22 describe the look-up table and defuzzification; steps s23~s25 execute

the PI controller in position loop; steps s27~s104 execute the computation of RBF neural

network; and s105~s111 execute the tuning of fuzzy rule parameters. The operation of

each step in FPGA can be completed within 80ns (12.5 MHz clock); therefore total 112

steps need 8.96 s operation times.

kxm

*

a0

1*

kxm

a1

2*

kxm

a2

1kxm

b1

2kxm

b2

S1 S 2 S 3

kx p

-

kxm

- ke

1ke

kde

SD -e i 1

SD -de j 1

ke

kde

RS,

1

eA

1

RS,

1

deBj

&i

j

j&i

-

1

eA

1

eA

1

1

d ji ,

-

1

deB j

deBj

deBj

d ji ,1

deBj

1

eA

1

d ji 1,

d ji 1,1

d ji ,

c ij ,

d ji 1,

c ij ,1

d ji ,1

c ij 1,

c ij 1,1

d ji 1,1

u f

k p

ku

S 7 S 8 S9 S 10 S11S 12

S 13 S 15 S 16 S 17 S 18 S19 S 20 S 21 S 22 S 23 S 24 S 25

-

-

k i

1kui

Look-up

Fuzzy rule

table

c ij ,

c ij 1,

c ij ,1

c ij 1,1

S 14

j&i

S 101 S 102 S 103

α

e(k)

jacobian

k p

d ij , c ji,

c ji,

d ij ,1

c ji 1,

d ij 1,

c ji 1,

c ji ,1

c ji ,1

d ij 1,1 c ji 1,1

c ji 1,1

Neuro-1

computation

Neuro-2

computation

Neuro-3

computation

kx p

1kxp

1out

2out

3out

1J

2J

3J

xrbf

S 0 S 4 S 5 S 6

S 26

SS 10027~ S 104 S105 S 106 S 107

Computation of reference model output Computation of position error

and error changeFuzzification

Look-up fuzzy table Defuzzification PI controller

Computation of RBF neural network

k i

Adjustment of fuzzy rule parameters

S 108 S 109 S 110 S 111

ku

1ku

∆u(k)

∆u(k)

Figure 4.7: State diagram of FSM for describing the overall position controller IP

38

The inputs and outputs of the function block of NFC shown in Figure 4.8 as follow:

clk : clock signal with frequency 50MHz

clk_80n : clock signal with frequency 12.5 MHz

model : select Reference Model or not

ruleout_enable : read the current value of rule

cmd_position : position command

kp_position : kp in position control loop

ki_position : ki in position control loop

learning_rate : learning_rate of fuzzy parameters

Max,Max_M,Max_S : Maximum value of fuzzy parameters

rule_PS,rule_PM,rule_PL : values transferred to fuzzy rule table

em_PS,em_PM,em_PB,em_range : tops of membership functions and range

dem_PS,dem_PM,dem_PB,dem_range : tops of membership functions and range

A0_in,A1_in,A2_in,B1_in,B2_in : parameters of reference model

en : enable neural network

ne_core_in : the number of nodes in hidden layer

order_in : the order of estimation of exponential

c_data_1, c_data_2, c_data_3 : initial centers of neurons

b_data : initial width of neurons

w_data : initial weight of neurons

fuzzy_out : output of fuzzy-neural controller

position_out : position of linear motor

ruleout : fuzzy rule table

refcmd_output : output of reference model

39

Figure 4.8: The function block of neural fuzzy Controller

4.3.1 Reference Model

Second order system with natural frequency, n and damping ratio, is usually

as the RM in the fuzzy-neural control system. Applying the bilinear transformation, the

second order system can be transformed to a discrete model:

2

2

1

1

2

2

1

10

1*

1

1)(

)(

zbzb

zazaa

zx

zx

m

m (4.6)

Furthermore, the difference equation is written as:

)2()1()()2()1()(*

2

*

1

*

021 kxakxakxakxbkxbkx

mmmmmm (4.7)

where the z1 is back shift operator and bbaaa and

21210,,,, are the parameters of

the discrete model.

40

To present float number computation, we use Q31-format representation.

If 40 n , 1 , and sampling frequency is 2kHz, the parameters of RM in the

difference equation will be:

1

0

1

5

2

4

1

5

0

10*3726078815802.9

03969603960396.1

10*698029604940.9

10*1389605920988.1

10*698029604940.9

a

b

a

a

a

(4.8)

The difference equation is

)2(*10*698029604940.9

)1(*10*1389605920988.1

)(*10*698029604940.9

)2(*10*3726078815802.9

)1(*03969603960396.1)(

*5

*4

*5

1

kx

kx

kx

kx

kxkx

m

m

m

m

mm

(4.9)

To avoid overflow occurred, reformulated it as

)2(*10*03454901480247.0

)1(*10*0699802960494.0

)(*10*03454901480247.0

)2(*10*11864803940790.0

)1(*01989801980198.02/)(

*5

*4

*5

1

kx

kx

kx

kx

kxkx

m

m

m

m

mm

(4.10)

Finally, changing float numbers to 32 bit binary (Q31-format)

)2(*105528

)1(*210516

)(*105258

)2(*1031638429

)1(*2104959219)(

*

*

*

kx

kx

kx

kx

kxkx

m

m

m

m

mm

(4.11)

Reference model is implemented by 6 steps computation using FSM description and

shown in Figure 4.8.

41

kxm

*

a0

1*

kxm

a1

2*

kxm

a2

1kxm

b1

2kxm

b2

S1 S 2 S 3

-

-

S 0 S 4 S 5

kxm

Figure 4.9: State diagram of FSM for describing the reference model

4.3.2 PI type Fuzzy Controller

From the design method is presented in chapter 2 and two equation (2.11) and

(2.12) use to calculate the output of FC we can show the method of hardware design for

PI type fuzzy controller in position loop in Figure 4.10.

The overall computation needs 21 steps from S6 to S26. From steps SS 86~ are

for the computation of table position, position error and error change; steps SS 129~

describe the fuzzification; steps SS 2213~ are for the look-up table and defuzzification;

and steps SS 2623~ execute the PI controller and computation of position command

output.

42

kxp

-

kxm- ke

1ke

kde

SD-

ei 1

SD-

de j 1

ke

kde

RS,1

eA

1

RS,1

deBj

&i

j

j &i

-

1

eA

1

eA

11

d ji,

-

1

deBj

deBj

deBj

d ji ,1

deBj

1

eA

1

d ji 1,

d ji 1,1

d ji,

c ij,

d ji 1,

c ij ,1

d ji ,1

c ij 1,

c ij 1,1

d ji 1,1

u f

kp

ku

S 7S

8 S9 S 10 S11S 12

S 15 S16S 17 S 18 S19 S 20 S 21

S 22 S 23 S 24 S 25

ki

1kui

S 14

1ku

ku

S6

S 26

S 13

Look - up

Fuzzy rule

table

c ij ,c

ij 1,

cij ,1

c ij 1,1

Figure 4.10: State diagram of FSM for describing the Fuzzy + PI controller

4.3.3 Radial Basis Function Neural Network (RBFNN)

Figure 4.11 describes RBF neural network. It has three inputs in input layer,

three RBFs in hidden layer, and one output in output layer. Corresponding to the RBF

NN structure shown in Figure 4.11, Figure 4.12 describes the computing sequence of

RBF network implemented in FPGA. Steps SS 10027~ are the computation of neural

cores.

x1

exp

x3

x2

exp

exp kxe

kyrbf

ke

w

w

w

Output

layerHidden

layer

Input

layer

3 3 1

Figure 4.11: Structure of the proposed RBF NN

43

Neural core

Neural core

Neural core

Σ

resulttotal

ett

ratelearning

w

b

c

c

c

x

x

x

_

arg

_

3

2

1

3

2

1

total_ result

Jacobian

rbf_out

rbf_out

rbf_out

j

j

j

S27 SS 10027~ S101 S104

~

Figure 4.12: State diagram of FSM for describing the RBF NN

4.3.3.1 Radial basic function

The radial-basic function is calculated by:

mjb

cxy

j

rbf

j

....,4,3,2,1,2

exp2

2

(4.12)

Figure 4.13 are state diagram of FSM to compute one radial basic function.

Steps SS 137~ are computation of norm and steps SS 4614

~ are computation of

exponential function.

norm

x1

c1(k-1)

x2

c2(k-1)

x3c3(k-1)

b(k-1)

b(k-1)<<1

÷

2b_p2(k-1)

norm_outexp

-exp_in h

w(k-1)

one_rbf_out

S 7 S 12 S 13 S 14 SS 4614~ S 47 S 48

Figure 4.13: State diagram of FSM for describing the radial-basic function

44

1. Norm function

Norm of cx j is defined as follow

cxcxcxcxnorm j 332211

222

(4.13)

And square of norm is defined as

cxcxcxcxnorm j 332211

2222

2

(4.14)

The computation of square of norm needs 4 steps using FSM description shown in

Figure 4.14.

x_data_1

x_data_2

x_data_3

-c_data_1

-c_data_2

-c_data_3

S 0 S 1 S 2 S 3

norm_out

Figure 4.14: State diagram of FSM for describing the norm

2. Exponential function

Using Maclaurin series solution to estimate exponential function as follow

!!3!211

!

32

0

)(

n

xxxx

n

xe

n

n

n

x

(4.15)

Hardware design algorithm to compute this formula is illustrated by FSM in Figure 4.15.

Inputs and outputs of the block of exponential function:

Clk : clock signal with frequency 50MHz

en : enable signal

data_in : the input of data

order_in : the input of order

exp : the result of exponential function

45

1/m

M=1,2,3...n

If m=order

TIME+TIME+1Section=1

(to S1)

1xd 1xeout

xd xeout xeout

then

else

order

e in

80001

80001

x

xd

e out

m

S 0 S 1

1 xx ee outout

S 2

1 xdxd

S 3 S 4

Figure 4.15: State diagram of FSM for describing the exponential function

clk

en

data_in[19..0]

order_in[5..0]

exp[19..0]

exponential

inst2

Figure 4.16: The block of exponential function

4.3.3.2 Training of Radial Basic Function

Iterative algorithm for training RBF NN is as follow:

khkekwkw jjj 1 (4.16)

kb

kckxkhkwkekckc

j

jii

jjjiji2

1

(4.17)

kb

kckxkhkwkekbkb

j

jjjj

jii

3

2

1

(4.18)

All steps to compute the training RBF are shown in Figure 4.17, in which Steps

SS 5451~ describe update RBF w; steps SS 5655

~ describe update RBF b; steps

SS 6957~ describe update RBF c1, c2, and c3.

46

÷

÷

÷

÷

h

lr

target

-total_result

Ihe

w(k-1)

w(k)

2b_p2(k-1)>>1

b(k-1)exp_in

w(k-1)

Ihew

b(k-1)

b(k)

S 51 S 52 S 53 S 54 S 55 S 56 S 57

update RBF w update RBF b

x1

-c1(k-1)

2b_p2(k-1)>>1 Ihew c1(k-1)

c1(k)

x2

-c2(k-1)

2b_p2(k-1)>>1 Ihew c2(k-1)

c2(k)

S 57 S 58 S 59 S 60 S 61 S 62 S 63 S 64 S 65

update RBF c1 update RBF c2

x3

-c3(k-1) 2b_p2(k-1)>>1 Ihew c3(k-1)

c3(k)

S 65 S 66 S 67 S 68

133

122

111

1

1

kckc

kckc

kckc

kbkb

kwkw

S 69

update RBF c3

Figure 4.17: State diagram of FSM for describing the training RBF NN

4.3.3.3 Jacobian

Jacobian is defined as follow:

b

chw

j

j

j

jj

kuJacobian

2

13

1

(4.19)

Figure 4.18 uses 5 steps to describe the computation of Jacobian transformation.

47

÷

b(k-1)

b(k-1)

c1(k-1)

-x1

h w(k-1)

jacob

S 69 S 70 S 71 S 72 S 73

Figure 4.18: State diagram of FSM for describing jacobian

4.3.4 Adjusting Mechanism

The formula to adjust fuzzy parameters is computed as follow:

))(

(**)(*)(*)(2

1

1

,,

j

j

j

l

j

jmnipnmb

kuchwdkkkekc

(4.20)

The computation of this formula includes 8 steps using FSM description and shown

in Figure 4.19.

S104 S105 S106 S107 S108 S109 S110 S111

α

e(k) jacobian

d ij, cji,

c ji,

d ij ,1

cji 1,

d ij 1,

c ji 1,

c ji ,1

c ji ,1

d ij 1,1 c ji 1,1

c ji 1,1

kp

ki

Figure 4.19: State diagram of FSM for describing jacobian

48

Chapter 5

Software realization of the motion trajectory for

linear X-Y table

Figure 5.1 illustrates the internal architecture of the proposed FPGA

implementation of the position neural fuzzy controller IP, the speed controller and plant

IP for linear X-Y table. The FPGA chip adopted herein is Altera Stratix II

EP2S60F672C5 with 48,352 ALUTs, maximum 492 user I/O pins, 36 DSP blocks,

2,544,192 bits of RAM. The Nios II embedded processor has a 32-bit configurable CPU

core. The internal circuit in Figure 5.1 comprises a Nios II embedded processor IP

(Intelligent Properties) and an application IP. The application IP (hardware) includes the

circuits of X axis and Y axis. Each one axis includes the position controller (NFC),

speed P controller and PMLSM plant IP. And the Nios II processor performs the

function of generating the motion trajectory, collecting the response data and the

communication with external device by software. The operating clock rate of the

designed FPGA controller is 50 MHz, and the frequency divider generates 50MHz (Clk),

12.5MHz (Clk-step), and 5MHz (Clk-plant).

Figure 5.1: The architecture of a motion controller for X-Y table

49

The FPGA utility of overall motion control IC for X-Y table in Figure 5.1 is

evaluated. The results are listed in Table 3.1, which presents that the overall circuits of

the proposed motion control IC including a Nios II embedded processor IP (40,877 LEs

and 571,136 RAM bits), use 85% LEs resource and 37% RAM resource of a Stratix II

EP2S60.

Table 5.1 Utility evaluation of motion control IC for Linear X-Y table in FPGA

5.1 The Nios II software

The Nios II software development environment in Figure 5.2 is called Nios II

Integrated Development Environment (IDE). The Nios II IDE is based on the GNU

C/C++ compiler and the Eclipse IDE, and it provides an established environment for

software development.

50

Figure 5.2: Nios II IDE development system diagram

Many embedded systems require Interrupt Service Routines (ISRs) to process

external hardware interrupts in a timely manner. The CPU runs the ISR after it is

interrupted. The Nios development kits include software subroutines that make it easy

to implement ISRs in your Nios system. These routines allow you to spend your time

writing the ISR instead of working on the overhead necessary to set up the ISR. For

example, one line of C code installs the ISR and saves and restores the context when the

interrupt occurs.

Exceptions interrupt the processor: they stop the current operation to take care of

something more important. Different sources can cause exceptions, including external

hardware, direct software interrupts, and internal exceptions during normal execution of

code. Figure 5.3 illustrates a simple case of what happens in most embedded systems

when an exception occurs

1. Save the current state (context)

2. Retrieve the ISR address from vector table based on the interrupt number

3. Jump to the ISR routine and run to completion

4. Restore saved context.

5. Resume program

51

Figure 5.3: Exception handling process

Figure 5.4: Typical initialization settings 2 kHz interrupts

The Nios II processor IP used in our proposed system performs the function of

motion trajectory in software. The clock frequency of the Nios II processor is 50MHz.

Figure 5.5 illustrates the flow charts of the main program and the interrupt service

routine (ISR), where the interrupt interval is designed with 0.5ms. All programs are

coded in the C programming language.

52

Figure 5.5: Flow chart of main and ISR program

5.2 Motion trajectory[36]

The motion trajectory is very important to control the X–Y table. In practical

applications, the motion commands of X-axis and Y-axis are designed individually

through motion trajectory to achieve two dimensions motion control. This section will

present the motion trajectory planning for X-Y table, including one axis control point-

to-point motion trajectory and two axis of the motion trajectory planning which the

circle, flexuous, star and window motion trajectory are used to evaluate the motion

control performance of the proposed NFC control system in X-Y table.

5.2.1 Point to Point motion trajectory

The motion trajectory of a linear motor is based on the point-to-point motion

control scheme with a trapezoidal constant acceleration/deceleration velocity profile

shown in Figure 5.6. In this scheme, the designed parameters are the overall

displacement x p (millimeters), the maximum velocity W (millimeters per second), the

acceleration and deceleration periodT acc, and the sampling interval td. Therefore, based

53

on the velocity profile in Figure 5.6, the command of instantaneous position, x pat each

sampling interval can be determined by the following procedure.

Step 1: Computation of the overall running time. First, compute the running

time without considering acceleration/deceleration:

WxT p/

1 (5.1)

This T 1must exceed acceleration timeT acc

. Next, the acceleration/deceleration

design is considered, and the overall running time is

TTTT accaccMAX ,

10 (5.2)

Step 2: Adjustment of the overall running time to meet the condition of multiple

of the sampling interval.

tTtT ddaccNandN //

0 (5.3)

Where N is the interpolation number and [ ] refers to the Gauss function with

integer output. Therefore,

tTtT ddaccNandN *'* '' 0

(5.4)

Step 3: Modification of the maximum velocity

TTx accpW

0/ (5.5)

Step 4: Calculation of the acceleration/deceleration

T accWA / (5.6)

Step 5: Calculation of the position command at the mid-position

a) Acceleration region:

txx Arop

2*

**2

1 (5.7)

Where t dnt * , 0 < n ≤ N’, and x ro

is the initial position.

b) Constant speed region:

tWxx rp'*

1

*

(5.8)

Where t dnt * , Nn

10 , and x r 1

is the final position in the

acceleration region and '*21

NNN .

c) Deceleration region:

txx AtW

rp

2

2

*

**2

1'* (5.9)

where t dnt * , 0 < n ≤ N and x r 2

is the final position in the constant speed region.

54

Figure 5.6: Point-to-point trapezoidal velocity profile

5.2.2 Circular motion trajectory

A circular trajectory is shown in Figure 5.7 and its equation is described as

follows:

)cos(

)sin(

1

ii

ii

ii

ry

rx

(5.10)

Where is the variation value of the angle; r is the radius of the circle;i

x is the

motion command of the X-axis; i

y is the motion command of the Y-axis.

Figure 5.7: Circular motion trajectory

55

5.2.3 Star motion trajectory

The star trajectory is shown in Figure 5.8 and can be divided into six parts from

a to f. The star trajectory can be described as follows:

a trajectory:

1

1

ii

ii

yy

xSx (5.11)

b trajectory:

1

0

1

0

36sin

54sin

ii

ii

ySy

xSx (5.12)

c trajectory:

1

0

1

0

72sin

18sin

ii

ii

ySy

xSx (5.13)

d trajectory:

1

0

1

0

72sin

18sin

ii

ii

ySy

xSx (5.14)

e trajectory:

1

0

1

0

36sin

54sin

ii

ii

ySy

xSx (5.15)

Where S is a constant and the size of the trajectory can be changed with different value

of S; xi is the motion command of the X-axis; yi is the motion command of the Y-axis.

Figure 5.8: Star motion trajectory

56

5.2.4 Window motion trajectory

The window trajectory is shown in Figure 5.9 and can be divided into 9 parts

from a to i. The window trajectory can be described as follows:

1ii

(5.16)

a trajectory:

1

1

ii

ii

ySy

xx (5.17)

b trajectory: )24

6:(

i

)sin(

)cos(

1

1

iyi

ixi

rOy

rOx

(5.18)

c trajectory:

1

1

ii

ii

yy

xSx (5.19)

d trajectory: )4

6:(

i

)sin(

)cos(

2

2

iyi

ixi

rOy

rOx

(5.20)

e trajectory:

1

1

ii

ii

ySy

xx (5.21)

f trajectory: )2

1:(

i

)sin(

)cos(

3

3

iyi

ixi

rOy

rOx

(5.22)

g trajectory:

1

1

ii

ii

yy

xSx (5.23)

h trajectory: )2

10:(

i

)sin(

)cos(

4

4

iyi

ixi

rOy

rOx

(5.24)

57

i trajectory:

1

1

ii

ii

ySy

xx (5.25)

Where S is also a constant and the size of the trajectory can be changed with different

value of S, and the tracking speed of the trajectory can be changed with the value of .

According to trajectory function, the window trajectory can be generated by the

accumulation of the angle with the changing of time.

Figure 5.9: Window motion trajectory

5.2.5 Flexuous motion trajectory

The flexuous trajectory is shown in Figure 5.10 and can be divided into 7 parts

from a to g. The flexuous trajectory can be described as follows:

1ii

(5.26)

a trajectory:

1

1

ii

ii

yy

xSx (5.27)

b trajectory: )2

3

2

1:(

i

)sin(

)cos(

1

1

iyi

ixi

rOy

rOx

(5.28)

c trajectory: )2

1

2

1:(

i

58

)sin(

)cos(

2

2

iyi

ixi

rOy

rOx

(5.29)

d trajectory:

1

1

ii

ii

yy

xSx (5.30)

e trajectory: )2

1

2

3:(

i

)sin(

)cos(

3

3

iyi

ixi

rOy

rOx

(5.31)

f trajectory: )2

3

2

1:(

i

)sin(

)cos(

4

4

iyi

ixi

rOy

rOx

(5.32)

g trajectory:

1

1

ii

ii

yy

xSx (5.33)

Where S is also a constant and the size of the trajectory can be changed with different

value of S, and the tracking speed of the trajectory can be changed with the value of .

According to trajectory function, the window trajectory can be generated by the

accumulation of the angle with the changing of time.

Figure 5.10 Flexuous motion trajectory

59

5.3 Perfomance measures[19]

To measure the performance of various controllers, the average tracking error m

and the standard deviation of the tracking error Ts for the motion tracking are defined as

follows:

n

k n

kTm

1

)(

(5.34)

Where )()()(22

kTkTkTyx

And )()()( kdkdkTimii

yxi ,

n

k

sn

mkTT

1

2))((

(5.35)

Where dmi is the command for each axis, di is the feedback for each axis; Ti is the error

between the values of command and feedback for each axis. The comparison of the

control performance can be easily shown using the average tracking error. Moreover,

the oscillation of the motion tracking can be evaluated by the standard deviation of the

tracking error.

60

Chapter 6

Simulation results of the motion controller

To prove the effectiveness and correctness of our proposed controller and

motion control IC used in X-Y table; some simulations results by step response and by

the two dimensional motion includes circular, star, window and flexuous motion

trajectory demonstrated in MATLAB and in FPGA are evaluated.

6.1 Simulation in MATLAB

Prior to simulate in FPGA, the simulation in MATLAB is first used to evaluate

the correctness of the proposed controller and motion control IC of the X-Y table. For

this evaluation, the comparison of two controllers includes fuzzy controller and neural

fuzzy controller are carried out.

6.1.1 One dimensional motion trajectory

The architecture of fuzzy controller and neural fuzzy controller for single axis

are respectively shown in Figure 6.1 and 6.2. And the controller parameters are

designed as following figure.

Figure 6.1: Diagram of fuzzy control for PMLSM drive

61

Figure 6.2: Diagram of Neural fuzzy control for PMLSM drive

Firstly, the reference model (RM) is carried out to help the system easy to track the

following command. Second order system is used:

22

2

*2)(

)(

nn

n

p

m

sssx

sx

(6.1)

with selection by 1,/20 sradn

. The discrete model of RM is obtained as follow

by using bilinear transformation at the sampling frequency be 2 kHz.

2

2

1

1

2

2

1

10

1*

1

1)(

)(

zbzb

zazaa

zx

zx

p

m

(6.2)

with a0=0.000098; a1=0.000196; a2=0.000098; b1=-1.960396; b2=0.960788

Secondly, according to our experience, the initial fuzzy rule table is chosen in Figure

6.3.

Figure 6.3: Membership functions, fuzzy rule table and control effort surface

62

and Ke, Kde, Ku in Fig 6.1 and Fig 6.2 are chosen as 2, 500, and 1, respectively.

In Figure 6.3, the output of FC is calculated by

mn

i

in

j

jm

nmi

in

j

jm

BA

i

in

j

jm

BAnm

fdc

dee

deec

deeu

mn

mn

,

1 1

,1 1

1 1

,

*

)(*)(

)(*)(

),(

(6.3)

The output of PI type fuzzy controller is:

)(*)()1()( kukkkukufipi

(6.4)

Thirdly, RBF network is designed with 3-3-1 structure In Figure 6.4. This structure has

three inputs in an input layer, chose three neurons in hidden layer and one output in an

output layer. The initial parameters in wj, bj, cj are selected as follow

The weight from the hidden layer neuron to the output layer neuron

5.05.05.0

jw

(6.5)

The width of 3 neurons:

5.05.040

jb

(6.6)

The center of 3 RBF unit:

5.05.040

5.05.040

5.05.040

jc

(6.7)

and the learning rate of neural network is chosen 5.0

The RBF neural network will supply Jacobian information to adjust fuzzy parameters.

Further, the formulation of output of RBF neural network and Jacobian are:

b

cxwhwy

jj

j

j

jjrbf

j

2

2

3

1

3

1 2exp (6.8)

3

1

2

1

1)(

j j

j

jjb

kuchwJacobian (6.9)

63

x1

exp

x3

x2

exp

exp kxe

kyrbf

ke

w1

w2

w3

Output

layerHidden

layer

Input

layer

3 3 1

)(ku

)( kx

)1( kx

Figure 6.4: Radial basis function neural network

Two tested cases with different PMLSM parameters in (6.10) are considered to evaluate

the controller performance, in which we have the following cases.

Case 1: Light-load condition

Kt = 64, Mm = 1, Bm = 0.1

Case 2: Heavy-load condition (6.10)

Kt = 64, Mm = 7, Bm = 0.7

The PI gains are chosen by Kp = 5 and Ki = 0.09 and the learning rate α is set as 0.07.

Square-wave step response is used as a tested input command. Compare the tracking

performance of the aforementioned two controllers at various system conditions. The

system parameters are initially designed at the light-load condition in case 1 then

changed to the heavy-load condition in case 2 after 2s. Therefore, under the

aforementioned designed condition, the simulation results are shown in Figure 6.5 and

Figure 6.6. In Figure 6.5, the mover position has a good following response at the light-

load condition by using the Fuzzy controller. However, after 2 s, when the system

parameters change to the heavy-load condition, about 8.7% overshoot by using the

fuzzy controller, as shown in Fig. have occurred. It reveals that FC is affected by the

various loads. To cope with this problem, an NFC is adopted, and its simulation result is

shown in Figure 6.6. In the case 2 condition, initially, the mover of PMLSM track the

output of the RM with oscillation and only 0.9% overshoot, while the parameters of ci,j

in Figure 6.7 are continuously tuned to reduce the error between the output of the RM

and the position of the mover at each control sampling interval. After one square-wave

position commands have been tracked, the ci,j parameters shown in Table 6.1 are tuned

to adequate values, and the position of the mover can accurately track the output of the

RM.

64

Figure 6.5: Position response and control effort when using FC

(simulation in MATLAB)

Figure 6.6: Position response and control effort when using NFC

(simulation in MATLAB)

65

Figure 6.7: Rule table after adjusted and the control effort surface for

Step response with neuron fuzzy controller (simulation in MATLAB)

6.1.2 Two dimensional motion trajectory

6.1.2.1 FC using in position loop (simulation in MATLAB)

This section shows the simulation results of the motion controller for the X-Y

table by using Fuzzy controller in position loop. The architecture of FC is shown in

Figure 6.8. The parameters of FC are used the same parameters using in section 6.1.1.

Initial controller parameters in X axis and Y axis are selected the same and the

parameters of plant are initialled as follow

X axis: Kt = 64, Mm =7, Bm = 0.7

Y axis: Kt = 64, Mm = 5, Bm = 0.5

The simulation results shown in Figure 6.9 ~Figure 6.12. In the circular trajectory result,

we can find in some locations of the position response not follow to the command

position; in the window trajectory, the position response doesn’t track to the command

position in the bend and the straight line; in the corner of star trajectory, the tracking is

better than in the band of the window trajectory and in the band of the flexuous

trajectory has poor tracking. Finally, the tracking errors of the trajectory motion

response include the average tracking error and the standard deviation errors are shown

in table 6.1.

66

Figure 6.8: Diagram of fuzzy control for linear X-Y table

-6 -4 -2 0 2 4 6-6

-4

-2

0

2

4

6

X-axis Position

Y-a

xis

Positio

n

0 0.5 1 1.5 2 2.5 3-10

0

10

X-a

xis

Positio

n

0 0.5 1 1.5 2 2.5 3-10

0

10

Time

Y-a

xis

Positio

n

0 1 2 3-50

0

50

X-a

xis

Iq

0 1 2 3-50

0

50

Time

Y-a

xis

Iq

0 1 2 3-0.5

0

0.5

X-a

xis

positio

n e

rror

0 1 2 3-0.5

0

0.5

Time

Y-a

xis

positio

n e

rror

(b)

(d)

(a)

(c)

Figure 6.9: FC using circular trajectory tracking response (Simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

67

-0.5 0 0.5 1 1.5 2 2.5 3-2

-1.5

-1

-0.5

0

0.5

1

1.5

X-axis Position

Y-a

xis

Pos

ition

0 1 2 3 4 5-4

-2

0

2

4

X-a

xis

Pos

ition

0 1 2 3 4 5-4

-2

0

2

4

Time

Y-a

xis

Pos

ition

0 1 2 3 4 5-40

-20

0

20

40

X-a

xis

Iq

0 1 2 3 4 5-40

-20

0

20

40

Time

Y-a

xis

Iq

0 1 2 3 4 5-0.1

0

0.1

X-a

xis

posi

tion

erro

r

0 1 2 3 4 5-0.1

0

0.1

Time

Y-a

xis

posi

tion

erro

r

(a) (b)

(d)(c)

Figure 6.10: FC using star trajectory tracking response (Simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

-1 0 1 2 3 4 5-3

-2

-1

0

1

2

3

X-axis Position

Y-a

xis

Pos

ition

0 1 2 3 4 5 6-5

0

5

X-a

xis

Pos

ition

0 1 2 3 4 5 6-5

0

5

Time

Y-a

xis

Pos

ition

0 1 2 3 4 5 6-50

0

50

X-a

xis

Iq

0 1 2 3 4 5 6-50

0

50

Time

Y-a

xis

Iq

0 1 2 3 4 5 6-0.1

0

0.1

X-a

xis

posi

tion

erro

r

0 1 2 3 4 5 6-0.1

0

0.1

Time

Y-a

xis

posi

tion

erro

r

(a) (b)

(d)(c)

Figure 6.11: FC using window trajectory tracking response (Simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

68

1 2 3 4 50.5

1

1.5

2

2.5

3

3.5

X-axis Position

Y-a

xis

Positio

n

0 1 2 3 40

2

4

6

X-a

xis

Positio

n

0 1 2 3 40

2

4

6

Time

Y-a

xis

Positio

n

0 1 2 3 4-50

0

50

X-a

xis

Iq

0 1 2 3 4-20

0

20

Time

Y-a

xis

Iq

0 1 2 3 4-0.1

0

0.1

X-a

xis

positio

n e

rror

0 1 2 3 4-0.1

0

0.1

Time

Y-a

xis

positio

n e

rror

(a)

(c) (d)

(b)

Figure 6.12: FC using flexuous trajectory tracking response (Simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Table 6.1: The tracking error of trajectory response in case using FC

(Simulation in MATLAB)

6.110.00420.0108

6.100.00050.0062

6.90.00120.0135

Figure

Circular

Standard

deviation

The error values of the response trajectory and the command

trajectory when using Fuzzy controller

Average errrorTrajectory

planing

Star

Window

Flexuous 6.120.00070.0053

69

6.1.2.2 Neural fuzzy controller using in position loop

The architecture of NFC is shown in Figure 6.13. The parameters of NFC are

used the same parameters using in section 6.1.1. Initial controller parameters in X axis

and Y axis are selected the same and the parameters of plant are initialled in FC. The

simulation results shown in Figure 6.14 ~Figure 6.17. In the simulation result, we can

see the position response close to the command position; and in the bend and the

straight line; in the corner of the trajectories, the tracking is better than using FC. The

tables 6.2~6.5 show the ci,j parameters are tuned to adequate values, and the position of

the mover can accurately track the command position. Finally, the tracking errors of the

trajectory motion response include the average tracking error and the standard deviation

errors are shown in table 6.6.

Figure 6.13: Diagram of neural fuzzy control for linear X-Y table

70

-6 -4 -2 0 2 4 6-6

-4

-2

0

2

4

6

X-axis Position

Y-a

xis

Pos

ition

0 0.5 1 1.5 2 2.5 3-10

0

10

X-a

xis

Pos

ition

0 0.5 1 1.5 2 2.5 3-10

0

10

Time

Y-a

xis

Pos

ition

0 0.5 1 1.5 2 2.5 3-50

0

50

X-a

xis

Iq

0 0.5 1 1.5 2 2.5 3-50

0

50

Time

Y-a

xis

Iq

0 0.5 1 1.5 2 2.5 3-0.5

0

0.5

X-a

xis

posi

tion

erro

r

0 0.5 1 1.5 2 2.5 3-0.5

0

0.5

Time

Y-a

xis

posi

tion

erro

r

(c)

(a) (b)

(d)

Figure 6.14: NFC using circular trajectory tracking response (simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Table 6.2: The rule table after adjusted in the circular simulation case

(Simulation in MATLAB)

71

-0.5 0 0.5 1 1.5 2 2.5 3-2

-1.5

-1

-0.5

0

0.5

1

1.5

X-axis Position

Y-a

xis

Positio

n

0 1 2 3 4 5-4

-2

0

2

4

X-a

xis

Positio

n

0 1 2 3 4 5-4

-2

0

2

4

Time

Y-a

xis

Positio

n

0 1 2 3 4 5-50

0

50

X-a

xis

Iq

0 1 2 3 4 5-50

0

50

Time

Y-a

xis

Iq

0 1 2 3 4 5-0.1

0

0.1

X-a

xis

positio

n e

rror

0 1 2 3 4 5-0.1

0

0.1

Time

Y-a

xis

positio

n e

rror

(a)

(c)

(b)

(d)

Figure 6.15: NFC using star trajectory tracking response (simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Table 6.3: The rule table after adjusted in the star simulation case

(Simulation in MATLAB)

72

-1 0 1 2 3 4 5-3

-2

-1

0

1

2

3

X-axis Position

Y-a

xis

Pos

ition

0 1 2 3 4 5 6-5

0

5

X-a

xis

Pos

ition

0 1 2 3 4 5 6-5

0

5

Time

Y-a

xis

Pos

ition

0 1 2 3 4 5 6

-50

0

50

X-a

xis

Iq

0 1 2 3 4 5 6-50

0

50

Time

Y-a

xis

Iq0 1 2 3 4 5 6

-0.1

0

0.1

X-a

xis

posi

tion

erro

r

0 1 2 3 4 5 6-0.1

0

0.1

Time

Y-a

xis

posi

tion

erro

r

(a) (b)

(c) (d)

Figure 6.16: NFC using window trajectory tracking response (simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Table 6.4: The rule table after adjusted in the window simulation case

(Simulation in MATLAB)

73

1 2 3 4 50.5

1

1.5

2

2.5

3

3.5

X-axis Position

Y-a

xis

Positio

n

0 1 2 3 40

2

4

6

X-a

xis

Positio

n

0 1 2 3 40

2

4

6

Time

Y-a

xis

Positio

n

0 1 2 3 4-50

0

50

X-a

xis

Iq

0 1 2 3 4-20

0

20

Time

Y-a

xis

Iq

0 1 2 3 4-0.1

0

0.1

X-a

xis

positio

n e

rror

0 1 2 3 4-0.1

0

0.1

Time

Y-a

xis

positio

n e

rror

(a) (b)

(c) (d)

Figure 6.17: NFC using flexuous trajectory tracking response (simulation in MATLAB)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Table 6.5: The rule table after adjusted in the flexuous simulation case

(Simulation in MATLAB)

74

Table 6.6: The tracking error of trajectory response in case using NFC

(Simulation in MATLAB)

6.160.00540.0125

6.150.00070.0078

6.140.00170.0182

Figure

Circular

Standard

deviation

The error values of the response trajectory and the command

trajectory when using Neural Fuzzy controller

Average errrorTrajectory

planing

Star

Window

Flexuous 6.170.00350.0098

6.1.2.3 Tracking performance analysis when simulation in MATLAB

The index values in (5.34) and (5.35) are used, to evaluate the trajectory tracking

performance of FC and NFC. Figure 6.18 and Figure 6.19 show the average tracking

error and tracking error of the standard deviation while controllers using FC and NFC in

X-Y table, respectively. From the performance analysis of the average error in tracking,

the circular trajectory of the neural fuzzy controller is better than fuzzy controller with

decrease about 36%; the window trajectory of the neural fuzzy controller is lower than

fuzzy controller about 14%, the star trajectory of neural fuzzy controller is better than

fuzzy controller by reduction about 21% and the flexuous trajectory about 46%. In the

standard deviation tracking error, the circular trajectory of neural fuzzy controller is

lower than fuzzy about 30%, the window trajectory of the neural fuzzy controller is

lower than about 22%; star tracking of the neural fuzzy controller than is reduced by

about 29% with star tracking of the fuzzy controller and about 46% with flexuous

tracking.

75

Figure 6.18: Average of the tracking error (simulation in MATLAB)

Figure 6.19: Standard deviation of the tracking error (simulation in MATLAB)

76

6.2 Simulation in FPGA

After verifying the effectiveness of our proposed control algorithm for X-Y table

in MATLAB, the simulation in FPGA is further evaluated. However, the control system

architectures in Figure 6.1, Figure 6.2 and Figure 6.8 are used to evaluate the

performance of FC and NFC. The motion trajectory command is implemented by

software using Nios II and the other parts including the neural fuzzy controller for

position loop, speed loop and plant model are implemented by hardware in FPGA. In

simulation, the sampling frequency is chosen to 2 kHz by hardware in FPGA and the

clock frequency of Nios II processor is 50MHz.

6.2.1 One dimensional motion trajectory

In this section, present simulation in FPGA for single axis with two architectures

includes FC and NFC. The parameters are chosen as follow

- According to our experience, the membership functions of two inputs and initial rule

table of FC are shown in Figure 6.20.

Figure 6.20: Rule table and the control effort surface (Simulation in FPGA)

µ(e)

A0 A1 A2 A3 A4 A5 A6

-600 -400 -200 0 200 400 600

e

µ(d

e)

1B

0B

1B

2B

3B

4B

5B

6

-30

--2

0-

10

01

02

03

0

de

- 900 - 900 - 900 - 900 - 600 - 300 0

- 900 - 900 - 900 - 600 - 300 0 300

- 900 - 900 - 600 - 300 0 300 600

- 900 - 600 - 300 0 300 600 900

- 600 - 300 0 300 600 900 900

- 300 0 300 600 900 900 900

0 300 600 900 900 900 900

77

- The initial parameters of RBF neural network structure are selected as follow

The weight from the hidden layer neuron to the output layer neuron

0028.00028.00028.0j

w (6.11)

The width of 3 neurons:

0038.00038.00038.0j

b (6.12)

The center of 3 RBF units:

0028.00028.000019.0

0028.00028.000019.0

0028.00028.000019.0

jc

(6.13)

- The specific values of parameters in control loops are as follow

Position loop: Kp=0.91 and Ki=0.004; Learning rate of fuzzy: 0.001; Learning rate of

neural: 0.0095; Speed loop : Kp=0.91

As the same with the simulation in MATLAB, two tested cases with different PMLSM

parameters are considered to evaluate the controller performance. The cases as follow

Case 1: Ψ =0.018; Ф=0.8; rate=0.8

Case 2: Ψ =0.018; Ф=0.5; rate=0.8

The simulation results are shown in Figure 6.21 and Figure 6.22. In Figure 6.21, the

mover position has a good following response at the case 1 condition by using the FC.

When the system parameters change to the case 2 condition, about 9% overshoot as

shown in Figure 6.21 have occurred. It reveals that FC is affected by the various plant

parameters. However, when NFC is used in the case 2 condition, the mover of PMLSM

track the output of the RM well with little oscillation and only 0.6% overshoot, which is

shown in Figure 6.22. Further, the parameters of ci,j can be continuously tuned to reduce

the error between the output of the RM and the position of the mover at each control

sampling interval. After one square-wave position commands have been tracked, the ci,j

parameters shown in Figure 6.23 are tuned to adequate values, and the position of the

mover can accurately track the output of the RM.

78

Figure 6.21: Step response and control effort when using FC (simulation in FPGA)

Figure 6.22: Step response and control effort when using NFC (simulation in FPGA)

79

Figure 6.23: Rule table after adjusted and the control effort surface for

Step response (simulation in FPGA)

6.2.2 Two dimensional motion trajectory

6.2.2.1 FC using in position loop (simulation in FPGA)

This section shows the FPGA simulation results of the motion controller for the

X-Y table by using Fuzzy controller in position loop. The parameters of FC are used the

same parameters using in section 6.2.1. Initial controller parameters in X axis and Y

axis are selected as follow

- Position loop: Kp=0.91 and Ki=0.0006; Learning rate of fuzzy: 0.001; Learning rate of

neural: 0.0095; Speed loop : Kp=0.91

- The parameters of plant are initialed as follow

X axis: Ψ =0.02; Ф=0.5; rate=0.8

Y axis: Ψ =0.02; Ф=0.75; rate=0.9

The simulation results shown in Figure 6.24 ~Figure 6.27. We also can find in some

locations of the position response in the results not follow to the command position such

as in the bend and the straight line of window trajectory response; in the corner of star

trajectory and in the band of the flexuous trajectory has poor tracking. The Table 6.1

shows the tracking errors of the trajectory motion response include the average tracking

error and the standard deviation errors.

80

Figure 6.24: FC using circular trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Figure 6.25: FC using star trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

81

Figure 6.26: FC using window trajectory tracking response (simulation in FPGA)

Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Figure 6.27: FC using flexuous trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

82

Table 6.7: The tracking error of trajectory response in the case using FC

(Simulation in FPGA)

6.260.004222.4074

6.250.000523.5104

6.240.001240.8001

Figure

Circular

Standard

deviation

The error values of the response trajectory and the command

trajectory when using Fuzzy controller

Average errrorTrajectory

planing

Star

Window

Flexuous 6.270.000714.7543

6.2.2.2 NFC using in position loop (simulation in FPGA)

Using NFC in position loop is present in this section and the parameters of NFC

are used the same parameters using in section 6.1.1. The initial controller parameters in

X axis and Y axis are selected the same and the parameters of plant are initialed in FC.

Figure 6.28 ~Figure 6.34 show the simulation results, rule table after adjusted and the

control effort surface for motion trajectories, respectively. We also can see the position

response close to the command position; and in the bend and the straight line; in the

corner of the trajectories, the tracking is better than using FC as the same with the

simulation in MATLAB.

83

Figure 6.28: NFC using circular trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Figure 6.29: Rule table after adjusted and the control effort surface for

Circular motion trajectory

84

Figure 6.30: NFC using star trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Figure 6.31: Rule table after adjusted and the control effort surface for

star motion trajectory

85

Figure 6.32: NFC using circular trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Figure 6.33: Rule table after adjusted and the control effort surface for

Window motion trajectory

86

Figure 6.34: NFC using flexuous trajectory tracking response (simulation in FPGA)

(a) Trajectory response (b) Axis response (c) Axis control effort (d) Tracking error

Figure 6.35: Rule table after adjusted and the control effort surface for

Flexuous motion trajectory

87

Table 6.8: The tracking error of trajectory response in the case using NFC

(Simulation in FPGA)

6.3216.674515.3015

6.3016.672613.9198

6.2828.692726.8106

Figure

Circular

Standard

deviation

The error values of the response trajectory and the command

trajectory when using Neural Fuzzy controller

Average errrorTrajectory

planing

Star

Window

Flexuous 6.3413.5910.3505

6.2.2.3 The X-Y table motion trajectory tracking performance analysis

For the detail comparison of the control performance of various controllers, the

performance measures of the Fuzzy controller and neural fuzzy controller are depicted

in Figure 6.36 and Figure 6.37. Figure 6.36 demonstrates the average tracking errors of

two controllers, and Figure 6.37 demonstrates the standard deviation of tracking errors

of two controllers with simulation results in FPGA. From the performance analysis of

the average error in tracking, the circular trajectory of the neural fuzzy controller is

better than fuzzy controller with decrease about 5%; the window trajectory of the neural

fuzzy controller is lower than fuzzy controller about 22%, the star trajectory of neural

fuzzy controller is better than fuzzy controller by reduction about 20% and the flexuous

trajectory about 32%. In the standard deviation tracking error, the circular trajectory of

neural fuzzy controller is lower than fuzzy about 7%, the window trajectory of the

neural fuzzy controller is lower than about 10%; star tracking of the neural fuzzy

controller than is reduced by about 18% with star tracking of the fuzzy controller and

about 29% with flexuous tracking.

88

Therefore, we can easily find that the proposed neural fuzzy controller has the least

average and standard deviation of tracking error and is more suitable to control the X-Y

table under the occurrence of uncertainties at various reference trajectories.

Figure 6.36: The average tracking error (simulation in FPGA)

Figure 6.37: Standard deviation of the tracking error (simulation in FPGA)

89

Chapter 7

Conclusion and future works

7.1 Overview

A motion control IC using a neural fuzzy controller for X-Y table based on

FPGA technology is successfully demonstrated in this thesis. The work herein is

summarized as follows.

1. The functionalities required to build a digital motion controller of X-Y table, such as

two RBF Neural-fuzzy controllers and one motion trajectory planning, have been

integrated in one FPGA chip.

2. The behavior of a Neural-fuzzy controller has been successfully described by VHDL,

and proven with a well motion trajectory performance in X-Y table.

However, the simulation results by step response, point to point motion control

tracking, circular, window, star and flexuous motion trajectory tracking in MATLAB

and in QUARTUS II software environment have been revealed that the software and

hardware co-design technology with the parallel processing well in the motion control

system of X-Y table.

7.2 Future works

The following research work can be studied in the future:

1. Fuzzy membership function can be tuned based on RBF NN identification, or fuzzy

membership function can adopt Gauss function.

2. Implement high sampling rate in the position loop to increase controller performance

is possible in the further study.

3. Apply this proposed control algorithm for X-Y table experimental system or XYZ

table.

90

REFERENCES

[1] T. H. Liu, Y. C. Lee and Y. H. Chang, “Adaptive controller design for a linear

motor control system,” in IEEE Trans. on Aerospace and Electronics System,

vol. 40, no.2, pp. 601-613, Apr. 2004.

[2] F. J. Lin and P. H. Shen, “Robust Fuzzy Neural Network Sliding-Mode Control

for Two-Axis Motion Control System,” in IEEE Trans. on Industrial Electronic ,

vol. 53, no.4, pp. 1209-1225, Aug. 2006.

[3] Dai Fuyu, Cai Xing’an, and Chen Jiasheng, “SOPC-based servo control system

for the XYZ Table,” in Nios II Embedded Processor Design Contest, 2005.

[4] M. P. Groover, Fundamentals of Modern Manufacturing: Materials, Process,

and Systems. Upper Saddle River, NJ: Prentice-Hall, 1996.

[5] H. Lim, J. W. Seo, and C. H. Choi, “Position control of XY table in CNC

machining center with nonrigid ballscrew,” in Proc. Amer. Control

Conf.,Chicago, IL, 2000, pp. 1542–1546.

[6] E. C. Park, H. Lim, and C. H. Choi, “Position control of X-Y table at velocity

reversal using presliding friction characteristics,” IEEE Trans. Control Syst.

Technol., vol. 11, no. 1, pp. 24–31, Jan. 2003.

[7] E. C. Park, H. Lim, and C. H. Choi, “Position control of X-Y table at velocity

reversal using presliding friction characteristics,” IEEE Trans. Control Syst.

Technol., vol. 11, no. 1, pp. 24–31, Jan. 2003

[8] F. Gieras and Z. J. Piech, “Linear synchronous motors-transportation and

automation systems,” in CRC Press, 2000.

[9] P. K. Budig, “The application of linear motors,” in Proceedings, PIEMC 2000,

the 3rd international, 2000, vol. 3, pp.1336-1340.

91

[10] G. W. McLean, “Review of recent progress in linear motors,” in IEE

Proceedings, Part B, vol. 135, no. 6, pp.380-416, Nov. 1988.

[11] M. Sanada, S. Morimoto, and Y. Takeda, “Interior permanent magnet linear

synchronous motor for high-performance drives,” IEEE Trans. Ind. Appl., vol.

33, no. 4, pp. 966–972, Jul./Aug. 1997.

[12] C. J. Kempf and S. Kobayashi, “Disturbance observer and feedforward design

for a high-speed direct-drive positioning table,” IEEE Trans. Control Syst.

Technol., vol. 7, no. 5, pp. 513–526, Sep. 1999.

[13] F. J. Lin, C. H. Lin, and C. M. Hong, “Robust control of linear synchronous

servo drive using disturbance observer and recurrent neural network

compensator,” Proc. Inst. Elect. Eng.—Electr. Power Appl., vol. 147, no. 4, pp.

263–272, 2000.

[14] F. J. Lin, R. J. Wai, and C. M. Hong, “Hybrid supervisory control using

recurrent fuzzy neural network for tracking periodic input,” IEEE Trans. Neural

Netw., vol. 12, no. 1, pp. 68–88, 2001.

[15] S. Sankaranarayanan and F. Khorrami, “Adaptive variable structure control and

application to friction compensation,” in Proc. IEEE CDC Conf. Rec., 1997, pp.

4159–4164.

[16] A. P. Maulana, H. Ohmori, and A. Sano, “Friction compensation strategy via

smooth adaptive dynamic surface control,” in Proc. IEEE CCA Conf. Rec., 1999,

pp. 1090–1095.

[17] C. M. Liaw, R. Y. Shue, H. C. Chen and S. C. Chen, “Development of a linear

brushless dc motor drive with robust position control,” in IEE Proc. Electric

Power Application, vol. 148, no. 2, pp. 111-118, Mar. 2001.

92

[18] Y. Hong and B. Yao, “A globally stable high-performance adaptive robust

control algorithm with input saturation for precision motion control of linear

motor driver system,” IEEE Trans. on Magnetics, vol. 43, no. 10, pp.3868-3871,

2007.

[19] F. Parasility, M. Tursini and D. Zhang, “On-line self-tune of PI controller for

high performance PMSM Drives,” in Proc. IEEE IAS Annual Meeting, 1996, vol.

3, pp.1619-1625.

[20] G. Qingding, H. Qingtao and Q. Yanli, “Neural network real-time IP position

controller on-line design for permanent magnetic linear synchronous motor,” in

Proc. of the 7th International on Advanced motion control, 2002, pp. 386-389.

[21] F. J. Lin, C. H. Lin and P. K. Huang, “Recurrent fuzzy neural network

controller design using sliding-mode control for linear synchronous motor

drive,” IEE proc.- Control Theory Application, vol. 151, no.4, pp. 407-416, July

2004.

[22] S. C. Hsu, C. H. Liu, C. H. Liu and N. J. Wang, “Fuzzy PI controller tuning for

a linear permanent magnet synchronous motor drive,” IECON’01, in Proc. of the

27th Annual Conf. of IEEE Indus. Elect., 2001, vol. 3, pp.1661-1666.

[23] Berenji,H.R. and Khedkar,P., “Learning and Tuning Fuzzy Logic Controllers

Through Reinforcements,“ IEEE Trans. On Neural Networks, Vol.3, No.5,

pp724-740, Sept.1992.

[24] Khalid,M., Omatu,S. and Yusof,R., “Adaptive fuzzy control of a Water Bath

Process with Neural Networks,” Engng. Appl. Artif. Intell., Vol.7, No.1, pp39-52,

1994.

[25] Bogdan,S. and Kovacic,Z., “Fuzzy rule-based adaptive force control of a single

d of mechanisms, “Proc. Of the 1993 Int. Symp. On IntelligentControl, Chicago-

USA, pp469-474, Aug.1993,

93

[26] Skrjanc,I., Kavsek-Biasizzo,K. and Matko,D., “Real-Time Fuzzy Adaptive

Control,” Engng.Appl. Artif. Intell. Vol.10, No.1, pp53-61, 1997.

[27] Lin,C.T., LinC.J. and Lee,C.S., “Fuzzy adaptive learning control network with

on-line neural learning,“ Fuzzy Sets and Systems 71, pp25-45, 1995.

[28] T. S. Radwan, M. A. Rahman, A. M. Osheiba and A. E. Lashine, “Dynamic

analysis of a high performance permanent magnet synchronous motor drive,”

Electrical and Computer Engineering, Canadian Conference on 1996, vol. 2, pp.

611-614.

[29] Brown,M. and Harris,C.J., “A Perspective and Critique of Adaptive Neurofuzzy

Systems used for Modeling and Control Applications,” Int. Journal of Neural

Systems, Vol.6, No.2, pp197-220, June 1995.

[30] Jang,J.R. and Sun,C.T., “Neuro-Fuzzy Modeling and Control,” Proc. Of The

IEEE, Vol.83, No.3, pp378-406, 1995.

[31] Brown,M. and Harris,C.J., “A Perspective and Critique of Adaptive Neurofuzzy

Systems used for Modeling and Control Applications,” Int. Journal of Neural

Systems, Vol.6, No.2, pp197-220, June 1995.

[32] Nie,J. and Linkens,D.A., “Fuzzy-Neural Control: Principles, algorithms and

applications,” Prentice Hall, UK, 1995.

[33] Harris,C.J., Brown,M., Bossley,K.M., Mills,D.J. and Ming,F., “Advances in

Neurofuzzy Algorithms for Real-time Modeling and Control,” Eng. Appl. Artif.

Intell. Vol.9, No.1, pp1-16, 1996.

[34] Watanabe,K., Tang,J., Nakamura,M., Koga,S. and Fukuda,T., “A Fuzzy-

Gaussian Neural Network and Its Applications to Mobile Robot Control,” IEEE

Trans. On Control Systems Techn. Vol.4, No.2, pp193-199, March 1996.

94

[35] G. Qingding, H. Qingtao and Q. Yanli, “Neural network real-time IP position

controller on-line design for permanent magnetic linear synchronous motor,” in

Proc. of the 7th International on Advancedmotion control, 2002, pp. 386-389.

[36] F. J. Lin, C. H. Lin and P. K. Huang, “Recurrent fuzzy neural network controller

design using sliding-mode control for linear synchronous motor drive,” IEE

proc.- Control Theory Application, vol.151, no.4, pp. 407-416, July 2004.

[37] Y. S. Kung, R. F. Fung, and T. Y. Tai, “Realization of a Motion Control IC for

X−Y Table Based on Novel FPGA Technology,” in IEEE Trans. on Industrial

Electronic , vol. 56, no.1, pp. 43-53, Jan. 2009.

[38] S. Jung and S. S. Kim, “Hardware implementation of a real-time neural network

controller with a DSP and an FPGA for nonlinear systems,” IEEETrans. Ind.

Electron., vol. 54, no. 1, pp. 265–271, Feb. 2007.

[39] F. J. Lin, D. H.Wang, and P. K. Huang, “FPGA-based fuzzy sliding mode

control for a linear induction motor drive,” Proc. Inst. Elect. Eng.—Electr.

Power Appl., vol. 152, no. 5, pp. 1137–1148, Sep. 2005.

[40] Custom instructions for the Nios Embedded processor,

http://www.altera.com/literature/tt/tt_nios_ci.pdf.

[41] Nios Glossary

[42] Website: http://www.altera.com

[43] “Control of PMLSM in motion control applications” Master’s thesis;

Lappeenranta University of Technology, Faculty of Technology

[44] J. F. Gieras and Z. J. Piech, “Linear synchronous motors:transportation and

automation systems,” CRC Press, 2000.

95

BIOGRAPHY

Name : Nguyen Khanh Quang

Place of Birth : Hue, Vietnam

Date of Birth :May 07th

, 1983

Education and Certificates :Southern Taiwan University

[2008-2010] Master Program in Electrical

Engineering

Da nang University of Technology

[2001-2006] Undergraduate Program in

Electrical Engineering

[Publication]

1. Ying-Shieh Kung, Nguyen Khanh Quang and Le Thi Van Anh, “FPGA-

based Neural Fuzzy Controller Design for PMLSM Drive,” Accepted to

the 8th International Conference on Power Electronics and Drive Systems

(PEDS'09), Nov. 10, 2009, Taipei, Taiwan.