Wheelchair Woods
Wheelchair Woods
Wheelchair Woods
Omni-Directional Wheelchair
Honours Thesis
Benjamin Woods
10218282
Bachelor of Engineering (Mechatronics)
Faculty of Engineering, Computing and Mathematics
Supervisors:
Associate Professor Thomas Braunl
Mr. Chris Croft
Centre for Intelligent Information Processing
School of Electrical and Electronics Engineering
30 October, 2006
ii
Benjamin Woods
12 Anaconda Place
Sorrento, WA 6020
Yours sincerely,
Benjamin Woods
10218282
iii
iv
Abstract
Since the beginning of 2004, the University of Western Australias Centre for
Intelligent Information Processing Systems (CIIPS) has been developing an omnidirectional wheelchair. Omni-directional vehicles can turn and drive in any direction,
including directly sideways. Therefore, an omni-directional wheelchair allows the
user to navigate through a confined environment with less difficulty than would
otherwise be possible with a conventional wheelchair.
This project aims to improve the driving accuracy, human interface and comfort
of the already existing omni-directional wheelchair found in the mobile robotics
laboratory at the University of Western Australia. This will be accomplished by
altering the wheels, batteries, motor driver cards, joystick, control software, chassis
and suspension system.
vi
Acknowledgements
I would like to thank the following people for helping me produce this work. Without
them, it would surely not have been possible.
Associate Professor Thomas Braunl for your guidance throughout the life of
this project (even whilst in Germany).
Mr. Chris Croft for catching the handball from Thomas.
Dr. Nathan Scott for your unforgiving eye and advice regarding the wheelchair
suspension system.
The friendly staff and students within CIIPS and the EE workshops. It has
been a pleasure to work with you for a year.
My family and friends for putting up with my scarce free time over the past
year and providing sound advice.
In addition to this, two organisations have been a great help in this project:
DNM for supplying the university with the 4 shock absorbers necessary for the
project - at no cost! Along with shock absorbers for mountain bikes, DNM
also provide a large range of other suspension systems for bicycles and dirt
bikes. More details available at http://www.dnmsuspension.com/.
TADWA for their supply of knowledge regarding practical wheelchair design.
TADWA provide a range of help for disabled people in WA. More details
available at http://www.technicalaidwa.org.au/.
vii
viii
Contents
1 Introduction
1.1
Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3
Thesis Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Literature Survey
2.1
2.2
Control Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
Human Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Hardware
3.1
General Arrangement . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2
Mecanum Wheels . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.1
Technical Details . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.2
Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.3
Wheel Rims . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3
Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4
EyeBot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5
Batteries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.6
3.7
Footrests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
17
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ix
CONTENTS
4.2
Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.4
Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5 Joystick
23
5.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2
Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.3
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.4
Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
31
6.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.2
Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7 Suspension System
35
7.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.2
Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
43
8.1
Motor Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
8.2
Joystick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
8.3
8.4
9 Conclusion
49
9.1
Outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
9.2
Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Bibliography
51
A Code
55
A.1 ODW.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
A.2 ODW.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
A.3 ODW MotorCtrl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
x
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
105
121
xi
xii
List of Figures
2.1
2.2
2.3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4.1
4.2
4.3
4.4
5.1
5.2
5.3
5.4
6.1
LIST OF FIGURES
6.2
6.3
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
. . . . . . . . . . . . . . . . . . 39
7.10 The shock absorber angle determines the effective spring constant . . 42
8.1
8.2
8.3
8.4
9.1
xiv
List of Tables
3.1
4.1
4.2
4.3
5.1
5.2
5.3
5.4
8.1
xv
xvi
Nomenclature
Acronyms
ASCII
DOF
Degrees Of Freedom
EEPROM
FSJ
I/O
Input/Output
IR
Infra-Red
MOSFET
MotorCtrl
Motor control
ODV/ODW
Omni-Directional Vehicle/Wheelchair
PSD
PSJ
PWM
Pulse-Width Modulation
RS232
SHS
USB
WC
WheelChair
xvii
LIST OF TABLES
Mathematical Notation
r
VX
VY
xviii
Chapter 1
Introduction
1.1
Background
1.2. OBJECTIVES
1.2
Objectives
1.3
Thesis Structure
Chapter 2
Literature Survey
2.1
Figure 2.1: NASA OmniBot mobile base (Lippitt & Jones 1998)
Whilst normal wheels have a line contact with the ground, Mecanum wheels
have a point contact with the floor in the ideal case. Due to the infinite pressure
which would result from a point contact, either the floor or the wheel must deflect,
3
resulting in an area of contact. Regardless, the higher contact pressures that occur
with Mecanum wheels can be minimised by using fewer rollers, with 6 rollers being
found to be optimal (Dickerson & Lapin 1991). This fact was used by McCandless
(2001) when developing his new Mecanum wheel design at the University of Western
Australia.
One disadvantage of the Mecanum design is the inefficient use of the kinetic
energy supplied to the wheels by the motors. Due to the rotation of the exterior
rollers, only a component of the force at the perimeter of the wheel is applied to the
ground and the resulting force only partially contributes to the motion of the vehicle.
Diegel, Badve, Bright, Potgieter & Tlale (2002) address this problem by introducing
two new wheel designs, one with lockable rollers and the other with rotatable rollers.
Although these designs are more efficient, their increased complexity makes them
almost impractical in a university project with a limited budget.
4
2.2
Control Methods
The forward and inverse kinematics of the rectangular Mecanum wheel arrangement
used in this project are derived by Viboonchaicheep, Shimada & Kosaka (2003).
Unfortunately, using the wheel rotations and forward kinematic equations to
determine the vehicles current motion (also known as position rectification) is not
possible with the Mecanum wheels being used in this project. This is due to the high
level of slip experienced during normal operation providing inaccurate predictions
of the ODVs velocity. As an alternative, a visual dead-reckoning system using
a camera and optical flow analysis can be used to determine the change in the
ODVs position (Nagatani, Tachibana, Sofne & Tanaka 2000), (Shimada, Yajima,
Viboonchaicheep & Samura 2005) and (Cooney, Xu & Bright 2004). If accurate
feedback of the wheelchairs position and/or velocity is required in a future project,
this technique would be the most appropriate.
It is not uncommon for the user of an electric wheelchair to experience strong
vibrations whilst driving. These vibrations have sometimes been known to excite the
users internal organs at their natural frequency, causing discomfort and sometimes
nausea. By avoiding the natural frequency of the chair and human organs using
frequency shape control, this effect can be minimised (Terashima, Miyoshi, Urbana
& Kitagawa 2004) and (Urbano, Terashima, Miyoshi & Kitagawa 2005). Although
this lies outside the scope of this project, if this problem is experienced at a future
date it can be rectified using the methods described in these two papers.
5
2.3
Human Interface
surroundings can be used to control the vehicle (Kamiuchi & Maeyama 2004). Due
to the additional complexity of controlling an ODV, this project assumes a user who
has wrist movement which is acceptable for controlling a joystick.
As a user friendly alternative to obstacle avoidance, a variable impedance joystick
that increases the impedance of tilting the joystick in the direction of an obstacle can
be used (Kitagawa, Kobayashi, Beppu & Terashima 2001) and (Urbano, Terashima,
Miyoshi & Kitagawa 2004). This ensures the wheelchairs motion always obeys
the users instructions even when obstacles are present, rather than altering the
trajectory of the vehicle. As an alternative to this method, the wheelchair requires
the user to manually enable the obstacle avoidance system. This ensures any altered
wheelchair trajectories are at least expected by the user, eliminating the need for
this complex arrangement.
Chapter 3
Hardware
3.1
General Arrangement
Control software
Metal chassis
Chair
Armrests
Footrests
PSD sensors
Joystick
12V batteries
EyeBot controller
Mecanum wheels
None
Purchase replacements
7
X
None
Requirements
Suitable?
Exists?
Component
Qty
(Leong 2006)
(Leong 2006)
Chapter 7
Chapter 6
Chapter 5
Chapter 4
Section 3.7
Section 3.6
Section 3.5
Section 3.4
Section 3.3
Section 3.2
Refer to. . .
CHAPTER 3. HARDWARE
3.2
3.2.1
Mecanum Wheels
Technical Details
The Mecanum wheel works by using passive rollers around its circumference at an
angle offset from the axis of the wheel rotation. In the case where four of these
wheels are used in combination, the rollers are at an angle of 45 (see Figure 3.1).
As the wheel is made to rotate, the force exerted on the ground only consists of
that component of the force along the axis of the rollers. The other component of
the force does not affect the motion of the vehicle as it simply works to rotate the
passive rollers. Hence, the resulting force on the vehicle from this particular wheel
is in a direction 45 to the wheel axis (see Figure 3.2). By controlling the rotation
of each individual wheel (and therefore every individual force), the vehicle can be
made to move in any desired direction (see Figure 3.3).
3.2.2
Kinematics
Due to the increased complexity of the wheels used in ODVs, the algorithms required
to control the vehicles motion are very different to the algorithms used in a standard
differential drive or Ackermann arrangement. The inverse kinematic equations are
used when determining the required rotational speed of the motors to fulfill the
9
Figure 3.2: Force components in the Mecanum wheel (seen from below)
Figure 3.3: Wheel rotations for different driving directions (seen from below)
10
CHAPTER 3. HARDWARE
desired motion of the ODV. Similarly, the forward kinematic equations can be used
to determine the current trajectory of the ODV from the current rotational speeds of
the motors. The forward and inverse kinematics of the Mecanum wheel were derived
by Viboonchaicheep, Shimada & Kosaka (2003) and are shown below in Equations
3.1 and 3.2 respectively.
X
VY
= 2r 14
2(d+s)
1 1
1 1
1
2r
1 1
1 1
4
1
4
1
4
1
4
1
4
1
4
14
1
2(d+s)
1
2(d+s)
1
2(d+s)
(d+s)
2
(d+s)
2
(d+s)
2
(d+s)
2
(3.1)
VX
VY
(3.2)
X
VY
1
1
=
1
1 1
1 1
2
=
1 1
3
1 1
4
3.2.3
1 1
1
1 1 1
1 1 1
VX
VY
(3.3)
(3.4)
Wheel Rims
One of the recommendations made by Iwasaki (2005) in the final section of his
thesis was to machine down the Mecanum wheel rims to increase clearance from
the ground and avoid its contact with carpet or other soft surfaces. More simply,
only the white plastic rollers of the Mecanum wheel design shown in Figure 3.1
are intended to make contact with the ground; the metal wheel rims are merely
for structural support. If the rims were to come into contact with the ground, the
wheel would begin to behave like its more conventional counterpart, destroying the
wheelchairs ability to move omni-directionally.
During initial tests, the metal rims were found to be making contact with the
ground in some situations (such as when driving on an uneven, or carpeted surface).
To fix this problem, the diameter of the wheel rims was reduced until the holes for
the roller pins were almost exposed (about 5mm off the radius). This was acceptable
since the force on the rims from the pins would always be towards the centre of the
wheel. As an additional safety feature, a chamfer was also added to the outside edge
of the rims to prevent serious injury if the wheels were to run over somebody. These
alterations are shown in Figure 3.4.
12
CHAPTER 3. HARDWARE
3.3
Motors
13
3.4. EYEBOT
The motors have built in brakes as well as a switch which provides two modes
for the brakes:
Switch up: Always off, and
Switch down: On, unless a potential of 20V is applied across the brake inputs.
Currently, these brakes are not being used since they act very suddenly, causing
a large jerk to the user if the wheelchair is still moving. It would be possible
to implement a braking mechanism which activates the brakes 1 second after the
motors have come to a halt.
3.4
EyeBot
The wheelchair makes use of the EyeBot controller developed at the University of
Western Australia (Braunl 2005a). It reads the inputs from the user and the sensors,
and calculates a suitable wheelchair trajectory. The EyeBot uses a 25MHz and 32
bit Motorola 68332 chip and has 1Mb of RAM and 512KB of ROM. Communication
with other devices is available via serial, parallel, digital input and analogue input
and output ports. Figure 3.6 shows the front and back of the EyeBot MK4 used on
the wheelchair.
14
CHAPTER 3. HARDWARE
3.5
Batteries
Initially, the wheelchair used two 12V lead-acid car batteries connected in series to
provide the required 24V. However, car batteries are designed for a 5 second burst
of power to crank the engine, followed by 30 minutes of charging from the cars
alternator. This makes them unsuitable for the omni-directional wheelchair which
would require constant low-current power for many hours.
The batteries were replaced with two 12V deep-cycle lead-acid batteries with
a rating of 40Ah. Since each motor uses approximately 3A at a maximum, this
should provide for at least 3.5 hours of continuous usage. In reality, the motors are
not continuously drawing 3A, and the batteries last for approximately 7 hours of
semi-continuous usage.
The replacement batteries have two additional features to ensure they are
suitable for this application:
The batteries are sealed to ensure the acid inside does not spill on the user if
they are tipped upside-down in a crash.
The acid inside the batteries is a gel (rather than the typical liquid) to prevent
the wheelchairs vibration from causing bubbles to form on the lead plates
inside, affecting their performance and life.
The original Exide LM380C batteries, along with the purchased FirstPower
LFP1240G batteries, are shown in Figure 3.7
Figure 3.7: Original car batteries and new sealed, deep-cycle gel batteries
15
3.6
The wheelchair makes use of Position Sensitive Devices (PSDs) for its driverassistance software (Leong 2006). The six Sharp GP2D02 sensors use an infrared
transmitter and receiver to detect the linear distance to the closest obstacle in the
direction of the beam. They are shown in Figure 3.8.
3.7
Footrests
Two standard wheelchair footrests were kindly donated by TADWA for use on the
wheelchair. They were mounted in front of the two front motors once the new
chassis and suspension system had been completed (see Figure 3.9). To prevent the
footrests getting in the way of the user, they can be rotated up whilst the user gets
into or out of the wheelchair.
16
Chapter 4
Motor Driver Cards
4.1
Introduction
The speed of a DC motor is proportional to the voltage applied across its inputs,
whilst the torque is proportional to the current it is drawing. Therefore, to control
the speed of a DC motor, an analogue voltage ranging from Vmax to Vmax can
be used. This requires the use of a digital to analogue converter, which is very
expensive.
A common alternative is to use a constant supply voltage which is continuously
being switched on and off by a controller. When this is done at a very high frequency,
the input voltage is effectively reduced by the percentage of time that the signal is
off (see Figure 4.1). This technique is known as pulse-width modulation (PWM)
and allows the speed of a DC motor to be controlled by varying the pulse-width
ratio of the input signal (also known as the duty cycle).
Initially, the EyeBot controllers digital outputs were used to generate a 5V and
8.191 kHz PWM signal for each motor. These signals were then fed into four motor
controller cards designed by the electronic workshop, where they were amplified to
24V before being passed to the motors. Unfortunately the circuits in these cards were
not designed to cope with the high currents generated when the motors were required
to suddenly change direction, resulting in irreparable damage to the MOSFETs. The
controller cards either needed to be redesigned to accommodate this sort of activity,
17
4.2. SELECTION
30
DC Voltage (V)
25
20
15
10
5
0
0.5
1
1.5
Time (seconds)
2.5
4
x 10
4.2
Selection
The following considerations were deemed important when selecting the new DC
motor controller cards:
To fit within the project budget, the cards should be relatively cheap whilst
being of high enough quality to successfully perform the tasks required.
The cards should be capable of handling a 24V signal with a current of up to
15A per motor (in the case of current spikes).
The cards should include protections against over-heating, over-current and
incorrect polarity.
If possible, the cards should be available through a local supplier in Australia.
The cards should either accept 5V PWM signals as inputs, or allow serial
communication using the RS232 protocol.
The most suitable cards were found to be the Roboteq AX1500 controllers,
which are unfortunately only manufactured in and distributed from the USA (see
Figure 4.2). These cards can work with DC motor voltages between 12V and
18
4.3
Installation
The two Roboteq cards are used to drive the four wheelchair motors independently.
One card controls both the front left and front right motors, whilst the other controls
the back left and back right motors. Each card requires 4 power inputs (+24V supply
and ground for each motor) and produces 4 power outputs (the PWM signal and
ground for each motor). These connections are all made on one side of the card, as
shown in Figure 4.3.
Additionally, the two cards are both connected to the second serial port on the
EyeBot using the daisy-chain cable shown in Figure 4.4. This allows the EyeBot
controller to communicate with the cards using only one of its serial port, leaving
the other free for communication with a PC. To allow the daisy-chaining of these
cards, their EEPROM first needed to be flashed with the latest firmware available
from Roboteq. The daisy-chain settings were then activated by sending the character
strings ^00 01 and ^00 11 to the first and second cards respectively (Roboteq
2005).
19
4.4. PROGRAMMING
At the back of the controller (shown in the figure below) are located all the terminals that
must be connected to the batteries and the motors.
Note:
Both VMot terminals are
connected to each other in
the board and must be
wired to the same voltage.
VMot
M2+
M2-
M1+
M1-
VMot
CommandMotor
Set 1
Motor 2
FIGURE 2.Figure
AX1500 Controller
Rear View
4.3: Roboteq
Pwr
Ctrl
3 x Gnd
DB9 Female
5
10
to Controller
Address 1
Rx
Tx
8
15
15
9
Tx
Rx
DB15 Male
4.4
Command Set
Programming
Each controller echoes every character it receives.
Controller 0 recognizes the standard commands (e.g !a55, ?a ...) ignores the others.
the RS232 protocol. As documented in the Roboteq AX1500 manual, the cards
TABLE 17.
21
22
!a55, B7F
Config
5E
5F
^00, _01
Encoder
2A
2B
*A8, +A9
Reset
25
26
%rrrrrr, rrrrrr
RS232 Parameter
Roboteq AX1500 Setting
Inportant Notics
Baud Rate
9600 bit/s
Since a + is a normal response of the controller after accepting a command, conWord Size
10 bits
troller at address 1 must
be first in the daisy chain. If placed second, it will interpret
the + issued by the first controller as the start of a new command and cause an
Start Bits
1
error.
Data Bits
7
Parity
Even
Latency and Delay
StopCommand
Bits
1
This
scheme
introduces
a
1
character latency (~1ms). Furthermore the 9600bps bandwidth
Flow Control
None
must now be shared by two or more controllers.
20
AX3500 Motor Controller Users Manual
87
Event
Command
Query
Config
Encoder
Reset
Card 1
ASCII HEX Example
!
21
!a55
?
3F
?a
^
5E
^00
*
2A
*A8
%
25
%rrrrrr
21
ASCII
"
@
_
+
Card 2
HEX Example
22
"a55
40
@a
5F
_00
2B
+A8
26
rrrrrr
?v or ?V
?a or ?A
?m or ?M
?e or ?E
^mm
^mm nn
%rrrrrr
Reset controller
???
!Mnn
\r\r\r\r\r\r\r\r\r\r
Bad Command
Set motor speed
Send to Roboteq
Event
Power up prompt
22
+
nn
mm
nn
mm
nn
mm
DD
nn
mm
Description
Firmware version and date
? is random & can be ignored
10 carriage returns
Only required if not default mode
Unknown or incorrect command
M selects the motor and direction:
A Motor 1, forward direction
a Motor 1, reverse direction
B Motor 2, forward direction
b Motor 2, reverse direction
nn = Hexadecimal digits from 00 to 7F
nn = Motor 1 speed from 00 to 7F
mm = Motor 2 speed from 00 to 7F
No direction information given.
nn = Motor 1 current in amps
mm = Motor 2 current in amps
nn = Thermistor 1 from 00 to FF
mm = Thermistor 2 from 00 to FF
nn = Main battery from 00 to FF
mm = Internal 12V from 00 to FF
mm = Parameter number
DD = Current parameter value
mm = Parameter number
nn = New parameter value
Will reset and display prompt
4.4. PROGRAMMING
Chapter 5
Joystick
5.1
Introduction
Many people with disabilities rely on wheelchairs for use throughout their daily
life. As a result, a wheelchairs control mechanism should be simple and accurate.
Unfortunately, controlling a vehicle with 3 degrees of freedom is not immediately
intuitive. Of the many human interface designs discussed in Section 2.3, a positionsensing joystick is the most familiar and simple to use, and was therefore selected
for this wheelchair.
5.2
Selection
Joysticks come in all shapes and sizes, with many different features available. When
selecting the appropriate joystick for the wheelchair, two important considerations
were taken into account:
Whether the joystick should be analogue or digital, and
Whether the joystick should have 2 or 3 axes.
A digital joystick uses multiple on/off micro-switches to determine the direction
in which the stick is being pushed.
5.2. SELECTION
magnitude and direction in which the stick is being pushed. In this way, the speed
of the wheelchair is directly proportional to the degree by which the stick has been
moved from its origin. Of the two methods, the former allows simpler joystick
control for disabled users with poor fine-motor skills, whilst the latter provides a
more intuitive interface.
Most joysticks have 2 axes, allowing the stick to move from side to side (the x
axis) and forwards/backwards (the y axis). A 3 axis joystick additionally allows the
stick to be twisted about its axis (the z axis), as shown in Figure 5.1. Using a 3 axis
joystick allows direct control of each of the wheelchairs degrees of freedom, whilst
a 2 axis joystick requires a toggle button to alternate between two driving modes.
In the default mode, the x axis controls the rotation of the wheelchair, whilst in the
alternative strafe mode the x axis controls the sideways motion of the wheelchair.
24
CHAPTER 5. JOYSTICK
3 joysticks (described in Table 5.1 and shown in Figure 5.2) were purchased for
the wheelchair and tested with a PC.
Table 5.1: The 3 joysticks purchased and tested
Joystick Model
QuickShot QS-130F
Logitech Wingman Light
Microsoft Sidewinder
# axes
2
2
3
Control
Digital
Analogue
Analogue
After using all three joysticks, it was clear that as the functionality of the joystick
increased, the ease of use decreased. Therefore, a decision had to be made about the
target market for this wheelchair. Since it would be difficult to accurately maneuver
the wheelchair using either digital or 2 axis control, it was decided that the Microsoft
Sidewinder joystick would be used. This would unfortunately make it difficult for
users with certain disabilities (such as those which limit hand motion) to control the
wheelchair. It would, however, be possible to customise the design for users with
these disabilities.
25
5.3. INSTALLATION
5.3
Installation
The Microsoft Sidewinder joystick purchased came with a USB cable for connection
with a PC (see Figure 5.3). Unfortunately, the EyeBot controller to which it is
connected does not have a USB host. This problem was overcome by removing the
internal circuit board and replacing it with a custom circuit board that directly
accesses the joysticks potentiometers and buttons. This board was made exactly
the same size and uses exactly the same potentiometer connectors as the original
board, allowing it to fit easily into place (see Appendix B.1).
Using a multimeter to measure the resistance of the joysticks potentiometers,
it was found that the x, y, and z axes have potentiometers with a resistance of
10k, whilst the throttle potentiometer has a resistance of 20k. The circuit board
connects these potentiometers to the analogue inputs of the EyeBot, which reads
their current value (see Table 5.2). However, since the EyeBot supplies a voltage of
5V and the analogue inputs can read voltages between 0V and 4.1V, a resistor is
required between the supply voltage and each potentiometer. Using simple voltage
division, it is possible to find the necessary resistances for the x, y, z potentiometers
(a) and the throttle potentiometer (b).
0.9
5
a
10k+a
0.9
5
a = 2.2k
b
20k+b
b = 4.4k
The joystick has 4 buttons on its base and 7 buttons at the top of the stick.
Only the buttons on the base are used by the wheelchair, since only 4 buttons are
required and the user could accidentally press the buttons on the stick. The circuit
board directly connects these buttons to the digital inputs of the EyeBot, which
reads their current settings (see Table 5.2). When a button is not pushed, the open
switch causes no current to flow through that branch resulting in the 5V source
voltage being read by the EyeBot. When a button is pushed, the closed switch
causes current to flow through that branch and a voltage drop across the resistor,
resulting in 0V being read by the EyeBot.
26
CHAPTER 5. JOYSTICK
27
5.4. PROGRAMMING
Signal
X Axis
Y Axis
Z Axis
Throttle
Button 5
Button 6
Button 7
Button 8
+5V
Ground
5.4
Wire Colour
Yellow
Green
Brown
Grey
Blue
Thin Black
Purple
Orange
Red
Thick Black
EyeBot Pin
Analogue Input 5
Analogue Input 6
Analogue Input 7
Analogue Input 8
Digital I/O 9
Digital I/O 10
Digital I/O 11
Digital I/O 12
Digital I/O 13
Digital I/O 16
Programming
Once the 4 buttons and 4 potentiometers are correctly connected to the digital and
analogue input pins on the EyeBot, the RoBIOS operating system makes it simple
to read their current values. The x, y and z potentiometers are used to control the
motion of the wheelchair left/right, forwards/backwards and clockwise/anticlockwise
respectively. The throttle potentiometer acts as an overall maximum speed control;
at its minimum position the maximum speed of the wheelchair is 20%, at its
maximum position the maximum speed of the wheelchair is 100%, and moving
between these positions causes a gradual increase in the wheelchairs maximum
speed. The 4 buttons are used to control the advance driving modes of the wheelchair
(Leong 2006).
All of the digital inputs are read in one command: OSReadInLatch(0). This
command returns a 16 bit number, with each bit representing the current state of
the corresponding digital I/O pin. AND masking the number with a mask with
only the corresponding bit set to 1, and then dividing by the same mask causes the
number to be 0 if the button is pushed and 1 otherwise. This bit is then inverted
(a logical NOT) to give the desired result (see Table 5.3).
28
CHAPTER 5. JOYSTICK
Button
5
6
7
8
Mask
BUTTON5 = 0x10
BUTTON6 = 0x20
BUTTON7 = 0x30
BUTTON8 = 0x40
Command
!((OSReadInLatch(0) & BUTTON5)/BUTTON5)
!((OSReadInLatch(0) & BUTTON6)/BUTTON6)
!((OSReadInLatch(0) & BUTTON7)/BUTTON7)
!((OSReadInLatch(0) & BUTTON8)/BUTTON8)
The analogue inputs are each read by one command: OSGetAD(CHANNEL) (where
CHANNEL corresponds to the analogue input to read from). This command returns
an integer between 0 and 1000 (representing 0V and 4.1V respectively). Since the
joysticks minimum and maximum values for each axis will not be exactly 0 and
1000, the joystick must be calibrated. After calibration, moving the joystick to the
minimum/maximum position on each axis should ideally result in a 0/1000 reading
respectively. This number is then scaled to a number representing the percentage
of the potentiometers movement (see Table 5.4).
Calibration can be performed manually each time the EyeBot is started by
introducing a routine that requires the user move the joystick to the bottom left
position with the joystick twisted fully left and the throttle at a minimum and then
pushing a button. The user then moves the joystick to the top right, twisted fully
right with the throttle at a maximum and pushes a button. The EyeBot would read
the minimum and maximum values for each axis and use them to convert the raw
readings to the desired values. As it turns out, the raw minimum and maximum
values stay relatively constant between uses and can therefore be hard coded into
the software, removing the need for this arduous calibration routine (see Table 5.4).
Pot.
X
Y
Z
Throttle
Channel
4
5
6
7
Raw Min
95
920
145
1000
Raw Max
905
75
845
58
29
Desired Min
-100
-100
-100
0
Desired Max
100
100
100
100
5.4. PROGRAMMING
After calibration, the joystick input values are finally adjusted using threshold
values on each axis. This causes the input from an axis to be taken as zero unless
it is above a specified (and customisable) value. This is required for three reasons:
The joystick is extremely sensitive around its origin, and any small accidental
movements would cause the wheelchair to drive.
People with disabilities may have difficulty holding the joystick perfectly still
at the origin without shaking it.
By thresholding each axis individually, driving directly forward is also made
easier by preventing a small component of the wheelchairs velocity from being
in the sideways direction.
After testing, it was found that a threshold value of 15% was optimal for most
wheelchair users on each axis.
30
Chapter 6
Low Level Driving Routines
6.1
Introduction
For any driving robot, the low-level driving routines are the simple components of
the onboard software that determine the desired driving positions, velocities and/or
accelerations. This involves interfacing with all input and feedback devices on the
vehicle and calculating the required motor speeds before sending them to the motors.
In our current wheelchair design, there are 3 pieces of hardware with which the
low-level driving routines must communicate:
the motor controller cards to ensure the correct motor speeds are achieved.
Higher level driving routines are also being developed which make use of
the wheelchairs onboard position-sensitive devices (PSDs) to perform automatic
functions such as door-driving, wall following and obstacle avoidance (Leong 2006).
31
6.2. DESIGN
6.2
Design
The software has been written entirely in the C programming language and compiled
using the gcc68 compiler for the Motorola HC68332 chip (Braunl 2005a). Although
C itself is not an object-oriented language, it can be made modular by using separate
text files for the different software components. Header files are used to define the
necessary variables and functions, as well as include documentation and comments
on their use. These files have the .h prefix (eg. ODW.h). The bulk of the code is
included in the C source files, with filenames using the .c prefix (eg. ODW.c).
The wheelchairs code has 4 main components or modules, each modelled around
the hardware with which it is interfacing. A brief description of each component is
provided below.
ODW: This component of the software includes the main function which initially
starts the desired modules. Once these modules have been successfully started,
the main function continually loops and updates the LCD display, whilst
reading any EyeBot key inputs. When key 4 is pressed, the program stops
the running modules and exits gracefully.
ODW IR: This module interfaces with the infra-red remote control receiver,
allowing the wheelchair to be controlled by a Nokia remote control. The
module initialises the receiver and waits for a key input. When a key input is
received, the appropriate action (defined in the corresponding header file) is
taken. It is important to note that the functionality of this module is effectively
destroyed if the Joystick module is also activated.
ODW Joystick: This module interfaces with the modified 3-axis Microsoft Sidewinder
joystick discussed in Chapter 5. When started, the module first calibrates the
joystick and then continually reads the joysticks current position and button
values. This data is converted into the appropriate motor speeds using the
inverseKinematics function, which are then set using the setWCSpeed function
(both of which are found in the ODW MotorCtrl module). The button values
can also be used to activate the advanced driving routines (Leong 2006).
32
Success?
No
Yes
while STOP_RUNNING != 1
Update LCD
Read Keys
Update STOP_RUNNING
Stop modules:
ODW_MotorCtrl
ODW_Joystick
ODW_IR
33
6.2. DESIGN
Calibrate Joystick
calibrateJoystick()
Read IR Key
IRTVRead()
No
No
Stop?
Stop?
Yes
Yes
Initialise RS232
Set Zero Speed
No
Stop?
Yes
34
Chapter 7
Suspension System
7.1
Introduction
7.2. DESIGN
vibrations could mainly be attributed to the minor machining inaccuracies of the
Mecanum wheels which resulted in a sudden jerk each time the roller in contact the
ground was alternated. Since the rollers were made of an inflexible plastic and there
was no suspension built into the design, the user would be left feeling these effects.
This was found to be particularly bad when driving on a rough terrain.
7.2
Design
36
The chair, which was designed by Leong (2006), was mounted on top of this
battery box by welding its support arm onto a thick steel plate lid the same size
as the top of the box. If this lid had simply been screwed to the top of the box,
the entire chair would need to be lifted off each time maintenance was required on
37
7.2. DESIGN
the batteries or the internal electronics. Instead, the lid was attached to the box
with two hinges on the rear side, and locked down on the front side with a standard
barrel bolt. This allows the internal components of the battery box to be exposed
by simply unlocking the barrel bolt and tilting the chair back. This design can be
seen in Figure 7.3.
The final, and most important part of the design involved connecting the motors
to the chassis and incorporating a suspension system. This system is the most
likely section of the design to fail under the large forces and stress resulting from
any sudden impacts. In addition, the Mecanum wheel design being used on the
wheelchair requires that the wheels remain perpendicular to the floor at all times.
If the wheels were on an angle, the rims would contact the ground making omnidirectional motion impossible (see Figure 7.4).
Each wheel requires independent suspension to allow movement without affecting
the wheelchair chassis or the other wheels. The most basic independent suspension
design positions the shock absorber directly between the motors and the chassis (see
Figure 7.5). This design does not provide strength against sideways or rotational
motion of the motors, making it unsuitable for use in the wheelchair.
A slightly more complicated design uses a trailing arm which runs from the
motors to the chassis, where it is connected in such a way that it is only allowed
38
Figure 7.4: Perpendicular requirement for the adopted Mecanum wheel design
to rotate in the vertical direction. The shock absorber then connects to both the
chassis and the arm to limit this motion. The trailing arms can either extend to
the sides of the chassis, or to the front and back of the chassis. Since the Mecanum
wheels need to remain perpendicular to the ground the latter was chosen for this
design (see Figure 7.6).
39
7.2. DESIGN
Rather than using a simple plate for the trailing arm, a 50 50 3mm squarehollow-section (SHS) tube was used. This allows the arm to remain rigid and resist
both bending and twisting forces which would otherwise have resulted in failure.
This arm is bolted to the motors at one end and welded to a 20mm diameter solid
steel rod at the other end. This rod runs perpendicular to the trailing arm and is
held by rotational bearings at each end. The bearings are housed in pressed-metal
straps which are bolted onto the main chassis of the wheelchair. This design is
shown in Figure 7.7.
Figure 7.8 shows the forces that could be experienced by the wheels and motors
(in red), and the corresponding forces and torques each independent suspension
system will need to overcome (in green).
40
Finally, the shock absorbers are connected between the trailing arms and the
sides of the battery box. Four small mounting blocks were welded onto the arms
and box to achieve this. The mounting angle of the shock absorbers between the
arm and the chassis determines the extent to which the springs will be compressed
or expanded for a given amount of movement of the wheels. This therefore dictates
how easily the wheels will be able to move up and down. The compression of the
springs was tested on a prototype, and the angle of the shock absorbers was chosen
to cause the springs to compress approximately 50% under the weight of the chair
and a standard user. This allows leeway for the wheels to move both up and down
from the default position, as required. An extra set of holes were drilled for the
bearings to allow an alternative setting for slightly heavier users (see Figure 7.10).
The final designs of the new wheelchair chassis and suspension system can be
seen in Appendix B.2.
41
7.2. DESIGN
Figure 7.10: The shock absorber angle determines the effective spring constant
42
Chapter 8
Results, Testing and Simulation
8.1
Motor Control
The speeds of the four independent DC motors on the wheelchair are now controlled
by the new Roboteq AX1500 controller cards. This is done by sending ASCII
characters through the daisy-chain serial cable using the RS232 protocol (see
Chapter 4). Tests were performed on the motors, by measuring the actual speeds
achieved for certain requested values. Even though no feedback is used to control
the motor speeds, they are in general very accurate. The test results can be seen in
Table 8.1 and Figure 8.1. If the motors were to become inaccurate in the future, it
would be possible to write simple software instructions to calibrate them.
8.2
Joystick
The 3-axis joystick installed in this project allows highly accurate control of each of
the wheelchairs degrees of freedom. Although this style of joystick is new to most
users, the design is intuitive and easy to learn. To prevent accidental wheelchair
motion resulting from small movements of the stick near the zero position of an axis,
independent threshold values were implemented on each axis. These values can be
customised to also allow users with deteriorated fine-motor skills (such as those with
Parkinsons disease) to use the joystick.
43
8.2. JOYSTICK
Requested
Speed
/127
12
25
38
50
63
76
88
101
114
127
nn
0C
19
26
32
3F
4C
58
65
72
7F
%
9.45
19.69
29.92
39.37
49.61
59.84
69.29
79.53
89.76
100
FL
Fwd
!Ann
RPM
59
77
97
117
135
155
173
192
FL
Rev
!ann
RPM
58
76
97
117
135
155
175
193
FR
Fwd
!bnn
RPM
57
75
94
114
131
151
170
189
FR
Rev
!Bnn
RPM
57
75
95
114
131
150
169
186
BL
Fwd
"Bnn
RPM
56
75
95
114
133
153
173
192
BL
Rev
"bnn
RPM
56
75
95
114
133
153
173
192
BR
Fwd
"ann
RPM
43
65
86
108
130
150
172
193
214
250
FL
FR
BL
BR
Linear (FL)
Linear (FR)
Linear (BL)
Linear (BR)
200
150
100
BR
Rev
"Ann
RPM
42
63
83
104
125
144
165
186
205
50
0
-150
-100
-50
50
100
150
-50
-100
y = 1.9412x - 0.0625
R2 = 1
-150
y = 1.8895x + 0.25
R2 = 1
-200
y = 1.9186x - 7E-15
R2 = 1
y = 2.1155x + 2.4444
R2 = 0.9999
-250
Requested Speed (%)
44
45
8.3
After the installation of the trailing-arm suspension system, the wheelchairs motion
was found to be much more accurate on uneven surfaces. Motions which used to
cause the Mecanum wheels to slip (such as sideways and diagonal driving) can now
be executed with a higher degree of accuracy. This is due to the wheels always being
pushed down to the ground by the springs in the shock absorbers. In addition, the
vibrations felt by the user when driving the wheelchair are now mostly absorbed by
the shock absorbers. This greatly improves the level of comfort for the user.
Maintenance can be performed on the wheelchair by simply unlocking the barrelbolt on top of the battery box, and tilting the entire chair backwards to expose the
electronic circuits and batteries. This prevents any injuries that would otherwise
result from the user lifting the entire chair off the battery box to access the internal
components.
An unexpected side-effect of the suspension system can be seen when the
wheelchair is driven directly to the side. These movements cause the springs on
the side away from the direction of motion to compress, resulting in a slight tilt
of the chair in this direction. This is due to the combination of the angular forces
from the Mecanum wheels, and cannot easily be overcome. Although this may at
first startle the user, there are no devastating effects and overtime the user learns
to anticipate it.
46
8.4
The new chassis and suspension system were designed with the aid of AutoDesk
Inventor version 10. Inventor is the 3D modelling version of AutoDesks popular
AutoCAD software, and is similar to other 3D CAD programs such as Solid Edge
and Solid Works. The model was used to ensure that all the components would
actually fit together as planned, and that the workshop would be able to get the
required access to all the nuts and bolts that needed to be fitted and tightened.
The model developed in AutoDesk Inventor was then converted to a Milkshape
3D model, developed by chUmbaLum sOft. This allowed the model to be used
in the EyeSim EyeBot simulation software developed at the University of Western
Australia (Braunl 2005b). A program called Deep Exploration, developed by Right
Hemisphere, was used to convert the Inventor assembly files (with extensions .iam
and .ipt) into a AutoDesk drawing interchange/exchange format file (with extension
.dxf). This file was then imported into Milkshape 3D where it was scaled, coloured,
and saved (with extension .ms3d) ready for use in EyeSim.
wheelchair model in EyeSim is shown in Figure 8.4.
47
A picture of the
48
Chapter 9
Conclusion
9.1
Outcomes
9.2
Recommendations
The following recommendations are made for future projects involving the wheelchair.
Replace the current Mecanum wheels with an alternative material and design.
The current wheels are inherently slippery, and a rubbery material would
most likely prevent any slip from occurring. In addition to this, a soft rubber
49
9.2. RECOMMENDATIONS
would have a shock absorbing effect and would aid the suspension system in
mitigating vehicle vibrations. To prevent issues with the rims contacting the
ground, the new design should use a fork to hold each external roller, similar
to that developed by McCandless (2001). The final result would be similar to
that used by Lippitt & Jones (1998).
With the new Mecanum wheels mentioned above, the issue of wheel slip should
be overcome. This would allow feedback from the motors to actually provide
useful information for the driving routines. Shaft encoders should be installed
on each wheel, and the information used to provide both velocity and position
feedback for the wheelchair. A simple PID control system should be developed
for the overall wheelchair velocity and position, rather than for each individual
wheel.
Using the feedback from the motors and PID control system mentioned above,
software similar to the V interface could be written for the wheelchair,
allowing for movements in certain directions for a specified distance. This
could be extended to provide fully autonomous driving through a known
environment, using a map of the walls and obstacles.
wheelchair could be made to drive from room 3.13 of the Electrical Engineering
building at the University of Western Australia, to room 4.04 (making use of
the elevator).
50
Bibliography
Airtrax. (2006). Omni-Directional Technology: Changing the way vehicles move,
[Online]. Available from: <http://www.airtrax.com/> [September 2006].
Braunl, T. 2003, Embedded Robotics: Mobile Robot Design and Applications with
Embedded Systems, Springer, New York.
Braunl,
T.
The
(2005a).
University
EyeBot
of
Online
Western
Documentation,
Australia.
[Online],
Available
from:
T.
(2005b).
University
EyeSim
of
Mobile
Western
Robot
Australia.
Simulator,
[Online],
Available
<http://robotics.ee.uwa.edu.au/eyebot/doc/sim/sim.html>
from:
[September
2006].
Cooney, J.A., Xu, W.L., Bright, G. 2004, Visual Dead-Reckoning for Motion
Control of a Mecanum-Wheeled Mobile Robot, Mechatronics, vol. 14,
pp. 623637.
Cooper, R.A., Jones, D.K., Fitzgerald, S., Boninger, M.L. & Albright, S.J. 2000,
Analysis of position and isometric joysticks for powered wheelchair driving,
IEEE Transactions on Biomedical Engineering, vol. 47, pp. 902910. Available
from: IEEE Xplore, [April 2006].
Coyle, E.D. 1995, Electronic wheelchair controller designed for operation by handoperated joystick, ultrasonic noncontact head control and utterance from a
small word-command vocabulary, IEEE Colloquium on New Developments
51
BIBLIOGRAPHY
in Electric Vehicles for Disabled Persons, pp. 3/13/4. Available from: IEEE
Xplore, [April 2006].
Dickerson, S. & Lapin, B. 1991, Control of an omni-directional robotic vehicle with
Mecanum wheels, Proceedings of the National Telesystems Conference, vol. 1,
pp. 323328. Available from: IEEE Xplore, [April 2006].
Diegel, O., Badve, A., Bright, G., Potgieter, J. & Tlale, S. 2002, Improved mecanum
wheel design for omni-directional robots, Proceedings of the Australasian
Conference on Robotics and Automation, pp. 117121.
Ding, D., Cooper, R.A., Spaeth, D. 2004, Optimized joystick controller, Proceedings
of the 26th Annual International Conference of the Engineering in Medicine and
Biology Society, vol. 2, pp. 48814883. Available from: IEEE Xplore, [April
2006].
Guo, S., Cooper, R.A., Boninger, M.L., Kwarciak, A. & Ammer, B. 2002,
Development of power wheelchair chin-operated force-sensing joystick,
Proceedings of the Second Joint Engineering in Medicine and Biology, vol. 3,
pp. 23732374. Available from: IEEE Xplore, [April 2006].
Ilon, B.E. 1975, Wheels for a course stable selfpropelling vehicle movable in any
desirable direction on the ground or some other base, US Patent 3876255
Iwasaki, Y. 2005, Omni-Directional Wheelchair, Honours Thesis, The University of
Western Australia.
Jones, D.K., Cooper, R.A., Albright, S. & DiGiovine, M. 1998, Powered wheelchair
driving performance using force- and position-sensing joysticks, Proceedings
of the IEEE 24th Annual Northeast Bioengineering Conference, pp. 130132.
Available from: IEEE Xplore, [April 2006].
Kamiuchi, S. & Maeyama, S. 2004, A novel human interface of an omnidirectional wheelchair, 13th IEEE International Workshop on Robot and
Human Interactive Communication, pp. 101106. Available from: IEEE Xplore,
[April 2006].
52
BIBLIOGRAPHY
Kitagawa, L., Kobayashi, T., Beppu, T. & Terashima, K. 2001, Semi-autonomous
obstacle avoidance of omnidirectional wheelchair by joystick impedance
control, Proceedings of the IEEE/RSJ International Conference on Intelligent
Robots and Systems, vol. 4, pp. 21482153. Available from: IEEE Xplore, [April
2006].
Leong, M. 2006, Active User Omni-Directional Wheelchair, Honours Thesis, The
University of Western Australia.
Lippitt,
W.C. 1998,
KSC Re-
BIBLIOGRAPHY
Terashima, K., Miyoshi, T., Urbana, J. & Kitagawa, H. 2004, Frequency shape
control of omni-directional wheelchair to increase users comfort, Proceedings
of the IEEE International Conference on Robotics and Automation, vol. 3,
pp. 31193124. Available from: IEEE Xplore, [April 2006].
Urbano, J., Terashima, K., Miyoshi, T. & Kitagawa, H. 2004, Impedance control
for safety and comfortable navigation of an omni-directional mobile wheelchair,
Proceedings of the International Conference on Intelligent Robots and Systems,
vol. 2, pp. 19021907. Available from: IEEE Xplore, [April 2006].
Urbano, J., Terashima, K., Miyoshi, T. & Kitagawa, H. 2005, Velocity control
of an omni-directional wheelchair considering users comfort by suppressing
vibration, IEEE/RSJ International Conference on Intelligent Robots and
Systems, pp. 31693174. Available from: IEEE Xplore, [April 2006].
Viboonchaicheep, P., Shimada, A. & Kosaka, Y. 2003, Position rectification control
for Mecanum wheeled omni-directional vehicles, The 29th Annual Conference
of the IEEE Industrial Electronics Society, vol. 1, pp. 854859. Available from:
IEEE Xplore, [April 2006].
Voo, C.Y. 2000, Low level driving routines for the omni-directional robot, Honours
Dissertation, The University of Western Australia.
Wada, M. & Asada, H. 1998, A holonomic omnidirectional vehicle with a
reconfigurable footprint mechanism and its application to wheelchairs,
Proceedings of the IEEE International Conference on Robotics and Automation,
vol. 1, pp. 774780. Available from: IEEE Xplore, [April 2006].
West, M. & Asada, H. 1992, Design of a holonomic omnidirectional vehicle,
Proceeding of the IEEE International Conference on Robotics and Automation,
vol. 1, pp. 97103. Available from: IEEE Xplore, [April 2006].
54
Appendix A
Code
A.1
ODW.h
1 /* *
2
* ODW . h
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is the header file for the general ODW code .
12
*
13
* Note :
14
*
The types , variables and functions defined here should be available
15
*
regardless of the implementation .
16
*/
17
18
19 // GLOBAL VARIABLES
20
21 /* *
22
* If set to 1 , the program and wheelchair control will stop .
23
*/
24 int STOP_RUNNING ;
25
26
27 // FUNCTIONS
28
55
A.1. ODW.H
29 /* *
30
* Input :
NONE
31
* Output : 0 = ok
32
*
-1 = error
33
* Semantics :
Initialise and start all the functions of the ODW
34
*/
35 int ODWInit ( void ) ;
36
37 /* *
38
* Input :
NONE
39
* Output : 0 = ok
40
*
-1 = error
41
* Semantics :
Stop and release all functions of the ODW
42
*/
43 int ODWStop ( void ) ;
56
CHAPTER A. CODE
A.2
ODW.c
1 /* *
2
* ODW . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This file contains the main function and other general initialisation and
12
*
stop functions for the ODW code .
13
*/
14
15
16 # include " eyebot . h "
17 # include < math .h >
18 # include < stdlib .h >
19 # include " ODW . h "
20 # include " ODW_MotorCtrl . h "
21 # include " ODW_IR . h "
22 # include " ODW_Joystick . h "
23
24
25 int ODWInit ()
26 {
27
int result ;
28
29
STOP_RUNNING = 0;
30
31
// Motor Control
32
result = startMotorCtrl () ;
33
if ( result != 0 ) return result ;
34
35
OSWait (10) ;
36
37
// Joystick Control
38
result = startJoystick () ;
39
if ( result != 0 ) return result ;
40
41
OSWait (10) ;
42
43
// Infra - red Remote Control
44
result = startIR () ;
if ( result != 0 ) return result ;
45
46
57
A.2. ODW.C
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
return result ;
}
int ODWStop ()
{
int result ;
// Infra - red Remote Control
result = stopIR () ;
if ( result != 0 ) return result ;
OSWait (10) ;
// Joystick Control
result = stopJoystick () ;
if ( result != 0 ) return result ;
OSWait (10) ;
// Motor Control
result = stopMotorCtrl () ;
if ( result != 0 ) return result ;
return result ;
}
58
CHAPTER A. CODE
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122 }
59
A.3
ODW MotorCtrl.h
1 /* *
2
* ODW_MotorCtrl . h
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is header file for the code that controls the motors and the speed of the ODW .
12
*
13
* Note :
14
*
The types , variables and functions defined here should be available
15
*
regardless of the implementation .
16
*/
17
18
19 // DEFINITIIONS
20
21 /* *
22
* Set to 1 if using daisy - chaining of Roboteq cards .
23
* Set to 0 otherwise .
24
*/
25 # define DAISY 1
26
27 /* *
28
* Required settings for serial communication with Roboteq cards
29
* Baud :
9600 kb / s
30
* Handshaking : None
31
* Start bits : 1
32
* Data bits :
7
33
* Parity :
Even
34
* Stop bits :
1
35
*/
36 # define ROBOTEQ_BAUD SER9600
37 # define ROB OTEQ_H ANDSHA KE NONE
38
39 /* *
40
* 100/ Hz
41
* Frequency at which to transmit speed signals to motors
42
*/
43 # define MOTOR_CTRL_FREQ 100/2
44
60
CHAPTER A. CODE
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* *
* ODW physical specifications
*/
# define ODW_WIDTH 5.20
# define ODW_LENGTH 5.40
# define WHEEL_RADIUS 0.95
/* *
* Speed value for stopping the ODW
*/
# define WC_STOPPED ( WCSpeed ) {0 ,0 ,0}
/* *
* Address of values to change in MC68332 chip to set valuesfor serial communication
59
*/
60 # define sccr1 0 xfc0a
61
62
63 // TYPE DEFINITIONS
64
65 /* *
66
* Holds speed values for each individual motor in the ODW in rads / sec
67
*/
68 typedef struct
69 {
70
int FL ;
71
int FR ;
72
int BL ;
73
int BR ;
74 } WCMotorSpeeds ;
75
76 /* *
77
* Holds speed values for the overall motion of the ODW
78
*/
79 typedef struct
80 {
double x ;
81
82
double y ;
83
double w ;
84 } WCSpeed ;
85
86 /* *
87
* Holds position values for the overall motion of the ODW
88
*/
89 typedef struct
90 {
91
double x ;
61
double y ;
double phi ;
} WCPosition ;
// GLOBAL VARIABLES
/* *
* The currently desired individual motor speeds .
* Max value per motor = 127 = 0 x7F
*/
WCMotorSpeeds D E S I R E D _ M O T O R _ S P E E D S ;
/* *
* The currently desired overall ODW speed .
* Max value per axis = 100
*/
WCSpeed DESIRED_WC_SPEED ;
/* *
* The handle for the timer which continues to
* send the currently desired motor speeds to the
* motor controller cards .
*/
TimerHandle MotorCtrlTimer ;
// FUNCTIONS
/* *
* Input :
( wcmotorspeeds ) The motor speeds to convert
* Output : The corresponding overall speed of the ODW
* Semantics :
Convert individual motor speeds into the overall WC speed
125
*/
126 WCSpeed forwardK inemat ics ( WCMotorSpeeds wcmotorspeeds ) ;
127
128 /* *
129
* Input :
( wcspeed ) The overall speed of the ODW to convert
130
* Output : The corresponding speeds of the individual motors
131
* Semantics :
Convert the overall WC speed into required individual motor speeds
132
*/
133 WCMotorSpeeds inver seKine matics ( WCSpeed wcspeed ) ;
134
135 /* *
136
* Input :
NONE
137
* Output : 0 = ok
138
*
-1 = error
62
CHAPTER A. CODE
139
* Semantics :
Set up and start the control of the motors
140
*/
141 int startMotorCtrl ( void ) ;
142
143 /* *
144
* Input :
NONE
145
* Output : 0 = ok
146
*
-1 = error
147
* Semantics :
Stop the control of the motors and release the serial ports
148
*/
149 int stopMotorCtrl ( void ) ;
150
151 /* *
152
* Input :
NONE
153
* Output : NONE
154
* Semantics :
Control the motors using the global parameters
155
*/
156 void MotorCtrl ( void ) ;
157
158 /* *
159
* Input :
( wcspeed ) The speed values to set for the ODW
160
* Output : 0 = ok
161
*
-1 = error
162
* Semantics :
Set the speed of the overall ODW ( rather than each motor independently )
163
*/
164 int setWCSpeed ( WCSpeed wcspeed ) ;
165
166 /* *
167
* Input :
NONE
168
* Output : The currently desired speed for the ODW
169
* Semantics :
Get the current desired speed of the overallODW ( rather than each individual motor )
170
*/
171 WCSpeed getWCSpeed ( void ) ;
172
173 /* *
174
* Input :
( wcmotorspeeds ) The speed of each motor to set
175
* Output : 0 = ok
176
*
-1 = error
177
* Semantics :
Set the speed of each motor independently ( rather than the overall ODW )
178
*/
179 int setWCMotorSpeeds ( WCMotorSpeeds wcmotorspeeds ) ;
180
181 /* *
182
* Input :
NONE
63
64
CHAPTER A. CODE
A.4
ODW MotorCtrl.c
1 /* *
2
* ODW_MotorCtrl . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is code to control the motors and the speed of theODW .
12
*
This implementation uses the Roboteq AX1500 cards installed .
13
*/
14
15
16 # include " eyebot . h "
17 # include " ODW_MotorCtrl . h "
18 # include < math .h >
19 # include < stdio .h >
20 # include < stdlib .h >
21
22
23 WCSpeed fo rwardK inemat ics ( WCMotorSpeeds wcmotorspeeds )
24 {
25
WCSpeed wcspeed ;
26
27
// Find ODW speeds by converting motor speeds
28
wcspeed . x = ( wcmotorspeeds . FL + wcmotorspeeds . FR + wcmotorspeeds . BL + wcmotorspeeds . BR ) * 100.0 / (127.0*4) ;
29
wcspeed . y = ( - wcmotorspeeds . FL + wcmotorspeeds . FR + wcmotorspeeds . BL - wcmotorspeeds . BR ) * 100.0 / (127.0*4) ;
30
wcspeed . w = ( - wcmotorspeeds . FL + wcmotorspeeds . FR - wcmotorspeeds . BL + wcmotorspeeds . BR ) * 100.0 / (127.0*4) ;
31
32
return wcspeed ;
33 }
34
35
36 WCMotorSpeeds inver seKine matics ( WCSpeed wcspeed )
37 {
38
WCMotorSpeeds wcmotorspeeds ;
39
65
50
51
52
53
54
55
56
57
58
59
60
61
62
66
CHAPTER A. CODE
63
return wcmotorspeeds ;
64 }
65
66
67 int startMotorCtrl ()
68 {
// Initialise the second serial port for transmission to69
Roboteq cards
70
LCDPrintf ( " Init SERIAL2 ...\ n " ) ;
int result = OSInitRS232 ( ROBOTEQ_BAUD , 71
ROBOTEQ_HANDSHAKE , SERIAL2 ) ;
72
// The next line sets even parity for serial interface 2
73
(*((( volatile BYTE *) Ser1Base ) +3) ) = 0 x1a ;
74
75
// If not using daisy chaining , also initialise the first serial port
76
if ( ! DAISY ) {
77
LCDPrintf ( " Init SERIAL1 ...\ n " ) ;
78
result = result && OSInitRS232 ( ROBOTEQ_BAUD , ROBOTEQ_HANDSHAKE , SERIAL1 ) ;
79
// The next line sets even parity for serial interface 1
80
(*(( volatile unsigned short *) sccr1 ) ) = 0 x042c ;
81
}
82
83
setWCSpeed ( WC_STOPPED ) ;
84
85
MotorCtrlTimer = OSAttachTimer ( MOTOR_CTRL_FREQ , MotorCtrl ) ;
86
87
return ( result ) ;
88 }
89
90
91 int stopMotorCtrl ()
92 {
93
// Stop continuous transmission of speed signals
94
int result = ! OSDetachTimer ( MotorCtrlTimer ) ;
95
// Send one last transmission of zero values
96
97
setWCSpeed ( WC_STOPPED ) ;
98
MotorCtrl () ;
99
return result ;
100
101 }
102
103
104 void MotorCtrl ()
105 {
67
68
CHAPTER A. CODE
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183 }
184
185
186 int
187 {
188
189
190
191
return setWCMotorSpeeds ( wcmotorspeeds ) ;
192 }
193
194
195 WCSpeed getWCSpeed ()
196 {
197
WCMotorSpeeds wcmotorspeeds = getWCMotorSpeeds () ;
198
69
207
208
209
210
211
212
213
214
215
216
DESIRED _ M O T O R _ S P E E D S = wcmotorspeeds ;
217
218
return 0;
219 }
220
221
222 WCMotorSpeeds getWCMotorSpeeds ()
223 {
224
return D E S I R E D _ M O T O R _ S P E ED S ;
225 }
70
CHAPTER A. CODE
A.5
ODW Joystick.h
1 /* *
2
* ODW_Joystick . h
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is the header file for the code that initialises and reads from the ODW s joystick .
12
*
13
* Note :
14
*
The types , variables and functions defined here should be available
15
*
regardless of the implementation .
16
*/
17
18
19 // DEFINITIIONS
20
21 /* *
22
* 100/ Hz
23
* The frequency with which to read from the joystick
24
*/
25 # define JOY_FREQ 100/10
26
27 /* *
28
* The bitmasks for extracting the bit values for associated buttons
29
*/
30 # define BUTTON5 0 x10
31 # define BUTTON6 0 x20
32 # define BUTTON7 0 x40
33 # define BUTTON8 0 x80
34
35 /* *
36
* The analogue channels to which each axis is connected
37
*/
38 # define X_CHANNEL 4
39 # define Y_CHANNEL 5
40 # define Z_CHANNEL 6
41 # define T_CHANNEL 7
42
43 /* *
44
* The threshold values for each axis
71
*/
# define X_THRESHOLD 15
# define Y_THRESHOLD 15
# define Z_THRESHOLD 15
/* *
* With the throttle set to the minimum level , the maximum possible ODW speed
52
* will be limited to 100/ THROTTLE_DIVISOR %
53
*/
54 # define THROTTLE_DIVISOR 5.0
55
56
57 // TYPE DEFINITIIONS
58
59 /* *
60
* Holds position values for each axis in the joystick .
61
*/
62 typedef struct
63 {
64
int x ;
65
int y ;
66
int z ;
67
int t ;
68 } JoyPos ;
69
70 /* *
71
* Holds bit values for each button on the joystick .
72
*/
73 typedef struct
74 {
75
BYTE b5 ;
76
BYTE b6 ;
77
BYTE b7 ;
78
BYTE b8 ;
79 } ButtonState ;
80
81
82 // GLOBAL VARIABLES
83
84 /* *
85
* Hold the minimum , central and maximum values for each axis in the joystick
86
*/
87 JoyPos JOY_MIN , JOY_MAX , JOY_CURRENT ;
88
89 /* *
90
* Holds integer values representing button states
91
*/
72
CHAPTER A. CODE
92 ButtonState BUT_CURRENT ;
93
94 /* *
95
* TimerHandle for Joystick timer
96
*/
97 TimerHandle JoystickTimer ;
98
99
100 // FUNCTIONS
101
102 /* *
103
* Input :
NONE
104
* Output : 0 = ok
105
*
-1 = error
106
* Semantics :
Callibrates the minimum and maximum values for each axis
107
*
in the joystick and sets the global variables .
108
*/
109 int ca ll ib ra te Jo ys ti ck ( void ) ;
110
111 /* *
112
* Input :
NONE
113
* Output : 0 = ok
114
*
-1 = error
115
* Semantics :
Callibrates the joystcik , and starts the reading of joystick values
116
*/
117 int startJoystick ( void ) ;
118
119 /* *
120
* Input :
NONE
121
* Output : 0 = ok
122
*
-1 = error
123
* Semantics :
Stops the reading of joystick values
124
*/
125 int stopJoystick ( void ) ;
126
127 /* *
128
* Input :
NONE
129
* Output : NONE
130
* Semantics :
Updates the current settings of the joystick , and sets the
131
*
ODW speed appropriately
132
*/
133 void Joystick ( void ) ;
134
135 /* *
136
* Input :
NONE
137
* Output : NONE
73
* Semantics :
Get the current position of each axis in thejoystick .
139
*
The result will be stored in the global variable JOY_CURRENT
140
*/
141 void up da te J o y s t i c k P o s i t i o n ( void ) ;
142
143 /* *
144
* Input :
NONE
145
* Output : NONE
146
* Semantics :
Get current state of each button on the joystick base
147
*
The result will be stored in the global variable BUT_CURRENT
148
*/
149 void upd ate J o y s t i c k B u t t o n s ( void ) ;
150
151 /* *
152
* Input :
NONE
153
* Output :
The current position of the joystick
154
* Semantics :
Get the current position of the joystick
155
*/
156 JoyPos getJ o ys t i ck P o si t i on ( void ) ;
157
158 /* *
159
* Input :
NONE
160
* Output :
The current state of all 4 joystick buttons
161
* Semantics :
Get the current state of the 4 buttons
162
*/
163 ButtonState g et Jo ys ti ckB ut to ns ( void ) ;
164
165 /* *
166
* Input :
Button code
167
*
0 = Any buttons pushed
168
*
5 = Button 5
169
*
6 = Button 6
170
*
7 = Button 7
171
*
8 = Button 8
172
* Output :
A bit value for whether the buttons are currently being pushed
173
*
-1 = Illegal button code
174
*
0 = Not pushed
175
*
1 = Being pushed
176
* Semantics :
Get the current state of a button on the joystick , or
177
*
determine whether any button is currently being pressed .
178
*/
179 BYTE isButtonPushed ( int button_code ) ;
74
CHAPTER A. CODE
A.6
ODW Joystick.c
1 /* *
2
* ODW_Joystick . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is the code for initialising and reading from the ODW s joystick .
12
*/
13
14
15 # include " eyebot . h "
16 # include " ODW_Joystick . h "
17 # include " ODW_MotorCtrl . h "
18 # include < math .h >
19
20
21 int ca ll ib ra te Jo ys ti ck ()
22 {
23
// Auto callibration ( magic numbers )
24
JOY_MIN = ( JoyPos ) {95 , 920 , 145 , 1000};
25
JOY_MAX = ( JoyPos ) {905 , 75 , 845 , 58};
26
27
/*
28
// Manual callibration
29
LCDClear () ;
30
LCDPrintf (" Move joy to ...\ n ") ;
31
32
LCDPrintf (" bottom left \ n ") ;
33
LCDPrintf ("& push button 5\ n ") ;
34
while ( ! isButtonPushed (5) ) ;
35
AUBeep () ;
36
JOY_MIN = joy () ;
37
OSWait (50) ;
38
39
LCDPrintf (" top right \ n ") ;
40
LCDPrintf ("& push button 6\ n ") ;
41
while ( ! isButtonPushed (6) ) ;
42
AUBeep () ;
43
JOY_MAX = joy () ;
44
LCDPrintf (" Done !\ n ") ;
45
OSWait (100) ;
46
*/
75
return 0;
}
int startJoystick ()
{
int result = c al li br at eJ oy st ic k () ;
if ( result != 0 ) return result ;
JoystickTimer = OSAttachTimer ( JOY_FREQ , Joystick ) ;
if ( JoystickTimer == 0 ) result = 1;
else result = 0;
return result ;
}
int stopJoystick ()
{
int result = ! OSDetachTimer ( JoystickTimer ) ;
return result ;
}
void Joystick ()
{
double divisor ;
// Read current joystick values and update global variables accordingly
up da te J o y s t i c k P o s i t i o n () ;
upd ateJ o y s t i c k B u t t o n s () ;
// Adjust speed values to account for throttle position
divisor = THROTTLE_DIVISOR - ( THROTTLE_DIVISOR -1) /100 * JOY_CURRENT . t ;
// Set the ODW speed accordingly
setWCSpeed ( ( WCSpeed ) { round ( JOY_CURRENT . y / divisor ) , round ( JOY_CURRENT . x / divisor ) , round ( JOY_CURRENT . z / divisor ) } ) ;
88 }
89
90
91 void up da te J o y s t i c k P o s i t i o n ()
76
CHAPTER A. CODE
92 {
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
);
);
);
);
// Round to integers
JOY_CURRENT . x = ( int ) round ( x ) ;
JOY_CURRENT . y = ( int ) round ( y ) ;
JOY_CURRENT . z = ( int ) round ( z ) ;
// Correct throttle to account for the min / max
JOY_CURRENT . t = round (100 * ( JOY_CURRENT . t - JOY_MIN . t ) /( JOY_MAX . t - JOY_MIN . t ) ) ;
if ( JOY_CURRENT .t <0) JOY_CURRENT . t =0;
if ( JOY_CURRENT .t >100) JOY_CURRENT . t =100;
125
126
127 }
128
129
130 void u p d a t e J o y s t i c k B u t t o n s ()
131 {
77
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
}
JoyPos getJ o ys t i ck P o si t i on ( void )
{
JoyPos joypos ;
joypos . x
joypos . y
joypos . z
joypos . t
=
=
=
=
JOY_CURRENT . x ;
JOY_CURRENT . y ;
JOY_CURRENT . z ;
JOY_CURRENT . t ;
return joypos ;
}
ButtonState g et Jo ys ti ckB ut to ns ( void )
{
ButtonState bs ;
bs . b5
bs . b6
bs . b7
bs . b8
=
=
=
=
BUT_CURRENT . b5 ;
BUT_CURRENT . b6 ;
BUT_CURRENT . b7 ;
BUT_CURRENT . b8 ;
return bs ;
}
BYTE isButtonPushed ( int button_code )
{
switch ( button_code ) {
case 0:
return ( BUT_CURRENT . b5 || BUT_CURRENT . b6 || BUT_CURRENT . b7 || BUT_CURRENT . b8 ) ;
break ;
case 5:
return BUT_CURRENT . b5 ;
break ;
case 6:
return BUT_CURRENT . b6 ;
break ;
78
CHAPTER A. CODE
175
176
177
178
179
180
181
182
183
184 }
case 7:
return BUT_CURRENT . b7 ;
break ;
case 8:
return BUT_CURRENT . b8 ;
break ;
}
return -1;
79
A.7
ODW IR.h
1 /* *
2
* ODW_IR . h
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is header file for the code that allows control ofthe ODW via an
12
*
infra - red remote control .
13
*
14
* Note :
15
*
The types , variables and functions defined here should be available
16
*
regardless of the implementation .
17
*/
18
19
20 /* *
21
* Key Code
Meaning
22
*
23
* 0
No Key
24
* RC_0
0 Key
25
* RC_1
1 Key
26
* RC_2
2 Key
27
* RC_3
3 Key
28
* RC_4
4 Key
29
* RC_5
5 Key
30
* RC_6
6 Key
31
* RC_7
7 Key
32
* RC_8
8 Key
33
* RC_9
9 Key
34
* RC_PLUS
+ Key
35
* RC_MINUS
- Key
36
* RC_FF
>> Key
37
* RC_RW
<< Key
38
* RC_STOP
Stop Key
39
* RC_PLAY
Play Key
40
* RC_STANDBY
On / Off Key
41
* RC_OK
OK Key
42
*/
43
44
45
80
CHAPTER A. CODE
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// DEFINITIIONS
/* *
* 100/ Hz
* The frequency with which to check for an IR key press
*/
# define IR_FREQ 100/10
// GLOBAL VARIABLES
/* *
* Handle for the Infra Red Timer which checks for an
* infra red key press with frequency determined by IR_FREQ .
*/
TimerHandle IRTimer ;
/* *
* The size of a step increase in speed .
*/
int IRstep ;
// FUNCTIONS
/* *
* Input :
NONE
* Output : 0 = ok
*
-1 = error
* Semantics :
Initialise and start the control by IR remote control
76
*/
77 int startIR ( void ) ;
78
79 /* *
80
* Input :
NONE
81
* Output : 0 = ok
82
*
-1 = error
83
* Semantics :
Check for and deal with a key press
84
*/
85 void IRKey ( void ) ;
86
87 /* *
88
* Input :
NONE
89
* Output : 0 = ok
90
*
-1 = error
91
* Semantics :
Stop the control by IR remote control
92
*/
93 int stopIR ( void ) ;
81
A.8
ODW IR.c
1 /* *
2
* ODW_IR . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
This is code to allow control of the ODW via an infra - red remote control .
12
*/
13
14
15 # include " eyebot . h "
16 # include " ODW_IR . h "
17 # include " ODW_MotorCtrl . h "
18 # include " irtv . h "
19 # include " IRnokia . h "
20
21
22 int startIR ( void )
23 {
24
// Initialise IR using appropriate settings
25
int result = IRTVInit ( SPACE_CODE ,15 ,0 ,0 x03ff , SLOPPY_MODE ,1 ,10) ;
26
27
IRstep = 10;
28
IRTimer = OSAttachTimer ( IR_FREQ , IRKey ) ;
29
30
return result ;
31 }
32
33
34 int stopIR ( void )
35 {
36
int result = ! OSDetachTimer ( IRTimer ) ;
37
// Terminate IR
38
IRTVTerm () ;
39
40
return result ;
41 }
42
43
44 void IRKey ( void )
45 {
82
CHAPTER A. CODE
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
83
84
CHAPTER A. CODE
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
case RC_7 :
// 7 key pressed : Backward - Left
if ( -1* currentwcspeed . x == currentwcspeed . y && currentwcspeed . w == 0 )
{
x = currentwcspeed . x ;
y = currentwcspeed . y ;
if ( x > 0 ) x = 0;
if ( y < 0 ) y = 0;
x = x - IRstep ;
y = y + IRstep ;
} else {
x = -1 * IRstep ;
y = IRstep ;
}
setWCSpeed ( ( WCSpeed ) {x , y , 0} ) ;
break ;
case RC_8 :
// 8 key pressed : Backward
if ( currentwcspeed . y == 0 && currentwcspeed . w == 0 )
{
x = currentwcspeed . x ;
if ( x > 0 ) x = 0;
x = x - IRstep ;
} else {
x = -1 * IRstep ;
}
setWCSpeed ( ( WCSpeed ) {x , 0 , 0} ) ;
break ;
case RC_9 :
// 9 key pressed : Backward - Right
if ( -1* currentwcspeed . x == -1* currentwcspeed . y && currentwcspeed . w == 0 )
{
x = currentwcspeed . x ;
y = currentwcspeed . y ;
if ( x > 0 ) x = 0;
if ( y > 0 ) y = 0;
x = x - IRstep ;
y = y - IRstep ;
} else {
x = -1 * IRstep ;
y = -1 * IRstep ;
}
setWCSpeed ( ( WCSpeed ) {x , y , 0} ) ;
break ;
85
case RC_PLUS :
// + key pressed : Increase Step Size
IRstep = IRstep + 10;
if ( IRstep > 100 ) IRstep = 100;
if ( IRstep < 5 ) IRstep = 5;
break ;
case RC_MINUS :
// - key pressed : Decrease Step Size
IRstep = IRstep - 10;
if ( IRstep > 100 ) IRstep = 100;
if ( IRstep < 5 ) IRstep = 5;
break ;
case RC_FF :
// >> key pressed : Rotate Right
if ( currentwcspeed . x == 0.0 && currentwcspeed . y== 0.0 )
{
w = currentwcspeed . w ;
if ( w > 0 ) w = 0;
w = w - IRstep ;
} else {
w = -1 * IRstep ;
}
setWCSpeed ( ( WCSpeed ) {0 , 0 , w } ) ;
break ;
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231 }
case RC_RW :
// << key pressed : Rotate Left
if ( currentwcspeed . x == 0.0 && currentwcspeed . y== 0.0 )
{
w = currentwcspeed . w ;
if ( w < 0 ) w = 0;
w = w + IRstep ;
} else {
w = IRstep ;
}
setWCSpeed ( ( WCSpeed ) {0 , 0 , w } ) ;
break ;
case RC_STOP :
// Stop key pressed : STOP !
setWCSpeed ( WC_STOPPED ) ;
break ;
}
86
CHAPTER A. CODE
A.9
Makefile
1 include Makeincl
2
3 LIBS
= - lm
4 CFLAGS
=
5 AFLAGS
=
6
7 ASMSOURCE = $ ( wildcard *. s )
8 CSOURCE
= $ ( wildcard *. c )
9
10
11 all :
ODW . hex
12
13 ODW . hex :
ODW . o ODW_MotorCtrl . o ODW_Joystick . o ODW_IR . o
14
$ ( CC68 ) $ ( CFLAGS ) -o ODW . hex ODW . o ODW_MotorCtrl . o ODW_Joystick . o ODW_IR . o $ ( LIBS )
15
16 clean :
17
-$ ( RM ) $ ( addsuffix . hex , $ ( basename $ ( CSOURCE ) ) $ ( basename $ ( ASMSOURCE ) ) ) \
18
$ ( addsuffix . elf , $ ( basename $ ( CSOURCE ) ) ) \
19
$ ( addsuffix .o , $ ( basename $ ( CSOURCE ) ) ) \
20
$ ( addsuffix .o , $ ( basename $ ( ASMSOURCE ) ) ) \
21
*. hex core
22
23 %. o :
%. c
24
$ ( CC68 ) $ ( CFLAGS ) -c -o $@ $ <
25
26 %. o :
%. s
27
$ ( AS68 ) $ ( AFLAGS ) -c -o $@ $ <
87
A.10. MAKEINCL
A.10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Makeincl
88
CHAPTER A. CODE
A.11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
test.c
/* *
* test . c
*
* Author :
*
Benjamin Woods (10218282)
*
The University of Western Australia
*
Bachelor of Engineering & Bachelor of Commerce
*
Final Year Mechatronics Engineering Project 2006
*
* Description :
*
Test the basic use of the Eyebot LCD .
*/
# include " eyebot . h "
int main ( int argc , char * argv [] )
{
LCDPrintf ( " Hello , World !\ n " ) ;
OSWait (500) ;
return 0;
}
89
A.12. MCTEST.C
A.12
mctest.c
1 /* *
2
* mctest . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
Test the communication with the Roboteq cards and the resulting motor speeds
12
*/
13
14 # include " eyebot . h "
15
16 # define BAUD SER9600
17 # define HANDSHAKE NONE
18 # define INTERFACE SERIAL2
19
20 # define sccr1 0 xfc0a
21
22 int main ( int argc , char * argv [] )
23 {
24
int key , error ;
25
char ch ;
26
27
LCDClear () ;
28
LCDMenu ( " GO " , " " , " " , " STOP " ) ;
29
30
LCDPrintf ( " Init ...\ n " ) ;
31
OSInitRS232 ( BAUD , HANDSHAKE , INTERFACE ) ;
32
33
// Set RS232 on SERIAL2 to 7 Bit EvenParity and 1 Stopbit
34
(*((( volatile BYTE *) Ser1Base ) +3) ) = 0 x1a ;
35
36
// Set RS232 on SERIAL1 to 7 Bit EvenParity and 1 Stopbit
37
// (*(( volatile unsigned short *) sccr1 ) ) = 0 x042c ;
38
39
do
40
{
41
key = KEYGet () ;
42
} while ( key != KEY1 && key != KEY4 ) ;
43
44
OSWait (10) ;
45
if ( key == KEY4 ) return 0;
46
90
CHAPTER A. CODE
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 }
91
A.13. JOYTEST.C
A.13
joytest.c
1 /* *
2
* joytest . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
Test the joystick by displaying readings as numbers on the screen .
12
*
The LCD can be set ( using the Eyebot keys ) to display either :
13
*
- Raw values read from the 4 potentiometers in the joystick
14
*
- Percentage and thresholded values of the joysticks position
15
*
- 0 s and 1 s representing the states of the 4 joystick buttons
16
*/
17
18 # include " eyebot . h "
19 # include < limits .h >
20 # include < math .h >
21
22 # define BUTTON5 0 x10
23 # define BUTTON6 0 x20
24 # define BUTTON7 0 x40
25 # define BUTTON8 0 x80
26 # define X_CHANNEL 4
27 # define Y_CHANNEL 5
28 # define Z_CHANNEL 6
29 # define T_CHANNEL 7
30 # define X_THRESHOLD 15
31 # define Y_THRESHOLD 15
32 # define Z_THRESHOLD 15
33
34 typedef struct
35 {
36
int x ;
37
int y ;
38
int z ;
39
int t ;
40 } JoyPos ;
41
42 int STOP_RUNNING ;
92
CHAPTER A. CODE
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
=
=
=
=
OSGetAD (
OSGetAD (
OSGetAD (
OSGetAD (
X_CHANNEL
Y_CHANNEL
Z_CHANNEL
T_CHANNEL
);
);
);
);
return joypos ;
}
void callibrate ()
{
// Auto callibration ( magic numbers )
MIN = ( JoyPos ) {95 , 920 , 145 , 1000};
MAX = ( JoyPos ) {905 , 75 , 845 , 58};
/*
// Manual callibration
LCDClear () ;
LCDPrintf (" Move joy to ...\ n ") ;
LCDPrintf (" bottom left \ n ") ;
LCDPrintf ("& push button 5\ n ") ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUBeep () ;
MIN = joy () ;
OSWait (300) ;
LCDPrintf (" top right \ n ") ;
LCDPrintf ("& push button 6\ n ") ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUBeep () ;
MAX = joy () ;
93
A.13. JOYTEST.C
92
93
94
95
96 }
97
98 int
99 {
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
94
CHAPTER A. CODE
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
95
A.13. JOYTEST.C
182
183
184
185
186
187
188
189 }
OSWait (10) ;
}
LCDPrintf ( " Stopping ...\ n " ) ;
return 0;
96
CHAPTER A. CODE
A.14
joytest2.c
1 /* *
2
* joytest2 . c
3
*
4
* Author :
5
*
Benjamin Woods (10218282)
6
*
The University of Western Australia
7
*
Bachelor of Engineering & Bachelor of Commerce
8
*
Final Year Mechatronics Engineering Project 2006
9
*
10
* Description :
11
*
Test the joystick using a graphical display on the Eyebot LCD .
12
*/
13
14 # include " eyebot . h "
15 # include < limits .h >
16 # include < math .h >
17
18 # define BUTTON5 0 x10
19 # define BUTTON6 0 x20
20 # define BUTTON7 0 x40
21 # define BUTTON8 0 x80
22
23 # define X_CHANNEL 4
24 # define Y_CHANNEL 5
25 # define Z_CHANNEL 6
26 # define T_CHANNEL 7
27
28 # define X_THRESHOLD 15
29 # define Y_THRESHOLD 15
30 # define Z_THRESHOLD 15
31 # define JOY_FREQ 100/5
32
33 typedef struct
34 {
35
int x ;
36
int y ;
37
int z ;
38
int t ;
39 } JoyPos ;
40
41 typedef struct
42 {
43
BYTE b5 ;
44
BYTE b6 ;
45
BYTE b7 ;
46
BYTE b8 ;
97
A.14. JOYTEST2.C
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
} ButtonState ;
int STOP_RUNNING ;
JoyPos JOY_MAX , JOY_MIN , JOY_CURRENT , JOY_OLD ;
ButtonState BUT_CURRENT , BUT_OLD ;
int xy_realx ( int x )
{
return ( round ( x /4.0) + 32) ;
}
int xy_realy ( int y )
{
return (32 - round ( y /4.0) ) ;
}
int z_realx ( int z )
{
return ( round ( z *0.15) +83 ) ;
}
int t_realy ( int t )
{
return ( 52 - round ( t *0.2) ) ;
}
void xy_plot ( int x , int y , int col )
{
LCDSetPixel ( xy_realx ( x ) , xy_realy ( y ) , col ) ;
}
98
CHAPTER A. CODE
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
xy_drawline ( x -2 , y +2 , x +2 , y -2 , col ) ;
}
void drawrectangle ( int x1 , int y1 , int x2 , int y2 , int col )
{
LCDLine ( x1 , y1 , x1 , y2 , col ) ;
LCDLine ( x1 , y2 , x2 , y2 , col ) ;
LCDLine ( x2 , y2 , x2 , y1 , col ) ;
LCDLine ( x2 , y1 , x1 , y1 , col ) ;
}
void drawmap ()
{
xy_drawrectangle ( -100 , -100 , 100 , 100 , 1 ) ;
xy_drawline ( X_THRESHOLD , -100 , X_THRESHOLD , 100 , 1 ) ;
xy_drawline ( -1* X_THRESHOLD , -100 , -1* X_THRESHOLD , 100 , 1 );
110
xy_drawline ( -100 , Y_THRESHOLD , 100 , Y_THRESHOLD , 1 ) ;
111
xy_drawline ( -100 , -1* Y_THRESHOLD , 100 , -1* Y_THRESHOLD , 1 );
112
113
drawrectangle ( 68 , 12 , 98 , 22 , 1 ) ;
114
LCDLine ( z_realx ( -1* Z_THRESHOLD ) , 12 , z_realx ( -1* Z_THRESHOLD ) , 22 , 1 ) ;
115
LCDLine ( z_realx ( Z_THRESHOLD ) , 12 , z_realx ( Z_THRESHOLD ) ,22 , 1 ) ;
116
117
drawrectangle ( 78 , 52 , 88 , 32 , 1 ) ;
118
119
drawrectangle ( 110 , 7 , 120 , 17 , 1 ) ;
120
drawrectangle ( 110 , 20 , 120 , 30 , 1 ) ;
121
drawrectangle ( 110 , 34 , 120 , 44 , 1 ) ;
122
drawrectangle ( 110 , 47 , 120 , 57 , 1 ) ;
123 }
124
125 void drawzt ( int z , int t , int col )
126 {
127
LCDLine ( z_realx ( z ) , 12 , z_realx ( z ) , 22 , col ) ;
128
LCDLine ( 78 , t_realy ( t ) , 88 , t_realy ( t ) , col ) ;
129 }
130
131 void drawbuttons ( BYTE b5 , BYTE b6 , BYTE b7 , BYTE b8 , int col )
132 {
if ( b5 ) LCDArea ( 111 , 8 , 119 , 16 , col ) ;
133
134
if ( b6 ) LCDArea ( 111 , 21 , 119 , 29 , col ) ;
135
if ( b7 ) LCDArea ( 111 , 35 , 119 , 43 , col ) ;
136
if ( b8 ) LCDArea ( 111 , 48 , 119 , 56 , col ) ;
137 }
99
A.14. JOYTEST2.C
138
139 void drawreadings ()
140 {
141
xy_drawcross ( JOY_OLD .x , JOY_OLD .y , 0 ) ;
142
drawzt ( JOY_OLD .z , JOY_OLD .t , 0 ) ;
143
drawbuttons ( BUT_OLD . b5 , BUT_OLD . b6 , BUT_OLD . b7 , BUT_OLD . b8 , 0 ) ;
144
145
drawmap () ;
146
147
JOY_OLD . x = JOY_CURRENT . x ;
148
JOY_OLD . y = JOY_CURRENT . y ;
149
JOY_OLD . z = JOY_CURRENT . z ;
150
JOY_OLD . t = JOY_CURRENT . t ;
151
152
BUT_OLD . b5 = BUT_CURRENT . b5 ;
153
BUT_OLD . b6 = BUT_CURRENT . b6 ;
154
BUT_OLD . b7 = BUT_CURRENT . b7 ;
155
BUT_OLD . b8 = BUT_CURRENT . b8 ;
156
157
xy_drawcross ( JOY_OLD .x , JOY_OLD .y , 1 ) ;
158
drawzt ( JOY_OLD .z , JOY_OLD .t , 1 ) ;
159
drawbuttons ( BUT_OLD . b5 , BUT_OLD . b6 , BUT_OLD . b7 , BUT_OLD . b8 , 1 ) ;
160 }
161
162 void button_beep ()
163 {
164
if ( BUT_CURRENT . b5 || BUT_CURRENT . b6 || BUT_CURRENT . b7 || BUT_CURRENT . b8 )
165
AUTone ( BUT_CURRENT . b5 *1000+ BUT_CURRENT . b6 *1500+ BUT_CURRENT . b7 *3000+ BUT_CURR
50) ;
166 }
167
168 void joy_update ()
169 {
170
BUT_CURRENT . b5 = !(( OSReadInLatch ( 0 ) & BUTTON5 ) / BUTTON5 ) ;
171
BUT_CURRENT . b6 = !(( OSReadInLatch ( 0 ) & BUTTON6 ) / BUTTON6 ) ;
172
BUT_CURRENT . b7 = !(( OSReadInLatch ( 0 ) & BUTTON7 ) / BUTTON7 ) ;
173
BUT_CURRENT . b8 = !(( OSReadInLatch ( 0 ) & BUTTON8 ) / BUTTON8 ) ;
174
175
JOY_CURRENT . x = 200*( OSGetAD ( X_CHANNEL ) - JOY_MIN . x ) /( JOY_MAX . x - JOY_MIN . x ) - 100;
176
JOY_CURRENT . y = 200*( OSGetAD ( Y_CHANNEL ) - JOY_MIN . y ) /( JOY_MAX . y - JOY_MIN . y ) - 100;
100
CHAPTER A. CODE
JOY_CURRENT . z = 200*( OSGetAD ( Z_CHANNEL ) - JOY_MIN . z ) /( JOY_MAX . z - JOY_MIN . z ) - 100;
JOY_CURRENT . t = 100*( OSGetAD ( T_CHANNEL ) - JOY_MIN . t ) /( JOY_MAX . t - JOY_MIN . t ) ;
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
}
void callibrate ()
{
// Auto callibration ( magic numbers )
JOY_MIN = ( JoyPos ) {95 , 920 , 145 , 1000};
JOY_MAX = ( JoyPos ) {905 , 75 , 845 , 58};
/*
// Manual callibration
LCDClear () ;
LCDPrintf (" Move joy to ...\ n ") ;
LCDPrintf (" bottom left \ n ") ;
LCDPrintf ("& push button 5\ n ") ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUBeep () ;
JOY_MIN .= joy () ;
OSWait (300) ;
LCDPrintf (" top right \ n ") ;
LCDPrintf ("& push button 6\ n ") ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUTone (5000 , 50) ;
OSWait (100) ;
AUBeep () ;
JOY_MAX .= joy () ;
LCDPrintf (" Done !\ n ") ;
OSWait (100) ;
*/
}
int main ( int argc , char * argv [] )
{
STOP_RUNNING = 0;
int key = 0;
callibrate () ;
101
A.14. JOYTEST2.C
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241 }
102
CHAPTER A. CODE
A.15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
psdtest.c
/* *
* psdtest . c
*
* Author :
*
Benjamin Woods (10218282)
*
The University of Western Australia
*
Bachelor of Engineering & Bachelor of Commerce
*
Final Year Mechatronics Engineering Project 2006
*
* Description :
*
Test the position sensitive devices on the wheelchair
*/
# include < eyebot .h >
int main ()
{
PSDHandle psdright ;
int start , key , current , stop , release ;
psdright = PSDInit ( PSD_RIGHT ) ;
start = PSDStart ( psdright , TRUE ) ;
LCDPrintf ( " Start : % d \ n " , start ) ;
LCDMenu ( " GO " , " " , " " , " END " ) ;
do {
key = KEYGet () ;
} while ( key != KEY1 && key != KEY4 ) ;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 }
103
A.15. PSDTEST.C
104
Appendix B
Mechanical and Electrical Designs
B.1
Joystick Circuit
O
6
O
6
O
6
O
7;
7;
7;
7;
O
105
106
107
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
TITLE
SCALE
SIZE
DWG NO
Wheelchair Design
SHEET
1 OF 1
REV
B.2
Suspension Designs
108
494.00
560.00
224.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
SIZE
SCALE
DWG NO
SHEET
1 OF 1
Battery Box
TITLE
REV
290.00
109
172.00
440.00
500.00
172.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
SCALE
SIZE
DWG NO
SHEET
1 OF 1
TITLE
REV
224.00
170.00
230.00
110
180.00
30.00
30.00
204.00
3.00
500.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
204.00
SIZE
SCALE
DWG NO
SHEET
1 OF 1
TITLE
REV
3.00
111
290.00
30.00
500.00
30.00
30.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
30.00
21/08/2006
21/08/2006
SCALE
SIZE
DWG NO
SHEET
1 OF 1
TITLE
REV
112
70.00
DRAWN
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
21/08/2006
21/08/2006
TITLE
SCALE
SIZE
DWG NO
Motor Mounts
REV
SHEET
1 OF 1
10.00
24.00
10.00
113
3.00
50.00
16.50
19.00
R10.00
n10.00
21.00
90.00
215.00
15.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
n20.00
SCALE
SIZE
DWG NO
SHEET
1 OF 1
TITLE
REV
39.00
50.00
114
22.00
145.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
22.00
TITLE
21/08/2006
21/08/2006
SCALE
SIZE
Swivel Arm
DWG NO
SHEET
n12.00
1 OF 1
n20.00
REV
115
24.00
3
16
.4
17.00
27.00
n8.00
R10.00
14.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
SCALE
SIZE
DWG NO
SHEET
1 OF 1
Mounting Bracket
TITLE
REV
14.00
5.00
5.00
116
45.0
n26.00
80.00
23.00
23.00
5.00
80.00
2
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
21/08/2006
21/08/2006
SCALE
SIZE
10
DWG NO
SHEET
1 OF 1
TITLE
REV
117
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
20/09/2006
20/09/2006
TITLE
SCALE
SIZE
11
DWG NO
SHEET
1 OF 1
REV
25.00
118
255.00
50.00
560.00
255.00
33.00
3.00
2
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
33.00
20/09/2006
20/09/2006
SIZE
SCALE
12
DWG NO
SHEET
1 OF 1
TITLE
REV
30.00
284.00
119
75.00
130.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
20/09/2006
20/09/2006
SCALE
SIZE
13
DWG NO
SHEET
1 OF 1
TITLE
REV
24.50
25.00
230.00
120
130.00
APPROVED
MFG
QA
Chris Croft
CHECKED
Benjamin Woods
DRAWN
20/09/2006
20/09/2006
SIZE
SCALE
14
DWG NO
SHEET
1 OF 1
TITLE
REV
24.50
25.00
230.00
Appendix C
Information and Brochures
121
C.1
Roboteq AX1500
AX1500
Dual Channel
Forward/Reverse
Digital Robot Controller
2 x 30 SmartAmps
Roboteqs AX1500 controller is designed to convert commands received from a R/C radio, Analog Joystick, wireless
modem, or microcomputer into high voltage and high current output for driving one or two DC motors. Designed for
maximal ease-of-useby professionals and hobbyist alike, it
is delivered with all necessary cables and hardware and is
ready to use in minutes.
The controller's two channels can either be operated independently or mixed to set the direction and rotation of a
vehicle by coordinating the motion on each side of the vehicle. The motors may be operated in open or closed loop
speed mode. Using low-cost position sensors, they may
also be set to operate as heavy-duty position servos.
The AX2850 version is equipped with quadrature optical
encoders inputs for precision speed or position operation.
Numerous safety features are incorporated into the controller to ensure reliable and safe operation.
The controller can be reprogrammed in the field with the
latest features by downloading new operating software
from Roboteq.
Applications
Key Features
Microprocessor digital
design
R/C mode support
RS232 Serial mode
support
Analog mode support
Header for Optional
Optical encoder
Built-in power drivers
for two motors
Up to 30A output per
channel
Programmable current
limitation
Open loop or closed
loop speed control
Closed loop position
control
Data Logging Output
Built-in DC/DC converter
Compact Board Level
Design
Field upgradable software
122
Benefits
Accurate, reliable, and fully programmable operation. Advanced algorithms
Connects directly to simple, low cost R/
C radios
Connects directly to computers for
autonomous operation or to wireless
modem for two-way remote control
Connects directly to analog joystick
Stable speed regardless of load. Accurate measurement of travelled distance
Supports all common robot drive methods
Suitable for a wide range of motors
Protects controller, motors, wiring and
battery.
Low cost or higher accuracy speed control
Create low cost, ultra-high torque
jumbo servos
Capture operating parameters in PC for
analysis
Operates from a single 12V-40V battery
Lightweight and easy to incorporate in
most applications
Never obsolete. Add features via the
internet
Technical Features
External temperature sensor inputs
User defined purpose (RS232 mode
only)
One Switch input configurable as
Emergency stop command
Simple operation
Software upgradable with new features
Multiple Command Modes
vehicle inverted
Up to 2 general purpose outputs for accessories or weapon
One 24V, 2A output
12 to 40 V operation
User programmable current limit up to 30A
Standard Fast-on connectors for power
supply and motors
Built-in Sensors
Multiple Motor Control modes
activation
Compact Design
Ordering Information
Model
AX1500
Description
Dual Channel DC Motor controller up to 30 SmartAmps per channel
www.roboteq.com
602-617-3931
123