KTH ROYAL INSTITUTE OF TECHNOLOGY INDUSTRIAL TECHNOLOGY AND MANAGEMENT

DEGREE PROJECT, IN ENGINEERING MECHANICS , FIRST LEVEL STOCKHOLM, SWEDEN 2015 Spinning LED Figure RESOLUTION OF A PROJECTED 3D IMAGE PETER FJELLANDER...
Author: Evelyn Holland
2 downloads 0 Views 4MB Size
DEGREE PROJECT, IN ENGINEERING MECHANICS , FIRST LEVEL STOCKHOLM, SWEDEN 2015

Spinning LED Figure RESOLUTION OF A PROJECTED 3D IMAGE PETER FJELLANDER, SIMON GÄRTNER

KTH ROYAL INSTITUTE OF TECHNOLOGY INDUSTRIAL TECHNOLOGY AND MANAGEMENT

Spinning LED figure

Resolution of projecting a 3D image

PETER FJELLANDER SIMON GÄRTNER

Bachelor’s Thesis in Mechatronics Supervisor: Examiner: Approved:

Baha Alhaj Hasan Martin Edin Grimheden 2015-05-20

TRITA MMK 2015:7 MDAB060

Abstract The thesis is a study about pixel density of a 3D projection, projected by a spinning ring with LED attached to its surface and which parameters impact the pixel density. A theory of when and how the 3D projection occurs was developed. The theory is based on the works of Max Wertheimer in 1912 on the subject of Φ-movement. A demonstrator is built to prove that the concept works in reality. The demonstrator and the theory is then evaluated and the results showed that to to get the highest pixel density, the number of LED configurations should be increased and the RPM of the ring decreased. The number of LED:s is a scaler factor to increase the pixel density but compromises the systems stability margins.

iii

Sammanfattning Snurrande LED-figur Rapporten behandlar en studie av pixeltätheten hos en tredimensionell projektion och vilka parametrar som påverkar pixeltätheten. Projektionen projiceras av en snurrande ring med lysdioder fästa på ytan. En teori om när och hur den tredimensionella projektionen uppstår utvecklades. Teorin är baserad på arbete gjort av Max Wertheimer år 1912 på ämnet Φ-rörelse. En demonstrator byggdes för att bevisa att konceptet fungerar i verkligheten. Demonstratorn och teorin utvärderades och resultaten visade att för att få den största pixeltätheten, ska varvtalet minska och antal LED konfigurationer ska öka. Antalet LED:ar är en skalär faktor som ökar pixeltätheten men minskar systemets stabilitets marginaler.

v

Preface We would like to thank our supervisor, Baha Alhaj Hasan, for constant feedback and support, Tomas Österås for all the help with manufacturing the mechanical parts of the system, Staffan Qvarnström and Sebastian Quiroga for support and guidance.

Peter Fjellander & Simon Gärtner Stockholm, may, 2015

vii

Contents Abstract

iii

Sammanfattning

v

Preface

vii

Contents

ix

Nomenclature

xi

1 Introduction 1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Purpose and scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 1 1 2

2 Theory 2.1 Phi movement . . . . . . 2.2 Pixel density . . . . . . 2.3 Angular Segment Time . 2.4 Driver Cycle Time . . . 2.5 Modelling the DC motor

. . . . .

3 3 3 4 5 5

. . . . . . . . . . .

9 9 10 10 11 11 11 12 14 14 14 14

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

3 Demonstrator 3.1 Problem Formulation . . . . . . . . . . . . 3.2 Hardware . . . . . . . . . . . . . . . . . . 3.2.1 Support Frame and Ring . . . . . 3.2.2 Power Supply and Power Transfer 3.3 Electronics . . . . . . . . . . . . . . . . . 3.3.1 Microcontroller Arduino UNO . . 3.3.2 TLC5940 LED Drivers . . . . . . . 3.3.3 IR link . . . . . . . . . . . . . . . . 3.3.4 GR42x25 DC Motor . . . . . . . . 3.3.5 H-bridge . . . . . . . . . . . . . . . 3.4 Software . . . . . . . . . . . . . . . . . . . ix

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . .

. . . . . . . . . . .

. . . . . . . .

14 16 16 17 19 20 20 20

4 Calculations 4.1 PPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

21 21

5 Results

23

6 Discussion and conclusions 6.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25 25 25

7 Recommendations and future work

27

Bibliography

29

3.5

3.6

3.4.1 Motor Program . . . . . . . . . . . . 3.4.2 LED Program . . . . . . . . . . . . . Motor Control . . . . . . . . . . . . . . . . 3.5.1 Designing a PI controller . . . . . . 3.5.2 Control signal in a digital controller System Interaction . . . . . . . . . . . . . . 3.6.1 Rotation System . . . . . . . . . . . 3.6.2 LED System . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

Appendices A Additional information A.1 Circuit Boards . . . . . . A.2 Matlab Code . . . . . . . A.2.1 PID calculations . A.2.2 Motor model . . . A.2.3 PPI calculations . A.2.4 PPI measurements

. . . . . .

. . . . . .

. . . . . .

. . . . . .

x

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

31 31 32 32 33 33 35

Nomenclature Symbols Symbols

Description

ω n d τ

Angular velocity (rad/s) Number of revolutions (RPM) Diameter (m) Time (s)

Abbreviations Abbreviation Description PWM CAD RPM RGB LED PCB EEPROM PPI DCT AST GND TTL IR

Pulse Width Modulation Computer Aided Design Rotations Per Minute Red Green Blue Light Emitting Diode Printed Circuit Board Electrically Erasable Programmable Read-Only Memory Pixels Per Inch Driver Cycle Time Angular Segment Time Electrical Ground Transistor-Transistor Logic Infra red

xi

Chapter 1

Introduction This chapter is an introduction to the project. It addresses both background for the project and the method how the project was carried out.

1.1

Background

Flipbooks, [Jason Miers, 2006], is a common toy used in elementary school to demonstrate how the first cartoon movies used to be made. By flipping still images fast enough, objects in the picture appears to move. The thesis takes a scientific approach to extending the idea into the third dimension, projecting a 3D-image of still images.

1.2

Purpose and scope

The project will use a number of RGB LED:s attached in a circular segment, to a spinning ring, turning on and off in different configurations, to project a 3D-image. What the thesis will cover is the relationship between the pixel density in a projected image and the RPM of the ring. The purpose with the thesis (as partly mentioned in 1.1 Background) is to determine how various parameters of the spinning ring determines the pixel density of the projected image. Some questions that will be discussed are: • How does the RPM of the ring affect the pixel density? • How does the number of RGB LED affect the pixel density? • How does the angle between the different configurations affect pixel density? There is a large amount of components and technical solutions that could be used. Therefore a certain fixed parameters will be used in the project: • The project will use two Arduino UNO microcontroller • The projection will only be projected around one rotation axis. 1

CHAPTER 1. INTRODUCTION

• The project will use 32 RGB LED to project the image. • The demonstrator will use PWM signals to lit the RGB LED:s. • The maximum RPM will not exceed 2500 RPM.

