Title: Robotic balance through autonomous oscillator control and the dynamic inclinometer
CITATION PDF VIEWER THUMBNAILS PAGE IMAGE ZOOMABLE
Full Citation
STANDARD VIEW MARC VIEW
Permanent Link: http://ufdc.ufl.edu/UF00100822/00001
 Material Information
Title: Robotic balance through autonomous oscillator control and the dynamic inclinometer
Physical Description: Book
Language: English
Creator: Nipper, Nathan James
Publisher: University of Florida
Place of Publication: Gainesville Fla
Gainesville, Fla
Publication Date: 2001
Copyright Date: 2001
 Subjects
Subject: Robotics   ( lcsh )
Robots -- Control systems   ( lcsh )
Electrical and Computer Engineering thesis, M.E   ( lcsh )
Dissertations, Academic -- Electrical and Computer Engineering -- UF   ( lcsh )
Genre: government publication (state, provincial, terriorial, dependent)   ( marcgt )
bibliography   ( marcgt )
theses   ( marcgt )
non-fiction   ( marcgt )
 Notes
Summary: ABSTRACT: In order to have robotic systems capable of complex tasks in ever-changing and uncertain environments, we must develop systems with the capability to balance in the general dynamic case. The primary purpose of the research is to demonstrate that active balance through torque application is achievable and able to be implemented independent of support base orientation. This goal can be realized by using an inertial sensor array that can generate accurate position and velocity data independent of support base orientation, in conjunction with a platform that can demonstrate efficient balance control using position and velocity data by varying only stiffness and driving.
Thesis: Thesis (M.E.)--University of Florida, 2001.
Bibliography: Includes bibliographical references (p. 53).
System Details: System requirements: World Wide Web browser and PDF reader.
System Details: Mode of access: World Wide Web.
Statement of Responsibility: by Nathan James Nipper.
General Note: Title from first page of PDF file.
General Note: Document formatted into pages; contains vii, 54 p.; also contains graphics.
General Note: Vita.
 Record Information
Bibliographic ID: UF00100822
Volume ID: VID00001
Source Institution: University of Florida
Holding Location: University of Florida
Rights Management: All rights reserved by the source institution and holding location.
Resource Identifier: oclc - 50743701
alephbibnum - 002763564
notis - ANP1586

Downloads

This item has the following downloads:

NathanNipperThesis ( PDF )


Full Text











ROBOTIC BALANCE THROUGH
AUTONOMOUS OSCILLATOR CONTROL
AND THE DYNAMIC INCLINOMETER

















By

NATHAN JAMES NIPPER


A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL
OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT
OF THE REQUIREMENTS FOR THE DEGREE OF
MASTER OF ENGINEERING

UNIVERSITY OF FLORIDA


2001





























Copyright 2001

By

Nathan James Nipper















ACKNOWLEDGMENTS

I would like to thank my wife, Brianna, who experienced many nights alone while

I worked in the lab and also endured a pregnancy while I finished my research. This

would not have been possible without her unconditional love and support.

Special thanks go to Johnny Godowski. His dreams have inspired this work. He

is a visionary and a pioneer in the robotics field. This work would not be possible

without his guidance and advice.

I would also like to thank Dr. Eric Schwartz and Dr. Antonio Arroyo for allowing

me to pursue my research in the Machine Intelligence Lab. It has truly been a great

experience.

Special thanks go to my parents, for always believing in me. I hope that I will be

the same inspiration for my children that they have been for me.
















TABLE OF CONTENTS
A C K N O W L E D G M E N T S ................................................................. .....................iii
LIST OF FIGURES ................... .. .. ....................... ................. .v
CHAPTERS
1. INTRODUCTION .................... ....... .. ........... ................. 1
R research G oals..................................................................... 1........
M otivation for B balance ................................................. .............................. 1
B balance by Support Shift ............................................... ............................. 2
Balance by Torque .. ......... ..................... ........ ............... 3
The Im portance of B balance .................................................................................... 4
2. LITERATURE REVIEW ..................................... ........................................5
3D One-Legged Hopper- M IT (1984)....................... ................................. 5
Spring Flam ingo M IT (1996)................................................................... ..... 6
G yrobot U university of Illinois.......... ................. ......................... .............. 7
Balancing Act Deakin University..................................................................... 8
3. BALANCE IN THE GENERAL DYNAMIC CASE .............................................9
Sensors for Balance. ........................ ...... ....... .. .. .............. 9
B balance by P rotraction ...................................... .......................... ................ .. 9
B balance by P endulum ..................... .................. .......................... ... ........... 10
B balance by D ynam ic Inclinom etry .................................. ............ .................. 12
Implementation of Dynamic Inclinometer ........................................................ 14
4. AUTONOMOUS OSCILLATOR CONTROL ................................................. 20
P platform M ech an ics .................................................................... ................ .. 2 3
Platform Configuration........................................................... 24
Platform Electronics .............. ............ ......................... ......... .. 29
Processor ................................. .......................... .... ....... 29
S e n so rs ........................................................ 3 1
A ctu atio n .................................................... 3 1
S w in g O p eratio n .................................................. ...................... ................ .. 3 2
5. CONCLUSION AND FUTURE APPLICATIONS ............................................34
APPENDIX A DYNAMIC INCLINOMETER SOFTWARE CODE........................35
APPENDIX B SWINGBOT SOFTWARE CODE.......................... .....................49
L IST O F R E FE R E N C E S .................................................................. .....................53
BIO GRAPH ICAL SK ETCH ............................................... ............................ 54




iv
















LIST OF FIGURES

Figure Page

1-1: Inverted Pendulum balanced by Support Shift.................... ........... ...............3
2-1: 3D O ne-L egged H opper ................................................................. ....................... 5
2-2: Spring Flamingo ............................... ... ...... ... ................. .6
2 -3 : G y ro b o t ................................................................................. 7
2-4: Balancing Act ...................................................................... ...............
3-1: Calculating the Total Effect of Forces on a System.....................................................10
3-2: Pendulum M easurem ent when n = 0 ........................................ ......................... 11
3-3: Pendulum M easurem ent w hen n = ........................................ ......................... 11
3-4: Pendulum M easurem ent when n > ........................................ ......................... 12
3-5: Dynam ic Inclinom eter Test Platform .................................... .......................... ......... 13
3-6: C calculation of ,1 .................................... ......................... ..... .... ........ 13
3-7: Calculation of ..2 ..................................................................... ......... 14
3-8: Calculation of Position (0)......................................................................................... 14
3-9: D I Calibration Fixture .......................... ......... .. .. ..... .. ............15
3-10: D I Calibration R results ............................................................ .. 16
3-11: A sy m m etry ab out 1G ............... ................................................................................ 17
3-12: Linear A acceleration D isparity N oise ........................................ ........................ 18
3-13: Linear A acceleration D isparity N oise ........................................ ........................ 19
4-1: Proportional Derivative Control Law ........................................................ .......... 21
4-2: SwingBOT Platform in AutoCAD ........................................ ........................... 24
4-3: Support Pivot (A ) ........................ .. ........................ .. .... ........ ......... 25
4-4: Swing Body (B).................. ........ .................... ........... 25
4 -5 : C rossb ar (C ).........................................................2 6
4 -6 : S erv o m o to r (D )......................................................................................................... 2 6
4-7 : C controller (E ).........................................................26
4-8: A ngular Position Sensor (F) ........................................................................ ..27


