Você está na página 1de 55

A system balancing a sphere on a seesaw

James Murphy, Kai Neuhaus, Song Yan GMIT Galway Mayo Institute of Technology Modul: Physics & Instrumentation: Intstrumentation Design Laboratory Technical Project 3.1 Modul Leader: John Cunningham, Gareth Roe

March 8, 2011
Abstract

A team project to construct and build an controlled system. A seesaw system was selected as an controlled system with dierent sensor arrangements for feedback signals. The seesaw system can balance a sphere on its lever by adjusting the inclination driven by a stepper motor and according to the sensor signals. Dierent sensor arrangements were prepared including an sensor less approach to compare with. The stepper motor and sensors were interfaced with intermediate electronics circuits and the DAQmx interface from National Instruments [4]. Subsequently the signal processing and stepper motor logic was implemented with labview from National Instruments. The seesaw system nally can demonstrate its properties as an feedback system compared to the open loop system without sensors. The system can stabilize the sphere on the lever by continuously changing the inclination from one side to the other and the use of one or two sensors. In open loop mode without sensors the sphere cannot be kept on the lever and falls down. http://www.youtube.com/playlist?list=PLCA00BC1089C52DA1

CONTENTS

CONTENTS

Contents
1 Introduction 2 Investigative and Developmental Work 2.1 Selection of System . . . . . . . . . . . . . . . . . . . 2.2 Mechanical Setup . . . . . . . . . . . . . . . . . . . . 2.3 Motor Specs . . . . . . . . . . . . . . . . . . . . . . . 2.4 Stepper Motor Interface . . . . . . . . . . . . . . . . 2.5 Sensor Interface . . . . . . . . . . . . . . . . . . . . . 2.6 Sensor Specs . . . . . . . . . . . . . . . . . . . . . . . 2.7 Labview Processes . . . . . . . . . . . . . . . . . . . 2.7.1 Stepper Motor Process . . . . . . . . . . . . . 2.7.2 Oscillation Process . . . . . . . . . . . . . . . 2.7.3 Single Sensor Process . . . . . . . . . . . . . . 2.7.4 Double Sensor Process . . . . . . . . . . . . . 2.8 System Analysis . . . . . . . . . . . . . . . . . . . . . 2.8.1 Estimation of speed of sphere with one sensor 2.8.2 Angle of Inclination to stop sphere . . . . . . 2.8.3 Step Size of angle of Seesaw . . . . . . . . . . 2.8.4 Estimating Forces acting on motors axis . . . 2.8.5 Analysis of the Control System . . . . . . . . 4 5 5 6 6 7 9 10 11 11 13 14 15 16 16 17 18 19 20 24 24 24 26 27 28 29 30 31 39 42 47 53 55

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

3 Final System 3.1 LabView Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Overall Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Test and Calibration of LabView Processes 5 Conclusion 6 List of Equipment and Components 7 References A Labview Diagrams A.1 Double-Sensor . A.2 Single-Sensor . A.3 Oscillation . . . A.4 Motor-Interface A.5 Inc-Dec . . . . A.6 Bin2Nr . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

Project: Seesaw System as a controlled system (February 26, 2012)

2/ 55

LIST OF FIGURES

LIST OF FIGURES

List of Figures
1 2 3 4 5 6 7 8 9 10 11 12 13 Overall connection schematic of the phases of the stepper motor to driver and DAQmx. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Detail schematic for one output channel of the driver showing the open collector output and the protection diode. . . . . . . . . . . . . . . . . . Overall connection schematic of the sensor interface board and DAQmx. Detail schematic for one sensor input. The relay separates the 20V sensor voltage from the DAQmx. . . . . . . . . . . . . . . . . . . . . . . . . . . Block Diagram of the motor interface in labview . . . . . . . . . . . . . . Detail Figure 5 Sequence tables . . . . . . . . . . . . . . . . . . . . . . . Detail Figure 5 Incrementor / Decrementor . . . . . . . . . . . . . . . . . Block Diagram: Incrementor / Decrementor . . . . . . . . . . . . . . . . Block Diagram: Oscillation Process . . . . . . . . . . . . . . . . . . . . . Block Diagram: Single Sensor Process . . . . . . . . . . . . . . . . . . . . Block Diagram: Time Loop in Sensor Loop . . . . . . . . . . . . . . . . . Block Diagram: Delay with dt sensor 2 . . . . . . . . . . . . . . . . . . Using the sensors eld of sensing (operating range 0.008m) to estimate the speed of a sphere. The diameter for one sphere was measured with 0.019m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rail with two sensors. L is the length of one site of the rail and D the distance of a sensor from the pivot point. . . . . . . . . . . . . . . . . . . Compared to Figure 14 a geometrical representation of the rail inclined by an angle of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Relation of forces caused by the sphere over the rail and gear system acting on the motor axis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Block diagram showing components and values of the feedback system in the two sensor system of the seesaw. . . . . . . . . . . . . . . . . . . . . 7 8 9 10 11 12 12 12 13 14 15 15

16 17 17 19 22

14 15 16 17

Project: Seesaw System as a controlled system (February 26, 2012)

3/ 55

1 INTRODUCTION

Introduction

Author: all The goal of this project was to construct and build a controlled system with feedback in a team eort during a dened period of time (9 weeks and anticipated 6 hours a week). The team was assembled of three members - the authors of this report. The rst step of the project comprised the selection of a suitable system to be constructed. The system was supposed to exploit features of an controlled system with feedback that is interfaced with labview from National Instruments. A seesaw system was selected, as it appeared to provide all the features demanded. Further more, such a system promised to provide a wider variety of dierent modes as an controlled system. On the other hand does the seesaw provide a dierent and abstract approach that may oer a deeper look inside a controlled system compared to other systems. It was easy to conceive, that already with a dierent arrangement and amount of proximity switches, a variety of dierent experiments may be created. The choice of an stepper motor to control the inclination of the lever appeared to be suitable, though speed considerations and the holding force of the motor turned out to be critical. Using proximity switches was restricted due to availability but neverless an interesting and nally a bit chellanging choice. The construction of the system demanded the sharing of dierent tasks between the members, i.e. research and planning of system components, dimensioning and constructing interface electronics, computer processing with labview, test and calibration as well analysis of the system and the documentation.

Project: Seesaw System as a controlled system (February 26, 2012)

4/ 55

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

Investigative and Developmental Work

Author: all

2.1

Selection of System

The seesaw system was selected as it promised to supply a rich set of dierent properties to observe within an controlled system. Basically the seesaw system exposes the controlled system that is usually covered below the real world. Further more the seesaw also provides an immediate visual feedback about the performance. A stepper motor was chosen as it appeared to provide all required properties to apply small changes of angular movements and a certain force to lock to a certain angular position. Further consideration revealed it could be of advantage that the holding torque can be increased dramatically by using a snail worm gear. However, it turned out that this would have reduced the rotational speed by a factor of 56 (the amount of teeth of the driven gear), meaning with a maximum motor speed of 130 steps per seconds. Taking also the angular change in account that would be 7.5 = 0.13 we would obtain an angular speed 56 of 0.13 s1 . Therefore, turning the lever about one degree would have needed about 8 seconds and that appeared much to slow to react appropriately to the much quicker moving sphere on the lever. The choice of proximity switches was dictated much more by availability. At the time of choice, however, it was not known what exact eect single switches would have on the performance of the system. It appeared conceivable that dierent systems might be arranged with up to four sensors, the maximum amount of sensor available. To control the system the use of labview from National Instrument was requested. Therefore, no other considerations where added at the beginning. To interface the stepper motor with the DAQmx [4] module from National Instruments a dedicated driver chip ULN2803A was used as it was available together with the stepper motor. Finally a sensor interface was needed to transform the sensor output voltage from 20V to the input level range of the DAQmx of 5V.