1.3

Method

The project use theory to define and prove the minimum RPM of a rotating ring with a defined number of RGB LED:s to produce the 3D effect. A general module to calculate maximum Pixel Per Inch (PPI) for the projected 3D image, is determined. A prototype is built to prove that the concept works in practice. Two systems is incorporated, one LED control system and one motor control system, to simplify the overall system. The motor control system is modulated with Matlab [MathWorks, 2015] to be able to predict and control the motor performance. Critical parameters for the LED system is decided (see Angular Segment Time 2.3 and Driver Cycle Time 2.4) and limitations of the LED system is evaluated. The performance of the overall system is first measured by conducting a series of experiments with the demonstrator. Using a camera and a test schedule, pictures of the projection was taken at certain sets of RPM and with different number of RGB LED configurations. The demonstrator is set to fire one LED configuration with full power, with a single color switching between red, green and blue. The setup for the experiments is presented in figure 1.1.

100 mm

500 mm

Figure 1.1: The set up for the experiments

Three pictures of each data point was taken. The pictures was then used to measure the distance between each pixel with an image processing software and the average pixel density of each set of pictures is calculated. The measurements are then repaeted for each data point. The results are presented in chapter 5.

2

Chapter 2

Theory This chapter describes the theory of the project. It includes all the theoretical background and definitions needed to implement the project.

2.1

Phi movement

The illusion the beholder experiences when the pages of the flipbook flips and the images switches rapid, is called Φ movement. First discovered by Max Wertheimer in 1912, Φ movement (or as Wertheimer called it "pure" movement) was discovered experimentally. Test subjects were shown two pictures, the first picture with line a and the second picture with line b, where line a was twice as long as line b. The test subject were shown line a and then line b with the time interval τΦ . When τΦ > 200 ms, the two lines a and b were perceived separated. But when τΦ decreased, the test subjects reported that they perceived one picture of several lines, varying in length from line a to line b. Wertheimer reported that if τΦ was lower then 30 ms, the two pictures were perceived as one. Φ movement is the illusion of motion when switching between still images, appearing when 30 ms < τΦ < 200 ms [Steinman et al., 2000].

2.2

Pixel density

Pixel density is measured in Pixels Per Inch (here on referred to as PPI) and is a measurement of picture resolution in either one or two dimensions. To calculate the PPI in two dimensions, the following equation is used √

dp =

wp2 + h2p

(2.1)

Where dp is the diagonal resolution, wp the horizontal resolution and hp the vertical resolution as shown in figure 2.1.

3

CHAPTER 2. THEORY

m,n n,1 dp wd ... 2,1 1,1

1,2

...

hd

1,m

Figure 2.1: Pixel projection with [n, m] pixels.

Combining equation 2.1 and figure 2.1, PPI is calculated as PPI =

dp di

(2.2)

where di is the diagonal length of the projected surface in inches. [Christensen et al., 2009]

2.3

Angular Segment Time

As the spinning ring is rotating along its own axis, there will be a certain time window to "fire" the RGB LED configuration before the next RGB LED configuration needs to be "fired". The time it takes to rotate the angle between each configuration is called angular segment time (here on referred to as AST).

AST

l r

n

a

(a) AST in relation to n RPM

(b) Geometrics

Figure 2.2: Circular geometrics

4

2.4. DRIVER CYCLE TIME

AST depends on the angle segment length, see figure 2.2, which is calculated as l=

α 2πr 360

(2.3)

where α is the angle of the segment and r is the radius of the circle. As the motor spins with n RPM, the AST is calculated as α ω

(2.4)

2π 60

(2.5)

AST = where ω is described as ω=n

2.4

Driver Cycle Time

The driver cycle time (here on referred to as DCT) is the amount of time the LED Drivers [Texas Instruments Incorporated, 2004](see section 3.3.2) requires to read data from the Arduino UNO (see section 3.3.1) for one configuration of the RGB LED:s, store it internally and output it to the RGB LED:s. This time is calculated by DCT = τdriver + τmicrocontroller

(2.6)

where τdriver is the time it takes for one LED driver to read the data from the microcontroller, store it internally and output it to the RGB LED:s, calculated by τdriver =



τdelays,i

(2.7)

where τdelays,i is the internal delays of the LED Drivers (see section 3.3.2). τmicrocontroller is the time it takes for the Arduino UNO to clock in data to the external drivers and is calculated by τmicrocontroller =



τdelays,j

(2.8)

where τdelays,j , is the time it takes for the microcontroller to set pins high or low and output a PWM signal. To get the most accurate DCT, the project measures the DCT experimentally.

2.5

Modelling the DC motor

To be able to control the RPM of the ring, a digital implemented PI-controller is used to control the DC motor. Classic control theory is used to decide a transfer function for the motor and controller.

5

CHAPTER 2. THEORY

The physics of a DC motor, when feed a voltage V , is given by figure 2.3

IR V

L

dI dt

t

E M

fw,Jw Ms

Figure 2.3: Loads affecting motor performance when fed a voltage V

where E is the induced voltage from the spinning motor, J is the moment of inertia, V is the voltage provided, ω is the rotation speed of the motor shaft, R is the motor internal resistance, L is the motor internal inductance, τ is the provided torque from the motor onto the shaft , Ms is the static friction caused by the motor shaft and load and f is a viscosity friction factor. With the load given in figure 2.3, the load the DC motor needs to rotate is given by J ω˙ = τ − f ω − Ms

(2.9)

where τ is given by equation 2.10 τ = Ke I

(2.10)

where Ke is the motor constant for induced voltage and where I is the induced current. With Kirchoffs law [Johansson, 2013] and figure 2.3, the equation for the voltage in the DC motor is given as V =L

dI + RI + E dt

(2.11)

where E is given by equation 2.12 E = Ke ω

(2.12)

By simplifying equation 2.11 with L ≈ 0 in small DC motors, eliminating I with equation 2.9, equation 2.10 and equation 2.11, the system is described as K KI Ke V − ω − f ω − Ms (2.13) R R Applying LaPlace transformation [Råde and Westergren, 2003] to equation 2.13 the tranfer function of the system, with voltage V as input signal and rotation speed ω as output signal, is given as J ω˙ =

6

2.5. MODELLING THE DC MOTOR

G(s) =

KI − Ms R Js + f + KIRKe

(2.14)

which gives the open loop system, shown in figure 2.4 where the disturbance v is υ ωref



G

ω

Figure 2.4: The plant G(s) with the disturbance v, when fed a voltage V

given by 1 v = Acd ω 2 (2.15) 2 where A is the area of the PCB inside the ring and cd is a drag coefficient determined by the characteristics of the air flow, roughness of the surface and the geometry of the surface [Nakayama and Boucher, 1999]. cd is often determined though testing on the surface and since v is described with equation 2.15, which is a non-linear differential equation, this problem can not be solved using classic control theory. The problem is simplified by adding v as a disturbance and the stability margins are increased to ensure stability.

7

Chapter 3

Demonstrator This chapter describes the finished demonstrator. It addresses all the hardware, electronics and software used in the project.

