Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless...

93
Master of Science Thesis in Electrical Engineering Department of Electrical Engineering, Linköping University, 2016 Modeling and control of Risley prism beam steering including BLDC motors Oscar Gunnarsson

Transcript of Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless...

Page 1: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Master of Science Thesis in Electrical EngineeringDepartment of Electrical Engineering, Linköping University, 2016

Modeling and control ofRisley prism beam steeringincluding BLDC motors

Oscar Gunnarsson

Page 2: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Master of Science Thesis in Electrical Engineering

Modeling and control of Risley prism beam steering including BLDC motors

Oscar Gunnarsson

LiTH-ISY-EX--16/4938--SE

Supervisor: Erik JohanssonSaab AB, Training & Simulation, Huskvarna

Per LagervallSaab AB, Training & Simulation, Huskvarna

Sertac Erdemirisy, Linköpings universitet

Examiner: Johan Löfbergisy, Linköpings universitet

Division of Automatic ControlDepartment of Electrical Engineering

Linköping UniversitySE-581 83 Linköping, Sweden

Page 3: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

iii

Modeling and control of Risley prism beam steeringincluding BLDC motors

Oscar Gunnarsson

Division of Automatic ControlDepartment of Electrical Engineering

The Institute of Technology at Linköping UniversityLinköping, Sweden 2016

Training & SimulationBusiness Area Dynamics

SAAB ABHuskvarna, Sweden 2016

Page 4: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

iv

Modeling and control of Risley prism beam steering including BLDC motors

Oscar Gunnarsson

Copyright © 2016 SAAB AB

Automatic controlDepartment of Electrical EngineeringThe Institute of Technology at Linköping UniversitySE-581 83 LinköpingSwedenTelephone: +46-(0)13 281 000

Saab ABBusiness Area DynamicsTraining & SimulationSE-561 85 HuskvarnaSwedenTelephone: +46-(0)36 388 000

Page 5: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Sammanfattning

Saab AB Training & Simulation är specialiserade på militär träning, bland an-nat baserad på laser och för att fortsätta vara världsledande inom detta områdekrävs utveckling av en ny generation lasersimulatorer. För att underlätta utveck-lingsarbetet av detta högst komplexa system, har i detta examensarbete en simu-lerbar modell skapats i MATLAB/Simulink för att kunna simulera det elektro-opto/mekaniska system som beskriver deras laserbaserade simulatorplattform.Fokus för detta examensarbete har varit att modellera avlänkningen. Mer ingå-ende så modelleras de motorer som används för att rotera Risley-prisman så atten laserstråle uppnår önskad avlänkning. Med en bra modell av motorerna ap-pliceras ett reglersystem som styr de roterbara kilarna till referensposition. Re-ferenspositionen är dock komplicerad att beräkna eftersom avlänkningen frånflera roterande kilar beter sig högst olinjärt. För att göra detta finns flera till-vägagångssätt, men i detta examensarbete kommer det att göras genom att lösaoptimeringsproblem i MATLAB.

v

Page 6: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller
Page 7: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Abstract

Saab AB Training & Simulation is specialized on military training, including laserbased training. To continue being the world leader in this area, a new generationof laser simulators needs to be developed. To simplify the development of thishighly complex system, this master thesis have resulted in a MATLAB/Simulinkmodel which simulates the electro-opto/mechanical system representing theirlaser based simulation platform. The focus of this master thesis has been to sim-ulate and control the laser beam deflection. To be more precise, the motors usedto rotate the Risley-prisms deflecting the laser beam is modelled. With a goodmodel of the motors, a control system is applied steering the wedges to a refer-ence rotation angle. The reference rotation angle is difficult to calculate though,since the deflection following several rotary wedges is severely nonlinear. Thereare many ways to calculate the rotation angles, but in this master thesis it will bedone by solving optimization problems in MATLAB.

vii

Page 8: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller
Page 9: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Acknowledgments

First of all I would like to thank my supervisor Erik Johansson at Saab for hiscommitment and expertise as well as giving me this opportunity. My thanks alsogoes to my supervisor Per Lagervall and my co-workers at Saab AB Training &Simulation as well as my examiner at Linköping University Johan Löfberg andmy supervisor Sertac Erdemir for their help and guidelines during this masterthesis. Last but not least, my deepest gratitude goes to my family and friendswho have supported me throughout my studies and who made this possible.

Linköping, May 5, 2016Oscar Gunnarsson

ix

Page 10: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller
Page 11: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Contents

Notation xv

1 Introduction 11.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.5 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.6 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.7 Thesis outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Background 52.1 General background . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 The target simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 The fire simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.3.1 Estimating the target position using the laser beams . . . . 72.3.2 Deflection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3.3 Deflection system overview . . . . . . . . . . . . . . . . . . 112.3.4 Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Theory 133.1 Modeling the BLDC ring motors . . . . . . . . . . . . . . . . . . . . 13

3.1.1 Motor model . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1.2 Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.1.3 Commutation of the BLDC ring motor . . . . . . . . . . . . 17

3.2 Modeling the control system . . . . . . . . . . . . . . . . . . . . . . 183.2.1 Single P-controller . . . . . . . . . . . . . . . . . . . . . . . 183.2.2 PD-controller . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2.3 Cascaded P-controller . . . . . . . . . . . . . . . . . . . . . . 19

3.3 Modeling the Risley-prism refraction . . . . . . . . . . . . . . . . . 213.3.1 Ray tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.3.2 Calculating the intersection points . . . . . . . . . . . . . . 263.3.3 Vignetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

xi

Page 12: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

xii Contents

3.3.4 Distortion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.4 Solving the inverse deflection problem . . . . . . . . . . . . . . . . 283.5 Wedge configuration examples . . . . . . . . . . . . . . . . . . . . . 29

3.5.1 First example using two rotary wedges . . . . . . . . . . . . 293.5.2 Second example using three rotary wedges . . . . . . . . . 293.5.3 Third example using two rotary wedges and a flipping wedge 29

4 Method 334.1 Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.2 Modeling the motors . . . . . . . . . . . . . . . . . . . . . . . . . . 334.3 Choosing control loop and parameters . . . . . . . . . . . . . . . . 34

4.3.1 Single P-controller . . . . . . . . . . . . . . . . . . . . . . . 344.3.2 PD-controller . . . . . . . . . . . . . . . . . . . . . . . . . . 344.3.3 Cascaded P-controller . . . . . . . . . . . . . . . . . . . . . . 34

4.4 Solving the inverse deflection problem . . . . . . . . . . . . . . . . 344.4.1 Using fsolve . . . . . . . . . . . . . . . . . . . . . . . . . . 354.4.2 Using fmincon . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.5 Calculating the vignetting . . . . . . . . . . . . . . . . . . . . . . . 374.6 Calculating the distortion . . . . . . . . . . . . . . . . . . . . . . . 384.7 Creating the Simulink model . . . . . . . . . . . . . . . . . . . . . . 384.8 Simulating the whole system . . . . . . . . . . . . . . . . . . . . . . 38

5 Result 395.1 Motor model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395.2 The resulting control loops . . . . . . . . . . . . . . . . . . . . . . . 43

5.2.1 Single P-controller . . . . . . . . . . . . . . . . . . . . . . . 435.2.2 PD-controller . . . . . . . . . . . . . . . . . . . . . . . . . . 445.2.3 Cascaded P-controller . . . . . . . . . . . . . . . . . . . . . . 44

5.3 Solution to the inverse deflection problem . . . . . . . . . . . . . . 455.3.1 Using fsolve . . . . . . . . . . . . . . . . . . . . . . . . . . 455.3.2 Using fmincon . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.4 Vignetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535.5 Distortion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565.6 The Simulink model . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.6.1 Inverse deflection . . . . . . . . . . . . . . . . . . . . . . . . 585.6.2 Motor model . . . . . . . . . . . . . . . . . . . . . . . . . . . 585.6.3 Ray tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595.6.4 Simulating the whole system . . . . . . . . . . . . . . . . . 59

6 Discussion 676.1 Modeling the motors . . . . . . . . . . . . . . . . . . . . . . . . . . 676.2 Choosing control loop . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3 Solving the inverse deflection problem . . . . . . . . . . . . . . . . 686.4 Calculating the vignetting . . . . . . . . . . . . . . . . . . . . . . . 696.5 Calculating the distortion . . . . . . . . . . . . . . . . . . . . . . . 696.6 The Simulink model . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

Page 13: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Contents xiii

6.7 Simulating the whole system . . . . . . . . . . . . . . . . . . . . . . 70

7 Conclusions 717.1 General conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.2 Motor model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.3 Ray tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.4 Inverse deflection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

Bibliography 73

Page 14: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller
Page 15: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Notation

Abbreviations

Abbreviation Description

BLDC Brushless direct current motorBack-EMF Back electromotive force

P-controller Proportional controllerPD-controller Proportional and differential controller

MPC Model predictive controllere◦ Electrical degree (360 e◦corresponds to a complete cy-

cle of altering current)IMU Inertial measurement unitPWM Pulse-width modulationCAD Computer-aided design

Dictionary

Word Description

Risley-prism A glass prism shaped as a wedgeDistortion A change in the laser lobe shapeVignetting A reduction of laser intensityLaser lobe A laser beam shaped as a line by a laser beam integra-

torInverse

deflection Calculating the rotation of the Risley-prisms in orderto achieve a certain deflection angle

Commutation Produces an altering current to power the BLDC mo-tors

Aperture Describes the total area in which light can passAltitude Vertical angleAzimuth Horizontal angle

xv

Page 16: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

xvi Notation

Common notation

Notation Description

Vx The voltage on phase xRx The armature resistance on phase xLx The armature self-inductance on phase xix The current on phase xex The back electromotive force on phase xfx The shape of the back electromotive force on phase xKe The back electromotive force constantωm The rotor angular velocityθe The electrical angleθm The mechanical rotor anglep The number of polesTe The electromagnetic torqueTl The torque loadB The damping coefficientJ The moment of inertia

Vref The reference voltagegx The shape of the commutation on phase xP The total poweru The control signalKp The proportional gainr The reference motor angley The actual motor anglee The error between the reference motor angle and the

actual motor angley1 The actual motor angley2 The actual motor angular velocitye1 The error between the reference motor angle and the

actual motor anglee2 The error between the reference motor angular veloc-

ity and the actual motor angular velocityKd The derivative gainαxy The wedge opening angle for wedge x and surface yS The ray direction vectorS1 The incident ray direction vectorS2 The refractive ray direction vectora The surface normalb The unit vector parallel to the surfaceI1 The incident ray angleI2 The refractive ray angleN The surface normalz The unit vector perpendicular to both S and a

Page 17: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Notation xvii

Notation Description

Ψ The starting angle of the Risley-prismΦ The altitude angle of the final rayΘ The azimuth angle of the final rayn1 The refractive index of the media before the refractionn2 The refractive index of the media after the refractionL0 The vector to the starting position of the rayL0 The starting position of the rayD The scalar describing the length of the lineL The intersection pointL The vector to the intersection point LP0 A point on the surfaceP 0 The vector to the point P0 on the surfaceεx The orthogonal distance between the ideal lobe line

and the distorted lobe point xPx The distorted lobe point xLx The ideal lobe point xP x The vector to the distorted lobe point xLx The vector to the ideal lobe point xF The objective functionk The number of the current surfacen The total number of wedgesj The number of the current surfacep The total number of wedgesx The rotation angles of all wedgesS0 The first incident ray directionSn The final incident ray directionceq The nonlinear equality vectorAeq The linear equality A vectorBeq The linear equality B vectorq The total number of deflection grid pointsr The distance between the intersection point and the

z-axis

Page 18: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller
Page 19: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

1Introduction

This master thesis covers the modeling and control of a laser beam pointing di-rection using Risley-prisms which are rotated by brushless direct current (BLDC)motors, in MATLAB/Simulink. The thesis has been performed at the Researchand Development department at Saab AB Training & Simulation in Huskvarna,Sweden. This introduction chapter will cover a brief background and the prob-lem formulation.

1.1 Motivation

Saab AB Training & Simulation develops simulation platforms for military train-ing. In some of these applications it is crucial to control the pointing directionfor sending and receiving laser beams. In this application the pointing direc-tion is dynamic which creates a back- and forth-sweeping horizontal movementof the laser beam, following the vertical position of a projectile during its timeof flight. There are several deflection techniques to make this work and in thisreport the laser beam is sent through different configurations of Risley-prisms(wedge-formed prisms) rotated by BLDC (Brushless direct current) motors.

One configuration which is presented in this report uses two rotary Risley-prisms. The final sweeping deflection then depends on the deflection of bothRisley-prisms. For the laser beam to follow a deflection trajectory, the Risley-prisms are to be rotated in a nonlinear pattern.

1.2 Purpose

Saab AB Training & Simulation develop training solutions covering air, land,naval and civil security. The training solutions consist of training platforms

1

Page 20: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

2 1 Introduction

which aim to help the military experience the elements of combat in advance.The simulation platform simulates a combat with the intention of preparing sol-diers for authentic situations where the individuals train as they fight. The goalis to reduce the time and resources needed for the crews to become experiencedand react automatically under pressure. Saab AB Training & Simulation aims tostudy new solutions which are more compact, precise and produced to a lowercost. Regarding developing a new fire simulator used to simulate the engage-ment, it is important to control the deflection of laser lobes. The thesis plan isto create a modular simulation platform in MATLAB/Simulink, simulating dif-ferent prisms, motors and control configurations which can be evaluated by thedeflection characteristics.

The starting configuration is to use two rotary Risley-prisms, which comparedto previous products ought to reduce the number of components, power con-sumption and also product size. However, the new fire simulator would becomemore complex and require components with a higher performance in order toretain and increase product performance. Therefore each Risley-prism will becontrolled with a high performance BLDC ring motor which has a high power tosize ratio.

This electro-opto/mechanical system is to be built up in MATLAB/Simulinkso that one easily could identify possible problems and compare how parameterssuch as e.g. motor parameters and wedge configurations impact the whole systemfunctionality. In this way different control loops, motor parameters can be com-pared and verified if they are sufficient enough for the product requirements. Bysimulating the system behaviour, one can determine where to tune and improvethe product without having to modify the real product. A simulation platformbuilt in MATLAB/Simulink becomes modular and components can be changedeasily for test purposes without having to rebuild the hardware.

1.3 Objective

The objective of this master thesis is to model the electro-optical/mechanicalsystem of Risley-prisms rotated by BLDC ring motors in MATLAB/Simulink.An overview of the system can be seen in Figure 2.5. The configurations ofprisms and motors ought to be modular and thereby easily replaced and modi-fied. The BLDC ring motor model should include variable loads, friction in bear-ings, power and torque in motors, as well as the characteristics of the opticalencoder disc which encodes the angular position of the Risley-prism. The BLDCmotor is controlled by a control system and a reference rotation angle generatorwhich are included in the model.

Furthermore, choose the best control system that takes the real limitations inprocessor performance and electrical power into account. The parameters andcontrol system are to be implemented in motor drive circuits, FPGA and micro-processor software. Integration of the software with the hardware and evaluatingif the angular accelerations and step responses are sufficient enough to providegood tracking using different operating points.

Page 21: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

1.4 Limitations 3

Since the aims of the fire simulator is to deflect a laser beam it is also impor-tant to implement a ray tracing algorithm so that the laser beam deflection canbe evaluated for different prism, motor and control configurations. The configu-ration should also be possible to evaluate regarding distortion and vignetting.