Project: Seesaw System as a controlled system (February 26, 2012)

5/ 55

2.2 Mechanical Setup

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

2.2

Mechanical Setup

Author: James We use wood for the base and walls of the set up as it is easy to carve into shape , to assemble together and to make alterations and adjustments to. We used bolts and nuts to hold the main axis rod in position. We rst used the snail gear for its smooth rotation and high translation purposes. However the motor was not able to supply the speed in turning required to turn the gear fast enough to control the system. There was an initial problem with connecting the motor to the gear system as it had a di rod dimension. this was easily solved but a change in motor. There had to be made a change to the assembly of the body to account for the change in gear system from the snail gear to the normal tooth gear. the main axis rod also had to be re-enforced so that the teeth would not slip or jump out.

2.3

Motor Specs

Author: Kai A selection of the stepper motor specications found in [9]. numeric value power consumption 5.3 maximum pull in rate 130 maximum working torque 57 maximum holding torque 85 resistance per phase 47 current per phase 240 step angle 7.5 steps per revolution 48 direction of rotation reversible units W s1 mNm mNm mA 20

Table 1: signicant stepper motor specications (Type 2) [9]

The specication [9] also state that the torque speed characteristics can be improved by adding a suitable resistor ( 6) in series with each commons and increase the voltage accordingly. This option was not followed up due to time constraints of the project.

Project: Seesaw System as a controlled system (February 26, 2012)

6/ 55

2.4 Stepper Motor Interface 2 INVESTIGATIVE AND DEVELOPMENTAL WORK

2.4

Stepper Motor Interface

Author: Kai, Yan Interfacing of the stepper motor was based on the practical instruction [8] of an course at the GMIT in Physics & Instrumentation. According to the handout [8] a driver chip ULN2803A [7] was suggested to connect up directly with the stepper motor phases (see Figure 1). The commons of the stepper motor are connected to the positive terminal of a power supply with 12V. The ground connection is supplied through the driver chip. It may be worth to mention, that the driver chip is an array of transistors switched in open collector conguration Figure 2. This explains the somewhat special place where the ground must be connected and that the commons of the stepper motor must be connected to +12V.

stepper motor coils L1 L2 L3 L4 CONN1


1 2 3 4

pcb ULN2803A
1 2 3 4 5 6 7 8 I1 I2 I3 I4 I5 I6 I7 Vee I8 10 +Vs O1 O2 O3 O4 O5 O6 O7 O8 18 17 16 15 14 13 12 11

DAQmx
4 3 2 1

P0.3 P0.2 P0.1 P0.0

CONN2

CONN4
1 2 3 4 4 3 2 1

CONN3

Vcc

12V

Vcc

Power Supply 12V 600mA

Figure 1: Overall connection schematic of the phases of the stepper motor to driver and DAQmx.

Project: Seesaw System as a controlled system (February 26, 2012)

7/ 55

2.4 Stepper Motor Interface 2 INVESTIGATIVE AND DEVELOPMENTAL WORK

D1 COM

OUT Q1

R1
B

IN
E

C B

Q2
E

R2

R3

Figure 2: Detail schematic for one output channel of the driver showing the open collector output and the protection diode.

Project: Seesaw System as a controlled system (February 26, 2012)

8/ 55

2.5 Sensor Interface

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

2.5

Sensor Interface

Author: Kai The sensor interface is needed to adabt the output voltage of about 20V provided by the sensors to the input voltage requirements of the DAQmx [4] to about 5V. Further more was the sensor interface supposed to work as input protection towards the DAQmx. Therefore, it occured best to use relaysiterelay, as these provide a nearly perfect seperc ation of voltage and current. The minimal set/reset time for the relays is stated with 15ms and appeared sucient for their anticipated use. The relays work with 12V activation voltage, this required an additional resistor in series with the coil of 270 in accordance with the coil resistance of 720 - those can be found in Figure 3 for the resistors R1 , R2 , R4 , R6 . The switch site of the relay is depicted in Figure 4 and is taken from the user manuale of the DAQmx [4]. Therefore, if the switch of the relay is open then a level of 5V is supplied over an 100k to one port and provides a level of high. If the switch is closed the resistor is connected to ground on the DAQmx and rendering a voltage of 0V on the input port.

sensor interface CONN1 +5V Vcc


1 2 3 4

R2

R3

R5

4 3 2 1

DAQmx

P1.3 P1.2 P1.1 P1.0

U1 CONN1
1 2 3 4

U2

CONN1

RELAY NO

RELAY NO

4 3 2

R1 R7 R8 R4

CONN1

CONN1
1 2 3 4

U3 CONN1
1 2 3 4

U4 Vcc

R6

RELAY NO

RELAY NO

20V

4 3

CONN1

Figure 3: Overall connection schematic of the sensor interface board and DAQmx.

Project: Seesaw System as a controlled system (February 26, 2012)

Vcc

Power Supply 20V 100mA

9/ 55

2.6 Sensor Specs

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

20V Sensor IN

R1

P1.3 P1.2 P1.1 U1 P1.0

+5V Vcc

DAQmx

RELAY NO

Figure 4: Detail schematic for one sensor input. The relay separates the 20V sensor voltage from the DAQmx.

2.6

Sensor Specs

Author: Kai A selection of specications of the proximity sensors found in [1]. The name used in the spec sheet is Cylindrical Inductive Proximity Sensor type TL-X. Special type used NPN NO TL-X 10 ME1. No special attention payed to the mounting type, as typical lab stands where used for putting sensors in place.

Dierential travel DC solid state Response frequency Circuit protection

Type Max. on-state voltage drop Output short circuit

NPN-NO open collector with current source 2VDC 200Hz provided; automtic resetting type

Table 2: signicant sensor specications for the used proximity sensors [1]
1

Naming as used in spec sheet

Project: Seesaw System as a controlled system (February 26, 2012)

10/ 55

2.7 Labview Processes

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

2.7

Labview Processes

Author: Kai2

2.7.1

Stepper Motor Process

The stepper motor process was designed under the consideration that it should contain a bare minimum of functions enabling just the basics of the stepper motor functions ( Figure 5). Some analysis revealed that the last index the stepper motor has locked its position on has to be stored and has to be reused for the next step to insure a smooth forward/reverse behavior. Later on all other functions concerning the system were added by enclosing the stepper motor in further sub vis.

Full Step Sequence Half / Full Step Half Step Sequence prev index

Decimal String To Number Index Array Control Display observing the decimal value of binary pattern

Control Display observing the present active coils prev index

angle present index


Increment / Decrement sequence index output format

present angle angle

Figure 5: Block Diagram of the motor interface in labview DAQmx


here.vi Array subarray The main feature in the stepper motor vi is probably the sequence table to energize the coils for full and half steps Figure 6. Depending on a Boolean input a table was selected enabling it to easily switch between full and half step mode.

The second most important part within the motor interface is most like the incrementor/decrementor (IncDec) ( Figure 7 and Figure 8). The incrementor/decrementor (IncDec) ( Figure 7, Figure 8) becomes aware of the half/full-step mode by a Boolean value and therefore is able to select the right maximum index regarding the sequence table. The IncDec is also as its name suggests incrementing or decrementing the values for the index depending on another Boolean value determining the forward and revers action.
Regarding sources used for the labview process design, only the help documents included with labview were used.
2