v









4-9: G ain Selects (G ).........................................................27
4-10: A ctual Sw ingB O T Platform ........................................................................... .... ... 29
4-11: Sw ingB O T E electronics ............................................................................... ..... .... 30
4-12: SwingBOT Electronics Block Diagram ............................................ ............... 30
4-13: SwingBOT Control System ..................................................................... 32

















































vi















Abstract of Thesis Presented to the Graduate School
of the University of Florida in Partial Fulfillment of the
Requirements for the Degree of Master of Engineering

ROBOTIC BALANCE THROUGH
AUTONOMOUS OSCILLATOR CONTROL
AND THE DYNAMIC INCLINOMETER

By

Nathan James Nipper

August 2001


Chairman: Dr. Antonio Arroyo, Associate Professor
Major Department: Electrical and Computer Engineering

In order to have robotic systems capable of complex tasks in ever-changing and

uncertain environments, we must develop systems with the capability to balance in the

general dynamic case. The primary purpose of the research is to demonstrate that active

balance through torque application is achievable and able to be implemented independent

of support base orientation.

This goal can be realized by using an inertial sensor array that can generate

accurate position and velocity data independent of support base orientation, in

conjunction with a platform that can demonstrate efficient balance control using position

and velocity data by varying only stiffness and driving.














CHAPTER 1
INTRODUCTION


Research Goals

The primary purpose of the research is to demonstrate that active balance through

torque application is achievable and able to be implemented independent of support base

orientation in the general dynamic case. This goal can be realized through the

combination of two platforms:

1. An inertial sensor array that can generate accurate position & velocity data
independent of support base orientation.

2. A platform that can demonstrate efficient balance control using position and
velocity data by varying only stiffness and driving.

The design and control of these devices form the basis of this thesis.


Motivation for Balance

In order to have robust systems capable of complex tasks in ever-changing and

uncertain environments, we need to have systems that model nature. The primary reason

for modeling nature is that nature is efficient. The balance and coordination achieved by

humans and animals has proven to be stable in varying environments and robust in

multiple applications.

Another reason for developing human-like robots is that the planet is pre-

engineered for human function. Our world consists of uncertain terrains such as stairs

and buildings. Robots of the future will have to be able to perform their tasks and move

around in these uncertain and varying environments.









Nature has determined that legs are the best method for locomotion. Land-

dwelling animals use legs to get from one place to the next.

Another reason for legs is that walking is a very efficient use of energy. The

trade-off is that the geometry and dynamic model become very complex. Red Whittaker,

of Carnegie Mellon University, says, "Without mobility, a robot is limited to only the

space where it can reach. So mobility, as a function, is the crux the essential capability

for complex achievement."

The major disadvantage to creating human-like robots (two legs) is that balance is

more difficult. Gill Pratt, the director of the MIT Leg Lab, notes, "With two legs, you

have to do dynamic balancing." The cost of greater mobility is decreased stability. In

order to receive the benefit of human-like robots, we have to overcome the problem of

balance in the general dynamic case.


Balance by Support Shift

There are two types of balance, support shift and torque balance.

Support shift balance is the typical solution to the inverted pendulum (or

rotational inverted pendulum) problem. In this case, the support base of the robot can be

moved laterally to balance a load. The result is the balance is achieved because the

support base remains beneath the load.

Support shift balance can also be observed during walking, the system can be

dynamically tuned to achieve a stable oscillation around the support base. The support

base is shifted slightly to maintain balance.









The advantage of support shift balance is that it uses low energy to accomplish

balance within a specified non-constrained path. When the balance parameters are no

longer within the path constraints of support shift balance, torque balance is required.





m, I










Figure 1-1: Inverted Pendulum balanced by Support Shift




Balance by Torque

Applying torque between respective segments of a system to induce a support

reaction that will return the system to the desired position

Torque balance requires much higher energy than support shift balance, but it is

necessary in situations where the path or support base is constrained. The following

examples describe situations where torque balance is needed:

1. Standing on one leg.

2. Walking on a beam (straight line or a tight-rope).

3. When acted on by an outside force.

4. When a sudden direction change is necessary.

5. Riding a bicycle (support constrained).






4


The Importance of Balance

In order to accomplish complex tasks, a free system must continually configure

itself in the driving field while maintaining balance. The robot becomes the link between

the object to be acted on and the support base of the robot.

It is essential to maintain coordinated balance in order to apply the required forces

to complete a general task. The most efficient balancing system would contain both

support-shift and torque balance components and be capable of operation in a

dynamically changing environment.














CHAPTER 2
LITERATURE REVIEW

This chapter summarized many of the current balance technologies being used


today.


3D One-Legged Hopper MIT (1984)


Figure 2-1: 3D One-Legged Hopper


The 3D One-Legged Hopper has a 2-axis hip powered by hydraulics. The leg is

powered by compressed air.

The robot is able to remain upright by bouncing on the single leg. The action

resembles a pogo stick. The robot must keep hopping in order to maintain balance.

The equations of motion reduce to a ballistics problem when the robot is in the

air. This is due to the structure. The frame is very heavy (38 lb.) while the leg is

relatively light. So movement of the leg in the air does not significantly affect the inertia









of the system. Using this assumption, the location and orientation of the landing can be

calculated. This robot may use an inertial sensor to determine orientation at actuation,

and then position the actuator for next landing to follow the desired path.


Spring Flamingo MIT (1996)

The Spring Flamingo is a planar bipedal walking robot. It must be constrained

laterally, but is capable of maintaining balance and taking steps. This robot is still quasi-

static, although beginning to use series elastic actuators for minimal force control [1].














Figure 2-2: Spring Flamingo



The robot uses support-shift balance to remain upright and costs approximately

$100,000.









Gyrobot University of Illinois












Figure 2-3: Gyrobot



Gyrobot is a single link pendulum with an inertial, motor-driven flywheel located

at the free end of the link. The support pivot is constrained and not actuated. The motor

controls the acceleration of the flywheel, which passively transfers energy in the flywheel

to energy in the link [2].

A shaft encoder at the pivot determines the position and velocity of the pendulum

link. A change in velocity (acceleration) of the flywheel causes a change in link angle,

which enables the pendulum to swing up from the downward vertical stable equilibrium

to the inverted unstable equilibrium and maintain balance at the unstable inverted

position.

Gyrobot is an example of achieving balance exclusively by torque application











Balancing Act Deakin University



Counter Foam Paddle
Weight







Motor

Figure 2-4: Balancing Act



Balancing Act is a two-legged platform that balances through torque application.

A single inertial sensor provides position and angular velocity of the robot platform. A

foam paddle exerts torque by pushing against the air to maintain balance.

A fuzzy logic controller uses the position and velocity information to drive the

motor and keep the robot balanced. The result is a slow rocking motion as the robots

oscillates around the upright position.

Since Balancing Act is a heavy, high inertia platform inconsistencies in quasi-

static measurement data are masked.














CHAPTER 3
BALANCE IN THE GENERAL DYNAMIC CASE


Sensors for Balance

There are three types of measurement sensors that can be used for balance. These

methods are protraction, pendulum sensing, and Dynamic Inclinometry.

Protraction is using a mechanical or optical sensor to determine the angle of the

