Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the...

58
Eindhoven University of Technology MASTER Feedforward motion control on a predictable embedded multi-core platform Feng, W. Award date: 2018 Link to publication Disclaimer This document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Student theses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the document as presented in the repository. The required complexity or quality of research of student theses may vary by program, and the required minimum study period may vary in duration. General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

Transcript of Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the...

Page 1: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Eindhoven University of Technology

MASTER

Feedforward motion control on a predictable embedded multi-core platform

Feng, W.

Award date:2018

Link to publication

DisclaimerThis document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Studenttheses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the documentas presented in the repository. The required complexity or quality of research of student theses may vary by program, and the requiredminimum study period may vary in duration.

General rightsCopyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright ownersand it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

• Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

Page 2: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Feedforward motioncontrol on a predictable

embedded multi-coreplatform

Master Thesis

Wenguang Feng0901004

Department of Mathematics and Computer ScienceEmbedded System Group

Supervisors:Dip Goswami

Seyed Mojtaba HaghidTijs Donkers

Julien Schmaltz

4th version

Eindhoven, June 2018

Page 3: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking
Page 4: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Abstract

Technische Universiteit Eindhoven (TU/e) is currently involved in an internal project about sys-tem desired trajectory tracking with a LTI motion system (PATO system), which is required todevelop a suitable feedforward-feedback control algorithm for the control application on an em-bedded platform that can help the PATO system (or other systems in the future) precisely trackthe desired input profile. The purpose of the graduation project is about the development andimplementation of feedforward controller on the predictable multi-core platform (CompSOC) andhow predictability can be exploited in the controller design.

The feedforward controller we are using is the static feedforward gain for system regulation prob-lem, which is derived base on the constant input signal. However, now we need to consider aboutthe tracking problem, where the static one could be not suitable for this problem because thedesired input profile is time-varying. Hence, we need to design a suitable feedforward controllerto improve the system tracking performance. In our work, the feedforward controller is designedbased on the PATO system, which is the sample motion system for education purpose in TU/e.Commonly, Inversion-based technique is the basic concept for the feedforward algorithm. Thatmeans the feedforward controller is briefly considered as the inversion of the system model. Some-times, just exact inversion of the system model is not suitable because of the unstable zeros of thesystem, which becomes the unstable poles of feedforward controller. These unstable zeros of thesystem would make the output of the feedforward signal unbounded during the system execution.In order to deal with these unstable zeros of the system, there are some methods which can keepthe feedforward output stable. Among these methods, ZPETC, ZMETC and NPZ-ignore are themost suitable methods for our work, and we choose ZPETC for the PATO system. With the chosenfeedforward algorithm, we simulate the controller on MATLAB and we can analyze the effect ofplatform timing configuration on the tracking performance. We find that with different timing, itwould cause different tracking performance. Then, we implement the method on the embeddedplatform, and verify whether the results of simulation and real platform implementation are thesame under the same timing condition. Finally, based on the analysis, to design the feedforwardcontroller with an optimal timing configuration, we provide a general design flow.

Feedforward motion control on a predictable embedded multi-core platform iii

Page 5: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Preface

Before writing the thesis report, I should say thanks to all the people who made a lot of contribu-tion to my project and final report.

Firstly, I should appreciate to my supervisor Dip Goswami, who gave me an opportunity to join inthis project for my final graduation of my master program. During the project, Mr.Goswami alsogave me many useful advises to me when meeting some unexpected troubles. These experiencewould be good for my future jobs.

Secondly, I should also thank to my project tutor Seyed Mojtaba Haghi. He is a good andpatient people with numerous related professional knowledge. With the help from him, I can solvethe problem step by step. Besides, he is very friendly, I always enjoy and will remember the timeworking with him.

In addition, please allow me to wish one of my friends, Zhao Yun, all the best. She was heavilyinjured in Shanghai, China because of a serious car accident during this final project. I sincerelyhope she could finally recover from the injury.

iv Feedforward motion control on a predictable embedded multi-core platform

Page 6: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Contents

Contents v

List of Figures vii

List of Tables ix

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Motion Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Embedded implementation on predictable multi-core platform . . . . . . . . . . . . 21.4 System model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.4.1 State-space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4.2 Tracking problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.5 Problem definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.6 Outline of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Literature Study 52.1 Literature about feedforward control . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.1.1 Stable inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.1.2 Approximate inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.1.3 Other techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.2 Literature about feedforward control structure . . . . . . . . . . . . . . . . . . . . 62.2.1 Feedforward-plant-inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.2 Feedforward-closed-loop-inverse . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3 Embedded platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3.1 dSPACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3.2 Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.3 CompSOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Tracking control systems 93.1 Discrete-time system model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Dynamics of the PATO system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3 Tracking problem and performance analysis . . . . . . . . . . . . . . . . . . . . . . 12

4 Predictable embedded control 134.1 CompSOC platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.1 Architecture of CompSOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.1.2 TDM schedule policy on CompSOC . . . . . . . . . . . . . . . . . . . . . . 144.1.3 Cycle-accurate temporal isolation . . . . . . . . . . . . . . . . . . . . . . . . 14

4.2 Embedded control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.2.1 Control tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.2.2 Sampling period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Feedforward motion control on a predictable embedded multi-core platform v

Page 7: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CONTENTS

4.2.3 Sensing to actuating delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.3 Modeling sensor to actuator delay . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5 Feedforward tracking control design 195.1 Feedback controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.2 Feedforward controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.2.1 Inversion-based feedforward . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.2.2 Nonminimum-phase zeros ignore . . . . . . . . . . . . . . . . . . . . . . . . 215.2.3 Zero-phase-error-tracking controller . . . . . . . . . . . . . . . . . . . . . . . 225.2.4 Zero-magnitude-error-tracking controller . . . . . . . . . . . . . . . . . . . . 225.2.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

6 Simulation and results analysis 246.1 Design Flow of ZPETC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.2 Control system on Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.3 System Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.4 Tracking error against sampling period . . . . . . . . . . . . . . . . . . . . . . . . . 296.5 Error against sensing to actuating delay . . . . . . . . . . . . . . . . . . . . . . . . 29

6.5.1 Bode diagram with various sensing to actuating delay . . . . . . . . . . . . 326.5.2 Impact on zero location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

7 Implementation and validation 367.1 ZPETC Implementation on CompSOC . . . . . . . . . . . . . . . . . . . . . . . . . 36

7.1.1 Sampling period and sensing to actuating delay on CompSOC . . . . . . . 367.1.2 Algorithm implementation on CompSOC . . . . . . . . . . . . . . . . . . . 37

7.2 Results validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

8 Gernal design flow for feedforward control 41

9 Conclusion and future work 449.1 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Bibliography 46

vi Feedforward motion control on a predictable embedded multi-core platform

Page 8: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

List of Figures

1.1 PATO system with control hardware . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Basic Feedback control system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Basic Feedback control system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.1 feedforward plant-inverse architecture . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 feedforward closed-loop-inverse architecture . . . . . . . . . . . . . . . . . . . . . . 7

3.1 System schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 Basic state-space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3 Basic state-space model with feedback and feedforward controller . . . . . . . . . . 11

4.1 High-level overview of CompSOC [22] . . . . . . . . . . . . . . . . . . . . . . . . . 134.2 Architecture of CompSOC platform [18] . . . . . . . . . . . . . . . . . . . . . . . . 144.3 TDM schedule policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.4 Cycle-accurate temporal isolation [13] . . . . . . . . . . . . . . . . . . . . . . . . . 154.5 Embedded control loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.6 Sensor to actuator delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.1 closed-loop transfer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.2 closed-loop transfer function with feedforward controller . . . . . . . . . . . . . . . 20

6.1 The general design flow of ZPETC . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.2 Control system on Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.3 System response with preview by ZPETC . . . . . . . . . . . . . . . . . . . . . . . 266.4 Control system on Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.5 System response with mixed sinusoid wave . . . . . . . . . . . . . . . . . . . . . . . 286.6 System response with sinusoid wave . . . . . . . . . . . . . . . . . . . . . . . . . . 286.7 System response with tooth wave . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286.8 Overall trend of error against the sampling period (ZPETC) . . . . . . . . . . . . . 296.9 Number of unstable zeros vs sampling period (ZPETC) . . . . . . . . . . . . . . . 296.10 Tracking performance against sensing to actuating delay-sinusoid wave in Figure 6.6 306.11 Tracking performance against sensing to actuating delay-mixed sinusoid wave in

Figure 6.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306.12 Tracking performance against sensing to actuating delay-tooth wave in Figure 6.7 . 306.13 Tracking performance against sensing to actuating delay-sinusoid wave (ZPETC) . 316.14 Tracking performance against sensing to actuating delay-mixed sinusoid wave (ZPETC) 316.15 Tracking performance against sensing to actuating delay-tooth wave (ZPETC) . . 316.16 number of unstable zeros against sensing to actuating delay . . . . . . . . . . . . . 316.17 Bode diagram with different value of sensing to actuating delay . . . . . . . . . . . 326.18 Zeros’ location locus of system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336.19 Zeros’ location locus of system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.20 Zeros’ location locus of system-delay=9.0ms . . . . . . . . . . . . . . . . . . . . . . 346.21 Zeros’ location locus of system-delay=8.5ms . . . . . . . . . . . . . . . . . . . . . . 35

Feedforward motion control on a predictable embedded multi-core platform vii

Page 9: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

LIST OF FIGURES

6.22 Zeros’ location locus of system-delay=9.5ms . . . . . . . . . . . . . . . . . . . . . . 35

7.1 Implementation on CompSOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367.2 Implementation on CompSOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377.3 Array 1 and Array 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.4 Buffer 1 and Buffer 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.5 Concept of ZEPTC on hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.6 Task mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397.7 Tracking performance on MATLAB and CompSOC-mixed sinusoid wave . . . . . . 407.8 Performance difference between MATLAB and CompSOC-mixed sinusoid wave . . 407.9 Tracking performance on MATLAB and CompSOC-tooth . . . . . . . . . . . . . . 407.10 Performance difference between MATLAB and CompSOC-tooth . . . . . . . . . . 40