Project: Seesaw System as a controlled system (February 26, 2012)

11/ 55

2.7 Labview Processes

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

Full Step Sequence Half / Full Step

Decimal String To Number Index Array

Half Step Sequence Step Sequence Full prev index / Full Step Half

Decimal String To Number ControlIndex Array Display observing the present active coils

angle

Half Step Sequence Figure 6: Detail Figure 5 Sequence tables prev index prev index

present index
Increment / Decrement angle sequence index

Control Disp observing th active coils

present angle angle index prev present index

Increment / Decrement sequence index

present angle angle

Figure 7: Detail Figure 5 Incrementor / Decrementor

Full = T Half = F

HF

uInt8 min_i=0; uInt8 max_i=0; float angle=0.0;

new_index

present index

previous index

previous angle

Dec == True Inc == False

if (HF>0) { prev_index max_i=3; angle=7.5;} prev_angle else{ max_i=7; angle=3.75;} DEC if (DEC > 0){ new_index = prev_index-1; new_angle = prev_angle - angle;} else{ new_index = prev_index+1; new_angle = prev_angle + angle;} if (new_index > max_i) new_index = min_i; if (new_index < min_i) new_index = max_i;

new_angle

present angle

Figure 8: Block Diagram: Incrementor / Decrementor A further value to increment and decrement the angle was added for visual feedback how the value changes depending on which mode the motor is working with. The angle value did not represent any motor angle and would need to be initialized for a certain position each time. The IncDec Figure 8 was implemented totally in a formula node as previous attempts of Project: Seesaw System as a controlled system (February 26, 2012) 12/ 55

2.7 Labview Processes

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

implementation with graphical symbols obliterated the diagram with wires. Separating the IncDec vi in further vis may have provided another solution to obtain readable block diagrams but the formula node did provide a straight forward solution too.

2.7.2

Oscillation Process

The oscillation process was the simplest process and also a test case during the process design Figure 9. It represents, however, the core of the process loop for all further processes taking sensors into account described later on.

Processing Loop

react only if button or sensor reading


False 0 [0..3] step count Half / Full Step angle stop

motor-interface-0-7-1.vi angle

forward
coil index

step delay/ms

Ajdust/Run

default Figure 9: Block Diagram: Oscillation Process

front panel elements

step delay/ms The stacked sequence in Figure 9 can coil index angle detail in subsection A.3 and is not of be seen in further relevance to understand the design principles here. The sequence basically occurs step count delay forward delay reverse here once more and each sequence is separated by a delay time. The delay time can be LEFT RIGHT adjusted in the front panel.

single step buttons for adjusting the lever

The basic functional part to be explained may be that each sequence changes the Boolean forward (as seen in Figure 9) from true to false reverse and so on. The processing loop will repeat this process until the stop button is pressed. Basically this causes the motor to forward and reverse by the amount of dened steps (see blue variable step count) within the loop swinging the lever from left to the right and back. There is one case structure that is of minor interest, except it is supposed to call the motor interface always and only once per button press for adjusting the initial angular position of the lever. Project: Seesaw System as a controlled system (February 26, 2012) 13/ 55

2.7 Labview Processes 2.7.3

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

Single Sensor Process

The single sensor process ( Figure 10) is an extension of the sensor-less oscillation process. The extension in particular, as it can be seen in Figure 10, is the use of an occurrence connector of the sensor loop and the main processing loop.

Main Process Loop

react only if button or sensor reading


False 0 [0..5]

Half / Full Step

Wait on Occurrence
RIGHT LEFT

Ajdust/Run

Enabled Sensor True step delay/ms coil index angle

step count
LEFT

delay forward

delay reverse
RIGHT

single step buttons for adjusting the lever

Figure 10: Block Diagram: Single Sensor Process 1 [0..5] False The stacked sequence is basically the same than in the oscillation process but now is step count motor-interface-0-7-1.vi waiting each time on an occurrence before switching to the next forward or reverse step angle (see subsection A.2). The delay times are also present here to be able to delay the change forward angle coil index of the inclination according to an improved reaction behavior.
step delay/ms The second smaller loop below the main processing loop is the sensor loop. This loop is polling the sensor and according to a signal it switches a case structure causing an occurrence to be raised.

Project: Seesaw System as a controlled system (February 26, 2012)

14/ 55

6 [0..7]

Half / Full Step

delay reverse

2.7 Labview Processes 2.7.4

2 INVESTIGATIVE AND DEVELOPMENTAL WORK


dt sensor 2

Double Sensor Process


if dt is small wait longer to decelerate

The double sensor process is again an extension of the oscillation loop and another sensor loop added (see subsection A.1).
Sensor 1

The more important dierence in the double sensor process is the time measurement loop Sensor within each sensor2loop ( Figure 11). The main features from the single sensor loop can be found again - the occurrence. Additionally another case structure is available now with an internal time loop.
front panel elements
default True Sensor 1 step delay/ms coil index

Ajdust/Run

ang

Sensor 1 fired delay forward


LEFT

RIG

steps s1
True

single step button adjusting the leve dt sensor 1

Elapsed Time2
dt sensor 1

The pulse length dt of an sensor is an indi A short pulse length indicates high velocity slow speed.

Figure 11: Block Diagram:True Time Loop in Sensor Loop


Sensor 2

If a sensor detects a short pulse it may nee get the sphere back.

However, this also introduces If the sensor is active the new case structure will stay active as long as the oposite direction and thethe danger t sensor is Sensor 2 fired in the system bec Process LoopThis also causes to run the inner while loop as long as the sensor is active and active. This means the inclination may only be intr the elapsed timer is running as long as the sensor is active and writes the be reversed soon enough. elapsed time The dt of a s into a variable dt sensor 1. The value of the variable dt sensor 1 is read by anotherbe predicted by sufficie Adjust mode / Run mode set a the phy Basically this could False inclined plane. The goal wouldtime period. be - if we me delay loop within the stacked sequence of the main process loop ( Figure 12). Lever Inclination Sequence
6 True [0..7]

Elapsed Time
Half / Full Step dt sensor 2 delay reverse

how steep should the inclination be to min stop The inclinatio not speeding it up in the opposite direction may achieve The latter condition may ideally be give a fa lever to a levelled state. The former condition is either The problem a 90 degree too long the by the mechanical setup and by the maxim will actually in

Blocking the as the timeou are very nar

dt sensor 2

Figure 12: Block Diagram: Delay with dt sensor 2

if dt is small wait longer to decelerate

The present behaved, as fires. Assum inlination is a sensor need main sequen

Further more must be defi Sensor 1 Sensor 2 Ajdust/Run

Project: Seesaw System as a controlled system (February 26, 2012)

15/ 55

front panel elements


default

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

2.8
2.8.1

System Analysis
Estimation of speed of sphere with one sensor

Author: Yan Editor: Kai The speed of a sphere can be Sensor operating range is 0.008m.Ball of the eld of the sensor and estimated considering the size diameter is as in Figure 13. In move the diameter of the sphere is known 0.019m.The ball should particular for a sphere with a 0.027m(0.008m+0.019m). diameter of 19mm and an estimated eld size of the sensor with 8mm the speed would Velocity 0.027m/Time of ball pass be v = 8mm+19mm = 27mm ; where t= is the time the sphere needs to pass through the t t through the sensor eld of the sensor.