system with respect to the base. The actual sensor could be a potentiometer or an optical

encoder. This method can generate accurate measurement information of position and

velocity, but the orientation and position of the platform base must be known. If the

platform base were tilted, this sensing method would no longer work.

Pendulum sensing could be accomplished by using a single inertial sensor, like an

accelerometer. This method can yield effective results in the quasi-static case, but does

not work in the general dynamic case.

Dynamic Inclinometry (DI) uses the linear disparity between two inertial sensors,

placed a small distance apart, to determine angular velocity. The displacement angle can

be computed by the static acceleration plus a rotational acceleration. This is a valid

approach for the general dynamic case. Sensing by protraction and pendulum methods

breakdown in the general dynamic case.


Balance by Protraction

Protraction sensing is typical for solving the inverted pendulum problem using

support shift. The deflection angle can differentiated to provide velocity and acceleration









information. This sensing method is only valid for cases where orientation of base with

respect to gravity is known (special lab case).


Balance by Pendulum

In this method, a pendulum, or single inertial sensor, is used to determine the

deflection angle. This sensing method is only valid for quasi-static case, when the system

is either stationary or moving very slowly.

When system is falling, pendulum measurement becomes zero. Pendulum

measurement is even worse when additional forces act in addition to gravity.

To understand this phenomenon, we need a way to describe the total effect of the

forces acting on the system. The variable n will be used to describe the relationship

between the total acceleration of the system and the acceleration due to gravity.


Tangential Acceleration of System (at)

Tangential Acceleration due to Gravity (ate)
Figure 3-1: Calculating the Total Effect of Forces on a System



For the purpose of this discussion, the system is an inverted pendulum with a

single two-axis accelerometer mounted at the top of the link (Figure 3-2).

Consider the static case (n = 0). In this case, the system is not moving, and so the

only force acting on the system is gravity. The position of the system canbe determined

by the vector sum of the radial and tangential accelerations due to gravity.

















/ TT
Figure 3-2: Pendulum Measurement when n = 0


The next case to consider is when n = 1. In this scenario, the tangential

acceleration of the system is equal to the tangential acceleration due to gravity

(Figure 3-3). The result is that the two tangential vectors cancel each other and the

direction of the resulting vector is always along the shaft of the system. This is true

regardless of the actual direction of gravity with respect to the sensor. This is where the

pendulum method breaks down. There is no way to get the actual position of the system

because the tangential acceleration at the sensor is zero.


Figure 3-3: Pendulum Measurement when n = 1









The final case is when n is greater than 1. In this case, the tangential acceleration

of the system is greater than the tangential acceleration due to gravity. The direction of

the resulting vector is actually in the opposite direction from the actual gravity vector. In

Figure 3-4, the tangential acceleration of the system is twice the tangential acceleration

due to gravity.












Figure 3-4: Pendulum Measurement when n > 1



It is clear from this analysis that the pendulum method will not yield useful results

in the general dynamic case. This is why the method of Dynamic Inclinometry was

developed, to provide useful measurements for balance in the general dynamic case.


Balance by Dynamic Inclinometry

This method uses two dual-axis accelerometers, mounted a small distance apart.

The architecture functionally models human balance system, in that it measures the same

physical parameters. Linear acceleration can be determined from average readings from

linear accelerometer array. Angular acceleration can be determined by disparity in the

linear array. The dynamic position is derived from the combination of linear and angular

accelerations.























Figure 3-5: Dynamic Inc


In the static case (n = 0), linear acceleration is measured using the average of both