1.4 Limitations

In the simulation platform made by Saab Training & Simulation in which thedeveloped model might be used, there are more components and dynamics whichwill not be discussed in this report. Even though there are several techniques todeflect a laser beam, this master thesis will only cover laser beam steering byRisley-prisms which are rotated by BLDC motors. To steer the laser beam, amaximum of four Risley-prisms are used for which at most three are rotary, butthe model can easily be extended for more rotary or fix Risley-prisms and BLDCmotors.

1.5 Method

The first four weeks of the master thesis consisted mainly of literature studiesand writing a planning report. Thereafter the BLDC motor model was createdin MATLAB/Simulink. An iterative process started comparing and tuning themotor model to match a real BLDC motor. When a suitable match was found, acontrol system was implemented and designed to satisfy the performance require-ments. The ray tracing algorithm was created in MATLAB/Simulink and givenan incident ray, the wedge deflection could be calculated. A halfway presentationof the master thesis was made together with the examiner and the master thesiswas evaluated to be on schedule and the examiner approved to continue the mas-ter thesis. Further work on the MATLAB/Simulink model was made and to beable to control the deflection, the inverse deflection problem was solved. Nowthe rotary wedges could be given a reference rotation angle so that the acquireddeflection angle could be achieved. Finally, scripts to calculate the vignetting anddistortion were made so that a wedge configuration could be evaluated.

1.6 Related work

Using Risley-prisms for laser beam steering is not new, it has been done before.The easy part of laser beam steering using rotary Risley-prisms is to trace the rayand calculate the resulting deflection given specific rotation angles of the Risley-prisms. The harder part is to estimate the rotation angles of the Risley-prismsgiven desired deflection angles. Both problems and possible solutions are cov-ered in the following articles but each with a different approach. Yayun [2011]and Yaguang [2008] gives an analytical solution to the inverse deflection problem.Amirault and DiMarzio [1985] gives a first-order approximation of the wedge ro-tation angles given a desired deflection angle. On the other hand, Yayun [2011]

Page 22: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

4 1 Introduction

gives a more correct estimation of the wedges rotation angles by a third-order ap-proximation. In order to evaluate the approximation methods mentioned before,Yafei [2013] has made both theoretical and experimental comparisons betweenthem to see when and how much they differ. In Yuan [2013], follows a discussionof limited regions and the singularity points for which the angular velocity de-mands becomes too high for the physical motor to handle. Physical failures andhow much they impact on the final result is covered in Yuan [2014].

Since BLDC motors have increased rapidly in popularity the last couple ofyears, there is a large amount of literature on modeling and control of BLDC mo-tors. Petersson [2009], Mozaffari [2012] and Mozaffari [2014] describes how tocontrol the motors with no sensors and one can use similar equations to modelthe motors used in this thesis. Techniques to reduce the torque ripple occurredby the commutation is covered in Jiancheng and Bangcheng [2012]. Similar equa-tions are used in Lenine [2007] which describes how to estimate the rotor positionand speed with an extended Kalman filter. A detailed way of simulating a BLDCmotor in MATLAB is also covered in Fedák and Záskalický [2012], Tibor andDurovsky [2011],Muruganantham [2010] and Baldursson [2005]. The Phd-thesisLiangtao [2008] describes how to control a BLDC motor using adaptive controland Preindl and Bolognani [2013] describes a way of using model predictive con-trol to control a permanent magnet synchronous motor. Kamal [2014] and Ram-babu [2007] uses a PI-controller and fuzzy based control algorithms to controlthe BLDC motors and Nilsson and Modrack [2013] covers commutation meth-ods. Devisree [2013] describes the voltage source inverter and how it switchesthe voltage for the BLDC motor phases.

1.7 Thesis outline

The master thesis is starting with Chapter 1 which describes the problem for-mulation and also gives some background to the master thesis. After the intro-duction comes Chapter 2 which gives a deeper understanding of the productand how it works. Chapter 3 comprises the theory of how to model the electro-opto/mechanical system in MATLAB/Simulink based on literature studies. Chap-ter 4 describes the method of how to implement and evaluate the theory in MAT-LAB/Simulink. The results are then presented in Chapter 5 which shows theperformance of the simulated electro-opto/mechanical system. After the resultsfollows Chapter 6 regarding the method, results and what further work could becarried out, followed by the conclusions in Chapter 7.

Page 23: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

2Background

This chapter includes some background of the simulation platform made by SaabAB Training & Simulation. First some general information about the simulationplatform and after that an explanation of the fire and target simulators with moredetails on the functionality of the deflection system in the fire simulator which isbeing modeled in this master thesis.

2.1 General background

Saab AB Training & Simulation produce a simulation platform making militarytroops able to simulate engagements without using any live ammunition. Thesimulation platform consists of a fire and a target simulator. The deflection con-trol covered in this master thesis is located inside the fire simulator. The firesimulator is a small laser source which is placed on each weapon used in the com-bat simulation. Each target are given a target simulator. The target simulatormainly consist of prisms and detectors which reflect and receive the laser lobestransmitted by the fire simulator.

2.2 The target simulator

A target simulator mainly consists of prisms and detectors which reflects andreceives data from the laser beam sent out from the fire simulator. A target is apredefined area around the reflector seen from the fire simulator. A target canhave more than one reflectors and therefore the target system is the system thatevaluates a hit depending on the firing system ammunition type, the hit pointand the target vulnerability.

5

Page 24: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

6 2 Background

2.3 The fire simulator

The fire simulator consists of laser sources that sends out three laser lobes whichcan be seen in Figure 2.1. The laser lobes are then swept back and forth in hor-izontal direction over the surroundings. The simulator platform knows whichweapon is used and can thereby determine the ballistics of the projectile. Whenthe gun is fired, the sweep follows the fictive projectile holding the same verti-cal angle and sweeping horizontally. If the gun is shaken or moved during theprojectile time of flight, an IMU (inertial measurement unit) keeps track of themovement which corrects the projectile position seen from the fire simulator mak-ing the sweep always following the projectile. Of course there are limitations, theweapon can not be moved unlimited. But since the projectile time of flight isrelatively short, the projectile soon reaches maximum length before the weaponis moved to the limit. If the sweeping laser lobes pass a target prism, the laseris reflected back to the fire simulator which acknowledge the target position byknowing in which direction the laser beams were sent. The fire simulator alsokeeps track of how far the projectile has travelled and can thereby decide if theprojectile hits the acknowledged target or not by checking if the projectile havethe same distance as the target and if the projectile is inside the target hitbox(see Figure 2.2). The projectile simulation will continue until it hits a target orreaches the maximum simulation range. For each acknowledged targets, the firesimulator sends the projectile position, ammunition type and weapon identity tothe target simulator using laser pulses.

Figure 2.1: A sketch showing the laser lobes during a sweep from left toright. The red solid bold lines describe the laser lobe right now. The threedashed lines to the left describe the laser lobes at a previous time of thesweep and the three dashed lines to the right describes the laser lobes at atime in the future. The lobes are numbered 1,2,3 starting from the left.

Page 25: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

2.3 The fire simulator 7

2.3.1 Estimating the target position using the laser beams

The target altitude and azimuth position can be calculated from the two outerlaser lobes. If the sweep goes from left to right, the right laser lobe will hit thetarget first. Since the laser position inside the lobe is unknown, one can only ex-tract the distance between the projectile and the target in 90◦direction from theright lobe. When the laser beam is reflected from a target prism, the laser pulsedistance is changed to a pulse distance which corresponds to the length betweenthe laser lobe and the projectile. The target simulator detector detects the changein laser pulse distance and extracts the projectile position sent by the fire sim-ulator. When the laser lobe have passed the prism, the pulse distance is reset.Afterwards the middle laser lobe passes the target prism and the pulse distanceis changed again to send information about e.g. ammunition type. The pulse dis-tance is then reset after the laser lobe has passed the prism. When the left laserlobe later on hits the target prism, the fire system knows the 90◦distance fromthe left lobe to the target. The fire system then knows the target position and canthereby tell how far away the projectile is from the target (see Figure 2.2). Thepulse distance is changed to a pulse distance which corresponds to the lengthbetween the left laser lobe and the projectile. Since the position of the targetis based on knowing the exact deflection angle of the laser lobes, it is very im-portant to be certain of the laser lobe deflection. Another important factor forthe system to work is the horizontal sweep speed. For the target simulator plat-form to be able to interpreter the correct projectile position, the horizontal sweepspeed must be constant during the sweep. These are some of the problems thatneeds to be solved for the new fire simulator to work and are discussed in thismaster thesis.

2.3.2 Deflection

The aim of this master thesis is to model and simulate a possible new fire simula-tor and evaluate the system regarding the deflection and sweep properties. Thefinal model is simplified and does not cover the whole fire simulator, but this isa good start to simulate the whole system further on. Dynamics which are notincluded in this master thesis are e.g. the laser pulses which are used to commu-nicate with the target simulator. A sweep position is decided by the projectileposition. The sweep shall always sweep around the projectile and therefore holdthe same vertical angle as the projectile, sweeping horizontally with the projectilein center. A sweeping movement of the laser beam is accomplished by rotatingthe two Risley-prisms. Depending on where in the deflection area the sweepis made, the rotation of the Risley-prisms become more or less nonlinear. TheRisley-prisms are rotated by BLDC ring motors which makes the fire simulatorcompact and effective. The derived models used in this master thesis aims to sim-ulate the real hardware e.g. the BLDC ring motors and also the software such asthe control system.

Given the desired deflection angles in altitude and azimuth (vertical and hori-zontal direction), the deflection module of the fire system decides which rotation

Page 26: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

8 2 Background

Figure 2.2: Image courtesy of Saab AB, Training & Simulation showing asketch of how the target position is estimated during a sweep from the left.The three lobes on the left (green) shows the first sequence, when the thirdlobe hits the target prism (the white circle in the middle of the tank). The firesystem does not know where in the lobe, the prism is hit, but calculates theperpendicular distance from the third lobe to the projectile. The distanceis sent to the target simulator by changing the laser pulse distance. Thesecond sequence, when the second lobe passes the target prism (the threeblue lobes in the middle), information about the ammunition is sent to thetarget. In the third sequence, when the first lobe passes the target prism (thethree red lobes to the right), the perpendicular distance from the first lobeto the projectile is calculated and sent to the target system. Both the firesimulator and the target simulator then knows the position of the target andthe position of the projectile and can decide whether or not the projectile hitsthe hitbox or not (shown in darker grey). For a color version of this figure,the reader is referred to the online version.

angle to use for the two rotary wedges. The rotating wedge angles can be cal-culated by solving a ray tracing optimization problem. The ray is traced usingSnell’s law in vector form which is described in Section 3.3. When the deflectionangle is given, the inverse deflection problem is solved, giving a control systemthe reference rotation angle of the Risley-prisms. The control system outputs avoltage reference to feed the motors. A commutation then use the voltage ref-erence to create a three phase voltage to power the BLDC motor. By applyingvoltage on the three phases of the BLDC motor, the motor is turned and the Risley-prisms rotated into the desired position and thereby the laser beam is pointingin the desired deflection angles.

The laser source sends out three laser lobes which are spread out in space overa span in angle and is visualized in Figure 2.3. The figure also shows nine lobepoints which represents the end and middle points of the laser lobes. The laser

Page 27: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

2.3 The fire simulator 9

lobe consist of infinitely many lobe points but for this master thesis it is said tobe enough to evaluate three extreme points of one lobe to estimate its distortion.Seen from the laser source, all laser points except number five have a small angledeviation in altitude and/or azimuth. The laser lobes hits a paraxial lens, whichmeans that the ray passing point five passes straight through and hits the firstwedge behind the paraxial lens with no altitude and azimuth angles. Since allother points have a slight angle deviation into the paraxial lens, the refractionwill also have a small altitude and azimuth angle. The small angle deviation inthe beginning leads to a distortion in the final deflected laser lobes which canresult in estimation errors of the target position. Therefore it is also importantto take the deviation and distortion into account when solving the optimizationproblem mentioned above.

Figure 2.3: A figure showing the three laser lobes together with nine pointson the laser lobes. The points are placed in the ends and in the middle of thelaser lobes. In this way the distortion of the laser lobes can be investigated.Each point have a certain altitude and azimuth angle except the center point(lobe point 5).

Vector model of the inverse deflection problem

To easier understand the deflection made by a Risley-prism and the complexityof combining many Risley-prisms, the deflection of a Risley-prism can be seen asa vector resultant describing the deflection made by that wedge. Simplifying thevector model and assuming that the incident ray have no azimuth and altitudeangle, the vector length of a Risley-prism deflection depends on the opening an-gles of the wedges (see Figure 3.7) and the direction of the vector is dependenton the rotation angle of the wedge. Combining two rotary wedges results in twovectors and the final deflection angle can be seen as the vector resultant of thosetwo. A sketch of the vectors can be seen in Figure 2.4 and Figure 3.6.

The final deflection is supposed to sweep horizontally back and forth. Ap-plying this to the vector model, the end tip of the second dotted vector (in Fig-ure 2.4) which represents the final deflection is supposed to sweep horizontally.The sweep speed is supposed to be constant but the nonlinear rotation trajec-tory of the wedges (the trajectory of the vector direction) means that the wedgesneeds to be accelerated and retarded to follow the sweep with a constant velocity.

Page 28: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

10 2 Background

Figure 2.4: A sketch of the two dotted (blue and orange) vectors representingtwo rotary prisms and the solid final deflection vector (red). The vectorsdescribe the deflection angles in altitude Φ and azimuth Θ (deflection anglesin vertical and horizontal direction).

Sweeping in an area far away from the origin (zero altitude and azimuth deflec-tion), the movements of the vector directions are small and thereby the wedgeacceleration is small. Closer to the origin, the accelerations increase which anddepending on the sweep speed and the motor performance, the motor might notbe able to follow the rotation angle trajectory.

Since most sweeps are done for small final deflection angles, this behaviouris highly undesirable and it is therefore one of the main problems to be analyzedin this master thesis. By simulating the rotation needed acceleration, the per-formance could be evaluated for different motor and wedge configurations. Toavoid high accelerations for small final deflection angles one way is to also usetwo fix prisms, one in front of the rotating prisms and one behind. The purposeof these prisms is to offset the origin for the two rotary wedge vectors. In this way,the high accelerations will end up in another deflection area which is less likelyused.

Another way of using the vector model of the inverse deflection is to define thefield of regard. The field of regard is defined as all reachable deflection angles.Using the vector model presented above with zero incident angles, it becomesclear that for one rotary wedge, the reachable deflection angles are defined bya circle of radius equal to the vector length. The field of regard it then definedas this circle. For two rotary wedges, two vectors are used and the maximumreachable deflection angles are reached by letting both vectors have the samedirection. All deflection angles can be reached inside this circle which makesthis circular disc the field of regard for two rotary wedges. Adding another rotarywedge leads to a field of regard represented by a circular disc with radius equalto the sum of all three vectors and so on.

The vector model can also be used to get an intuition in how many possibleways a final deflection angle can be obtained. Take the case with only one vector,each point in the field of regard (on the circle) can be reached in one way. Havingtwo rotary wedges, the boundary points of the field of regards can be reached inone way. But all other points inside the circle can be reached twice and the origin

Page 29: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

2.3 The fire simulator 11

in infinitely many ways. Increasing the problem to three vectors, the boundarypoints of the field of regards are reached in one way. But all other points insidethe circle can be reached in infinitely many ways.

2.3.3 Deflection system overview