0.027m

Whe
Sensor

0.019m Ball

0.019m

Sensor Operating Range

Ball

0.008m

*m

Figure 13: Using the sensors eld of sensing (operating range 0.008m) to estimate the speed of a sphere. The diameter for one sphere was measured with 0.019m.

We can use this

Project: Seesaw System as a controlled system (February 26, 2012)

16/ 55

2.8 System Analysis 2.8.2

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

Angle of Inclination to stop sphere


4

Author: Yan3

It is possible to estimate at what angle of inclination the sphere might be brought to rest. Considering Figure 14 and Figure 15 the subsequent relationship in Equation 1 may be applied to obtain the angle to stop the sphere at a position L (the end of the rail):
We decide put two sensors on the bridge.

.Ball d move

pass

Figure 14: Rail with two sensors. Lthe the length of one site of the rail and D the distance When is bridge rotate.It can be look like this of a sensor from the pivot point.

el to the e. nd we know that

.019m

a t is time of

Ball

ck to sensor. program.

Sphere
*m*v^2+m*g*sin*D=M*g*sin*(L-D) Sin=v^2/2g(L-2D) =arcSin

Figure mg
3 4

tooth

We can use this to determine which representation of stop 15: Compared to Figure 14 a geometrical angle can make sphere the rail inclined by an At end of bridge. angle of .

p mode)

Addition from the author: Rotational energy = mgh = mgsin() Used reference Yuanyuan Luo[6]

ond between two second. de) de)

Project: Seesaw System as a controlled system (February 26, 2012)

17/ 55

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK (1)

1 2 v + mg sin() D = M g sin() (L D) 2 v2 g(L 2D) 2

sin() =

(2)

= arcSin()

(3)

For instance, inclination of 1 . Gravity can be resolved into two forces. One is parallel to the bridge and the other is perpendicular to the bridge. We only need to pay attention to the rst one.

F1 = mgsin(1 ) and we know F = ma so a =


F , m

(4)

a = mgsin(1 ), m = gsin(1 ). v0 v1 t

a=

(5)

With v0 is velocity of sphere and v1 is zero. Then t =


v0 a

is the time to decelerate the sphere down to zero.

This time * 2 is the time the sphere needs to return to the sensor after passing it. This time can be used to estimate the delay time to hold the inclination of the rail in labview.

2.8.3

Step Size of angle of Seesaw

Author: Yan In the projects system a small gear with 19 teeth and large gear with 56 teeth was used to transfer the rotational motion from the stepper motor onto the rail of the seesaw. The stepper motor was specied with step sizes for full step as 7.5 and for half step as 3.75 . For a step size of 7.5 the angles step size of the lever may occur as 7.5 19 = 2.5 56

Project: Seesaw System as a controlled system (February 26, 2012)

18/ 55

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

and for half step mode with 3.75 3.75 . 19 = 1.3 56

For instance,inclination of 1 degree. Gravity can be resolve into two force. One is parallel to the bridge.another is perpendicular to the bridge. We only need pay attention to the first one. F1=mgSin1,and we know that F=ma . 2.8.4 Estimating Forces acting on motors axis So a=F/m, a=mgSin1/m=gsin1. a=(v0-v1)/t v0 is velocity of sphere v1 is zero . t= v0/a t is time of decelerate the sphere down to the zero. Author: Yan This time * 2 is sphere pass through sensor and come back to sensor. Editor: Kai We can use this to set the delay time in the labview program.

Big gear Sphere


Small gear

mg

Figure 16: Relation of on the motor axis.

Small gear has 19 tooth and big one has 56 tooth Stepper motor sphere over the rail and forces caused by thehalf step:3.75per step gear Full step:7.5per step With big gear,3.75*19/56=1.272321(Half step mode)

system acting

Considering the arm length of the lever from the pivot point (see Figure 16) and assuming 7.5*1*/56=2.544642(Full step mode) the sphere resting at the very end of it, this would cause a kind of a maximum force. If we further assume the lever means how then angleforce is in one secondrectangular manner is leveled, many the change acting in a In labview program delay time means time difference between two downwards regarding to the lever. steps.so 1/delay time = how many steps in one second. F * mg (6) =1/delay time = 1.272321(Half step mode)
=1/delay time * 2.544642(Full step mode)

=F L

(7)

As the force acting caused by the mass of the sphere is rectangular to the lever the cross product to obtain the torque simplies to a straight multiplication:

= mg L The velocity ratio of a gear system as described in [2] would be VR = 19 small gear = = 0.34 big gear 56

(8)

(9) 19/ 55

Project: Seesaw System as a controlled system (February 26, 2012)

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK


1 VR

It appears plausible that then the advantage can be obtained as caused by the weight of the sphere. 56 big gear = = 2.95 smallgear 19

reducing the force

advantage =

(10)

If we neglect any friction in the gear system this would result in a force acting on the axis of the stepper motor by calculating it as follow: axis lever advantage mg L advantage

axis

motor

(11)

axis

motor

(12)

axis

motor

0.082N m 0.026kg 9.81ms2 0.32m = = 0.028N m = 28mN m = 2.95 2.95

(13)

The stepper motor specication subsection 2.3 and [9] state a maximum working torque of 57mNm. This would suggest the system is working well in its specications. But this does not account for any friction yet. Even no particular measurements had been done to determine the frictional forces of the gear system, an estimation suggest that the force is certainly more than 20mNm, that is to add to the force the motor has to bring up. Further more can the specication sheet [9] mentions even a reduction of torque depending on the resting angle the axis is kept in place by the magnetic forces of the phases. Observation of the running system strongly suggest, that the motor working torque is exceeded at some points if the sphere reaches more than two third on one side of the rail towards the end. At this locations of the sphere the motor was not able to change the inclination at all or worse the motor released the rail completely.

2.8.5

Analysis of the Control System

Author: Kai At this stage only an attempt was made to nd the overall structure of the whole feedback system. It turned out that for each dierent mode (sensor less, single sensor, double sensor) a dierent feedback system has to be found. Further more it is not trivial to identify the input value and the type of it, say step input or some other more complicated shape. Time constraints did not allow to do a in depth analysis or even a simulation.

Project: Seesaw System as a controlled system (February 26, 2012)

20/ 55

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

Certainly can we assume that the equation of motion in the system apply to some degree according to Giancoli [3](14-21) without dening the shape of the input force Fi (t) yet: m + bx + kx = Fi (t) x (14)

We may dene m for the mass of the sphere, b is some coecient of damping and k is a constant that certainly contains g as the earths acceleration due to gravity.

Sensor-less The sensor less system may be a typical open loop system. However, the resulting oscillation is certainly to be modeled as a forced oscillation caused by the continuous change of the inclination of the rail of the seesaw. Intuitively we might expect that such a system may be possible to get in a stable oscillation. That would be the case if the damping of the system matches the input force in some way. The damping component in this sensor less system is certainly the frictional force of the sphere acting on the rail. To get such a system to work it would be needed to adjust the inclination of the rail in steps small enough to achieve equivalent values to the frictional force. But as determined in subsubsection 2.8.3 the smallest stepsize to be possible to achieve would be 1.3 . This turned out to be much to coarse to achieve anything close to a stable system. The coarse step size also rises the question about the shape of the input force. Considering a continuously changing of the angle of inclination it might follow a sinusoidal shape. But this changes more and more towards a square wave if the inclination is changed as quickly as possible from one to the other side. Maybe it is possible to account for such a force by applying a sinusoidal force with very big amplitude and cut o at a upper and lower limit.