accelerometers (Figure 3-6). Angular acceleration is not present. The static position, (1,

is calculated from these average accelerations.


XAVG YAVG










1 = TAN-'[XAVG YAVG]
Figure 3-6: Calculation of 41


In the dynamic case, The DI uses the linear acceleration disparity to determine

angular acceleration. The dynamic position, 42, is calculated from this disparity.


lometer Test Platform











YL

YR


2

d

2 = TAN- [(YR YL)/ d]
Figure 3-7: Calculation of 42


The actual position of the system (0) is a function of both the static position (l1)

and the dynamic position (12), with a known or assumed moment of inertia. This method

can yield the angle of the system in the general dynamic case


I = OI + (02 /1)
Figure 3-8: Calculation of Position (0)



Implementation of Dynamic Inclinometer
There were many issues that had to be solved for the actual implementation of the

Dynamic Inclinometer theory. The first hurdle was that software code needed to be very

efficient to achieve the goal of a 30Hz-sampling rate. The target processor for this

application was the Motorola 68HC11, since the application is primarily for embedded

systems. The actual sampling rate on the final product was about 40Hz.

Another problem was that there were sensor errors from multiple sources. These

sources included bias, scale factor, non-linearity, asymmetry, noise, drift, and






15


temperature. Eventually, a good method for calibration was realized to minimize effects

from bias and scale factor errors.

The calibration fixture designed in AutoCAD to provide consistent measurements

at known positions. Spreadsheet analysis was performed to determine error sources and

magnitudes. These values were used in the software to reduce the errors seen by the

system.














Calibration of XLeft Sensor

-*XLnominal -*-XLFitted --XLRaw

















30 -20 -10 0 10 20 3
Degrees

Figure 3-10: DI Calibration Results


Another source of difficulty in the implementation process was a sensor

asymmetry that occurred around 1G. A plausible explanation for this occurrence could

not be ascertained. The solution to this problem was to rotate the sensors 45 degrees to

remove this part of the curve.

This fix made the small angle trigonometric approximation problematic. The

solution was to use trig lookup table. The lookup table was at first very computationally

intensive. This was reduced significantly with a binary search algorithm.













Asymmetry of Y_Left about 1G


--Ynominal


- YLActual


-0.88

-0.9

-0.92

S-0.94

^ -0.96

-0.98

-1

-1.02
3-


30


-10 0 10
Degrees

Figure 3-11: Asymmetry about 1G


A low-pass filter was used on the sensor output to limit high-frequency noise.

Additional software filtering techniques were also required. Noise is especially

problematic in disparity-based angular acceleration calculation. Drift is not a significant

source of error. Multiple calibrations show very little change in average sensor data.

Variations due to temperature are ignored. Adjustable parameters facilitate

calibration from all error sources.


' A/


















Disparity of Linear Accleration in Radial Direction

--Y_Difference -- Filtered
2.0


1.5


1.0


0.5 -

00.0


-0.5


-1.0 -


-1.5


-2.0


Figure 3-12: Linear Acceleration Disparity Noise




The results of the implementation were very promising. The calculation of linear


acceleration (1) is very stable and repeatable. The calculation of angular acceleration


(Q2) is still noisy, but much improved over previous attempts. This method shows

promise with reduction of angular acceleration noise and available added resolution.









19






Filtering Large Changes in Linear Disparity

YdiffMoreFilter --Ydiff

200


150


100


50


0


50


100


150


200
-15 *--------------------------------------------------- ---------


Figure 3-13: Linear Acceleration Disparity Noise














CHAPTER 4
AUTONOMOUS OSCILLATOR CONTROL

The Dynamic Inclinometer demonstrates that active balance using inertial sensors

is possible, given the proper actuation system to perm torque balance. SwingBOT is a

useful platform for implementing balance through oscillator control using the Dynamic

Inclinometer. SwingBOT is a simple harmonic oscillator controller that exerts torque as

a function of position and velocity. It is a concept illustration platform to show that

torque balance is possible.

The pendulum model, both in its inverted form and in the non-inverted or swing

form, is recognized here as a useful general basic model employable by analogy to all

dynamic robotic tasks of similar order, including balance, and aspects of locomotion and

manipulation.

The implementation embodied here constitutes a simple case, in which the

inherent passive stiffness, which is elastic resistance to deflection, of the system is

overcome in a limited region by actively exerted, augmentative, deflection-related torque

along with velocity-dependent torque to achieve maximum efficiency.

The most efficient method of increasing the frequency of oscillation is by

increasing the stiffness. This can be done through active deflection-related torque

application to augment the inherent passive stiffness of the system. This is known as

stiffening torque. Stiffening torque generally affects stiffness, and therefore frequency of

oscillation [3].









The most efficient method of driving oscillations is through actively applied,

velocity-related torque. This is known as driving torque. Driving torque changes the

energy of the system, and so generally affects the amplitude of oscillation.

Both driving and stiffening torque can be applied as described above, or in the

reverse sense. The deflection-related torque may be applied to counteract inherent

stiffness, making the system behave as though it were less stiff. Similarly, the driving

torque can be applied in a negative sense, to reduce the amplitude, instead of augmenting

it.

In the theoretical approach, the system is configured with passive elastic

deflection restraint such that the inherent stiffness is consistent with the desired

oscillating frequency. No active energy expenditure is generally needed to maintain

desired frequency in this approach, except as occasionally required to induce some small

and temporary deviation from the inherent frequency.

To drive oscillations, a driving torque proportional to the measured angular swing

velocity would be exerted. To drive the frequency of these oscillations, a stiffening

torque proportional to the measured angular displacement would be exerted. To achieve

the theoretical optimum for efficient oscillator control, both the driving torque and the

stiffening torque are applied simultaneously. This type of control is known as the

Proportional Derivative Control Law [4].









The general theoretical approach requires the measurement of both position and

velocity, and the calculation of respective torques proportional to each. The gain values,

K1 and K2, are selected to achieve the desired function.

This means that if the swing is displaced a small amount from the vertical, torque

will be applied to actively increase this deflection. This active effect compounds, since

as the torque is applied the swing is displaced even further, giving rise to even greater

applied torque, and so the swing is displaced further still.

Eventually a point is reached where the servo is overpowered by inherent elastic

restraint (gravity acting to swing the pendulum back), or the servo runs into its limit of

travel, and so can exert no additional torque.

At this point, the swing begins to return, swinging back through the zero point and

continuing to the other side, where similar corresponding activity takes place. In this way

the swing amplitude is continually increased until a balance is achieved between applied

power and inherent elastic restraint. In this case, the inherent elastic restraint is gravity.

By adjusting the gains, or proportionality of both driving and stiffening torques,

the amplitude of the resulting oscillations can be adjusted.

The servo cannot respond immediately to a change in signal, as there is some real

time delay involved. Also, if the servomotor is turning rapidly, its own inertia must be

overcome before it can stop and reverse direction. This same inertia is a factor as the

motor accelerates from rest. The servo as presently configured is limited in its angular

travel to slightly under ninety degrees in either direction from the center value. The

commands to the servo must keep the desired servo position within these travel limits.









In this configuration, the predominance of these effects throughout the swing

cycle appears favorable. The delays shift the phase of the applied torque with respect to

the swing angle, and thereby may cause the applied action to have more of a driving

effect.

This would be consistent with our expectations, since in oscillatory motion, the

velocity is phase delayed by ninety degrees. Since driving is theoretically proportional to

velocity, any phase shift or delay effect with respect to position contributes more to

driving, in either a helpful or adverse sense depending on conditions. It may be possible

to alter these delays to further modify the driving effect in useful ways.

At the extremes of swing amplitude, the servo travels from one limit to the other,

and so is always configured to apply its full torque to greatest effect. This is another

synergistic system quality.

The power of this method is in the ability to induce oscillations in analogous

robotic systems. A swinging or waving arm or walking leg, flapping wing, waving

antenna or flag, or any similar robotic structure whose chief function is to oscillate can be

simply and effectively excited to do so by suitable adaptation of this control method.


Platform Mechanics

The SwingBOT apparatus can be best understood as functionally modeling the

familiar example of a child swinging on a swing.

If the swing is at rest and the child in the swing remains motionless, no torque is

induced on the system and the swing remains at rest.

Once the child starts to move the legs and upper body, a torque is induced on the

system and the swing begins to oscillate. The child can increase the amplitude of these









oscillations by moving the legs and upper body so as to induce a torque on the system

that leads the phase of the swing itself by 900.

Conversely, the child can decrease the amplitude of the swing's oscillations by

inducing a torque on the system that lags the phase of the swing by 90.















Figure 4-2: SwingBOT Platform in AutoCAD




Platform Configuration

The simple non-inverted pendulum consists of the following:

A) A support pivot, (the top of the swing, from which the rest of it swings)

being a horizontally oriented rod constrained to allow only rotation about its longitudinal

axis,


















figure 4-3: Support Pivot (A)


B) A first linear structural element perpendicularly attached to (hanging

from) the support pivot and thereby constrained to allow only rotation in a vertical plane

about the horizontal pivot axis (swinging), and











Figure 4-4: Swing Body (B)



C) A second linear structural element (crossbar), being a attached to the first

linear structural element by constraint (crossbar pivot) allowing only rotation in a vertical

plane (see-sawing) about a crossbar pivot axis oriented parallel to the support pivot axis

(top) and displaced some distance (bottom of the swing). The crossbar is actuated by



















l gure 4-5: Crossbar (C)


D) A servomotor responding to the actions of


E) A controller using inputs from


Figure 4-7: Controller (E)


F) An angular position sensor mounted suitably with respect to the support


pivot axis and













Figure 4-8: Angular Position Sensor (F)


G) Two gain selectors configured for operator input.






*I
Figure 4-9: Gain Selects (G)

We refer again to the case of the case of a child swinging on a swing:
The support pivot (A) is the top of the swing-set, from which the rest of the swing
is suspended.
B above is the hanging swing structure that hangs the chair from the support.
C above is the child seated in the chair, who exerts torque by holding on to B,
while effecting dynamic body and leg motions through motor action (D), to excite the
swing system into desired oscillations.
The controller (E) is the brain of the child, which senses parameters related to
swing amplitude (F), and chooses appropriate desired gain (G). These values are






28


processed to calculate and effect the motor action (D), which drives the body and legs to

exert torque, thereby driving the swing.

In the SwingBOT, the support pivot (A) is mounted atop a wooden dual A-frame

structure resting on the floor for support. The Pivot axis is oriented horizontally at the

top of the A-frame structure, extending between the peaks of the two A-frame trusses

comprising the support structure.





























Figure 4-10: Actual SwingBOT Platform


The pendulum and crossbar swing from this support axis. The controller, with its

associated power supply, occupies a shelf partway up the outside of one of the A-frame

trusses. Ribbon-wires connect power and signal to the servomotor and two

potentiometers. One potentiometer is mounted along the pivot axis atop the A-frames to

determine swing position angle, and the other receives manual input to implement desired

gain.


Platform Electronics

Processor