3.1

Problem Formulation

To be able to project the image, the demonstrator needs to solve several problems. • The Arduino UNO has a limited amount of flash memory and the RGB LED:s configurations require more memory than the Arduino UNO can provide. • The Arduino UNO has only 6 pins that can produce a PWM signal, but the demonstrator needs 96 different individual PWM signals to take advantage of the full spectrum of the RGB LED:s. • The time to output a LED configuration needs to be smaller than the time to rotate the angle between every two configurations. • The LED:s should never dim. • The ring needs to spin fast enough so that AST is smaller than τΦ , see section 2.3 and section 2.1. • The Arduino UNO needs to know the position of the ring at any given time to fire the correct RGB LED configuration. • The support structure of the demonstrator needs to handle the vibration caused by the spinning ring

9

CHAPTER 3. DEMONSTRATOR

3.2

Hardware

The demonstrator consists of a support frame, a ring, a power supply unit, a bearing and a motor (see section 3.3.4) as displayed in figure 3.1.

Figure 3.1: Overview of the Demonstrator

3.2.1

Support Frame and Ring

The purpose of the support frame is to mount and stabilize the axis and the ring. The support frame is directly mounted on the display table and made out of aluminium. To damp the vibration generated by the spinning ring, rubber feet were added to the table. The motor axis is fixed with a ball bearing to minimize friction. The radius (r) of the circle is decided 100 mm.

(a) Support frame

(b) The ring with mounted LED:s

Figure 3.2: Mechanical Design of the Support Frame and Ring

10

3.3. ELECTRONICS

3.2.2

Power Supply and Power Transfer

To supply the electronics inside the ring with power, a slip ring is used. A slip ring is an electromechanics device that allows the transmission of power from a stationary system to a rotating one.

(a) Overview of the Slip Ring

(b) Exploded view of the Slip Ring

Figure 3.3: Mechanical Design of the Slip ring The slip ring consist of conductive and insulating parts, as shown in picture 3.3b. The conductive rings are connected to GND and VCC on the mounted PCB. Power is distributed via two flat irons as shown in figure 3.4.

Figure 3.4: Power Transfer to the Slip Ring

The flat irons are themselves connected to GND and VCC from a power supply and provides power to the electronics inside the ring.

3.3 3.3.1

Electronics Microcontroller Arduino UNO

Arduino UNO is a microcontroller board based on the ATmega328 [Atmel, 2009]. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, an USB connection, a power jack, an 11

FEATURES

APPLICATIONS

1

• Monocolor, Multicolor, Full-Color LED Displays • 16 Channels • LED Signboards • 12 bit (4096 Steps) Grayscale PWM Control • Display Backlighting • Dot Correction • General, High-Current LED Drive – 6 bit (64 Steps) – Storable in Integrated EEPROM DESCRIPTION CHAPTER 3. DEMONSTRATOR • Drive Capability (Constant-Current Sink) The TLC5940 is a 16-channel, constant-current sink – 0 mA to 60 mA (VCC < 3.6 V) LED driver. Each channel has an individually – 0 mA ICSP to 120header, mA (VCC > 3.6 V) button. The boardadjustable and a reset runs on C/C++ code and uses itsPWM own brightness 4096-step grayscale control and a 64-step, constant-current sink (dot compiler 2010]. • LED Power Supply[Arduino, Voltage up to 17 V correction). The dot correction adjusts the brightness • VCC = 3 V to 5.5 V variations between LED channels and other LED • Serial Data Interface 3.3.2 TLC5940 LED Drivers drivers. The dot correction data is stored in an integrated EEPROM. Both grayscale control and dot • Controlled In-Rush Current To increase the number of PWM output pins from the correction are Microcontroller accessible via aArduino serial interface. A • 30MHz Data Transfer Rate single external resistor sets maximum current UNO, 6 TLC5940 LED Drivers [Texas Instruments Incorporated, 2004]the (here on • CMOS Level I/O all 16 channels. referred to as LED Driver) are used. Thevalue LEDof Driver has 16 channels, every • Error Information channel has a 64-step constant current sinkThe andTLC5940 4096-step grayscale signal features two PWM error information circuits. – LOD: at LED The shift LED register open detection (LOD) indicates 30Open MHz.Detection The LED Driver uses an internal and serial data input a broken or disconnected LED at an output 3.5, terminal. – TEF: Thermal Error Flag to store what duty cycle each channel should output. As seen in figure each The thermal error flag (TEF) indicates an overtemperature channel is connected to the internal shift register. The LED drivers uses key pins condition. 2

VCC

GND

SCLK

SIN

XLAT VPRG

IREF

Max. OUTn Current

VREF =1.24 V

CNT 1 0

VPRG 1

DCPRG

GS Register

0

0

DCPRG 1

0 GSCLK BLANK

DC Register

0 GS Counter

CNT

5

LED Open Detection

CNT 192

12−Bit Grayscale PWM Control

GS Register 12 23 DCPRG 1

96 95 1 0 VPRG

96

6 DC EEPROM11

Temperature Error Flag (TEF)

0

Constant Current Driver

OUT1

Delay x1

LED Open Detection

VPRG

CNT

Blank 1

6−Bit Dot Correction

DC Register 11 0

6

96

LED Open Detection (LOD)

OUT0

Delay x0

VPRG

96 192

Constant Current Driver

6−Bit Dot Correction

0

0 DC EEPROM 5 Input Shift Register

Status 0 Information: LOD, TED, DC DATA 191

12−Bit Grayscale PWM Control

11

Input Shift Register

12−Bit Grayscale PWM Control

GS Register 180 191 DCPRG 1

XERR 90 191 90

DC Register 95 0

DC EEPROM 95

Constant Current Driver

OUT15

Delay x15

6−Bit Dot Correction

LED Open Detection

VPRG

SOUT

Figure 3.5: Internal Logic for the LED Driver

1

2

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of an internal clockproducts to beand able to "clock in"appears the right PWM to the right Texas and Instruments semiconductor disclaimers thereto at the end of thissignal data sheet. PowerPAD is a channel. trademark of Texas Instruments.

PRODUCTION DATA information is current as of publication date. Products conform to specifications per the terms of the Texas Instruments standard warranty. Production processing does not necessarily include testing of all parameters.

• SIN: Serial data input, data that is clocked in.

Copyright © 2004–2007, Texas Instruments Incorporated

• SOUT: Serial data output, clocked out data. • XLAT: The latch pin, on its rising edge, tells the LED Driver to output the clocked in PWM signal to each channel. • SCLK pin: Serial clock pin, on its rising edge data from the SIN pin is stored in the internal shift register. 12

VCC

IREF

DCPRG

29

28

27

26

25

Thermal PAD

NC

30

28 27 26 25 24 23 22 21 20 19 18 17 16 15

NC

31

21

OUT15

DEVICE INFORMATION

SOUT XERR

VCC IREF DCPRG GSCLK SOUT XERR OUT15 OUT14 OUT13 OUT12 OUT11 OUT10 OUT9 OUT8

OUT0 4

23 22

RHB PACKAGE (TOP VIEW)