Single Sensor The single sensor system was surprisingly much easier to tune considering the sphere is only moving on one side between the end and the pivot point. This appears to be plausible considering the change of inclination of the rail that is caused by the weigh of the sphere. If the sphere would cross the pivot point it would introduce an additional value that is not processed by the system and rendering the whole system unstable. We could try to compensate for such a deviation but the systems design did not allow to achieve this without a major redesign (see subsubsection 2.8.3). Also this system appears to be modeled as a forced oscillation and a input more or less shaped as a square wave. However, the major dierence compared to the sensor less system appears to be that the inclination of the rail now acts in two ways. Once it is acting as an input force and then it is acting as an opposing force to slow the sphere down. This suggests that we can produce Project: Seesaw System as a controlled system (February 26, 2012) 21/ 55

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

a damping force that matches much better the input force. And it appears conceivable that we are well able to achieve inclinations to one side equally close matching to the other side, even with the system coarse step size.

Double Sensor without speed feedback The double sensor system was apparently not working, if the sensors only triggered the inclination to an predened angle each time the sphere passes the sensor on its side. The best case in this arrangement occurred if the sphere stabilized on one side and oscillated around one sensor alone.

Double Sensor with speed feedback The double sensor system with a crude speed feedback enabled a stable system to some degree. However, it did prove the advantage of an feedback system. In Figure 17 a very basic model shows a very simplied idea of the system as it was implemented. It is perceivable that we have to assure that the velocity of the sphere (dt) does not exceed some value as it otherwise would travel to far along the rail and falls down.

1 delay before change of angle

error

1 labview

1 stepper motor

angle

1 acceleration of sphere
dt

Gain
delay

Figure 17: Block diagram showing components and values of the feedback system in the two sensor system of the seesaw. We dont consider here the extreme case to erect the rail with an angle of 90 to stop the sphere immediately. It would also not be possible to turn the rail in short enough time to neglect the movement of the sphere anyway in such a case. The system in Figure 17 shows the principle setup of the system. The block diagram exposes the diculties caused by the coarse step size. The angle of inclination was actually pre-adjusted and did not change during oscillation, as any change of it would have set up the system too much than it could have dealt with. Therefore the angle of inclination does not appear within the model here, yet it may appear as a possible constant gain during further analysis and modeling of the system.

Project: Seesaw System as a controlled system (February 26, 2012)

22/ 55

2.8 System Analysis

2 INVESTIGATIVE AND DEVELOPMENTAL WORK

Instead of using the angle as a variable it was decided to use the time delay before the rail is changed back to the new angle. Because it is perceivable, assuming an innite long rail that the sphere must return at some point. The length of the rail therefore restricted the system by the speed a sphere is allowed to be introduced into the system. Even though, two sensors were used, it was not yet implemented to determine the change of speed. This even more, restricted the system such that, the time delay must carefully be tuned. The time delay needs to be in a range such that the frictional force is compensated but does not exceed acceleration of the sphere constrained by the distance it is allowed to travel during a slow down on the other end of the rail.

Project: Seesaw System as a controlled system (February 26, 2012)

23/ 55

3 FINAL SYSTEM

3
3.1

Final System
LabView Performance

Author: Kai The processing system designed in labview did show signicant delays if many loops where arranged. The exact delays where not further investigated but it should be noted, that such delays will have a signicant eect on anything that needs to be recorded in real time. The use of occurrences was the only acceptable way to incorporated multiple independent sensors. However, it should be noted, that occurrences are no low level events and dont provide any real time support. Though, the system suers certainly from signicant delays, it appears that these delays are possible to compensate by appropriate tuning.

3.2

Overall Performance

Author: Kai The overall performance was better than expected considering all detrimental factors occurring during the project development. The probably biggest uncertainty was introduced by the stepper motor and its working and holding torque. Depending where the sphere was located on the lever it introduced signicant deviations of the levers inclination and subsequently major changes in the acceleration of the sphere during movement. The use of single point sensors introduced another unexpected eect regarding the ability to control the movement of the sphere. It might be easy to conceive that we only have to turn the lever if we detect the sphere on one end. However, depending on the speed of the sphere going in one direction the sphere comes to rest in the best case and usually becomes accelerated causing it to drop from the lever after only two or three oscillations, rendering the system unstable. Most interestingly this was not the case for a single sensor arrangement. Final tests proved that the feedback system was contributing to the stability of the system. The rst test without any sensor and applying a swinging lever with a frequency of about 5Hz or even a bit more, showed it was impossible to balance the sphere with such an Project: Seesaw System as a controlled system (February 26, 2012) 24/ 55

3.2 Overall Performance

3 FINAL SYSTEM

arrangement without feedback sensor. It was clearly to see that the sphere was traveling straight to the one or other side of the lever as soon as it crossed the pivot point. This was caused by the deviation due to the weight of the sphere and the inability to rigidly hold the inclination by the stepper motor (see subsubsection 2.8.4). To try to apply higher inclination angles in fact caused to exceed the working torque of the motor many times and causing the motor to drop steps - the system failed totally. The second test was done with two sensors but no speed control yet. The system with two sensors turned out to be unstable too. It stabilized sometimes if the sphere remained on one side causing to switch only with one sensor. This behavior was pointing to an interesting eect, that a single sensor system without speed feedback might be one solution towards one stable arrangement. In fact a setup with an asymmetric sensor arrangement proved that it is enabling a stable oscillation of the sphere. But it was surprising, that it is not working if the sensor is placed at or close to the pivot point of the lever. The nal approach with two sensors and speed feedback enabled the system to be stable after extensive tuning the speed feedback gain. The two sensor system was however a very sensitive system regarding the initial speed of the sphere and sooner or later deviations in inclination of the lever.

Project: Seesaw System as a controlled system (February 26, 2012)

25/ 55

4 TEST AND CALIBRATION OF LABVIEW PROCESSES

Test and Calibration of LabView Processes

Author: Kai The process design was tested regularly oine by incorporating just ordinary buttons instead of sensors. It should be noted, that this includes the danger that time dependent processes may not be possible to test appropriately. The system needs calibration before it may be possible to run at all.

Adjusting the Level To adjust the lever before the rst use, the step delay should be set to at least 200ms. Otherwise each button press triggers more than one step and it becomes very dicult to adjust the lever to the right equilibrium or preset angle. It also should be noted, that, if the adjustment have to be done after a process was stopped the sensors must be red once more again manually after the adjustment mode was activated. Otherwise the adjustment buttons dont react.

Single Sensor Setup The distance of the sensor should be chosen about 100mm from the pivot point - either to the right or to the left. The amount of 4 steps should be adjusted and a step delay of about 80ms. The delay between the inclinations did have no signicant eect as long as they are larger that the step delay and shorter than the sphere needs for each time to travel.

Double Sensor Setup The distance of the sensors were found to be best at 120mm to each site of the pivot point. A step delay of 80ms should be chosen here. For the steps to the left and the right usual values between 2 and 5 were working best. However, these values only determine how dynamic the system is supposed to show up. According to the chosen values of the amount of steps the system needs to be tuned now by the adjustment of the delay times to the left and the right. No exact values can be given here, but it is to expect these values should lie between about 100 and 600ms. Any larger delay times appear to block the sensors too long and cause immediate drops of the sphere. A too short delay time appears to bring the stepper motor in diculties such that it drops steps and causes erratic jumps causing the sphere to drop.