The processor is a Motorola 68HC11. It is installed on a MTJPRO11 board from

Mekatronix [5]. The 8-bit processor is operated in expanded mode at 2MHz with 32K

external SRAM. The internal processor hardware used in this project includes the A/D

Converter and Output Compare subsystems.

















Figure 4-11: SwingBOT Electronics


The HC6811 contains an 8-bit Analog-to-Digital converter. There are eight

individual inputs to the system, which takes 16ms per conversion. The Output Compare

system allows timer-driven interrupts based on a 16-bit free-running counter. This

hardware system allows pulse-width modulated (PWM) waveforms to be generated using

interrupts.

68HC11
PE5
Angle A/D Converter Mode
POT Switch

PE6
FF6 PE4
Velocity
Gain
POT Output Compare
PA5
PE7 Motor
Deflection ,
D efl section ......................... ..i ... ................. ..........
Gain
POT
Figure 4-12: SwingBOT Electronics Block Diagram









The software for this project was developed using the ImageCraft C compiler for

the 68HC11.

Sensors

The swing uses three sensors during operation.

A 1K potentiometer is used to measure the deflection angle of the swing from the

resting position (Angle POT). The outer pins are connected to Vc, and GND to create a

voltage divider output with the center contact. This voltage is read using the 8-bit A/D

converter hardware inside the 68HC11. This results in an angle resolution of

approximately Idegree.

Another 1K potentiometer is used to determine the open-loop gain of the motor

output (Gain POT). This is a user input that can be varied during operation. A similar

voltage divider circuit is read using the A/D converter to determine this desired gain.

A Single-Pole, Single-Throw switch is connected to one of the 68HC11 digital

inputs. This is a user input to determine if the crossbar will be driven to increase or

decrease the amplitude of the oscillations (Mode Switch).

Actuation

A Cirrus CS-80 servomotor controls the position of the crossbar. The rated stall

torque is 343 oz/in. The position of the servo is determined by the positive width of a

50Hz PWM signal. The positive pulse width for the center position is 1550ms. The

PWM signal is interrupt driven and uses the Output Compare hardware in the 68HC11.

Due to the mechanical structure of the platform, the motor is restricted to 160 degrees of

rotation.








Swing Operation

The torque output of the servomotor is directly proportional to the magnitude of

the difference between the current and desired positions. The user input at the gain

potentiometers (K1 and K2) scales this torque value accordingly. The software for this

application commands the motor to a higher torque based on the swing velocity and the

amount of deflection from the resting position of the swing. The direction that this torque

is applied depends on the mode of operation.


Velocity
Gain
K2
Motor
Fi C o Controller


Deflection
Gain



Angle System M
d0/dt *- Motor
POT Actuation
Figure 4-13: SwingBOT Control System


SwingBOT has two modes of operation. In the first mode, the stiffening torque is

applied to counteract inherent stiffness, and driving torque is applied to increase the

swing velocity. This applied torque, coupled with the driving forces of the system

dynamics, increases the amplitude of the swing oscillations. At maximum gain, the

swing can achieve amplitudes of about 30 degrees from the resting position.









In the second mode, the torque is applied in the opposite sense. The stiffness is

increased and the driving torque decreases the swing velocity. The result is that the

oscillation amplitude is reduced. This results in a system that controls the crossbar to

maintain the resting position.














CHAPTER 5
CONCLUSION AND FUTURE APPLICATIONS

The conclusion of this research is that active balance through torque application,

in the general dynamic case, is achievable using inertial sensors. The Dynamic

Inclinometer can generate position & velocity data in the general dynamic case, and the

SwingBOT demonstrates oscillator control using position and velocity data by varying

only stiffness and driving

There are many possibly applications of this work. The sensing methods of the

Dynamic Inclinometer and a torque balance platform could be combined to accomplish

autonomous bike riding. Another application is that the SwingBOT oscillator control

code can be used to drive oscillators in the general case. These oscillators can be used to

drive any elastically linked oscillator.

Another feature of this work that will require more study is the addition of

feedback capability to continue operation when moment of inertia changes.

The combination of balance by torque and support shift in the general dynamic,

through dynamic inclinometry, is the most promising architecture for future robotic

platforms that emulate living systems.





















APPENDIX A

DYNAMIC INCLINOMETER SOFTWARE CODE



botlOl.c
than J. Nipper
ily 21, 2001
)m


I Q nrlrt- T! r'I^ c;- tn hQ tI 1' 1h -t nI r T\ qT~ q' n~T q\ir q^D Q -7


od for read


ion 7: Adding
ion 7d: Change
Added


: Add good
10j: Add b
: Add Degr(


addedd


include
include



























































id desired


.X Right = Ide
. Y Right = Id






















































69,
78, 0.
0.315
182,
, 0.34
, 0.35
33, 0.
165,
'15,
'26,
124,
47, 0.
4, 0.4
6, 0.4


, u .
;7, 0.
)6, 0.
15, 0.
19, 0.
1, 0.
13, 0.
5, 0.
, 0.4.
i, 0.4
*1, 0 .
83, 0.
6, 0.
;1, O.
3, 0..
52, 0.
'8, 0.
18, 0.2









38



0.939062506, 0.942352329, 0.945652991, 0.948964567, 0.95228713, 0.955620757, 0.958965522,
0.962321502, 0.965688775, 0.969067417, 0.972457508, 0.975859126, 0.97 351,
3944, 0.989582475, 0.993042939, 0.99651542 1, 1.003496765,
1.0070058, 1.010527192, 1.014061027, 1.017607393, 1.021166379 1.0247028322566,
1.031919949, 1.035530314, 1.039153752, 1.042790358, 1.046440225, 1.050103449,
1.053780125, 1.057470351, 1.061174223, 1.06489184, 1.068623303, 1.072 71, 1.076128164,
1.079901766, 1.08368962, 1.08749183, 1.091308501, 1.095139739, 1.098985651, 1.102846344,
1.106721929, 1.110612515, 1.114518213, 1.118439135, 1.122375395, 1.126327107,
1.130294386, 1.134277349, 1.138276113, 1.142290798, 1.146321522, 1.15 07,
1.15443176, 1.15851115, 1.162607256, 1.166720019, 1.170849566, 1.174 1.179159526,
1.183340199, 1.187538177, 1.191753593, 1.195986581, 1.200237278, 1.20 1.20879235,
1.213097004, 1.217419925, 1. 17.226121139, 1. 11, 1230499724, 1.23 157,
1.239313585, 1.243749161, 1.248204036, 1.252678364, 1.257172299, 1.261685998,
1.266219621, 1.270773326, 1.275347275, 1.279941632, 1.284556562, 1.289192232, 1.29384881,
1.298526466, 1.303225373, 1.307945704, 1.312687636, 1.317451347, 1.322237014,
1.327044822, 1.331874952, 1.33672759, 1.341602923, 1.346501142, 1.351422438, 1.356367004,
1.361335036, 1.366326733, 1.371342293, 1.37638192, 1.381445819, 1.386534195, 1.391647258,
1.39678522, 1.401948294 1.407136697, 1.412350648, 1.417590366, 1.422 77, 1.428148007,
1.433466383, 1.438811438, 1.444183406, 1.449582523, 1.455009029, 1.460463166,
1.465945179, 1.471455316, 1.476993828, 1.482560969, 1.488156995, 1.493782166,
1.499436745, 1.505120998, 1.510835194, 1.516579605, 1.522354507, 1.528160179,
1.533996902, 1.539864964, 1.545764652, 1.551696259, 1.557660082, 1.56365642, 1.569685577,
1.57574786, 1.58184358, 1.587973051, 1.594136594, 1.600334529, 1.606567185, 1.612834891,
1.619137983, 1.625476801, 1.631851687, 1.63826299, 1.644711062, 1.651 1.657718944,
1.664279482, 1.670878245, 1.677515606, 1.684191948, 1.690907656, 1.697663119,
1.704458734, 1.711294902, 1.718172028, 1.725090524, 1.732050808, 1.7390533, 1.746098431,
1.753186632, 1.760318346, 1.767494016, 1.774714096, 1.781979042, 1.789289319,
1.796645398, 1.804047755, 1.811496875, 1.818993247, 1.826537369, 1.834129745,
1.81770886, 1.84946131, 1.857201543, 1.864992118, 1.872833576, 1.880726465, 1.88867142,
1.896668769, 1.904719321, 1.912823577, 1.920982127, 1.929195568, 1.93
1.945789558, 1.954171346, 1.962610506, 1.971107679, 1.979663518, 1.988278686,
1.996953856, 2.005689708, 2.014486937, 2.023346245, 2.032268347, 2.041253967,
2.0503718, 2.0685993, 2 2.077846524, 2.087161007, 2.096543599,
2.105995109, 2.115516356, 2.1251081, 2 2.134771408, 2.144506921, 2.15
2.164198288, 2.174155933, 2.1841894362.1.194299731, 2.204487764, 2.214754498,
2.225100911, 2.235528, 2.246036774, 2.256628263, 2.267303512, 2.278063586, 2.288909564,
3654, 2.321974022, 2.333174808, 2.34446719, 2.355852366, 2.36733154,
.378905995, 2.39057695, 2.402345703, 2.414213562, 2.426181858, 2.438 .4 25198,
2.462703025, 2.475086853, 2.487578139, 2.500178362, 2.512889034, 2.52