THERMAL PAD

VPRG 3

PWP PACKAGE (TOP VIEW)

1 2 3 4 5 6 7 8 9 10 11 12 13 14

GND

32

24 GSCLK 3.3. ELECTRONICS

SIN 2

0

DECEMBER 2004 – REVISED OCTOBER 2007

GND BLANK XLAT SCLK SIN VPRG OUT0 OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7

XLAT

BLANK

NC − No internal connection

SCLK 1

20 OUT14 • BLANK pin: On its rising edge, resets the internal clock to 0.

OUT1 5 OUT2 6

19

OUT13

OUT4 8

OUT10

OUT9

OUT8

OUT7

OUT6

OUT5

OUT4

OUT3

OUT2

OUT1

11

10

9

8

7

6

5

4

3

2

1

16

17

18

19

20

21

22

23

24

25

26

27

28

OUT15

XERR

SOUT

GSCLK

DCPRG

IREF

VCC

GND

BLANK

XLAT

SCLK

SIN

VPRG

OUT0

www.ti.com

OUT11

12

15

NT PACKAGE (TOP VIEW)

OUT12

13

OUT10

14

OUT9

OUT13

16

OUT8

NC

15

OUT7

NC

12

OUT6

14

11

OUT5

13

9

10

OUT14

• GSCLK pin: Grayscale Clock Pin, converts, sync and store a incoming PWM 18 OUT12 17 OUT11 signal with the internal clock.

OUT3 7

Figure 3.6: The key pins for the TLC5940 to clock in a PWM signal.

By inputting a PWM signal with X% duty cycle to the GSCLK pin, the PWM signal converts it to match the internal clock and stored in one of the internal shift register. With the falling edge of the BLANK pin, described in figure 3.7, the internal clock starts counting, in 1-by-1 step, from 0 until 4096. When the the counter reaches the value that corresponds to the same duty cycle X% for the LED Driver, the signal is driven high and stored in first channels Grayscale register. When the clock reaches 4096 steps, the BLANK pin is driven high to reset the internal counter. If new data is clocked in, the old data is shifted into the second grayscale register and so on. When data is shifted out from the last channel, no. 15, the data is outputted to the SOUT pin. To output all the stored data in the grayscale registers, the XLAT Vcc Rising edge

Falling edge

V0

Figure 3.7: Rising and falling edge of a signal

pin is driven high. With its rising edge, the internal clock starts counting. When the clock is at the same duty cycle as any stored data in the grayscale registers, the output of that channel is driven high, simulating a PWM signal. If a duty cycle of 100% is, required, the SCLK pin is driven high. At its rising edge, data is clocked in to the internal shift register. The constant current sink prevents the current to drop by using an EEPROM in conjunction with two transistors, as seen in figure 3.8. By storing output data of every channel on a EEPROM and then syncing every channel’s EEPROM, the LED Driver can output a constant current from each 13

LED Open Detection VPRG

Input Shift Register

CNT

96

92

192 96 95 1 0 VPRG

12−Bit Grayscale PWM Control

GS Register 12 23

96 6

DCPRG 1 DC Register 11 0

6 DC EEPROM11 96

LED Open Detection

VPRG

OUT1

Delay x1

CHAPTER 3. DEMONSTRATOR

CNT

Blank 0

6−Bit Dot Correction

Constant Current Driver

Input Shift Register

12−Bit Grayscale PWM Control

GS Register 180 191 DCPRG 1 DC Register 90 95 0

191 90

DC EEPROM 95

Constant Current Driver

OUT15

Delay x15

6−Bit Dot Correction

LED Open Detection

VPRG

SOUT

Figure 3.8: Internal continious current circuit

channel. This prevents the LED:s to dim when several PWM signals are at a high mportant notice concerning availability, standard warranty, and use in critical applications of cycle at theatsame time. By connecting onductor products andpercentage disclaimersduty thereto appears the end of this data sheet. a single external resistor the maximum output current is set. [Texas Instruments Incorporated, 2004] s Instruments.

s of publication date. terms of the Texas processing does not

3.3.3

IR link

Copyright © 2004–2007, Texas Instruments Incorporated

The IR link consists of one emitter [OSRAM semiconductors, 2014b] and one sensor [OSRAM semiconductors, 2014a]. To avoid being blinded by sunlight and background noise, both the emitter and sensor complies with the NEC protocol (National Electricical Code), which specifies a working frequency at 38 kHz. The IR link is acting like an optocoupler [Texas Instruments Incorporated, 1981], just with added disturbance by not being encapsulated.

3.3.4

GR42x25 DC Motor

The motor used in the demonstrator is a GR42x25 permanent magnetized, 15 W DC Motor. The motor uses voltages between 0-40 V and is gearless [Dunkermotoren, 2004].

3.3.5

H-bridge

The H-bridge is based on the Chip L298N Motor Driver Integrated Circuit and is controlled by standard TTL logic. The H-bridge can handle up to 2 ampere of continuous current and peak amplitudes of 3 ampere for 100 µs [STMicroelectronics, 2000].

3.4 3.4.1

Software Motor Program

The motor has two tasks: to accelerate the ring up to the correct RPM and thereafter keep the speed constant. By using the IR link (see section 3.3.3) and using the interrupt pins on the Arduino UNO and the control function (see section 3.5), the 14

3.4. SOFTWARE

RPM is decided. The zero position is defined as the point when the IR link sends its pulse as the receiver is hit by the IR emitter. When the ring passes the zero point position, an internal clock enumerates until the next pulse is registered by the Arduino UNO. To project the 3D image, AST should be lower than τΦ (see section 2.1)and the sample frequency to calculate a new ω is described with equation 3.1, fsample =

1 T

(3.1)

where T is the sample time. The program flowchart is shown in figure 3.9 False Start

Accellerate motor

Correct x RPM?

True

Figure 3.9: Motor flow chart

15

Stop accelleration

CHAPTER 3. DEMONSTRATOR

3.4.2

LED Program

When the ring has acquired the correct RPM via the motor control program, the software calculates the RPM of ring. The RPM is used to calculate the delay between each configuration, given by the equation delayconf = RP M

2π 60

(3.2)

The software then starts an internal clock, "fires" one configuration, stops the clock and delays the next configuration as delay = delayconf − ∆clock

(3.3)

The software then samples a new RPM if the requirement is met and calculates a new delayconf iguration , as shown in figure 3.10. True Start

Calculate RPM

Calculate delay between configurations

Rotated x laps?

False

Read configuration data

Send configuration data to LED driver

Figure 3.10: LED system flow chart

3.5

Motor Control

To determine how the static friction and viscosity friction caused by the inertia of the ring and motor axis affects the model, two data sets were collected. The data sets were with different voltages, V1 and V2 applied to the motor and the angular velocity, ω1 and ω2 were sampled when the motor reached a steady state, where ω˙ ≈ 0, simplifying equation 2.13 to K KI Ke V1 = Ms + ω1 + f ω1 R R K KI Ke V2 = Ms + ω2 + f ω2 R R Equations 3.4a and 3.4b are plotted in figure 3.11.