Project: Seesaw System as a controlled system (February 26, 2012)

26/ 55

5 CONCLUSION

Conclusion

Author: all The overall system performance was nally better than expected. Though, the initial expectations were positive right from the beginning, it turned out that it was nedishly dicult to tune the system and bring the sphere to a fairly stable oscillation on the lever. Dierent other published seesaw systems [5] use a fundamentally dierent approach to track the movement of an object and are not directly comparable with the system in this project. The dierence is that, that it is much easier to use systems that track an object continuously by other means than just single point sensors. Though, it might occur that the system exposes a two step control system with two sensors, that does not necessarily mean such systems are easier to control. Each sensor needs to be aware of the speed of the sphere to adjust the inclination and the time to hold the inclination of the lever to gracefully return the sphere each time. It was however, a surprise that it was easier to tune the seesaw with an single sensor compared to a two sensor arrangement, even though the single sensor system did not need a speed feedback. This may be accounted by the fact that the amplitute the sphere was travelling with was much smaller and a much higher damping factor was introduced by the single sided inclination lever, as the system needed to keep the sphere only on one side. Therefore, another test showed, that it was not possible to balance the sphere with an single sensor placed at the pivot point. The single sensor needed to be placed excentrically on one side of the seesaw to obtain a stable oscillation of the seesaw system. And yet another chellange was the rough step size the lever was only able to turn caused by the rough gear system design. Considering the amount of uncertainties the system exposes it was nice to see that it is possible to obtain some stability of such an system. A lot of eort can be put into the control system to make the system even more stable and shows the signicance of computer controlled systems.

Project: Seesaw System as a controlled system (February 26, 2012)

27/ 55

6 LIST OF EQUIPMENT AND COMPONENTS

List of Equipment and Components

Author: all PC double core processor, usb connector LabView software installed on the computer DAQmx usb, national instruments power supply binary, 12V, 20V DMM measuring resistance, voltage range up to 40V, current range up to 1A Table 3: List of used equipment drilling machine, drills screw driver pliers wire stripper single core wire exible / stranded wire soldering iron / gun, solder, uxing agent experimental soldering board mains connectors Table 4: Other tools and material Driver Chip ULN2803A Relays Resistors Wire Terminals Table 5: Electronics Components

Project: Seesaw System as a controlled system (February 26, 2012)

28/ 55

REFERENCES

REFERENCES

References
[1] OMRON: Industrial Automation. Cylindrical inductive proximity sensor: Tl-x10 me1. http://www.ia.omron.com. [2] John Avison. The World of Physics. Thomas Nelson and Sons Ltd. UK, 2nd edition, 1989. [3] Douglas C. Giancoli. Physics for scientists and engineers with modern physics. Pearson Prentice Hall, 4th edition, 2008. [4] National Instruments. Ni usb-6008,6009. http://www.ni.com/pdf/products/us/20043762301101dlr.pdf. [5] Seesaw balancer. http://www.engineering.uiowa.edu/ comcon/lab/Lab2.pdf. [6] Yuanyuan Luo. College Physics. Jiangxi Universities and Colleges Press, 4th edition, 2005. [7] SGS-Thomson Microelectronics. Uln2803a. http://www.datasheetcatalog.com/datasheets pdf/U/L/N/2/ULN2803.shtml. [8] GMIT: Galway Mayo Institute of Technology. Handout Practical; Module: Physics & Instrumentation. Subject: Digital systems 3.1: Practical: The stepper motor. http://www.gmit.ie, 2010. [9] RS Components Ltd. UK. Unipolar 7.5 deg stepper motor, 12v 5.3w. http://uk.rsonline.com/web/search/searchBrowseAction.html?method=getProduct&R=0332953. Size 2.

Project: Seesaw System as a controlled system (February 26, 2012)

29/ 55

A LABVIEW DIAGRAMS

Labview Diagrams

Project: Seesaw System as a controlled system (February 26, 2012)

30/ 55

Project: Seesaw System as a controlled system (February 26, 2012) 31/ 55

A.1

A.1 Double-Sensor

Page 1 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM sensor-pulse-0-3-1-2.vi

Double-Sensor

Fixing the wait occurence locations in the inclination sequence such tthat the first ssensor waits - occurence needs seperate frame. Double Sensor Simulation with documentation of the use of the dt of a sensor. First attempt to describe how to implement the use of the dt (pulse length) of the sensor. Double Sensor System The first sensor is blocked as long as the second has not fired and so on. Basically this means if one sensor detects the sphere it keeps the inclination until the other sensor detects the sphere. step delay/ms 80 steps s1 2 delay forward 220 LEFT left Ajdust/Run angle -3.75 coil index 0 steps s2 5 delay reverse 200 RIGHT right The target is 1s and subsequently starts counting new afte 1s. dt sensor 2 0 dt sensor 1 0

A LABVIEW DIAGRAMS

Adjust if active otherwise run mode!

stop STOP

Sensor 1 forward Sensor 2 reverse

Project: Seesaw System as a controlled system (February 26, 2012) 32/ 55

A.1 Double-Sensor

Page 2 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM Ajdust/Run stop step delay/ms angle steps s1 LEFT RIGHT delay forward delay reverse Sensor 1 Sensor 2 steps s2 coil index dt sensor 2 dt sensor 1

A LABVIEW DIAGRAMS

Project: Seesaw System as a controlled system (February 26, 2012) 33/ 55

A.1 Double-Sensor

Page 3 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM
Process Loop

Adjust mode / Run mode


False Lever Inclination Sequence 1 [0..7] Run N steps at s1 stop

steps s1 Half / Full Step

motor-interface-0-7-1.vi angle

The dt of a sensor is here used to set a time delay for the inclination. Blocking the sensor with a timeout is not suitable as the timeout times are changing havily and are very narrow. The present process is in that way already well behaved, as it just waits until the opposite sensor fires. Assuming that the duration time of the inlination is always much less than the other sensor needs to fire a simple delay in the main sequence may be sufficient. For now we only can pre-adjust the inclination, but this should express anyway a suitable system behavior.

forward
angle coil index

step delay/ms

Sensor 1 Sensor 2

Ajdust/Run

True True Sensor 1

Sensor 1 fired

Sensor 2

Sensor 2 fired

front panel elements


step delay/ms default coil index angle

The pulse length dt of an sensor is an indication of the velocity of the sphere. A short pulse length indicates high velocity and a long pulse length indicates slow speed. If a sensor detects a short pulse it may need to use an increased inlination to get the sphere back.

True True

delay forward Elapsed Time

LEFT

RIGHT

delay reverse

However, this also introduces the danger that the sphere becomes acellerated in the oposite direction and the system becomes unstable. This means the inclination may only be introduced for a short moment and must be reversed soon enough.

Elapsed Time2
dt sensor 2 dt sensor 1

steps s1 single step buttons for adjusting the lever dt sensor 1

steps s2
Basically this could be predicted by the physical properties of a sphere on an inclined plane. The goal would be - if we measure a certain speed of the sphere how steep should the inclination be to minimize the speed of the spher but not speeding it up in the opposite direction? The latter condition may ideally be achieved with an infinite fast return of the lever to a levelled state. The former condition is either a 90 degree inclination but this is obviously restricted by the mechanical setup and by the maximum length of the lever.

A LABVIEW DIAGRAMS

dt sensor 2

DAQ Assistant data

DAQ Assistant2 data

False

False