Figure 2.5 shows an overview of the wedge configuration and deflection systemused in the example presented in Section 3.5.1). The deflection of the laser lobesare controlled using two BLDC ring motors which rotates two Risley-prisms.Given a desired deflection angle (Θ - azimuth, Φ - altitude), the inverse deflec-tion problem is solved giving the wedge angle reference (θref ) so that the desireddeflection can be achieved. A control system then takes the reference wedge an-gle (θref ) and the estimated actual wedge angle (θ) and wedge angular velocity

( ˆθ) and outputs a voltage reference (Vref ) for each BLDC motor. The voltage refer-ence is discretized into a PWM (Pulse-Width Modulation) signal which is passedon to the commutation. The discretized voltage reference (Vref ) is commutedinto three phase voltages (VA, VB, VC), depending on the estimated actual wedgeangle (θ).

2.3.4 Sweep

A sweep sequence is divided into three phases. One acceleration phase wherethe deflection is accelerated with a constant positive angular acceleration up toa certain velocity. Followed by the constant phase, where the deflection holds aconstant velocity. The last phase is the retardation phase where the velocity isretarded with a constant negative angular acceleration to 0 rad/s. Even thougha sweep sequence is divided into three phases, a sweep is said only to be themiddle phase, when the horizontal sweep speed is constant. Sweeping is onlydone in horizontal direction meaning that the laser beam only sweeps horizon-tally around the projectile. When making a sweep in different deflection areas,it is important to verify which acceleration is needed from the BLDC motors aswell as their power consumption. It is therefore important to simulate both thedeflection and the BLDC motors during a sweep.

Page 30: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

12 2 Background

Figure 2.5: An overview of the system that is modeled in this master the-sis. In the top there is the physical system with a laser source, four Risley-prisms and two BLDC ring motors. The BLDC motors are controlled withthree phase voltages (VA, VB, VC) coming from the commutation. The com-mutation derives the phase voltages from the estimated actual wedge angle(θ) given by an optical disc encoder and the voltage reference (Vref ) given bya control system. The reference voltage is calculated from the control systemusing the estimated rotor angle (θ) and angular velocity (ω) together withthe reference rotor angle (θref ). The reference rotor angle is derived by solv-ing the inverse deflection problem which takes the desired deflection angles(Θ - altitude, Φ - azimuth) and calculates the needed rotation angles of thewedges so that the desired deflection is achieved.

Page 31: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3Theory

This chapter covers the theory of modeling the electro-optic/mechanical system.The chapter mainly covers modelling the BLDC motors, the motor control system,the ray tracing and the inverse deflection problem.

3.1 Modeling the BLDC ring motors

3.1.1 Motor model

The BLDC ring motors used in this master thesis are star winded with a sinu-soidal back electromotive force (back-EMF). The BLDC motor can be modeledin similar manner as a three phase synchronous motor according to Tibor andDurovsky [2011]. Figure 3.1 shows a circuit schematic of the BLDC motor. UsingKirchoff’s voltage law, the mathematical model of the BLDC ring motor can bedescribed as

VaVbVc

=

Ra 0 00 Rb 00 0 Rc

iaibic

+

La 0 00 Lb 00 0 Lc

diadtdibdtdicdt

+

eaebec

(3.1)

Ua, Ub and Uc in Equation (3.1) represents the voltage over the three phasesa, b and c. ia, ib and ic represents the current of the three phases. Ra, Rb and Rcdenotes the armature resistance and likewise, La, Lb and Lc denotes the armatureself-inductance. ea, eb and ec is the back electromotive force (back-EMF) createdby the movement of the rotor which is derived by Equation (3.2) given in Tiborand Durovsky [2011].

13

Page 32: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

14 3 Theory

Figure 3.1: A schematic of the star winded BLDC motor with the threephases A, B and C. The phase currents are represented by ia, ib and ic. Thephase voltage is represented by Va, Vb and Vc. Ra, Rb and Rc is the armatureresistance and La, Lb and Lc is the armature self-inductance. ea, eb and ecrepresents the back electromotive force produced by the rotor.

eaebec

= Keωm

fa(θe)fb(θe)fc(θe)

(3.2)

ωm in Equation (3.2) is the rotor angular velocity and Ke is the back-EMFconstant. θe is the electrical angle, given by Equation (3.3) where θm is the me-chanical rotor angle and p the number of poles in the BLDC motor (Tibor andDurovsky [2011]).

θe =pθm

2(3.3)

fa, fb and fc in Equation (3.2) are functions of θe (the electrical angle of therotor) representing the back-EMF shape which can be either trapezoidal or si-nusoidal depending on the winding of the motor. Under the assumption thatRa = Rb = Rc = R, La = Lb = Lc = L and Equation (3.2) holds, Equation (3.1) canbe written as VaVb

Vc

= R

iaibic

+ L

diadtdibdtdicdt

+ Keωm

fa(θe)fb(θe)fc(θe)

(3.4)

Page 33: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.1 Modeling the BLDC ring motors 15

Rewriting the differential Equation (3.4) on a state space form results indiadtdibdtdicdt

=1L

VaVbVc

− RLiaibic

− KeωmLfa(θe)fb(θe)fc(θe)

(3.5)

Furthermore, a mechanical relationship between the stator and rotor is needed.The electromagnetic torque Te can according to Lenine [2007] be derived as

Te =iaea + ibeb + icec

ωm(3.6)

The torque in relation to the actual speed of the BLDC ring motor is alsodescribed in Lenine [2007], giving

Te − Tl = Bωm + Jdωmdt

(3.7)

J in Equation (3.7) is the moment of inertia, B is a damping coefficient and Tlis the torque load. Combining Equation (3.6) and Equation (3.7) yields

dωmdt

=iaea + ibeb + icec

Jωm− Tl −

BωmJ

(3.8)

Inserting Equation (3.2) into Equation (3.8) gives

dωmdt

=Ke(iafa(θe) + ibfb(θe) + icfc(θe))

J− Bωm

J(3.9)

As mentioned above, the relation between the electrical angle and mechanicalangle is θe = pθm

2 . Differentiating both sides in time gives Equation (3.10) whichalso is included in Lenine [2007].

dθedt

=pωm

2(3.10)

Using Equation (3.5), Equation (3.9) and Equation (3.10), the BLDC ring mo-tor can be modeled in state space form as

x =

iaibicωmθe

=

−RL 0 0 −Kefa(θe)L 00 −RL 0 −Kefb(θe)

L 00 0 −RL −Kefc(θe)L 0

Kefa(θe)J

Kefb(θe)J

Kefc(θe)J −BJ 0

0 0 0 p2 0

︸ ︷︷ ︸A

iaibicωmθe

︸︷︷︸x

+

1L 0 0 00 1

L 0 00 0 1

L 00 0 0 −1

J0 0 0 0

︸ ︷︷ ︸B

VaVbVcTl

︸︷︷︸u

(3.11)The the commutation of the BLDC motor can be written as a function of the

rotor position and the reference voltage.

Page 34: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

16 3 Theory

VaVbVc

=

ga(θe)gb(θe)gc(θe)

Vref (3.12)

Inserting Equation (3.12) into Equation (3.11) results in

x =

iaibicωmθe

=

−RL 0 0 −Kefa(θe)L 00 −RL 0 −Kefb(θe)

L 00 0 −RL −Kefc(θe)L 0

Kefa(θe)J

Kefb(θe)J

Kefc(θe)J −BJ 0

0 0 0 p2 0

︸ ︷︷ ︸A

iaibicωmθe

︸︷︷︸x

+

1Lga(θe) 01Lgb(θe) 01Lgc(θe) 0

0 −1J

0 0

︸ ︷︷ ︸B

[VrefTl

]︸︷︷︸

u

(3.13)The commutation method used in this master thesis is trapezoidal (discussed

in Section 3.1.3) which means that the function ga, gb and gc takes either +1/2,-172 or 0 depending on the phase and the electrical rotor angle. The trapezoidalcommutation characteristics are presented in Table 3.1. The back-EMF for theBLDC motors used in this master thesis is sinusoidal, that means that Equa-tion (3.14) holds.

fa(θe)fb(θe)fc(θe)

=

sin(θe)sin(θe − 2π

3 )sin(θe + 2π

3 )

(3.14)

Inserting Equation (3.14) into Equation (3.13) gives

x =

iaibicωmθe

=

−RL 0 0 −Ke sin(θe)L 0

0 −RL 0 −Ke sin(θe− 2π3 )

L 0

0 0 −RL −Ke sin(θe+2π3 )

L 0Ke sin(θe)

JKe sin(θe− 2π

3 )J

Ke sin(θe+2π3 )

J −BJ 00 0 0 p

2 0

︸ ︷︷ ︸A

iaibicωmθe

︸︷︷︸x

+

+

1Lga(θe) 01Lgb(θe) 01Lgc(θe) 0

0 −1J

0 0

︸ ︷︷ ︸B

[VrefTl

]︸︷︷︸

u

(3.15)

Page 35: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.1 Modeling the BLDC ring motors 17

3.1.2 Power

Since the simulator platform is supposed to be small and portable, the BLDCmotors can not consume too much power. Therefore the model includes powerequations to keep track of how much power the product consumes. The powerconsumption of the BLDC motor is given as the voltage times the current, for allthree phases.

P = Vaia + Vbib + Vcic (3.16)

3.1.3 Commutation of the BLDC ring motor

There are mainly two ways of commuting a BLDC motor, either trapezoidal com-mutation or sinusoidal commutation. The trapezoidal commutation is the easiestone, with only three possible outputs which alter in six different electrical rotorangle intervals. This makes the control sequence of driving the BLDC motor onerevolution look like a trapezoid pattern (which can be seen in Figure 3.2), giventhat the reference voltage is constant. The sinusoidal commutation on the otherhand commutes the BLDC motor as a phase shifted sine wave which creates amagnetic field orthogonal to the magnets and therefore gives a smoother torque.

Trapezoidal commutation

Trapezoidal commutation is the simplest kind of commutation used for threephase BLDC motors. It takes the voltage reference and depending on the rotorposition, the trapezoidal commutation outputs either 0, positive or negative thehalf voltage reference on the three phases. Note that it takes the half voltage refer-ence since the BLDC motor use two legs the same time and the total voltage overthe both legs are summed up to be the voltage reference. Table 3.1 from Nilssonand Modrack [2013], shows the commutation characteristic functions ga, gb, gcused in Section 3.1.1 which depends on the phase and the electrical degree ofthe rotor. The trapezoidal commutation only needs three hall sensors to identifyin which of the six electrical degree intervals the rotor is. The simplicity makesthe trapezoidal commutation widely used. The trapezoidal commutation gives ahigher torque than sinusoidal commutation, but gives rise to torque ripple. Fora more advanced control and a smoother torque, sinusoidal commutation is ad-vised.

Sinusoidal commutation

Sinusoidal commutation is more advanced than trapezoid commutation and needsa more accurate angle measurement of the rotor. The more accurate electrical ro-tor angle makes it possible to set the magnetic field in orthogonal direction to themagnets and thereby achieve maximum output. The sinusoidal commutation isa phase shifted sine wave multiplied by the voltage reference.

Page 36: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

18 3 Theory

Table 3.1: Describing the value of the commutation characteristic functionsga, gb and gc for each phase depending on the electrical rotor angle (θe) in-terval expressed in degrees.

Electrical rotor angle (θe) [◦] ga(θe) [-] gb(θe) [-] gc(θe) [-]0-60 +1/2 −1/2 060-120 +1/2 0 −1/2120-180 0 +1/2 −1/2180-240 −1/2 +1/2 0240-300 −1/2 0 +1/2300-360 0 −1/2 +1/2

VaVbVc

= Vref

sin(θe)sin(θe − 2π

3 )sin(θe + 2π

3 )

(3.17)

3.2 Modeling the control system

The purpose of the control system is to control both angular position and angularvelocity of the two rotating wedges so that the deflection angles and angular ve-locities follow the system demands. If the deflection angle deviates too much, thefire system will be unable to communicate with the target system. Likewise is theangular velocity a key factor since if not correct or too noisy, the fire system willsend wrong position of the projectile to the target system. The control systemalso have to take the power consumption into account, the BLDC motors can notconsume too much power since the simulator platform is supposed to be portableand the battery size is limited. In other words, the performance of the control sys-tem is crucial for the simulation performance of the whole simulation platform towork. There are numerous control loops which could be tested and tuned differ-ently, but in this master thesis only three control loops were evaluated. A singleP-controller controlling the rotor angle, a PD-controller controlling the rotor an-gle and a cascaded P-controller with an inner loop controlling the rotor velocityand an outer loop controlling the rotor angle.

3.2.1 Single P-controller

A single P-controller is constructed so that the error between the reference motorangle and the actual motor angle is multiplied by a proportional gain.

u(t) = Kpe(t) = Kp(r(t) − y(t)) (3.18)

u(t) in Equation (3.18) is the control signal, Kp is the proportional gain (designparameter) and e(t) is the error between the reference motor angle r(t) and theactual motor angle y(t). The system can be viewed in Figure 3.3.

Page 37: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.2 Modeling the control system 19

0 50 100 150 200 250 300 350

Electrical rotor angle [°]

-1

0

1Trapezoid commutation phase A

ga

0 50 100 150 200 250 300 350

Electrical rotor angle [°]

-1

0

1Trapezoid commutation phase B

gb

0 50 100 150 200 250 300 350

Electrical rotor angle [°]

-1

0

1Trapezoid commutation phase C

gc

Figure 3.2: Shows the trapezoidal commutation characteristics for ga(θe),gb(θe) and gc(θe). As can be seen, gb(θe) and gc(θe) is a ±120◦ phase shiftfrom ga(θe).

3.2.2 PD-controller

The PD-controller takes the error between the reference and actual motor angleas input and calculates the control signal by a proportional and derivative term.

u(t) = Kpe(t) + Kdde(t)dt

= Kp(r(t) − y(t)) + Kdd(r(t) − y(t))

dt(3.19)

u(t) in Equation (3.19) is the control signal, Kp is the proportional gain (de-sign parameter), Kd is the derivative gain (design parameter) and e(t) is the errorbetween the reference motor angle r(t) and the actual motor angle y(t). The con-trol loop can be viewed in Figure 3.4.

3.2.3 Cascaded P-controller

The cascaded P-controller consists of two P-controller loops connected to eachother. The cascaded P-controller takes advantage of knowing the motor angularvelocity to control the motor angle. An inner loop controls the motor angularvelocity and an outer loop controls the motor angle. According to Enqvist andStrömberg [2014], the advantage of using a cascaded P-controller is that the dis-turbance on the secondary plant model (in this case the integrator) can be imme-diately taken care of by the inner loop. The algorithm describing the cascadedP-controller is presented in Equation (3.20) and a schematic of the cascaded P-controller can be viewed in Figure 3.5.

Page 38: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

20 3 Theory

Figure 3.3: Showing the control loop for the P-controller (proportional con-troller), where r(t) represents the reference motor angle, y(t) the actual mo-tor angle, e(t) the difference between the reference motor angle and the ac-tual motor angle. Kp is the proportional gain which is a design parameterand G is the plant model.

Figure 3.4: Showing the control loop for the PD-controller (proportional andderivative controller), where r(t) represents the reference motor angle, y(t)the actual motor angle, e(t) the difference between the reference motor angleand the actual motor angle. Kp is the proportional gain which is a designparameter, d

dt takes the derivative of the signal and G is the plant model.