2.57368, 2.578153915, 2.591560574, 2.605089065, 2.61 2.63251858,
2.64642321, 2.660456884, 2.674621494, 2.688918967, 2.703351271, 2.71792041, .732628431,
2.747477419, 2.762469503, 2.777606854, 2.79289168, 2.808326261, 2.823912886,
2.83965 3, 47, 2.871608841, 2.887827699, 2.904210878, 2.920760989, 2.9374807,
2.954372735, 2.971439875, 2.988684963, 3.006110903, 3.023720665, 3.041517279,
3.059503847, 3.077683537, 3.096059589, 3.114635316, 3.133414104, 3.152399419,
3.171594802, 3.19100388, 3.210630362, 3.230478041, 3.250550801, 3.270852618, 3.291387561,
3.312159796, 3.333173587, 3.354433305, 3.375943423, 3.397708524, 3.419733305,
3.442022577, 3.464581272, 3.487414444, 3.510527275, 3.533925079, 3.557613303,
3.581597536, 3.605883509, 3.630477104, 3.655384355, 3.680611456, 3.706164764,
3.732050808};

float DegVal[601]
15, 15.1,
15.2, 15.3, 15.4, 15.5, 15.6, 15.7, 15.8, 15.9, 16, 16.1,
16.2, 16.3, 16.4, 16.5, 16. 6, 16.7, 16.8, 16.9, 17, 17.1,
17.2, 17.3, 17.4, 17.5, 17 6, 17.7, 17.8, 17.9, 18, 18.1,
18.2, 18.3, 18. 4 18.5, 18. 6, 18.7, 18. 8, 18. 9, 19, 19. 1
19.2, 19.3, 19.4, 19.5, 19. 6, 19.7, 19.8, 19.9, 20, 20.1,
20.2, 20.3, 20.4, 20.5, 20. 6, 20.7, 20.8, 20. 9, 21, 21.1,
21.2, 21.3, 21.4, 21.5, 21.6, 21.7, 21.8, 21.9, 22, 22.1,
22.2 22.3 22.4 22.5, 22.6, 22.7, 22.8, 22.9, 23 23.1
23.2, 23.3, 23.4, 23.5, 23.6, 23.7, 23.8, 23.9, 24, 24.1,
24.2, 24.3, 24.4, 24.5, 24.6, 24.7, 24.8, 24.9, 25, 25.1,
25.2, 25.3, 25.4, 25.5, 25.6, 25.7, 25.8, 25.9, 26, 26.1,
26.4, 26.5, 26 6, 26.7, 26 8, 26 9, 27, 27. 1
27.2, 27.3, 27.4, 27.5, 27.6, 27.7, 27.8, 27.9, 28, 28.1,
28.4, 28.5, 28 6, 28.7, 28 8, 28 9, 29, 29. 1
29.2, 29.3, 2 9.4, 29.5, 29.6, 29.7, 29.8, 29. 9, 30, 30.1,
30.2, 30.3, 30.4, 30.5, 30.6, 30.7, 30.8, 30.9, 31, 31.1,
31.2, 31.3, 31.4, 31.5, 31.6, 31.7, 31.8, 31.9, 32, 32.1,









39