16

(3.4a) (3.4b)

3.5. MOTOR CONTROL

RPM of the system at a given voltage

850 800

V1 = 6 [V]

750

V2 = 9 [V] Mean RPM at V1 = 463.55 [rev/min] Mean RPM at V2= 832.44 [rev/min]

RPM

700 650 600 550 500 450 400 1

2

3

4

5 Time [s]

6

7

8

9

Figure 3.11: The data sets sampled for steady state value of the motor with connected load

From figure 3.11 the static friction were determined to Ms = −4.7092 · 10−4 Nm and friction coefficient f = 0.0133 Nms/rad.

3.5.1

Designing a PI controller

Since the system was determined with non-linear differential equations (see section 2.5), the control problem is non-linear. To be able to control the motor with this in mind, the sample time for the digital controller was chosen as T =

2π ωc

(3.5)

where wc is the phase margin of the system. By choosing a proper sample time with equation 3.5, the system was able to decrease it’s phase margin with roughly 20◦ and still remain stable [Glad and Ljung, 2006]. A PI controller was chosen since the system do not have any certain speed requirements but can not accept any kind of overshoot or static error. To design the PI controller, a controller F (s) was added to open loop system, shown in figure 2.4 and using feedback control the system was closed as seen in figure 3.12 where the controller function for a PI-controller in the frequency domain is given as F (s) = K(1 +

1 ) sTI

(3.6)

where K is the proportional part, decided via testing with simulated step responses in Matlab [MathWorks, 2015] A.2.2 Motor model, and TI is the integration part of the PI-controller defined as K TI = (3.7) T 17

CHAPTER 3. DEMONSTRATOR

υ ωref +



e

F

u

G



ω

− Figure 3.12: The closed loop system with controller F (s) and plant G(s)

Using Matlab [MathWorks, 2015], a Bode plot [Glad and Ljung, 2006] A.2.1 PID calculations for the uncontrolled system G(s), given by equation 2.14 and table 3.1, where J is estimated with a CAD software, and R and Ke are given in the datasheet [STMicroelectronics, 2000], were modulated as seen in figure 3.13 Table 3.1: Motor constants to module the rotation system Internal Resistence (R) 14.5 Ω

Motor Constant (Ke ) 86.8 · 10−3 V /revolution

Moment of Inertia (J) 0.5 kgm2

Bode Diagram

80

Magnitude (dB)

70 60 50 40 30 20 10 0 −50

Phase (deg)

−60 −70 −80 −90 −4 10

−3

10

−2

10

−1

10

0

10

Frequency (rad/s)

Figure 3.13: Bode diagram of the modelled system

and from figure 3.13, the crossover frequency of the system is determined to ωc = 90.8875 rad s−1 By using wc and equation 3.5 the sample time T = 0.0691 s and with equation 3.7 TI = 143.2055 s−1 . 18

3.5. MOTOR CONTROL

3.5.2

Control signal in a digital controller

