EXAMENSARBETE INOM MASKINTEKNIK, AVANCERAD NIVÅ, 30 HP STOCKHOLM, SVERIGE 2018

Robust and Adaptive Motion Control for Windscreen Wiping on Commercial Vehicles

PETER FJELLANDER

KTH SKOLAN FÖR INDUSTRIELL TEKNIK OCH MANAGEMENT

Robust and Adaptive Motion Control for Windscreen Wiping on Commercial Vehicles

PETER FJELLANDER

Master’s Thesis at ITM Supervisor: Martin Edin Grimheden Examiner: Martin T¨orngren

TRITA-ITM-EX 2018:162

Master of Science Thesis TRITA-ITM-EX 2018:162

Robust and Adaptive Motion Control for Windscreen Wiping on Commercial Vehicles

Peter Fjellander

Approved Examiner Supervisor 2018-06-15 Martin Törngren Martin Grimheden Commissioner Contact person Scania CV AB Anders Sundström Abstract Windscreen wiping is an important part of safety and vehicle maneuverability. However, importance does not automatically imply progression, and the wiping functionality for heavy commercial vehicles have remained roughly the same through decades. When redesigning the cab for the latest generation at Scania, the thickness of the firewall was reduced to save weight. This reduced the stiffness of the cab, which made the vibrations in the pedal from actuating the windscreen wiper rise to a critical level. The problem definition in this thesis was to understand the root-cause and cooperation in the system by doing modelling and Model-Based Design (MBD), rather than starting with experimental verification. The task was to investigate what changes needed to be made in the controlling of the wiper motor and system specification of the ECU to reduce vibrations and ensure Scania's position as a premium brand in the future. The windscreen wiping system was modelled in Simulink, with both Simulink blocks and Simscape models. A current-measuring voltage-controller for motion-profiles was developed and verified on real production hardware. Recommendation for future development of next ECU generation regarding sampling time and controller design was made and the importance of considering the whole system design was emphasized. Results showed that controlling with current measurement of DC-motors as input parameter is a volatile approach due to disturbances. The algorithms depending on this measurement needs to be very robust, since filtering adds unwanted delay to the control loop. Further investigations should be made in the component selection when mapping motors with the correct driver. The more logic placed in the motor, the less need for a complex ECU and vice versa.

Keywords: motion control, current measurement, windscreen wiping, dc motor, pwm, model- based design

Examensarbete TRITA-ITM-EX 2018:162

Robust och adaptiv rörelsestyrning för vindrutetorkning på kommersiella fordon

Peter Fjellander

Godkänt Examinator Handledare 2018-06-15 Martin Törngren Martin Grimheden Uppdragsgivare Kontaktperson Scania CV AB Anders Sundström Sammanfattning För att kunna framföra ett fordon på ett säkert sätt är vindrutetorkning är en viktig del. Men, bara för att det är en viktig del i användandet innebär det inte att det är en viktig del i utvecklingen. Detta har visat sig genom att funktionen och designen av vindrutetorkare på lastbilar har varit densamma i årtionden. När hytten till Scanias senaste lastbilsmodell designades så minskades tjockleken på torpedväggen för att spara vikt. Detta minskade även styvheten i hytten, vilket fick de vibrationer som inducerades vid körning av vindrutetorkarna att nå en kritisk gräns. Problemställningen för detta exjobb var därför att förstå ursprunget till dessa vibrationer och hur delsystemen interagerar med varandra genom att utföra modellbaserad utveckling (MBD). Uppgiften var att undersöka vilka ändringar som behövde genomföras i styrningen av vindrutetorkarna och systemspecifikationen för den inbyggda styrenheten för att reducera vibrationerna och säkerställa Scanias position som premiummärke även i framtiden. Vindrutetorkarsystemet modellerades i Simulink, med både Simulink-block och Simscape- modeller. En strömberoende spänningskontroller för rörelsestyrning utvecklades för att sedan verifieras på nuvarande hårdvara. Rekommendationer för framtida arbete på ECU gällande systemfrekvens för mätning samt algoritmdesign gjordes, samt helhetstänket vid design av ett nytt system poängterades. Resultaten visar att styrning av en likströmsmotor med ström som ingångsparameter är komplicerat då strömmen varierar kraftigt på grund av störningar. Algoritmen som behandlar mätdatat måste därför vara väldigt robust eftersom filtrering påverkar systemet genom att lägga till fas i kontrollern, vilket ger eftersläpningar. Kommande arbetsinsatser bör fokusera på hur man väljer komponenter som matchar varandra gällande likströmsmotor och ECU. Desto mer logik som placeras i motorn, desto mindre datorkraft behövs i den inbyggda styrenheten.

Nyckelord: rörelsestyrning, strömmätning, vindrutetorkning, dc-motor, pwm, modellbaserad utveckling

Acknowledgements

I would like to thank my academical supervisor Martin Grimheden for guidance during the project. I would also like to thank Scania and my industrial supervisor Ortwin Schl¨uterfor giving feedback on the project. Thanks also goes to Anders Sundstr¨omfor proofreading and giving second opinions. Secondly, I would like to thank dSPACE GmbH and Petter Bellander at Fengco for providing the thesis with software to fully utilize the experimental setup. Lastly, I would like to thank my colleagues at Scania. An extra thanks is directed to Tuhin Chowdhury and P¨arMagnussson for their contribution beyond expectation in the definition phase of the thesis, and to Steffen Langhammer for help with elevation of privileges beyond expectation. Contents

1 Introduction 1 1.1 Background and problem description ...... 1 1.2 Purpose and definitions ...... 3 1.2.1 Improving system characteristics ...... 3 1.3 Scope and definitions ...... 3 1.3.1 Problem identification ...... 4 1.4 Methodology ...... 4 1.5 Ethical considerations ...... 5

2 Windscreen wiping today 7 2.1 System architecture ...... 7 2.2 Mechanical linkage ...... 8 2.3 Principles of actuation ...... 9 2.4 Drive unit and current control ...... 10 2.4.1 Existing drive unit ...... 10 2.4.2 Controllable parameters ...... 10 2.4.3 Current-dependent algorithm ...... 11 2.5 About patents/CPC ...... 12

3 Modelling and parameters 15 3.1 Mechanical linkage ...... 15 3.1.1 External load - naive approach ...... 17 3.1.2 External load - simple approach ...... 19 3.2 Electrical motor model ...... 20 3.2.1 Park sensor ...... 20 3.2.2 Design considerations ...... 21 3.3 ECU ...... 22 3.4 Model verification ...... 22 3.5 Current-sensing ...... 22 3.5.1 Controller strategy ...... 22 3.6 Summarizing of modelling and results ...... 25

4 Experiments and verification 27 4.1 System overview ...... 27 4.2 Hardware ...... 27 4.2.1 Power supply and measurement tool ...... 27 4.2.2 Driver ...... 28 4.2.3 Motor ...... 29 4.2.4 Load and disturbance ...... 29 4.2.5 Microcontroller ...... 30 4.3 Test plan ...... 31 4.4 Results ...... 32 4.4.1 PWM performance ...... 32 4.4.2 Data charts ...... 32 4.5 Summarizing ...... 38

5 Discussion and conclusions 41

6 Recommendations and future Work 43

Bibliography 45

Appendices 48

A Matlab toolboxes 49 A.1 Mathworks-developed toolboxes ...... 49 A.2 dSPACE-developed toolboxes ...... 51

B Matlab code 53 B.1 Matlab scripts ...... 53 B.1.1 Matlab main code ...... 53 B.1.2 Real world measurements ...... 54 B.1.3 Mathematic parameters of linkage ...... 55 B.1.4 Mathematic calculation of linkage ...... 55 B.1.5 Motor data from supplier ...... 56 B.1.6 Simulink parameters ...... 57 B.1.7 Plot style ...... 58 B.1.8 Trajectory figure generation ...... 58 B.2 Matlab functions ...... 59 B.2.1 Workspace cleanup ...... 59 B.2.2 Calculate circle intersections ...... 59 B.2.3 Extract motor data ...... 60 B.2.4 Analytic plot ...... 61

C Inventory list Simulink 63 C.1 Analytical model ...... 63 C.2 dSPACE model ...... 67 List of Figures

1.1 Windscreen wiper motor acceleration, with starting acceleration impulse 1 1.2 Overview of physical system ...... 2 1.3 Proposed mechanical solution for damping throttle pedal vibration . . . 3

2.1 CAD model of four-bar linkage and wiper motor ...... 8 2.2 Crank-rocker characteristic four-bar linkage. a + f < b + g ...... 8 2.3 System overview ...... 10

3.1 System modelling overview ...... 15 3.2 Linkage in Mechanics Explorer with labels. Joints in capital...... 15 3.3 Mechanical linkage model ...... 16 3.4 Naive load-estimation ...... 17 3.5 Physical quantities of passenger side (PS) ...... 18 3.6 Modelled vs. measured motor torque ...... 18 3.7 Simple load-estimation ...... 19 3.8 Windscreen wiper motor model ...... 20 3.9 Park sensor model ...... 21 3.10 Current-controlled feed-forward model ...... 23 3.11 Voltage profile state machine ...... 24 3.12 Voltage trajectory profile according to state machine in figure 3.11 . . . 24

4.1 Experimental setup ...... 27 4.2 H-bridge block diagram ...... 28 4.3 Evaluation motors ...... 29 4.4 Real world simulator ...... 29 4.5 dSPACE MicroAutoBox II ...... 30 4.6 Circuit diagram for test-setup ...... 30 4.7 MicroAutoBox II controller model. dSPACE-blocks coloured in cyan. . . 31 4.8 Inverted step response at different PWM-frequencies ...... 32 4.9 System performance. Ts = 1 ms ...... 33 4.10 System performance with disturbances. Ts = 1 ms ...... 33 4.11 System performance. Ts = 2 ms ...... 34 4.12 System performance with disturbances. Ts = 2 ms ...... 34 4.13 System performance. Ts = 10 ms ...... 35 4.14 System performance with disturbances. Ts = 10 ms ...... 35 4.15 System performance. Ts = 20 ms ...... 36 4.16 System performance with disturbances. Ts = 20 ms ...... 36 4.17 System performance. Ts = 50 ms ...... 37 4.18 System performance with disturbances. Ts = 50 ms ...... 37 List of Tables

2.1 Patent tags B06S ...... 12

3.1 Linkage attributes ...... 16 3.2 Load parameters ...... 19 3.3 Worm gear attributes ...... 20 3.4 Motor attributes ...... 21 3.5 State machine parameters ...... 23

4.1 System performance evaluation ...... 38 Glossary

µC microcontroller. 10, 20, 22, 27

BDC brushed DC-motor. 2, 9, 42

BLDC brush-less DC-motor. 9, 42

CAD computer-aided design. 16

CAN Controller Area Network. 10, 44

CMOS Complementary Metal Oxide Semiconductor. 10

CPC Cooperative Patent Classification. 12

DS driver side. 2

ECU electronic control unit. 2, 3, 7, 10, 11, 22, 23, 43, 44

EMC electro-magnetic compatibility. 11, 44

EMI electro-magnetic interference. 20

HMI human-machine interface. 7, 10

MABX2 MicroAutoBox II. 30, 31

MBD model-based design. 7

MOSFET metal oxide semiconductor field effect transistor. 28

NTG New Truck Generation. 1

PS passenger side. 2

PSU power supply unit. 27

PWM pulse width modulation. 21, 23, 32 RMS root mean square. 22

Scania Scania CV AB. 1–4, 10, 11, 21, 42, 44

SPI Serial Peripheral Interface . 10

SPST single pole, single throw. 10

VS-ABC Variable Structure Adaptive Backstepping Controller. 11, 41, 43

VS-MRAC Variable Structure Model Reference Adaptive Control. 11, 41, 43

WWM windscreen wiper motor. 1–3, 29, 41, 43, 44 Chapter 1

Introduction

1.1 Background and problem description

In August 2016, Scania CV AB (Scania) released a new line of , developed as the New Truck Generation (NTG) and marketed as Next Generation Scania. The windscreen wiper system design on the NTG is simple and has proven to be very reliable over the years, but nevertheless has some disadvantages, such as induced vibrations in the cab, which are coming more and more into focus. The vibrations appeared shortly after introducing the new truck line to the pub- lic, so early on Scania realized that the problem had to be taken seriously. Therefore, an investigation was started to find the source of the vibrations. The root-cause of the vibrations was the actuation of the windscreen wiper motor (WWM), but a redesign of the firewall had created a weaker mount for the WWM, from which the vibrations propagated easier. Therefore, the vibration amplitude in the throttle pedal reached critical levels as shown in figure 1.1. [1] Motor 10 10 Wiping cycle ] 2

s 5 5 / 2 0 2 0

-5 -5 acc m/s acc m/s