Project: Seesaw System as a controlled system (February 26, 2012) 34/ 55

A.1 Double-Sensor

Page 4 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM
False 0 [0..7] False

Wait for Sensor 1

2 [0..7]

delay forward

dt sensor 1

if dt is small wait longer to decelerate

3 [0..7]

A LABVIEW DIAGRAMS

steps s1

Reverse N steps at s1

motor-interface-0-7-1.vi angle

reverse
angle coil index

step delay/ms

Project: Seesaw System as a controlled system (February 26, 2012) 35/ 55

A.1 Double-Sensor

Page 5 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM
4 [0..7]

Wait for Sensor 2

5 [0..7]

steps s2

run n steps at s2 motor-interface-0-7-1.vi angle angle coil index

reverse

step delay/ms

6 [0..7]

A LABVIEW DIAGRAMS

delay reverse

dt sensor 2

if dt is small wait longer to decelerate

Project: Seesaw System as a controlled system (February 26, 2012) 36/ 55

A.1 Double-Sensor

Page 6 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM
7 [0..7]

reverse n steps at s2 steps s2 motor-interface-0-7-1.vi angle angle coil index

forward

step delay/ms

True

single step mode for Motor action loop adjusting the lever
Run N steps 1 angle motor-interface-0-7-1.vi angle

RIGHT LEFT

coil index

step delay/ms

A LABVIEW DIAGRAMS

Project: Seesaw System as a controlled system (February 26, 2012) 37/ 55

A.1 Double-Sensor

Page 7 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM

A LABVIEW DIAGRAMS

Project: Seesaw System as a controlled system (February 26, 2012) 38/ 55

A.1 Double-Sensor

Page 8 sensor-pulse-0-3-1-2.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/sensor-pulse-0-3-1-2.vi Last modified on 03/08/2011 at 12:41 PM Printed on 03/08/2011 at 12:42 PM DAQ Assistant2 runs tasks using NI-DAQmx. Refer to the DAQ Quick Start Guide for information on devices supported by NI-DAQmx. Creates, edits, and When you place this Express VI on the block diagram, the DAQ Assistant launches to create a new task. After you create a task, you can double-click the DAQ Assistant Express VI in order to edit that task. For continuous measurement or generation, place a loop around the DAQ Assistant Express VI. For continuous single-point input or output, the DAQ Assistant Express VI might not provide satisfactory performance. Refer to examples\DAQmx\ Analog In\Measure Voltage.llb\Cont Acq&Graph Voltage-Single Point Optimization.vi for techniques to create higher-performance, single-point I/O applications.

DAQ Assistant Creates, edits, and runs tasks using NI-DAQmx. Refer to the DAQ Quick Start Guide for information on devices supported by NI-DAQmx. When you place this Express VI on the block diagram, the DAQ Assistant launches to create a new task. After you create a task, you can double-click the DAQ Assistant Express VI in order to edit that task. For continuous measurement or generation, place a loop around the DAQ Assistant Express VI. For continuous single-point input or output, the DAQ Assistant Express VI might not provide satisfactory performance. Refer to examples\DAQmx\ Analog In\Measure Voltage.llb\Cont Acq&Graph Voltage-Single Point Optimization.vi for techniques to create higher-performance, single-point I/O applications.

Elapsed Time2 Elapsed Time Indicates the amount of time that has elapsed since the specified start time. --------------------

A LABVIEW DIAGRAMS

This Express VI is configured as follows: Time Target: 1 s Auto Reset: On

Project: Seesaw System as a controlled system (February 26, 2012) 39/ 55

A.2

A.2 Single-Sensor

Page 1 single-sensor-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/single-sensor-0-1.vi Last modified on 03/08/2011 at 12:20 PM Printed on 03/08/2011 at 12:47 PM single-sensor-0-1.vi

Single-Sensor

Simulation with a single sensor For the single sensor the inclination must be pre-set! This means the lever has an initial inclination. step delay/ms 60 step count 6 delay forward 500 LEFT left angle 0 coil index 0 delay reverse Delay reverse and forward should not be too short as 500 otherwise both turns happen at once. RIGHT unless it is wanted right Ajdust/Run

Adjust if active otherwise run mode! if adjust is blocked press sensor once or twice.

A LABVIEW DIAGRAMS

Sensor left

Project: Seesaw System as a controlled system (February 26, 2012) 40/ 55

A.2 Single-Sensor

Page 2 single-sensor-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/single-sensor-0-1.vi Last modified on 03/08/2011 at 12:20 PM Printed on 03/08/2011 at 12:47 PM
Main Process Loop

react only if button or sensor reading


False Sequence of inclinations 5 [0..5]

Half / Full Step

delay reverse

RIGHT LEFT

Ajdust/Run

Sensor

Enabled

A LABVIEW DIAGRAMS

True step delay/ms coil index angle

step count
LEFT

delay forward

delay reverse
RIGHT

DAQ Assistant data 0

Index Array

single step buttons for adjusting the lever

Project: Seesaw System as a controlled system (February 26, 2012) 41/ 55

A.2 Single-Sensor

Page 3 single-sensor-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/single-sensor-0-1.vi Last modified on 03/08/2011 at 12:20 PM Printed on 03/08/2011 at 12:47 PM
0 [0..5] False Disabled

not fired

Wait on Occurrence

1 [0..5] Motor action loop Run N steps step count motor-interface-0-7-1.vi angle

forward
angle coil index

A LABVIEW DIAGRAMS

step delay/ms

A.3 Oscillation

A LABVIEW DIAGRAMS

A.3

Oscillation

oscillation-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/oscillation-0-1.vi Last modified on 03/08/2011 at 12:07 PM Printed on 03/08/2011 at 12:49 PM oscillation-0-1.vi angle RIGHT LEFT step delay/ms

coil index

Process to set the lever into an predefined oscillaion. It may be expected that, if the oscillation frequency is suitable in relation to the inlination that the sphere is always sufficiently slowed down to stay on the lever. This system therefore cannot react on externel changes or a different sphere.
Sensor less oscillating system Adjust step delay and step count. Also adjust delay between forward and reverse. step delay/ms 200 step count 2 delay forward 0 LEFT left Ajdust/Run Adjust if active otherwise run mode! stop STOP angle 3.75 coil index 0 delay reverse 0 RIGHT right Adjust angle with a positive value as the forward count will be negative therefore achieving a symmetric counting. But get this in sync with the real system"

step delay/ms LEFT RIGHT angle coil index

Project: Seesaw System as a controlled system (February 26, 2012)

42/ 55

A.3 Oscillation

A LABVIEW DIAGRAMS

oscillation-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/oscillation-0-1.vi Last modified on 03/08/2011 at 12:07 PM Printed on 03/08/2011 at 12:49 PM


Processing Loop

react only if button or sensor reading


False 2 [0..3] step count motor-interface-0-7-1.vi Half / Full Step angle coil index angle stop

reverse

step delay/ms

Ajdust/Run

front panel elements


default

step delay/ms

coil index

angle

step count
LEFT

delay forward

delay reverse
RIGHT

single step buttons for adjusting the lever

Project: Seesaw System as a controlled system (February 26, 2012)

43/ 55

A.3 Oscillation

A LABVIEW DIAGRAMS

oscillation-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/oscillation-0-1.vi Last modified on 03/08/2011 at 12:07 PM Printed on 03/08/2011 at 12:49 PM


True

single step mode for adjusting the lever


1 angle motor-interface-0-7-1.vi angle

RIGHT LEFT