32.2, 32.3, 32.4, 32.5, 32.6, 32.7, 32.8, 32.9, 33, 33.1,
33.2, 33.3, 33.4, 33.5, 33.6, 33.7, 33.8, 33.9, 34, 34.1,
34.2, 34.3, 34.4, 34.5, 34.6, 34.7, 34.8, 34.9, 35, 35.1,
35.2, 35.3, 35.4, 35.5, 35.6, 35.7, 35.8, 35.9, 36, 36.1,
36.2, 36.3, 36.4, 36.5, 36. 6, 36.7, 36.8, 36.9, 37, 37.1,
37.2, 37.3, 37.4, 37.5, 37.6, 37.7, 37.8, 37.9, 38, 38.1,
38. 2, 38.3, 38.4, 38.5, 38. 6, 38.7, 38.8, 38. 9, 39, 39.1,
39.2, 39.3, 39.4, 39.5, 39. 6, 39.7, 39.8, 39.9, 40, 40.1,
40.2, 40.3, 40.4, 40.5, 40.6, 40.7, 40.8, 40.9, 41, 41.1,
41.2, 41.3, 41.4, 41.5, 41. 6, 41.7, 41.8, 41.9, 42, 42.1,
42.2, 42.3, 42.4, 42.5, 42.6, 42.7, 42.8, 42.9, 43, 43.1,
43.2, 43.3, 43.4, 43.5, 43.6, 43.7, 43.8, 43.9, 44, 44.1,
44.2, 44.3, 44.4, 44.5, 44.6, 44.7, 44.8, 44.9, 45, 45.1,
45.2, 45.3, 45.4, 45.5, 45. 6, 45.7, 45.8, 45.9, 46, 46.1,
46.2, 46.3, 46.4, 46.5, 46.6, 46.7, 46.8, 46.9, 47, 47.1,
47.2, 47.3, 47.4, 47.5, 47.6, 47.7, 47.8, 47.9, 48, 48.1,
48.2, 48.3, 48.4, 48.5, 48 6, 48.7, 48.8, 48.9, 49, 49.1,
49.2, 49.3, 49.4, 49.5, 49. 6, 49.7, 49.8, 49.9, 50, 50.1,
50.2, 50.3, 50.4, 50.5, 50.6, 50.7, 50.8, 50.9, 51, 51.1,
51.2, 51.3, 51.4, 51.5, 51.6, 51.7, 51.8, 51.9, 52, 52.1,
52.2, 52.3, 52.4, 52.5, 52.6, 52.7, 52.8, 52.9, 53, 53.1,
53.2, 53.3, 53.4, 53.5, 53.6, 53.7, 53.8, 53.9, 54, 54.1,
54.2, 54.3, 54.4, 54.5, 54.6, 54.7, 54.8, 54.9, 55, 55.1,
55.2 55.3 55.4, 55.5, 55.6, 55.7, 55.8, 55.9, 56 56.1
56.2, 56.3, 56.4, 56.5, 56.6, 56.7, 56.8, 56.9, 57, 57.1,
57.2, 57.3, 57.4, 57.5, 57.6, 57.7, 57.8, 57.9, 58, 58.1,
58.2, 58.3, 58.4, 58.5, 58. 6, 58.7, 58.8, 58.9, 59, 5 .1,
59.2, 59.3, 59.4, 59.5, 59. 6, 59.7, 59.8, 59.9, 60, 6 .1,
60.2, 60.3, 60.4, 60.5, 60. 6, 60.7, 60.8, 60.9, 61, 63.1,
61.2, 61.3, 61.4, 61.5, 61. 6, 61.7, 61.8, 61.9, 62, 64.1,
62.2, 62.3, 62.4, 62.5, 62. 6, 62.7, 62.8, 62. 9, 63, 63.1,
63.2, 63.3, 63.4, 63.5, 63. 6, 63.7, 63.8, 63.9, 64, 67.1,
64.2, 67.3, 67.4, 67.5, 64.6, 64 .7, 64 .8, 64 .9, 65, 65.1,
65.2, 65.3, 65.4, 65.5, 65. 6, 65.7, 65.8, 65.9, 66, 6 .1,
.2, .3, 66.4, 66.5, 66. 6, 66.7, 66.8, 66 .9, 67, 67.1,
3, 67.4, 67.5, 67 6, 67 7, 678, 67 9, 68 61
S8.4, 68.5, 68 6, 68.7, 6818, 68 9, 69, 6
S9.4, 69.5, 69(6, 69.7, 69 8, 69 9, 70, 70.1,
3, 70.4, 70.5, 70 6, 70.7, 70 8, 70 9, 71, 71.1,
71. 71.3, 71.4, 71.5, 71 6, 71.7, 71.8, 71 9, 72, 72.1,
72.2, 72.3, 72.4, 72.5, 72.6, 72.7, 72.8, 72.9, 73, 73.1,
73.2, 73.3, 73.4, 73.5, 73.6, 73.7, 73.8, 73.9, 74, 74.1,
74.2, 74.3, 74.4, 74.5, 74.6, 74.7, 74.8, 74.9, 75






void main(void)

char clear[] "\xlb\x5B\x32\x4A\x04"; /* Clear screen /
char place] "\xlb[l;lH"; /* Home cursor /

initSCI();
init analogy);
initInputCapture();
init overflowo;
init servoo);

/* Initialize Run-Time Parameters */
Inertialnv 700;
DegslOn 1;
Degs20n 1;
DegslBias 0;
Degs2Bias 0;

while(1)

/* MAIN MENU */
printf("%s", clear); /*clear screen*/
printf("%s", place); /*home cursor*/








40





ntf("\nRUN-TIME PARAMETERS\n");
ntf("\tInertialnv ...................... %.lf\n",Inertialnv);
ntf("\tPHI 1 On........................ %u\n",DegslOn);
ntf("\tPHI 1 Bias...................... %.lf\n",DegslBias);
ntf("\tPHI 2 On ........................ %u\n",Degs20n);
ntf("\tPHI 1 Bias...................... %.lf\n",Degs2Bias);

ntf("\n\nMAIN MENU\n"
"\tl. Run the T BOT\n"
"\t2. Examine Sensor Outputs & Calculations\n"
"\t3. Change Run-Time Parameters\n"
"\t4. Display Motor Update Table (after running TBOT)\n\n"
Enter a Number: ");

t = getchar();

est == '1')

intf("%s", clear); /*clear screen*/
intf("%s", place); /*home cursor*/
intf("\n\n\tT-BOT is currently Operating!!\n");
ile(SCDR != Ox1b)

SET BIT(TMSK1,OxOF); /* Only all 4 IC Interrupts.... */
while ((TMSK1 & OxOF) !- 0); /* Wait until all IC Ints are disabled


:divid




























































re di




































































id Angle) : ");


nt directly */














id Angle): ");


nt directly */


as ....... ....... .......
i ................... ....
as ....... ....... .......
'o Main Menu\n\n");
ber: ");








43




BAUD OxbO; /* OxbO is 9600 0x35 is 300 baud */




int getchar(void) /* Waits for character at serial port & return ASCII value


while ((SCSR & 0x20) == 0); /* Wait for character */
return(SCDR & Ox7F); /* Return 7-bit ASCII by stripping bit 8"/



void initInputCapture(void) /* TIC1 TIC4 Initialization */

INTROFF();

SETBIT(PACTL, 0x04); /* Set 14/05 bit to enable IC4 */
TCTL2 OxAA; /* Set all 4 IC Chhannels to Falling edge trigger

/* Enable & Disable IC1-IC4 interrupts in Main
CLEARFLAG(TFLG1,OxOF); /* Clear IC1-IC4 interrupt flags */

IClCount 0;
IC2Count 0;
IC3Count = 0;
IC4Ciount = 0;

INTRJON();



void init servo(void) /* Initialize variables for servo on PA5 (OC3) */
***************************************************************
INTROFF();

servo pulse width = 0; /* Motor starts turned off */
TCTL1 0x40; /* Clear OC3 on first interrupt */

INTRON();



void initoverflow(void) /* Initialize variables Timer Overflow */

INTROFF();

Overflow count = 0;
CLEARFLAG(TFLG2,0x80); /* Clear Timer Overflow interrupt flags */
SETBIT(TMSK2,0x80); /* Enable TOV interrupt */

INTRON();



void initanalog(void) /* Power up A/D */

SETBIT(OPTION,0x80);



nt analog(int port) /* Returns the analog value read from A/D PORTE */

ADCTport; /* Address the selected channel */
while((ADCTL & 0x80) == 0); /* Wait for A/D to finish */
return(ADR1); /* Return analog value */



void servo(int newposition)













Stio n defined


by newpositi
;ition in dec


ailing Edc









rising Edge

























ailing Edc


Rising Edc






































Falling Edc










Rising Edge

























Falling Ed(


Rising Edc


















TOC3 isr() /* Interrupt handler for PA5 (OC3) servo signals */


((TCTL1 & 0x30) = 0x30) /* Was Last Output High? */

TOC3 = TOC3 + servo pulse width; /* Set HIGH Time */
'CTL1 = 0x20; /* Set next Output to Low */

;e /* Last Output was Low */

)C3 TOC3 + (PERIOD servo pulse width); /* Set LOW Time */
'CTL1 0x30; /* Set next Output to High */