Acceleration [m -10 -10 Shock impulse -15 -15 0 5 10 0 Find the root cause of the vibration and understand how the vibration gets from the wiper motor to timeTime[sec [s]] Figure 1.1. Windscreen wiper motor acceleration, with starting acceleration impulse

1 CHAPTER 1. INTRODUCTION

Since the WWM is turning both driver side (DS) and passenger side (PS) wipers through a mechanical linkage, the load on the motor axle is a function of the lever angle Φ as seen in figure 1.2.

φ

ωPS, αPS ωDS, αDS

ωM , αM

Figure 1.2. Overview of physical system

Since the brushed DC-motor (BDC) model is described as

di U = R · i + L · + Kemf · φ˙r (1.1) dt and Jr · φ¨r = Ke · i − Tload − dr · φ˙r (1.2) a variable load (Tload) results in a variable current (i) fed into the motor since all other variables are motor-dependent and constant. Due to the current and torque being linearly proportional in a DC-motor [2], the torque varies with alternating current. If the difference elapses within a short period of time, a shock is transferred to the system. The windscreen wipers at Scania current truck generation can be activated at four different modes: high, low, fixed interval and controlled by rain sensor. How- ever, only two different wiping speeds are used: high and low. The speeds are controlled by an electronic control unit (ECU) in an open-loop configuration. Early on in this thesis, three methods for reducing the torque peaks were pro- posed:

1. Introducing a motor with integrated encoder

2. Using existing motor with sensor-less control

3. Make use of existing sensors and analyse the system to implement a controller

In consultation with both Scania and KTH, the first method was deemed un- wanted, since the time to market for a possible solution was too long. The second

2 1.2. PURPOSE AND DEFINITIONS method was academically promising, but was removed due to time constraints and for being too specific. Only the last method deemed sufficient for a thesis work and within the set time constraints.

1.2 Purpose and definitions

Before the start of the thesis work, the vibration problem has been thoroughly investigated mechanically. The current solution is to replace the bolt which transfers the force with a cylindrical vibration damper as seen in figure 1.3.

Figure 1.3. Proposed mechanical solution for damping throttle pedal vibration

However, both Scania and the company producing the vibration damper doubts the damper fulfills Scania’s tough premium-brand requirements to the same extent as the original bolt. Scania also wants something more easily implemented in the production. In total, the goal was to optimize the motion profile of the WWM to avoid non-favourable combinations of force and levers.

1.2.1 Improving system characteristics An overall goal for the thesis was to reduce the vibrations noticed by the driver. Since the truck generation where the problem is present is in production, no hard- ware modifications may be done. However, for those who experience the vibrations in the throttle pedal as a disturbing factor, there is always the possibility for after- market solution, i.e. service. Therefore, the result of this thesis aimed to be of such a magnitude that it is possible and cost effective to implement as an after-market solution by updating ECU software.

1.3 Scope and definitions

Since the research question was almost unlimited in question of possible solutions, some limitations had to be made. The thesis has focused on modelling and integrat- ing systems of different disciplines into each other. Experiments has been done when necessary for verification, and implementation of everything into a production-ready

3 CHAPTER 1. INTRODUCTION container-format is omitted due to time-constraints. More specific, the thesis has focused on current measuring on existing hardware and how to estimate rotor posi- tion with a limited amount of information. A control algorithm has been made and evaluated in terms of adaptability and robustness. Real-world test on production- made trucks was kept to a minimum because of lead time on hardware modifications. Instead, open-bench tests of hardware were favoured. Actuating was only made on the low-speed coil on the motor due to time-constraints. Any modifications of the system and the new solution was going to be compared to requirements imposed by Scania, but the intention is to keep the function of the system intact.

1.3.1 Problem identification

By concatenating the above described scope into a problem description, the follow- ing three points were deducted:

1. Understand the vibration origin

2. Propose new solution for vibration reduction

3. Verify proposed new solution

The first point aimed to answer if it was physically possible to reduce vibrations, or if the system design made it practically impossible with the desired system perfor- mance unaltered. To solve this problem, a descriptive study was made. Secondly, a new solution for windscreen wiping was to be developed. By theoretically assuming the torque is directly proportional to the current, a solution based on the measura- bility of current and reduction of the torque peaks was developed. Concurrently, a State-of-the-Art analysis in the field of current measurement was conducted. Lastly, an experimental setup to verify the implied gain from the developed solution was created.

1.4 Methodology

From an engineering point of view, the thesis goal was to improve the driver comfort. This by reducing the vibrations in the throttle pedal in terms of an experimental study with descriptive methods. To reduce the vibrations and get an academic the- sis outcome, the main key was to understand the system and how the subsystems interact with each other. By doing theoretical analysis and modelling of mecha- tronic components, the foundation for a solution was made. By doing experimental verification the theories were verified. By understanding the interaction occurring in the system, the root cause was isolated and a proper solution was proposed.

4 1.5. ETHICAL CONSIDERATIONS

1.5 Ethical considerations

In theory, the outcome of this thesis proposes a solution which eliminates a distur- bance factor for the truck driver. This leads to more driving-environment aware drivers, but since the problem appears to quite few drivers, the overall outcome for society is small. However, every accident is adding unnecessary pain to society, and if this thesis contributes to reducing the risk of accidents for this small percentage of truck drivers, it does good. Also, this thesis did include experiments on live hardware and was therefore required to taking human safety into account. All safety precautions and regula- tions were fulfilled; i.e. a sufficiently large safety distance was kept when operating windscreen wiper arms. The largest academical ethical consideration was to make sure the thesis work was developed independent from bias from supervisors, stakeholders et al. Asso- ciated with this was also the consideration to be detailed in the thesis work, but respecting the intellectual property rights of involved companies.

5

Chapter 2

Windscreen wiping today

Regarding the given information in previous chapter, a frame of reference needs to be defined. The information gathered in this process is to be held as the literature study of this thesis.

2.1 System architecture

The windscreen wiping system on a manned vehicle usually contains five subsystems: human-machine interface (HMI), control unit, actuator, power transmitter, and wipers. The constraints of the system are usually set by external factors which needs to be weighted by the system architects. Such performance constraints may exist of, but not be limited to, performance - safety, manufacturability - volume, and performance - cost. [3] Because the wiping system is a mechatronic system, a holistic approach in mod- elling is required. Mechatronic systems are complex by nature due to the sheer number of unique components and input parameters. Therefore, modelling the complete system requires the different subsystem models to be as simple as possi- ble. One way of doing this is to use standardized continuous components for physical units and omit complex transient characteristics. [4] During the last decades, the windscreen wiping system has stayed roughly the same, except for one component: the control unit. Prior to the control unit, the actuator was hard-wired to the HMI and possible to control only from the designed HMI interface. With the introduction of the ECU in the 1990s, the possibilities for large functional improvements and integrated functions emerged. [5] However, the wider toolbox also brought an almost infinite set of system states which were non-desirable and harder to model and predict. This set of non-desirable states created the need for model-based design (MBD). Model-based design is a way of capturing the dynamics of a system at a more holistic view early in the design process. By splitting the design into several unique models, the designer may easily re-use previously used models, which reduces time to market and increases quality. [6]

7 CHAPTER 2. WINDSCREEN WIPING TODAY

2.2 Mechanical linkage

A well-known invention of controlling motion is the mechanical linkage.

Figure 2.1. CAD model of four-bar linkage and wiper motor

Most common in the vehicle industry nowadays is to use a four-bar linkage with crank-rocker characteristics as seen in figure 2.1. The crank rotates a complete revolution while the rocker oscillates a fixed set of degrees for every crank revolution. The length of the couplers is adjusted so the desired motion characteristics are achieved.

f

a b

g

Figure 2.2. Crank-rocker characteristic four-bar linkage. a + f < b + g

As classical Newtonian motion mechanics proposes, the most efficient setup is when the arm and lever are perpendicular. This is not the general case of the four- bar linkage. As shown in figure 2.2, the continuous motion of the crank results in different lever angles on the rocker. Hence, the internal damping and friction of the linkage is important for the system characteristics in terms of force distribution and

8 2.3. PRINCIPLES OF ACTUATION thresholds. In a ideal world, free from friction and damping, the motion of each point in the linkage would be perfectly synchronized, i.e. one unit of motion of the crank gives the geometrical scaled one unit of motion at the rocker.

2.3 Principles of actuation

There are many types of actuators available for mechatronic systems. Commonly, they are referred to as electromagnetic actuators, fluid power actuators, piezoelec- tric actuators, thermal shape memory alloy actuators, and other actuators. Each type of actuator can be classified by different performance to simplify design. Vol- umetric power as a function of frequency/efficiency is the intuitive approach, but only after solid mechanic requirements are fulfilled, i.e. actuation stress as a func- tion of actuation strain. [7] There are five types of criterion valid when designing a function with an actuator [8]:

1. Actuator type

2. Physical material properties parameters

3. Physical volumetric parameters

4. Input quantity

5. External load

When designing an actuator with maximum degree of freedom, the task is in practice impossible. Some limitations need to be set, especially since some of the design parameters are dependable. For example, all actuator types have ranges for linear scaling of power. Common actuators used for commercial vehicles are electrical direct current (DC) motors of both brushed and brush-less type, and hydraulic/pneumatic motors. The BDC is cheap, simple, and easy to control. The maximum power is somewhat limited since the heat dissipation is conducted in the rotor. A brush-less DC-motor (BLDC) however, is expensive, needs a driver unit for correct commutation and is complex to control. Therefore the use cases for a BLDC motor are somewhat limited. However, since the heat dissipates through the stator, the power limit for a BLDC is significantly higher than the power limit for a BDC motor. Hydraulic and pneumatic motors are the in principle the same, with only dif- ference in hydraulic motors having a return path for the oil where the pneumatic actuators just release the used air into the premises. Since gas is a worse medium for kinetic energy than oil, the efficiency of pneumatic motors is worse than for hy- draulic ones. However, the use of fluid power actuators is the most practical where high torque is needed and the infrastructure allows an additional component in the loop.

9 CHAPTER 2. WINDSCREEN WIPING TODAY

2.4 Drive unit and current control

2.4.1 Existing drive unit The windscreen wipers at Scania’s current truck generation can be activated at four different modes: high, low, fixed interval and controlled by rain sensor. However, only two different wiping speeds are used: high and low. The speeds are controlled by an ECU in an open-loop configuration.

HMI ECU PERIPHERALS

POWER CAN

Figure 2.3. System overview

Due to legislation, the ECU interacts with HMI directly through I/O pins as shown in figure 2.3, and on a functional level with the rest of the truck through the Controller Area Network (CAN). [9]

Switching component The switch used as peripheral switch in the ECU is an automotive switch from NXP Semiconductors. It is an integrated Complementary Metal Oxide Semiconductor (CMOS) chip for controlling loads in the industrial and automotive industry. Due to the legislation demands, the switch has a fall-back fail-safe mode. The switch communicates with the microcontroller (µC) through a Serial Peripheral Interface bus (SPI) bus and accommodates per channel measurement of open load, over current and short circuit. A single pole, single throw (SPST)-switch is possible to model with a h-bridge. The h-bridge emulates a SPST-switch by using only one-quadrant due to the fact that the polarity is fixed on a switch and it is only high-sided switch characteristics. [2]

2.4.2 Controllable parameters There are always constraints when designing a product aimed to be produced in tens of thousands of units. The current ECU is switching and measuring current, which in theory makes it capable of controlling both current and voltage. However, the

10 2.4. DRIVE UNIT AND CURRENT CONTROL

ECU:s currently in use by Scania is considered not good enough for high frequency operation because of the bandwidth of the I/O. Due to electro-magnetic compati- bility (EMC), every I/O pin is equipped with a low pass filter when applicable, i.e. DC-characteristics usage. The cross-over frequency for the filter is of a magnitude of 50 Hz. This design choice also improves performance by reducing high frequency noise, such as switch bounce. [10] Since the ECU have on-board flash, history may be utilised for each measured parameter. Both voltage and current history are utilized by trajectory algorithms.

2.4.3 Current-dependent algorithm When controlling current in a motor, the desire is often to control a specific mo- tion. When controlling a specific motion, a trajectory control is usually the desired option. When controlling actuators by current, the desire is often to remove jerk and smoothen the motion. However, most industrial systems are open-loop (with- out feedback), which may reduce controllability. A motion trajectory controller is robust to open-loop errors since the trajectory is a known variable. [11] One of the most used algorithms is the sliding mode current control algorithm. Historically, this control technique has suffered from switching imperfections and sliding phenomena, but modern silicon hardware has eliminated previous problems. A general system which is to be controlled by a sliding-mode controller could be described by dy = f(x) + B(x) · u (2.1) dx where u is the input-vector, x the system state and f is the system state as a function of time. By constructing a switching function S(x) = [S1,S2, ..., Sm] where the surface created is Si(x) = ~0, the surface created is called the sliding surface. The sliding function S(x) could be implemented in both continuous and discrete time. [12, 13] Controlling current by using sliding mode current controller is a robust way of controlling since it rejects high frequency noise. Robustness is per se a good property, since controlling actuators with unstable algorithms imposes unnecessary risks. However, to much robustness reduces adaptability, as Rohrs, Valavani, Athans and Stein proposed in the 80s. [14] Combining sliding mode current controls with adaptive schemes to improve adaptiveness is common when constructing modern controllers. Adaptive schemes are weak when handling transients, but for a process with a relative order of one in S-domain, a different method was approached called Variable Structure Model Reference Adaptive Control (VS-MRAC). [15, 16] Queiroz, Araujo and Dias proposes that the VS-MRAC controller is inferior to the Variable Structure Adaptive Backstepping Controller (VS-ABC) due to the need of integral parts and complex controller design, which makes implementation cumbersome. [17] Since robustness is defined as an ability to withstand changes [18], the char- acteristics of a robust current controller should take the shape of a low-pass filter

11 CHAPTER 2. WINDSCREEN WIPING TODAY to smoothen the current profile. As shown previously, the derivate of the current should be low to minimize the impulses to the system, which requires the algorithm to limit the current in some cases.

2.5 About patents/CPC

The Cooperative Patent Classification (CPC) is a joint project between the Euro- pean Patent Office (EPO) and US Patent Office (USPTO) to harmonize the intel- lectual property process, ensure compliance with international patent classification system and reduce the need for cross-verification of patents. [19] From the European Patent office [20] the corresponding CPC tags relevant to this thesis were identified and a search for full-text patents was done. From the full- text search a number of patents was filtered out by reading the abstract, another assertion was done, and thereafter the remaining patents was read in full. Following CPC scheme was researched:

Table 2.1. Patent tags B06S B06S 1/00 Cleaning of vehicles B06S 1/02 . Cleaning windscreens, windows or optical devices B06S 1/04 . . Wipers or the like, e.g. scrapers B06S 1/043 . . . {Attachment of the wiper assembly to the vehicle} B06S 1/0441 . . . . {characterised by the attachment means} B06S 1/0444 . . . . . {comprising vibration or noise absorbing means} B06S 1/06 . . . characterised by the drive B06S 1/08 . . . . electrically driven B06S 1/0814 . . . . . {using several drive motors; motor synchronisation circuits} B06S 1/16 . . . . Means for transmitting drive B06S 1/166 . . . . . {characterised by the combination of a motor-reduction unit and a mechanism for converting rotary into oscillatory movement}

As table 2.1 shows, several different problems are present in the construction of a windscreen wiping system. The squealing friction-noise from the screen has been addressed by Karcher whom proposes a method of motion control of the wiper arm to eliminate squealing noise. [21] Wiping of special or curved windows is also a topic where several different solu- tion has been invented. Garrastacho and Hussaini proposes a design differentiation to overcome the problem of uneven curvature of windscreen. [22] Luik and miller proposes an improved spring-loaded solution for cleaning highly curvature wind- screens. [23] Bichler solves the problem of operating windscreen wiper on an open- able window. [24] Closely related to the curvature is the spherical wiping where

12 2.5. ABOUT PATENTS/CPC

Google has developed a system for passively wipe their roof-mounted LIDAR:s in a 360-degree angle. [25] After concluding the window figure is of no relevance, the actuation force is of interest. Tatsuya et al. has developed an alternative way of mounting the four- bar linkage for improved performance [26] Tetsuya and Takamichi proposes a design where the wiper motor is positioned in between the linkage. [27] Ikeda has developed a solution to utilize a high-performance brush-less motor for driving the linkage. [28] Wegner et al. has invented a method of mounting the wiper arm directly on the motor, eliminating the need for a linkage, but requiring two motors. [29] H¨ogner and Wagner invented a method for programming two separate wipers where one is configured as master and the rest as slaves. [30] Prskawetz et al. continues the work on separate wiper arms by developing an algorithm for self-determination of master/slave. [31] Lastly, the control of the wiper arms have been investigated. Hospital and Jackson proposes a method for adaptive adjusting of a software end-stop to provide self-adaptation to the wipers. [32] Boland proposed an improved yoke-free wiper blade where the end-caps are properly fastened to the wiper. [33] IBM has developed a method to prevent melted snow on a windscreen to refreeze during shut-down phases of heating windscreens. [34] Braun et al. proposes a method for determining system properties regarding the load. [35] Ernst and Kraemer has developed a wind blocking add-on for the wiper arm. [36]

13

Chapter 3

Modelling and parameters

The system is mainly modelled in Simulink to keep the intuitive connection to the real world hardware. [37] By keeping this connection, the model works with param- eters such as position, angular velocity and acceleration instead of the mathematical Laplace transforms of each physical quantity. [38]

ECU MOTOR LINKAGE

Figure 3.1. System modelling overview

A complete Matlab and Simulink model representing figure 3.1 can be found in appendix A, B and C.

3.1 Mechanical linkage

As stated in section 2.2, a mechanical linkage is simple, on a conceptual level. The model in Matlab Mechanics Explorer is built as shown in figure 3.2

BPS BDS DM bPS bDS aM fPS f CPS DS AM CDS

Figure 3.2. Linkage in Mechanics Explorer with labels. Joints in capital.

In Simulink, the mechanical domain is used to model the linkage, hence the mechanical solver, world frame and solver in the bottom of figure 3.3. The model is derived from the Simulink example smdoc four bar. [39]

15 CHAPTER 3. MODELLING AND PARAMETERS

Four-bar linkage PS C PS link DS link DS C

B F Conn2 Conn1 F B B F Conn1 Conn2 F B

PS D DS D 2 2 2 n n n n n n o o o S PS C PS lever C Motor lever C DS lever 1 1 1 n n n n n n

ECU o o o Wiper motor C C C

Position Position Velocity Position Velocity Velocity Acceleration Acceleration Acceleration Actuator Torque Actuator Torque Actuator Torque Force constrained To WS2 Torque constrained To WS1 Force total Torque total t q b F w t t t t c c f t q b q b F F w w f t To WS3 Base-Rocker Base-Rocker Motor axle Revolute Joint1 Revolute Joint park B t PWM ref pulse angle B t B t f(x) = 0 current Load Load2 Controller Park sensor Load vel Load vel 2 2 2 n n n n n n o o o C C C PS B A DS B 1 1 1 n n n n n n o o o C C C W F F F Rocker-Base Transform1 Origo Rocker-Base Transform

B B C f(x) = 0 B

Figure 3.3. Mechanical linkage model

The world frame is attached to the three fixed points of a dual four-bar linkage with co-joined centre point: BPS, BDS and A. Each of those fixed points is attached to a block representing a computer-aided design (CAD) description in Mechanics Explorer in Matlab. Then the model shows that the joints are connected by levers to form the linkage.

Table 3.1. Linkage attributes Signal Type Value Unit Description damping attribute 1.5 × 10−2 N m s/deg Joint damping stiffness attribute 1 × 10−9 N m/deg Joint stiffness density attribute 8000 kg/m3 Bar density

16 3.1. MECHANICAL LINKAGE

Material parameters deducted from the model of the linkage is described in table 3.1. Those parameters were the ones that gave the most successful system response when verifying against measured data as in figure 3.6.

3.1.1 External load - naive approach Good enough is a mantra when modelling system loads. Since the motion of the system is static (except when ice on screen [40]) and the forces from the environ- ment are dynamic, the resulting outcome of system load is hard to predict with methods available for a common student. A good model may be achievable, but to analytically determine such model is a relevant subject for a stand-alone thesis work.

Model As an introduction before dynamic modelling, a semi-static load model was tested as shown in figure 3.4. The approach was to always apply a torque corresponding to the air-force at highway speeds. Since the motion of the wipers makes the lever the most favourable in the middle of the rocker motion, a sinusoidal modification to the torque was applied.

ext_load

Angular Velocity 1 PS S >= 0 Output Torque S PS 2 vel Input Torque Load

ext_load -1 red Karnop friction

m_pos 1 cos 1

Figure 3.4. Naive load-estimation

Results As the results show, the load profile is working according to instructions. The overall characteristics are promising, however, the frequency is not correct and a mysterious peak appears at every turning-point as shown in figure 3.5 and 3.6. The aim of this modelling approach was that the modelled motor torque in red in figure 3.6 should behave the same as the measured motor torque in blue. E.g. the torque-curve should behave similar, which is not the case.

17 CHAPTER 3. MODELLING AND PARAMETERS

Physical Quantities, Passenger side 15 Position PS [rad] Velocity PS [rad/s] Torque PS [Nm] 10

5

0

-5

-10 0 1 2 3 4 5 6 7 8 Time [s]

Figure 3.5. Physical quantities of passenger side (PS)

Motor torque 40 Measured data, dry glass, cold motor, low speed 35 Modelled motor torque

30

25

20

15

Torque [Nm] 10

5

0

-5 0 1 2 3 4 5 6 7 8 Time [s]

Figure 3.6. Modelled vs. measured motor torque

18 3.1. MECHANICAL LINKAGE

3.1.2 External load - simple approach

As the naive approach for modelling the load torque resulted in unexplainable errors too big to be ignored, a simplification of the model was done. The Karnop friction was removed and the model was made less dependent on the position differences. The resulting model can be seen in figure 3.7

ext_load

1 PS S vel S PS 2 Load m_pos cos 0.7 1

Figure 3.7. Simple load-estimation

where input and output is accordingly to table 3.2.

Table 3.2. Load parameters Signal Type Value Unit Description ext load input 3 Nm External load factor vel input N/A rad/s Joint velocity m pos input N/A rad Crank angle Load output N/A Nm Joint load

The load on the joints can be mathematically described as:

load = (1 − |0.7 · cos(m pos)|) · sgn(vel) · ext load (3.1)

19 Four-bar linkage CHAPTER 3. MODELLING AND PARAMETERS PS C PS link DS link DS C

3.2 Electrical motor model B F Conn2 Conn1 F B B F Conn1 Conn2 F B PS D DS D The electrical motor model is a fundamental part of the model, since the real-world 2 2 2 n n n

usability of the results depends on the accuracy of the model. n n n o o o S PS C PS lever C Motor lever C DS lever 1 1 1 n n n n n n

ECU o o o Wiper motor C C C

Position Position Velocity Position Velocity Velocity Acceleration Acceleration Acceleration Actuator Torque Actuator Torque Actuator Torque Force constrained To WS2 Torque constrained To WS1 Force total Torque total t q b F w t t t t c c f t q b q b F F w w f t To WS3 Base-Rocker Base-Rocker Motor axle Revolute Joint1 Revolute Joint park B t PWM ref pulse angle B t B t f(x) = 0 current Load Load2 Controller Park sensor Load vel Load vel 2 2 2 n n n n n n

Figure 3.8. Windscreen wiper motor model o o o C C C PS B A DS B 1 1 1 n n n n n n o o o C

The DC-motor itself is low-pass filtered by input- and output inductances as C C shown in figure 3.8. This is to increase the robustness against electro-magnetic interference (EMI). [9] The DC motor internally connected to a viscously loss-less, W right-handed worm gear with parameters according to table 3.3. F F F Rocker-Base Transform1 Origo Rocker-Base Transform

Table 3.3. Worm gear attributes B B C f(x) = 0 B Description Type Value Unit Gearing attribute 73 - Worm-gear efficiency parameter 0.74 - Gear-worm efficiency parameter 0.65 - Power threshold attribute 0.001 W

The rest of the mechanical motor model is the ideal rotational motion sensor which feeds the rotor angle to the park sensor, ideal velocity feedback from the load on the output shaft, and ideal output torque for actuation of output shaft.

3.2.1 Park sensor The park sensor on the motor is a sheet metal located on the output gear, which indicates parking position. Approximately 2 degrees every revolution the sheet metal is grounded, and therefore sending a pulse to the µC to brake the motor. For the sake of simplicity, the starting position of the wiper motor is also when it is in contact with parking sheet metal. Where to put the parking mode could be a topic

20 3.2. ELECTRICAL MOTOR MODEL of interest to this thesis, but it has shown previously that parking position is not a critical cause for vibrations in the throttle pedal. [41] angle 0 1 PS S > 1 2*pi 1 pulse

Figure 3.9. Park sensor model

As seen in figure 3.9, the output of the parking sensor is binary in the model, but may be any value when implemented on the motor since it is referenced to ground.

3.2.2 Design considerations The physical and electrical design of the motor is decided by the supplier, since Scania buys the complete windscreen-wiping subsystem as a single product. [40] Therefore, the motor parameters available for modelling are somewhat uncertain since no data sheet exists.

Table 3.4. Motor attributes Description Type Value Unit Armature resistance attribute 1.91 Ω Armature inductance attribute 3.75 mH Filter inductance (each) attribute 5.7 µH Back-emf constant attribute 0.113 Vs/rad No-load current input 0.58 A DC supply voltage input 28 V

As shown in table 3.4, the armature inductance is high. This is a design con- straint, because the electrical time constant is L 3.75 mH τe = = ≈ 1.96ms (3.2) R 1.91 Ω which gives a theoretical maximum bandwidth of 1 1 f3db = = ≈ 81.1Hz (3.3) 2πτe 2π · 1.96ms A minimum pulse width modulation (PWM) frequency of 1 fPWM = ≈ 510Hz (3.4) τe is required to theoretically ensure smoothness in the actuation of the wiper motor. For sure, such a low PWM frequency would emit audible noise, which reduces the over-all performance of the system.

21 CHAPTER 3. MODELLING AND PARAMETERS

3.3 ECU

The ECU is represented by a h-bridge driven in one-quadrant mode, i.e. simulation of the currently implemented switch. This part is possible to make more dynamic to use the flexibility of the h-bridge, the only thing to adjust is to make the reference voltage a controlled parameter instead of static.

3.4 Model verification

The common approach when modelling the system was verification by design of subsystems. This means each subsystem’s behaviour was verified against theory. However, when combining all subsystems with the mechanical linkage, the situation becomes more complex. Therefore, the simulated torque output is compared to motor data supplied by the manufacturer. However, this does not guarantee that each individual component performs exactly accordingly to the suppliers design specification. But since the overall system performance for each load is acceptable, the model is deemed sufficient.

3.5 Current-sensing

The key parameter to control the wiper motor is the current. The armature current is measured in the switch described in 2.4.1, which then is communicated to the µC. Three parts are identified as crucial in order to achieve desired performance: current limiter, turning point detection, and soft start. To ensure smooth performance, the deviation from the root mean square (RMS) value should be kept at a minimum. Only in occasional cases should the physical peak current be allowed. To detect the turning point of the wiper helps reducing shock transmission into the truck, since a custom motion profile may be applied to counter such behaviours. Lastly, to ensure a steady transmission of an accelerating system into a steady- state system, a soft start may be introduced. An soft-start algorithm acts upon the difference between the output and reference and limits the maximum acceleration to a pre-determined accepted value.

3.5.1 Controller strategy

The current current-controller is based upon a voltage-trajectory state-machine, which determine the behaviour depending on the input variables as discussed by both Teixeira and Revol [12, 13].

22 3.5. CURRENT-SENSING

1 park park

t period > 0.1 period 1 Period calc i_real i_lim t i_real y PWM VCC 2 1 i i_lim Ts Ts PWM ref To VCC current i-limit uc_enable enable

AccVal AccVal

TurnVal TurnVal Voltage profile1

Figure 3.10. Current-controlled feed-forward model

As figure 3.10 shows, the controller is modelled in high level language in both physical and mathematical domain of Simulink. The parameters of the state ma- chine is according to table 3.5.

Table 3.5. State machine parameters Signal Type Value Unit Description park input N/A N/A Park signal period input N/A s Time for half a period i real input N/A A Motor current i lim input N/A A Minimum motor current Ts input 0.1 s Sampling time enable input 1 N/A State machine enable AccVal input 0.7 N/A Soft-start parameter TurnVal input 0.7 N/A Soft-turn parameter y output N/A N/A PWM output

The period subsystem takes time as input and calculated once every falling edge of the park signal. It takes the current time, subtracts the value from last calculation one period ago, and multiplies by a half. The switch in line with the signal decides that if the period is below 0.1 s (which is physically impossible with current hardware), the period is set to 1 s. The current subsystem takes current and time as input and outputs real and minimum current. Both of the input are then transferred the discrete domain with Zero-Order-Hold with 20 ms sampling time, to simulate a real ECU. For convenience, the current is set to zero during the first 0.3 s of the simulation to avoid transient errors in the starting process. The current minimum is a sliding minimum value of the discretised current with a sliding period of 50 samples. Lastly, the sliding minimum is compared to the no-load current of the motor and replaced if less than or equal, and multiplied with the i lim gain variable (3 %) to set the threshold for the minimum current detection.

23 CHAPTER 3. MODELLING AND PARAMETERS

Soft_start [enable ~= 0] du: y = AccVal+elapsed(sec)*(1/Ts)*(1-AccVal); IDLE [after(Ts,sec)] du: y = 0;

[after(Ts/2,sec)] RUN en: ro = 0;

Soft_stop RUN du: y = 1 - elapsed(sec)*(1/Ts)*2*(1-AccVal); du: y = 1; [after(Ts,sec)]

[(elapsed(sec) > period - 2*Ts) & (ro == 0) & i_real < i_lim]

turn_point_dec du: y = 1 - elapsed(sec)*(1/Ts)*(TurnVal); ex: ro = 1;

[park > 0] 1 [after(Ts,sec)] 2 [(elapsed(sec) > 2*period - 2*Ts) & (ro == 1)] turn_point_acc du: y = (1-TurnVal) + elapsed(sec)*(1/Ts)*(TurnVal);

Figure 3.11. Voltage profile state machine

As figure 3.11 shows, the state machine starts in an idle state, doing nothing. When switching the enable flag, the machine starts to run and moves into the state Soft start where it ramps up during T s time to maximum system voltage. Voltage trajectory profile 1 Soft_start RUN.RUN 0.5 RUN.turn_point_dec RUN.turn_point_acc

Soft_stop Voltage [V] Voltage 0 0 0.5 1 1.5 2 2.5 3 3.5 4 Time [s]

Figure 3.12. Voltage trajectory profile according to state machine in figure 3.11

Since T s is a magnitude smaller than the period, the machine continues to the RUN state automatically where it continues to run with maximum voltage according to 3.12. All this until it reaches the T s before period time, where it continues if the real current is lower than the threshold. After deceleration in the turning point, the system enters next state and accelerates into the RUN state where it continues until the prediction of a full revolution enters. Then it decelerates.

24 3.6. SUMMARIZING OF MODELLING AND RESULTS

If the enable flag is raised, the process continues. The voltage trajectory profile as shown in figure 3.12 lowers the armature voltage on the motor when approaching turning points. As stated in equation 1.1 and 1.2, the reduced voltage results in lowered current, and therefore lowered torque as mentioned in section 1.1. The trapezoidal voltage reference implemented has worse jerk-reduction than the s-curve, but is easier to implement. [42] If better performance is desirable, a better jerk-reduction profile may be implemented instead of the trapezoidal ramp.

3.6 Summarizing of modelling and results

In short, the most important understanding of chapter 3 was that the external load (i.e. wind load) on the system is negligible in comparison with the internal dynamics (damping and stiffness). This leads to the conclusion that the system is relatively well documented, as proposed in the first point in the problem description in section 1.3.1. If the external load had not been deemed negligible, tests had to be made on the magnitude and impact of different loads on the system. However, with this concluded, the experimental phase may be conducted.

25

Chapter 4

Experiments and verification

Focus on this chapter is to verify the correctness of previously discussed methods, models and results from chapter 2 and 3.

4.1 System overview

The lab assembly consists of a straight chain of hardware, with a computer moni- toring the µC.

POWER µC DRIVER MOTOR

PC

Figure 4.1. Experimental setup

4.2 Hardware

4.2.1 Power supply and measurement tool

The power supply unit (PSU) used in the experiments is a variable supply unit with an upper limit of 30 V and 10 A. The output is set to 28 V ±0.02 V, measured with a Fluke 85 multimeter. [43] Even though the battery voltage is 24 V, the maximum system voltage is achieved when running the generator at maximum power, hence

27 CHAPTER 4. EXPERIMENTS AND VERIFICATION

the 28 V output. All instruments were regularly calibrated to ensure conformity to the specification.

4.2.2 Driver

VNH7100ASTo adjust the voltage, a h-bridge is needed. As this Block is not diagram a core and part pin of description the thesis, a driver evaluation board was purchased. The board chosen was an evaluation 1 Blockboard of (EV-VNH7100AS)diagram and the pin h-bridge description VNH7100AS from ST Microelectronics. The power driver can handle and input voltage of 28 V and a current of 15 A with limited external cooling. Figure 1. Block diagram

9&&

32:(5 /,0,7$7,21

/6$B29(57(03(5$785( /6%B29(57(03(5$785(

8 +6$B29(57(03(5$785( 9 +6%B29(57(03(5$785(

&/$03+6$ &/$03+6%

+6 '5,9(5 '5,9(5 +6 $ ,/')# % +6$ +6%

0QFOMPBE 0QFOMPBE 0''TUBUF" &855(17 &855(17 0''TUBUF# /,0,7$7,21$ /,0,7$7,21% )$8/7 287 . . 287 $ '(7(&7,21 %

&/$03/6$ &/$03/6%

/6 '5,9(5 '5,9(5 /6 $ /6 /6 % $ .69 %

/6'$29(5/2$' /6'%29(5/2$' '(7(&725$ '(7(&725%

,1 &6 6(/ ,1 3:0 *1' *1'$ $  % %

("1($'5 Figure 4.2. H-bridge block diagram

Table 2. Block description

The h-bridgeName is symmetrically constructed with two Description identical sides for both out- puts. As figure 4.2 shows, the internalAllows bridge the turn-on with and four the metalturn-off oxideof the high-side semiconductor and the Logic control field effect transistor (MOSFET),low-side are controlled switches throughaccording to a the combined truth table. input for all MOSFET:s.Undervoltage Shuts down the device for battery voltage lower than 4 V. An internal interlocking featureProtect is present the high-side to avoid and activating the low-side low- switches and from high the side High-side and low-side clamp voltage at the same time, creating a short-circuit.high voltage [44] on the battery line. Drive the gate of the concerned switch to allow a proper High-side and low-side driver Ron for 28the leg of the bridge. Current limitation Limits the motor current in case of short circuit. In case of short-circuit with the increase of the junction High-side and low-side overtemperature temperature, it shuts down the concerned driver to prevent protection degradation and to protect the die. Detects when low side current exceeds shutdown current Low-side overload detector and latches off the concerned Low side.

DocID028092 Rev 4 5/38

37 4.2. HARDWARE

4.2.3 Motor

A wide selection of motors have been supplied for testing the hypothesis of the thesis. Pictured below are three generation of motors, with minor adjustments between each generation. Motor data is according to table 3.3 and 3.4.

Figure 4.3. Evaluation motors

The connection for the power supply to the motor is done through a TYCO HDSCS vehicle connector, highlighted by the red circle in figure 4.3. Each motor has dual coils for low- and high speed actuation. Only low-side actuation was done in this thesis as discussed in section 1.3.

4.2.4 Load and disturbance

As load simulator for the WWM, a lifetime-testing equipment is used. In short, it is a 3 mm aluminum plate which mounts the motor with the axle rotating in the vertical plane.

t = 0

0.25 m c-c

m = 2.35 kg

Figure 4.4. Real world simulator

29 CHAPTER 4. EXPERIMENTS AND VERIFICATION

As shown in figure 4.4, the system setup at t = 0 s is with arm rotated to 270°. This position allows the motor to initially accelerate with zero counter-reacting forces from gravity. The disturbance force is produced by manually braking or accelerating the load during run-time

4.2.5 Microcontroller

To combine all subsystem together while controlling and measuring data, an Mi- croAutoBox II (MABX2) from dSPACE was used. The MABX2 is equipped with all major automotive communication , high-performance I/O and the ability to monitor the run-time environment from a standard PC. [45]

Figure 4.5. dSPACE MicroAutoBox II

The system is connected according to the circuit diagram in figure 4.6, where all electrical connections (pull-up resistors etc.) are handled internally in each device.

Vdd Vdd Vdd

DIO_TYPE1_PWM_VP_M1 PWM 91k DIO_TYPE1_PWM_VP_M2 INA OUT1 DIO_TYPE1_PWM_VP_M3 INB M H-bridge OUT2 MABX2 DIO_TYPE1_PWM_VP_M4 SEL0 PARK ADC_TYPE1_M1_CON1 CS ADC_TYPE1_M1_CON2

Figure 4.6. Circuit diagram for test-setup

30 4.3. TEST PLAN

4.3 Test plan

To evaluate controller performance, the following test run scheme was used: Five sampling times for current measurement; 1, 2, 10, 20 and 50 ms. Each test run was approximately twenty-five seconds to ensure test length to approximately 10 samples for each setup. For each sampling time, two tests were run. One run with load only, and one run with a large disturbance torque added periodically. The disturbance torque was made by braking or acceleration the load manually. The code running on the MABX2 was C-code generated from a modified controller model in Matlab. To compensate for real-world imperfection, the model was based on proposed model in chapter 3.

RTI Data

Current Moving i Period Average park PWM Park enable Current filter Duty Cycle ADC VCC-level 0 Controller DIO_TYPE1_PWM_VP_M1_C1 > 4.5 Period 5 Park filter > 0.35 1 Duty Cycle 1 uc_enable INA DIO_TYPE1_PWM_VP_M1_C2 0 Period Main start 0 Duty Cycle > 0 INB DIO_TYPE1_PWM_VP_M1_C3 0 0 PWM Mode Period

1 Duty Cycle 2e-5 SEL0 DIO_TYPE1_PWM_VP_M1_C4 period

Figure 4.7. MicroAutoBox II controller model. dSPACE-blocks coloured in cyan.

The MABX2 was set to trigger on the positive flank of main start switch, and the recording was stopped manually after the set run-time. Due to large disturbances in the motor current as seen in figure 4.18, a moving average filter was implemented as shown in figure 4.7 where an approximate unit-delay of one eight of the system frequency was introduced. Since the h-bridge had integrated over-current protection, a relatively high start- ing voltage was needed to get the motor running without engaging the over-current protection. Therefore, the minimum motor voltage was set to 35 % of the system voltage.

31 CHAPTER 4. EXPERIMENTS AND VERIFICATION

4.4 Results

4.4.1 PWM performance Before any motor-current tests were conducted, an inverted step response with PWM was conducted at different sampling times, Ts. PWM performance 3.5 T = 0.01ms s T = 1ms 3 s T = 100ms s 2.5 Voltage profile

2

1.5 Current [A] Current

1

0.5

0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 Time [s]

Figure 4.8. Inverted step response at different PWM-frequencies

As shown in figure 4.8, a PWM-frequency of 100 kHz is enough to smoothly actuate the motor. This is accordingly to the rule of thumb, which says that the controlling parameter should be 10 to 30 times faster than the actuating one, as theory presented in section 3.2.2 predicts. Also, 100 kHz is not in the audible spectrum, which makes it proper for long-term usage in terms of driver comfort. The suitability of PWM-frequency to smoothly actuate the motor is shown by the relatively mild derivative occurrence when applying the inverted step response as shown in green in figure 4.8. Both PWM-frequencies of 1 kHz and 0.01 kHz results in a great deviation from predicted current when comparing to the current controlled with a PWM-frequency of 100 kHz. In reality; this phenomena results in noise, vibrations and excessive heating of motor coil.

4.4.2 Data charts The tests were conducted by driving the motor with the proposed voltage profile while measuring the motor current, park signal, and monitoring the voltage profile.

32 4.4. RESULTS

System performance, normal load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.9. System performance. Ts = 1 ms

System performance, disturbed load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.10. System performance with disturbances. Ts = 1 ms

33 CHAPTER 4. EXPERIMENTS AND VERIFICATION

System performance, normal load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.11. System performance. Ts = 2 ms

System performance, disturbed load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.12. System performance with disturbances. Ts = 2 ms

34 4.4. RESULTS

System performance, normal load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.13. System performance. Ts = 10 ms

System performance, disturbed load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.14. System performance with disturbances. Ts = 10 ms

35 CHAPTER 4. EXPERIMENTS AND VERIFICATION

System performance, normal load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.15. System performance. Ts = 20 ms

System performance, disturbed load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.16. System performance with disturbances. Ts = 20 ms

36 4.4. RESULTS

System performance, normal load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.17. System performance. Ts = 50 ms

System performance, disturbed load 3 100

90 2.5 80

70 2 60

1.5 50

40 [%] Ratio Current [A] Current 1 30

0.5 20 Motor Current [A] Motor voltage [%] 10 Park signal [%] 0 0 0 1 2 3 4 5 6 7 8 9 10 Time [s]

Figure 4.18. System performance with disturbances. Ts = 50 ms

37 CHAPTER 4. EXPERIMENTS AND VERIFICATION

4.5 Summarizing

To summarize figure 4.9 to 4.18, assessment of performance was done in terms of park prediction success and turn prediction success. The full data set of 20 s of data was used, even if only 10 s is shown in the graphs for clarity. The assessment was done on the following criteria:

1. When a park signal is sent, the motor voltage should be in system state RUN.turn point dec as shown in figure 3.12.

2. Between each park signal, on the same position on the current signal, the motor voltage should be in system state RUN.turn point acc as shown in figure 3.12

3. Only one occurrence of RUN.turn point acc, RUN.turn point dec, Soft start and Soft stop is allowed between each park signal.

Failure to comply to above mentioned points is counted as an error in table 4.1, where assessment of first criteria is grouped as park prediction and assessment of second criteria is grouped as turn prediction. As an example, the absence of an deceleration phase at t = 5 s in figure 4.15 counts as an error when assessing the algorithm. As mentioned in section 1.3.1, a new solution for reduction of vibrations should be proposed. The current tested solution should be improving the driver comfort since the derivative of the current is reduced and functionality is intact.

Table 4.1. System performance evaluation

Ts Load profile Park prediction Turn prediction 1 ms Normal 5/10 6/10 1 ms Disturbed 6/11 6/10 2 ms Normal 5/10 6/10 2 ms Disturbed 5/10 9/10 10 ms Normal 7/10 6/10 10 ms Disturbed 7/10 9/10 20 ms Normal 9/9 6/10 20 ms Disturbed 9/10 6/10 50 ms Normal 9/9 9/10 50 ms Disturbed 9/9 9/10

As table 4.1 shows, an increased sampling rate reduces the robustness of the implemented algorithm and the number of false negatives increases in terms of turn predictions. The first revolution is always counted as a fail by algorithm design, which is clearly visible in the charts. As one can see in each chart in chapter 4.4.2, and as described in figure 4.7, the current is filtered with 0.125 s to make graphs readable and algorithm more robust. This sample time was chosen because it is

38 4.5. SUMMARIZING a magnitude faster than the system revolution time, but the most efficient filter design is an optimization problem, and therefore not covered in this thesis. Worth to mention is that the slowest sampling time is not performing correctly in figure 4.17 and 4.18. This due to the deceleration phases happens after the park signal and not on it.

39

Chapter 5

Discussion and conclusions

As stated in the Problem identification chapter, the task of this thesis was to:

1. Understand the vibration origin

2. Propose a new solution for vibration reduction

3. Verify proposed new solution

The problem intended to solve with this thesis is how to control the motion of the wipers to reduce the torque peaks and vibrations. The usual engineering way is to develop a solution, do some tests and then iterate until the requirements have been fulfilled. This thesis aimed to develop a model of the system to solve the problem academically by proposing how it should be. When modelling the system, the number of parameters where the value was unknown were in the beginning quite many. However, during the modelling it turned out which parameters were critical to the system performance as discussed in chapter 3. By modelling the system in Simulink, an understanding of the system and the dependable parameters was made. As previously stated, the external load model was of minor importance since the internal damping was magnitudes greater. It is also to be mentioned that the goal was not to create a perfect model, but a sufficient good one to detect the turning-point of the wipers. By understanding the system, the preparations for making a theoretical controller was made, since understanding of the system and the controllable parameters are crucial for a correct design. The controller was made based on knowledge gathered about sliding mode con- trollers in 2.4.3. Compared to the VS-MRAC and VS-ABC controllers, the sliding mode controller offered the greatest robustness, but lacked in adaptability. A more tuned controller design is an optimization problem, and not covered in this thesis, but since the tests conducted in section 4.4.2 show a distinct dependability to the sampling frequency, the problem is solvable. Comparing of the algorithms may be conducted as future work. Since the thesis has focused on the single setup of dry wiping with cold motor, an inductive hypothesis about other weather conditions may be done if the WWM

41 CHAPTER 5. DISCUSSION AND CONCLUSIONS can be interpreted as linear, which is not an obviously bad hypothesis. Connected with this hypothesis is the generality of the motor. Since the motor is a BDC-motor, assumptions made of system performance are valid when talking about electrical motors in general which can be driven in the same configuration as in section 4.1. More specific, the results may be achieved with a BLDC-motor if the driver block is correctly emulated by the BLDC-driver. If the thesis had tried to investigate the torque-reducing problem by using sensor- less control, i.e. by measuring the imperfections of commutation brushes in the rotor, the scope had been out of bound for a thesis work, and the main problem would have been in the engineering scope since measuring accurate with fast sam- pling frequency is difficult, even for experienced personnel at Scania. In the tests conducted, the test setup described in section 4.1 is dependable on the gravity since the worm gear in the motor is not self-locking and the centre of mass is not positioned in the centre of motion. However, this was also deemed to be of minor importance since this an adjustment of controller parameters due to the same circular motion. This affected the results, as shown in figure 4.15 where there sometimes appears a straigh line as motor current. This in contrast to the noise motor current. The challenge is to make the controller robust enough, without malfunctioning as it did with the 50 ms sampling time. To compare the results with the possibility to implement on current Scania hardware, the controller is only possible to implement with a sampling time of 50 ms, which were the only sampling time which were disregarded due to faulty behaviour. Last, by not least, measurement errors had to be taken into account. Since Scania is experienced in experimental testing, all instruments used were calibrated to meet the manufactured specifications, even if the hardware is dated. As table 4.1 shows, the results are somewhat surprising. The slowest sampling time is disregarded due to not follow specifications of the controller. E.g. too much delay before actuating. However, the two fastest sampling times also predicted quite similar which imposes that the acquired low pass filter when running slow sampling frequencies is affecting the system in a desirable way and needs to be implemented if faster sampling times are to be used. Omitted from this thesis is the case of running the measuring and the computing processes at different frequencies, which may improve system and control stability, especially when dealing with filters. Also, the effect of aliasing needs to be taken into account and is affecting the motor current and the threshold values. E.g. when the ripple in figure 4.18 is around 0.5 A (20 % of max current) and the threshold for state change is 3 % of minimum current, the robustness of the controller is compromised by design.

42 Chapter 6

Recommendations and future Work

To combine sensor data to create a greater sum than sum of the individual inputs is not a breaking new discovery. One of the most interesting further developments of this thesis is to compare the method and algorithm with the implementation of a Kalman-filter. Since the thesis shows that the performance of the controller is sufficient with the implementation of a voltage driver, the way forward may take three directions. The first one, and probably the most expensive and flexible approach, is to implement two electronically geared encoder-equipped motors actuating each wiper independently. This has the side effect of getting rid of the linkage. However, since this is cost-driving, it may not be the best overall solution. As previously discussed in section 1.1, a closed loop system (i.e. motor with encoder) would probably outperform charts shown in section 4.4.2, but instead the model error would have been introduced as a system parameter. As previously stated, a closed loop controlled motor with integrated encoder will significantly increase system cost. This makes this solution only feasible if the additional func- tionality is demanded by the market, since the customer buys a function (windscreen wiping), not a construction. As the experimental results shows in section 4.5, higher sampling time does not always equals better performance per se, but requires a more delicate controller design. However, the current sampling time of 20 ms is shown to be the best trade-off in terms of performance and robustness as shown in table 4.1. However, as current solution is limited by hardware design and as a faster sampling time is desirable, a more complex filter solution may be implemented in the design of the next ECU and WWM, and good control may be achieved with limited resources. If the hardware is developed to be able to use with a higher freqency system, the current filter design may be further optimized by comparing the controller implemented in this thesis with VS-MRAC and VS-ABC controllers. Lastly, in terms of design considerations, the number of end-point switches may be increased to approximately four to create a poor-man’s encoder, which in the current user case should be sufficient to improve the vibration handling in the

43 CHAPTER 6. RECOMMENDATIONS AND FUTURE WORK throttle pedal. This reduces the amount of work needed to implement the future, but is probably the most limited solution. In this design consideration problem, the lead-time of developing a new truck should be taken into account. If any decision is taken today it will take several years before the solution is being implemented on the line of production and the customer demands may have changed. However, Scania is on a development trend of doing the truck more decentralized, which sort of confirms the next step of the system to be transformed to a distributed one which only communicates with the truck through the CAN-bus. This also helps with the EMC-certification, which is an area of interest where the solutions seldom are easy. Since the power requirements of the WWM is roughly 72 W, the possibility of using an automotive motor constructed for voltages should also be considered to utilize the power of purchasing from the Group and stream-lining the product portfolio. The implemented controller uses three types of information: time, current and history of both. Those parameters are possible to use in any combination, but there are more information available which have not been used. For example, the rain sensor may be possible to utilize to define current thresholds, since rain lowers the external load from the friction on the windscreen. In the same way could the speedometer information be used to calculate wind load. Especially the history is interesting to highlight. How long duration should history be saved? With micro- controllers and flash-memory, the possibilities to store data are almost infinite, but should one store every data point since the first power-up of the ECU or only the data from the last wiping cycle? As the results in section 4.5 shows, the effect of a sudden disturbance (history) diminishes after approximately one motor revolution with developed controller. Since the environment also may change quite dramati- cally, i.e. when travelling from the coast to highlands, data may soon be outdated. The experimental setup was simple, but there is a lot of data accessible on the CAN- buses in the truck. I.e. one could also use the GPS and date to predict the season, in addition to using the temperature- and rain sensor. Such approaches of sensor fusion was omitted from this thesis due to time constraints. The environmental parameter was set static to indoor conditions. However, this sensor comparison is probably enough for a stand -alone thesis.

44 Bibliography

[1] O. Hult, “Ncg, root cause analysis of vibration in accelerator pedal when wiper starts,” Scania RTCD - Vehicle Dynamics, Tech. Rep. 7033863, 20135.

[2] H. Johansson, Elektroteknik. Instutitionen f¨orMaskinkonstruktion, 2013.

[3] M. Staron, Automotive Software Architectures An Introduction. Springer In- ternational Publishing: Cham, 2017.

[4] R. B. GmbH, Bosch Automotive Electrics and Systems and Components, Networking and Hybrid Drive., 5th ed., ser. Bosch Profes- sional Automotive Information. Springer Fachmedien Wiesbaden, 2014.

[5] M. Grimheden and M. T¨orngren,“What is embedded systems and how should it be taught?—results from a didactic analysis,” ACM Transactions on Embed- ded Computing Systems (TECS), vol. 4, no. 3, pp. 633–651, August 2005.

[6] T. Basten, Model-Based Design of Adaptive Embedded Systems, ser. Embedded Systems, 22. Springer New York, 2013.

[7] J. E. Huber, N. A. Fleck, and M. F. Ashby, “The selection of mechanical actuators based on performance indices,” Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 453, no. 1965, pp. 2185– 2205, October 1997.

[8] O. Gomis-Bellmunt, Design Rules for Actuators in Active Mechanical Systems. Springer London, 2010.

[9] O. Schl¨uter,“Interview,” 2018.

[10] M. Enstr¨om,“Interview,” 2018.

[11] J.-y. Oh, J.-y. Park, J.-w. Cho, J.-g. Kim, J.-h. Kim, and G.-h. Lee, “Influence of a clutch control current profile to improve shift quality for a wheel loader au- tomatic transmission.(report),” International Journal of Precision Engineering and Manufacturing, vol. 18, no. 2, February 2017.

[12] E. Monmasson, Ed., Power electronic converters : PWM strategies and current control techniques. Hoboken, 2011.

45 BIBLIOGRAPHY

[13] L. R. L. Teixeira, J. B. Oliveira, and A. D. Araujo, “Smooth indirect adaptive sliding mode control,” International Journal of Robust and Nonlinear Control, vol. 25, no. 6, pp. 775–790, April 2015.

[14] C. Rohrs, L. Valavani, M. Athans, and G. Stein, “Robustness of continuous- time adaptive control algorithms in the presence of unmodeled dynamics,” Au- tomatic Control, IEEE Transactions on, vol. 30, no. 9, pp. 881–889, September 1985.

[15] A. Znidi, K. Dehri, and A. S. Nouri, “Discrete variable structure model refer- ence adaptive control using only input-output measurements,” Transactions of the Institute of Measurement and Control, vol. 40, no. 3, pp. 861–872, February 2018.

[16] L. Hsu, “Variable structure model-reference adaptive control (vs-mrac) using only input and output measurements: the general case,” Automatic Control, IEEE Transactions on, vol. 35, no. 11, pp. 1238–1243, November 1990.

[17] K. Queiroz, A. Araujo, and S. Dias, “Design and stability analysis of a variable structure adaptive backstepping controller,” Asian Journal of Control, vol. 14, no. 3, pp. 641–651, May 2012. [Online]. Available: http://search.proquest.com/docview/1544886129/

[18] A. Wieland and C. Marcus Wallenburg, “Dealing with supply chain risks,” International Journal of Physical Distribution & Logistics Management, vol. 42, no. 10, pp. 887–905, November 2012.

[19] European Patent Office, United States Patent and Trademark Office, “Cooperative Patent Classification,” 2018. [Online]. Available: http: //www.cooperativepatentclassification.org/about.html

[20] European Patent Office, “European Patent Office,” 2018. [Online]. Available: https://worldwide.espacenet.com/

[21] K. Hubertus, “Wiper control,” U.S. Patent Application US 2013/0 119 911 A1, 2013-05-16. [Online]. Available: https://lens.org/015-056-773-918-68X

[22] G. Eddie and H. Saied, “ wiper,” U.S. Patent Application US 2012/0 030 894 A1, 2012-02-09. [Online]. Available: https://lens.org/ 128-589-212-628-18X

[23] M. Vitali and L. Roland, “Windshield wiper system,” U.S. Patent Application US 2015/0 121 641 A1, 2015-05-07. [Online]. Available: https: //lens.org/070-536-424-137-671

[24] B. Oliver, “Screen wiper arrangement and method for operating a screen wiper arrangement,” U.S. Patent Application US 2012/0 138 090 A1, 2012-06-07. [Online]. Available: https://lens.org/171-921-189-739-930

46 BIBLIOGRAPHY

[25] D. Graham, K. P. T. Hansen, and A. Peter, “Passive wiper system,” U.S. Patent Application US 2016/0 121 855 A1, 2016-05-05. [Online]. Available: https://lens.org/102-928-719-065-689

[26] A. Tatsuya, A. Hiroshi, Y. Ryota, A. Takeshi, H. Satoru, N. Tomoaki, and T. Takanobu, “Support structure for front wiper device for vehicle,” U.S. Patent Application US 2015/0 135 461 A1, 2015-05-21. [Online]. Available: https://lens.org/129-589-102-655-810

[27] T. Tetsuya and I. Takamichi, “Windshield wiper assembly,” U.S. Patent Application US 2015/0 074 933 A1, 2015-03-19. [Online]. Available: https: //lens.org/162-499-147-054-645

[28] I. Hironori, “Brushless motor and wiper apparatus,” U.S. Patent Application US 2016/0 276 899 A1, 2016-09-22. [Online]. Available: https://lens.org/ 107-021-902-493-848

[29] W. Norbert, R. Juergen, M. Andreas, B. Guillaume, A. Christian, and H. Pierre, “Windshield wiper drive,” U.S. Patent Application US 2014/0 317 870 A1, 2014-10-30. [Online]. Available: https://lens.org/ 036-922-573-952-947

[30] H. Eberhard and W. Sebastian, “Method for programming a wiper system for vehicle windscreens and wiper system,” U.S. Patent Application US 2016/0 144 828 A1, 2016-05-26. [Online]. Available: https://lens.org/ 021-861-545-213-804

[31] P. Philipp, T. Florian, and F. Edgard, “Drive control means,” U.S. Patent Application US 2012/0 173 077 A1, 2012-07-05. [Online]. Available: https://lens.org/073-640-317-037-914

[32] H. Eric and J. James, “Method for controlling a wiper motor,” U.S. Granted Patent US 7 019 477 B2, 2006-03-28. [Online]. Available: https://lens.org/061-612-409-012-77X

[33] B. Xavier, “Windscreen wiper device,” U.S. Patent Applica- tion US 2010/0 263 155 A1, 2010-10-21. [Online]. Available: https: //lens.org/129-254-684-632-55X

[34] D. J. R and K. T. D, “Wiper control mechanism,” U.S. Patent Application US 2014/0 148 085 A1, 2014-05-29. [Online]. Available: https: //lens.org/081-274-675-398-712

[35] B. Peter, W. Norbert, and R. Harald, “Control device and control method for the drive unit of a windshield wiper system,” U.S. Patent Application US 2015/0 127 219 A1, 2015-05-07. [Online]. Available: https: //lens.org/167-590-750-806-29X

47 BIBLIOGRAPHY

[36] E. Waldemar and K. Godelieve, “Wiper arm wind deflector unit,” U.S. Patent Application US 2016/0 144 827 A1, 2016-05-26. [Online]. Available: https://lens.org/072-013-579-452-473

[37] Mathworks, “Simulink,” 2018. [Online]. Available: https://www.mathworks. com/products/simulink.html

[38] L. R˚adeand B. Westergren, Mathematics Handbook - for Science and Engi- neering. Studentlitteratur AB, 2003.

[39] Mathworks, “Four bar example,” 2018. [On- line]. Available: https://www.mathworks.com/help/physmod/sm/ug/ prescribe-joint-motion-in-four-bar-model.html

[40] K. Schmidt, “Requirements specification windscreen cleaning system,” Scania RCCS - Cab interior, Tech. Rep. 2022038, 2014.

[41] T. Chowdhury, “Interview,” 2018.

[42] J. R. Garcia Martinez, J. Rodriguez Resendiz, M. A. Martinez Prado, and E. E. Cruz Miguel, “Assessment of jerk performance s-curve and trapezoidal velocity profiles,” Engineering Congress (CONIIN), 2017 XIII International, pp. 1–7, May 2017.

[43] Fluke, “Fluke 83/85/87 manual,” 1989. [Online]. Available: http://assets. fluke.com/manuals/83 85 87smeng0500.pdf

[44] S. Microelectronics, “Vnh7100as manual,” 2016. [Online]. Available: http: //www.st.com/resource/en/datasheet/VNH7100AS.pdf

[45] dSPACE, “Microautobox ii brochure,” 2018. [Online]. Available: https://www.dspace.com/shared/data/pdf/2018/dSPACE MicroAutoBoxII-Brochure 2018-01 180418.pdf

48 Appendix A

Matlab toolboxes

Installed toolboxes in Matlab 2017b.

A.1 Mathworks-developed toolboxes

Name Version Date Release Aerospace Blockset 3.20 24-Jul-2017 (R2017b) Aerospace Toolbox 2.20 24-Jul-2017 (R2017b) Antenna Toolbox 3.0 26-Jul-2017 (R2017b) Audio System Toolbox 1.3 24-Jul-2017 (R2017b) Automated Driving System Toolbox 1.1 24-Jul-2017 (R2017b) Bioinformatics Toolbox 4.9 24-Jul-2017 (R2017b) Communications System Toolbox 6.5 24-Jul-2017 (R2017b) Computer Vision System Toolbox 8.0 24-Jul-2017 (R2017b) Control System Toolbox 10.3 24-Jul-2017 (R2017b) Curve Fitting Toolbox 3.5.6 24-Jul-2017 (R2017b) DO Qualification Kit 3.4 24-Jul-2017 (R2017b) DSP System Toolbox 9.5 24-Jul-2017 (R2017b) Data Acquisition Toolbox 3.12 24-Jul-2017 (R2017b) Database Toolbox 8.0 24-Jul-2017 (R2017b) Datafeed Toolbox 5.6 24-Jul-2017 (R2017b) Econometrics Toolbox 4.1 24-Jul-2017 (R2017b) Embedded Coder 6.13 24-Jul-2017 (R2017b) Filter Design HDL Coder 3.1.2 24-Jul-2017 (R2017b) Financial Instruments Toolbox 2.6 24-Jul-2017 (R2017b) Financial Toolbox 5.10 24-Jul-2017 (R2017b) Fixed-Point Designer 6.0 24-Jul-2017 (R2017b) Fuzzy Logic Toolbox 2.3 24-Jul-2017 (R2017b) GPU Coder 1.0 27-Jul-2017 (R2017b) Global Optimization Toolbox 3.4.3 24-Jul-2017 (R2017b) HDL Coder 3.11 24-Jul-2017 (R2017b)

49 APPENDIX A. MATLAB TOOLBOXES

HDL Verifier 5.3 24-Jul-2017 (R2017b) IEC Certification Kit 3.10 24-Jul-2017 (R2017b) Image Acquisition Toolbox 5.3 24-Jul-2017 (R2017b) Image Processing Toolbox 10.1 24-Jul-2017 (R2017b) Instrument Control Toolbox 3.12 24-Jul-2017 (R2017b) LTE HDL Toolbox 1.0 24-Jul-2017 (R2017b) LTE System Toolbox 2.5 24-Jul-2017 (R2017b) MATLAB 9.3 24-Jul-2017 (R2017b) MATLAB Coder 3.4 24-Jul-2017 (R2017b) MATLAB Compiler 6.5 24-Jul-2017 (R2017b) MATLAB Compiler SDK 6.4 24-Jul-2017 (R2017b) MATLAB Report Generator 5.3 24-Jul-2017 (R2017b) Mapping Toolbox 4.5.1 24-Jul-2017 (R2017b) Model Predictive Control Toolbox 6.0 24-Jul-2017 (R2017b) Model-Based Calibration Toolbox 5.3 24-Jul-2017 (R2017b) Neural Network Toolbox 11.0 24-Jul-2017 (R2017b) OPC Toolbox 4.0.4 24-Jul-2017 (R2017b) Optimization Toolbox 8.0 24-Jul-2017 (R2017b) Parallel Computing Toolbox 6.11 24-Jul-2017 (R2017b) Partial Differential Equation Toolbox 2.5 24-Jul-2017 (R2017b) Phased Array System Toolbox 3.5 24-Jul-2017 (R2017b) Polyspace Bug Finder 2.4 24-Jul-2017 (R2017b) Polyspace Code Prover 9.8 24-Jul-2017 (R2017b) Powertrain Blockset 1.2 24-Jul-2017 (R2017b) RF Blockset 6.1 24-Jul-2017 (R2017b) RF Toolbox 3.3 24-Jul-2017 (R2017b) Risk Management Toolbox 1.2 24-Jul-2017 (R2017b) Robotics System Toolbox 1.5 24-Jul-2017 (R2017b) Robust Control Toolbox 6.4 24-Jul-2017 (R2017b) Signal Processing Toolbox 7.5 24-Jul-2017 (R2017b) SimBiology 5.7 24-Jul-2017 (R2017b) SimEvents 5.3 24-Jul-2017 (R2017b) Simscape 4.3 24-Jul-2017 (R2017b) Simscape Driveline 2.13 24-Jul-2017 (R2017b) Simscape Electronics 2.12 24-Jul-2017 (R2017b) Simscape Fluids 2.3 24-Jul-2017 (R2017b) Simscape Multibody 5.1 24-Jul-2017 (R2017b) Simscape Power Systems 6.8 24-Jul-2017 (R2017b) Simulink 9.0 24-Jul-2017 (R2017b) Simulink 3D Animation 7.8 24-Jul-2017 (R2017b) Simulink Check 4.0 24-Jul-2017 (R2017b) Simulink Code Inspector 3.1 24-Jul-2017 (R2017b) Simulink Coder 8.13 24-Jul-2017 (R2017b) Simulink Control Design 5.0 24-Jul-2017 (R2017b)

50 A.2. DSPACE-DEVELOPED TOOLBOXES

Simulink Coverage 4.0 24-Jul-2017 (R2017b) Simulink Design Optimization 3.3 24-Jul-2017 (R2017b) Simulink Design Verifier 3.4 24-Jul-2017 (R2017b) Simulink Desktop Real-Time 5.5 24-Jul-2017 (R2017b) Simulink PLC Coder 2.4 24-Jul-2017 (R2017b) Simulink Real-Time 6.7 24-Jul-2017 (R2017b) Simulink Report Generator 5.3 24-Jul-2017 (R2017b) Simulink Requirements 1.0 24-Jul-2017 (R2017b) Simulink Test 2.3 24-Jul-2017 (R2017b) Spreadsheet Link 3.3.2 24-Jul-2017 (R2017b) Stateflow 9.0 24-Jul-2017 (R2017b) Statistics and Machine Learning Toolbox 11.2 24-Jul-2017 (R2017b) Symbolic Math Toolbox 8.0 24-Jul-2017 (R2017b) System Identification Toolbox 9.7 24-Jul-2017 (R2017b) Text Analytics Toolbox 1.0 27-Jul-2017 (R2017b) Tracking and Sensor Fusion Toolbox 1.0 24-Jul-2017 (R2017b) Trading Toolbox 3.3 24-Jul-2017 (R2017b) Vehicle Network Toolbox 3.4 24-Jul-2017 (R2017b) Vision HDL Toolbox 1.5 24-Jul-2017 (R2017b) WLAN System Toolbox 1.4 24-Jul-2017 (R2017b) Wavelet Toolbox 4.19 24-Jul-2017 (R2017b)

A.2 dSPACE-developed toolboxes

Name Version Date dSPACE FlexRay Configuration Blockset 4.0 02-Nov-2017 dSPACE MATLAB Connection 2.4 01-Jun-2012 dSPACE MATLAB Integration Main 2.2 02-Nov-2017 dSPACE Model Comparison Tool 2.8 07-Nov-2017 dSPACE Model Port Block Library 3.5 02-Nov-2017 dSPACE Model Separation Block Library 3.5 02-Nov-2017 dSPACE MotionDesk Blockset 2.5.2 02-Nov-2017 dSPACE RTI Bypass Blockset 3.9 02-Nov-2017 dSPACE RTI CAN Blockset 3.4.5 02-Nov-2017 dSPACE RTI CAN MultiMessage Blockset 4.6 02-Nov-2017 dSPACE RTI EMC Blockset 1.4.1 02-Nov-2017 dSPACE RTI ETHERNET Blockset 1.2.3 02-Nov-2017 dSPACE RTI ETHERNETUDP Blockset 1.4.3 02-Nov-2017 dSPACE RTI FPGA Programming Blockset 3.4 02-Nov-2017 dSPACE RTI FlexRay Configuration Blockset 4.0 02-Nov-2017 dSPACE RTI Gigalink Blockset 2.4 02-Nov-2017 dSPACE RTI LIN MultiMessage Blockset 2.9 02-Nov-2017 dSPACE RTI MultiMessage Shared Utilities 1.9.5 02-Nov-2017

51 APPENDIX A. MATLAB TOOLBOXES dSPACE RTI RPCU Blockset 2.2.3 02-Nov-2017 dSPACE RTI USBFLIGHTREC Blockset 1.2.2 02-Nov-2017 dSPACE RTI WATCHDOG Blockset 2.1.1 02-Nov-2017 dSPACE RTI XCP on Ethernet Blockset 1.2.10 02-Nov-2017 dSPACE RTI for Multiprocessor Systems RTI-MP 7.9 02-Nov-2017 dSPACE Real-Time Interface (RTI1401) 7.9 02-Nov-2017 dSPACE Real-Time Interface Shared Utilities 7.9 02-Nov-2017 dSPACE Run-Time Target 3.5 02-Nov-2017 dSPACE Run-Time Target Shared Utilities 3.4 02-Nov-2017 dSPACE TargetLink Data Dictionary 4.3 26-Oct-2017 dSPACE TargetLink Production Code Generator 4.3 26-Oct-2017

52 Appendix B

Matlab code

Complete Matlab code used for thesis work.

B.1 Matlab scripts

B.1.1 Matlab main code

1 addpath(’./functions’); 2 addpath(’./scripts’); 3 addpath(’C: \ Users \PFJVFB\Desktop’); 4 5 cleanup();%Wipes workspace 6 run real w o r l d.m;%Import coordinates from Catia 7 run four b a r c a l c.m;%Calculate4 −bar linkage constraints 8 9 %Run−time settings 10 p l o t t=0; 11 m o t o r d a t a e x i s t s=1; 12 13 run wiper c a l c.m;%Calculate wiper points 14 i f(plott == 1) 15 a n a l y t i c p l o t(A, A1, A2, B1, B2,B DS,b DS,B PS,b PS,C DS, C PS,D,a,space,points,resolution)%Plot analytical v e r s i o n 16 end 17 18 i f(motordata e x i s t s == 0) 19 extract motor(); 20 e l s e 21 run motor.m;%Handles motor data 22 end

53 APPENDIX B. MATLAB CODE

23 24 run simulink para.m%Initiate Simulink parameters 25 26 %% Print modelled response 27 run custom plot.m 28 desc= []; 29 p l o t(PS B.Time,PS B.Data(:,1)); desc=[desc;’Position PS’ ]; 30 p l o t(PS B.Time,PS B.Data(:,2)); desc=[desc;’Velocity PS’ ]; 31 p l o t(PS B.Time,PS B.Data(:,4)); desc=[desc;’Torque PS’ ]; 32 legend(desc); 33 t i t l e(’Physical Quantities, Passenger side’) 34 35 run custom plot.m 36 desc= []; 37 p l o t(DGCML.t,filter(b,a,DGCML.T)); 38 p l o t(M A.Time,M A.Data(:,4)); 39 p l o t(PS B.Time,sin(PS B.Data(:,1)) ∗30) ; 40 p l o t(M A.Time,sin(M A.Data(:,1)) ∗30) ; 41 legend(’Measured data, Dry glass, cold motor, low speed’,’ Modelled motor torque’,’Wiper position’,’Motor position’) ; 42 t i t l e(’Motor torque and position’) B.1.2 Real world measurements

1 %Physical dimensions of actual Scania wiper system 2 3 %Drawing 2371908 1 4 PT A = [1457.8 −913.16 1496.54]; 5 PT B = [1400.34 144.92 1522.5]; 6 PT C = [1479.8 −336.99 1318.4]; 7 PT D = [1379.35 −826.37 1487.3]; 8 PT E = [1480.25 −808.17 1486.42]; 9 PT F = [1354.91 82.32 1494.36]; 10 PT G = [1456.45 82.26 1480.18]; 11 %Drawing 2371908 2 12 lever DS = 76.44; 13 lever PS = 67.11; 14 lever M = 55; 15 16 %From Catia

54 B.1. MATLAB SCRIPTS

17 PT DS = [1376.26 32.13 1446.37]; 18 PT PS = [1416.18 −876.37 1434.76]; 19 PT MDS = [1383.33 −428.93 1418.80]; 20 PT MPS = [1372.36 −429.21 1419.58]; 21 22 a n g l e o f f s e t = 2.2; 23 PT M=[PT MDS(1)+lever M ∗ sind(angle o f f s e t)... 24 PT MDS(2)+lever M ∗ cosd(angle o f f s e t)... 25 PT MDS(3) ]; B.1.3 Mathematic parameters of linkage

1 %Physical Parameters(DS= Driver Side, PS= Passenger Side) 2 corr3D=[2 −26 1 5 ] ;%Due to simplification from2D to3D 3 a= lever M; 4 b DS= lever DS; 5 b PS= lever PS; 6 f DS= norm(PT MDS−PT DS)+corr3D(2); 7 f PS= norm(PT MPS−PT PS)+corr3D(3); 8 g DS= norm(PT M−PT E); 9 g PS= norm(PT M−PT F)−corr3D(1); 10 a n g l e x i PS= pi/4;%Experimental 11 angle xi DS= pi/5;%Experimental 12 angle phi DS= atan(( PT E(3) −PT M(3))/abs(PT E(2) −PT M(2))); 13 angle phi PS= atan(( PT F(3) −PT M(3))/abs(PT F(2) −PT M(2))); B.1.4 Mathematic calculation of linkage

1 %Settings 2 duration=6;%s 3 r e s o l u t i o n = 20;%fps 4 p o i n t s= duration ∗ r e s o l u t i o n;%no of points 5 space = 50; 6 7 %Starting values 8 A= [0 0]; 9 B DS=g DS ∗ [cos(angle phi DS) sin(angle phi DS)]; 10 B PS=g PS∗[− cos(angle phi PS) sin(angle phi PS)]; 11 12 %Calculations: 13 i=1:points; 14 a n g l e t h e t a=(i./10); 15 D=[A(1) +a ∗ cos(angle t h e t a);A(2) +a ∗ s i n(angle t h e t a)];% [X;Y] 16

55 APPENDIX B. MATLAB CODE

17 %Intersections 18 [C DS, th] = intersect c i r c l e(D,B DS,f DS,b DS);%First s o l u t i o n is valid 19 [th2,C PS] = intersect c i r c l e(D,B PS,f PS,b PS);%Second s o l u t i o n is valid 20 c l e a r th ∗ ;%Delete unused solutions 21 22 %Error calculation 23 e r r o r(1,:) = sqrt((C DS(1,:) −D(1 ,:)).ˆ2+(C DS(2,:) −D(2,:)) . ˆ 2 )−f DS; 24 e r r o r(2,:) = sqrt((C PS(1,:) −D(1 ,:)).ˆ2+(C PS(2,:) −D(2,:)) . ˆ 2 )−f PS; 25 26 %Calculate wiper arms 27 angle alphaB DS= angle xi DS+ atan((C DS(1,:) −B DS(1))./( C DS(2,:) −B DS(2))); 28 angle alphaB PS= angle x i PS+ atan((C PS(1,:) −B PS(1))./( C PS(2,:) −B PS(2))); 29 30 Q1 = 118.6; 31 Q2 = 941.9; 32 Q3 = 151.1; 33 Q4 = 947.5; 34 35 % Test 36 A1=[B PS(1)+Q1∗−cosd(44+rad2deg(angle alphaB PS));B PS(2) +Q1∗ sind(44+rad2deg(angle alphaB PS))]; 37 B1=[B PS(1)+Q2∗−cosd(3.2+rad2deg(angle alphaB PS));B PS ( 2 )+Q2∗ sind(3.2+rad2deg(angle alphaB PS))]; 38 39 A2=[B DS(1)+Q3∗−cosd(53+rad2deg(angle alphaB DS));B DS(2) +Q3∗ sind(53+rad2deg(angle alphaB DS))]; 40 B2=[B DS(1)+Q4∗−cosd(7.1+rad2deg(angle alphaB DS));B DS ( 2 )+Q4∗ sind(7.1+rad2deg(angle alphaB DS))]; B.1.5 Motor data from supplier

1 d i r=’motor’; 2 3 DGCMH= load(fullfile(dir,’Dry Glass Cold Motor HS c o r r e c t e d.mat’)); 4 DGCML= load(fullfile(dir,’Dry Glass Cold MotorLS c o r r e c t e d.mat’)); 5 DGWMH= load(fullfile(dir,’Dry Glass Warm Motor HS

56 B.1. MATLAB SCRIPTS

c o r r e c t e d.mat’)); 6 DGWML= load(fullfile(dir,’Dry Glass Warm MotorLS c o r r e c t e d.mat’)); 7 WGCMH= load(fullfile(dir,’Wet Glass Cold Motor HS c o r r e c t e d.mat’)); 8 WGCML= load(fullfile(dir,’Wet Glass Cold MotorLS c o r r e c t e d.mat’)); 9 WGWMH= load(fullfile(dir,’Wet Glass Warm Motor HS c o r r e c t e d.mat’)); 10 WGWML= load(fullfile(dir,’Wet Glass Warm MotorLS c o r r e c t e d.mat’)); 11 12 %Filter values 13 windowSize = 55; 14 b = (1/windowSize) ∗ ones(1,windowSize); 15 a= 1; 16 17 i f(plott == 1) 18 run custom plot.m 19 20 desc= []; 21 p l o t(DGCMH.t,filter(b,a,DGCMH.T)); desc=[desc;’Dry g l a s s, cold motor, high speed’]; 22 p l o t(DGCML.t,filter(b,a,DGCML.T)); desc=[desc;’Dry g l a s s, cold motor, low speed’]; 23 p l o t(DGWMH.t,filter(b,a,DGWMH.T)); desc=[desc;’Dry g l a s s, warm motor, high speed’]; 24 p l o t(DGWML.t,filter(b,a,DGWML.T)); desc=[desc;’Dry g l a s s, warm motor, low speed’]; 25 % plot(WGCMH.t,filter(b,a,WGCMH.T)); desc=[desc;’Wet g l a s s, cold motor, high speed’]; 26 % plot(WGCML.t,filter(b,a,WGCML.T)); desc=[desc;’Wet g l a s s, cold motor, low speed’]; 27 % plot(WGWMH.t,filter(b,a,WGWMH.T)); desc=[desc;’Wet g l a s s, warm motor, high speed’]; 28 % plot(WGWML.t,filter(b,a,WGWML.T)); desc=[desc;’Wet g l a s s, warm motor, low speed’]; 29 legend(desc); 30 a x i s([ −0.15 4 −20 4 0 ] ) ; 31 end B.1.6 Simulink parameters

1 gy= 0;% −9.80665;

57 APPENDIX B. MATLAB CODE

2 d e n s i t y = 8000; 3 e x t l o a d=3;%External load[Nm] 4 damping = 1.5e −2;%joint[Nm/(deg/s)] 5 s t i f f n e s s=1e −9;%joint[Nm/deg] 6 n= 73;%Gearing 7 v o l t a g e = 28;%V 8 f = 20;%Hz 9 10 %Controller parameters 11 i l i m g a i n = 1.03;%[%] 12 Ts = 0.1;%Period time[s] 13 uc enable = 0.35;%Controller start 14 VCC= 5;%System voltage scaling factor 15 AccVal = 0.7;%[%] 16 TurnVal = 0.7;%[%] 17 18 sim(’four b a r’) B.1.7 Plot style

1 h=figure(); 2 hold on; grid on; 3 4 %Start position and size 5 x0=100; 6 y0=100; 7 width=1000; 8 height=600; 9 s e t(gcf,’units’,’points’,’position’,[x0,y0,width,height]) B.1.8 Trajectory figure generation

1 cleanup(); 2 x=[0 0.1 0.9 1 1.1 1.9 2]; 3 y=[0.7 1 1 0.3 1 1 0.7]; 4 5 f = 14; 6 7 f i g u r e(); 8 hold on; axis equal; 9 t i t l e(’Voltage trajectory profile’,’FontSize’,f ∗ 1 . 5 ) 10 x l a b e l(’Time[s]’,’FontSize’,f) 11 y l a b e l(’Voltage[V]’,’FontSize’,f) 12 a x i s([ −0.1 4.2 0 1.1]) 13

58 B.2. MATLAB FUNCTIONS

14 area(x(1:2) ,y(1:2)); 15 area([x(2:3)x(3)x(5)x(5:6)] ,[y(2:3) 0 0y(5:6)]); 16 area(x(3:4) ,y(3:4)); 17 area(x(4:5) ,y(4:5)); 18 area(x(6:7) ,y(6:7)); 19 legend(’Soft \ s t a r t’,’RUN.RUN’,’RUN.turn \ p o i n t \ dec’,’RUN. turn \ p o i n t \ a c c’,’Soft \ s t o p’) B.2 Matlab functions

B.2.1 Workspace cleanup

1 f u n c t i o n []= cleanup() 2 %Makes the workspace tidy 3 c l e a r; clc; clf; close all; 4 format compact; 5 end B.2.2 Calculate circle intersections

1 f u n c t i o n[ sol 1, sol 2]= intersect c i r c l e(A,B,aa,bb) 2 %Calculates intersection between circles 3 4 %syms helper 5 l e n= length(A); 6 s o l 1= zeros(1,len); 7 s o l 2= zeros(1,len); 8 9 N= [1 0;0 −1];%Negate second element 10 F= [0 1;1 0];%Flip elements 11 12 f o ri=1:len 13 d= norm(B −A(:,i).’); 14 15 i fd > aa+ bb 16 disp(’No solution! Separate circles’); 17 18 e l s e i fd < abs(aa − bb) 19 disp(’No solution!A containsB’); 20 e l s e i fd == 0 && aa == bb 21 disp(’No solution! Same circle’); 22 end 23 24 a=(aaˆ2 −bbˆ2+dˆ2)/(2 ∗d); 25 h= sqrt(aaˆ2 −aˆ2);

59 APPENDIX B. MATLAB CODE

26 P2=A(:,i).’ +a ∗(B−A(:,i).’)/d; 27 28 Q=h ∗(B−A(:,i).’)/d; 29 30 tmp A= P2+Q ∗F∗N; 31 tmp B= P2+ −Q∗F∗N; 32 33 s o l 1(1,i)= tmp A(1); 34 s o l 1(2,i)= tmp A(2); 35 s o l 2(1,i)= tmp B(1); 36 s o l 2(2,i)= tmp B(2); 37 end 38 39 %%Symbolic method(slow...) 40 % x1=B(1); 41 % y1=B(2); 42 % 43 % Dx=A(1,:); 44 % Dy=A(2,:); 45 % 46 % symsxy 47 % fori=1:len 48 %[Sx, Sy]=solve((x −Dx(i))ˆ2+(y −Dy(i))ˆ2==aaˆ2,(x −x1) ˆ2+(y−y1)ˆ2==bˆ2,x,y); 49 % sol 1 { i } =[double(Sx(1)), double(Sy(1))]; 50 % sol 2 { i } =[double(Sx(2)), double(Sy(2))]; 51 % disp(len −i); 52 % end 53 54 end B.2.3 Extract motor data

1 f u n c t i o n []= extract motor() 2 %extract motor() Extracts data from Excel files from s u p p l i e r 3 d i r e c t o r y=’motor’; 4 5 f i l e s= dir(fullfile(directory,’ ∗ .xlsx’)); 6 f o r file= files’ 7 filename= fullfile(directory, file.name); 8 [NUM,TXT,RAW]=xlsread(filename,’A1:N50001’); 9 10 V meas= NUM(:,1);

60 B.2. MATLAB FUNCTIONS

11 A calc= NUM(:,3); 12 A max= max(A calc); 13 A avg= NUM(:,7); 14 XYZ= NUM(:,2); 15 t= XYZ. ∗ 0 . 0 0 2 ; 16 17 %Torque and speed calculations 18 Tp= NUM(1:2,10); 19 Sp= NUM(1:2,13); 20 21 T=(A avg−Tp(2))/Tp(1); 22 S= Sp(1) ∗T+Sp(2); 23 24 sample len = 100; 25 T(isnan(T))=0; 26 n o i s e l e v e l T = 0.3; 27 f o ri=1:length(T) 28 i f(mean(T(i:i+sample len)) >=T(i)+noise l e v e l T) 29 i f(T(i) ˜= 0) 30 V meas=V meas(i:end); 31 A calc=A calc(i:end); 32 A avg=A avg(i:end); 33 t=t(i:end) −t(i); 34 T=T(i:end) −T(i); 35 S=S(i:end); 36 break 37 end 38 end 39 end 40 41 42 s t r= erase(filename,’.xlsx’); 43 save(str,’V meas’,’A calc’,’A max’,’A avg’,’XYZ’,’t’ ,’Tp’,’Sp’,’T’,’S’); 44 end 45 end B.2.4 Analytic plot

1 f u n c t i o n []= analytic p l o t(A, A1, A2, B1, B2,B DS,b DS,B PS, b PS,C DS,C PS,D,a,space,points,resolution) 2 %Plots analytic version of wiper system 3 %Draw once 4 a x i s(’equal’,[min(B1(1,:)) −space max(B2(1,:))+spaceA(2)

61 APPENDIX B. MATLAB CODE

−a−space max(B1(2,:))+space]); 5 hold on 6 7 %Plot trajectory circles 8 traj D= viscircles(A,a,’Linestyle’,’ −− ’); 9 traj C DS= viscircles(B DS,b DS,’Linestyle’,’ −− ’); 10 traj C PS= viscircles(B PS,b PS,’Linestyle’,’ −− ’); 11 p l o t([A(1)B DS(1)B PS(1)] ,[A(2)B DS(2)B PS(2)],’ ∗ ’); %Plot traj centers 12 c l e a r traj ∗ ;%Delete unused solutions 13 14 f o rt=1:points 15 16 l i n k a g e= line(... 17 [ A1(1,t)B PS(1)C PS(1,t)D(1,t) NaNA(1)D(1,t )C DS(1,t)B DS(1) A2(1,t)],... 18 [ A1(2,t)B PS(2)C PS(2,t)D(2,t) NaNA(2)D(2,t )C DS(2,t)B DS(2) A2(2,t)]); 19 wipers= line([ A1(1,t) B1(1,t) NaN A2(1,t) B2(1,t) ],[ A1(2,t) B1(2,t) NaN A2(2,t) B2(2,t)]); 20 pause(1/resolution); 21 22 d e l e t e(linkage); 23 %delete(wipers); 24 end 25 end

62 Appendix C

Inventory list Simulink

Model was used in Simulink [37] with toolboxes according to appendix A.

C.1 Analytical model

Name Type PS link SubSystem A SubSystem Base-Rocker Revolute Joint SimscapeMultibodyBlock Base-Rocker Revolute Joint1 SimscapeMultibodyBlock Controlled PWM Voltage SimscapeBlock Controlled Voltage Source SimscapeBlock Controller SubSystem Controller/park Inport Controller/Clock Clock Controller/Constant1 Constant Controller/Constant2 Constant Controller/Constant3 Constant Controller/Constant4 Constant Controller/Constant5 Constant Controller/Period calc SubSystem Controller/Period calc/t Inport Controller/Period calc/Trigger TriggerPort Controller/Period calc/Gain Gain Controller/Period calc/Memory Memory Controller/Period calc/Subtract Sum Controller/Period calc/period Outport Controller/Switch1 Switch Controller/To VCC SubSystem Controller/To VCC/PWM Inport Controller/To VCC/Gain Gain

63 APPENDIX C. INVENTORY LIST SIMULINK

Controller/To VCC/Simulink-PS Converter SubSystem Controller/To VCC/Unit Delay UnitDelay Controller/To VCC/VCC PMIOPort Controller/Voltage profile1 SubSystem Controller/i-limit SubSystem Controller/i-limit/t Inport Controller/i-limit/Constant Constant Controller/i-limit/Constant4 Constant Controller/i-limit/Gain1 Gain Controller/i-limit/Moving Minimum MATLABSystem Controller/i-limit/PS-Simulink Converter SubSystem Controller/i-limit/Switch Switch Controller/i-limit/Switch2 Switch Controller/i-limit/Zero-Order Hold ZeroOrderHold Controller/i-limit/Zero-Order Hold1 ZeroOrderHold Controller/i-limit/i PMIOPort Controller/i-limit/i real Outport Controller/i-limit/i lim Outport Controller/current PMIOPort Controller/PWM ref PMIOPort Current Sensor SimscapeBlock DC Motor SimscapeBlock DS B SubSystem DS C SimscapeMultibodyBlock DS D SimscapeMultibodyBlock DS lever SubSystem DS link SubSystem Electrical Reference SimscapeBlock Electrical Reference1 SimscapeBlock H-Bridge1 SimscapeBlock Ideal Angular Velocity Source SimscapeBlock Ideal Rotational Motion Sensor SimscapeBlock Ideal Torque Sensor SimscapeBlock Inductor SimscapeBlock Inductor1 SimscapeBlock Load SubSystem Load/Abs Abs Load/Add Sum Load/Constant Constant Load/Constant1 Constant Load/Cos Trigonometry Load/From From Load/Gain2 Gain Load/PS-Simulink Converter1 SubSystem

64 C.1. ANALYTICAL MODEL

Load/Product Product Load/Product1 Product Load/Sign Signum Load/Simulink-PS Converter1 SubSystem Load/vel PMIOPort Load/Load PMIOPort Load2 SubSystem Load2/Abs Abs Load2/Add Sum Load2/Constant Constant Load2/Constant1 Constant Load2/Cos Trigonometry Load2/From From Load2/Gain2 Gain Load2/PS-Simulink Converter1 SubSystem Load2/Product Product Load2/Product1 Product Load2/Sign Signum Load2/Simulink-PS Converter1 SubSystem Load2/vel PMIOPort Load2/Load PMIOPort Mechanical Rotational Reference SimscapeBlock Mechanism Configuration SimscapeMultibodyBlock Motor axle SimscapeMultibodyBlock Motor lever SubSystem Origo SimscapeMultibodyBlock PS B SubSystem PS C SimscapeMultibodyBlock PS D SimscapeMultibodyBlock PS lever SubSystem PS-Simulink Converter1 SubSystem Park sensor SubSystem Park sensor/Constant Constant Park sensor/Constant2 Constant Park sensor/Constant3 Constant Park sensor/Mod Math Park sensor/PS-Simulink Converter2 SubSystem Park sensor/Switch Switch Park sensor/angle PMIOPort Park sensor/pulse Outport Rocker-Base Transform SimscapeMultibodyBlock Rocker-Base Transform1 SimscapeMultibodyBlock Scope Scope Scope1 Scope

65 APPENDIX C. INVENTORY LIST SIMULINK

Solver Configuration SubSystem Solver Configuration1 SubSystem To WS1 SubSystem To WS1/Mux1 Mux To WS1/PS-Simulink Converter SubSystem To WS1/PS-Simulink Converter4 SubSystem To WS1/PS-Simulink Converter5 SubSystem To WS1/PS-Simulink Converter6 SubSystem To WS1/To Workspace ToWorkspace To WS1/Position PMIOPort To WS1/Velocity PMIOPort To WS1/Acceleration PMIOPort To WS1/Actuator Torque PMIOPort To WS2 SubSystem To WS2/Mux1 Mux To WS2/PS-Simulink Converter SubSystem To WS2/PS-Simulink Converter4 SubSystem To WS2/PS-Simulink Converter5 SubSystem To WS2/PS-Simulink Converter6 SubSystem To WS2/To Workspace ToWorkspace To WS2/Position PMIOPort To WS2/Velocity PMIOPort To WS2/Acceleration PMIOPort To WS2/Actuator Torque PMIOPort To WS3 SubSystem To WS3/Goto Goto To WS3/Mux1 Mux To WS3/PS-Simulink Converter SubSystem To WS3/PS-Simulink Converter1 SubSystem To WS3/PS-Simulink Converter2 SubSystem To WS3/PS-Simulink Converter3 SubSystem To WS3/PS-Simulink Converter4 SubSystem To WS3/PS-Simulink Converter5 SubSystem To WS3/PS-Simulink Converter6 SubSystem To WS3/PS-Simulink Converter7 SubSystem To WS3/To Workspace ToWorkspace To WS3/Position PMIOPort To WS3/Velocity PMIOPort To WS3/Acceleration PMIOPort To WS3/Actuator Torque PMIOPort To WS3/Force constrained PMIOPort To WS3/Torque constrained PMIOPort To WS3/Force total PMIOPort To WS3/Torque total PMIOPort

66 C.2. DSPACE MODEL

Voltage Sensor SimscapeBlock Voltage Source SimscapeBlock World Frame SimscapeMultibodyBlock Worm Gear SimscapeBlock

C.2 dSPACE model

Name Type ADC VCC-level SubSystem ADC VCC-level/ADC TYPE1 M1 CON1 SubSystem ADC VCC-level/ADC TYPE1 M1 CON2 SubSystem ADC VCC-level/Gain Current Gain ADC VCC-level/Gain Park Gain ADC VCC-level/Current Outport ADC VCC-level/Park Outport Constant Constant Constant1 Constant Constant2 Constant Constant3 Constant Constant4 Constant Constant5 Constant Controller SubSystem Controller/i Inport Controller/park Inport Controller/enable Inport Controller/Clock Clock Controller/Constant1 Constant Controller/Constant3 Constant Controller/Constant4 Constant Controller/Constant5 Constant Controller/Current limit SubSystem Controller/Current limit/t Inport Controller/Current limit/i Inport Controller/Current limit/Constant Constant Controller/Current limit/Constant4 Constant Controller/Current limit/Gain1 Gain Controller/Current limit/Moving Minimum MATLABSystem Controller/Current limit/Switch Switch Controller/Current limit/Switch2 Switch Controller/Current limit/i real Outport Controller/Current limit/i lim Outport Controller/Period calc SubSystem Controller/Period calc/t Inport

67 APPENDIX C. INVENTORY LIST SIMULINK

Controller/Period calc/Trigger TriggerPort Controller/Period calc/Gain Gain Controller/Period calc/Memory Memory Controller/Period calc/Subtract Sum Controller/Period calc/period Outport Controller/Rate Transition RateTransition Controller/Rate Transition1 RateTransition Controller/Rate Transition2 RateTransition Controller/Scope1 Scope Controller/Switch1 Switch Controller/Voltage profile SubSystem Controller/PWM Outport Current filter MATLABSystem DIO TYPE1 PWM VP M1 C1 SubSystem DIO TYPE1 PWM VP M1 C2 SubSystem DIO TYPE1 PWM VP M1 C3 SubSystem DIO TYPE1 PWM VP M1 C4 SubSystem INA Constant INB Constant Main start ManualSwitch Mode ManualSwitch PWM Constant Park filter Switch RTI Data SubSystem SEL0 Constant Switch1 Switch Switch2 Switch period Constant

68

TRITA ITM-EX 2018:162

www.kth.se