8.1 General Design flow for the controller . . . . . . . . . . . . . . . . . . . . . . . . . 418.2 Sub design flow I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428.3 Sub design flow II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438.4 General design flow for implementation . . . . . . . . . . . . . . . . . . . . . . . . 43

viii Feedforward motion control on a predictable embedded multi-core platform

Page 10: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

List of Tables

1.1 Project Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3.1 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.1 comparison of three feedforward methods . . . . . . . . . . . . . . . . . . . . . . . 27

7.1 Timing configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Feedforward motion control on a predictable embedded multi-core platform ix

Page 11: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 1

Introduction

1.1 Background

Nowadays, many motion systems often require a high performance of trajectory tracking. Thesemotion systems have been applied in several application domains, such as robotics motion con-trolling, wafer positioning, 3D printer, etc. Trajectory tracking means that the movement of themotion system should follow the desired trajectory, which is the input to the motion system.Electronic Systems (ES) group in Technische Universiteit Eindhoven (TU/e) is currently involvedin an internal project to analyze the trajectory tracking performance of various motion controlsystems implemented on the predictable embedded platform (CompSOC) designed by TU/e [3].

Currently, a design flow has been developed for the implementation of feedback control algorithmson CompSOC. This design flow is suitable for regulation problems with a constant reference signal.In this thesis, we combined both feedback and feedforward controller to extend the current setupsuitable for tracking problems. With the implementation on CompSOC, we developed a platform-aware control algorithm for the motion control system and demonstrated how the platform timingcan be exploited in the design to improve tracking performance.

1.2 Motion Systems

The investigated motion system in our work is named PATO system [9]. The PATO system ismainly used for education or research purposes in TU/e. The reason of choosing this system isthat it could be regarded as a typical application example of a motion control system. As canbe seen in Figure 1.1, the PATO system is a dual rotary motion control system. It consists oftwo masses which are connected by a spring in the middle. In addition, there is a motor as theinput to drive the first mass. The attached sensors are used to measure the displacement and thevelocity of both masses. The measured displacement value from one of the masses is the outputof the motion system [6]. Based on the description above, this system could be considered as aSingle-Input-Single-Output (SISO) system.

In the embedded implementation, the system is discretized with a uniform sampling period. Withinthe sampling period, the measured position of one mass as the system output is received by anembedded platform. Then, the platform computes the received values with a designed controlalgorithm and sends a new actuating value as a new control input for the next sampling period.

As can be seen in Figure 1.1, the embedded control process on the platform is usually dividedinto three control tasks: sensing, computing and actuating. These three control tasks have to beexecuted in sequence within one sampling period.

Feedforward motion control on a predictable embedded multi-core platform 1

Page 12: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 1. INTRODUCTION

Figure 1.1: PATO system with control hardware

In addition, there is an inevitable delay between sensing and actuating due to the finite executiontime of the control tasks. Hence, such a delay should be considered in the control design.

1.3 Embedded implementation on predictable multi-coreplatform

As can be seen in Figure 1.1, the controller is implemented on an embedded platform and runsat discrete time. Due to the discrete-time system, the sampling period (inverse of sampling rate),which might influence the system tracking performance, should be considered in the design. Usu-ally, a shorter sampling period leads to a higher tracking performance, but may result in a higherenergy consumption and workload. Hence, a shorter sampling period is not always desired for thecontrol system.

CompSOC has two main properties: predictability and composability. The definition of thesetwo properties can be found in [11]. With the property of predictability, we can design a platform-aware controller such that we can improve the tracking performance with an optimal platformtiming configuration. With the property of composability, we can avoid inter-application inter-ference. Hence, the control application can be developed and tested independently from otherunrelated applications.

In this project, we will take advantage of the property of predictability to set up an optimaltiming configuration for the control applications to have a relatively high tracking performancewith an acceptable resource utilization.

1.4 System model

1.4.1 State-space model

We consider the plant as a Linear Time-Invariant (LTI) system. An ideal LTI system is bothlinearity and time invariance [14]. Normally, an LTI system can be modeled by a state-spacemodel [17]. A continuous-time LTI system can be represented by Equation 1.1,

2 Feedforward motion control on a predictable embedded multi-core platform

Page 13: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 1. INTRODUCTION