u(t) = Kp2e2(t) =/e2(t) = Kp1e1(t) − y2(t)

/=

= Kp2(Kp1e1(t) − y2(t)) =/e1(t) = r(t) − y1(t)

/=

= Kp2(Kp1(r(t) − y1(t)) − y2(t)) (3.20)

Kp1 and Kp2 in Equation (3.20) are the two proportional gains (design param-eters), e1(t) the error between the reference motor angle r(t) and the actual motorangle y1(t). e2(t) is the error between the "reference" motor angular velocity andthe actual motor angular velocity. Since the derivative of the motor angle is themotor angular velocity, the motor angular velocity can be written as y2(t) = dy1(t)

dtwhich gives

u(t) = Kp2

(Kp1(r(t) − y1(t)) −

dy1(t)dt

)(3.21)

Page 39: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.3 Modeling the Risley-prism refraction 21

Figure 3.5: Showing the control loop for the cascaded P-controller (propor-tional controller), where r(t) represents the reference motor angle, y1(t) theactual motor angle, y2(t) the actual motor angular velocity, e1(t) the differ-ence between the reference motor angle and the actual motor angle, e2(t)the difference between the "reference" motor angular velocity and the actualmotor angular velocity. Kp1 and Kp2 are design parameters representing pro-portional gains, G is the plant model and

∫dt represents the signal being

integrated.

3.3 Modeling the Risley-prism refraction

In this master thesis Risley-prisms are used to deflect the laser beam. A Risley-prism is basically a wedge formed piece of glass. The deflection is constant fora fix Risley-prism, but by rotating the Risley-prism, the deflection reaches theboundaries of a conical shape. By combining two rotary Risley-prisms, the deflec-tion can reach all points inside a conical shape as can be seen in Figure 3.6.

Figure 3.6: A sketch describing the deflection using two rotary Risley-prisms. The laser source is placed in the origin and the laser beam is de-flected onto a plane. The two arrows drawn in the plane represents the de-flection vectors of each wedge discussed in Section 2.3.2. The maximumdeflection angles are represented by a conical shape which depends on thewedge opening angles, refractive index and incident ray direction.

Depending on the refractive index and the opening angles of the Risley-prisms,the deflection is increased or decreased resulting in a larger or smaller radius of

Page 40: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

22 3 Theory

the conical shape. A sketch of the opening angles can be seen in Figure 3.7.

Figure 3.7: A cross section view of the Risley-prisms. The red line comingfrom the laser source placed in the origin represents the laser beam paththrough the wedges (not drawn to scale) as well as the wedge opening anglesαi,j which describe the physical angles of the wedges.

Since the system consists of rotary parts, it is important to define a coordi-nate system. The fire simulator fix coordinate system used in this master thesisis defined as in Figure 3.6 with the origin being the laser source. Looking at thewedges from the laser source, the x-axis is defined positive to the right, the y-axispositive in the up direction and the z-axis positive towards the viewer. Whenrotating the wedges, the rotation angle θm and starting angle Ψ is positive coun-terclockwise from the x-axis as can be seen in Figure 3.8. When the wedge hasnot been rotated, the thickest part of the wedge will have the highest x-value.

The vector form of Snell’s law is used to derive the refractive ray direction andwhich can be written in many ways, but in this master thesis it will be derivedaccording to the equations mentioned in Kidger [2002] and Bass [1995]. Imaginean incident ray as a normed vector S1 hitting a surface and refracts as the normedray vector S2 presented in Figure 3.9. The normed surface normal a is a vectorperpendicular to the surface in the intersection point, pointing away from thelaser beam source. The incident angle is presented as I1 and the refracted angleas I2. The cross product between S and a is defined as

S × a = |S ||a| sin(I1)z (3.22)

z in Equation (3.22) is defined as the unit vector perpendicular to both S anda. Since S and a are unit vectors (|S | = |a| = 1), Equation (3.22) can be written as

S × a = sin(I1)z (3.23)

Page 41: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.3 Modeling the Risley-prism refraction 23

Figure 3.8: A sketch of the coordinate system used in this master thesis. Thecircle represents the first surface of the first Risley-prism seen from the lasersource. Ψ defines the starting angle and θm defines the rotation angle of thewedge. The reference position is the thickest part of the wedge which forθm = Ψ = 0 is placed on the highest x-value. The thickest part of the wedgeis then positively rotated when rotated counterclockwise from the x-axis.

Snell’s law states that the incident ray S1 and the refracted ray S2 are coplanarand together with the scalar form of Snell’s law (n1 sin(I1) = n2 sin(I2)), the vectorform of Snell’s law can be expressed as

n1S1 × a = n2S2 × a (3.24)

Since the intention of using Snell’s law is to calculate the refracted ray direc-tion S2, Equation (3.24) needs to be rewritten so that S2 can be derived usingonly the known parameters n1, n2, S1 and a. To do this, a unit vector b is definedparallel to the surface at the intersection point and in the plane created by theincident ray and the surface normal. The incident ray can then be described asEquation (3.25) and the refracted ray as Equation (3.26).

S1 = a cos(I1) + b sin(I1) (3.25)

S2 = a cos(I2) + b sin(I2) (3.26)

Combining Equation (3.25) and Equation (3.26) gives

b =S1 − a cos(I1)

sin(I1)=S2 − a cos(I2)

sin(I2)⇔

(S1 − a cos(I1)) sin(I2) = (S2 − a cos(I2)) sin(I1) (3.27)

Snell’s law in scalar form introduced in Equation (3.28) applied to Equation (3.27)results in Equation (3.29), where n1 and n2 represents the refractive indexes ofmedia one and two.

n1 sin(I1) = n2 sin(I2) (3.28)

Page 42: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

24 3 Theory

Figure 3.9: A sketch of the laser beam refraction, where S1 is the incidentray, S2 is the refracted ray, I1 is the incident angle, I2 is the refracted angle,n1 is the refractive index of media one, n2 is the refractive index of mediatwo, a and N are the surface normals in the intersection point.

(S1 − a cos(I1))n1 = (S2 − a cos(I2))n2 (3.29)

Equation (3.29) is rewritten into Equation (3.30) so that n2S2 can be calcu-lated.

n2S2 = n1S1 + n2a cos(I2) − n1a cos(I1) = n1S1 + a(n2 cos I2 − n1 cos(I1)) (3.30)

n2 cos(I2) − n1 cos(I1) is a common expression in geometrical optics but hasnot been given a name or variable. In order for Equation (3.30) to only dependon known parameters, cos(I1) and cos(I2) have to be rewritten. Since a and S1 areunit vectors, cos(I1) can be expressed as

cos I1 = |S1||a| cos(I1) = S1 • a (3.31)

Also cos(I2) in Equation (3.30) is unknown, but can be rewritten using thesquare of Snell’s law in Equation (3.28) and the pythagorean trigonometry iden-tity (sin2(I) = 1 − cos2(I)), into

cos(I2) =√

1 − sin2(I2) =/n1 sin(I1) = n2 sin(I2)

/=

=

√1 −

n21

n22

sin2(I1) =/

sin2(I1) = 1 − cos2(I1)/

=

√1 −

n21

n22

(1 − cos2(I1)

)(3.32)

Combining Equation (3.31) and Equation (3.32) results in Equation (3.33)which only depends on known parameters.

Page 43: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.3 Modeling the Risley-prism refraction 25

cos(I2) =

√1 −

n21

n22

(1 − (a • S1)2

)(3.33)

Inserting the rewriting of cos I1 and cos I2 presented in Equation (3.31) andEquation (3.33), into Equation (3.30) yields

S2 =n1

n2S1 + a

1 −n2

1

n22

(1 − (a • S1)2

)− n1

n2(a • S1)

(3.34)

Since it is more common to use the surface normal in the opposite direction,a is rewritten as a = −N , where N also is the surface normal perpendicular to thesurface in the intersection point. Inserting this change into Equation (3.34) gives

S2 =n1

n2S1 − N

n1

n2(N • S1) +

√1 −

n21

n22

(1 −

(− N • S1

)2) (3.35)

N in Equation (3.35) is the normed normal vector of the wedge surface. De-pending on if the normal is calculated for the surface closest or furthest awayfrom the laser source, the surface normal N is derived in two ways. For the sur-face closest to the laser source, the surface normal is derived as Equation (3.36)and the surface normal for the surface furthest away from the surface is calcu-lated as Equation (3.37).

N =

NxNyNz

=

− cos(Ψ + θm) sin(α)− sin(Ψ + θm) sin(α)

cos(α)

(3.36)

N =

NxNyNz

=

cos(Ψ + θm) sin(α)sin(Ψ + θm) sin(α)

cos(α)

(3.37)

θm in Equation (3.36) and Equation (3.37) is the rotation angle of the Risley-prism counted from the starting angle Ψ and α is the wedge opening angle. Notethat the direction of the surface normal direction differs between the two surfaceswhich is represented by a change of sign.

3.3.1 Ray tracing

The ray tracing algorithm used in this master thesis is based on the three dimen-sional ray refraction presented in Section 3.3 for both surfaces of the wedge andfor the number of used wedges. Given the example in Section 3.5.1, the refractedray in Equation (3.35) have to be calculated eight times, one for each wedge sur-face. In other words, given the incident ray direction from the paraxial lens to thefirst surface, the refracted ray is calculated and used as the incident ray directionfor the second surface refraction and so on. Until the refracted ray of the lastsurface is calculated which gives the final deflection.

Page 44: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

26 3 Theory

3.3.2 Calculating the intersection points

The ray tracing mentioned above only calculates the direction of the ray before,after and between the surfaces. But it is also important to calculate the intersec-tion points of the ray and the surfaces. In this way the ray could be evaluated ifit intersects the surface outside the physical wedge or not, which is used whencalculating the vignetting. This can also be used to plot the ray tracing togetherwith the wedges in a coordinate system.

Figure 3.10: A sketch of the intersection between a line representing the rayand a plane representing the wedge surface, where N is the surface normal,P0 is a point on the surface, L0 is the starting position of the line, S is theline direction and D is a scalar describing the distance from the line startingposition to the intersection point L. Vectors are denoted with a bar above thevariable and points without a bar.

The intersection point can be derived as a line-plane intersection where theline represents a ray of light and the plane represents the wedge surface. The lineequation is presented in Equation (3.38) and a sketch of the line-plane intersec-tion can be seen in Figure 3.10.

L = L0 + DS (3.38)

L in Equation (3.38) is the intersection point, L0 is the starting point of theline, S is a unit vector describing the line direction and D is the length of the linefrom the line starting point to the intersection point. The vector L0 representsthe vector from the origin to the point L0, L represents the vector from the originto the point L, N represents the unit vector surface normal and P 0 represents thevector from the origin to the arbitrary point P0 on the surface.

The plane equation is defined as

(L − P 0) • N = 0 (3.39)

Inserting Equation (3.38) into Equation (3.39) gives

(L0 + DS − P 0) • N = 0 (3.40)

Page 45: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.3 Modeling the Risley-prism refraction 27

Solving Equation (3.40) for the ray length D gives

D =N • (P 0 − L0)

N • S(3.41)

To calculate the intersection point L, insert the derived ray length D fromEquation (3.41) into Equation (3.38).

3.3.3 Vignetting

The laser beam emitted from the laser source are assumed to pass through aparaxial lens making all rays from one point in the lobe pattern passing the aper-ture parallel to each other. The rays that passes the aperture are assumed to bethe total number of rays. Since the laser source emits laser lobes with an altitudeand/or azimuth angle, the result is an aperture of rays with the negative (paraxiallens effect) altitude and/or azimuth angle. A ray with zero incident altitude andazimuth angle to the paraxial lens results in an aperture of rays with zero altitudeand azimuth angle. The whole aperture of rays with no altitude and/or azimuthangles will all hit the first wedge since the wedge aperture have the same size.Furthermore, not the whole aperture of rays with an altitude and/or azimuth an-gle will hit the first wedge surface since there is a distance between the apertureof the paraxial lens and the surface of the first wedge. This loss in aperture iscalled vignetting, meaning that the number of incident rays is not equal to thenumber of finally refracted rays. By using this in a bigger picture, the apertureof rays passing the paraxial lens are the incident rays, and the rays passing thesecond surface of the last wedge are the refracted rays. The vignetting is thenthe percentage of total rays that are able to pass all wedges without hitting theenclosure surrounding the wedges.

The vignetting depends on the incident ray altitude and/or azimuth angleand the rotation angle of the wedges (wanted deflection). The vignetting canbe interpreted to be proportional to the laser beam intensity. No vignetting (=100%) means full laser beam intensity and thereby maximum fire range. Highervignetting (less percentage) means less laser beam intensity and thereby a shorterfire range.

3.3.4 Distortion

The fire simulator use three laser lobes displayed in Figure 2.3. The figure alsoshows the top, middle and bottom points of the laser lobes. By ray tracing therays with the altitude and azimuth angles given by the points, results in a map ofhow the laser lobe distortion behaves. Preferably, the middle point of the middlelaser lobe should have certain deflection angles, then the wedges are rotated intoposition so that the middle point of the middle lobe gives the desired deflectionangles. The rotation of the wedges will then not be correct for the other eight lobepoints and thereby the laser lobes will be distorted. Since the fire simulator usesthe orthogonal distance from the lobe line to the target simulator, the interestingerror/distortion will also be orthogonal to the laser lobe. By ray tracing the lobe

Page 46: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

28 3 Theory

point rays for the nine lobe points (presented in Figure 2.3) in different deflectionangles, the distortion can be measured and be taken into account when choosinga new wedge configuration. The orthogonal distortion is derived as the distancefrom a point to a line as can be seen in Figure 3.11.

ε1 =‖(P 1 − L1) × (P 1 − L7)‖

‖L7 − L1‖(3.42)

Figure 3.11: A sketch of the orthogonal distortion created on the left laserlobe at a certain deflection point. The bent line represents the actual dis-torted lobe and the straight line represents the ideal lobe. ε1 represents theorthogonal distance from the ideal lobe line to the distorted lobe point 1 andε7 represents the distance from the ideal lobe line to the distorted lobe point7. L1, L4 and L7 represents ideal lobe points 1, 4 and 7. P1, P4 and P7 repre-sents the distorted lobe points 1, 4 and 7. L1 is the vector from the origin tothe ideal lobe point L1 and L7 is the vector from the origin to the ideal lobepoint L7. P 1 represents the vector from the origin to the distorted lobe pointP1

3.4 Solving the inverse deflection problem

While the ray tracing presented in Section 3.3.1 is pretty straight forward, theinverse deflection problem is far more complex. The inverse deflection problem

Page 47: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.5 Wedge configuration examples 29

refers to calculating the rotation angles of the rotary wedges given a desired de-flection angle. The relation between the rotation angles of the wedges and thefinal deflection angles is very nonlinear. It is therefore harder to solve the inversedeflection problem than tracing a ray.

3.5 Wedge configuration examples

Limiting the rotary wedges to two or three rotary wedges and a maximum of fourwedges, numerous of wedge combinations could still be created. The MATLABand Simulink files created to simulate and solve the problem can handle all ofthese combinations. But only two of all combinations will be discussed in thismaster thesis, since they describe the most interesting wedge configurations. Thefirst wedge configuration consists of two fix and two rotary wedges, the secondconsists of three rotary wedges. The wedge configuration of three rotary wedgewill be covered in two example setups using the first wedge as a continuouslyrotary wedge and an alternative design where the first rotary wedge flipped be-tween two discrete rotation angles.

3.5.1 First example using two rotary wedges