;AR FLAG(TFLG1,0x20); /* Clear OC3 flag */

********************************************************************/



Binary Search Algorithm */
Returns Theta 1 degree value */

t binsearch(float target)

Middle;
t low = 0;
hi 600;

le (low < hi)

middle = (low + hi)/2;
f (target < InvTan[middle])
hi = middle-1;
lse // Assert: target >= InvTan[middle]
if (target > InvTan[middle])
low =middle+1;


,urn DegVal[middle];




ead int(void)

mnction description: *
Receives a sequence of numerical characters from the serial port *
and converts to a signed 16-bit binary number. The number is *
read module 2d"15. The number is echoed as it is typed. A CR and

turns: 16-bit signed integer

puts *
Parameters: None *
Globals: None *
Registers: SCSR, SCDR *
Itputs *
'arameters: None *
;lobals: None *
Registers: None *
nations called: get char(), put char *
ltes: None *


digit, number, sign;













(digit)

- '


ign 1; digi
ign = 0; digi


Id read i


******** Initi
iddress:0xffd6


if( digi
if( diqi


digit);
,digit);


Convert digit
digit= digi

multiply prev
number = (nu:
digit= get
nIt char(dia


digit;


.d di









48



MMYENTRY, /* TOC4 */
C3 isr, /* TOC3 */
MMYENTRY, /* TOC2 */
MMY ENTRY, /* TOC1 */
C3isr, /* TIC3 */
C2 isr, /* TIC2 */
C1 isr, /* TIC1 */
MMY ENTRY, /* RTI */
MMY ENTRY, /* IRQ */
MMY ENTRY, /* XIRQ */
MMY ENTRY, /* SWI */
MMY ENTRY, /* ILLOP */
MMY ENTRY, /* COP */
MMY ENTRY, /* CLM */
tart /* RESET */


id abs address





















APPENDIX B

SWINGBOT SOFTWARE CODE



* Title swing5.c
* Programmer Nathan J. Nipper
* Date February 13, 2001
* Version 05

Description
Drive swinging pedulum with servo at OC3(PA5) using
angle-detecting POT at PE5. Switch hooked to PE4 determine
if swing is trying to increase or decrease swing amplitude.
The magnitude of the driving amplitude is set by the hand I
Version 03: Clean UP CRT display
Version 04: Fix parameters for E-Fair Fixture
Version 05: Code for E-Fair (no keyboard input)
****


**************************** Includes ************************
include
#include
#include
*************************************************************


*********************** Defines ***********************
define DUMMY ENTRY (void (*) (void))0OxFFFE /* Default for unL
xtern void _start(void) ; /Initialize RESET v
define PERIOD 40000 /* 50Hz refresh foi

define CLEAR BIT(x,y) x &= -y; // Clear all bits in x that au
define SET BIT(x,y) x I y; // Set all bits in x that are
define CLEAR FLAG(x,y) x &= y; // Clearing Interrupt Flags

define POT1 analog(7)
define POT2 analog(5)

define BIT 0x01;
define BIT1 0x02
define BIT2 0x04;
define BIT3 0x08
define BIT4 0x10;
define BIT5 0x20
define BIT6 0x40;
define BIT7 0x80
/*************************************************************

/ * * * * * * * * * P r o t o t y p e s * * * * * * * * * * * *
1pragma interrupt handler TOC3 isr

oid init SCI(void);
1oid init servo(void);
roid servo(int); /* send desired Pulse Width(0 or 2000 to 4(








50



idd;


idd;








51






init servo(void) /* Initialize variables for serve
***************************************************
'R OFF();

vo pulse width = 0; /* Motor starts turned of
L1 0x4O; /* Clear OC3 on first inti

'R ON();



init analog(void) /* Power up A/D */

BIT(OPTION,Ox80);



nalog(int port) /* Returns the analog value read

:TL=port; /* Address the selected channel
le((ADCTL & 0x80) 0); /* Wait for A/D to finish
turn(ADR1); /* Return analog value */



servo(int newposition)
=rvo on PA5 <- position defined by newposition
iis subroutine takes the new position in degrees
Id calculates the pulse HighTime in E-Clocks. PWM
,gnal is generated by ISR.


(newposition != 0)

ervo pulse width newposition;
;ET BIT(TMSK1,0x20); /* Enable OC3 interru

;e CLEAR BIT(TMSK1,0x20); /* Disable OC3 interri




TOC3 isr() /* Interrupt handler for PA5 (OC3) sert


((TCTL1 & 0x30) == 0x30) /* Was Last Output High?

'OC3 = TOC3 + servo pulse width; /* Set HIGH Time


******** Initi
iddress:0xffd6









52



MMYENTRY, /* PAO */
MMYENTRY, /* TOF */
MMY ENTRY, /* TOC5 */
MMY ENTRY, /* TOC4 */
C3 isr, /* TOC3 */
MMY ENTRY, /* TOC2 */
MMY ENTRY, /* TOC1 */
MMY ENTRY, /* TIC3 */
MMY ENTRY, /* TIC2 */
MMY ENTRY, /* TIC1 */
MMY ENTRY, /* RTI */
PMMY ENTRY, /* IRQ */
MMY ENTRY, /* XIRQ */
MMY ENTRY, /* SWI */
MMYENTRY, /* ILLOP */
MMYENTRY, /* COP */
MMY ENTRY, /* CLM */
tart /* RESET */


id abs address















LIST OF REFERENCES


[1] Pratt, Williamson, Dillworth, Pratt, Ulland, and Wright, Stiffness Isn't Eve.'i vhin/g.
Proceedings of ISER, 1995. http://alpha-bits.ai.mit.edu/proj ects/leglab/, accessed on
4/13/2001.

[2] A. J. Lee, Mechanical Design and Internet-Based Control of the Gyrobot, Master's
Thesis, University of Illinois at Urbana-Champaign, 2000.

[3] N. Nipper and J. Godowski, Robotic Swing Drive as Exploit of Stiffness Control
Implementation, 2001 Florida Conference for Recent Advances in Robotics.
http://mil.ufl.edu/-swing/, accessed on 5/25/2001.

[4] Serway, Raymond A. Physicsfor Scientists and Engineers.
Saunders College Publishing, Orlando, Florida, 1990.

[5] Doty, Keith. Talrik Junior Professional Edition Assembly Manual. Mekatronix 1999.
http://www.mekatronix.com, accessed on 1/11/2001.















BIOGRAPHICAL SKETCH

Nathan Nipper graduated from the University of Florida in May 1997 with a

bachelor's degree in electrical engineering.

After undergraduate school, Nathan accepted a full-time position as a Test

Engineer for Honeywell Space Systems in Clearwater, FL. His major responsibility was

to run the troubleshooting lab for all of the subassembly circuit boards for two flight units

that provided guidance and navigation for Titan and Atlas rocket launches. He also acted

as a customer interface to provide technical support launch constraints.

After almost three years at Honeywell, Nathan returned to UF for full-time

graduate school to finish a master's degree in electrical engineering and pursue a career

in digital hardware design. His graduate emphasis and research is in machine intelligence

and embedded micro-controller applications in robotics.




University of Florida Home Page
© 2004 - 2010 University of Florida George A. Smathers Libraries.
All rights reserved.

Acceptable Use, Copyright, and Disclaimer Statement
Last updated October 10, 2010 - - mvs