coil index

step delay/ms

False 2 [0..3] step count motor-interface-0-7-1.vi angle angle coil index

reverse

step delay/ms

0 [0..3] step count

motor-interface-0-7-1.vi angle

forward
angle coil index

step delay/ms

Project: Seesaw System as a controlled system (February 26, 2012)

44/ 55

A.3 Oscillation

A LABVIEW DIAGRAMS

oscillation-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/oscillation-0-1.vi Last modified on 03/08/2011 at 12:07 PM Printed on 03/08/2011 at 12:49 PM


1 [0..3]

delay forward

2 [0..3] step count motor-interface-0-7-1.vi angle angle coil index

reverse

step delay/ms

3 [0..3]

delay reverse

Project: Seesaw System as a controlled system (February 26, 2012)

45/ 55

A.3 Oscillation

A LABVIEW DIAGRAMS

oscillation-0-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/oscillation-0-1.vi Last modified on 03/08/2011 at 12:07 PM Printed on 03/08/2011 at 12:49 PM

motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi

Project: Seesaw System as a controlled system (February 26, 2012)

46/ 55

Project: Seesaw System as a controlled system (February 26, 2012) 47/ 55

A.4

A.4 Motor-Interface

Page 1 motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi Last modified on 03/08/2011 at 12:06 PM Printed on 03/08/2011 at 12:50 PM motor-interface-0-7-1.vi Half / Full Step angle Increment / Decrement seque... present angle present index

Motor-Interface

Stepper Motor Interface has direct acces to DAQmx to the hardware interface. It only controls Half / Full Step and forward / reverse. The sequence tables are stored as controls in the front panel for easy modification.

A LABVIEW DIAGRAMS

Project: Seesaw System as a controlled system (February 26, 2012) 48/ 55

A.4 Motor-Interface

Page 2 motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi Last modified on 03/08/2011 at 12:06 PM Printed on 03/08/2011 at 12:50 PM Each time the program is called or run the index wil count up or down and hold the index for a subsequent call Full Step Sequence 0 0 1 1 1 1 0 0 1 0 0 1 0 1 1 0 TODO Test bin order may be reversed

Control Display observing the present active coils 0 0 0 0

Half Step Sequence 0 0 0 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1

Control Display observing the decimal value of binary pattern 0

prev index 0

present index 0

angle Increment / Decrement sequence index 0 present angle Increment 0

A LABVIEW DIAGRAMS

At each run the next coil sequence should occur in the control display. The array may be used directly as the DAQ requires an array anyway. Half / Full Step

output format 0 0 0 0 0

Project: Seesaw System as a controlled system (February 26, 2012) 49/ 55

A.4 Motor-Interface

Page 3 motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi Last modified on 03/08/2011 at 12:06 PM Printed on 03/08/2011 at 12:50 PM Full Step Sequence Increment / Decrement sequence index Half Step Sequence Half / Full Step prev index angle Control Display observing the present active coils

Control Display observing the decimal value of binary pattern output format nr present angle

A LABVIEW DIAGRAMS

present index

Project: Seesaw System as a controlled system (February 26, 2012) 50/ 55

A.4 Motor-Interface

Page 4 motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi Last modified on 03/08/2011 at 12:06 PM Printed on 03/08/2011 at 12:50 PM Full Step Sequence Half / Full Step Half Step Sequence Control Display observing the present active coils prev index angle output format Decimal String To Number Index Array Control Display observing the decimal value of binary pattern

prev index

angle

Increment / Decrement sequence index

present angle

present index
DAQmx here.vi Array subarray

DAQ Assistant data

A LABVIEW DIAGRAMS

Project: Seesaw System as a controlled system (February 26, 2012) 51/ 55

A.4 Motor-Interface

Page 5 motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi Last modified on 03/08/2011 at 12:06 PM Printed on 03/08/2011 at 12:50 PM

A LABVIEW DIAGRAMS

DAQ Assistant Creates, edits, and runs tasks using NI-DAQmx. Refer to the DAQ Quick Start Guide for information on devices supported by NI-DAQmx. When you place this Express VI on the block diagram, the DAQ Assistant launches to create a new task. After you create a task, you can double-click the DAQ Assistant Express VI in order to edit that task. For continuous measurement or generation, place a loop around the DAQ Assistant Express VI. For continuous single-point input or output, the DAQ Assistant Express VI might not provide satisfactory performance. Refer to examples\DAQmx\ Analog In\Measure Voltage.llb\Cont Acq&Graph Voltage-Single Point Optimization.vi for techniques to create higher-performance, single-point I/O applications.

Project: Seesaw System as a controlled system (February 26, 2012) 52/ 55

A.4 Motor-Interface

Page 6 motor-interface-0-7-1.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-0-7-1.vi Last modified on 03/08/2011 at 12:06 PM Printed on 03/08/2011 at 12:50 PM motor-interface-inc-dec.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-inc-dec.vi DAQmx here.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/DAQmx here.vi motor-interface-bin2nr-0.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-bin2nr-0.vi

A LABVIEW DIAGRAMS

A.5 Inc-Dec

A LABVIEW DIAGRAMS

A.5

Inc-Dec

motor-interface-inc-dec.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-inc-dec.vi Last modified on 03/01/2011 at 05:53 PM Printed on 03/08/2011 at 12:53 PM motor-interface-inc-dec.vi Full = T Half = F previous index previous angle Dec == True Inc == False present index present angle

Determain values according to half / full step and forward and reverse. In detail the max index according to half and full step is returned and values for the index and angle are accordingly increased or decreased. previous angle 0 Full = T Half = F present angle 0

present index 0

previous index 0

Dec == True Inc == False

Full = T Half = F previous index Dec == True Inc == False previous angle present index present angle

Project: Seesaw System as a controlled system (February 26, 2012)

53/ 55

A.5 Inc-Dec

A LABVIEW DIAGRAMS

motor-interface-inc-dec.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-inc-dec.vi Last modified on 03/01/2011 at 05:53 PM Printed on 03/08/2011 at 12:53 PM


Full = T Half = F uInt8 min_i=0; uInt8 max_i=0; float angle=0.0; new_index

HF

present index

previous index

previous angle

Dec == True Inc == False

if (HF>0) { prev_index max_i=3; angle=7.5;} prev_angle else{ max_i=7; angle=3.75;} DEC if (DEC > 0){ new_index = prev_index-1; new_angle = prev_angle - angle;} else{ new_index = prev_index+1; new_angle = prev_angle + angle;} if (new_index > max_i) new_index = min_i; if (new_index < min_i) new_index = max_i;

new_angle

present angle

Project: Seesaw System as a controlled system (February 26, 2012)

54/ 55

A.6 Bin2Nr

A LABVIEW DIAGRAMS

A.6

Bin2Nr

motor-interface-bin2nr-0.vi /home/kai/Documents/GMIT_Y3_2/IDL/project/labview/system-0-2-1/motor-interface-bin2nr-0.vi Last modified on 03/01/2011 at 05:53 PM Printed on 03/08/2011 at 12:52 PM motor-interface-bin2nr-0.vi Array nr

Convert an array of binary numbers into a decimal. Attention: It is NOT tested if the binaries are only 1 and 0 ! Array 0 0 Array nr 0

nr nr

Array

nr

nr=a[3]*2**0+a[2]*2**1+a[1]*2**2+a[0]*2**3;

Project: Seesaw System as a controlled system (February 26, 2012)

55/ 55

Você também pode gostar