The first example wedge configuration consists of four Risley-prisms mounted ascan be seen in Figure 3.12. The wedge closest to the laser source and the wedgefurthest away from the laser source are fixed and the two wedges in the middleare rotary by two BLDC motors. Given a desired final deflection angle, the middlewedges are rotated so that the desired deflection angle is obtained.

3.5.2 Second example using three rotary wedges

The second example wedge configuration consists of three Risley-prisms, whichare all rotary. Given a desired deflection angle, all three rotary wedges are rotatedinto position so that the desired deflection angle is achieved. This requires asolution to the inverse deflection problem for three rotary wedges which is muchmore complex than for two rotary wedges. A CAD schematic of the wedge andmotor configuration can be seen in Figure 3.13.

3.5.3 Third example using two rotary wedges and a flippingwedge

In this example, the wedge configuration consists of a three wedges, all are infact rotary but the first wedge is only switched 180◦discretely. The aim of flip-ping the first wedge is to lower the acceleration in certain problematic angles,discovered during the analysis of the solution to the two rotary prism setup. Thefirst wedge can be assumed to be fix for all positive deflection altitude angles.When the deflection altitude angle is zero and the sweep has reached its end-point, the wedge is switched 180◦ and assumed to be fix in that position for all

Page 48: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

30 3 Theory

Figure 3.12: A CAD schematic cross section of a possible deflection unit fora fire simulator showing the two Risley-prisms (in white) and the BLDC ringmotors (in yellow) surrounding the two middle prisms. The laser source isnot seen in the picture, but is situated to the left of the wedge furthest to theleft.

negative deflection altitude angles. The inverse deflection problem then has tobe solved for two discrete cases with the first wedge fix. This solution is intendedto decrease the maximum acceleration required from the motors. But it might besensitive to disturbance or oscillating deflection angles around zero deflection al-titude. The schematic of the wedge configuration looks the same as the one usedin Section 3.5.2, shown in Figure 3.13.

Page 49: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

3.5 Wedge configuration examples 31

Figure 3.13: A CAD schematic cross section of a possible deflection unit fora fire simulator showing the three Risley-prisms (in white) and the threeBLDC ring motors (in yellow) surrounding the prisms. The laser source isnot seen in the picture, but it is situated to the left of the wedge furthest tothe left.

Page 50: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller
Page 51: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

4Method

This chapter covers how this master thesis was performed. Starting with a pilotstudy, modeling the electro-optic/mechanical system followed by control looptuning and solving the inverse deflection problem.

4.1 Planning

During the first month of this master thesis, a planning report was made. The pur-pose with the planning report was to better understand the problem and make aplan of how the work should be executed. The first month also included a vastliterature study which resulted in a first outline of the solution.

4.2 Modeling the motors

Initially step responses were made on the actual BLDC motors. The experimentsresulted in a table with recorded time, rotation angles, rotation angle velocitiesand the applied voltages. The motor model based on material found during theliterature studies was implemented in Simulink. Some motor parameters usedto model the motors were known and some were not specified in the data sheetand could not be measured. Therefore the known model parameters were putinto the model and the rest had to be estimated. The data from the experimentswas preprocessed to remove trends and means. The experimental data was thencompared with the data from the Simulink model and the unknown motor modelparameters were manually tuned to fit the experimental data.

33

Page 52: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

34 4 Method

4.3 Choosing control loop and parameters

In this master thesis three control loops are discussed, a single P-controller, aPD-controller and a cascaded P-controller which ought to control the BLDC mo-tors. Nonlinearities in the motor model such as commutation, saturated anddiscretized control signal made the control system hard to analyze. But witha Simulink model of the nonlinear system, the control loops and control parame-ters could be tested and iteratively tuned.

4.3.1 Single P-controller

To begin, the P-controller introduced in Section 3.2.1 with a rotor angle feedbackwas implemented in the Simulink model. The design parameter Kp was thentuned to increase the rotor angle reference tracking capabilities. At first, an initialguess was made and from there, the system was evaluated, tuned and run again.

4.3.2 PD-controller

BLDC motors are most commonly controlled with a PD-controller which makesthis a suitable control loop for this system. The PD-controller was implementedin Simulink according to the definition in Section 3.2.2. The design parametersKp and Kd were tuned until a satisfying step response was acquired, and theresult was evaluated.

4.3.3 Cascaded P-controller

Instead of having a PD-controller which uses only the motor angle feedback, alsothe motor angular velocity could be used to control the wedges. This could bedone by using a cascaded P-controller introduced in Section 3.2.3. The cascaded P-controller consists of an inner and an outer control loop. The inner P-control loophandles the motor angular velocity and the outer handles the motor angle. Aninitial guess of the control parameters was made based on the motor performanceand the control signal limitations. An iterative process then followed, tuning thecontrol parameters to improve the rotation angle tracking capabilities.

4.4 Solving the inverse deflection problem

The inverse deflection problem can be solved in many ways and can, dependingon the wedge configuration, have multiple solutions. Plotting the rotation anglesin a grid of deflection angles gives a surface which might be continuous or dis-continuous. Since the laser beam is supposed to sweep over the deflection grid,the surface must be continuous because the motors can not rotate the wedge dis-continuously.

By calculating the gradient of the rotation angles shown in a grid of deflectionangles and multiplied by the sweep velocity gives the rotation angle velocity inthe different deflection grid points. In the same way, the sweep accelerations is

Page 53: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

4.4 Solving the inverse deflection problem 35

given by calculating the gradient of the rotation angle velocity in a grid of de-flection angles multiplied by the sweep velocity. The rotation angle accelerationsare important since the BLDC motors have an acceleration saturation. If the rota-tion angle acceleration is higher than the maximum rotation angle acceleration,the BDLC motor can not provide a good rotation angle tracking in the whole de-flection grid. The rotation angle acceleration also gives a good indication of thepower consumption for different wedge configurations. Lower acceleration peaksresult in less power consumption and vice versa.

The method used to solve the inverse deflection problem in this master the-sis is to solve an optimization problem using the MATLAB functions fsolveand fmincon. The difference between the use of fsolve and fmincon is thatfsolve is a numerical routine for finding solutions to a set of nonlinear equa-tions (F(x)), which in terms of optimization can be used to solve problems withnonlinear equality constraints. fmincon is a more general nonlinear optimiza-tion solver which in addition to finding solutions to nonlinear equality constraintsalso can solve the problem with nonlinear inequality constraints, linear inequal-ity constraints, linear equality constraints, upper and lower bound constraints aswell as having an objective function.

fsolve solves the optimization problem for each deflection grid point indi-vidually with no relation to the other grid points other than an initial guess. Arelatively good initial guess to would be the rotation angle for the neighboringdeflection grid point or a combination of all adjacent rotation angles. fminconon the other hand takes an initial guess of the rotation angles for the whole de-flection grid and uses an objective function to smoothen out the rotation anglesurface. In this way, all rotation angle grid points depend on each other. Thisis typically preferred when having three rotational wedges since the deflectionpoints have an infinite number of rotation angle solutions.

4.4.1 Using fsolve

The MATLAB function fsolve is used to solve nonlinear equations numerically.It minimizes the function F(x) using a specified optimization algorithm. Start byrewriting Equation (3.36) and Equation (3.37) in a more general form to representthe surface normal for all wedge surfaces. Using k = 1, . . . , n as indicator of thecurrent surface where n is the total number of surfaces and j = 1, . . . , p representsthe current wedge where p is the total number of wedges. Since each wedge hastwo surfaces, j can be defined as j = dk/2e but the notation of j will be used torefine the equations.

N k(xj ) =

(−1)k cos(Ψ + xj ) sin(α)(−1)k sin(Ψ + xj ) sin(α)

cos(α)

(4.1)

xj in Equation (4.1) represents the rotation angle of wedge j taken from thevector x defined as

Page 54: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

36 4 Method

x =

x1...xj...xp

=

θm1...θmj...

θmp

(4.2)

Generalizing Equation (3.35) to hold for all surfaces, the refracted ray fromsurface k can be written as

Sk(x) =n1

n2Sk−1(x) − N k(xj )

n1

n2

(N k(xj ) • Sk−1(x)

)+

+

√1 −

n11

n22

(1 −

(− N k(xj ) • Sk−1(x)

)2) (4.3)

Sk−1 in Equation (4.3) represents the incident ray direction to surface k andN k represents the surface normal of surface k. The objective function F(x) isdefined as the difference between the incident ray direction and the refracted raydirection based on the states x describing the wedge rotational angles and thefirst incident ray direction S0 as well as the desired refracted ray direction Sn.

F(x) =

F1(x)...

Fk(x)...

Fn(x)

=

S0 − S1(x)...

Sk−1(x) − Sk(x)...

Sn−1(x) − Sn

(4.4)

The rotation angles needed to achieve a certain deflection is obtained by solv-ing the optimization problem expressed in Equation (4.5) using fsolve.

minxF(x) (4.5)

The optimization problem is then solved separately for every grid point.

4.4.2 Using fmincon

The MATLAB function fmincon uses an objective function as well as both linearand nonlinear constraints which could provide a solution to the inverse deflectionproblem. The optimization problem solved by fmincon can be expressed as

minxf (x) such that

ceq(x) = 0Aeqx = Beq

(4.6)

Page 55: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

4.5 Calculating the vignetting 37

ceq(x) = 0 in Equation (4.6) represents the nonlinear equalities and Aeqx =Beq the linear equalities. The state vector x consists of rotation angles for eachdeflection grid point, when using fmincon to solve the optimization problem.The size of x depends on the total number of wedges p and the total number ofdeflection grid points q which gives a state vector of p ∗ q elements.

x =[x1,1, . . . , x1,q, xj,1, . . . , xj,q, xp,1, . . . , xp,q

]T(4.7)

The nonlinear constraints basically does the same as F(x) in fsolve, limitsthe ray refraction to be equal to the desired ray direction. By deriving Sn(x) for acertain deflection altitude Φ and deflection azimuth Θ using Equation (4.3), thenonlinear equality constraint is set to

ceqΦ,Θ (x) = SnΦ,Θ − SnΦ,Θ (x) = 0 (4.8)

The nonlinear equality constraint vector ceq then consists of ceqΦ,Θ for all de-flection grid points so that fmincon takes the rotation angles for the whole de-flection grid into account. The linear equality constraint is used to set up thewedges to be fix or rotary by defining B as a zero vector of equal size as x. Aeqis a diagonal matrix of size p ∗ q × p ∗ q, where the diagonal elements related toa fix wedge is set to one and the elements related to the rotary wedges are setto zero. The objective function is used to smoothen out the peaks by penalizingthe difference in rotation angle between the current deflection grid point and theneighboring grid points for all wedges separately.

f (x) =q∑r=1

p∑j=1

(x2r,j +

r+1∑s=r−1

j+1∑i=j−1

(xr,j − xs,i)2)

(4.9)

4.5 Calculating the vignetting

The vignetting is calculated by ray tracing a number of rays that passes the aper-ture from the paraxial lens. The percentage of rays that go through all prismsgives an approximation of the vignetting. By calculating the vector L to the in-tersection point between the rays and the surfaces presented in Section 3.3.2, therays can be evaluated if they hit the enclosure or not.

L =

LxLyLz

(4.10)

The x- and y-components of L can be used to determine the distance from theintersection point to the z-axis.

r =√L2x + L2

y (4.11)

If the distance r between the intersection point and the z-axis is larger thanthe wedge radius, the ray is vignetted. The vignetting calculation is then made

Page 56: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

38 4 Method

for a grid of deflection points so that the difference in vignetting between differ-ent deflection points can be viewed. This is calculated for all nine lobe points(incident ray angles) presented in Figure 2.3 and the lobe point with highest vi-gnetting is set to define the vignetting in that deflection point.

4.6 Calculating the distortion

The distortion is calculated by tracing the rays for all nine lobe points presentedin Figure 2.3 for a grid of deflection points. The distortion is then the orthogonaldeviation from the original lobe line to the distorted lobe point presented in Sec-tion 3.3.4. To visualize the distortion, the ray tracings of all nine lobe points areplotted for each grid point together with the ideal lobe points.

4.7 Creating the Simulink model

When the Simulink model was created, much effort was made on making it mod-ular so that the wedge configuration and motor model could be modified eas-ily. The Simulink model was created so that any wedge configuration and motormodel used in this master thesis could be run by loading a wedge configurationand a motor model to the MATLAB workspace and then run the Simulink model.

4.8 Simulating the whole system

When simulating the whole system, load a wedge configuration and a motormodel to the MATLAB workspace, open and run the Simulink model whichstores the interesting variables to the MATLAB workspace. The variables canthen be plotted using the command window or more preferable by executing aplot script. Plot e.g. the final deflection, the motor angle, angular velocity, angu-lar acceleration, voltage, current and power consumption to identify the systemperformance.

Page 57: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5Result

This chapter covers the achieved result of this master thesis, following the meth-ods presented in Chapter 4, which implements the theory in Chapter 3. Themotor model turned out to fit the experimental motor well and combined witha control loop, the system requirements were fulfilled. Different wedge configu-rations as well as different solutions to the inverse deflection problem could beevaluated by simulating the whole system.

5.1 Motor model

The motor model presented in Section 3.1.1 uses the parameters p - the num-ber of poles, R - the armature resistance, L - the armature self-inductance, Ke -the back-EMF constant, J - the moment of inertia, B - the damping constant, Tl- the torque load. The number of poles, the armature resistance, the armatureinductance and the Back-EMF constant is specified in the data sheet. Because ofproduction variations, the resistance and the inductance might vary between themotors and also in the star connection. The resistance and inductance have there-fore been measured to verify the data sheet. There were some minor fluctuationsbetween the legs in the star connection but since the data sheet value was approx-imately the average of these, the data sheet value was chosen for the resistanceand inductance. Since the motor have been modified regarding the motor mate-rial, the damping coefficient were uncertain, but assumed to be low and thereforean initial guess of B = 0 was made. Inside the rotor, the wedge is placed whichaffects the moment of inertia. The moment of inertia was estimated from a CADprogram which were used as a first initial guess since this parameter also werequite uncertain. The torque load was assumed to be low which led to an initialguess of 0 was made.

After preprocessing the experimental data the motor model was simulated us-

39

Page 58: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

40 5 Result

ing the initial guesses of the motor parameters with the experimental voltage asinput to the simulation resulted in the graph presented in Figure 5.1. The resultis actually really good, with a small drift when the motor works around low veloc-ities. The damping coefficient could then be tuned to give a better result which isdisplayed in Figure 5.2. The drift in the middle of the simulation is now fixed butthere still exist a small drift for low velocities outside that range. The drift willbe discussed in Section 6.1. A trade off between a good angle and a good angularvelocity tracking was made and it was preferable to have a better tracking of thevelocity. This because it is the velocity and acceleration that limits the motor per-formance which was important to study in this report and the difference in angleis a small drift in velocity. Tuning the torque load Tl resulted in Tl = 0 which isalso physically trustworthy since no torque load is applied to the rotor.

Time [s]

θ [

rad

]

Angle

Experimental data

Simulated data

Time [s]

ω [

rad

/s]

Angular velocity

Experimental data

Simulated data

Figure 5.1: The top graph shows the motor angle and the bottom graphshows the motor angular velocity. The blue filled line represents the datafrom the simulated motor model without control using the input voltagemeasured in an experiment as input. The red dashed line represents themeasured motor angle and angular velocity during the experiment. In theseplots the damping coefficient as well as the torque load is set to zero. Theaxes are removed for confidentiality reasons.