{x(t) = A · x(t) +B · u(t)

y(t) = C · x(t)(1.1)

where A, B and C are three constant matrices to model a LTI system. They denote the statematrix, the input matrix and the output matrix respectively. x(t) is the state array of the system,and the state elements inside are dependent on which system it represents. u(t) is the controlinput, and y(t) is the output of the system.

To solve the control problem, we add feedback and feedforward controller into the system, and theassociated control structure is shown in Figure 1.2. This is not the only possible control structurefor the feedforward control system. The relevant research is introduced in Chapter 2. Accordingto Figure 1.2, we can get the equation of the system input as follows,

Figure 1.2: Basic Feedback control system

u(t) = Kx(t) + Fr(t) (1.2)

where K and F represent the feedback and feedforward gains respectively. r(t) is the desired inputreference.

If the input reference is constant, we can define that r(t) = r. The control objective is to achievethe following equation:

limt→∞y(t) = r (1.3)

The system output y(t) should reach the input reference r with time, which is a regulation problem.For a regulation problem, a static feedforward gain F is suitable.

1.4.2 Tracking problem

In a tracking problem, the reference r(t) becomes time-varying and the control objective is thefollowing equation,

y(t) ≈ r(t) with t→∞ (1.4)

Thus, we need to develop a new feedforward controller F (t), instead of the static gain which ismentioned above, to enable the system to track r(t) precisely. That is the tracking problem weconcentrate in our work.

Feedforward motion control on a predictable embedded multi-core platform 3

Page 14: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 1. INTRODUCTION

1.5 Problem definition

In this thesis, we concentrate on the trajectory tracking control of the PATO motion system,which is described in Chapter 1.2. To address this problem, we introduce a novel model-inversionbased feedforward controller for the PATO system. With an predictable embedded multi-coreplatform described in Chapter 1.3, we aim for developing a platform-aware implementation of theproposed feedforward control design method. Based on this proposed method, we derive a generaldesign flow. Following this design flow, we implement a feedforward-feedback control applicationon CompSOC and set an optimal timing configuration for the control application. Table 1.1 showsproject goal which is expected to be finished during the assignment.

Table 1.1: Project Goal

Goal of project1. Design tracking control for the PATO system2. Characterize the effect of delay3. Scheduling and mapping of the feedforward control on CompSOC4. HIL simulation and validation on platform5. Propose a design flow

To achieve the purpose of the thesis, we propose a brief work flow for our work. It is shownin Figure 1.3.

Figure 1.3: Basic Feedback control system

1.6 Outline of the thesis

In this part, we introduce the outline of the thesis. Chapter 2 reviews the research related toour work. In Chapter 3, we derive a discrete-time model for the PATO system and explain thetracking problem in our work. In Chapter 4, we discuss the embedded platform (CompSOC) andintroduce the three control tasks for embedded control. Due to these control tasks, we have tothink of the sensing to actuating delay. Because of the sensing to actuating delay, we derive anew discrete-time augmented system. In Chapter 5, we introduce three methods of feedforwardcontroller: ZPETC, ZMETC and NPZ-ignore. Then, we design a feedforward controller and dothe related simulation in Chapter 6. Besides, we also analyze how the tasks scheduling can affectthe system tracking performance. In chapter 7, we mainly describe the controller implementationon CompSOC. And then, we propose a general design flow of feedforward controller developmentwith an optimal timing configuration. Finally, the conclusion and recommendation can be foundin Chapter 9.

4 Feedforward motion control on a predictable embedded multi-core platform

Page 15: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 2

Literature Study

2.1 Literature about feedforward control

The feedforward controller is to improve the tracking performance of motion systems in thisporject. Currently, there are several existing algorithms for the feedforward control. In this part,we will introduce some of them which are relevant to our work.

2.1.1 Stable inversion

According to [24], the inversion-based technique is a basic technique to design a feedforwardcontroller. If the system is minimum-phase (a system without unstable zeros), an exact modelinversion for the feedforward controller can be directly applied. However, when the system isnonminimum-phase (a system containing unstable zeros), we need to deal with the unstable partof the feedforward controller.

One possible approach is to use stable inversion. With this method, the designed feedforwardcontroller should be divided into a stable part and an unstable part. The unstable part of the sys-tem should be treated non-causally and its solution, in time domain, should be computed backward[25]. Based on the introduction of [24], a relatively large number of samples for pre-actuation,infinity in ideal, is required. This situation may lead to a computationally expensive solution.Thus, this is not suitable for our project since we have limited computing resources in CompSOC.

2.1.2 Approximate inversion

Another way to deal with the unstable part is the approximate inversion. NPZ-Ignore [26], Zero-Phase-Error Tracking Control (ZPETC) [20] [21] and Zero-Magnitude-Error Tracking Control(ZMETC) [16] are three main techniques associated with the approximate inversion. These meth-ods are widely applied for LTI feedforward solutions.

The main idea of the approximate inversion is to remove the effect of unstable poles or replacethese poles by its reflected stable poles and zeros, in order to achieve the goal of the approximateinversion with almost the same behavior compared to the exact inversion. These three methodsfocus on different aspects. NPZ-ignore method avoids the effect of the unstable part, and makethe unstable part zero-order. ZMETC method tries to change the unstable part and compensatefor the magnitude response error. ZPETC method attempts to adjust the unstable part and avoidthe phase response error.

Feedforward motion control on a predictable embedded multi-core platform 5

Page 16: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 2. LITERATURE STUDY

2.1.3 Other techniques

Another technique called norm-optimal method is introduced in [24]. The idea of it is to minimizethe tracking error. Theoretically, this method needs an infinite or a large number of previewsamples to achieve a good tracking performance. Limited samples would cause a bounded error.The large number of preview samples may increase the difficulties for the hardware implementa-tion. This technique is popular for Iterative Learning Control (ILC).

Besides, [12] also introduces the spatial feedforward controller for H2 or H∞ control. This kindof feedforward controller for H2 or H∞ control is mainly used for the disturbance rejection. Thatis different from our case because of the different purpose. The feedforward controller designedby this method normally contains a relatively complicated transfer function. That makes thecontroller hard to be implemented on the embedded platform.

Finally, Truncated Series Approximation (TSA) is described in [19]. The main idea of this methodis to use Tyler Series Expansions to approximate the unstable part. Ideally, this method needsinfinite preview samples to achieve a good tracking performance for the system, so it demands ahigh cost of computation resources.

2.1.4 Summary

The techniques mentioned above are the main possible solutions for the feedforward controller interms of the tracking problem.

Among all the mentioned methods, we consider the approximate inversion techniques with ZPETC,ZMETC or NPZ-ignore control might be the most suitable for this work. First of all, they are rel-atively easy to be implemented for a model-based LTI system. They do not require a complicatedcalculation for the embedded implementation. Hence, they are more effective on computation. Itis much easier for us to analyze and take advantage of predictability.

However, as for other techniques, they would not be further investigated in this thesis. Someof them (stable inversion, TSA) might have a better performance, but they cost more computa-tion resources, which may cause a negative impact on the resource utilization. Furthermore, wecould hardly utilize the property of predictability in the design because the quality of the trackingperformance is always high if the number of preview samples is large. The others (ILC feedforwardcontrol, H2 or H∞ feedforward control) are not very related to our current assignment due to thedifferent control structures and control purpose. Therefore, it would be hard for us to utilize theprevious results if we choose these methods.

2.2 Literature about feedforward control structure

There are two main types of feedforward control structures(architectures) for an inversion-basedfeedforward controller. One is the Feedforward-Plant-inverse structure. The other one is theFeedforward-closed-loop-inverse structure.

2.2.1 Feedforward-plant-inverse

This structure can be seen in figure 2.1, which is introduced in [4], where we consider FF (s) as thefeedforward controller, FB(s) as the error feedback controller and P (s) as the transfer function forthe plant. According to the concept of the inversion-based technique, the feedforward controllerneeds to inverse the function P (s) in the FFPI structure.

6 Feedforward motion control on a predictable embedded multi-core platform

Page 17: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 2. LITERATURE STUDY

Figure 2.1: feedforward plant-inverse architecture

2.2.2 Feedforward-closed-loop-inverse

The structure of FFCLI is illustrated in Figure 2.2, where the feedforward controller needs toinverse the transfer function of the whole closed-loop system, instead of the transfer function ofthe plant. This structure is mentioned in [8].

Figure 2.2: feedforward closed-loop-inverse architecture

As shown in Chapter 1.4, FFCLI is chosen to be the control structure for the feedforward controller.One important reason is that this structure has a better performance than that of FFPI, which isshown in [16]. Besides, this is also the structure which has been applied in the previous work forthe regulation problem. With this structure, it becomes possible that we can treat the closed-loopsystem as a new system. We only need to concentrate on the design of feedforward controller andkeep the feedback part the same. This allows us to analyze the effect of feedforward part separately.That would be easier for us to compare the tracking performance between the proposed controllerand the existing controller with a static feedforward.

2.3 Embedded platform

As introduced in Chapter 1.3, the embedded platform plays an important role in an embeddedcontroller or a control application. Nowadays, there are many kinds of embedded platforms canbe chosen to execute the control application. Although we use CompSOC in the thesis, there aresome other potential platforms might be suitable. We will introduce some platforms in this part.

2.3.1 dSPACE

The products of dSPACE are mainly used for the real-time control functionality of smart vehicles.In this part, we briefly introduce a relatively cost-effective controller board of dSPACE, DS1104[1] , which could be used in the simulation of applications from various areas, such as roboticsmovement and vehicle driving. With the help of open-sourced software, we can easily set up thecontrol system graphically by using Real-Time Interface (RTI). Additionally, The simulation couldbe operated under Simulink. In summary, the products of dSPACE are user-friendly, but theirproducts are very expensive to us.

Feedforward motion control on a predictable embedded multi-core platform 7

Page 18: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 2. LITERATURE STUDY

2.3.2 Raspberry Pi

Raspberry Pi might also be a possible choice for the embedded implementation of a control systemin the market. Because this platform is open-sourced, some existed examples for a motion control-ler design example could be founded. As introduced in [15], the author shows the implementationof motion control system kit with a DC motor. More detailed information about this platform canbe found in [2]. However, this platform is hard to achieve timing predictability in this platform.

2.3.3 CompSOC

CompSOC is an existed platform which is developed by ES group in TU/e. As stated by [11],this platform is designed for multiple embedded applications, including the control application,on one platform with a predictable performance and non-interference between different embeddedapplications. In order to ensure the purpose above, the platform should meet the propertiesof both predictability and composability. Because of these two properties, this platform meetsthe requirements which is introduced in Chapter 1.3. For this reason, CompSOC is chosen asthe platform where the control application is implemented. The details of CompSOC would beintroduced in the later part.

8 Feedforward motion control on a predictable embedded multi-core platform

Page 19: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 3

Tracking control systems

In order to design the controller of the PATO system, we need to set up a model of the controlsystem based on the parameters of this system first. In this chapter, a state-space model of thePATO system would be derived.

3.1 Discrete-time system model

Since the embedded controller usually works at discrete time, the continuous-time state-spacemodel (Equation 1.1) is not suitable. Hence, we need to discretize the continuous-time state-spacemodel to fit for the sampling period of the controller.

We define that the sampling period is constant, the discrete-time state-space model can be rep-resented by Equation 3.1: {

x[k + 1] = φ · x[k] + γ · u[k]

y[k] = C · x[k](3.1)

Where φ and γ are the discrete-time state matrix and input matrix, which can be formulated asfollow:

φ = eAh

γ =

∫ h

0

eAsBds

where h denotes the sampling period.

3.2 Dynamics of the PATO system

In this part, we would derive a discrete-time state-space model for the PATO system. First ofall, we need to analyze the dynamics of the PATO system before deriving it into the state-spacemodel. Then, we can list the dynamics equations based on the analysis. The state-space model isestablished based on these equations.

The dynamics of the PATO system is shown in Figure 3.1. It is considered as a SISO systemwhich includes two masses (M1, M2). They are connected by a spring. M1 is driven by the motorand disturbed by the spring. M2 is only affected by the spring. The motor from the input slotis driven by the input current. The displacement of M1 is measured during the test, which isregarded as the output y[k] of the PATO system.

Feedforward motion control on a predictable embedded multi-core platform 9

Page 20: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 3. TRACKING CONTROL SYSTEMS

Figure 3.1: System schematics

According to the analysis of Figure 3.1, the dynamics equation for both the masses of the PATOsystem can be listed. Based on the Newtons Second Law, Equation 3.2 and 3.3 are the differentialequations for the two masses,

J1 · θ1 = Kmim − k(θ1 − θ2)− d(θ1 − θ2)− bθ1 (3.2)

J2 · θ2 = −k(θ2 − θ1)− d(θ2 − θ1)− bθ2 (3.3)

where θ1 and θ2 denote the displacement of the M1 and M2. J1 and J2 represents the inertiaof M1 and M2. Km is the motor constant and im is the input current. k, d and b denote thecoefficients of torsional spring, torsional damping and friction respectively.

Based on Equation 3.2 and Equation 3.3, we start to set up the state-space model for the PATOsystem. The value of displacement and velocity of both masses are the states which can be meas-ured by the PATO system. Thus, there are four elements which should be listed in the state arrayx, which is shown in Equation 3.4:

x =

θ1θ2ω1

ω2

(3.4)

where θ1, θ2, ω1 and ω2 denote the state of displacement and velocity of both masses respectively.let ω1 = θ1 and ω2 = θ2, the values of all the elements for the matrices in the state-space modelcan be calculated according to Equation 3.5 to 3.7. The related parameters of the PATO systemare shown in Table 3.1.

A =

0 0 1 00 0 0 1

−KJ1

KJ1

− (b+d)J1

dJ1

KJ2

−KJ2

dJ2

− b+dJ2

(3.5)

B =

00

Km

J1

0

(3.6)

C =[

1 0 0 0]

(3.7)

10 Feedforward motion control on a predictable embedded multi-core platform

Page 21: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 3. TRACKING CONTROL SYSTEMS

Figure 3.2: Basic state-space model

Figure 3.3: Basic state-space model with feedback and feedforward controller

Then, we use the discrete-time state space model (Equation 3.1) to discretize the matrix A, Band C. These discretized matrices compose a complete discrete-time system model of the PATOsystem with a constant sampling period. The discrete-time control system model is illustratedin Figure 3.2. In order to track the desired input, we need to compute a suitable system controlinput u[k] as shown in Equation 1.2.

The input u[k] consists of two parts, Kx[k] and Fr[k], which represent the output signal ofthe feedback and feedforward controller respectively. According to the structure of the FFCLI,we establish a control system with the feedback and feedforward controller for the discrete-timestate-space model (Figure 3.3). Then, we can design a suitable algorithm of the feedback andfeedforward controller for the PATO system according to the structure in Figure 3.3, which willbe discussed in the later chapter.

Table 3.1: Parameters

Parameter value Description UnitsJ1 3.75× 10−6 inertia of mass1 Kgm2

J2 3.75× 10−6 inertia of mass2 Kgm2

b 1× 10−5 friction coefficient Nms/radk 0.2656 torsional spring Nm/radd 3.125× 10−5 torsional damping Nms/radKm 4.4× 10−2 motor constant Nm/A

Feedforward motion control on a predictable embedded multi-core platform 11

Page 22: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 3. TRACKING CONTROL SYSTEMS

3.3 Tracking problem and performance analysis

Because we mainly concentrate on the tracking performance of the system, we need a suitableformula to analyze it. Given a desired input trajectory r[k] to the system, we expect the systemoutput y[k] follow the input r[k]. The error between r[k] and y[k] should be as less as possible.

Therefore, in order to investigate the tracking performance, we apply Mean Square Error (MSE)to calculate the sum of tracking error with each sample during the system test, which is definedin Equation 3.8:

error =1

performance=

∞∑k=0

(y[k]− r[k])2 (3.8)

where y[k] is the output of the PATO system and r[k] is the desired input profile. As Equation3.8 shows, the system output is compared to the desired input profile for checking the similaritybetween y[k] and r[k]. A low calculated value of error indicates a desired tracking performanceof the system. In addition, if we need to judge the tracking performance, we should keep the sim-ulation duration the same first. With a constant simulation duration, the number of test samplesis unchanging. Under this precondition, we can conclude how the tracking performance of thesystem is by Equation 3.8 with same number of test samples.

For instance, there are 50000 test samples during the simulation. We expect that the percentage

of the average error variance of the tracking performance should be (y[k]−r[k])2max(r[k]) < 0.01. Thus, if

the calculated summation value of all the test samples is lower than 0.01× 50000 = 500, it meansthat the tracking performance meets the expectation.

12 Feedforward motion control on a predictable embedded multi-core platform

Page 23: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 4

Predictable embedded control

4.1 CompSOC platform

We use CompSOC as the embedded platform to implement the control application. Figure 4.1developed from [22] shows the composition of CompSOC. CompSOC normally consists of theprocessor tile, the memory tile and the monitor tile. The processor tiles are applied to processthe designed control application or simulate the plant. The memory tile is regarded as a specificresource. It contains external memory and states of the controller or other specifications. Besides,the monitor tile is mainly used for debugging. Through the micro-kernel (CoMik), the platformcreates the partition slots in each physical processor based on the time division multiplexing(TDM) policy [11]. Additionally, these partition slots are separated by CoMik slots with a muchshorter time.

Figure 4.1: High-level overview of CompSOC [22]

4.1.1 Architecture of CompSOC

The sample architecture of CompSOC platform is shown in Figure 4.2, which is from [18]. In thisexample, we can study the details of CompSOC from this figure. Each processor tile shown infigure 4.2 contains one processor with its associated instruction memory (IMEM) and data memory(DMEM). These memories cannot be shared among the different tiles. Different processor tilesare inter-connected by the Network On Chip (NOC). With the NOC, the two processor tiles can

Feedforward motion control on a predictable embedded multi-core platform 13

Page 24: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 4. PREDICTABLE EMBEDDED CONTROL

Figure 4.2: Architecture of CompSOC platform [18]

communicate by Direct Memory Access (DMA) through its communication memory (CMEM).Each processor tile can handle different applications, but only one application among them canaccess DMA simultaneously.

4.1.2 TDM schedule policy on CompSOC

CompSOC applies TDM schedule policy to maintain the properties of predictability and compos-ability on this platform. As shown in figure 4.3, there exist two kinds of slots, partition slots(ψ) and CoMik slots (ω). In this instance, the schedule has one TDM period with four partitionslots and four CoMik slots. Within one TDM period, the application run by a virtual processor(VP) is allocated in the dedicated partition slots and suspended in the unassociated slots. Theapplication would only continue in the partition slots allocated by the same application. In thenext TDM period, the application is executed in the same manner. The duration of the partitionslots can be predefined by CompSOC. Between two adjacent partition slots, the CoMik slots areused to ensure the cycle-accurate temporal isolation, which makes the platform predictable andcomposable.

Figure 4.3: TDM schedule policy

4.1.3 Cycle-accurate temporal isolation

TDM scheduling policy on CompSOC is achieved by the periodic interrupt to start a contextswitch between two different VPs (or partition slots). As can be seen in Figure 4.4 from [13],

14 Feedforward motion control on a predictable embedded multi-core platform

Page 25: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 4. PREDICTABLE EMBEDDED CONTROL

when the periodic interrupt occurs, it could not be immediately processed by the processor nor-mally. That would cause a jitter (J). The jitter depends on the duration of the critical regionwhere is not interruptible. After the jitter is over, the previous VP’s related context and state arepreserved and then the next VP is arranged and loaded. The period of this process spends time ofT , which mainly depends on the scheduling time of the VPs [22]. Thus, the starting point of nextVP is associated with the value of J and T . Because both duration of J and T are dependent, inorder to realize the cycle-accurate temporal isolation, the CoMik slot ω should be as follow:

ω ≥ max(J) +max(T ) +R (4.1)

where R denotes the cycles of the stages of the processor pipeline which are needed to be takeninto consideration, such as fetch and decode stage. The upper bound of time T is decided by theperiod of the conversion between two different VPs. Besides, the upper bound of time J dependson the length of the critical region. These variables determine the required length of ω. We cancompute the lower bound of the CoMik slot according to Equation 4.1. When the length of ωis larger than the determined lower bound, the cycle-accurate temporal isolation could be realized.

According to [10], [11] and the description above, the property of predictability on CompSOCcan guarantee the worst-case performance for the hard real-time applications, since the Worst-Case Response Time (WCRT) of an application is bounded. The control application is a typicalhard real-time application. Therefore, a performance-aware controller can be implemented byCompSOC since the WCRT could be guaranteed and calculated.

Figure 4.4: Cycle-accurate temporal isolation [13]

4.2 Embedded control

Since the controller would be implemented on CompSOC, there are some real-time and hardwarerestrictions needed to be considered.

Figure 4.5: Embedded control loop

Feedforward motion control on a predictable embedded multi-core platform 15

Page 26: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 4. PREDICTABLE EMBEDDED CONTROL

4.2.1 Control tasks

Figure 4.5 shows the embedded control loop for the motion control system. There are three controltasks contained within this control loop [22], [23]. They are sensing task (Ts), computing task(Tc) and actuating task (Ta):

- Sensing task: the task to receive the states information from the sensors of the PATO systemand send the received information to the computing task.

- Computing task: the task to extract the received states from the sensing task and computethe next control input for the PATO system by the designed control algorithm.

- Actuating task: the task to send the computed control input from the computing task tothe actuator of the PATO system.

The three control tasks should be executed sequentially on CompSOC to avoid the control mis-takes. The working sequence of three tasks should be Ts → Tc → Ta.

We define ts(Tks ), ts(T

kc ) and ts(T

ka ) as the start time of the sensing task, the computing task

and the actuating task respectively, where k means the kth discrete sample. Define te(Tks ), te(T

kc )

and te(Tka ) as the end time of sensing task, computing task and actuating task respectively. Then,

the execution time of these three tasks e(T ks ), e(T k

c ), e(T ka ) equals to:

e(T ks ) = te(T

ks )− ts(T k

s ) (4.2)

e(T kc ) = te(T

kc )− ts(T k

c ) (4.3)

e(T ka ) = te(T

ka )− ts(T k

a ) (4.4)

4.2.2 Sampling period

The sampling period of the controller (hc) equals the duration between the starting time of twoadjacent Ts for a normal embedded motion control system, which is shown in Equation 4.5.

hc(k) = ts(Tk+1s )− ts(T k

s ) (4.5)

A uniform sampling period hc can be achieved by a suitable mapping of the control tasks withthe predictable platform.

4.2.3 Sensing to actuating delay

As can be seen in Figure 4.6, the sensing to actuating delay always exists within each samplingperiod. In this work, we only consider the condition that the sensing to actuating delay (Dc) issmaller than hc. Only in this condition, the required working sequence of the three control taskscan be achieved.

Dc equals the duration between the start time of the sensing task and the end time of the actuatingtask:

Dc(k) = te(Tka )− ts(T k

s ) (4.6)

The upper bound of the delay Dc is limited by the value of one sampling period. Besides, consid-ering that each task has its own execution time e(T k

s ), e(T kc ) and e(T k

a ), we have the theoreticallower bound of the delay according to Equation 4.6. That should be the sum of execution time of

16 Feedforward motion control on a predictable embedded multi-core platform

Page 27: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 4. PREDICTABLE EMBEDDED CONTROL

all the control tasks. Thus, the theoretical valid interval of Dc is:

e(T ks ) + e(T k

c ) + e(T ka ) < Dc(k) < hc(k) (4.7)

In this work, the execution time of control tasks is much smaller than the sampling period. Thus,We can briefly think the sum of execution time of all the control tasks is close to zero, which isusually regarded as the ideal situation. Therefore, the ideal interval of Dc could be considered as:

e(T ks ) + e(T k

c ) + e(T ka ) ≈ 0 << hc(k)→ 0 < Dc(k) < hc(k) (4.8)

With Equation 4.8, we can observe the effect of the sensing to actuating delay on the trackingperformance within this interval during the simulation.

Figure 4.6: Sensor to actuator delay

4.3 Modeling sensor to actuator delay

When thinking of the sensing to actuating delay to the basic state-space model (equation 3.1), anew augmented system should be developed to contain this kind of delay. The principle in detailis shown in [5]. The augmented state-space model equations is shown in Equation 4.9{

x[k + 1] = φx[k] + γ1(Dc)u[k − 1] + γ0(Dc)u[k]

y[k] = Cx[k](4.9)

where φ, γ1 and γ0 equals:

φ = eAh

γ1(Dc) =

∫ h

h−Dc

eAsBds

γ0(Dc) =

∫ h−Dc

0

eAsBds

Let the new augmented system be:

z[k] =

[x[k]

u[k − 1]

](4.10)

Feedforward motion control on a predictable embedded multi-core platform 17

Page 28: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 4. PREDICTABLE EMBEDDED CONTROL

The state-space model of a new augmented system is developed from Equation 4.9{z[k + 1] = φaugz[k] + γaugu[k]

y[k] = Caugz[k](4.11)

where the augmented matrices φaug, γaug and Caug equal:

φaug =

[φ γ1(Dc)0 0

]

γaug =

[γ0(Dc)I

]Caug =

[C 0

]With the new augmented system shown in Equation 4.11, we can design the controller which con-tains the sensing to actuating delay inside the system. The form of the augmented system modelis similar to the basic one (Equation 3.1). Hence, the inversion-based approach for feedforwardcontroller is still sufficient for this augmented system. Additionally, the different point is that sens-ing to actuating delay is treated as a variable of the augmented system. Different value definitelycauses a different augmented system model, which causes a different tracking performance.

18 Feedforward motion control on a predictable embedded multi-core platform

Page 29: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 5

Feedforward tracking controldesign

Since a system model has been derived in previous chapters, the algorithm of control applicationcould be designed based on the derived model. The control application consists of feedback andfeedforward controller. In this chapter, we would briefly introduce the feedback control develop-ment and mainly concentrate on the feedforward control design.

5.1 Feedback controller

Because the control system is modeled by the state space, we apply pole placement via state feed-back [22]. It is a common technique to develop a feedback controller for the state-space model.The concept of pole placement is to define the desired closed-loop poles, which would affect thesensitivity and stability of the system.

Considering the case without feedforward controller, let the input be:

u[k] = Kx[k] (5.1)

We apply the augmented system model (Equation 4.11) due to the sensing to actuating delay.Replace Equation 5.1 into Equation 4.11, we can get:

x[k + 1] = φaugx[k] + γaugu[k] = φaugx[k] + γaug(Kx[k]) = (φaug + γaugK)x[k] (5.2)

According to Equation 5.2, the desired closed-loop poles are represented by the eigenvalues of thematrix φaug + γaugK. To calculate the feedback gains, the vector of desired closed-loop polesshould be determined first. For the PATO system, we need five desired poles for the augmentedsystem. Define that the vector of desired poles as:

Poles =[pole1 pole2 pole3 pole4 pole5

](5.3)

then, according to the characteristics equation, we let the eigenvalue value of φaug + γaugK equalthe desired poles (Equation 5.4 and 5.5).

∆(φaug + γaugK) =[pole1 pole2 pole3 pole4 pole5

](5.4)

where ∆ means the solution to the characteristics equation. Then, the feedback vector K canbe computed according to the computed matrix φaug, γaug and the desired closed-loop poles thathave been defined before the K calculation.

Feedforward motion control on a predictable embedded multi-core platform 19

Page 30: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 5. FEEDFORWARD TRACKING CONTROL DESIGN

5.2 Feedforward controller

In this part, we begin to design the feedforward controller F . As mentioned in Chapter 2.1,we think that NPZ-ignore controller, ZPETC and ZMETC are the potential techniques for thefeedforward controller in our work. In this section, we would introduce how these methods can beachieved.

5.2.1 Inversion-based feedforward

The inversion-based technique is important for the feedforward design. In this technique, thefeedforward controller inverses the transfer function P of the control system to get the desiredcontrol input. With this control input, the system output and desired input should be the sametheoretically.

Since we choose FFCLI as the feedforward control structure, we can think the closed loop forthe feedback control as an integrated part. Based on the system which is shown in Figure 3.2,the whole system including the sensing to actuating delay with the feedback controller can berepresented by the following transfer function:

P = Caug(z · I − φaug − γaugK)−1γaug (5.5)

Thus the system can be replaced by a single block which contains the computed transfer function(Equation 5.5).

Figure 5.1: closed-loop transfer function

Then, substitute Figure 5.1 into Figure 3.3.

Figure 5.2: closed-loop transfer function with feedforward controller

In order to make the value of measured output y[k] close to the trajectory r[k], the feedforwardcontroller F should inverse the transfer function of the whole closed-loop system (Equation 5.5).Therefore, F should equal P−1:

F =1

Caug(z · I − φaug − γaugK)−1γaug(5.6)

If the system is a minimum-phase system, the system can precisely track the desired trajectorywith this direct inversion of the function. However, if the system is nonminimum-phase, it wouldcontain unstable zeros. The feedforward controller would become unstable because these unstablezeros of the system are the unstable poles of the inversion function (Equation 5.6). That is thereason that we need a suitable method to process these unstable zeros.

20 Feedforward motion control on a predictable embedded multi-core platform

Page 31: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 5. FEEDFORWARD TRACKING CONTROL DESIGN

5.2.2 Nonminimum-phase zeros ignore

Define that the transfer function which is computed from Equation 5.6 as:

P =Bs(z)Bu(z)

A(z)(5.7)

Where A(z) means the stable poles of the system, Bs(z) and Bu(z) represent stable zeros (insidethe unit circle for the discrete system) and unstable zeros (outside the unit circle for the discretesystem) respectively.

According to the inversion-based approach, we get:

F =A(z)

Bs(z)Bu(z)(5.8)

where Bu(z) contains the unstable poles of the feedforward transfer function. It makes the systemresponse unbounded.

Nonminimum-phase zeros ignore (NPZ-ignore) method is also called zero-order series inversion,which is one of the possible methods to address the problem of the unstable zeros. This method isto remain the stable part A(z) and Bs(z) and ignore the unstable zeros which exist in the transferfunction, and make them become zero-order (Equation 5.9).

Bnpz = Bu(1) (5.9)

Thus, NPZ-ignore feedforward function equals:

F =A(z)

Bs(z)Bnpz=

A(z)

Bs(z)Bu(1)(5.10)

And the relation between system output y and desired input r can be represented as:

y

r=Bu(z)

Bu(1)(5.11)

the term Bu(1) keeps the gain of 0Hz frequency. As discussed in [7] , this method is generally theleast precise method for inversion-based feedforward controller. It would lead to both magnituderesponse error and phase shift with the incremental number of the system unstable zeros andhigher frequency of the desired input.

It is difficult to directly use PATO system as the example to show how we can apply the feedfor-ward method in the thesis because of the complicated computation. Thus, in order to help wellunderstand the introduced method, we assume that we had been given a sample system, whosetransfer function equals:

P =(z − 0.5)(z + 2)

(z3 − 0.4z2 − 0.25z + 0.1)

where:

A(z) = z3 − 0.4z2 − 0.25z + 0.1

Bs(z) = z − 0.5

Bu(z) = z + 2

Feedforward motion control on a predictable embedded multi-core platform 21

Page 32: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 5. FEEDFORWARD TRACKING CONTROL DESIGN

As we can see, all three poles of the sample system are inside the unit circle (−0.5, 0.5, 0.4).The system contains one stable zero and one unstable zero. Following the Equation 5.10, theNPZ-ignore feedforward controller function equals:

F =z3 − 0.4z2 − 0.25z + 0.1

(z − 0.5)(1 + 2)=z3 − 0.4z2 − 0.25z + 0.1

(z − 0.5) · 3

5.2.3 Zero-phase-error-tracking controller

ZPETC is also one of the popular methods to deal with the unstable zeros. This method alsoremains the stable poles and stable zeros, just as in NPZ-ignore. For the unstable zeros, they arereplaced by their conjugate zeros. By doing so, it keeps the control system zero phase error at anyfrequency in frequency domain.

To realize ZPETC, we should adjust the unstable zeros Bu(z) into Bzp(z) (Equation 5.12).

Bzp(z) =Bu(1)2zm

Bfu(z)

(5.12)

Where Bfu(z) means the flipped coefficients of Bu(z), m denotes the order of Bu(z). Then,

substitute Equation 5.12 into Equation 5.8, we get ZPETC feedforward controller.

F =A(z)

Bs(z)Bzp(z)=

A(z)Bfu(z)

Bs(z)Bu(1)2zm(5.13)

Thus, the relationship between trajectory and output is:

y

r= P · F =

Bu(z)Bfu(z)

Bu(1)2zm(5.14)

Where Bu(z) · Bfu(z)zm in Equation 5.14 compensates for the phase shift error, and make this error

zero at any frequency. Similar with NPZ-ignore method, Bu(1) is used to maintain the unity mag-nitude at 0Hz frequency. Hence, magnitude attenuation or error may occur in the high-frequencyarea. In summary, ZPETC can guarantee zero phase response error but not for magnitude.

For example, we still assume the same system transfer function as the one in the last part. Byusing the method of ZPETC (Equation 5.13), the feedforward function should be:

F =(z3 − 0.4z2 − 0.25z + 0.1)(2z + 1)

(z − 0.5)(1 + 2)2z=

(z3 − 0.4z2 − 0.25z + 0.1)(2z + 1)

(z − 0.5) · 9z

5.2.4 Zero-magnitude-error-tracking controller

Zero-magnitude-error-tracking control (ZMETC) is another possible method. In contrast toZPETC, ZMETC focuses on avoiding the error in magnitude response. Similarly, ZMETC keepsthe stable zeros and stable poles. For unstable zeros, by using ZMETC, these zeros are adjustedby flipping the coefficients of polynomial Bu(z) (Equation 5.15).

Bzm(z) = Bfu(z) (5.15)

Then, substitute Equation 5.15 into Equation 5.8:

F =A(z)

Bs(z)Bzm(z)=

A(z)

Bs(z)Bfu(z)

(5.16)

22 Feedforward motion control on a predictable embedded multi-core platform

Page 33: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 5. FEEDFORWARD TRACKING CONTROL DESIGN

With this feedforward controller, the relationship between trajectory and output equals:

y

r= P · F =

Bu(z)

Bfu(z)

(5.17)

Where the term Bu(z)

Bfu(z)

compensates for the error of magnitude response. Thus, by using ZMETC,

the magnitude response error would not happen at any frequency. However, there must be phaseshift error between the input reference and output because there is no any compensation for thisaspect. The phase shift error depends on the number of unstable zeros contained in polynomialBu(z).

Here we still use the same instance as the one used in the previous parts to illustrate how toapply ZMETC method. With Equation 5.17, we can compute the ZMETC feedforward function:

F =z3 − 0.4z2 − 0.25z + 0.1

(z − 0.5)(2z + 1)

5.2.5 Summary

In this part, we would summarize the characteristics three inversion-based feedforward methods:

- ZPETC can help the system avoid the phase response error at any frequency. However, themagnitude response error cannot be prevented.

- ZMETC focus on the good performance of magnitude response of the system in frequencydomain. However, the phase error always happen.

- NPZ-ignore includes both the phase response error and magnitude response error in fre-quency domain.

considering the properties of these three mentioned techniques of feedforward controller, ZPETCcould be the most suitable choice for this project. The most important factor of ZPETC is zerophase tracking error. In our work, we want to make the system track the desired input on time,and only ZPETC is possible to realize this purpose with a limited number of previews. However,ZMETC and NPZ-ignore cannot guarantee this aspect. In addition, although ZPETC may causemagnitude response error, a large error is only possible to happen if the trajectory is too complexor its frequency is too high, which is out of scope.

Feedforward motion control on a predictable embedded multi-core platform 23

Page 34: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 6

Simulation and results analysis

In this part, we start to design the controller and have simulation with MATLAB. Besides, wewould analyze how the sampling period and the sensing to actuating delay can affect the trackingperformance. These analysis can help us to propose the general design flow.

6.1 Design Flow of ZPETC

We use MATLAB to establish the state-space model of the system in this work. In addition, thefeedback controller is designed based on Ackerman’s Formula to realize the pole placement viastate feedback.

To realize the ZPETC feedforward approach, the general design flow for the MATLAB programis shown in Figure 6.1. Regarding other methods, the general design flow is similar. We just needto change the block ’ZPETC for unstable part’ into other feedforward methods.

Figure 6.1: The general design flow of ZPETC

24 Feedforward motion control on a predictable embedded multi-core platform

Page 35: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

6.2 Control system on Simulink

Figure 6.2 shows the control system for the simulation that is implemented on Simulink. The inputMATLAB function in this figure contains the ZPETC feedforward controller function. The outputof the MATLAB function represents F · r[k]. Besides, the feedback control block is connected tothe output of the augmented system. The computed value of this block denotes K · x[k]. Thesum of these two value is the system input u[k]. The output of the system is eventually comparedto the desired input to check the tracking performance. The difference between the desired inputand the system output is stored in the workspace for the further analysis.

Figure 6.2: Control system on Simulink

Inside the input MATLAB function, the transfer function for the feedforward controller (computedfrom Figure 6.1) sometimes might be non-causal because the polynomial order of numerator ishigher than that of denominator. Non-causality results that we cannot calculate the feedforwardoutput value by only using the previous value. Simulink is not able to directly apply this non-causal function into the simulation.

Therefore, we need to utilize the preview samples from the input profile to develop the feed-forward controller in Simulink. Since the input profile of the system is known in this work and thedecided feedforward control methods only need limited preview samples, using preview samplesis possible. In order to utilize preview samples, we should change the feedforward transfer func-tion (Equation 5.7) into Finite Impulse Response (FIR) form. We define the feedforward transferfunction as follow:

F =1

Caug(z · I − φaug − γaugK)−1γaug=yfr

=hnz

n + hn−1zn−1 + hn−2z

n−2 + . . .+ h1z1 + h0z

0

zm + bm−1zm−1 + bm−2zm−2 + . . .+ b1z1 + b0z0

(6.1)

where yf is the output of the feedforward controller. r is the desired input. hi for 0 ≤ i ≤ ndenotes the ith-order coefficient of the polynomial on numerator, and bl for 0 ≤ l ≤ m− 1 denotesthe lth-order coefficient of the polynomial on denominator. From Equation 6.1, we can get:

yf · (zm + hm−1zm−1 + hm−2z

m−2 + . . .+ h1z1 + h0z

0)

= r · (hnzn + hn−1zn−1 + hn−2z

n−2 + . . .+ h1z1 + h0z

0)(6.2)

Assume we have the condition that n > m, we can get the equation as follow:

Feedforward motion control on a predictable embedded multi-core platform 25

Page 36: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

yf [k] = hnr[k + p] + hn−1r[k + p− 1] + . . .+ hmr[k] + . . .+ h1r[k −m+ 1] + h0r[k −m]

−bm−1yf [k − 1]− bm−2yf [k − 2]− . . .− b1yf [k −m+ 1]− b0yf [k −m](6.3)

Equation 6.3 is processed by the input MATLAB function. In this equation, p = n −m, whichdenotes the number of needed preview samples. k is the kth value. We can find that we needpreview samples of desired input from r[k + 1] to r[k + p]. By using preview samples, we cansimulate the feedforward controller with a non-causal function in Simulink. Besides, using pre-view samples also help the system improve the system tracking performance. The unexpectedphase shift of the output response can be avoided. The results between the system response withpreview samples and without preview samples (compensate for the non-causality by adding puredelay) are illustrated in Figure 6.3.

In order to realize the input MATLAB function in this Simulink model, the function needs 5input slots to extract the associated data from the MATLAB program (shown in Figure 6.1).The details are shown in Figure 6.4. They are the coefficients of numerator polynomial (hi),the coefficients of denominator polynomial (bl), the needed number of preview samples (p), thesampling period (k), and the desired input (r[k]). With these data, all needed information relatedto Equation 6.3 is available, and the feedforward output yf [k] can be computed.

Figure 6.3: System response with preview by ZPETC

26 Feedforward motion control on a predictable embedded multi-core platform

Page 37: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

Figure 6.4: Control system on Simulink

6.3 System Response

After establishing the Simulink model for simulation, we need to observe the tracking performanceof this model. First, we should check the system response with a certain timing configuration toensure whether the controllers’ tracking behavior is as expected in this system under differentkinds of desired inputs. In this simulation, we use three kinds of desired input: single sinusoidwave (one single frequency and magnitude), mixed sinusoid wave (two different frequency andmagnitude), tooth wave (much different frequency and magnitude).

With different methods of the feedforward controller, the simulation results are shown in Fig-ure 6.5 to 6.7. According to these figures, we can find that the results are similar among threedifferent kinds of desired input. First, the static feedforward control is hard to precisely track thedesired input, so this method cannot be used to solve the tracking problem. For the rest of thefeedforward control methods, the tracking behavior meets the expectation. Among these threemethods, both NPZ-ignore and ZMETC contain phase response error, but in a different direction.This kind of error is much larger on ZMETC. However, the magnitude response error of ZMETC isclose to zero. ZPETC can track the input profile without phase error, and its magnitude responseerror is also acceptable. Comparing these different methods, ZPETC can achieve the lowest av-erage tracking error. Therefore, ZPETC has the best performance among all the methods. Table6.1 shows the comparison between different methods according to the simulation results.

Table 6.1: comparison of three feedforward methods

Method Phase error rank Magnitude error rankZPETC not occur 1 occur 3ZMETC occur 3 not occur 1NPZ-ignore occur 2 occur 2static gain occur 4 occur 4

Feedforward motion control on a predictable embedded multi-core platform 27

Page 38: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

Figure 6.5: System response with mixed sinus-oid wave

Figure 6.6: System response with sinusoid wave

Figure 6.7: System response with tooth wave

28 Feedforward motion control on a predictable embedded multi-core platform

Page 39: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

6.4 Tracking error against sampling period

Next, we use the established system to analyze the effect of the sampling period. In order tocheck how the tracking performance is affected by the sampling period, we should remove theinfluence by other factors. According to Equation 4.9, the sensing to actuation delay is anotherimportant factor that would affect the tracking performance. To compensate for the disturbancefrom the sensing to actuating delay, we keep the ratio between the sampling period and the sensorto actuator delay unchanged:

Dc = a · h (0 < a < 1) (6.4)

where a is a constant ratio, Dc denotes the sensing to actuating delay and h is the sampling period.Then Dc is replaced by a · h, and the equation for the augmented system is only affected by thesampling period. We define the desired input as a sinusoid wave. The results are shown in Figure6.8. We can see that the tracking performance is getting worse with the increase of the samplingperiod. In addition, the error within one interval is higher than that of the other part because thetracking performance is also determined by the number of unstable zeros contained in the system(see Figure 6.9). A Larger number of unstable zeros leads to a worse tracking performance in themost cases.

In conclusion, the relationship between the tracking error and the sampling period is monotonousin overall. Larger sampling period causes a worse tracking performance.

Figure 6.8: Overall trend of error against thesampling period (ZPETC)

Figure 6.9: Number of unstable zeros vssampling period (ZPETC)

6.5 Error against sensing to actuating delay

To simplify the timing for the rest of simulation, we set the sampling period as 10ms (0.01s). Thenwe adjust the sensing to actuating delay from 0s to 0.01s to observe the tracking performance.The results are illustrated in Figure from 6.10 to 6.12.

In Figure 6.10, we define the desired input as a sinusoid wave. Among the various feedforwardcontrol methods, we can find that the static feedforward control has the worst performance amongall the methods. Besides, the sensing to actuating delay cannot help optimize the tracking per-formance. Among the rest of three feedforward control methods, ZPETC has the best performance(lowest tracking error). In addition, we also define the desired input as a mixed sinusoid wave anda tooth wave which have been mentioned in Chapter 6.3. The relevant results are shown in Figure

Feedforward motion control on a predictable embedded multi-core platform 29

Page 40: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

6.11 and 6.12 respectively, and the performance trends of these figures are also similar.

The details of the tracking performance trend of ZPETC are illustrated in Figure 6.13 to 6.15. Bychanging the value of the sensing to actuating delay, different delay may cause a different numberof unstable zeros (Figure 6.16). Based on the formulation of ZPETC (Equation 5.15), in the mostof situation, a less number of unstable zeros leads to a less tracking error. This situation indicatesa better tracking performance. However, we can find that there is a peak when the sensing toactuating delay is 9ms in Figure 6.13 to 6.15, even though its number of system unstable zerosdecreases to one (Figure 6.16). The reason is that one system zero’s location is very close tothe unit circle (x : −0.99, y : 0.00). Since it has become a stable zero, the ZPETC controllerdirectly inverses the zero of the system. Then, the zero becomes the pole of the feedforwardcontroller. When there are some poles whose location is near the unit circle, according to the the-ory, these poles would cause fluctuation on the tracking performance. That might cause an evenbad tracking performance. The impact of the system zero location will be further discussed later.

Figure 6.10: Tracking performance againstsensing to actuating delay-sinusoid wave in Fig-ure 6.6

Figure 6.11: Tracking performance againstsensing to actuating delay-mixed sinusoid wavein Figure 6.5

Figure 6.12: Tracking performance against sensing to actuating delay-tooth wave in Figure 6.7

Additionally, when the number of unstable zeros is unchanged, the tracking performance trend isnot the same for different kinds of desired inputs.

30 Feedforward motion control on a predictable embedded multi-core platform

Page 41: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

Figure 6.13: Tracking performance againstsensing to actuating delay-sinusoid wave(ZPETC)

Figure 6.14: Tracking performance againstsensing to actuating delay-mixed sinusoid wave(ZPETC)

Figure 6.15: Tracking performance againstsensing to actuating delay-tooth wave(ZPETC)

Figure 6.16: number of unstable zeros againstsensing to actuating delay

Feedforward motion control on a predictable embedded multi-core platform 31

Page 42: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

One reason is that the sensing to actuating delay causes a response delay at the beginning ofthe simulation. The duration of this response delay equals the value of the sensing to actuatingdelay. Within this period, the system output is always zero and a large tracking error occurs. Thevalue of this kind of error is dependent on the input profile.

6.5.1 Bode diagram with various sensing to actuating delay

Another reason is that the various value of sensing to actuating delay has different magnituderesponse plots, which can be seen in Figure 6.17. Usually, the bandwidth becomes larger with theincremental delay. Besides, there is an intersection point among all the plots. If the frequency ofdesired input is less than this point, a larger delay is more optimal for the tracking performance.Otherwise, lower delay is desired for the tracking performance. Thus, for some relatively complexdesired input waves like the tooth wave, which is combined by various sinusoid waves with differentfrequencies and magnitudes, the system tracking performance is actually a response combinationof all its contained frequencies.

Therefore, the desired input would also influence the tracking performance. However, the in-put profile should be determined by customers, which is out of the scope. We can conclude thatdifferent desired inputs would cause different timing configuration for an optimal tracking per-formance.

In conclusion, within one constant sampling period, we should first find the feasible delay in-terval which includes the least number of unstable zeros for a better tracking performance. Then,within this interval, we should find the certain value of sensing to actuating delay which canprovide the best tracking performance. This value is dependent on the input profile. Normally,each different input may have a different result.

Figure 6.17: Bode diagram with different value of sensing to actuating delay

32 Feedforward motion control on a predictable embedded multi-core platform

Page 43: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

6.5.2 Impact on zero location

As we also mentioned, the location of zero which contained in the system would also be a factor toinfluence the system tracking performance. Figure 6.18 shows the location locus of all four zerosof the system from the sensing to actuating delay of 0ms to 10ms. Besides, the sampling period is10ms. Each color denotes one zero’s locus. When sensing to actuating delay is lower than 0.2ms,

Figure 6.18: Zeros’ location locus of system

all the system zeros are inside the unit circle, so all of them are stable zeros. When the delay ishigher than 0.2ms, two of these zeros become unstable (out of the unit circle). When the delayis higher than 8.9ms, the one of the unstable zero (the red line) become stable again. Hence, thenumber of unstable zeros decreases to one. Furthermore, we can find that the zero location isalmost the same when the delay is 0ms and 10ms. That is because when the delay is close to thesampling period, this delay can be approximately regarded as a pure delay which equals to onesampling period.

When the (stable) zeros start to be close to the unit circle, the fluctuation occurs on the sys-tem output. If this fluctuation is very large, the tracking performance would also be influenced.As can be seen in Figure 6.19, we use tooth wave as the input profile, and we can observe thatwhen sensing to actuating delay is 9ms, the fluctuation is the most serious. Because one of thezero’s location is closest to the line of the unit circle (Figure 6.20), which becomes a pole of thefeedforward controller. When sensing to actuating delay is 9.5ms, the tracking performance isbetter than that when the sensing to actuating delay is 8.5ms because the former situation hasless number of unstable zeros. Besides, the location of stable zeros are not comparatively close tothe unit circle, which are illustrated in Figure 6.21 and 6.22.

Moreover, in Figure 6.20 to 6.22, there should exist 4 system zeros. However, one zero’s loca-tion is far away from the circle, so its location cannot be displayed in these figures.

Feedforward motion control on a predictable embedded multi-core platform 33

Page 44: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

Figure 6.19: Zeros’ location locus of system

Figure 6.20: Zeros’ location locus of system-delay=9.0ms

34 Feedforward motion control on a predictable embedded multi-core platform

Page 45: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 6. SIMULATION AND RESULTS ANALYSIS

Figure 6.21: Zeros’ location locus of system-delay=8.5ms

Figure 6.22: Zeros’ location locus of system-delay=9.5ms

Feedforward motion control on a predictable embedded multi-core platform 35

Page 46: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 7

Implementation and validation

After the simulation and analysis, we focus on the implementation of ZPETC feedforward al-gorithm into CompSOC and validate whether the system response on the real embedded platformis the same as the simulation results.

7.1 ZPETC Implementation on CompSOC

We need at least two processor tiles to implement the whole control system. One is to executethe controller. The other is for the plant. These two tiles are connected by the Network-On-Chip(NOC) interconnection. In addition, we need another processor tile as a monitor tile to check thedata of system response. The overview architecture of the implementation with the platform isshown in Figure 7.1.

Figure 7.1: Implementation on CompSOC

Where the plant tile executes the state space model of the PATO system with a high frequency.In this work, we normally think that the plant tile runs the model continuously. The controllertile executes the three control tasks: sensing, computing and actuating task. These three tasks aremapped in TDM schedule. The overview of the control system on CompSOC is shown in Figure7.2. Each task is mapped in one partition slot.

7.1.1 Sampling period and sensing to actuating delay on CompSOC

In the Chapter 6, we consider that the sampling period and the sensing to actuating delay playimportant roles in the tracking performance. In order to implement a performance-aware control-ler, we should know how to calculate these two variables based on the mapped TDM schedule.The period of one TDM frame is:

PeriodTDM = Nslots × (p+ c) (7.1)

36 Feedforward motion control on a predictable embedded multi-core platform

Page 47: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 7. IMPLEMENTATION AND VALIDATION

where Nslots denotes the number of slots in one TDM frame. p and c represent the length partitionslot and CoMik slot in clock cycles. All of these values should be defined on CompSOC. In common,we think the period of one TDM frame equals the sampling period of the controller tiles if the threecontrol tasks run in order. That is the way that we calculate the sampling period on CompSOC.

Figure 7.2: Implementation on CompSOC

The sensing to actuating delay is:

Dc = NTa

slots × (p+ c) +Da + e(T ka ) (7.2)

where e(T ka ) ≈ 0. NTa

slots represents the number of slots before the slot of Ta in one TDM frame.Da denotes the defined sleeping time in the slot of Ta. Based on Equation 7.1 and 7.2, we canmap the control tasks according to the desired sampling period and the sensing to actuating delayon CompSOC.

7.1.2 Algorithm implementation on CompSOC

To implement ZPETC algorithm on CompSOC, we need to acquire the associated data of thefeedforward controller on the MATLAB program. ZPETC feedforward controller needs at leasttwo buffers and two arrays to store the data obtained from the MATLAB program: one buffer isto store the data of the desired input (buffer 1), one array is to store the coefficients of numerator(array 1), the other buffer is to store the computed feedforward controller output (buffer 2) andthe other array is to store the coefficients of denominator (array 2). The length of buffer 1 andarray 1 should be the same, and the length of buffer 2 and array 2 is the same. According toEquation 6.1, the length of array 1 and buffer 1 equals n. The length of array 2 and buffer 2equals m.

We get the transfer function of feedforward controller from MATLAB first. Then, export thedata of the coefficients of both numerator and denominator to the implementation code (Figure7.3), and stored into array 1 and 2. Besides, the value of the desired input is put into buffer 1,and the computed feedforward controller output is stored in buffer 2. The initial values inside thebuffers are all zero. Both of buffers use First-In-First-Out (FIFO) principle. As can be seen infigure 7.4, we import the desired input which starts at r[k + p]. When the new input profile isimported, all the data currently stored in the buffer would be shifted to the adjacent slot. Thedata inside the last slot would be moved out of the buffer. The computed controller output isstored in the buffer 2. When the new round starts, all the data inside the buffer 2 would be shiftedtoo. The concept is similar to buffer 1.

Feedforward motion control on a predictable embedded multi-core platform 37

Page 48: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 7. IMPLEMENTATION AND VALIDATION

Figure 7.3: Array 1 and Array 2 Figure 7.4: Buffer 1 and Buffer 2

The overview of the ZPETC implementation on CompSOC is shown in Figure 7.5. The block’ZPETC Feedforward Controller’ applies Equation 6.3, all the needed information can be foundin the buffers and arrays. We extract the Feedforward output signal F · r[k] from buffer 2. Then

Figure 7.5: Concept of ZEPTC on hardware

combine F · r[k] and K · x[k] to compute the control input u[k].

7.2 Results validation

In this part, we begin to validate that whether the system response on CompSOC is similar withthat on MATLAB. In Chapter 6.3, we have the associated simulation results of system response,where the sampling period is 10ms, and the sensing to actuating delay is 5.6ms. To check whetherthe system response on the real hardware is as the expectation, we should have the same timing

38 Feedforward motion control on a predictable embedded multi-core platform

Page 49: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 7. IMPLEMENTATION AND VALIDATION

configuration. Table 7.1 shows the configuration of the platform.

Table 7.1: Timing configuration

Parameters Value Comments UnitPartition slot 245904 Partition slot clock cyclesComik slot 4096 CoMik slot duration clock cyclesDa 60000 sleeping duration in Ta clock cyclesTDMslot 4 Slots within one TDM frame slots

The working frequency of platform is 100mHz. With Equation 7.1, we can compute that samplingperiod equals 10ms (1000000 clock cycles). In order to the get the expected sensing to actuatingdelay, we need to map the control tasks based on TDM manner. Because the expected sensing toactuating delay is 5.6ms, the actuating task should be inside the third slot of the TDM frame. Tokeep the sequence of the control process, the other two control tasks: sensing task and computingtask should be put in the first slot and second slot respectively. The task mapping is shown inFigure 7.6. If we consider that e(Ta) ≈ 0, with equation 7.2, we can calculate that the delay equals5.6ms.

Figure 7.6: Task mapping

The results comparison between CompSOC and MATLAB are shown in Figure 7.7 and 7.9. Wecan find that the difference (error) between the system response of MATLAB and CompSOC isvery small (Figure 7.8 and 7.10). One of the reasons which leads to the difference is that the smalldifference between the coefficients from MATLAB and CompSOC. We only keep seven decimalsplaces on CompSOC which is less than that on MATLAB. In addition, the real execution timeof Ta does not exactly equal zero. Thus, the actual sensing to actuating delay has some devi-ation from the expectation. Besides, the system model applied in Simulink and CompSOC mightalso have some difference. For these reasons, a small difference occurs between MATLAB andCompSOC. However, in general, the difference between MATLAB and CompSOC is limited, andthe system response on CompSOC is as expected.

Additionally, because the controller sampling period on the platform is 10ms, we can only get themeasured data based on the sampling period on the hardware. Hence, we cannot further measurewhether the transient tracking performance is the same as that on MATLAB.

Feedforward motion control on a predictable embedded multi-core platform 39

Page 50: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 7. IMPLEMENTATION AND VALIDATION

Figure 7.7: Tracking performance on MATLABand CompSOC-mixed sinusoid wave

Figure 7.8: Performance difference betweenMATLAB and CompSOC-mixed sinusoid wave

Figure 7.9: Tracking performance on MATLABand CompSOC-tooth

Figure 7.10: Performance difference betweenMATLAB and CompSOC-tooth

40 Feedforward motion control on a predictable embedded multi-core platform

Page 51: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 8

Gernal design flow for feedforwardcontrol

Since the system response on the real platform has been verified, we can propose a general designflow to implement the motion controller.

Figure 8.1: General Design flow for the controller

As can be seen in Figure 8.1, the general design is divided into three main parts. The first blockis about pre-work. Before starting the design of the controller, we need to know the characterist-ics of the plant (in order to establish the system model), a predictable platform (in our work isCompSOC), the requirements of tracking performance (to determine the suitable timing configur-

Feedforward motion control on a predictable embedded multi-core platform 41

Page 52: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 8. GERNAL DESIGN FLOW FOR FEEDFORWARD CONTROL

ation) and the input profile to be tracked. Only when all the pre-conditions are available, we canstart to design the controller. First, we should choose a suitable sampling period based on theperformance requirements by using sub design flow I, which is shown in Figure 8.2. In sub designflow I, the block ’ZPETC controller’ follows the design flow illustrated in Figure 6.1.

Figure 8.2: Sub design flow I

Then we need to find the suitable sensing to actuating delay with the decided sampling period inorder to achieve the most optimal tracking performance. Following sub design flow II (Figure 8.3),the sensing to actuating delay for the best tracking performance could be obtained. If the trackingrequirement with the decided schedule is met indeed, we can go to the next step. Otherwise, weneed to go back and re-determine the timing.

After defining the value of both the sampling period and the sensing to actuating, we start tomap the control tasks based on the TDM manner. If the chosen sampling period and the sensingto actuating delay can be mapped with TDM schedule, we export computed K and F (z) fromMATLAB program and implement the controller on the real embedded platform. The generalflow of the implementation on the embedded platform is illustrated in Figure 8.4.

42 Feedforward motion control on a predictable embedded multi-core platform

Page 53: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 8. GERNAL DESIGN FLOW FOR FEEDFORWARD CONTROL

Figure 8.3: Sub design flow II

Figure 8.4: General design flow for implementation

Feedforward motion control on a predictable embedded multi-core platform 43

Page 54: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Chapter 9

Conclusion and future work

This thesis focus on the design of the feedforward motion control on the embedded platform. Inour work, we need to find the suitable method for feedforward control first. Inversion method isthe basic concept for the feedforward controller. Among the three observed methods of feedfor-ward controller: ZPETC, ZMETC and NPZ-ignore, ZPETC is the most suitable for our work. Wederive a state-space model of the PATO system, and use this derived model in the simulation andtest analysis. Based on the results of the simulation test, we find that ZMETC causes the largestphase response error comparing to other methods, which indicates the largest average trackingerror. However, ZMETC has the lowest error in magnitude response. Thus, this method can helpthe system keep the magnitude of the desired input. NPZ-ignore also has the phase response error,but in the opposite direction comparing to ZMETC. Therefore, for NPZ-ignore, the phase shiftcauses a shorter system response time. This method may lead to the best tracking performance forthe constant reference, but not for other kinds of desired input. Besides, NPZ-ignore also includesthe magnitude response error. ZPETC prevents the phase response error for all the frequencies.That means the motion system can track the desired input on time with ZPETC. Besides, itsassociated magnitude error is acceptable. These mentioned properties let ZPETC has the lowestaverage tracking error per sample. Thus, ZPETC is the most suitable method to develop thefeedforward controller in our work.

Then, according to the simulation and analysis, we find that the sampling period and the sensingto actuating delay are two main factors to affect the system tracking performance. To design thefeedforward controller for the LTI system with the best timing configuration, we have designedthe general design flow for the platform-aware feedforward controller development, which has beendiscussed in Chapter 8. First, we need to choose a suitable sampling period to meet the basictracking performance requirement. Then, under the decided sampling period, we find the mostoptimal sensing to actuating delay. With the designed timing configuration, we implement theplatform-aware feedforward controller on CompSOC. The system response on CompSOC is almostthe same as the simulation one on MATLAB.

In conclusion, following the general design flow, we can develop the feedforward controller with anoptimal timing configuration for various LTI motion system on an predictable embedded platform.

9.1 Future work

We have concluded the general design flow for the feedforward controller, but there is still somespace for the further improvement. Here are some recommendations:

- We should consider about non-equidistant sampling period. The system does not alwaysexecute in the unique sampling period. As we know, different sampling periods cause different

44 Feedforward motion control on a predictable embedded multi-core platform

Page 55: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

CHAPTER 9. CONCLUSION AND FUTURE WORK

system models. We need to do more further research about the tracking performance in thissituation.

- Currently, we only focus on the platform-aware feedforward controller development basedon the PATO system. We should use the general design flow to develop the controller onthe other motion system (even on time-varying system), and observe whether the trackingperformance is still as expected.

- Limited by the sampling period, the platform cannot investigate the transient performancenow. If possible, we should establish another independent monitor to check the trackingperformance (include transient tracking performance) of the motion system.

- Some other factors can be taken into account to make the design flow more detailed, suchas the input limitation, system sensitivity and so on. Some tradeoffs between these factorscan be further researched.

- The platform only contains the control application now. In the future, we should add moreapplications into CompSOC to make the situation more practical. These applications ortasks are not related to the control application, but they can affect the task mapping andthen change the timing configuration. Then there should be a tradeoff between task mappingand tracking performance.

Feedforward motion control on a predictable embedded multi-core platform 45

Page 56: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

Bibliography

[1] ”ds1104 rd controller board cost-effective system for controller development”. https://www.dspace.com/en/pub/home/products/hw/singbord/ds1104.cfm. 7

[2] ”raspberry pi home page”. https://www.raspberrypi.org/. 8

[3] ”CompSOC home page”. http://compsoc.eu/, 2012. 1

[4] Matthijs Boerlage, Maarten Steinbuch, Paul Lambrechts, and Marc van de Wal. ”Model-basedfeedforward for motion systems”. 6

[5] M.S. Branicky, S.M. Phillips, and Wei Zhang. ”Stability of networked control systems: explicitanalysis of delay”. 2000. 17

[6] H.G.L. Breukers. ”Model-Based Design Of Embedded Control Systems”. 2016. 1

[7] J.A. Butterworth, L.Y. Pao, and D.Y. Abramovitch. ”Analysis and Comparison of Discrete-Time Feedforward Model-Inverse Control Techniques”. 2011. 21

[8] Jeffrey A. Butterworth, Lucy Y. Pao, and Daniel Y. Abramovitch. ”A Comparison of ILCArchitectures for Nanopositioners with Applications to AFM Raster Tracking”. 2011. 7

[9] T.M.P. Gommans. ”Nonlinear Controller Design for Linear Motion Systems”. 2008. 1

[10] Kees Goossens. ”NoC-Based Multiprocessor Architecture for Mixed-Time-Criticality Applic-ations”. 2017. 15

[11] Kees Goossens, Arnaldo Azevedo, Karthik Chandrasekar, Manil DevGomony, Sven Goossens,Martijn Koedam, Yonghui Li, Davit Mirzoyan, Anca Molnos, Ashkan Beyranv, Nejad, An-drew Nelson, and Shubhendu Sinha. ”Virtual Execution Platforms for Mixed-Time-CriticalitySystems: The CompSOC Architecture and Design Flow”. 2016. 2, 8, 13, 15

[12] Yong Keat Lee. ”Active vibration control of a piezoelectric laminate plate using spatial controlapproach.”. 2005. 6

[13] Andrew Nelson, Ashkan Beyranvand Nejad, Anca Molnos, Martijn Koedam, and Kees Goos-sens. ”CoMik: A Predictable and Cycle-Accurately Composable Real-Time Microkernel”.2014. vii, 14, 15

[14] Alan V. Oppenheim. ”Signals and Systems”. Prentice Hall India Learning Private Limited,1997. 2

[15] Rebecca M. Reck and R. S. Sreenivas. ”Developing an Affordable and Portable ControlSystems Laboratory Kit with a Raspberry Pi”. 2016. 8

[16] Brian P. Rigney. ”Adaptive Settle-Optimal Control of Servomechanisms”. 2008. 5, 7

[17] Derek Rowell. ”Analysis and Design of Feedback Control Systems: State-Space Representationof LTI Systems”. 2002. 2

46 Feedforward motion control on a predictable embedded multi-core platform

Page 57: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking

BIBLIOGRAPHY

[18] S. Thapanda Suresh. ”Feedforward Control on an Embedded Platform”. 2016. vii, 13, 14

[19] Jan Swevers. ”Trajectory tracking control and feedforward”, 2013. 6

[20] Masayoshi Tomizuka. ”Zero Phase Error Tracking Algorithm for Digital Control”. 1987. 5

[21] Masayoshi Tomizuka. ”On the Design of Digital Tracking Controllers”. 1993. 5

[22] Juan Valencia. ”Composable Platform-Aware Embedded Control Systems on a Multi-CoreArchitecture”. 2016. vii, 13, 15, 16, 19

[23] Juan Valencia, Eelco van Horsen, Dip Goswamiand Maurice Heemels, and Kees Goossens.”Resource Utilization and Quality-of-Control Trade-off for a Composable Platform”. 2015. 16

[24] Jurgen van Zundert and Tom Oomen. ”Inverting Nonminimum-Phase Systems from thePerspectives of Feedforward and ILC”. 5, 6

[25] Jurgen van Zundert and Tom Oomen. ”Resource-E cient ILC for LTI/LTV Systemsthrough LQ Tracking and Stable Inversion: Enabling Large Feedforward Tasks on a Position-Dependent Printer”. 2016. 5

[26] Jurgen van Zundert and Tom Oomen. ”Inverting Nonminimum-Phase Systems from thePerspectives of Feedforward and ILC”. 2017. 5

Feedforward motion control on a predictable embedded multi-core platform 47

Page 58: Eindhoven University of Technology MASTER Feedforward ... · platform timing con guration on the tracking performance. We nd that with di erent timing, it would cause di erent tracking