To implement the digital control, Tustin approximation [Glad and Ljung, 2006] is used, as du ≈ ∆t u (3.8) dt where ∆t u is given as 1 1 (∆s u(t) + ∆t u(t − T ) = (u(t) − u(t − T ) 2 T

(3.9)

where T is the sample time for the system and u(t) is the control signal from the controller to the plant. As shown in figure 3.12 u(t) = ∆F (p)e(t) (3.10) where ∆F (p) is the controller function given by equation 3.6, approximated using equation 3.8 and equation 3.9, which results in the control signal u(t) = u(t − T ) + Ke(t)(1 +

T T ) − Ke(t − T )(1 + ) 2TI 2TI

(3.11)

which is implemented via the running code in the Arduino UNO, where the calculated constants are presented in table 3.2. Table 3.2: Summary of the constants used to calculate the control signal K T TI fsample

9.9 0.0691 s 143.2055 s−1 14.5 Hz

The controller need limits to how big the control signal can be since the motor only can handle a limited amount of voltage. The motor (see section 3.3.4) has a max voltage of 24 V, which is set as the maximum control signal umax and minimum umin is set to 0 V. To prevent the I-part of the controller to get stuck, reset windup ([Glad and Ljung, 2006]), the output of the controller is limited as    umax

un =

 

if un−1 + ∆un > umax if umin ≤ un ≤ umax if un−1 + ∆un < umin

un−1 + ∆un umin

where ∆u is given with equation 3.12 as ∆un = u(t) − u(t − T ) 19

(3.12)

CHAPTER 3. DEMONSTRATOR

3.6 3.6.1

System Interaction Rotation System

The rotation system of the demonstrator consists of a GR42x25 DC Motor (see section 3.3.4, an Arduino UNO (see section 3.3.1), Support Frame and Ring (see section 3.2.1) and IR link (see section 3.3.3). The main function of the system is to accelerate the motor to a desired RPM and keep that RPM until other is instructed. The support structure is designed to damp the vibration from the rotation ring. The motor is controlled with a H-bridge (see 3.3.5) and the position and speed is measured with an IR diode. When the IR diode detects a beam of IR light, it sends a pulse to the interrupt pin on the Microcontroller Arduino UNO. The microcontroller then starts an internal timer and stops it when another pulse is detected from the IR diode.

3.6.2

LED System

The LED System is one of the key components to project the image. The system consists of 32 RGB LED:s, one Microcontroller Arduino UNO, one IR link and 6 TLC5940 LED Drivers (see section 3.3.2). Using the same set up as the Rotation System (with a IR diode), the Microcontroller Arduino UNO knows the RPM of the ring. By using the equation 2.4 to calculate the AST (see section 2.3) and dividing AST with the chosen number of configuration each lap, the microcontroller regulates which LED configuration is to be "fired". By measuring the DCT (see section 2.4) with the internal timer of the Arduion, the DCT is decided to DCT = 400 · 10−6 s. By subtracting the DCT with the RPM and dividing the result with the number of RGB LED configurations, the delay between each configuration is calculated. With figure 4.1 a maximum number of configuration is calculated. If this value is exceeded, the microcontroller "fires" an error message via the RGB LED:s.

20

Chapter 4

Calculations This chapter contains all the calculation needed in the project

4.1

PPI

By using equation 2.2 (see section 2.2) and projecting the curved formula onto a plane, see figure 2.1, the vertical resolution wd is determined to the number of LED configurations fired each revolution. The horizontal resolution, hd , is determined to the number of LED and dring is the diameter of the ring, in inches. In combination with equation 2.2, the PPI of the system is √

PPI =

n2conf ig + n2LED dring

(4.1)

While nLED and dring are scalable, nconf ig is limited by equation 4.2 given as nconf ig =

360 ωAST

(4.2)

where AST is given by equation 2.4 The relationship between AST, α and RPM (see section 2.3) is calculated with equation 2.4, equation 4.2, equation 4.1 and equation 2.6 and is presented in figure 4.1

21

CHAPTER 4. CALCULATIONS

AST as function of α and RPM

0.1

0.08

0.12 0.1

0.06

AST, [s]

0.08 0.06

0.04

max AST

0.04

0.02

0.02

DCT

0 400

0

300

2000 200

1500 100

−0.02

1000 0

α, [deg]

500

n, [RPM]

Figure 4.1: AST as a function of α and RPM.

where the limit for Φ movement to appear is represented with the top horisontal grid. The lower horistional grid is the calculated DCT. To get a solid 3D projection, an AST between the two grids is required. As shown in figure 4.1, as the rotation speed of the ring increases, AST is decreasing. As AST is approaching DCT, system stability becomes compromised as the configurations are "fired" more frequent and the error margin decreases. If AST gets smaller than DCT, the PPI will not be affected as the TLC5940 LED Drivers will not be able to "fire" the configuration fast enough. The PPI as a function of α, without relation to the RPM, is shown in figure 4.2 PPI as function of α

5 4.9 4.8

Resolution [PPI]

4.7 4.6 4.5 4.4 4.3 4.2 4.1 4

0

50

100

150 200 α, [deg]

250

300

350

Figure 4.2: PPI as a function of α

where α is the angle between every LED configuration is "fired" (see figure 2.2).

22

Chapter 5

Results This chapter describes the results achieved with the project The result of the project is obtained with images taken at different RPM and with different number of configurations "fired" each revolution. The demonstrator is instructed to light all LED:s with full power with one color in a specific order: Red, green and blue. The images is then used to calculate the PPI for the specific combination of RPM and number of configurations, as seen in table 5.1. The distance between each pixel captured in the images, was measured with image processing software, as seen in figure 5.1.

Measured distance Known distance

Figure 5.1: Method used to measure PPI.

23

CHAPTER 5. RESULTS

Three pictures of each data point is collected and then averaged. The ratio between the measured distance between the pixels in the image and a measured distance with a known length in the image, multiplied with the known length (see A.2.4 PPI measurements) gives the resulting pixel density from A.2.3 PPI calculations, as seen in table 5.1 . Table 5.1: Results of the measured PPI Configurations per revolution 60 configurations 90 configurations 120 configurations 150 configurations

500 RPM 3.90 6.67 5.72 8.29

666 RPM 3.88 4.06 4.83 6.97

833 RPM 3.95 5.45 6.16 5.4

1000 RPM 3.68 3.69 2.44 1.98

Figure 5.2 shows the measured PPI as a function of the RPM. Measured PPI

9

500 RPM 666 RPM 833 RPM 1000 RPM

8 7

PPI

6 5 4 3 2 1 60

70

80

90 100 110 120 Configurations per lap

130

140

150

Figure 5.2: Measurements result.

As seen in figure 5.2, if few configurations is fired each revolution, the PPI is fairly constant for each RPM. As the RPM increases, the differences between a small and large number of configurations fired each revolution, increases. Lower RPM and a higher number of configurations fired gives the highest PPI. If the number of configurations are kept high and the RPM increases, the PPI falls. This effect is thought to be caused by the differences between the DCT ( see section 2.4) and AST (see section 2.3) are approaching zero. The results are further discussed in chapter 6. 24

Chapter 6

Discussion and conclusions This chapter contains a discussion about the results in the project and conclusions derived from the discussion.

6.1

Discussion

As to be expected, the result (see chapter 5) showed that the highest PPI was achieved with the slowest RPM and the most number of configurations. More interesting, the PPI sank as the ring spun faster and faster, as shown in figure 5.2. The fact that the PPI sank as the RPM and number of configuration "fired" each revolutions could be due to several factors. As the ring spins faster and faster and as the number of configurations are increasing, the difference between the AST and DCT approaches zero. As discussed in section 2.4, system stability is compromised at 1000 RPM, as the TLC5940 LED Drivers can not "fire" all the configurations fast enough, and the Arduino tries to push more data into the TLC5940 LED Drivers faster then the TLC5940 LED Drivers can push it out to the RGB LED:s. Also the AST gets closer to the limit for τΦ as the RPM increases, the configurations blur together as discussed in chapter 2. The result also shows that the maximum PPI was measured exceeded the theoretical value calculated in section 2.2, figure 4.2. This could be because the theoretical value was based on the actual size of the RGB LED used, which did not take into account of the fact that the RGB LED contains 3 smaller LED:s. If the RGB LED changes color during one AST, as done in the results, the RGB LED can be perceived as several pixels during the AST. This was not accounted for in the calculations, due to simplifications done in the model between PPI and α.

6.2

Conclusions

As the RPM of the ring is kept low and the number of configurations "fired" increases, the PPI increases. The number of LED:s is a scaler factor that will increase PPI but as the number of LED:s are increased, so is the DCT, affecting system sta25

CHAPTER 6. DISCUSSION AND CONCLUSIONS

bility. The DCT is the limiting factor as for system stability as, if the AST is lower thanτΦ , the DCT prevents the PPI to increase any further and system stability is compromised. If AST is greater thanτΦ , there will not be a 3D projection.

26

Chapter 7

Recommendations and future work Potential future work and improvements to the project. Also contains what needs to be improved with the demonstrator. The demonstrator’s main problem is the vibrations caused by the rotating load inside the ring and imperfections in the manufacturing of the slip ring. The load is asymmetrical placed, which causes an unbalanced system. To lower the vibration, future work should be focused on damping the vibration, balancing the rotating system and lower the total inertia of the rotating load by e.g lowering the total mass of the rotating load or replace the threaded rod as axis of rotation with a axis with higher tolerances. To reduce vibrations, an option is to use ball bearing at both the top and bottom of the axis, instead of the motor shaft at the bottom. The Microcontroller Arduino UNO only has 2 kilobytes of SRAM memory, which greatly limits the number of configurations the demonstrator can store and "fire", because of the 12 bit resolution of the PWM signal in the LED drivers. Extra memory should be added, or more memory efficient algorithms should be used, to store the configurations. A Graphic User Interface (GUI) could be added to calculate the configurations and to simplify the making of the projected image. Also, surface mounted LED:s could be used to decrease the distance between each LED, increasing the PPI of the projected image. The design of the PCB should be improved upon, with regards of the many induced currents in the wirings of the LED:s, due to the fast shifting of PWM signals in the rotating system. The size of pads, vias etc. should be enlarged to ensure maximum quality, if the circuit board is to be soldered manually. To improve the projection, a more accurate control system for the LED:s should be used. The demonstrator only measures its’ position once per revolution. More control points per revolutions could be added.

27

Bibliography [Arduino, 2010] Arduino (2010). Datasheet: Arduino Uno. Available from: http://docs-europe.electrocomponents.com/webdocs/0e8b/ 0900766b80e8ba21.pdf. [Atmel, 2009] Atmel (2009). Datasheet: Atmel328P. Available from: http://www. atmel.com/images/doc8161.pdf. [Christensen et al., 2009] Christensen, N. B., Suzuki, H., and Fukuda, Y. (2009). How to meet dots per inch requirements for images. International Journal of Urology, 16(7):596–596. [Dunkermotoren, 2004] Dunkermotoren (2004). Datasheet: GR 42x25 DC motor. Available from: http://www.dunkermotoren.com/data/technical_data/ motors/pdf/121005_GR42x25.pdf#page=1. [Glad and Ljung, 2006] Glad, T. and Ljung, L. (2006). Reglerteknik - Grundläggande teori. Studentlitteratur AB. [Jason Miers, 2006] Jason Miers (2006). Method of making an animated flipbook. Available from: http://www.google.com/patents/US7812998 [cited 2010-1012]. [Johansson, 2013] Johansson, H. (2013). Maskinkonstruktion.

Elektroteknik.

Instutitionen för

[MathWorks, 2015] MathWorks (2015). Matlab 2014b. Available from: mathworks. com [cited 2015-05]. [Nakayama and Boucher, 1999] Nakayama and Boucher (1999). Introduction to fluid mechanics. [OSRAM semiconductors, 2014a] OSRAM semiconductors (2014a). Datasheet: SFH 3100 F. Available from: http://www.osram-os.com/Graphics/XPic5/ 00101814_0.pdf/SFH%203100%20F,%20Lead%20(Pb)%20Free%20Product%20-% 20RoHS%20Compliant.pdf. [OSRAM semiconductors, 2014b] OSRAM semiconductors (2014b). Datasheet: SFH 4110 F. Available from: http://www.osram-os.com/Graphics/XPic3/ 29

BIBLIOGRAPHY

00082841_0.pdf/SFH%204110,%20Lead%20%28Pb%29%20Free%20Product%20-% 20RoHS%20Compliant.pdf. [Råde and Westergren, 2003] Råde, L. and Westergren, B. (2003). Mathematics Handbook - for Science and Engineering. Studentlitteratur AB. [Steinman et al., 2000] Steinman, R. M., Pizlo, Z., and Pizlo, F. J. (2000). Phi is not beta, and why wertheimers discovery launched the gestalt revolution. Vision Research, 40(17):22572264. [STMicroelectronics, 2000] STMicroelectronics (2000). Datasheet: L298 Hbridge. Available from: http://www.st.com/st-web-ui/static/active/en/ resource/technical/document/datasheet/CD00000240.pdf. [Texas Instruments Incorporated, 1981] Texas Instruments Incorporated (1981). Datasheet: Optocoupler. Available from: http://www.ti.com/lit/ds/ soes021c/soes021c.pdf [cited 1998-04]. [Texas Instruments Incorporated, 2004] Texas Instruments Incorporated (2004). Datasheet: TLC5940 LED Driver. Available from: http://www.ti.com/lit/ ds/symlink/tlc5940.pdf [cited 2007-10].

30

Appendix A

Additional information

28 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

TCL5940 OUT0 VPR OG S IN OUT1 S CLK OUT2 XLAT OUT3 OUT4 BLANK GND OUT5 OUT6 OUT7 OUT8 OUT9 OUT10 VCC OUT11 IR E F OUT12DCPR OG OUT13 GS CLK OUT14 S OUT OUT15 XE R R

27 26 25 24 23 22

21 20 19 18 17 16

S IN S CLK XLAT BLANK

GS CLK S OUT

1 2

GND

C1 100nF R2 2k

S CLK XLAT BLANK GS CLK

Power

S L1

GND

R1

8 7 6 5 4 3 2 LE DGR 1 P2 8 7 6 5 4 3 2 1

10k

LE DGR P1

VCC

Circuit Boards

VCC

A.1

S CLK XLAT BLANK GS CLK

1 2 3 4

S V5 S OUT

S IN

Figure A.1: TLC5940 schematics

31

1 2 3 4

S V1

332-02

332-02

332-02

332-02

X1-1

X2-1

X1-2

X2-2

APPENDIX A. ADDITIONAL INFORMATION

Figure A.2: TLC5940 circuit board, bottom

LED-channels

SCLK XLAT BLANK GSCLK 4

4

+5V GND

Figure A.3: TLC5940 circuit board, top

A.2 A.2.1 1 2 3 4 5 6 7 8

Matlab Code PID calculations

clc ; close all ; clear all ; J = 0 . 0 5 ;%kg−m^ 2 ; R = 1 4 . 5 ; %ohm f = 4.3∗10^ −6; % Ms = 96∗10^ −6; %kg−m^ 2 ; K_e=83∗10^ −3; %mV/ varv s=t f ( ’ s ’ ) ; G = (K_e−Ms∗R) / ( J∗ s+f +(K_e^2/R) ) ;

9 10 11 12 13 14

K = 10; r i s e t i m e =100; while risetime > 1 K=K− 0 . 1 ; Go= K∗G; 32

C1

1

2k R2

1

C1

SOUT

R1 10k

100nF SIN

4

SCLK XLAT BLANK GSCLK

+5V GND 4

R1 10k

SOUT 1

2k R2

1

R1 10k

C1

100nF SIN

1

TLC5940

TLC5940

100nF SOUT

LED-channels

16

SIN 2k R2

1

TLC5940

1

1

16

4

1

4

LED-channels

16

+5V GND

A.2. MATLAB CODE

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Goc=Go/(1+Go) ; S=s t e p i n f o ( ( Goc ) ) ; r i s e t i m e=e x t r a c t f i e l d ( S , ’ RiseTime ’ ) ; end K_P=K s t e p ( Goc ) S=s t e p i n f o ( Goc ) ; Tr=e x t r a c t f i e l d ( S , ’ RiseTime ’ ) ; [Gm, Pm, Wcg, Wc]= margin (Go) ; wb=bandwidth ( Goc ) ; d i s p ( ’ Phase margin ’ ) d i s p (Pm) T = ( 2 ∗ p i ) / (Pm) ; d i s p ( ’ Sample Time ’ ) d i s p (T) T_I = K/T ; d i s p ( ’ I n t e r g r a t o r Time ’ ) d i s p (T_I)

A.2.2 1

Motor model

clc ; clear all ; close all ;

2 3 4 5 6 7 8

%rho %J = %b = %K = %R = %L =

=; 0.01; A∗ rho ∗ cp ; 0.0045; 141; 0.5;

9 10 11 12 13 14 15 16

J = 0.01; b = 0.1; K = 0.01; R = 1; L = 0.5; s = tf ( ’s ’) ; P_motor = K/ ( ( J∗ s+b ) ∗ (L∗ s+R)+K^2) ;

17 18 19 20

zpk ( P_motor )

A.2.3 1

PPI calculations

c l c ; c l o s e a l l ; c l e a r a l l ; format compact 33

APPENDIX A. ADDITIONAL INFORMATION

2

%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 4 5 6 7 8 9

%Systemparameters nled = 32; dring_m = 0 . 2 ; %m d r i n g = c o n v l e n g t h ( dring_m , ’m’ , ’ i n ’ ) ; %i n c h e s RPM = [ 5 0 0 : 7 5 : 2 0 0 0 ] ; a l f a = [ 0 : 0 . 3 : 2 ∗ pi ] ; % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

10 11 12 13 14

15

16

%C a l c u l a t i n g AST and DCT DCT = 400∗10^ −6∗ o n e s ( s i z e (RPM) ) ; d c t = o n e s ( s i z e ( a l f a , 2 ) , s i z e (RPM, 2 ) ) ∗ max(DCT) ; %r i k t i g d c t d c t _ c a l c = o n e s ( s i z e ( a l f a , 2 ) , s i z e (RPM, 2 ) ) ∗ 1.56∗10^ −3; % beräknad d c t phi_max = o n e s ( s i z e ( a l f a , 2 ) , s i z e (RPM, 2 ) ) ∗ 30∗10^ −3; % beräknad d c t omega = RPM/ ( 6 0 / ( 2 ∗ p i ) ) ;

17 18 19 20 21 22 23 24 25 26

27 28 29

30 31 32 33 34 35 36 37

AST = z e r o s ( l e n g t h ( a l f a ) ) ; f o r i =1: l e n g t h ( a l f a ) f o r j = 1 : l e n g t h ( omega ) AST( i , j ) = a l f a ( i ) /omega ( j ) ; end end PPI = s q r t ( ( 3 6 0 . / r a d t o d e g ( a l f a ) ) .^2+ n l e d ^2) / d r i n g ; figure s u r f (RPM, r a d t o d e g ( a l f a ) ,AST, ’ EdgeColor ’ , ’ none ’ , ’ L i n e S t y l e ’ , ’ none ’ , ’ F a c e L i g h t i n g ’ , ’ phong ’ ) ; h o l d on s u r f (RPM, r a d t o d e g ( a l f a ) , d c t _ c a l c ) ; mesh (RPM, r a d t o d e g ( a l f a ) , phi_max , ’ EdgeColor ’ , ’ b l a c k ’ , ’ FaceColor ’ , ’ none ’ ) ; hold o f f colormap d e f a u l t caxis ([ −0.03 ,0.1]) colorbar x l a b e l ( ’ {\ i t n } , [RPM] ’ ) ; y l a b e l ( ’ {\ i t \ a l p h a } , [ deg ] ’ ) ; z l a b e l ( ’ {\ itAST } , [ s ] ’ ) ; t i t l e ( ’AST a s f u n c t i o n o f \ a l p h a and RPM’ ) ; 34

A.2. MATLAB CODE

38 39 40 41 42 43 44

figure p l o t ( r a d t o d e g ( a l f a ) , PPI ) x l a b e l ( ’ {\ i t \ a l p h a } , [ deg ] ’ ) ; y l a b e l ( ’ {\ i t R e s o l u t i o n } [ PPI ] ’ ) ; t i t l e ( ’ PPI a s f u n c t i o n o f \ a l p h a ’ ) ; g r i d on

A.2.4 1

PPI measurements

c l e a r a l l ; c l o s e a l l ; c l c ; format compact ;

2 3

c o n f = [ 6 0 90 120 1 5 0 ] ;

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

%Measured data rpm500 = [ 6 7 . 0 6 8 . 6 6 3 . 0 ; 40.0 35.6 31.8; 43.0 41.0 36.8; 33.8 29.8 2 6 . 8 ] ; rpm666 = [ 6 5 . 1 6 2 . 5 6 1 ; 55.9 58.2 59.9; 46.8 47.8 52.5; 36.8 37.8 3 2 . 5 ] ; rpm833 = [ 6 3 . 0 6 4 . 3 6 4 . 3 ; 41.0 48.0 47.4; 36.4 40.8 39.0; 53.9 52.3 5 1 . 5 ] ; rpm1000 = [ 6 8 . 9 6 4 . 0 6 8 . 9 ; 66.0 66.0 59.0; 94.0 91.7 96.3; 120.9 120.9 1 2 0 . 9 ] ;

22 23 24 25 26

y_scale500 = [ 3 0 . 5 28.2 27.2 2 9 . 5 ] ; y _ s c a l e 6 6 6 = [ 2 8 . 8 2 7 . 8 28 2 9 . 4 ] ; y_scale833 = [ 2 9 . 8 29.3 28.19 3 3 . 8 ] ; y_scale1000 = [ 2 9 . 3 27.8 27.1 2 8 . 3 8 ] ;

27 28 29 30 31 32 33

%C a l c u l a t e a v e r a g e f o r i = 1 : l e n g t h ( rpm500 ) avg500 ( i ) = mean ( rpm500 ( i , : ) ) ; avg666 ( i ) = mean ( rpm666 ( i , : ) ) ; avg833 ( i ) = mean ( rpm833 ( i , : ) ) ; avg1000 ( i ) = mean ( rpm1000 ( i , : ) ) ;

34

35

APPENDIX A. ADDITIONAL INFORMATION

35 36 37 38

s t d 5 0 0 ( i ) = s t d ( rpm500 ( i , : ) ) ; s t d 6 6 6 ( i ) = s t d ( rpm666 ( i , : ) ) ; s t d 7 5 0 ( i ) = s t d ( rpm833 ( i , : ) ) ; s t d 1 0 0 0 ( i ) = s t d ( rpm1000 ( i , : ) ) ;

39 40 41 42 43 44 45 46 47 48 49 50

PPI500 ( i ) = 2 5 . 4 / ( 6 ∗ avg500 ( i ) / ( y _ s c a l e 5 0 0 ( i ) ∗ 2 ) ) ; PPI666 ( i ) = 2 5 . 4 / ( 6 ∗ avg666 ( i ) / ( y _ s c a l e 6 6 6 ( i ) ∗ 2 ) ) ; PPI833 ( i ) = 2 5 . 4 / ( 6 ∗ avg833 ( i ) / ( y _ s c a l e 8 3 3 ( i ) ∗ 2 ) ) ; PPI1000 ( i ) = 2 5 . 4 / ( 6 ∗ avg1000 ( i ) / ( y _ s c a l e 1 0 0 0 ( i ) ∗ 2 ) ) ; end d i s p ( ’ PPI 500 RPM: [ 6 0 / 9 0 / 1 2 0 / 1 5 0 ] c o n f / l a p ’ ) d i s p ( PPI500 ) d i s p ( ’ PPI 833 RPM: [ 6 0 / 9 0 / 1 2 0 / 1 5 0 ] c o n f / l a p ’ ) d i s p ( PPI833 ) d i s p ( ’ PPI 1000 RPM: [ 6 0 / 9 0 / 1 2 0 / 1 5 0 ] c o n f / l a p ’ ) d i s p ( PPI1000 )

51 52 53 54 55 56 57 58 59 60 61 62

figure () p l o t ( conf , PPI500 ) h o l d on p l o t ( conf , PPI666 , ’ −. ’ ) p l o t ( conf , PPI833 , ’−∗ ’ ) p l o t ( conf , PPI1000 , ’−− ’ ) x l a b e l ( ’ Con f ig u r at i on s per lap ’ ) y l a b e l ( ’ PPI ’ ) g r i d on l e g e n d ( ’ 500 RPM’ , ’ 666 RPM’ , ’ 833 rpm ’ , ’ 1000 RPM’ ) t i t l e ( ’ Measured PPI ’ )

36

TRITA MMK 2015:7 MDAB060

www.kth.se

Suggest Documents