In another experiment, the motor is controlled with a cascaded P-controllerwhich takes the reference motor angle and together with the actual motor anglefeedback, a motor angle error is calculated. The error e1(t) is saturated and multi-plied with a proportional gain. The result (u1(t)) acts as a reference motor angu-lar velocity for the inner P-controller loop. The error between the reference andthe actual motor angular velocity is calculated, saturated and multiplied withthe second proportional gain. The final control signal is then discretized into

Page 59: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.1 Motor model 41

Time [s]

θ [

rad

]

Angle

Experimental data

Simulated data

Time [s]

ω [

rad

/s]

Angular velocity

Experimental data

Simulated data

Figure 5.2: The top graph shows the motor angle and the bottom graphshows the motor angular velocity. The blue filled line represents the datafrom the simulated motor model without control using the input voltagemeasured in an experiment as input. The red dashed line represents themeasured motor angle and angular velocity during the experiment. In theseplots the damping coefficient is non zero but still very small and the torqueload is set to zero. The axes are removed for confidentiality reasons.

discrete voltage steps and saturated to match the control signal limitations. Thecontrol signal is now the applied voltage for the system (u2(t)). By using thesame proportional gains in the Simulink model as in the experiment, the motorparameters can be evaluated. This can be seen in Figure 5.3. By analyzing the ref-erence data, it can be seen that since the overshoots at step two and three are notequally large, the motor is not symmetrical, it might be easier for it to rotate inone direction than the other. The simulated data on the other hand have equallylarge overshoots which is expected since the simulated motors are assumed to besymmetrical. But the simulated motor is assumed to track the actual motor goodenough.

Page 60: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

42 5 Result

Time [s]

θ [

rad

]

Angle

Experimental data

Simulated data

Reference position

Time [s]

ω [

rad

/s]

Angular velocity

Experimental data

Simulated data

Figure 5.3: The top graph shows the motor angle reference, the experimentalmotor angle and the simulated motor angle using the same controller as inthe experiment. The control loop used in both cases is a cascaded P-regulatorwhere the inner loop controls the motor angular velocity and the outer loopcontrols the motor angle. The bottom graph shows the motor angle velocityfor the simulated motor and the experimental motor. The axes are removedfor confidentiality reasons.

Page 61: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.2 The resulting control loops 43

5.2 The resulting control loops

Three control loops were tuned and tested in the Simulink model. The first wasa simple P-controller which gave the worst performance out of the three controlloops. The second control loop used a PD-controller which was quite satisfyingbut harder to tune and still the result could be better. The third control loop,using a cascaded P-controller turned out to give the best result out of these threecontrol loops. It was relatively easy to tune and the result became more robustthan the other solutions.

5.2.1 Single P-controller

Using a high Kp, the control signal gets saturated directly and oscillates betweenthe highest and lowest control signal. Decreasing Kp gave a smoother controlsignal which can take values between the saturation points. But as presented inFigure 5.4, the settling time becomes too long for the system requirements. Dueto limited time of test equipment, the tuned P-controller could not be tested inthe real test equipment and are therefore not plotted in the graphs. Since theresults were insufficient, the P-controller was replaced by a PD-controller.

Time [s]

θ [

rad

]

Angle

Simulated data

Reference position

Time [s]

ω [

rad

/s]

Angular velocity

Simulated data

Figure 5.4: The top graph shows the motor angle reference, the simulatedmotor angle using a tuned P-controller. The control loop only consists of amotor angle feedback. The bottom graph shows the motor angle velocity forthe simulated motor. The axes are removed for confidentiality reasons.

Page 62: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

44 5 Result

5.2.2 PD-controller

Compared to the P-controller, the tuned PD-controller performed better than theP-controller as can be seen in Figure 5.5 but was harder to tune, and the resultgave a small overshoot which might have been reduced by further tuning. Thesystem was really sensitive so instead a cascaded P-controller was made whichaccording to theory should be more robust. Due to limited time of test equipment,the tuned PD-controller could not be tested in the real test equipment and aretherefore not plotted in the graphs.

Time [s]

θ [

rad

]

Angle

Simulated data

Reference position

Time [s]

ω [

rad

/s]

Angular velocity

Simulated data

Figure 5.5: The top graph shows the motor angle reference and the simulatedmotor angle using a tuned PD-controller. The control loop only consists of amotor angle feedback. The bottom graph shows the motor angle velocity forthe simulated motor. The axes are removed for confidentiality reasons.

5.2.3 Cascaded P-controller

The control loop used in the test equipment discussed in Section 5.1 is based on acascaded P-controller. The graph presented in Figure 5.3 indicates that the modeldeviates a bit from the real experiment which was also mentioned in Section 5.1.By further tuning of the control parameters, the overshoot was reduced and therise time preserved. The satisfying result can be seen in Figure 5.6. Due to limitedtime of test equipment, the tuned control parameters could not be tested in thereal test equipment and are therefore not plotted in the graphs. Instead the motorangle and angular velocity for the experiment with untuned control parametersare plotted together with the simulated motor angle and angular velocity withtuned control parameters.

Page 63: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.3 Solution to the inverse deflection problem 45

Time [s]

θ [

rad

]

Angle

Experimental data

Simulated data

Reference position

Time [s]

ω [

rad

/s]

Angular velocity

Experimental data

Simulated data

Figure 5.6: The top graph shows the motor angle reference, the simulatedmotor angle using tuned control parameters and the experimental motorangle using the untuned control parameters. The control loop used in bothcases is a cascaded P-regulator where the inner loop controls the motor angu-lar velocity and the outer loop controls the motor angle. The bottom graphshows the motor angle velocity for the simulated motor and the experimen-tal motor. The axes are removed for confidentiality reasons.

5.3 Solution to the inverse deflection problem

The inverse deflection problem is in this master thesis solved using the MATLABfunctions fsolve and fmincon which are explained in Section 4.4. There arenumerous wedge configurations that could be solved with these MATLAB func-tions, but from here on only three examples will be discussed. One example usetwo rotary wedges which is presented in Section 3.5.1. In another example, threerotary wedges are used which is presented in Section 3.5.2. In the last example,two rotary wedges and a third rotary wedge which is only flipped 180◦discretelyis used. This configuration is presented in Section 3.5.3.

5.3.1 Using fsolve

In the first wedge configuration with two rotary wedges, there are two possiblesolutions to the inverse deflection problem. The two possible rotation angles arevisualized in Figure 5.7 and Figure 5.8 where the wedge rotation angle is plottedin a grid of deflection angles. As can be seen in the figures, the wedge rotationangles for wedge two and wedge three are switched in the two cases meaningthat the wedge rotation angles can be switched for either wedge, also mentioned

Page 64: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

46 5 Result

in Section 2.3.2.

Rotation angle wedge 1

Θ [rad]Φ [rad]

θ [

rad

]

θ [

rad

]

Rotation angle wedge 2

Φ [rad] Θ [rad]

θ [

rad

]

Rotation angle wedge 3

Φ [rad] Θ [rad]

Rotation angle wedge 4

Θ [rad]Φ [rad]θ [

rad

]

Figure 5.7: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.1. The rotation angle of wedge one and four is constant zero sincethe wedges are fix. Note that the figure only shows the rotation angles, thewedges may also have a starting angle which is not presented in this figure.The axes are removed for confidentiality reasons.

In the second wedge configuration with a total of three wedges, all rotary,fsolve gives more than two solutions to the inverse deflection problem. Thecharacteristics of the wedge rotation surfaces vary depending on the initial guess.Using an initial guess of the rotation angles being equal to zero for all grid pointsresults in the graphs presented in Figure 5.9.

Since Figure 5.9 consist of many discontinuities, it was conjectured that animproved solution could be obtained by using previously computed solutionsin neighboring grid points as an initial guess. The rotation angle surface thenbecomes smoother but still with some discontinuities which can be seen in Fig-ure 5.10. Different initial guesses gives different results. Solving the inverse de-flection problem of three rotary wedges gives for these initial guesses a surfacewhich in some part is discontinuous and also have parts with large accelerations.The discontinuity gives an unaccepted solution since it is physically impossibleto sweep over a discontinuous surface and the acceleration is limited by the maxi-mum acceleration of the motor. A surface that does not match these criteria is anundesired wedge configuration. By viewing the wedge opening angles in deflec-tion vectors (mentioned in Section 2.3.2), the wedge opening angles are designedsuch that the sum of the three vector lengths are large enough to reach all deflec-tion grid points. Increasing the wedge opening angles is the same as zoominginto the surface. In this way the discontinuities can be resolved at the cost ofvignetting and distortion. A graph with longer vectors (larger opening angles) ispresented in Figure 5.11 which have no discontinuities but a higher vignetting.

Page 65: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.3 Solution to the inverse deflection problem 47

Rotation angle wedge 1

Θ [rad]Φ [rad]

θ [

rad

]

θ [

rad

]

Rotation angle wedge 2

Φ [rad] Θ [rad]

θ [

rad

]Rotation angle wedge 3

Φ [rad] Θ [rad]

Rotation angle wedge 4

Θ [rad]Φ [rad]

θ [

rad

]

Figure 5.8: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.1. The rotation angle of wedge one and four is constant zero sincethe wedges are fix. Note that the figure only shows the rotation angles, thewedges may also have a starting angle which is not presented in this figure.The axes are removed for confidentiality reasons.

The vignetting when having short and long vectors are plotted in Figure 5.12.The third example using two rotary wedges and one "fix" wedge gives two

solutions. Choosing the solution is therefore as easy to choose as in the first ex-ample with two fix and two rotary wedges. The rotation angles for a positivedeflection altitude has a discontinuity at a certain negative altitude which can beseen in Figure 5.13. For negative deflection altitude, the rotation angles have adiscontinuity at a certain positive altitude. By switching between these at deflec-tion altitude zero, the final surface have no discontinuity other than the switch atzero deflection altitude. Assuming that the discontinuity can be handled duringthe retardation and acceleration phase of the sweep, this will have a good per-formance with a low hessian and thereby a low required acceleration and powerconsumption.

Page 66: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

48 5 Result

θ [

rad

]

Rotation angle wedge 1

Φ [rad] Θ [rad]

θ [

rad

]

Rotation angle wedge 2

Φ [rad] Θ [rad]

θ [

rad

]

Rotation angle wedge 3

Φ [rad] Θ [rad]

Rotation angle wedge 4

Θ [rad]Φ [rad]θ [

rad

]

Figure 5.9: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.2 and small wedge opening angles. The rotation angle of wedgefour is constant zero since it is not used in this wedge configuration. Theaxes are removed for confidentiality reasons.

θ [

rad

]

Rotation angle wedge 1

Φ [rad] Θ [rad]

θ [

rad

]

Rotation angle wedge 2

Φ [rad] Θ [rad]

θ [

rad

]

Rotation angle wedge 3

Φ [rad] Θ [rad]

Rotation angle wedge 4

Θ [rad]Φ [rad]

θ [

rad

]

Figure 5.10: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.2 and small wedge opening angles. The rotation angle of wedgefour is constant zero since it is not used in this wedge configuration. Theaxes are removed for confidentiality reasons.

Page 67: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.3 Solution to the inverse deflection problem 49

θ [

rad

]

Rotation angle wedge 1

Φ [rad] Θ [rad]

θ [

rad

]

Rotation angle wedge 2

Φ [rad] Θ [rad]θ [

rad

]

Rotation angle wedge 3

Φ [rad] Θ [rad]

Rotation angle wedge 4

Θ [rad]Φ [rad]

θ [

rad

]Figure 5.11: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.2 and large wedge opening angles. The rotation angle of wedgefour is constant zero since it is not used in this wedge configuration. Theaxes are removed for confidentiality reasons.

Inte

nsity [%

]

Laser beam intensity for

small wedge opening angles

Φ [rad] Θ [rad]

Inte

nsity [%

]

Laser beam intensity for

large wedge opening angles

Φ [rad] Θ [rad]

Figure 5.12: The left graph shows the vignetting when having short vectorsalso known as small opening angles of the wedges. The right graph showsthe vignetting when having long vectors also known as large opening anglesof the wedges. The figure shows the percentage of how many rays out ofthe total aperture that passes through all wedge surfaces without hitting thesurrounding wall, over a grid of deflection points. The axes are removed forconfidentiality reasons.

Page 68: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

50 5 Result

Φ [rad]

θ [ra

d]

Rotation angle wedge 1

Φ [rad]

θ [ra

d]

Rotation angle wedge 2

Φ [rad]

θ [ra

d]

Rotation angle wedge 3

Φ [rad]

θ [ra

d]

Rotation angle wedge 4

Figure 5.13: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.3 which represents the rotation angles for a positive deflectionangle. The rotation angle of the first wedge is zero and the fourth wedgeis not used in this wedge configuration. The figure only shows the surfacefrom the altitude side such that the discontinuities along the altitude axisare shown. Note that the figure only shows the rotation angles, the wedgesmay also have a starting angle which is not presented in this figure. The axesare removed for confidentiality reasons.

Page 69: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.3 Solution to the inverse deflection problem 51

Φ [rad]

θ [ra

d]

Rotation angle wedge 1

Φ [rad]

θ [ra

d]

Rotation angle wedge 2

Φ [rad]

θ [ra

d]

Rotation angle wedge 3

Φ [rad]

θ [ra

d]

Rotation angle wedge 4

Figure 5.14: The four graphs shows the rotation angles of the wedges plottedover a grid of deflection points with the wedge configuration presented inSection 3.5.3 which represents the rotation angles for a negative deflectionangle. The rotation angle of the first wedge is zero and the fourth wedgeis not used in this wedge configuration. The figure only shows the surfacefrom the altitude side such that the discontinuities along the altitude axisare shown. Note that the figure only shows the rotation angles, the wedgesmay also have a starting angle which is not presented in this figure. The axesare removed for confidentiality reasons.

Page 70: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

52 5 Result

5.3.2 Using fmincon

Using the MATLAB function fmincon, the function could take the whole sur-face into account and thereby be able to suppress peaks when possible. Whenusing two rotary wedges, there are only two solutions to the inverse deflectionproblem and therefore peaks could not be suppressed. The fmincon functiongives the same result as fsolve which is presented in Figure 5.7 and Figure 5.8.Having three rotary wedges on the other hand results in unlimited solutions tothe inverse deflection problem. Thereby the peaks and discontinuities of the ro-tation angles can be minimized. In fsolve the initial guess had to be chosenwisely to get a smoother surface and still it contained discontinuities. The advan-tage with fmincon is that each grid point takes its neighbors into account whichmakes each deflection grid point dependent on each other. In this way the initialguess does not make as large difference as with fsolve since it handles the dif-ference between the grid points. Instead it minimizes the difference between gridpoints to get a smooth surface given the nonlinear constraints which states thatthe actual deflection must be equal to the desired deflection. Using small wedgeopening angles, fmincon gives the graph presented in Figure 5.15. As can beseen, the surface have discontinuities which are not tolerable and more testing ofinitial guesses still gave some discontinuities. It was not until larger wedge open-ing angles were used, as the surface became smooth, like in the fsolve case.fmincon had much more tuning effects and gave a better result than fsolvebut took much longer time to calculate.

Φ [rad]

θ [ra

d]

Rotation angle wedge 1

Φ [rad]

θ [ra

d]

Rotation angle wedge 2

Φ [rad]

θ [ra

d]

Rotation angle wedge 3

Φ [rad]

θ [ra

d]

Rotation angle wedge 4

