• Nenhum resultado encontrado

Analysis of closed-loop control strategies for robotic percussionists : Análise de métodos de controle em malha fechada para robôs percussionistas

N/A
N/A
Protected

Academic year: 2021

Share "Analysis of closed-loop control strategies for robotic percussionists : Análise de métodos de controle em malha fechada para robôs percussionistas"

Copied!
52
0
0

Texto

(1)

Universidade Estadual de Campinas

Faculdade de Engenharia El´

etrica e de Computa¸c˜

ao

Yasmin Honorio de Medeiros

Analysis of Closed-Loop Control Strategies for

Robotic Percussionists

An´

alise de M´

etodos de Controle em Malha

Fechada para Robˆ

os Percussionistas

Campinas 2019

(2)

Yasmin Honorio de Medeiros

Analysis of Closed-Loop Control Strategies for Robotic Percussionists

An´alise de M´etodos de Controle em Malha Fechada para Robˆos Percussionistas

Master dissertation presented to the School of Electrical and Computer Engineering in fulfillment of the requirements for the degree of Master in Electrical Engineering. Concentration area: Computer Engineering.

Disserta¸c˜ao de mestrado apresentada `a Faculdade de Engen-haria El´etrica e de Computa¸c˜ao para cumprimento dos requi-sitos exigidos ao diploma de Mestre em Engenharia El´etrica.

´

Area de concentra¸c˜ao: Engenharia de Computa¸c˜ao.

Orientador: Prof. Dr. Tiago Fernandes Tavares Coorientador: Prof. Dr. Matheus Souza

Este exemplar corresponde `a vers˜ao ini-cial da disserta¸c˜ao defendida pela aluna, e orientada pelos Profs. Drs. Tiago Fernandes Tavares e Matheus Souza

Campinas 2019

(3)

Ficha catalográfica Universidade Estadual de Campinas Biblioteca da Área de Engenharia e Arquitetura

Rose Meire da Silva - CRB 8/5974

M467a MedAnalysis of closed-loop control strategies for robotic percussionists /

MedOrientador: Tiago Fernandes Tavares. MedCoorientador: Matheus Souza.

MedDissertação (mestrado) – Universidade Estadual de Campinas, Faculdade de Engenharia Elétrica e de Computação.

Med1. Robótica. 2. Teoria do controle. 3. Automação. I. Tavares, Tiago Fernandes, 1984-. II. Souza, Matheus, 1990-. III. Universidade Estadual de Campinas. Faculdade de Engenharia Elétrica e de Computação. IV. Título.

Informações para Biblioteca Digital

Título em outro idioma: Análise de métodos de controle em malha fechada para robôs

percussionistas

Palavras-chave em inglês:

Robotics Control theory Automation

Área de concentração: Engenharia de Computação Titulação: Mestra em Engenharia Elétrica

Banca examinadora:

Tiago Fernandes Tavares [Orientador] Eric Rohmer

André Ricardo Fioravanti

Programa de Pós-Graduação: Engenharia Elétrica

Identificação e informações acadêmicas do(a) aluno(a)

- ORCID do autor: https://orcid.org/0000-0003-2173-1454 - Currículo Lattes do autor: http://lattes.cnpq.br/7030718882262217

Powered by TCPDF (www.tcpdf.org)

Data de defesa: 27-08-2019

Medeiros, Yasmin Honorio de,

(4)

COMISS ˜

AO JULGADORA - DISSERTA ¸

C ˜

AO DE MESTRADO

Candidato: RA192713 Yasmin Honorio de Medeiros Data de Defesa: 27 de Agosto de 2019

T´ıtulo da Disserta¸c˜ao: Analysis of Closed-Loop Control Strategies for Robotic Percus-sionists

An´alise de M´etodos de Controle em Malha Fechada para Robˆos Percussionistas

Prof. Dr. Tiago Fernandes Tavares (presidente) Prof. Dr. Eric Rohmer

Prof. Dr. Andr´e Ricardo Fioravanti

A ata de defesa, com as respectivas assinaturas dos membros da Comiss˜ao Julgadora, encontra-se no SIGA (Sistema de Fluxo de Disserta¸c˜ao/Tese) e na Secretaria de P´ osGrad-ua¸c˜ao da Faculdade de Engenharia El´etrica e de Computa¸c˜ao.

(5)

Abstract

Robotic musicianship, in special robotic percussion, is becoming increasingly relevant as electronic and mechanical parts are becoming cheap and ubiquitous. The construction of a robotic music player requires both an engineering approach, for building the robots themselves, and a musical approach, focused on producing art pieces with the robots. Most approaches for robotic music consists of attaching a drumstick to a fast actuator that quickly responds to immediate human commands. In this project, we propose a different approach, which consists of controlling both the time and velocity that the ac-tuators hit the percussive instrument. This allows for fine control of sound dynamics (intensity), which is an important tool for musical expression. In addition, we evaluate simulation results from two types of controller: PID and state-space. They are analyzed on best case scenarios and also put under voltage and encoder restrictions. Then, the results are validated with experimental tests. Our experiments show that both controllers are suitable for such purpose, but state-space feedback performs better than only PID when there is voltage restriction or smaller target time. It is also more resilient to worse encoder resolutions. However, it needs more information from hardware and more soft-ware processing. These results are useful for designing hardsoft-ware for robotic percussionists and are a significant step towards the consolidation of engineering methods in robotic mu-sicianship.

(6)

Resumo

Musicalidade rob´otica, principalmente percuss˜ao rob´otica, tem se tornado cada vez mais relevante conforme pe¸cas mecˆanicas e eletrˆonicas se tornam mais baratas e comuns. A cria¸c˜ao de um robˆo m´usico exige tanto uma abordagem de engenharia, para a constru¸c˜ao do pr´oprio robˆo, como uma abordagem musical, que foca na produ¸c˜ao art´ıstica utilizando eles. A maioria dos m´etodos para desenvolver robˆos m´usicos consiste em usar um atu-ador com uma baqueta, de forma que ele responda rapidamente a comandos humanos. Nesse projeto, n´os propomos uma abordagem diferente, que consiste em controlar tanto o tempo como a velocidade que o atuador atinge o instrumento. Isso permite um controle mais refinado da dinˆamica sonora (intensidade), que ´e uma ferramenta importante para express˜ao musical. Al´em disso, n´os analisamos dois tipos de controladores: PID e com realimenta¸c˜ao de estados. Eles s˜ao avaliados nos melhores cen´arios, como tamb´em com restri¸c˜ao de tens˜ao de entrada e de qualidade de encoder. Depois, as premissas foram val-idadas com experimentos pr´aticos. Nossos resultados mostram que ambos controladores conseguem atingir o objetivo proposto, por´em utilizar realimenta¸c˜ao de estados d´a um resultado melhor do que s´o PID quando h´a restri¸c˜ao de tens˜ao ou deseja-se um tempo de impacto menor. Ele tamb´em ´e mais resiliente com encoders de baixa resolu¸c˜ao. Contudo, ele precisa de mais informa¸c˜ao vinda do hardware e de mais processamento de software. Esses resultados s˜ao ´uteis para o desenvolvimento de hardware de robˆos percussionistas e s˜ao um passo significante para a consolida¸c˜ao de m´etodos de engenharia na elabora¸c˜ao de instrumentos rob´oticos.

(7)

Contents

Introduction 8

1 Motor Modelling and Estimation 13

1.1 DC Motor Model . . . 13 1.2 Parameter Estimation . . . 16 1.3 State-Space Representation . . . 20 2 Control Algorithms 22 2.1 Model analysis . . . 22 2.2 PID Control . . . 24 2.3 LQR Control . . . 26 2.4 Implementation . . . 29 3 Experiments 31 4 Results 34 4.1 Arrival Parameters Control . . . 34

4.2 Voltage Saturation . . . 37

4.3 Quantizer Resolution . . . 39

4.4 Kalman Estimator . . . 42

4.5 Experimental Results . . . 45

5 Conclusion and Future Work 47

(8)

8

Introduction

The production of sounds is a cognitive and social experience for mankind. Our interest in finding novel ways to mechanically explore that has appeared throughout history. For example, take the greek-roman water organ called Hydraulis (Hyde 1938) built around 228. It used the counter-pressure of the water inside the organ container to push air into the funnel. Also, in 1206 Ismail al-Jazari published the idea for the Boat of Automata, a boat that had floating automatic musicians (Nadarajan 2007).

The popularization of electronics and microcontrollers allowed advances in robotic musical instruments. Early robotic instruments date back to the decade of 1980, like the organ player WABOT-2 made by a team at Waseda University (Roads 1986). It was a humanoid-inspired robot able to play songs by reading the music score. It accepted audience requests and was able to strike up to 15 keys per second. In order to do that, the robot needed a computer control system that stayed in a separate room. Human interaction was an important goal to WABOT-2.

In the XXI century, robotic percussionists have had an increasing role in music pro-duction. In 2002, Kapur built the ETabla (Kapur, Essl, Davidson & Cook 2002) shown in Figure 1b, an electromechanic tabla controlled via MIDI. It emulated tabla strokes and created an audio and visual performance. Its intention was to dissociate music automation from computer produced sounds.

Differently, Georgia Tech researchers have been focusing on human-robot interaction with Haile (Weinberg, Driscoll & Parry 2005) and Shimon (Hoffman & Weinberg 2010) on Figure 2. Haile is a robot that strikes a pow-wow drum, varying striking location and strength based on musical analysis. Shimon is a marimba player with four striking arms

(9)

Introduction 9

that improved the melodic perception from Haile and increased the range of movement. They both perform live improvisation with humans.

(a) ETabla Dahina Controller (Kapur et al. 2002)

(b) Electronic Tabla Controller (Kapur et al. 2002)

Figure 1: Early robotic percussionists

(a) Haile c 2005 IEEE

(b) Shimon c 2011 IEEE

Figure 2: Georgiatech robotic instruments

Many robotic instruments have been designed to achieve a set of performance goals. The Bassbot (Vindriis, Carnegie & Kapur 2011) was evaluated by comparing stepper motors and solenoids actuators speed and amplitude (loudness) consistency as pucking mechanisms. The robotic drum NotomotoN was tested fot speed, dynamics (loudness) and delay (Murphy, Kapur & Carnegie 2012). Also, industrial voice coil actuators were compared to linear and rotary solenoids by means of latency, loudness an repetition rate (Rooyen, Schloss & Tzanetakis 2017).

(10)

Introduction 10

In 2015, an article suggested a methodology for comparing musical robots striking ac-tuators (Long, Murphy, Kapur & Carnegie 2015). It compared three types of mechanisms: solenoids, servo motors and pneumatic strikers. They can be seen on Figure 3. The eval-uation methods considered latency, musical dynamic (loudness) range, consistency and repetition rate. These design goals are useful under the assumption that robots should quickly respond to immediate human commands.

Figure 3: Striking mechanisms evaluated, where A) and B) are Rotary Solenoids, C) and D) are Linear Solenoids, E) and F) are Pneumatic Strikers and G), H) and I) are Servo Motors (Long et al. 2015)

Another requirement for robotic instruments is related to the fine control of musical gestures. Closed-loop control can be used to control the musical parameters. It has been used on the Glockenspiel (Long, Kapur & Carnegie 2016) shown on Figure 4, to detect amplitude of the sound via magnets attached to the keys of the robot. This way, it implemented a calibration routine.

(11)

Introduction 11

The robot that plays alto recorder used control algorithms to adjust the air flow (Masuda, Kato, Kawashima & Kagawa 2012), using a flow sensor along with a servo valve. The saxophonist WAS-2 controlled the air flow using a closed-loop system, and implemented a feed-forward control using neural networks and PID (Solis, Petersen, Ya-mamoto, Takeuchi, Ishikawa, Takanishi & Hashimoto 2010).

Also, a robotic Hi-Hat used a distance sensor and closed-loop control to continuously calibrate the height of the percussionist (Long, Murphy, Carnegie & Kapur 2017). More-over, robotic percussionists have implemented PID controllers (Rooyen et al. 2017) with position error measured with an optical quadrature encoder.

In this work, we propose a robotic percussionist controller aimed at fine musical dy-namics control. It considers two opposing design aspects. The first is the actuator velocity on arrival, that is, the drumstick’s speed when it hits the drum. The second is the actu-ator delay, that is, the time interval between the movement onset and the drum hit. For such, we evaluated two different control paradigms, namely PID and LQR control. Both controllers were evaluated under a voltage-constraint scenario and using parameters esti-mated from a real DC motor. The PID control uses the angular position error, acquired with an optical encoder. The LQR control requires velocity and electric current values, which are usual state variables in DC motor modelling.

The results show the control error both for the velocity on arrival and for the actuator delay. Also, we estimate the required actuator current and the encoder resolution for each of the control scenarios, which allows for the design of fitting power electronic circuits for the robots. We also compared the simulated results with the physical motor behavior for both controllers. Because measuring position is easier in practice, a Kalman filter was implemented so that the LQR algorithm can use the velocity and electric current estimations. The result with the filter was first validated via software simulation.

The chapters of this document are organized as follows. Chapter 1 explains the DC motor modeling and circuitry. Chapter 2 defines the strategies used for implementing the control algorithms. Chapter 3 explains the experiments used to control delay and arrival velocity, in addition to the voltage restriction, encoder comparison and real motor testing. Chapter 4 compares simulation results for closed-loop performances, with PID

(12)

Introduction 12

implementation and with a state-space LQR algorithm. It also validates these results with physical tests. Chapter 5 finishes this document by reviewing the conclusions from the previous chapters and relates to future work.

(13)

13

Chapter

1

Motor Modelling and Estimation

Robotic percussionists can be built in different forms, using different mechanisms to produce sound. In this work, we studied an actuator that can be used on membra-nophones. In this type of instrument, there is no need to take into account height vari-ation of the instrument between drum hits or the influence of the actuator on it. Figure 1.1 represents a drumstick positioning and movement, in addition to the moment where it hits the fixed membrane.

Figure 1.1: Image of a drumstick angular movement and the moment it hits a fixed membrane.

1.1

DC Motor Model

One way to make robotic membranophone actuators is to use a system with a motor and a stick to strike the membrane of the instrument (Kapur 2005), as shown in Figure 1.2. The drumstick connection is fixed using the a screw, that presses the motor axis.

(14)

1.1. DC Motor Model 14

This mechanical connection could be done using gears, racks or more complex mecha-nisms, but we tried to keep the relative position between the stick and the motor simple and therefore chose this option. However, its vulnerability to physical changes affects the controller performance. Because of that the motor model parameters are sensitive to variations throughout its use.

This mechanism can be used to play percussive instruments but also can be controlled using standard H-Bridge circuits driven by PWM signals.

Figure 1.2: Photo of the percussive actuator used in this project: a DC Motor with encoder and an attached drumstick.

The DC motor can be described by its inner electromagnetic circuit, the load attached to it and their relation. The motor works based on the electromagnetic interaction between a rotating axis and a nonturning armature (stator) (Franklin, Powell & Emami-Naeini 2001). Such an interaction generates a back electromotive force V that is proportional to the rotation speed ω, that is,

V = κω, (1.1)

where κ is a constant that is specific to each motor.

The inner circuits of the motor are built using wires in a solenoid shape, hence they have intrinsic resistance Rm and inductance L. For this reason, a possible electric model

(15)

1.1. DC Motor Model 15

u

R

m

L

i

V = κω

M

Figure 1.3: Diagram for the motor model. It comprises a LR electric model that reacts to the input voltage u and a mechanic model that relates the back electromotive force V to the rotation speed w.