Figure 5.15: The four graphs shows the rotation angles of the wedges plot-ted over a grid of deflection points with the wedge configuration presentedin Section 3.5.2 for small wedge opening angles. The rotation angle of thefourth wedge is not used in this wedge configuration and therefore set tozero. The figure only shows the surface from the altitude side such that thediscontinuities are shown. Note that the figure only shows the rotation an-gles, the wedges may also have a starting angle which is not presented in thisfigure. The axes are removed for confidentiality reasons.

Page 71: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.4 Vignetting 53

5.4 Vignetting

The simulated vignetting can be displayed in a 3D-plot which shows the rays andthe wedges and can be seen in Figure 5.16. In the figure, it becomes clear thatthe ray bundle in the exit aperture is not as large as the incident and thereby avignetting has occurred. The vignetting can be seen by analyzing the rays furthestto the right in the figure. The rays which end up outside the wedge radius areneglected and only the rays which passes through all the wedge surfaces definesthe outgoing aperture.

The vignetting can also be visualized as a 2D-plot over the incident ray aper-ture which can be seen in Figure 5.17. Here all the rays that makes its waythrough all wedge surfaces without hitting the outside wall is marked. The per-centage of these gives a description of the ray intensity.

The vignetting is also affected by the final deflection. It varies throughoutthe deflection grid and also for each lobe point which represents the incident raydirection. Thereby, the vignetting can be plotted as a percentage surface over thedeflection grid where the percentage is given by the worst vignetting of all ninelobe points for that deflection point. This is visualized in Figure 5.18.

It can be shown by simulations that the vignetting increase when havinglarger wedge opening angles or longer distances between the wedges and viceversa. Which is intuitive since then the ray refraction becomes larger or the dis-tance to the next wedge becomes longer so that the ray misses the next wedgesurface. Also the incident ray direction which is defined by the lobe points af-fect the vignetting as well as the wedge configuration and deflection area. Sincethe vignetting could be related to the fire range, the vignetting is necessary toevaluate when choosing a wedge configuration.

Page 72: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

54 5 Result

Figure 5.16: The figure shows the vignetting that occurs when the rotatingwedges are rotated so that the deflection is on the deflection point bound-aries. The red lines show the rays and the blue wedges represents the Risley-prisms. The vignetting is described as the rays that hits the wall outside thewedge radius. This can be seen by inspecting the rays furthest to the rightwhich ends outside the wedge radius. The axes are removed for confiden-tiality reasons.

Figure 5.17: The figure shows the vignetting that occurs when the rotarywedges are rotated so that the deflection is on the deflection point bound-aries. The blue circle represents the incident ray aperture an the red marksshow all the rays of that aperture which passes through all wedges withouthitting the surrounding wall of the wedges. The axes are removed for confi-dentiality reasons.

Page 73: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.4 Vignetting 55

Inte

nsity [%

]

Laser beam intensity

Φ [rad]Θ [rad]

Figure 5.18: The figure shows the percentage of how many rays out of thetotal aperture that passes through all wedge surfaces without hitting the sur-rounding wall, over a grid of deflection points. In this way, the fire range canbe evaluated in different deflection points. The axes are removed for confi-dentiality reasons.

Page 74: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

56 5 Result

5.5 Distortion

The distortion is used to evaluate the performance of the wedge configuration. Asmall distortion leads to a better target position estimation, the more distortionresults in a higher error of target position estimation. A plot of the simulateddistortion as well as the wanted lobe pattern without distortion for a grid of de-flection points can be seen in Figure 5.19. By calculating the orthogonal errorfrom the wanted lobe line to the actual lobe points over a grid of deflection pointsresults in the surfaces presented in Figure 5.20. As can be seen, the distortion forlobe point five is really small (∼ 10−9 rad) which is good. This is the accuracy ofthe inverse deflection problem since the inverse deflection problem tries to min-imize the distortion for lobe point five. It shall be mentioned that it can be evenmore accurate, but for this application the accuracy is definitely good enough.For all other lobe points a higher distortion occurs.

Θ [rad]

Φ [ra

d]

Distortion

Figure 5.19: Showing the lobe distortion by ray tracing the nine lobe pointspresented in Figure 2.3 in nine different deflection points. The red crossesare the wanted undistorted lobe pattern and the blue dots represents the ac-tual distortion generated by the wedge configuration. The axes are removedfor confidentiality reasons.

Page 75: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.5 Distortion 57

ǫ [ra

d]

Lobe point 1

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 2

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 3

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 4

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 5

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 6

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 7

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 8

Φ [rad] Θ [rad]

ǫ [ra

d]

Lobe point 9

Φ [rad] Θ [rad]

Figure 5.20: Showing the orthogonal lobe distortion error ε for all nine lobepoints in a grid of deflection points. The graphs are presented in the same or-der as the lobe points in Figure 2.3. The axes are removed for confidentialityreasons.

Page 76: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

58 5 Result

5.6 The Simulink model

The Simulink model consists of mainly three parts, a part translating the desireddeflection angles to wedge rotation angles, a motor model part and a ray tracingpart. The model can be viewed in Figure 5.21. Starting from the left, the sweepin deflection angles are created. In the inverse deflection block, the desired de-flection angles are translated into reference wedge rotation angles. The referencewedge rotation angles are then used in the control loops for the motors. Insideeach control loop there is a motor model describing the actual motor dynamics.The motor model outputs the actual wedge rotation angle which is used in a raytrace block to calculate the actual deflection.

Figure 5.21: The schematics of the Simulink model at root level. The desireddeflection is created to the left and translated by the inverse deflection blockto reference rotation angles of the wedges. The reference rotation angles aretreated by the control system in the motor model which outputs an actualrotation of the wedges. The ray is then traced using the actual wedge rotationangles resulting in the actual deflection angles. The axes are removed forconfidentiality reasons.

5.6.1 Inverse deflection

The inverse deflection block only consists of four tables, one for each wedge. Thetable consists of the same data presented in the rotation angle plots presentedin Section 5.3. The Simulink model of the inverse deflection block is presentedin Figure 5.22. Since the tables use workspace variables it is easy to change thewedge configuration and use other wedge rotation angle data without modifyingthe Simulink model.

5.6.2 Motor model

The motor model block mainly consists of four equal motor models. Inside eachmotor block the control loop is found together with the commutation and motormodel which can be seen in Figure 5.23.

Page 77: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.6 The Simulink model 59

Figure 5.22: The Simulink block representing the inverse deflection. The in-verse deflection is calculated before in a script and loaded to the workspacewhen choosing wedge configuration. The Simulink model then use the in-terpolation inside that table to handle any grid point. The axes are removedfor confidentiality reasons.

5.6.3 Ray tracing

The ray tracing presented in Section 3.3.1, is implemented in the ray tracing blockin Simulink. The ray tracing simply use the incident ray to the first wedge andcalculates the refracted ray which is used as an incident ray for the next surfaceand so on. Until it has calculated the refracted ray of the last surface. Thenthe deflection angles are calculated and stored to the MATLAB workspace. TheSimulink model of the ray tracing for one wedge is presented in Figure 5.24.

5.6.4 Simulating the whole system

By simulating the whole system, the system could be evaluated. In this sectionthe cascaded P-controller which gave best control loop performance and the firstwedge configuration example presented in Section 3.5.1, which had no discon-tinuities but a slightly higher required acceleration, is used. By evaluating thesystem performance in a Simulink model, parameters which might be hard tomeasure on the physical system can now be measured and evaluated given thatthe model is correct. Also modifications to the model can be made to see whatneeds to be done to acquire a certain system performance. After setting up a de-sired deflection trajectory, the Simulink model were run and gave the trajectorytracking presented in Figure 5.25. Since the starting position of the wedges arenot the starting position of the trajectory, the system have to first steer its way tothe trajectory and then follow it. After a short settling time the deflection reachesthe deflection trajectory and from there on the simulated deflection tracks the de-

Page 78: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

60 5 Result

Figure 5.23: This is the motor model implemented in Simulink. From leftcomes the reference rotation angle which is handled by a control systemwhich creates a control signal representing the voltage reference to the com-mutation. The commutation transforms the voltage reference into phasevoltages which feeds the motor model. The axes are removed for confiden-tiality reasons.

flection trajectory well.The deflection tracking can also be seen in a horizontal and a vertical deflec-

tion separately as shown in Figure 5.26. There the settling time can be evaluatedas well as the overshoot and the deflection tracking.

Since the data transmitted by the laser is sensitive of having a constant sweepvelocity, also the horizontal sweep velocity is important to study. As can be seenin Figure 5.27, the horizontal sweep velocity is fairly constant but cannot trackthe reference deflection velocity fully since the reference is discontinuous.

To evaluate the motor performance, the motor angle, angular velocity andangular acceleration can be studied for each individual motor. This can be seen inFigure 5.28, Figure 5.29 and Figure 5.30. The motor angles and angular velocitiestracks the reference in a good way and the acceleration is quite low which resultsin a low power consumption.

To calculate the power consumption, also the voltage and current needs to becalculated and plotted. The applied voltage can be seen in Figure 5.31 and thecurrent for each individual motor can be seen in Figure 5.32.

Out of the voltage and current data, the power for each individual motor canbe calculated. The result for each motor is given in Figure 5.33 and the totalpower consumption for all motors are shown in Figure 5.34.

Also the second example presented in Section 3.5.2 was tested for the wholesystem with as small wedge opening angles as possible (without discontinuities)but it was evaluated to have too large vignetting and distortion. The third exam-ple using a flipping wedge (presented in Section 3.5.3) was evaluated to move theflipping wedge too slowly which could lead to high accelerations for the otherwedges even though it was supposed to reduce the accelerations. Therefore, thefirst example with two rotary wedges was chosen to be the best out of these threeexamples and the evaluation process with simulating the whole system gave agood indication of the system behaviour.

Page 79: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.6 The Simulink model 61

Figure 5.24: The ray tracing is done for each wedge and the resulting raydirection is passed on to the second wedge and so on. This figure only showsthe subsystem for one wedge. The surface normal is calculated and used tocalculate the ray direction between the wedge surfaces. The surface normalof the second surface is calculated and the refraction of the second surfaceof the wedge is calculated. The axes are removed for confidentiality reasons.

Θ [rad]

Φ [ra

d]

Deflection tracking

Simulated deflection

Reference deflection

Figure 5.25: Showing the deflection tracking made with cascaded P con-troller for first wedge configuration example (Section 3.5.1). The red linerepresents the reference deflection and the blue line represents the simu-lated deflection. The axes are removed for confidentiality reasons.

Page 80: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

62 5 Result

Time [s]

Θ [

rad

]

Horizontal deflection

Simulated horizontal deflection

Reference horizontal deflection

Time [s]

Φ [

rad

]

Vertical deflection

Simulated vertical deflection

Reference vertical deflection

Figure 5.26: Shows the deflection in horizontal and vertical direction sep-arately. The red line represents the reference deflection and the blue linerepresents the simulated deflection. The axes are removed for confidential-ity reasons.

Time [s]

/dt

[ra

d/s

]

Horizontal deflection velocity

Simulated horizontal deflection velocity

Reference horizontal deflection velocity

Time [s]

/dt

[ra

d/s

]

Vertical deflection velocity

Simulated vertical deflection velocity

Reference vertical deflection velocity

Figure 5.27: The deflection velocity in horizontal and vertical direction. Thered line represents the reference deflection velocity and the blue line repre-sents the simulated deflection velocity. The axes are removed for confiden-tiality reasons.

Page 81: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.6 The Simulink model 63

Time [s]θ [

rad

]

Angle motor 1

Simulated θ

Reference θ

Time [s]

θ [

rad

]

Angle motor 2

Simulated θ

Reference θ

Time [s]

θ [

rad

]

Angle motor 3

Simulated θ

Reference θ

Time [s]

θ [

rad

]

Angle motor 4

Simulated θ

Reference θ

Figure 5.28: Shows the motor angle tracking for each individual motor.Since the wedge configuration used in the simulation (presented in Sec-tion 3.5.1) only use motors on wedge two and three, the first and fourthmotor shown in the figure are set to zero. The red line represents the ref-erence motor angle and the blue line represents the simulated motor angle.The axes are removed for confidentiality reasons.

Time [s]

ω [

rad

/s]

Angular velocity motor 1

Simulated ω

Reference ω

Time [s]

ω [

rad

/s]

Angular velocity motor 2

Simulated ω

Reference ω

Time [s]

ω [

rad

/s]

Angular velocity motor 3

Simulated ω

Reference ω

Time [s]

ω [

rad

/s]

Angular velocity motor 4

Simulated ω

Reference ω

Figure 5.29: Shows the motor angular velocity tracking for each individualmotor. Since the wedge configuration used in the simulation (presented inSection 3.5.1) only use motors on wedge two and three, the first and fourthmotor shown in the figure are set to zero. The red line represents the refer-ence motor angular velocity and the blue line represents the simulated motorangular velocity. The axes are removed for confidentiality reasons.

Page 82: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

64 5 Result

Time [s]

α [ra

d/s

2]

Angular acceleration motor 1

Time [s]

α [ra

d/s

2]

Angular acceleration motor 2

Time [s]

α [ra

d/s

2]

Angular acceleration motor 3

Time [s]

α [ra

d/s

2]

Angular acceleration motor 4

Figure 5.30: Shows the motor angular acceleration for each individual mo-tor. Since the wedge configuration used in the simulation (presented in Sec-tion 3.5.1) only use motors on wedge two and three, the first and fourth mo-tor shown in the figure are set to zero. The red line represents the referencemotor angular acceleration and the blue line represents the simulated motorangular acceleration. The axes are removed for confidentiality reasons.

Time [s]

Vo

lta

ge

[V

]

Voltage motor 1

Phase 1

Phase 2

Phase 3

Time [s]

Vo

lta

ge

[V

]

Voltage motor 2

Phase 1

Phase 2

Phase 3

Time [s]

Vo

lta

ge

[V

]

Voltage motor 3

Phase 1

Phase 2

Phase 3

Time [s]

Vo

lta

ge

[V

]

Voltage motor 4

Phase 1

Phase 2

Phase 3

Figure 5.31: Shows the voltage applied for each individual motor and forall three phases. Since the wedge configuration used in the simulation (pre-sented in Section 3.5.1) only use motors on wedge two and three, the firstand fourth motor shown in the figure are set to zero. The blue line repre-sents the voltage on phase 1, the red line represents the voltage on phase 2and the green line represents the voltage on phase 3. The axes are removedfor confidentiality reasons.

Page 83: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

5.6 The Simulink model 65

Time [s]C

urr

en

t [A

]

Current motor 1

Phase 1

Phase 2

Phase 3

Time [s]

Cu

rre

nt

[A]

Current motor 2

Phase 1

Phase 2

Phase 3

Time [s]

Cu

rre

nt

[A]

Current motor 3

Phase 1

Phase 2

Phase 3

Time [s]

Cu

rre

nt

[A]

Current motor 4

Phase 1

Phase 2

Phase 3

Figure 5.32: Shows the current applied for each individual motor and forall three phases. Since the wedge configuration used in the simulation (pre-sented in Section 3.5.1) only use motors on wedge two and three, the firstand fourth motor shown in the figure are set to zero. The blue line repre-sents the current on phase 1, the red line represents the current on phase 2and the green line represents the current on phase 3. The axes are removedfor confidentiality reasons.

Time [s]

Po

we

r [W

]

Power motor 1

Time [s]

Po

we

r [W

]