Applying Kirchoff’s law to the electric network shown in Figure 1.3, the motor’s dy-namic behavior can be modelled by:

u = Ldi

dt + Rmi + κω. (1.2)

In addition, the motor torque T is proportional to the flowing current i, that is,

T = κi, (1.3)

where κ is the motor constant and is the same found in Equation (1.1), provided that the measurement unities are consistent.

The torque causes motor rotation and depends on the motor viscous friction coefficient b and the inertia J :

T = J ˙ω + bω. (1.4)

Based on Equations (1.1) to (1.4), it is possible to get the diagram shown on Figure 1.4. It relates the representation of the electromagnetic model of the system with the mechanical model used for calculating the torque T .

(16)

1.2. Parameter Estimation 16

Figure 1.4: Model of DC Motor with internal variables i, T and ω, electric parameters L and Rm, and mechanical parameters b and J . κ is the motor constant and u is the input

voltage of the system.

In summary, this model relies on five parameters:

• Rm: Armature Resistance [Ω]

• L: Armature Inductance [H]

• κ: Constant of the Motor [V s]

• b: Viscosity Coefficient [N ms]

• J: Moment of Inertia [kgm2]

1.2

Parameter Estimation

1.2.1

Setup

In order to estimate the motor parameters, an electric circuit was implemented. The DC Motor was turned on and off via a microcontroller board and an external power source was added to supply the desired voltage and electric current. They were linked using a NPN transistor as shown on Figure 1.5. The Arduino pin 7 controls the activation of the motor and pin A0 is used to measure current using the voltage difference and the electric resistance value.

An encoder was needed for measuring angular position. The optical key C860TP shown in Figure 1.6a was used to read the values of an encoder disc with 20 positions attached to the motor axis. The circuitry presented on Figure 1.6b was implemented, and the values of R1 and R2 were experimented so that the software could recognize the sensor pulses. The pulses were read and stored via the Arduino pin 2.

(17)

1.2. Parameter Estimation 17

Figure 1.5: Circuit used for controlling the DC motor and measuring current i.

(a) Optical key sensor

(b) Circuit used for measuring angular position θ.

Figure 1.6: Optical sensor and its circuit, which were used for measuring θ

Another option for encoder, which was used for another runs of the model estimation, is shown on Figure 1.7. This is a quadrature encoder, which allowed for acquiring the po-sition and also the direction (clockwise or anticlockwise). The encoder disc accompanying this encoder has 100 positions, which increases the precision of the measurements.

(18)

1.2. Parameter Estimation 18

Figure 1.7: Linear optical quadrature encoder

After setting up the electric circuit, the parameters were estimated by the following procedures (Geromel & Palhares 2004).

1.2.2

First procedure

First, the estimation of Rm and L can be performed by locking the motor axis and then

applying a constant voltage to the circuit. The circuit current was measured by sampling the voltage in a small resistor Ri connected in series to the motor. In this situation, ω = 0,

hence V = 0 and the current in the circuit equals:

i = i0· (1 − e−t/τ), (1.5)

where τ = L/Rm is the time constant of the RL circuit and i0 = u/(Rm + Ri) in the

steady state. The circuit current was acquired at 5 kHz. The value of Rm can be obtained

from the steady-state current equation.

After that, we can calculate τ by finding the point in which i = i0(1 − 1/e), which

(19)

1.2. Parameter Estimation 19

1.2.3

Second procedure

After the estimation of Rm and L, we estimated b using equations (1.3) and (1.4) in

the steady state. For such, we applied a constant voltage to the circuit without restricting the motor axis rotation. The angular position was measured asynchronously upon change from an encoder and the rotation speed ω was calculated with a frequency of 50 Hz. The circuit current was acquired at 500 Hz.

In this situation ω does not change, that is, ˙ω = 0, hence:

T = ki = J ˙ω + bω ki = bω

b = kiω.

(1.6)

Similarly, we estimated κ using the steady state of Equation (1.2). Since the estimation is performed in the steady state, the current does not change. Also, the input voltage is known a priori. It follows that:

u = Rmi + κω

κ = u−Rmi

ω .

(1.7)

1.2.4

Third procedure

Last, we estimated J by using a linear grey-box model (MATLAB 2018b), where we inserted the state-space representation in relation to J . We added the measured current i, the angular velocity ω and the voltage input u throughout 2s into the estimation function to serve as base for error calculation.

The optimization method was a combination of four least-squares algorithms: standard and adapted Gauss-Newton, Levenberg-Marquardt and Steepest descent. The search direction in each iteration was chosen by the first descent direction in the error function.

(20)

1.3. State-Space Representation 20 Parameter Value Rm 9.34 Ω L 0.006 H κ 0.075 Vs b 0.0011 Nms J 0.5 kgm2

Table 1.1: Motor Parameters obtained from the measurements.

1.3

State-Space Representation

The state-space representation of a system takes the set of differential equations that describes its dynamic behavior and put them in a vector form. They can be used to predict the evolution of the system state, show its internal behavior and generalize the model in order to include multiple inputs and outputs (Franklin et al. 2001). In addition, it changes the system representation to an equation of order one, which makes it easier to analyze.

Equation (1.8) represents the state-space form, where x is the state variable, y is the output vector (the measured variables) and u is the input (controlled signal). A comprises the state matrix, B is the input matrix, C is the output matrix and D is the direct transmission matrix (Ogata 2001).

˙x(t) = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t),

(1.8)

Based on Equations (1.2), (1.3) and (1.4), the state-space representation of the DC motor uses the state x as the usual state variables for a DC motor (current i, angular velocity ω and angular position θ, respectively). The control input u is the voltage applied to the motor and the controlled output y is the angular position, which is measured using an encoder. The state-space matrix can be expressed in terms of the aforementioned parameters as:

(21)

1.3. State-Space Representation 21   A B C D  =         −Rm/L −κ/L 0 1/L κ/J −b/J 0 0 0 1 0 0 0 0 1 0         . (1.9)

These models were used to define the controllers discussed in the next section, in order to calculate the control signal u.

The transfer function of the system can be obtained via the state-space form. Applying Laplace’s transform on Equation (1.8) and considering initial conditions as zero:

sX(s) = AX(s) + BU (s) Y (s) = CX(s) + DU (s). (1.10) Therefore, (sI − A)X(s) = BU (s), Y (s) = C(sI − A)−1BU (s) + DU (s) (1.11)

The transfer function G(s) = Y (s)/U (s) can be found as:

G(s) = C(sI − A)−1B + D. (1.12)

Solving Equation (1.12) for the matrices on Equation (1.9), the transfer function G(s) based on the DC motor parameters is