Power motor 2

Time [s]

Po

we

r [W

]

Power motor 3

Time [s]

Po

we

r [W

]

Power motor 4

Figure 5.33: Shows the power consumption for each individual motor. Sincethe wedge configuration used in the simulation (presented in Section 3.5.1)only use motors on wedge two and three, the first and fourth motor shown inthe figure are set to zero. The axes are removed for confidentiality reasons.

Page 84: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

66 5 Result

Time [s]

Po

we

r [W

]

Total power

Figure 5.34: Shows the total power consumption for both motors used in theexample presented in Section 3.5.1 when following the deflection trajectory.The axes are removed for confidentiality reasons.

Page 85: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

6Discussion

In this chapter the solution method presented in Chapter 4 and the results pre-sented in Chapter 5 will be discussed. This chapter also includes a hint of whatcould be made in the future.

6.1 Modeling the motors

Since some of the motor parameters were known and some were not, step re-sponses was made and given the motor model presented in Section 3.1.1, themotor parameters were estimated so that the model fitted the actual motor per-formance. In this process there could have been many errors. At first, the motormodel could be wrong and not fully describe the motor performance which alsocould be seen in Figure 5.3, where the experimental data and the simulated datais not exactly the same. But the model seems fit the data relatively close and it isprobably therefore, the model has been used widely academic articles regardingmodeling BLDC motors. But the motor parameters would have to be estimatedfrom more testing of unique motors to get a good overall estimate. The param-eters may also be tested for other operating points to give a more accurate andreliable result.

Regarding the slight drift in motor angle shown in Figure 5.2, there might beerrors on the measured data from the experiment. Out of a set of motors, thisdata was chosen since it was quite symmetrical regarding how much voltage wasneeded to make a certain step in positive and negative angle direction. Whentrying with a different motor, the applied voltage was less symmetrical to make astep which indicates that the individual properties of the motor may vary.

It was also assumed that if the fit of motor angular velocity is relatively good,the required voltages, currents and acceleration would be relatively good. Themotor angle deviation is not be a problem since the control loop would correct the

67

Page 86: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

68 6 Discussion

motor angle either way. But the voltage and current had to match the real motorso that the Simulink model could provide a trustworthy voltage and current.

By increasing the number of tests at different operating points for parame-ter estimation, the simulated motor performance could be improved so that itmatches the actual BLDC motor even more. The test process could also be spedup by creating a HIL (Hardware In Loop) test equipment directly connected toMATLAB instead of saving the data on a file from the oscilloscope and loading itto MATLAB.

6.2 Choosing control loop

There are many more control loops that could be evaluated. The control loopstested in this master thesis are quite simple, but the simpler the better if it stillfulfills the requirements. When starting this master thesis, the idea was to alsoevaluate a model predictive controller (MPC) which is much more complex, butsince the simpler cascaded P-controller solves the problem, there was no need forthe model predictive controller to be evaluated. It would though be interestingto compare the cascaded P-controller with the MPC, to see the difference sincethe MPC is the optimal controller for the problem taking the constraints andnonlinearities into account. But the MPC requires a lot of computations and thelimitations set on the physical system would probably not be able to handle suchcomputations to be done online. In Enqvist and Strömberg [2014], the solution isto use an explicit MPC which solves the problem offline. The drawback of usingan explicit MPC is that it solves the problem for all possible cases. If there isnot so many cases, the explicit MPC would be a suitable solution but if there aremany cases, the explicit MPC would become ineffective. Either way, comparingthe result from an MPC controller to the cascaded P-controller would give anindication of how much better the system could be controlled.

The system nonlinearities made it hard to analyze the system and therebyhard to analytically choose the control parameters. Simple control loops gavea satisfying result and thereby the system was not analyzed more. Evaluatingthe control loops resulted in the cascaded P-controller being the best. Using theknowledge of the motor angular velocity gave a new dimension to the problemand thereby the cascaded P-controller became more robust and easily tuned.

6.3 Solving the inverse deflection problem

The MATLAB functions "fsolve" and "fmincon" both gives a solution to the inversedeflection problem but no found solution have been sufficient enough for the casewhen having three rotary wedges to fulfill the system requirements. The threerotary wedge solution were thereby discarded as a suitable wedge configuration.Also the solution with two rotary wedges together with a flipping wedge wereneglected since the flipping wedge could not move 180◦during the retardationand acceleration phase of the sweep. Out of the three examples, the first wedgeconfiguration example presented in Section 3.5.1 is the most preferable. The

Page 87: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

6.4 Calculating the vignetting 69

inverse deflection problem is easily solved but the hessian (the required motoracceleration) is a bit high which results in higher power consumption.

Solving the inverse deflection problem with "fmincon" might sound better intheory than solving it with "fsolve" since it takes all grid points into account. Buteither the "fmincon" finds a local minimum for all my initial guesses or it couldbe tuned even more, regarding finding a solution for a wedge configuration ofthree rotary wedges having small wedge opening angles. Either way, the "fsolve"function tends to give a better solution to the inverse deflection problem when ituses the previously calculated rotation angle as the initial guess for the next gridpoint.

The resolution of "fsolve" is also higher, 2501 grid points compared to 117grid points for "fmincon". The reason is that an increase of the grid points for"fmincon" soon gives a very large minimization problem which leads to long cal-culations. As consequence of this, the resolution used here is reduced to a totalof 117 grid points which means that there could be a discontinuity between thegrid points as is also shown in Figure 5.15.The "fmincon" solution could probablybe tuned more to faster give a result and thereby more testing could be done andalso the grid could be expanded.

Using "fsolve" and "fmincon" might also be able to handle the inverse deflec-tion problem for four rotary wedges or more giving another degree of freedomwhich might lead to smaller accelerations of the wedges. But the smaller accel-eration and also power consumption then needs to be compared to the cost ofanother motor.

6.4 Calculating the vignetting

Calculating the vignetting by sending an aperture of rays through the optics andevaluating how many rays that comes out is a simple way of getting a roughestimate of the vignetting. Depending on how many rays that are used, the resultbecomes more or less accurate. Infinitely many rays would represent the truevignetting, but since that is impossible, the result given by this method wouldonly result in an estimate of the vignetting. Better would be to evaluate how theaperture change. By following the aperture circle which is refracted and cut offby the circular edges of the wedges, the intersection of all circles would representthe refracted aperture. This area is then divided by the area of the incident rayaperture which would give a more accurate definition of the laser beam intensity.

As the vignetting is implemented in this report, the intensity is approximatedto be proportional to the vignetting losses. As work in the future, the laser beamintensity model could be more detailed so that the fire simulator range could beestimated and simulated in a better way.

6.5 Calculating the distortion

Given that the ray tracing and inverse deflection used in this report is correct, thedistortion would be correct since it uses an incident ray and calculates the final re-

Page 88: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

70 6 Discussion

fracting ray given the rotation angles of the wedges. The distortion result shouldthereby be very accurate since it traces the rays using Snell’s law and gives a re-ally good theoretical distortion. However, the real distortion may deviate fromthe theoretical distortion since the wedges might not be placed in the exact posi-tion which might lead to small or large errors in the deflection (explained in Yuan[2014]). Yuan [2014] also states that the sensitivity of position errors are largerfor the latter wedges (wedges placed in the end) and that a larger refractive indexleads to smaller error allowances which could increase the actual distortion.

6.6 The Simulink model

The Simulink model is made very modular and split up into subsystems whichcould be evaluated separately. In this way, the subsystems could be easily com-bined, modified, replaced and debugged. By creating a Simulink model of thesystem, the system could be simulated without having to modify or use the realhardware which is perfect for a large group of developers with just a few real testequipments. The Simulink model could be improved with more detailed compo-nents and dynamics to give a better fit of the real hardware. The model couldalso include more components so that maybe the whole fire simulator and alsothe target simulator could be simulated in Simulink.

6.7 Simulating the whole system

The usability was taken into account when creating the system which made itvery easy to use. To simulate the whole system, load the wanted wedge config-uration, run the simulation and analyze the data by running different plottingscripts. When working on developing a new fire simulator, a modification caneasily be tested and evaluated without having to change any physical hardwareon the fire simulator.

Page 89: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

7Conclusions

7.1 General conclusion

A MATLAB/Simulink model of the electro-opto/mechanical system has been suc-cessfully developed. The MATLAB/Simulink model includes the modeling ofBLDC motors, ray tracing and solving the inverse deflection problem. Out of thetests made, the model behaves reasonably close to the real system. The modelis also very modular which makes room for further development and improve-ments which can be used to develop the new laser simulator platform.

7.2 Motor model

The motor model behaves like the real motor adequately well but there may bemore nonlinearities in the motor behaviour that is not described by the motormodel and which might be individual for each motor. Such nonlinearities couldbe that the motor might rotate easier in one direction than the other which is veryhard to model especially when seen in the bigger picture where many motors areused and each one cannot be modeled separately.

7.3 Ray tracing

The ray tracing behaves really well. When tracing a ray, both the intersectionpoint and the ray direction/deflection is calculated. Also the calculation timehave been reduced which gives capabilities of analyzing the distortion and vi-gnetting which occurs when letting multiple rays pass the wedges.

71

Page 90: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

72 7 Conclusions

7.4 Inverse deflection

The inverse deflection problem is solved and simulated. The two wedge examplegives a smooth wedge rotation angle surface but the required accelerations be-comes quite high. When using three rotary wedges, the rotor angle surface havebecome discontinuous for tests with small wedge opening angles. If there exists asolution with a continuous surface when the wedge opening angles are small, arenot known. Increasing the wedge opening angles resulted in a continuous wedgerotation surface but gave a higher vignetting and distortion. In the example witha flipping wedge which was flipped 180◦at a certain deflection altitude, the resulthad only one discontinuity in that deflection altitude. But the retardation and ac-celeration time of the sweep was too short to be able to move the flipping wedge180◦and was therefore neglected.

Page 91: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Bibliography

Christopher T. Amirault and Charles A. DiMarzio. Precision pointing using adual-wedge scanner. Applied optics, 24(9):1302–1308, 1985. Cited on page 3.

Stefán Baldursson. Bldc motor modeling and control - a matlab/simulinkimplementation. Master’s thesis, Chalmers University of Technology,2005. URL http://webfiles.portal.chalmers.se/et/MSc/BaldurssonStefanMSc.pdf. Cited on page 4.

Michael Bass. Handbook of optics, volume 1. McGraw-Hill Inc., 2 edition, 1995.Cited on page 22.

Sasi Devisree. Modelling and simulation of svpwm inverter fed permanent mag-net brushless dc motor drive. International Journal of Advanced Research inElectrical, Electronics and Instrumentation Engineering, 2(5):1947–1955, 2013.Cited on page 4.

Gunnarsson Lindskog Ljung Löfberg McKelvey Stenman Enqvist, Glad andStrömberg. Industriell Reglerteknik. Linköpings Universitet, 2014. Cited onpages 19 and 68.

Balogh Tibor Fedák, Viliam and Pavel Záskalický. Dynamic simulation of electri-cal machines and drive systems using matlab gui. In Vasilios N. Katsikis, editor,MATLAB - A fundamental tool for scientific Computing and Engineering Ap-plications - Volume 1, volume 1, chapter 14, pages 317–342. InTech, Sep. 2012.Cited on page 4.

Haitao Li Jiancheng, Fang and Han Bangcheng. Torque ripple reduction in bldctorque motor with nonideal back emf. IEEE Transactions on Power Electronics,27(11):4630–4637, 2012. Cited on page 4.

Mustafa Kamal. Speed control of brushless dc motor using fuzzy based con-trollers. In 2014 IEEE Students’ Conference on Electrical, Electronics andComputer Science (SCEECS), pages 1–6, Bhopal, Mar. 2014. IEEE. Cited onpage 4.

Michael J. Kidger. Fundamental Optical Design. SPIE - The International Societyfor Optical Engineering, 2002. Cited on page 22.

73

Page 92: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

74 Bibliography

D Lenine. Estimation of speed and rotor position of bldc motor using extendedkalman filter. In IET-UK International Conference on Information and Com-munication Technology in Electrical Sciences (ICTES 2007), pages 433–440,Tamil Nadu, Dec. 2007. IET. Cited on pages 4 and 15.

Zhu Liangtao. Adaptive control of Sinusoidal Brushless DC Motor ac-tuators. PhD thesis, Michigan Technological University, 2008. URLhttp://digitalcommons.mtu.edu/cgi/viewcontent.cgi?article=1426&context=etds. Cited on page 4.

Niapour Mozaffari. Design and analysis of speed-sensorless robust stochasticl-induced observer for high-performance brushless dc motor drives with di-minished torque ripple. Energy Conversion and Management, 64(1):482–498,2012. Cited on page 4.

Niapour Mozaffari. A new robust speed-sensorless control strategy for high-performance brushless dc motor drives with reduced torque ripple. ControlEngineering Practice, 24(1):42–54, 2014. Cited on page 4.

N Muruganantham. State space modeling and simulation of sensorless perma-nent magnet bldc motor. International Journal of Engineering Science andTechnology (IJEST), 2(10):5099–5106, 2010. Cited on page 4.

Christoffer Nilsson and Daniel Modrack. Universal embedded motorcontrol. Master’s thesis, Chalmers University of Technology, 2013.URL http://publications.lib.chalmers.se/records/fulltext/193773/193773.pdf. Cited on pages 4 and 17.

Fredrik Petersson. Sensor-less control of a permanent magnet synchronousmotor. Master’s thesis, The Institute of Technology at Linköping Univer-sity, 2009. URL http://liu.diva-portal.org/smash/get/diva2:208355/FULLTEXT01.pdf. Cited on page 4.

Matthias Preindl and Silverio Bolognani. Model predictive direct speed controlwith finite control set of pmsm drive systems. IEEE Transactions on PowerElectronics, 28(2):1007–1015, 2013. Cited on page 4.

S. Rambabu. Modeling and control of a brushless dc motor. Mas-ter’s thesis, National Institute of Technology, Rourkela, 2007. URLhttp://ethesis.nitrkl.ac.in/4304/1/Modeling_and_control_of_a_brushless_DC_motor.pdf. Cited on page 4.

Fedak Viliam Tibor, Balogh and Frantisek Durovsky. Modeling and simulation ofthe bldc motor in matlab gui. In 2011 International Symposium on IndustrialElectronics (ISIE), pages 1403–1407, Gdansk, Jun. 2011. IEEE. Cited on pages4, 13, and 14.

Lu Yafei. Theoretical and experimental determination of steering mechanism forrisley prism systems. Applied optics, 52(7):1389–1398, 2013. Cited on page 4.

Page 93: Modeling and control of Risley prism beam steering ...958032/FULLTEXT01.pdf · BLDC Brushless direct current motor Back-EMF Back electromotive force P-controller Proportional controller

Bibliography 75

Yang Yaguang. Analytic solution of free space optical beam steering using risleyprisms. Journal of Lightwave Technology, 26(21):3576–3583, 2008. Cited onpage 3.

Li Yayun. Closed form analytical inverse solutions for risley-prism-based steeringsystems in different configurations. Applied optics, 50(22):4302–4309, 2011.Cited on page 3.

Zhou Yuan. Motion control of the wedge prisms in risley-prism-based beam steer-ing system for precise target tracking. Applied optics, 52(12):2849–2857, 2013.Cited on page 4.

Zhou Yuan. Pointing error analysis of risley-prism-based beam steering system.Applied optics, 53(25):5775–5783, 2014. Cited on pages 4 and 70.