G(s) = s[κ2+(J s+b)(Ls+Rκ

(22)

22

Chapter

2

Control Algorithms

In this work, we implemented linear controllers in order to get the desired arrival time and angular velocity. For that, it is important that the system tracks the reference signal, which here corresponds to the angular position. Reference tracking is the ability to follow a behavior established by a signal and needs that the system is considered stable.

We implemented and evaluated two different control algorithms, namely PID and state-space feedback with LQR. The PID controller was chosen because of its recent use on robotic instruments and for the ability to track a reference signal and maintain the variable’s state (Long et al. 2017, Rooyen et al. 2017). In this project, the PID algorithm relies on direct feedback of the motor angular position, its derivative and its integral. It requires a position encoder that has little effect on the control circuitry.

The state-space control also uses information about the flowing current, which requires additional circuitry for a physical implementation. In addition, it requires deriving the measured position and passing it through a filter for calculating velocity.

2.1

Model analysis

In order to insert a controller on the system, it is important to analyze if the system is controllable, observable and its stability. An unstable system needs that a controller that is able to revert this aspect (Franklin et al. 2001). A model that is not controllable may not have a solution to repair the system flaws and one that is not observable is subject to measurement errors and inconsistencies (Ogata 2001).

(23)

2.1. Model analysis 23

2.1.1

Stability

A system model is called stable if its state dynamics is bounded and tends to zero for any initial condition. Transfer function poles on the positive side of the Real spectrum make the effects of initial conditions persist (Franklin et al. 2001). Therefore, if the system does not have positive real poles then it is stable.

Replacing the parameters found for the DC Motor from Table 1.1 on the Equation (1.13), the transfer function is

G(s) = 0.003s3+4.67s0.0752+0.016s (2.1)

The system has one pole on zero and two negative real poles: −1557 and −0.0034, which implies it can be considered stable.

The LQR controller needs information on all the state variables. This means that the state-space variable C is the 3 times 3 identity matrix and D is a 3 times 1 zeros vector. Therefore, the transfer function will be

G(s) =      J s+b κ2+(J s+b)(Ls+R m) κ κ2+(J s+b)(Ls+R m) κ s[κ2+(J s+b)(Ls+R m)]      (2.2)

The two negative poles will be the same so the system is stable for all three state variables. However, electric current has a zero on -0.022.

2.1.2

Controllability

A system is said to be controllable if it is possible to transfer its initial state to any other state in a finite time interval (Ogata 2001). A mathematical approach to find if a system is controllable is to check if the matrix [B|AB|A2B] has full column rank. In this

case, A and B are matrices from the state space representation on Equations (1.8) and (1.9). Therefore, we get that the controllability matrix is:

(24)

2.2. PID Control 24 Cm =      1/L −Rm/L2 J R 2 m−Lκ2 J L3 0 κ/J L −κRm−κLb J L2 0 0 J Lκ      (2.3)

The determinant of the matrix is det(Cm) = κ2/J2L3. A determinant different than

zero means that its columns are linearly independent. Therefore, for non zero values of κ, J and L the system is controllable. By replacing the parameters found on Table 1.1, the determinant is found to be det(Cm) = 625.

2.1.3

Observability

The LQR controller can use a state observer as an alternative to measuring the electric current and deriving the position to get the angular velocity. However, to do that the system needs to be observable. This means that every state x in time can be found through an observation of the output y over a finite time interval (Ogata 2001).

A mathematical approach to find if a system is observable is to check if the matrix [CT|ATCT|A2TCT] has full column rank. In this case, A and C are matrices from the state

space representation on Equations (1.8) and (1.9). Therefore, we get that the observability matrix is: O =      0 0 κ/J 0 1 −b/J 1 0 0      (2.4)

Since the determinant of the matrix is det(O) = −κ/J , its columns are linearly inde-pendent. Therefore, for non zero values of κ and J the system is observable. By replacing the parameters found on Table 1.1, the determinant is found to be det(O) = −0.15.

2.2

PID Control

The PID controller uses the error feedback signal as input and contains tree terms based on the gains: the proportional (KP), integral (KI) and derivative (KD). In this

(25)

2.2. PID Control 25

error. Proportional gain is the one that relates directly to the system error feedback. However, even if a large KP can get a small steady-state error, it might not give a good

enough transient response (Franklin et al. 2001).

The integral gain relates to the input history and is used to minimize steady-state error and make the controller more resilient to input disturbances (Franklin et al. 2001). The derivative gain provides anticipatory action, which is used for reducing the system oscillation (Astrom & Murray 2008) and improving the transient response.

The PID controller uses a transfer function in the form:

C(s) = KP + KI

1 s + KD

N s

s + N, (2.5)

where N is a filter coefficient that is used on the derivative term in order to reduce the effect of measurement noise.

Electromechanical restrictions will saturate the actuator and cause the integral term of the PID controller to windup, which will take more time for the control signal to return to the saturation limits (Astrom & Murray 2008). In this work, for instance, there is an electric current and voltage limit the circuit endures.

To simulate the control method results, a dynamic model of the system was created using the equations representation shown on Equations (1.8) and (1.9). The diagram of Figure 2.1 portray the feedback loop with PID controller, where the control signal is v. It also includes a voltage saturation, which will be further explored on the experiments of Chapters 3 and 4.

Figure 2.1: Dynamic model of the motor with PID controller, using position error as the input signal

(26)

2.3. LQR Control 26

2.3

LQR Control

While PID control only requires feedback from the motor’s position error, the state-space controller also uses information on its electric current. To balance these parameters, a linear quadratic regulator (LQR) was inserted along with PID. This allows balancing the cost of the control signals related to the PID and to the electric current feedback (Astrom & Murray 2008). It is a widely used technique, where the controller attempts to minimize the performance indicator ρ (Franklin et al. 2001) described in

ρ = Z ∞

0

(xTQx + Rc2) dt (2.6)

The cost function is composed of two parts: the positive semidefinite matrix Q penalises any deviation of the state x from the origin, whereas the positive scalar R does the same regarding the control input c. Different choices of Q and R may lead to completely different dynamical behaviour of the closed-loop system (Franklin et al. 2001).

The solution to this optimal control problem is given by a state-feedback negative control input −c = −Kx. The optimal gain is K = R−1BTP , where P is the symmetric positive definite stabilising solution to the Riccati equation

P A + ATP − P BR−1BTP + Q = 0. (2.7)

This means that if P exists, the system A − BK is stable (Ogata 2001).

The LQR feedback was not inserted alone because it returns a vector with gains for the state variables: electric current i, angular velocity w and angular position θ. However, for this case it is important to take into account the position integration. This is because reference tracking problem demands the output to follow the reference as closely as possible (Franklin et al. 2001), which is what we want in this scenario. It also gives a better comparison during the test runs because we analyzed the controllers performance while varying the position curve parameters.

The dynamic model of the system containing the feedback loop with PID and LQR gain K is shown on Figure 2.2. The LQR signal is represented by c, and the PID-LQR

(27)

2.3. LQR Control 27

Figure 2.2: Dynamic model of the motor with PID and LQR controllers, using position error as the PID input signal and states feedback for LQR

control signal is given by u = v − c. In this case, the state variable C is the 3 times 3 identity matrix and D is a 3 times 1 zeros vector.

2.3.1

Kalman Filter

Since the system is observable, instead of measuring the electric current i and calculat-ing the angular velocity ω, a Kalman filter can be inserted as an observer to estimate the state variables. Figure 2.3 shows the model of the system, replacing the states feedback with an observer that takes into account the system’s voltage input, the measured state feedback and the internal states estimation. This means the system uses the Equations (1.8) and (1.9) as the system’s representation.

Figure 2.3: Dynamic model of the motor with PID and LQR controllers, using position error as the PID input signal and state estimation for LQR

(28)

2.3. LQR Control 28

The observer uses the control signal (input) and a model of the system to estimate the internal variables. Then, it compares the estimated output with the measured output and multiply this error by a gain matrix Lo in order to correct the observer output (Geromel

& Korogui 2011). The observer equations will then be

˙xo(t) = Axo(t) + Bu(t) + Lo(y(t) − yo(t))

yo(t) = Cxo(t) + Du(t),

(2.8)

where the state variables are gotten from Equation (1.9) and we can find that the error derivative is ˙x(t) − ˙xo(t) = (A − LoC)(x(t) − xo(t)). This way, it is possible to choose

a value of Lo that makes the matrix A − LoC stable, so that the error can tend to zero

for any initial condition. However, large values of Lo also enlarge the measurement error

(Geromel & Palhares 2004).

The state estimation using Kalman solves that by assuming there is a process distur-bance wo and also measurement noise vo. There are two approaches to dealing with these

noises: the deterministic and the stochastic. The first approach considers that the noises can be described as wo = NUδ(t) and vo = pNµδ(t), where NU relates the components

of the state vector to wo, Nµ is the intensity of vo and δ(t) implies there is a white noise

(Geromel & Korogui 2011). The error function from the noises are:

ew(t) = e(A−LoC)tNU

ev(t) = −pNµe(A−LoC)tLo,

(2.9)

This means that the criteria for choosing Lo based on its performance can be ρ(Lo) =

R∞

0 ( ˙ew(t)ew(t) + ˙ev(t)ev(t)) dt. This is a quadratic criteria and therefore these noises can

reduced by minimizing the quadratic error related to the observer gain Lo (Geromel &

Korogui 2011).

The Kalman estimator was implemented on a microcontroller board considering that the angular position measurement can be described as z(k) = Hx(k) + vo(k). In addition,

it introduces the covariant matrices QK for the process and RK for the measurement

(29)

2.4. Implementation 29

The Kalman estimator has internal parameters xo and po, where xo is the estimated

state variables and po is the error covariance matrix. They are calculated using

xo(k) = Ax(k) + Bu(k)

po(k) = Ap(k − 1)AT + QK

(2.10)

Considering the Kalman gain as Lo(k) = po(k)HT(Hpo(k)HT + RK)−1 (Welch &

Bishop 2001), the internal parameters are corrected using the filter properties

x(k) = xo(k) + Lo(k)(z(k) − Hxo(k))

p(k) = (I − Lo(k)H)po(k)

(2.11)

Since z(k) is measured, the value of H can be chosen arbitrary in order to add gain to the estimated state xo. For this work, we chose to consider all estimated states and

therefore H is a 3 times 1 ones vector. QK and RK will be defined in the results section.

2.4

Implementation

While there exist several PID tuning rules of thumb for simple systems (Astrom & Murray 2008, Franklin et al. 2001), the determination of these gains in complex scenarios can be challenging. In this word, the PID gains were iteratively tuned using the Matlab Control Systems Toolbox IDE (MATLAB 2018a).

The toolbox operates over a SimulinkTM implementation, and displays two user-controlled parameters: “Response Time” and “Transient Behavior”. These parameters are used to calculate the PID gains by finding a crossover frequency for a target phase margin of 60 degrees, based on the linearized model of the system (Simulink 2018). Higher values for the “Response Time” tend to make the controller slower, whereas higher values for “Transient Behavior” makes it more robust. We used Response Time around 130ms (to get 100% amplitude at 120ms) and Transient Behavior equal to 0.5.

The controllers were adjusted with the following parameters. Q was set as a diagonal matrix to avoid interference between variables. One way to define initial values for Q and R is relating the element i of the matrix to 1/max(xi)2 (Franklin et al. 2001). This

(30)

2.4. Implementation 30

scales differ less than 10 times each other, therefore we decided to fix Q as a 3 × 3 identity matrix and R = 1.

We tested the gains R = 0.1, R = 1 and R = 10 because we wanted to analyze the influence of the variables weight, therefore they have 10 times more weight, same weight and 10 times less weight than the control signal. Table 2.1 shows the PID parameters for each controller configuration.

Parameters R=0,1 R=1 R=10 PID

KP 53 16.4 9.16 5.84

KI 152.7 51.75 18.44 8.66

KD -0.43 0.78 0.83 0.91

N 15.29 21.76 40.42 39.79

Table 2.1: PID parameters found for each controller configuration using ”transient be-haviour” variable as 0.5 and ”response time” around 130ms, where at 120ms the amplitude got to 100%

Because the control structure using state-space combines the LQR and the PID ideas, from the point on it shall be called LQR-PID controller.

The PID control signal used in our experiments refers to the angular position of the drumstick. The signal consists of a ramp that starts at π/2 rad and takes a finite time interval (the ramp duration) to reach the 0 position. The ramp was used so that softer drum hits can be achieved by increasing the ramp duration.

(31)

31

Chapter

3

Experiments

The experiments described in this document aim at highlighting the following impor-tant questions:

1. Can PID and LQR-PID controllers accomplish fine musical dynamics control?

2. What is the difference between the PID and LQR-PID controllers without restric-tions?

3. What is the impact of voltage saturation in each controller?

4. What is the impact of encoder resolution in each controller?

5. What are the circuit (voltage and current) requirements for the implementation of the robot controller?

6. What is the impact of using a Kalman estimator instead of measuring electric current and angular velocity?

7. Are the simulation results close to the experimental ones?

The tests were executed using the control topologies shown in Figures 2.1, 2.2 and 2.3 implemented on SimulinkTM, using both the PID controller and the LQR-PID controller.

The initial tests compared PID with all values of R cited on Table 2.1. In the tests that evaluated voltage saturation and encoder resolution, the latter controller was used only with R = 0.1 to attenuate the effects of the control signal. Then, a few comparison tests

(32)

CHAPTER 3. EXPERIMENTS 32

were made with the insertion of the Kalman estimator and this was implemented on the experimental tests, which meant to evaluate the PID solo with the LQR-PID controller.

The tests used a control signal corresponding to a ramp that starts at a pre-defined position and decreases towards zero. This control signal aims at informing the controller that the drumstick should hit the drum with angular velocity proportional to the ramp angular coefficient. The initial position and the ramp duration can vary in order to control arrival time and velocity. We ignored the results acquired after the time of arrival because they correspond to the time after hitting the drum, thus they are not relevant to our application.

We evaluated two error measures, as shown in Figure 3.1. The first measure is the time of arrival. It is related to the time interval required for the drumstick to hit the instrument. The second measure is the angular velocity on arrival, which corresponds to the musical dynamics related to hitting the instrument. Ideally, the time of arrival equals the ramp duration and the angular velocity on arrival equals the ramp’s angular coefficient.

Figure 3.1: Typical control signal and output for the system. The control signal is a decreasing ramp whose duration and angular coefficient are followed by the motor.

All four controllers were tested using an unrestricted scenario, which evaluated the ability to fit the desired signal. We varied the ramp duration from 50ms to 500ms and its initial position from 15 to 90 degrees. The PID and LQR-PID with R = 0.1 controllers

(33)

CHAPTER 3. EXPERIMENTS 33

were tested using an unrestricted scenario, as well as restrictions on voltage saturation at 5V and 20V. These saturation values are respectively associated to USB 3.0 cellphone chargers and to typical laptop chargers, which are frequently used as power sources in electronic experiments. The electric current was also confirmed to be inside these sources limits. For those tests, we assumed an initial position of π/2 radians and varied the ramp duration from 50ms to 200ms.

Next on the simulation tests, we introduced a quantization on the position output to simulate the enconder resolution. Also, the angular velocity input on LQR was derived from the quantized position. For those tests, we assumed an initial position of π/2 rad and a ramp duration of 50ms and 200ms. The quantization step was set at 0.05, 0.5, 1, 2, 4.5, 9, 18 and 36 degrees. They correspond, respectively, to a quadrature encoder with 3600, 360, 180, 90, 40, 20, 10 and 5 positions.

After that, we compared the simulation results of PID-LQR controller with measured states and with estimated states via Kalman. The first test was run to choose the Kalman parameters QK and RK. The following tests used ramps with 50ms duration, voltage saturation of 20V and an encoder step of 18 degrees in order to analyze the behavior of the system in restricted scenarios. In addition, a white noise was added to the system in order to compare the angular position output.

So far, all tests have been done with simulations and therefore using a model of the system. However, in order to validate the conclusions so far, the last test implemented the controllers on a microcontroller board and computed the angular position measured with an encoder. The rate to compute the variables and calculate the control signal was 100Hz. The test parameters were adapted because of eletromechanical restrictions. In the interest of validating most use cases so far, the experimental test ran with two voltage saturations (5V and 10V) and two different ramp durations (50ms and 100ms). The initial position was fixed in 90 degrees and the encoder resolution is 3.6 degrees.

(34)

34

Chapter

4

Results

This chapter analyzes the result of each test on the same order they were described on Chapter 3. The angular velocity and the time of arrival were the parameters evaluated and illustrated in each figure.

4.1

Arrival Parameters Control

Figure 4.1 shows the angular velocity ω on arrival comparison for the four controllers. This result did not consider saturations or quantization, but evaluated the influence of state-space feedback on LQR-PID controller. It intended to compare the controllers on the goal of controlling angular velocity by changing the ramp duration. With that in mind, the PID controller showed the result with less error. Note that all controllers had similar outputs, where the variation between them was kept below 1rad/s.

Also, Table 4.1 shows the arrival time for this experiment. It compares each controller to the ramp duration (desired arrival time). PID controller had the smallest error in all scenarios, even though the variation between controllers was kept below 3%.

From these results, we can find a relation between ramp duration and arrival param-eters. For instance, a variation of 100ms results in average on approximately a 1.06rad/s change on angular velocity and a 85ms change on arrival time for the PID controller. With that, we get the equations for angular velocity on arrival ωa and arrival time ta:

(35)

4.1. Arrival Parameters Control 35

Figure 4.1: Angular velocity on arrival for ramp durations from 50ms to 500ms, comparing PID and LQR-PID without saturation

Ramp Duration (ms) PID R=0,1 R=1 R=10 50 145.5 146 146.5 146 100 176.5 177 178.5 178 150 211 213.5 215 213 200 249.5 253.5 256.5 252.5 250 290 296 300 294.5 300 333.5 341 345 338.5 350 378 387.5 390.5 384 400 423.5 435 436.5 431.5 450 469.5 483 483 478.5 500 516.5 531.5 530.5 526.5

Table 4.1: Arrival time comparison for 90 degrees reference and input ramp duration from 50ms to 500ms, without voltage saturation

ωa = 8.0 − 10.6∆r

ta = 0.09 + 0.85∆r,

(4.1)

where ∆r is the ramp duration in seconds, ωa is in rad/s and ta is estimated in seconds.

We can get an equation in the form of Equation (4.2) for each of the four controllers, which means that all of them seem suitable for musical dynamics control. In addition, it is possible to conclude that the PID controller had the best result for changing ramp

(36)

4.1. Arrival Parameters Control 36

duration on a non-restriction scenario, because it is the one which had the closest desired arrival parameters.

Figure 4.2 also shows the result for angular velocity on arrival ωa, without voltage

restriction, for the four controllers. This test varied the initial position from π/12 rad (15 degrees) to π rad (180 degrees). As seen in the previous test, the PID controller had less error on the arrival velocity. Also, the variation between controllers was kept below 10%, which can be small enough to consider them all suitable.

Figure 4.2: Angular velocity on arrival for initial positions from 15 to 180 degrees, com-paring PID and LQR-PID without saturation

The arrival time for this test was around 177.5, with maximum 1.5ms variation, for all initial positions and all controllers. This means that it is possible to change initial position and only consider its affects on the angular velocity. In addition, we find that each π/12 rad (15 degrees) variation gets in average a 1.2rad/s difference on the angular velocity on arrival for the PID controller. The equation for estimating this parameter is:

ωa = 4.6θi, (4.2)

where θi is the ramp initial angular position in radians, ωa is in rad/s and ta = 0.1775s.

Therefore, all controllers managed to vary ωa based on the θi, which was the purpose

(37)

4.2. Voltage Saturation 37

4.2

Voltage Saturation

Figure 4.3 shows the arrival time comparison for the PID and LQR-PID with R=0.1 controllers. This test intended to analyze if the controllers would still be able to vary arrival parameters based on the ramp duration when there is a restricted scenario. The PID controller with a 5V saturation presents a slower behavior for ramps faster than 200ms, which is the opposite of what it was supposed to happen. In addition, the PID controller with a 20V saturation shows a similar behavior for ramps faster than 70ms. However, the LQR-PID controllers did not become slower for faster ramps for any of the saturations or durations tested.

Figure 4.3: Arrival time for 90 degrees reference, input ramp duration from 50ms to 200ms, comparing PID and R=0.1 with 5V, 20V and no saturation

This behavior is linked to saturations in the control signals, as shown in Figure 4.4. As it can be seen, the PID controllers are impacted more strongly by the saturations than the LQR-PID controllers.

Figure 4.5 shows the angular velocity on arrival behavior. It also highlights an ill-behavior of the PID controllers for short ramps. This means that even though PID has a better result without restrictions, it does not deal well with voltage saturations and that the angular velocity on arrival ωa cannot be put in a linear equation, as done previously.

(38)

4.2. Voltage Saturation 38

Figure 4.4: Control signals for the controllers with a 50ms reference ramp, comparing voltage saturation of 20V and 5V. The PID controllers clearly saturate, while the LQR-PID controllers do not.

ramp duration ∆r and ωa. Additionally, these results show that the LQR-PID controller

with a 5V saturation presents a better performance in this measure than the one with a 20V saturation.

Figure 4.5: Angular velocity on arrival for ramp durations from 50ms to 200ms, comparing PID and R=0.1 with 5V, 20V and no saturation

Such unexpected behavior can be explained by the angular velocity ω outputs viewed in Figure 4.6, which compare the LQR-PID behavior for voltage saturations of 20V and 5V. The arrival moment is indicated in the figure with a dot and (X, Y) axis values. They

(39)

4.3. Quantizer Resolution 39

show that these controllers start decreasing the motor velocity before impact. However, the control curve for the 5V LQR-PID controller follows a slower trajectory, and it has a longer time to control the velocity of arrival. This happens because this LQR-PID controller gives more weight to the variables’ states and less to the control signal.

Figure 4.6: Angular velocity signals for the state-space controllers with a 100ms reference ramp and for 5V and 20V saturations. The points in which the controller hits the zero position (drum impact) are marked in the figure.

In addition to the control results, we evaluated the current required by each controller in the worst-case scenario. The electric current signals for PID and state-space controllers with a fast ramp reference and voltage restrictions of 5V and 20V are shown in Figure 4.7. As it can be seen, the highest absolute value for the current is around 2.1 A.

These results indicate that the LQR-PID controller is more accurate for the control of robotic drummers than the PID controller. Also, they show that the saturation voltage has greater impacts on the PID controller than on the state-space controller. In addition, our simulations show that this control requires currents around 2.1A for a 20V saturation and 0.6A for 5V , which is in agreement with the USB 3.0 electric current restriction.

4.3

Quantizer Resolution

Figures 4.8 and 4.9 show the angular velocity ωa and time of arrival ta for PID and

(40)

4.3. Quantizer Resolution 40

Figure 4.7: Current required by each controller in the worst-case scenario of 50ms ramp reference.

still be able to maintain the expected arrival parameters when there is a restricted scenario. The variance in quantization steps showed that there is a threshold for the controller to keep its expected behavior. This can be found in both arrival parameters results.

Figure 4.8: Angular velocity on arrival for quantization resolutions from 0.05 to 18 degrees, with ramp duration of 50ms, comparing PID and R=0.1 with 5V and 20V saturation

In the PID case, it is possible to see that after the 9 degrees step, the result changes. The 20V restriction gives a worse result, whereas the 5V restriction seems to be less influenced by the encoder resolution. This can be further analyzed, but it is not relevant for the current discussion.

(41)

4.3. Quantizer Resolution 41

Figure 4.9: Arrival time for quantization resolutions from 0.05 to 18 degrees, with ramp duration of 50ms, comparing PID and R=0.1 with 5V and 20V saturation

As for LQR-PID controller, the increase on the quantization step did not affect the arrival time. However, a few intermediate steps gave an unexpected behaviour on the angular velocity with 20V restriction. One reason for this can be the calculation un-certainties. This is because the angular velocity is being derived from the quantized angular position and then passed through a moving average filter. Therefore, changes on the quantization step can cause small changes on the curve behaviour and explain the floating variation on Figure 4.8.

One more thing to highlight is that the LQR-PID needed the filter in order to give an acceptable result, because without it the deriving of quantized position had to much noise and with an amplitude many times larger than the actual value.

In addition, it is important to take into account that these results were calculated using an initial position of 90 degrees. The 36 degrees step was dismissed from these figures because it gave no result since it is not a divisor of the initial position. However, the 36 degrees value and other steps like 3.6 degree might be interesting to evaluate as well. In order to do that, it is important to consider an initial position that can be divided by all the steps.

(42)

4.4. Kalman Estimator 42

4.4

Kalman Estimator

The first part of this test consisted in choosing the desired values of RK and QK.

Therefore, Figure 4.10 shows the result of angular velocity on arrival ωa for different

combinations of the Kalman parameters. The values tested had a maximum value of 50% noise for the measurement signal and 4% for process noise. Note that the result varied less than 1% of the average for all values. In addition, the arrival time was the same for all values of RK and QK tested. Even knowing that all these values seemed suitable, we

chose to use RK = 0.1 and QK = 0.02, which is where ωa presented the highest value.

Figure 4.10: Angular velocity on arrival for QK from 0.005 to 0.04, comparing RK from 0.1 to 0.5. The quantization resolution was 18 degrees, with ramp duration of 50ms and 20V saturation

Figures 4.11 and 4.12 show the result for the angular velocity ωa and time of arrival ta

on the quantization tests. They compare the PID, LQR-PID and LQR-PID with Kalman estimation controllers. For this, a 20V saturation was chosen, in order to keep a restrict scenario but one where the PID is not too affect. In compliance to that, a ramp duration of 50ms was chosen.

This test intended to find where the LQR-PID with Kalman controller stands in com-parison to the others, analyzing if this is a good option for testing the LQR feedback influence on experimental results. With that in mind, note that it got a better result than

(43)

4.4. Kalman Estimator 43

Figure 4.11: Angular velocity on arrival for quantization resolution from 0.05 to 18 degrees, with ramp duration of 50ms, comparing PID and LQR-PID with and without Kalman for 20V saturation

Figure 4.12: Arrival time for quantization resolution of 18 degrees, with ramp duration of 50ms, comparing PID and LQR-PID with and without Kalman for 20V saturation

PID on this restricted scenario, which is what it was expected from adding LQR control signal. It did not get the same result as LQR-PID controller and this can be partially explained by remembering that LQR-PID is using a moving average filter and therefore having a better result for ωa than when there is no quantization. However, we do not

(44)

4.4. Kalman Estimator 44

One more thing that has to be notified is that Kalman expects measurement and process noise, which are not included in this simulation. This might also help explain the result difference for LQR-PID. Still, the arrival time ta is better for LQR-PID without

Kalman than with the parameter estimation. Since we will use Kalman estimation for experimental results analysis, this has to be taken into account as well.

In addition to these comparison, the angular position θ behavior was analyzed for LQR-PID controller with and without Kalman estimation adding a white noise generator. A quantization step of 18 degrees was considered, which is where the Figures 4.11 and 4.12 implied that the Kalman estimation result was affected by quantization.

Figure 4.13: Angular position over time for quantization step of 18 degrees, with ramp duration of 50ms, 20V saturation and white noise, comparing LQR-PID controller with R=0.1 with and without estimating the states via Kalman

The result shows that Kalman estimation seems to give the same result for arrival parameters as the PID-LQR that uses states measurements. This means that in the practical experiment, where we expect to find noise, the LQR-PID feedback can be inferred from LQR-PID with Kalman controller. Another observation is that the behavior of the angular position with Kalman seems to be deal better with the noise than the other controller, having less overshoot and faster stabilization.

(45)

4.5. Experimental Results 45

4.5

Experimental Results

This test intends to validate the simulation results we got so far. Even though prac-tical experiments tend to have a different outcome, is the comparison premises between controllers still valid in practice? Is it possible to relate initial position and ramp duration to arrival parameters? Does LQR-PID with Kalman has a better result than PID solo? Does the 5V saturation affects more the PID controller than the others?

In order to do this experiment, it was important to re-do the whole parameter esti-mation process. This is because the mechanic structure, motor and sensors have changed since the first estimation. In addition, the drumstick might have changed position or direction and therefore is important that the experiment is directly related to the mo-tor model estimation. From this, first we got the momo-tor parameters: there were two tests to measure Rm, L, b and κ, and then J was estimated using Matlab. From that,

we got the state-space representation, which was used to calculated LQR gains, Kalman representation of the discrete system and PID tuning parameters for the two controllers implemented. The controllers equations were implemented on a microcontroller and the acquisition period was set at 10ms.

Figures 4.14a to 4.14d show the angular position θ for PID and LQR-PID with Kalman estimation and R=0.1 controllers. The time of arrival ta can be inferred from the mark

where the curves reach the top axis of the figures (θ = 1.5708rad).

Note that the PID controller is slower for the 50ms ramp in comparison to the 100ms, which is a behavior predicted on the simulation tests. Here, it happened for both 5V and 10V saturations. This means that the controller could not get a linear relation between arrival parameters ωa and ta to the ramp duration ∆r, or even a direct proportionality

for the time of arrival. The controller might still get the desired performance when more voltage is provided or when the ramps are slower, as shown on simulation results.

The LQR-PID controller with R=0.1 and Kalman estimation also presented a strange behavior for the 50ms duration ramp, where the 5V restriction seemed to have a faster result than 10V . This did not happen with the 100ms duration ramp and, even so, it was a small difference between them. The PID controller showed a faster result than

(46)

4.5. Experimental Results 46

(a) 50ms ramp 5V saturation (b) 50ms ramp 10V saturation

(c) 100ms ramp 5V saturation (d) 100ms ramp 10V saturation

Figure 4.14: Simulation vs Experimental results

LQR-PID when the voltage restriction is loosened and the opposite when there was 5V saturation, which is also a validation of the simulation results.

These experiments show that PID is more affected by physical limitations than the LQR-PID controller. However, in practice, the LQR-PID controller loses performances.

Another note is that all results were faster or at least equal to the simulated curve presented here, which can mean that the model parameters are not completely correct. This can be affecting the LQR feedback and Kalman estimation, which might explain the difference from the expected results to the ones found. One argument to corroborate that is that the estimated parameter J is directly related to how fast the system behaves, meaning that a small variation in J might make a lot of difference in the expected curve. This could be further analyzed by comparing different methods of finding the value of the inertia J .

(47)

47

Chapter

5

Conclusion and Future Work

This work presented the comparison between PID and LQR-PID feedback to control a robotic percussionist. The results show that both controllers fit the purpose of controlling arrival time and velocity, but the LQR-PID controller is more resilient to control voltage saturation and worse encoder resolutions. This is important because in practice physical limitations are inevitable. However, the LQR-PID controller implementation requires additional hardware and a more complicated software.

Both control systems had a minimum trajectory time of 117 ms for the first model simulation and 300 ms for the motor experiment in practice. This considered an adjust of 90 degrees initial position, or around 30cm, which is the distance from the end of the drumstick to the rotation axis. The robotic percussive actuators mentioned in the Introduction section (Long et al. 2015, Rooyen et al. 2017, Murphy et al. 2012) got 85ms for 19cm distance, 82ms for 19cm distance and 41ms for 2cm distance, respectively. These were the highest heights tested. By adjusting the height, the best results were 12ms for 0.4cm distance, 10ms for 0.4cm distance, 29ms for 1cm distance, respectively. The human latency for encoding noise bursts go up to 0.8ms, a scale of 1ms, depending on age (Parbery-Clark, Anderson, Hittner & Kraus 2012).

By comparison, our resulting arrival times (which include latencies) can be too slow for musical applications. However, they can be reduced by using a stronger motor, a stronger power source and adjusting the initial position. Although changing the motor can lead to changes in the controller parameters, they can be re-estimated using the procedures

(48)

CHAPTER 5. CONCLUSION AND FUTURE WORK 48

shown in this project.

The experiment results from this project explain the advantages of each controller for this application and the methods used to find the limitations of the system. For instance, the first two tests are used to relate the desired angular velocity and time of arrival to the ramp duration and initial position.

The following test presents the electric current requirements for each voltage input chosen, and the limitations of the PID controller. The third test provide the threshold for the minimum encoder resolution, and show that LQR-PID requires filtering to get the angular velocity measurement. The next test analyzes the influence of estimating motor parameters via Kalman instead of measuring them and adding a filter to the angular velocity signal.

The final test provided practical results in order to compare and validate the simulation conclusions. It showed that the PID controller is more affected by system limitations and the LQR-PID controller is fit to relate the ramp duration to the angular velocity and time of arrival. Taking all results into account, choosing the controller that fits best the instrument purpose implies on hardware and software changes.

Future Work

• Different methods of estimating the inertia J can be analyzed in order to get a more precise model of the system.

• Base the tests and desired arrival times on a smaller initial position, in order to get more competitive latency values for musical application.

• These results do not involve using a model for the instrument membrane nor post impact management. All of these aspects are interesting venues for future work.

• The comparison with a stronger motor can show its influence on arrival parameters, in a way that might be useful depending on the instrument it is attached to.

• Test if other mechanical mechanisms to attach the drumstick can improve the model precision and the control performance, such as rack and pinion.

(49)

CHAPTER 5. CONCLUSION AND FUTURE WORK 49

• More robust controllers can be implemented and compared as well, for example optimal control.

• Adding more feedback variables to control can improve performance, such as mea-suring loudness and drumstick strength of impact.

• Changing the hardware (encoder, electric board) also might influence the system performance.

Submissions

Article submitted to the Simp´osio Brasileiro de Automa¸c˜ao Inteligente (SBAI) 2019, rejected for being out of scope. The comments gave an insight on what to change for future submissions.

(50)

50

Bibliography

Astrom, K. J. & Murray, R. M. (2008). Feedback Systems: An Introduction for Scientists and Engineers, Princeton University Press, Princeton, NJ, USA.

Franklin, G. F., Powell, D. J. & Emami-Naeini, A. (2001). Feedback Control of Dynamic Systems, 4th edn, Prentice Hall PTR, Upper Saddle River, NJ, USA.

Geromel, J. C. & Palhares, A. G. B. (2004). An´alise Linear de Sistemas Dinˆamicos: Teoria, Ensaios Pr´aticos e Exerc´ıcios, Editora Edgard Blucher Ltda.

Geromel, J. & Korogui, R. (2011). Controle Linear De Sistemas Dinamicos: TEORIA, ENSAIOS PRATICOS E EXERCICIOS, EDGARD BLUCHER.

Hoffman, G. & Weinberg, G. (2010). Gesture-based human-robot jazz improvisation, 2010 IEEE International Conference on Robotics and Automation, pp. 582–587.

Hyde, W. W. (1938). The recent discovery of an inscribed water-organ at budapest, Transactions and Proceedings of the American Philological Association 69: 392–410.

Kapur, A. (2005). A history of robotic musical instruments, ICMC.

Kapur, A., Essl, G., Davidson, P. & Cook, P. (2002). The electronic tabla controller, Vol. 32, pp. 77–81.

Long, J., Kapur, A. & Carnegie, D. A. (2016). The closed-loop robotic glockenspiel : Improving musical robots using embedded musical information retrieval.

(51)

BIBLIOGRAPHY 51

Long, J., Murphy, J., Carnegie, D. A. & Kapur, A. (2017). A closed-loop control system for robotic hi-hats, Proceedings of the International Conference on New Interfaces for Musical Expression, Aalborg University Copenhagen, Copenhagen, Denmark, pp. 330–335.

Long, J., Murphy, J., Kapur, A. & Carnegie, D. (2015). A methodology for evaluating robotic striking mechanisms for musical contexts, in E. Berdahl & J. Allison (eds), Proceedings of the International Conference on New Interfaces for Musical Expres-sion, Louisiana State University, Baton Rouge, Louisiana, USA, pp. 404–407.

Masuda, H., Kato, T., Kawashima, K. & Kagawa, T. (2012). Development of a recorder-playing robot using unsteady flow rate control technique, 2012 Proceedings of SICE Annual Conference (SICE), pp. 1319–1324.

MATLAB (2018a). Control System Toolbox, The MathWorks Inc., Natick, MA.

MATLAB (2018b). System Identification Toolbox, The MathWorks Inc., Natick, MA.

Murphy, J., Kapur, A. & Carnegie, D. (2012). Better drumming through calibration: Techniques for pre-performance robotic percussion optimization, Proceedings of the International Conference on New Interfaces for Musical Expression, University of Michigan, Ann Arbor, Michigan.

Nadarajan, G. (2007). Islamic automation: A reading of al-jazari’s the book of knowledge of ingenious mechanical devices (1206), Media Art Histories, MIT Press pp. 163–178.

Ogata, K. (2001). Modern Control Engineering, 4th edn, Prentice Hall PTR, Upper Saddle River, NJ, USA.

Parbery-Clark, A., Anderson, S., Hittner, E. & Kraus, N. (2012). Musical experience offsets age-related delays in neural timing, Neurobiol Aging.

Roads, C. (1986). The tsukuba musical robot, Computer Music Journal, MIT Press 10: 39–43.

(52)

BIBLIOGRAPHY 52

Rooyen, R. V., Schloss, A. & Tzanetakis, G. (2017). Voice coil actuators for percussion robotics, Proceedings of the International Conference on New Interfaces for Musical Expression, Aalborg University Copenhagen, Copenhagen, Denmark, pp. 1–6.

Simulink (2018). Control Design Toolbox, The MathWorks Inc., Natick, MA.

Solis, J., Petersen, K., Yamamoto, T., Takeuchi, M., Ishikawa, S., Takanishi, A. & Hashimoto, K. (2010). Mechanism design and air pressure control system improve-ments of the waseda saxophonist robot, 2010 IEEE International Conference on Robotics and Automation, pp. 42–47.

Vindriis, R. G., Carnegie, D. A. & Kapur, A. (2011). A comparison of pick-based strategies for robotic bass playing, Proceedings of the 2011 Electronics New Zealand Conference.

Weinberg, G., Driscoll, S. & Parry, M. (2005). Musical interactions with a perceptual robotic percussionist, ROMAN 2005. IEEE International Workshop on Robot and Human Interactive Communication, 2005., pp. 456–461.

Welch, G. & Bishop, G. (2001). An Introduction to the Kalman Filter, University of North Carolina at Chapel Hill Department of Computer Science.

Referências

Documentos relacionados

found that there was a direct, negative effect of self-reported impulsivity on baseline BMI indicating that those individuals with higher levels of impulsivity had lower BMI,

Fazendo um breve resumo de cada capítulo, começamos por referir que no primeiro, intitulado Geometria e Medida, são abordados, de acordo com as Metas Curriculares

This work was thus focused on a preliminary screening of domi- nant pure strains of lactic acid bacteria and coliforms isolated from traditional Serra cheese in terms of their

Integument reddish-brown; pronotum with an elliptical discal dark spot; pubescence unicolor, yellowish; lateral margins of pronotum straight from apex of hind

3.5 CONCLUSÃO Os resultados deste estudo revelaram que: i O fator mão de execução apresenta diferenças estatisticamente significativas em todas as tarefas ou aponta

Observa-se, assim, que esses processos de elaboração edital, de recebimento e avaliação poderiam ser tratados como um projeto para cada edital através de uma estrutura

As doenças mais frequentes com localização na cabeça dos coelhos são a doença dentária adquirida, os abcessos dentários mandibulares ou maxilares, a otite interna e o empiema da

O ponto de partida no desenvolvimento da ontologia consistiu na busca da informação necessária para dar resposta às inevitáveis questões sobre o domínio e