Word 2007 Version - Vanderbilt University

advertisement
ISAC Anthropomorphic Hand
Vanderbilt University
Senior Design Project
Sponsor: Dr. Kazuhiko Kawamura, CIS
Project Members:
Tom Billings
Kit Buckley
Ananya Majumder
Scott Shugh
Michael Stock
~
Acknowledgements
~
We would like to acknowledge the following people for their aid during this design process:
-
Kazuhiko Kawamura
- Erdem Erdemir
- Michael Goldfarb
- Tom Withrow
- Flo Wahidi
- Lason Watai
- Lewis Saettel
And lastly, we would like to thank Professor Dozier for his guidance.
2
Table of Contents
1 Introduction ............................................................................................................................................. 5
1.1 Background ....................................................................................................................................... 5
2 System Description................................................................................................................................... 6
2.1 Operational Concept ......................................................................................................................... 6
2.2 Hardware Overview .............................................................................................................................. 7
2.2.1 Palm............................................................................................................................................ 7
2.2.2 Fingers ........................................................................................................................................ 8
2.2.3 Touch Sensors ............................................................................................................................ 8
2.2.4 Stepper Motor, Driver Card, Microcontroller Board .................................................................. 8
2.3 Software Overview ............................................................................................................................ 9
2.3.1 Microcontroller Overview .......................................................................................................... 9
2.3.2 High Level Code Overview.......................................................................................................... 9
3 Detailed Design ...................................................................................................................................... 10
3.1 Hardware Detailed Design .............................................................................................................. 10
3.2.1 Palm.......................................................................................................................................... 10
3.2.2 Fingers ...................................................................................................................................... 11
3.2.3 Touch Sensors .......................................................................................................................... 12
3.2.4 Actuation .................................................................................................................................. 15
3.2.5 Stepper Motors and Driver Cards ............................................................................................ 15
3.2.6 Driver Cards and Microcontroller Board .................................................................................. 17
3.2 Software Detailed Design ................................................................................................................ 20
3.2.1 Microcontroller Detailed Design .............................................................................................. 20
3.2.2 High Level Code Detailed Design.............................................................................................. 24
4 Evaluation Procedure & Results ............................................................................................................. 30
4.1 Testing ............................................................................................................................................. 30
4.1.1 Durability Testing ..................................................................................................................... 30
4.1.2 Functionality Testing ................................................................................................................ 31
4.1.3 Touch sensor Testing................................................................................................................ 32
5 Conclusion .............................................................................................................................................. 32
6 Recommendations for Future Work ...................................................................................................... 32
6.1 Hardware Improvements ................................................................................................................ 33
3
6.2 Software Improvements ................................................................................................................. 33
Appendix A – Figure Listing and Visio Drawing Compilation ...................................................................... 34
Appendix B: Hardware Overviews .............................................................................................................. 44
APS12DT256SLK Development Kit .......................................................................................................... 44
EasyDriver v3 Stepper Motor Driver ........................................................................................................... 45
Interlink Force Sensing Resistors ............................................................................................................ 45
Jameco 237472 Bipolar Stepper Motor .................................................................................................. 46
Spindle Caps ............................................................................................................................................ 47
Enclosure................................................................................................................................................. 47
Polymorph Plastic ................................................................................................................................... 47
Rapid Prototype ...................................................................................................................................... 47
25-lb Test Fishing Line ............................................................................................................................. 48
Nuts and Bolts ......................................................................................................................................... 48
Appendix C: Project Code ........................................................................................................................... 49
Appendix D: Parts List ................................................................................................................................. 50
Appendix E: User’s Guide ............................................................................................................................ 51
1
Software User Details.......................................................................................................................... 53
1.1 Using the GUI .................................................................................................................................. 53
1.2 Debugging Help ............................................................................................................................... 54
1.2.1 Using the Hand Class ................................................................................................................ 54
1.2.2 Loading Code onto the Microcontroller ................................................................................... 54
1.2.3 Debugging using the CodeWarrior IDE..................................................................................... 55
1.2.4 Troubleshooting Suggestions ................................................................................................... 55
2 Hardware User Details ............................................................................................................................. 56
2.1 Making a New Finger....................................................................................................................... 56
2.2 Replacing a Finger ........................................................................................................................... 56
2.3 Resetting a Finger............................................................................................................................ 56
3 Normal System Operation Recommendations ........................................................................................ 57
4
1 Introduction
The Center for Intelligent Systems is a research group whose goal is to advance the state of the art in
intelligent systems such as autonomous robots through development in the areas of skill learning,
perception learning, and task learning. The CIS Anthropomorphic Hand project, sponsored by Dr.
Kazuhiko Kawamura of CIS (eecs.vanderbilt.edu/cis), aims to create a humanoid hand for the ISAC robot
currently used in the cognitive robotics laboratory. The project has the following specifications:
1. The hand must be an anthropomorphic right hand, necessitating four digits and a thumb, each
with humanoid joints and grasping action.
2. The total mass of the hand cannot exceed 1 kg.
3. The hand must be durable; it must be able to survive an impact due to arm malfunction.
4. The hand should possess independent finger control and should also be able to perform three
distinct grasping functions: a full hand close, a two-finger (thumb and index) pinch, and a threefinger (thumb, index, and middle) grasp.
5. There should be feedback from the fingers to the control unit to indicate when a touch occurs.
1.1 Background
There are numerous robotic hands currently on the market. The one that most closely duplicates
humanoid function is the Shadow Hand, manufactured by the Shadow Robot Company
(www.shadowrobot.com). This hand has 24 degrees of freedom, 40 air muscles, and provides enough
sensitivity to detect a single coin. The hand can be controlled via a Controller Area Network (CAN) bus
interface and an embedded Ethernet interface. The hand is relatively heavy, weighing 3.9 kg, and very
expensive, costing about $100,000. It is semi-autonomous.
A hand with similar functionality has been created at the University of Bologna in Italy. The UB Hand III
has 16 degrees of freedom and is controlled with position and force sensors as compared to the
pressure sensors employed by the Shadow Hand. Unlike the Shadow Hand, the UB Hand III is a research
prototype and is not commercially available
(www-lar.deis.unibo.it/activities/dexterousmanipulation/UBHandIII).
CIS has commissioned hands for ISAC in the past. Of the two hands currently attached to the robot, only
one is functional. This hand is actually a two-fingered gripper which is not conducive to interaction with
human subjects. The other hand is five-fingered but is no longer functional due to a lack of durability: an
arm malfunction caused the hand to be repeatedly hit against other objects, eventually breaking the
hand. This hand was implemented with pneumatic pistons and capacitive touch sensors, but has not
worked for several years. The CIS lab has commissioned an anthropometric replacement for the nonfunctional hand so it can be used in both robotic control research and psychology experiments.
5
The Vanderbilt Center for Intelligent Mechatronics has created a hand to be used with its
monopropellant actuators. This hand is being developed to be incorporated into a prosthetic arm that
the center is developing. As such, it can replicate most human hand movements and is more
sophisticated than the needs of the ISAC robot (http://research.vuse.vanderbilt.edu/cim/Default.htm).
2 System Description
2.1 Operational Concept
The system is composed of five major components as shown in Figure 1. The extremity of the hand
consists of five fingers fashioned with Polymorph and providing feedback by means of a touch sensor at
each fingertip. The fingers are attached to a palm, printed using rapid prototype. On a remote control
board connected to ISAC's body will be five bi-polar stepper motors used to control each finger
independently. The motors pull and release 25-lb test fishing line that is run through cable housing to
the fingers. A microcontroller will control the motors as well as receive feedback from the touch sensors
on the hand. When a touch is registered, the finger continues to close for a predetermined number of
steps more, ensuring a tight squeeze. The microcontroller will be connected by means of a serial port to
a computer that contains a C++ control program in IMA2 architecture. This computer will be connected
to the other computer agents used to control ISAC.
Overall Architecture
Touch
Sensors
Polymorph Fingers
Rapid Prototype Palm
Touch
Sensor Wires
Cable Housing
Bi-Polar
Stepper
Motors w/
Spindles
Motor Power
12 VDC, 4 A
Wall Plug-in
Power
Supply
C++ Class
EasyDriver
Cards
Serial
Connection
Touch
Sensor
Circuit
Microcontroller
Control Box
(not on hand)
Reset Switch
Figure 1 - System Overview
6
5 VDC
Microcontroller
Power Supply
Figure 2 - Image of hand attached to ISAC's arm
Figure 3 - Close-up of hand
2.2 Hardware Overview
2.2.1 Palm
The palm allows for strong connections to the fingers and arm while being light enough to stay within
the specified weight requirement. It provides connections for the elastic cord used for extension as well
as a place through which the flexion cables can be routed before they reach the motors. The palm’s
7
design itself, besides providing the structural necessities stated above, enhances the durability of the
overall hand.
2.2.2 Fingers
To fulfill the project requirements, the fingers had to be affordable and lightweight yet durable. The
material used to form the fingers had to be relatively inexpensive while still providing the required
strength. The weakest portion of the fingers, consequently the place where failure would be expected to
occur first, was the joints. Therefore, when designing the finger, the creation of the joints and methods
for maintaining their functionality was emphasized. The finger also had to be designed to accommodate
the connections and interactions with the materials used for flexion, extension, and feedback. The
extension was produced by a passive mechanism, in contrast to an active actuator-controlled flexion
mechanism, so special consideration had to be taken for how these mechanisms would best connect to
and work with the finger.
2.2.3 Touch Sensors
Force sensing resistors are attached to each fingertip. The resistance of these sensors is variable and is a
function of the inverse of the applied force. In order to detect a touch, a simple inverting op-amp circuit
was created in conjunction with each sensor. Changing the other resistor in the circuit can change the
sensitivity of the system. Additionally, each force resistor is covered with a Polymorph “fingertip” which
allows an increase in the effective surface area of the resistor while maintaining the anthropomorphicity
of the hand.
2.2.4 Stepper Motor, Driver Card, Microcontroller Board
The finger actuation is controlled by 5 stepper motors. Each motor is connected to a driver card. The
driver cards accept a step pulse and a direction from the microcontroller. They also receive power for
the stepper motors and translate the microcontroller step into a motor step at the correct motor
current and voltage level. These 5 driver cards are mounted on a circuit board that also contains the
microcontroller and two 16 pin IC sockets. These IC sockets allow for wires that control the stepper
motors to be jumped to the project board for debugging purposes.
In order to load code onto the microcontroller it needs to be plugged into the project board. When it is
plugged into the project board the pins are accessed by pushing them into corresponding sockets on the
project board, which means that no wires can be connected directly to the microcontroller pins. Since
loading and debugging code is more easily done when the microcontroller is attached to the project
board, a pin out board was connected to the driver card board for an easy transition between debugging
and final implementations.
As a note of caution when debugging on the project board, the microcontroller ground needs to be tied
to the ground of the stepper motor power supply to avoid having two circuits with different grounds.
When the microcontroller is on the driver card board the grounds are already connected on the other
side of the board.
The pin out for the microcontroller has more pins than the microcontroller does. Eight of these extra
port pins are tied under the board to different pins of the microcontroller. Five of these pins are tied to
8
the microcontroller ports that monitor the touch sensor circuits. Two of these pins are tied to the
microcontroller ground and the other pin is tied to a pin on the microcontroller that sources 5VDC. The
5VDC pin and one of the ground pins provides power for the touch sensor circuits. The other ground is
connected to a switch that is mounted on the outside of the control box. This switch can reset the
microcontroller in case of problems.
2.3 Software Overview
2.3.1 Microcontroller Overview
The main purpose of the program on the HCS12 microcontroller is to transition between electronic
control and physical manifestation of this project. The code for the HCS12 microcontroller was
developed in C using Freescale's CodeWarrior IDE. The microcontroller receives commands from the
host computer via the serial port then translates these commands into a sequence of pulses that
instruct the driver cards on how to move the motors in the correct direction, at the correct speed, and
for a desired period of time.
The first step in controlling the hand is to have a reliable connection to the host pc using the serial port.
A reliable connection requires successful transmission of data between the host pc and the
microcontroller. A 'language' of defined bytes was created. Certain bytes being sent from the host pc
are interpreted as instructions for the microcontroller, and certain bytes being sent from the
microcontroller verify that a task has been completed successfully.
Once a reliable means of talking to the microcontroller was implemented, code could be developed for
the microcontroller to control the motors. The use of driver cards greatly simplified the control of the
motors by only requiring two output lines: STEP and DIR. The STEP line provides a square wave to drive
the motors; the DIR line holds high or low depending on which direction the motors should turn. A
routine was made to generate a pulse train (square wave) using the timer interrupt channel by enabling
interrupts in a toggle mode. Each time an interrupt is generated the output on the STEP line switches to
its opposite state; thus, a square wave with a width of two times the pulse is generated. The motor
holds its current position if no pulse train is sent.
Another type of interrupt was used as a trigger to signify a successful touch had occurred. Once a touch
sensor on a particular finger successfully registers a touch, the interrupt service routine causes the
motors to stop shortly after the touch was registered. The reason for the delay is to ensure a firm grip
on the object that is being picked up.
Integrating the motor commands along with the serial commands allows for the host pc to control the
movement of the hand in an easy to use environment. Two other routines were also made to change
the motor speed and to change the maximum number of steps to make controlling the hand that much
more adaptable in future applications.
2.3.2 High Level Code Overview
The computer software provides the interface between the user and the microcontroller. It provides the
user with the ability to close the fingers, open the fingers, and set control variables. The software is
9
written in Visual C++ using Microsoft Visual Studio. The main software deliverable is a C++ class
composed of a header file (Hand.h) and a source file (Hand.cpp). There are two provided applications
which make use of the Hand class: a Console Application and a Windows Forms Application. The
Windows Forms Application provides a graphical user interface. This application is much easier to test
the hand with because it not only provides all of the functionality, but it displays the current hand status
and the current status of the control variables.
The Hand class was slightly modified for the Windows Forms Application. In the Console Application,
error and update reporting is done by printing character strings to the command window. There is no
command window in the Windows Forms Application; therefore, a different method of error and update
reporting was needed. Everywhere the cout command is used in the Console Application, the code is
replaced with a Windows Message Box command. This does not affect any of the operations, only how
errors are reported.
The computer needs to communicate with the microcontroller and does so by using the serial port.
Accessing the serial port in a windows operating system is difficult. To overcome this obstacle a free
serial communication class was found on the internet courtesy of Ramon de Klein. There was a slight
modification to the code because the ISAC computers use Windows XP, not Windows 95, or NT. The
modification is commenting out the SERIAL_NO_CANCELIO macro. Commenting out this macro allows
for timeouts in the serial communication.
The Serial class is used in the background of the Hand class. A user creating an instance of the Hand class
does not have access to any of the Serial class functionality. The Serial class is included in both of the
applications and is also part of the deliverables.
3 Detailed Design
3.1 Hardware Detailed Design
3.2.1 Palm
A modular cavity design, as indicated in Figure 4, was employed. The top face of the palm has two bolt
holes to connect each finger to the palm and one hole on the left corner of the top face for the thumb.
Connecting the fingers to the palm with bolts allows for the fingers to be replaced. It is known that the
joints of the fingers are fatigable. Therefore, to increase the lifespan of the hand, a bolted connection
will allow for individual fingers to be replaced without needing to replace the entire hand. The broken
finger can be unbolted and the cord, touch sensor, and elastic shock cord removed. A spare finger can
be reconnected to these parts and bolted back into the original hole. The entire hand can thus be
functional again without needing complete reconstruction.
The palm will be connected to the arm mount through two bolts on the back wall of the palm, shown in
Figure 5. The back portion of the hand will contain the anchors necessary for connecting and adjusting
the elastic shock cords. The palm will be created out of rapid prototype because the precision needed
to fit many intricate surfaces into a small area cannot be reliably created by hand.
10
Figure 4 - . A view of the underside of the palm, showing where the fingers can be bolted in and where the palm will be
connected to the arm.
Figure 5 - A view of the hand from below, showing the finger connections to the palm as well as the touch sensors at each
fingertip.
3.2.2 Fingers
Finger Fabrication
The entire finger was fabricated as a single piece. Each pre-fabrication cylinder of polymorph had to be
120mm in length and 20mm ± 2mm in width. Joints were made into the polymorph at intervals of 3cm,
3cm, 3.5cm, and 2.5cm with this last joint most proximal to the hand. The joints were made
progressively more flexible from the distal to the proximal joints. Between the joints, 4 finger segments
with mounds in the center were molded and an attachment flap was shaped out of the excess
polymorph after the most proximal joint. The distal three segments were created to anthropomorphize
the finger. The fourth segment, while not a part of typical human anatomy, was created to simulate the
flexibility of the palm. Guides for flexion cables were drilled into the segments on the palm-side of the
finger. On the back of the distal segment, a cavity was produced and holes for a horizontal bar were
drilled. On the horizontal bar, the flexion and extension cables were connected. A video on the
fabrication process was filmed to show how this procedure is accomplished
(http://eecs.vanderbilt.edu/courses/eece295/2007%2D2008/CIS%5Fpolymorph%5Fhand/documentatio
n/documentation.htm).
11
Flexion
Flexion is produced by bipolar stepper motors, which are connected to the fingers using 25 lb test
fishing line. The cable is connected to the horizontal bar in the distal segment of the finger on the palmfacing side and then threaded through the drilled holes in the segments. This cable continues through
the palm and to the motors. Running the line through the base of the fingers allows for maximum
flexion with minimum amount of exposed line. External loops connected to the palm side of the fingers
were considered, but through experimentation with Polymorph, these loops were found to be a major
source of design failure. Figure 6 shows a diagram of the proposed finger flexion system.
Figure 6 - View of the palm-facing side of the simulated finger, showing the test line that is used for flexion.
Extension
Whereas flexion is an actively controlled process, extension is passively modulated. The motors will be
run in reverse for extension but will have no active effect on the fingers’ extension. Elastic shock cord is
used to establish tension on the back side of the finger, causing the straightening action. Elastic cords
allow for a variable amount of tension through an adjustable connection at the proximal end of the
finger. The shock cords are connected to the same horizontal bar in the distal segment cavity. This
connection provides for increased lifespan of the hand, allowing fingers to be replaced without creating
a new hand completely, as will be explained further in the section that details the palm.
Linear springs were also considered as an option for passive extension. However, the amount of
distance traversed during flexion was highly likely to deform any spring. Also, a linear spring did not
allow the amount of variability that altering the length of a bungee cord could afford.
3.2.3 Touch Sensors
An Interlink Force Sensing Resistor (FSR) was placed on each fingertip, a third of the finger segment
length from the top of the finger. The sensing area of the resistor is only 5 mm whereas the width of the
finger is approximately 20 mm. In order to accommodate for this, an artificial fingertip was created. This
was done by making a small ball of polymorph- approximately 15 mm in diameter- and flattening one
end of the sphere. By attaching this dome to the surface of the resistor, the sensing area was greatly
increased. Not only did this allow for a larger area to be covered, it also allowed for sensing of touches
not perpendicular to the sensor itself.
12
Each sensor is 2 inches long, but the cable housing unit was approximately 10 feet. Therefore, the
sensors were connected to a ribbon cable, which was then attached to the housing carrying the fishing
line from the motors. This entire unit led from the hand, up ISAC’s arm, down his body, and to the
housing holding the motors and electronics.
The full description of the technology behind the force sensors is included in Appendix B. As detailed
there, the resistance of the unit decreases as applied force increases. For purposes of this project,
however, it was necessary for the voltage generated by a touch to increase proportional to the applied
force. To account for this stipulation and to ensure the microcontroller was never sent more than 5V
from the sensors (the maximum allowable input), the sensors were used in conjunction with an inverting
operational amplifier circuit. Figure 7 provides a schematic of the op amp circuit used. The 200 kΩ value
for the resistor in the circuit was calculated based on the constraint of no more than 1 mA/cm2 of
current through the sensing area of the FSR.
Figure 7 - Schematic of touch sensor circuit.
In order to create the circuit, a wire wrapping technique was used in conjunction with TI UA741CP
operational amplifiers. Figure 8 shows a diagram including the wire connections for the feedback circuits
for each of the five touch sensors.
13
Figure 8 - Operational amplifier connections for sensing circuit.
For the sake of simplicity and versatility, the operational amplifiers and resistors were attached to 14pin IC sockets. The op amp utilized the top 8 pins (4 on each side), the next pair of pins was left blank,
and the last 2 sets of pins were used to house resistors. Two 100 kΩ resistors were placed in these pins
and connected in series by wire wrapping, resulting in a total resistance of 200 kΩ. This technique is
superior to the use of a 200 kΩ resistor because it allows the user to change the resistances at will,
allowing for an increase (by increasing resistance) or decrease in sensitivity. The minimum amount of
total resistance must be 10 kΩ to keep from passing too much current to the FSRs. There is no maximum
resistance limit. Figure 9 shows a diagram of the overall board containing all the touch sensor circuitry.
Figure 9 - Touch Sensor Circuit Diagram
14
3.2.4 Actuation
The limiting factor on the design of the hand was its weight. Soft armed robots like ISAC, while
biomimetic, are notoriously underpowered. The Center for Intelligent Systems at Vanderbilt had
purchased a gripper for the arm which weighed about one kilogram, and the arm was not strong enough
to effectively manipulate the gripper. This suggests that the both the hand and the object the hand is
grasping needs to weigh under one kilogram.
The power of the arm was the only weight limit on the project, and so it was decided that as much of
the hand function as possible should be mounted off of the arm. The motors and accompanying circuitry
were mounted onto ISAC’s main chassis, and connected to the hand using Bowden cables to actuate the
fingers and ribbon cable to attach the sensors to the rest of the circuitry.
The Bowden cable used to transmit the power from the motors was a high test monofilament fishing
line routed through bicycle brake cable housing. The monofilament line was determined to be more
desirable than a wound steel cable because it could be wrapped around a smaller diameter shaft,
because it transmitted power through the cable housing more smoothly, and because wound steel cable
had a tendency to fray inside the cable housing.
One end of the monofilament line was attached to the end of the finger, and the other end was
attached to a spindle built onto the stepper motor. The stepper motor pulls with a constant amount of
torque for a certain step speed, so in order to generate enough force to close the fingers, we needed to
make the diameter of the spindle as small as possible. To achieve this, we attached a cap to the end of
the motor’s shaft, and used the motors and the cap as the spindle.
Figure 10 - Motor Spindle
Figure 11 - Motor Enclosure
3.2.5 Stepper Motors and Driver Cards
The fingers are actuated by Jameco 12VDC, 400mA bipolar stepper motors. Each step of these motors
rotates the shaft by 1.8° which corresponds to 200 full steps per revolution. Stepper motors are moved
by sending specific pulse sequences to the motor coils. The sequence that is sent to the coils determines
the characteristic of the step. One such stepping mode is full stepping. In this case, the Jameco motor
would take 200 steps to complete one revolution. Another mode is half stepping which would require
400 steps to complete one revolution. There is also the ability to microstep by further dividing the
number of steps required to complete a revolution. When power is applied, but no step sequence is sent
15
a stepper motor will hold at its current position with some degree of holding torque. The holding torque
of the Jameco motors is 2100 g-cm.
An advantage of stepper motors is the ability to use them in an open-loop control system. As long as a
device, such as a microcontroller, is monitoring the number of step sequences generated then the
relative position compared to the starting point is known. One downfall of stepper motors is that the
amount of torque they produce decreases with an increase in speed. In this hand design this does limit
the speed with which the fingers can close, but it does not limit them enough to significantly degrade
performance.
Controlling a stepper motor involves sending a specific pulse sequence. The Jameco stepper motors in
this project are 4 wire bipolar motors. There are 5 motors, meaning that there are 20 wires that require
correct pulsing sequences. Using a microcontroller to keep track of and generate these sequences would
have been very difficult and utilize most of the output pins. To work around this situation EasyDriver v3
stepper motor driver cards were used. Each of these cards requires only two inputs: a pulse input and a
direction input. The driver card translates this into the correct pulsing sequence for the motor. Using the
EasyDriver cards reduced the number of pulse outputs to 5 and the total outputs to 10.
The EasyDriver cards also provided another benefit. The chip on the card is an Allegro A397
Microstepping Driver. It is set to 8 step microstepping which means that one revolution is equal to 1600
steps. This provides very precise positioning control that would have been very difficult to attain with
just a microcontroller alone. It also results in a very smooth rotation of the motor shaft.
The power for a motor is routed through the EasyDriver card from a 12VDC, 4A power supply that can
be plugged into a wall outlet. Each motor draws 400mA for a total of 2A. This power supply provides a
2A margin. The driver card uses this power to translate the TTL microcontroller current and voltage into
the correct stepper motor current and voltage. The connections for the EasyDriver cards are displayed
below. Unfortunately, Jameco sent 2 motors with one wiring combination and 3 motors with another.
The correct wire order by color is shown for both types of motors.
16
EasyDriver Card Connections
Motor Wires By Color
Brown
Red
Orange
Blue
Red
Green
To 12V 4A
AC to DC
power supply
Yellow
Black
Motor Wires
Gnd V+
EasyDriver v3
Step
Dir
To Microcontroller
Figure 12 - EasyDriver card wiring connections.
3.2.6 Driver Cards and Microcontroller Board
The Driver Card / Microcontroller Board houses five driver cards, two 16 pin IC sockets, and the
microcontroller (including pin out). The power and control lines of the driver cards are connected to
lines on the 16 pin IC sockets. The IC sockets allow for wires to be jumped from the board to the project
board. The code on the microcontroller can only be debugged when it is plugged into the project board
and connected to a computer with a USB cable. These IC sockets make it easy to keep the driver cards
mounted and still run the hand from the project board. The wires used for control (i.e. STEP and DIR) are
30 gauge wire-wrapping wire because of the low voltage and currents passing through them, but the
GND and V+ wires require a smaller gauge due to the much larger voltages and currents that they carry.
In fact, the pins for Gnd and V+ on the back of the wire-wrapping boards were soldered together for this
very reason. The Gnd from the motor power is connected to the microcontroller Gnd so that the entire
circuit shares a common Gnd, a common reference point. When connecting to the microcontroller via
the project board, a Gnd line must be run between the two circuits to ensure proper functionality.
When the microcontroller is plugged into the pin out on the Driver Card / Microcontroller Board, several
pins are free to connect to the touch sensor circuit. The first seven pins (five touch sensors, V+ (5V), and
Gnd) are wire wrapped directly from the pin out of the microcontroller so that they can be directly
connected. The touch sensor circuit can easily be moved from this pin out to the project board for
debugging purposes. The current draw of the touch sensor circuit is minimal and is well below the
sourcing limit of the microcontroller. The eighth pin is a Gnd line for a RESET button to be mounted on
the external enclosure. The RESET pin on the microcontroller causes a global reset when it goes low.
17
Another wire coming from the RESET pin on the microcontroller leads to a switch, which when
depressed causes the pin to go low and the microcontroller to reset. This was installed so that the
microcontroller could be easily reset without having to open the enclosures.
The microcontroller pin connections are displayed below. Drawings for the Driver Card / Microcontroller
Board are also included.
Microcontroller Connections
Touch Sensor Circuits
Reset Switch
Touch Sensor Thumb
Touch Sensor Index
Motor Step Thumb
Motor Step Index
Touch Sensor Middle
Touch Sensor Ring
Touch Sensor Pinky
Motor Direction Pinky
Motor Direction Ring
Motor Step Middle
Motor Direction Middle
Motor Step Ring
Motor Direction Index
Motor Step Pinky
Motor Direction Thumb
Figure 13 - Microcontroller Pin Connections.
18
Driver Card Connection Board
To Motor A
To Motor B
Motor Wires
Motor Wires
Gnd V+
EasyDriver v3
Card A
Gnd V+
EasyDriver v3
Card B
Step Dir
Driver Card B V+
Driver Card B Gnd
Driver Card C V+
Driver Card C Gnd
Driver Card D V+
Driver Card D Gnd
Driver Card E V+
Driver Card E Gnd
EasyDriver v3
Card C
Driver Card A Gnd
To Motor C
To Gnd on 12 V 4 A AC
to DC Power Supply
+
Driver Card A V
Motor Wires
To V+ on 12 V 4 A AC
to DC Power Supply
Step Dir
Driver Card B Step
Driver Card B Dir
Driver Card C Step
Driver Card C Dir
** Driver Card A Step
** Driver Card A Dir
** Driver Card B Step
** Driver Card B Dir
** Driver Card C Step
** Driver Card C Dir
** Driver Card D Step
** Driver Card D Dir
** Driver Card E Dir
** Driver Card E Step
Driver Card D Step
Driver Card D Dir
Driver Card E Step
Gnd V+
Driver Card A Dir
Step Dir
Driver Card A Step
To Motor D
To Motor E
Motor Wires
Motor Wires
Gnd V+
EasyDriver v3
Card D
Gnd V+
EasyDriver v3
Card E
Step Dir
Reset Switch Gnd
Driver Card E Dir
Step Dir
Control Lines for Touch Sensor Circuit
Microcontroller
** Debug Pins are used for connecting motors when the microcontroller is being programmed and tested on the project board.
Figure 14 - Driver Card / Microcontroller Board.
19
Driver Card Connection Board:
Detailed View of Outputs to Touch Sensor Board
Reset Switch Gnd
Touch Sensor Board Gnd
Touch Sensor Board V+ (5 V)
Touch Sensor Finger 4
Touch Sensor Finger 3
Touch Sensor Finger 2
Touch Sensor Finger 1
Touch Sensor Finger 0
Microcontroller
Figure 15 - Detailed View of Outputs to Touch Sensor Board.
3.2 Software Detailed Design
3.2.1 Microcontroller Detailed Design
Before the host computer can connect to the microcontroller, certain registers must be initialized for
proper motor control, touch sensor response, and most importantly serial communication. The details
of these register initializations will be described along with the appropriate function definitions in the
sections below. Following the register initializations, serial communication is established between the
host pc and the microcontroller; if the communication is successful, the microcontroller enters a loop
waiting for the next command from the host pc.
At this point the microcontroller is ready for any command ranging from closing the hand, closing a
specific finger, altering the speed or maximum number of steps for a particular motor, or even
reestablishing communication with the host pc if need be. This loop is the core of the main function for
the microcontroller; once a command successfully completes, it waits for the next command from the
host. This process repeats until communication is lost or power is removed from the microcontroller.
20
Serial Communication
Serial communication is key to remote operation of the hand. Several steps must be taken before the
microcontroller is ready to communicate with the host PC. SCIInit() must be called to initialize the
registers responsible for activating communication. SCI0BDH and SCI0BDL are used to set the baud rate,
which is fixed to 9600 for this implementation. SCI0CR1 and SCI0CR2 are used to establish more of the
base settings such as: the data format (eight data bits with one start bit and one stop bit), parity
(disabled), interrupts (disabled), sending data (enabled), and receiving data (enabled).
The first function called in the main routine that does not deal with initializing registers is
ReadFromSCI0(char *). If a byte has been sent from the host pc, a data flag register will toggle its value,
indicating that data is ready to be grabbed. That data is then returned for interpretation. Specifically,
the first time the microcontroller is turned on, it is waiting for a HELLO command (predefined HEX code)
from the microcontroller; this specific byte indicates that the host pc and microcontroller are speaking
the same language. Once HELLO is verified, the microcontroller will send a HERE command to inform
the computer that everything is good to go. HERE is sent using WriteByteSCI0(char *), which reads the
byte in question directly into the data register. The function will return once the data transmission
register indicates there is no more data to be sent.
The functions used for serial communication are constantly used to interpret specific byte commands as
provided by the host pc within the main loop of the program. The code was designed so that only one
byte needs to be sent to control any aspect of the hand. A byte will be read in, followed by a call to
MotorCommand(char *), which decodes the byte into a coherent motor command or function call.
Motor Control
Motors will only be activated after a byte has been received and subsequently decoded by a switch
statement contained within MotorCommand(char *). MotorCommand(char *) contains a large switch
statement based upon predefined HEX codes that vary in functionality from resetting the
microcontroller, to redefining a motor’s speed or maximum number of steps, to controlling the motors.
For example, if the most recent byte read correlated to the HEX code CLS0, the thumb would be
instructed to close. Before any motor begins to move a few functions must be called to ensure that the
correct motors will run as defined. MotorDirection(int,int,int,int) is always called so that the fingers will
close in close commands and open in open commands. Each argument refers to a motor, and zeros are
used to indicate closing; ones indicate opening. By default a finger is set to close. Several other calls are
made to initialize PortP for handling responses from the touch sensors; this topic will be addressed in a
section below. MOTOR0_ON(), a macro defined at the top of main.c, is then called. Timer interrupt
channel zero is used to control the square wave being sent to the thumb’s driver card.
In order to use the timer channels, timer channel registers were initialized prior to establishing serial
communication with the host pc. TSCR1 is set to enable the timer’s normal functionality and to enable a
fast flag clear bit, allowing for input captures to be written to an output compare channel. TSCR2 is
prescaled to four; timer channels zero through four are set to output compare using the TIOS register.
Finally, TCTL1 and TCTL2 are initialized for toggling the logic level on the output compare pin. The
21
reasons for these initializations will be best understood through further explanation of how
MOTOR0_ON() and MOTOR0_OFF() work together.
Inside of MOTOR0_ON(), TC0 (timer channel zero) is set equal to the sum TCNT, the microcontroller’s
master timer) and a pulse value, which sets TC0 equal to a future time. When TCNT equals the TC0
value timer channel zero’s interrupt fires. Output compare and toggle were enabled so the output line
toggles from low to high or high to low depending on its current state. Inside of timer zero’s interrupt
service routine the value of TC0 is incremented by the pulse value again so another interrupt will hit
after the same length of time. When TC0 equals TCNT again, the output value will toggle. After this
second interrupt, it should be apparent that a square wave of period (pulse value)*2 has been
generated. In addition to updating the value of TC0, timer channel zero’s interrupt service routine also
increments MOTOR0_STEPS if the motor is closing (decrements if the motor is opening).
MOTOR0_STEPS is used to check for an exit condition.
After MOTOR0_ON() is called, the CLS0 routine enters a loop that waits for an exit condition. One way
to trigger this exit condition is if MOTOR0_STEPS exceeds MOTOR0_MAX_STEPS, which is set as a
physical bound for the finger. Usually it is set to a point where the finger would be touching the palm
when closed. A similar trigger exists for an open command; if MOTOR0_STEPS is decremented below
zero, the finger is all the way open and the loop will break. A touch sensor activation on PortP can also
trigger the loop exit condition. The touch sensor activation is explained later. When one of these
exceptions occurs, MOTOR0_OFF() is called.
MOTOR0_OFF() does the exact opposite of its counterpart; it disables the timer channels ability to
generate an interrupt and turns off toggle mode. It also sets MOTOR0_RUN_FLAG to zero. The status of
MOTOR0_RUN_FLAG is the loop exit condition mentioned above. All of the triggers result in
MOTOR0_RUN_FLAG being set to zero. CLS0 will then exit the loop, and reset MOTOR0_STEPS if
necessary. This ends the CLS0 routine.
Open routines function much the same way, but touch sensors cannot trigger an exit condition. The
main difference between the open and close commands is the direction. MotorDirection(int,int,int,int)
is called at the beginning of any motor routine, where each argument refers can either be a zero (close)
or a one (open) for each motor. The direction output from the microcontroller comes from PortB, which
also needs to be initialized before the motors can be given commands. DDRB is used to set PortB bits
one through five for output. For an open command the corresponding PortB bit is set to high. Although
PortB bits can be accessed individually, global variables are used to keep track of a motor’s direction so
that it cannot be changed inadvertently.
If more than one finger is being closed or opened using the specific grasp commands, the motors can
stop independently, but the routine will not return until all MOTOR_RUN_FLAGs have been set to zero
(i.e. all motors in that command have come to rest).
Touch Sensor Control (PortP)
PortP was briefly mentioned above when discussing exit conditions for running a motor, specifically
relating responses from a touch sensor. PortP is used to watch the response from a touch sensor; if the
22
touch sensor signals a touch, a PortP interrupt is generated. Again, in order to activate these interrupts
a few PortP registers must be initialized. PERP is set to enable pull up and pull down logic; PPSP
specifies pull up on a falling edge (when a touch is detected); and PIEP is set to enable interrupts. All of
these were set for PortP bits zero through four.
PortP interrupts are only activated during close commands, because accidental bumps during an open
routine would cause the hand to remain partially closed. This is ensured by enabling the interrupts at
the beginning of each close command and disabling the interrupts at the beginning of each open
command. The interrupts are only enabled on 5 PortP pins (5 touch sensors) to avoid generating an
interrupt misfire from an unconnected pin.
Any logic change on a PortP interrupt enabled pin will generate a general PortP interrupt. Inside of the
interrupt service routine, the PortP interrupt flag register must be checked to determine which pin
generated the interrupt. When an interrupt from a pin is triggered for the first time during a close
command, that corresponding interrupt flag is acknowledged (cleared by writing a logic one) and a new
MOTOR_MAX_STEPS value is set. The old value is stored in MOTOR_MAX_STEPS_TEMP, while its new
value is the current location plus two thousand steps. This will cause the motor to close for an
additional two thousand steps to ensure a good strong grasp. During the close routine this pin can still
generate interrupts, but it should only change MOTOR_MAX_STEPS once. MOTOR_TOUCH_FLAG is used
for this purpose. To ensure that MOTOR_MAX_STEPS is not lost, it is reset to
MOTOR_MAX_STEPS_TEMP at the beginning of each close command. MOTOR_TOUCH_FLAG is also set
at this time to ensure that MOTOR_MAX_STEPS cannot be overwritten more than once. PortP tied
together with the touch sensors allows for a firm grip.
Motor Parameters
In addition to grasping motions and other basic motor commands, several end user functions were
created to expand the functionality of the code. Both of these functions are related to realistic limits of
the motors. They are routed from the main MotorCommand(char *) function; the serial communication
works a bit different for these functions, because they need user input. Once the function is entered a
DONE (HEX code) is sent to the host computer to indicate that it’s okay to send the new value (speed
percentage or step change).
MotorSpeed(char *,int) will alter the motor speed by 25%, 50%, 75%, 125%, 150%, 175%, 200%, or
reset. The process can be repeated to a max speed of 225% of the original value and a minimum of 10%
of the original speed. A specific HEX code (e.g. SPEED_150 for 150% increase) is sent in to update the
speed. Since the pulse is for a particular motor is half the period of the wave controlling the motors, the
pulse must be decreased to increase the speed of the motor and vice versa to decrease the speed. Also
since the pulse has to be an integer, the current pulse has to multiplied and divided by other integers to
produce the correct result. For example to increase the current speed by 150%, pulse would have to be
multiplied by ¾. The pulse can be reset to its original value by sending the HEX code SPEED_100.
Another parameter the user can alter from the host pc is the max steps for a particular motor.
MOTOR_MAX_STEPS has hard limits of 400 and 30,000, because fewer than 400 steps barely moves the
23
motor at all and 30,000 will bend the finger beyond recognition. MotorStep(char *,int) reads in a byte
that is translated directly into a signed integer, which allows for an immediate alteration of steps by +
127 and a reset if zero is passed in. When MOTOR_MAX_STEPS is set MOTOR_MAX_STEPS_TEMP is also
set so that no problems arise when dealing with interrupts from PortP and the touch sensors.
3.2.2 High Level Code Detailed Design
Computer Software Definitions
Number of Fingers:
Finger 0: thumb
Finger 1: index
Finger 2: middle
Finger 3: ring and pinky
***The ring and pinky finger move together similar to how they move on an actual hand. Specifying
finger 3 for any function means that the user is dealing with both the ring and pinky.
Valid Close Commands:
CLOSE0:
thumb
CLOSE1:
index
CLOSE2:
middle
CLOSE3:
ring & pinky
CLOSEALL:
closes all fingers
CLOSEGRASP: closes thumb, index, middle (three finger grasp)
CLOSEPINCH: closes thumb, index (two finger pinch)
Valid Open Commands:
OPEN0:
thumb
OPEN1:
index
OPEN2:
middle
OPEN3:
ring & pinky
OPENALL:
opens all fingers
OPENGRASP: opens thumb, index, middle (opens the three finger grasp)
OPENPINCH: opens thumb, index (opens the two finger pinch)
Valid Speed Factors:
0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0
***1.0 resets to original speed
***Maximum limits are 10% of original speed to 225% of original speed
Valid Step Changes:
-127 to 127 at a time
*** 0 resets to original steps
Serial Communication Definitions (The communication ‘language’):
See Hand.h for the list of definitions.
Available Functions:
24
void Close_Fingers(Close cmd)
void Open_Fingers(Open cmd)
void Change_Speed(int finger, double speed_factor)
void Change_MaxSteps(int finger, int steps)
double get_MotorSpeed(int finger)
int
get_MaxSteps(int finger)
bool get_FingerStatus(int finger)
Function Documentation:
See the Hand.cpp file for commented functions. Below is an overview of the software which also
includes details about the functions.
Computer Side Software Detailed Description
The most important functionality that the C++ code provides is the ability to communicate with the
microcontroller. This is accomplished by using serial communication. The class is designed so that the
serial communication happens in the background. The user of a class does not have access to functions
dealing with serial communication.
Using the serial port on a computer running a Windows Operating System is not a simple task. To
accomplish this, the Hand class has a private variable which is an instance of the Serial class called
‘serial’. The serial class provides access to the serial port and takes care of most of the details associated
with serial communication. In the Hand class’s constructor, the parameters for the serial communication
are set. The serial object opens the serial communication on COM1 and signifies that an overlapped
structure will be used. Enabling an overlapped structure is necessary for serial port timeouts . The other
parameters are a baud rate of 9600, 8 bits of data, no parity, and 1 stop bit.
There are two functions that use the ‘serial’ object. These functions are private functions of the class
and provide background functionality. They perform the ‘dirty’ work of communicating with the
microcontroller. The first function is the Send_Command(char * hex_cmd). This function sends two
bytes over the serial line to the microcontroller. The first byte is a data byte and the second is a NULL
termination. The microcontroller looks for the NULL termination to know that the end of the data has
been sent. The data byte that the Send_Command function sends is either a specially defined byte or
one representing the numerical value of the step change. This data byte will be described later. The
Send_Command also specifies that there is no hardware handshaking. Hardware handshaking is where
the sending device transmits a “ready” signal, waits for an acknowledgement from the receiving device,
and then sends the data. The ‘serial’ object then writes the two byte character array to the serial port
and sends it to the microcontroller. The Send_Command returns an integer. This is copied over from a
test file in the provided Serial class. The test file had an error function that receives an integer. Instead
of making numerous changes to the code, the error function and setup for the Send_Command were
ported over.
The second function that uses the ‘serial’ object is the Receive_Command(DWORD timeout). This
function listens for a serial port event and then stores any data that is sent over the line. It is set to only
listen for a single byte at a time. The timeout is a value used to determine how long the application
25
should wait for a serial event before realizing that no serial event will occur. This is necessary, for
example, if the microcontroller is not connected to the computer. By default there is no timeout and the
application would wait indefinitely for a serial event and basically freeze up. There are different types of
communication; therefore, there is the ability to pass in different timeout lengths. The initial
communication timeout is set at 5 seconds because this is a quick communication. Timeouts for the
opening, closing, and variable setting events are 30 seconds. These values are set in the constructor.
Both the Send_Command and Receive_Command functions deal with exchanging data bytes with the
microcontroller. This data byte can either be a defined constant or represent the value of a step change.
There are defined constants that represent different bytes. For example, when sending the
microcontroller HELLO the Hand class is actually sending a hexadecimal 0x40 (or an ASCII ‘@’). The
microcontroller has the same constant definitions. After receiving a HELLO, it returns a HERE (0x41,
ASCII ‘A’). These defined constants are the ‘language’ that the microcontroller and Hand class use to
communicate. The other type of data byte will be described later in the Change_MaxSteps discussion.
Available Functions
There are seven public functions of the Hand class that are able to be called from an instance of the
Hand class. Three of them just provide access to the Hand classes private variables. These variables track
the status of the hand and should mirror the motor speed variables and maximum step variables
present on the microcontroller. As long as the global constants of the Hand class match the global
constants on the microcontroller then these tracking variables will be accurate. One set of variables
tracks the finger status as either being open or closed. Another set of variables tracks the motor speed
as a percentage of the original speed. The third set of variables tracks the maximum number of steps
that the stepper motors will run. The other four functions use the Send_Command and
Receive_Command functions to request the microcontroller to perform a task. These functions are:
Close_Fingers, Open_Fingers, Change_Speed, and Change_MaxSteps.
The Close_Fingers(Close cmd) and Open_Fingers (Open cmd) functions are very similar. Both have an
enumerated input parameter which makes passing values to the function clearer. For example, the valid
Close values are CLOSE0, CLOSE1, CLOSE2, CLOSE3, CLOSEALL, CLOSEB, and CLOSEC. The function first
verifies that there has been a successful connection to the microcontroller. If not, then it attempts to
connect before proceeding. If it still fails, then no action will be taken. Based on the cmd parameter, the
function uses the Send_Command function to send the correct data byte to the microcontroller. It then
listens for the microcontroller to respond with a done command. The Open_Fingers command has the
exact same structure, it just accepts Open commands: OPEN0, OPEN1, OPEN2, OPEN3, OPENALL,
OPENGRASP, and OPENPINCH. Flowchart s of the Close_Fingers and Open_Fingers functions are below.
26
Close_Fingers(Close cmd)
Close_Fingers
called
Is the microcontroller
connected?
YES
YES
Is it a valid parameter?
NO
Send Correct Data
Byte
NO
Attempt to connect
to microcontroller
Wait for response
Successful?
YES
NO
Was a ‘DONE’ returned?
NO
YES
Update finger
status variables
Exit Function
Figure 16 - Close_Fingers Flowchart.
27
Open_Fingers(Open cmd)
Open_Fingers
called
Is the microcontroller
connected?
YES
YES
Is it a valid parameter?
NO
Send Correct Data
Byte
NO
Attempt to connect
to microcontroller
Wait for response
Successful?
YES
NO
Was a ‘DONE’ returned?
NO
YES
Update finger
status variables
Exit Function
Figure 17 - Open_Fingers Flowchart.
Another public function is Change_Speed(int finger, double speed_factor). To use this function, a finger
value and a speed need to be sent to the function. The function first verifies that there has been a
successful connection to the microcontroller. If not, then it attempts to connect before proceeding. If it
still fails, then no action will be taken. To determine the new motor speed, the speed_factor variable is
multiplied by the current motor speed. For example, if the current motor speed is 100% and the
speed_factor is 0.50 then the microcontroller will set the motor speed to 50%. If the function is called
again with the same speed_factor, then the microcontroller will set the motor speed to (0.5)*(0.5) =
25% of the original speed. The Change_Speed function determines if this new change is outside of the
speed range. The range is from 10% to 225% of the original speed. A speed change that will result in a
speed of 226% is illegal. These values of speed were empirically chosen and are also hardcoded onto the
microcontroller. A higher speed leads to faster finger closing, but less torque is provided by the motor.
At speeds of higher than around 225% the motors start to slip.
Two data bytes are sent to the microcontroller when the Change_Speed function is called. The first byte
lets the microcontroller know two things: that a speed change is requested and what finger it applies to.
The second byte corresponds to the speed factor. The second byte is sent from the private function,
Set_Speed. Set_Speed uses a switch expression and these can only be applied to integer types. That is
28
why the speed_factor is converted from a double to an integer. This private function was used to
shorten the code by eliminating multiple nested switch expressions in the Change_Speed function. A
flowchart for Change_Speed is shown below.
Change_Speed(int finger, double speed_factor)
Change_Speed
called
Is the microcontroller
connected?
YES
YES
Are they valid parameters?
NO
NO
Send First Data
Byte
Wait for response
Attempt to connect
to microcontroller
NO
Successful?
Was a ‘DONE’ returned?
YES
YES
Send Second Byte
from Set_Speed
fucntion
NO
Wait for response
NO
Was a ‘DONE’ returned?
YES
Update motor
speed variables
Exit Function
Figure 18 - Change_Speed flowchart.
The last public function is Change_MaxSteps(int finger, int steps). To use this function, a finger value and
a step value need to be sent to the function. The function first verifies that there has been a successful
connection to the microcontroller. If not, then it attempts to connect before proceeding. If it still fails,
then no action will be taken. The steps parameter must be between -127 and +127. Passing in a value of
0 will reset the maximum number of steps to the original value. Some reasons for changing the
maximum number of steps include: a new finger is placed on the hand, finger behavior has changed due
to mechanical wear, or a different closing behavior is desired.
29
The function checks to make sure that the change in steps does not violate an overall step range. This is
more of just a safety check so that a user cannot set out of bounds limits such as negative values or
extremely large values. The hard limits are 400 to 30000 and the initial step value is 17000. 17000
seemed to be a ‘good’ starting value based on testing. The function also checks to make sure that the
finger is open and not closed. Changing the steps while the finger is closed creates problems with finger
location. The finger will not return to rest position. To change the maximum steps, two data bytes need
to be sent. The first byte lets the microcontroller know two things: that a step change is requested and
what finger it applies to. The second byte tells the microcontroller how many steps. The second byte is
not a defined constant. It can be any 8 bit value except 0 because that corresponds to a NULL character.
That leaves 255 possible options, hence the -127 to +127 range. An integer is at least two bytes, but can
be longer depending on the compiler. The communication protocol with the microcontroller sends one
byte at a time. Therefore, the integer is typecast as a character which is one byte. There are issues with
typecasting which require some creative mapping of values. When integer values between 1 and 127 are
typecast as a character and then typecast back as an integer they maintain their original value. When
integers between 128 and 256 are typecast they take on a value of: initial value – 256. Typecasting 255
returns -1. Typecasting 129 returns -127. To send a negative value, the function simply adds 256 to the
input parameter and typecasts it (-127 + 256 = 129 -127). A 128 typecast returns -128 which is outside
of the defined range. Instead of throwing this value away, the microcontroller interprets this as the
‘reset’ value. This means that when the ‘steps’ parameter is 0, the function sends a typecasted 128 to
the microcontroller. The flowchart for the Change_MaxSteps function is shown below.
4 Evaluation Procedure & Results
In its current form, the hand is not only mechanically capable of grasping within the full range of motion,
but also the isometric actuation after a grasp is made ensures that the hand has a firm grasp on the
object. The hand is sufficiently below the weight limit imposed upon it, and has proven to be durable in
every test thus far. The weight of the hand without the cable housing was 200 grams. The cable housing
weighs a bit more, but since its weight is distributed throughout the arm’s length and not all located
entirely at the wrist, the arm needs less torque to lift the cable housing.
4.1 Testing
4.1.1 Durability Testing
The hand is modular by design so that if one structural component, like a finger, does break it can be
replaced without changing the rest of the hand. Spare fingers have been fabricated and included with
the project in case any do break, and there is documentation on how to create a new set of fingers,
including an eight minute video on the subject. If the palm is accidentally destroyed, the original
ProEngineer model and the *.stl files of the palm have been submitted with the project so that a
replacement palm can be easily printed on a rapid prototype machine.
The durability of the finger joints was tested through a regular cycling of flexion and overextension. Five
different fingers were brought through 500 cycles. One cycle was constituted by a manual flexion
followed by an overextension. While during the course of operation the finger will not be
30
overextended, this was done during testing to place further stress on the joints, thus increasing the
robustness of testing. For each of the five fingers, no significant fatigue was observed. Therefore, it was
concluded that the finger design was durable enough for normal operation.
The durability of the flexion cable guides was tested through cycling of finger flexion and extension in
normal operation. Two of the fingers were run through 100 cycles. After the 100 cycles, the fingers
were detached from the palm and manually observed. No significant wearing away at the guide/flexion
cable connection was observed.
The durability of the finger/palm interface and overall structure of the hand was tested through impact
testing. The fingers and palm were connected and then dropped from 40 feet onto a stone tile floor.
Through basic calculations, it was determined that the hand was traveling at around 35 mph at impact.
After each drop, the integrity of the finger, palm, and interface were manually assessed. Six cycles of
this test were conducted on the hand. At each assessment, no significant breach to the integrity of the
palm, fingers, or their interface was observed. While this methodology provided more of a qualitative
assessment of the hands durability, it was able to withstand conditions far exceeding those it will be
experiencing in normal operation.
4.1.2 Functionality Testing
The functionality of independent control of fingers was tested by running the hand through a number of
different flexion and grasping tasks. First, independent control of each finger was tested by
commanding the hand to close single fingers in a random order. For example, the hand was
commanded to close and open in sequence the index, ring/pinky, thumb, and middle finger. This hand
was successfully able to complete this task for 5 different sequences. Next, the hand was commanded
to complete all three of its grasping functions (thumb-index, thumb-index-middle, and full hand) in a
random sequence. The hand was able to complete 5 random trials of this successfully.
The functionality of the hand's grasping ability was assessed for each of the grasping functions by three
different testing procedures involving variations in potential objects weight, shape, and texture.
To test its weight-bearing capabilities, a water bottle with varying levels of water was used. The grasp
was deemed to be successful if it was able to hold the bottle for 10 seconds without slipping. For the
two finger pinch, the hand was able to hold a water bottle weighing 175 g. For the three finger grasp,
the hand was able to hold a water bottle weighing 250 g. For the all finger grasp, the hand was able to
hold a water bottle weighing 350 g. The full hand also grasped a hammer weighing 500 g.
To test its ability to grip different shapes, the hand was commanded to grip a particular object with the
full hand grasp. Again, the grasp was deemed a success if it was able to hold the object for 10 seconds
without slipping. Of the objects tested, the hand was able to grip a small stuffed animal, a foam cup, a
baseball, and a computer mouse. The hand was unable to hold a pencil, sheet of paper, or a credit card;
however, all of these objects were able to be grasped but the object slipped before the 10 seconds.
To test its ability to grip different textures, the hand was commanded to grip a glue stick with different
covers with the full hand grasp. The textures tested were plush, hard and sleek, and hard and rough.
31
Once again, the grasp was deemed a success if it was able to hold the object for 10 seconds without
slipping. The hand was able to grip the plush object (foam around glue stick) and a hard and rough
object (sandpaper around glue stick) but was unable to grip a large and sleek object (glue stick).
4.1.3 Touch sensor Testing
The touch sensors were tested both on and off of the fingers. Off of the fingers, all of the touch sensors
were tested to see how much force was necessary to process a 3V increase in output. For all of the
touch sensors, a force of 0.1N ± 0.03N was able to create a 3V increase in the output.
5 Conclusion
There were a number of initial conditions applied to this project when we first undertook it. They were
systematically met throughout the course of our work:
1. The hand must be an anthropomorphic right hand. By placing the thumb in the correct position
in relation to the palm, we ensured this was indeed a right hand. By fashioning the fingers of
polymorph and modeling human joints, we made our model as anthropometric as the
constraints would allow.
2. The total mass of the hand cannot exceed 1 kg. The hand itself weighs 200g, well under the mass
limit. By moving the motors and electronics off the hand itself and onto the body of ISAC, we
preempt any problems with weight that could occur with a heavier model.
3. The hand must be durable. Through repeated testing, we have shown that the materials
themselves- Polymorph and rapid prototype- are durable by themselves and when fashioned in
the final hand format.
4. The hand should possess independent finger control and should also be able to perform three
distinct grasping functions. These were added to the high-level code as functions so the user has
full control over the hand’s motions.
5. There should be feedback from the fingers to the control unit. The use of touch sensors meets
this requirement. The system has been programmed so a finger closes for a specified number of
steps after a touch has been made, to ensure a firm grasp.
This project was also completed well under budget- when we first began, we were quoted a figure of
$750. As Appendix C shows, we spent slightly less than $500.
Based on the fact that we met all our design criteria and have created a hand with full functionality, we
believe our project has been a success.
6 Recommendations for Future Work
A significant amount of progress has been made on the ISAC hand this year. However, there are a
number of ways in which this project can be modified and improved upon in the future.
32
6.1 Hardware Improvements
The first of these possible improvements is on the fingers. While the Polymorph molding process has
yielded success for the time, the fact that the fingers must be formed by hand detracts from the
reproducibility and uniformity of the final product. In the future, it would be optimal to find a way of
creating the fingers in a more accurate and standardized manner.
The palm can also be improved to increase the friction of the surface. This is indeed an issue that can be
addressed with the whole hand- both Polymorph and rapid prototype are slick, a problem that could
lead to problems with grasping smooth objects later. Current applications of grasping plush objects,
however, are not affected by this shortcoming.
While the touch sensors are doing an adequate job of discerning a touch, this is another area that can be
improved upon in the future. Increasing the sensing area will only make grasping more accurate, as will
adding touch sensors to other locations- such as the back of the hand. Finally, a superior way of
attaching the sensors will also need to be experimented with. Currently, the sensors are attached to a
rubber fingertip which is then placed over the actual finger. While this accomplishes our most important
goal- allowing for easy interchanging of parts- the rubber fingertip can sometimes slide or move about.
Recently, there has been talk to make ISAC a mobile robot. If this were to ever happen, the hand could
not operate unless ISAC drug along a really long extension cord. Instead of investing in a 100 foot
extension cord, a battery pack could be made to power both the motors and the microcontroller so that
ISAC could still operate his hand on the move.
6.2 Software Improvements
The simplest way to add functionality to ISAC’s new hand is to add more and different grasping options,
but this would not benefit the project all that much. Currently, there is functionality to change the
speed of a motor and the maximum number of steps. The number of steps that the motor takes after a
touch is detected is hard coded to 2,000 steps, being able to change this number during operation
would allow for weaker and stronger grasping motions.
Serial interrupts could also be explored so that more than one motor command could be issued at a
time (I.e. Issue a closing command for the index finger. When it begins to close, issue another close
command for the thumb). Allowing for interrupts from the serial port would greatly expand the
functionality of the code, because during a closing or opening motion, the motors or their max steps or
maybe even the response to a touch could be altered so that the finger closes faster or slower
depending on the part of the motion it is in.
33
Appendix A – Figure Listing and Visio Drawing Compilation
Figure 1 - System Overview .......................................................................................................................... 6
Figure 2 - Image of hand attached to ISAC's arm.......................................................................................... 7
Figure 3 - Close-up of hand ........................................................................................................................... 7
Figure 4 - . A view of the underside of the palm, showing where the fingers can be bolted in and where
the palm will be connected to the arm....................................................................................................... 11
Figure 5 - A view of the hand from below, showing the finger connections to the palm as well as the
touch sensors at each fingertip................................................................................................................... 11
Figure 6 - View of the palm-facing side of the simulated finger, showing the test line that is used for
flexion. ........................................................................................................................................................ 12
Figure 7 - Schematic of touch sensor circuit. .............................................................................................. 13
Figure 8 - Operational amplifier connections for sensing circuit................................................................ 14
Figure 9 - Touch Sensor Circuit Diagram ..................................................................................................... 14
Figure 10 - Motor Spindle ........................................................................................................................... 15
Figure 11 - Motor Enclosure ....................................................................................................................... 15
Figure 12 - EasyDriver card wiring connections. ......................................................................................... 17
Figure 13 - Microcontroller Pin Connections. ............................................................................................. 18
Figure 14 - Driver Card / Microcontroller Board. ........................................................................................ 19
Figure 15 - Detailed View of Outputs to Touch Sensor Board. ................................................................... 20
Figure 16 - Close_Fingers Flowchart. .......................................................................................................... 27
Figure 17 - Open_Fingers Flowchart. .......................................................................................................... 28
Figure 18 - Change_Speed flowchart. ......................................................................................................... 29
Figure 19: Hand Control GUI ...................................................................................................................... 53
34
Overall Architecture
Touch
Sensors
Polymorph Fingers
Rapid Prototype Palm
Touch
Sensor Wires
Cable Housing
Bi-Polar
Stepper
Motors w/
Spindles
Motor Power
12 VDC, 4 A
Wall Plug-in
Power
Supply
C++ Class
EasyDriver
Cards
Serial
Connection
Touch
Sensor
Circuit
Microcontroller
Control Box
(not on hand)
Reset Switch
35
5 VDC
Microcontroller
Power Supply
Touch Sensor Circuit
+5 VDC from Microcontroller
Touch Sensor
Vout to Microcontroller
+
Microcontroller Ground
R = 200kΩ
Microcontroller Ground
73C54 Op Amp Connections
+5 VDC from Microcontroller
1
5
2
6
3
7
4
8
Touch Sensor
Resistor
Microcontroller Ground
36
Vout to Microcontroller
37
EasyDriver Card Connections
Motor Wires By Color
Brown
Red
Orange
Blue
Red
Green
To 12V 4A
AC to DC
power supply
Yellow
Black
Motor Wires
Gnd V+
EasyDriver v3
Step
Dir
To Microcontroller
38
Driver Card Connection Board
To Motor A
To Motor B
Motor Wires
Motor Wires
Gnd V+
EasyDriver v3
Card A
Gnd V+
EasyDriver v3
Card B
Step Dir
Driver Card B V+
Driver Card B Gnd
Driver Card C V+
Driver Card C Gnd
Driver Card D V+
Driver Card D Gnd
Driver Card E V+
Driver Card E Gnd
EasyDriver v3
Card C
Driver Card A Gnd
To Motor C
To Gnd on 12 V 4 A AC
to DC Power Supply
+
Driver Card A V
Motor Wires
To V+ on 12 V 4 A AC
to DC Power Supply
Step Dir
Driver Card B Step
Driver Card B Dir
Driver Card C Step
Driver Card C Dir
** Driver Card A Step
** Driver Card A Dir
** Driver Card B Step
** Driver Card B Dir
** Driver Card C Step
** Driver Card C Dir
** Driver Card D Step
** Driver Card D Dir
** Driver Card E Dir
** Driver Card E Step
Driver Card D Step
Driver Card D Dir
Driver Card E Step
Gnd V+
Driver Card A Dir
Step Dir
Driver Card A Step
To Motor D
To Motor E
Motor Wires
Motor Wires
Gnd V+
EasyDriver v3
Card D
Gnd V+
EasyDriver v3
Card E
Step Dir
Reset Switch Gnd
Driver Card E Dir
Step Dir
Control Lines for Touch Sensor Circuit
Microcontroller
** Debug Pins are used for connecting motors when the microcontroller is being programmed and tested on the project board.
39
Driver Card Connection Board:
Detailed View of Outputs to Touch Sensor Board
Reset Switch Gnd
Touch Sensor Board Gnd
Touch Sensor Board V+ (5 V)
Touch Sensor Finger 4
Touch Sensor Finger 3
Touch Sensor Finger 2
Touch Sensor Finger 1
Touch Sensor Finger 0
Microcontroller
40
Close_Fingers(Close cmd)
Close_Fingers
called
Is the microcontroller
connected?
YES
YES
Is it a valid parameter?
NO
Send Correct Data
Byte
NO
Attempt to connect
to microcontroller
Wait for response
Successful?
YES
NO
Was a ‘DONE’ returned?
NO
YES
Update finger
status variables
Exit Function
41
Open_Fingers(Open cmd)
Open_Fingers
called
Is the microcontroller
connected?
YES
YES
Is it a valid parameter?
NO
Send Correct Data
Byte
NO
Attempt to connect
to microcontroller
Wait for response
Successful?
YES
NO
Was a ‘DONE’ returned?
NO
YES
Update finger
status variables
Exit Function
42
Change_MaxSteps(int finger, int steps)
Change_Speed
called
Is the microcontroller
connected?
YES
Are they valid parameters
and is the finger open?
NO
YES
Convert steps to
appropriate
character
Send First Data
Byte
NO
Attempt to connect
to microcontroller
Wait for response
Successful?
YES
NO
Was a ‘DONE’ returned?
NO
YES
Send Second Byte
from Set_Speed
fucntion
Wait for response
NO
Was a ‘DONE’ returned?
YES
Update max steps
variables
Exit Function
43
Appendix B: Hardware Overviews
The following is an overview of the hardware used in the project. Full documentation is too extensive to
include, but is provided at the project website:
http://eecs.vanderbilt.edu/courses/eece295/2007%2D2008/CIS%5Fpolymorph%5Fhand/documentation
/documentation.htm.
APS12DT256SLK Development Kit
A microcontroller is needed to interface between the computer and the hand. The microcontroller will
receive high level function calls from the computer over the serial line and translate that into running
the correct stepper motors. The microcontroller needs to be able to communicate serially, output to
four drive boards (8 total pins), and input 5 interrupts (5 pins).
The microcontroller used is a MC9S12DT256 from Freescale Semiconductor. This microcontroller is
available in a student development kit with the part number APS12DT256SLK.
The APS12DT256SLK is an educational development module supporting the Freescale MC9S12DT256
microcontroller (MCU). Application module SLKs include components for out-of-box operation and are
preprogrammed with a serial monitor to make application development quick and easy. A background
DEBUG port is provided for development tool use and is compatible with HCS12 BDM interface cables
and software. The APSLK also contains CodeWarrior® programming development tools, as well as
documentation, power and communications cables.
(Source: http://www.freescale.com/webapp/sps/site/
prod_summary.jsp?code=HCS12DT256SLK&nodeId=0162469544)
Cost: $95
Features
• MC9S12DT256 MCU, 80 LQFP
• 256 KB Flash EEPROM
• 4KB EEPROM
• 12 KB RAM
• SAE J1850 Byte Data Link Controller
• 8-ch, 10-bit, ATD w/ external trigger
• 8-bit Enhanced Capture Timer with IC, OC,
and Pulse Accumulate capabilities
• 7-ch, 8-bit PWM
• 9 KBI inputs
• 56 GPIO
• 3 CAN Channels
• CAN 2.0 A/B PHY w/ 3-pos header
• 2 SCI & 2 SPI Channels
• 1 IIC Channel
• RS-232 transceiver w/ DB9 connector
• 4 MHz Clock Oscillator
• Low Voltage Reset Supervisor
• Power Input Selection Header
• On-board 5V regulator
• Optional power Input/Output from ConnectorJ1
• User Components Provided
• 1 DIP Switch, 4-pos
• 3 Push Button Switches: 2 User, RESET
• 5 LED Indicators: 4 User, +5V
• Jumpers
• USER_EN
• PWR_SEL
• COM_EN
• Connectors
• 60-pos pin-header providing access to MCU
IO signals
• 2.0mm barrel connector power input
• 6-pin BDM interface connector
• 3-pos CAN interface connector
• DB9 connector
• Supplied with DB9 Serial Cable, Power Supply,
Documentation (CD), and Manual
Specifications:
Module Size 3.5. x 2.5.
Power Input: +9V typical, +6V to +20V
44
EasyDriver v3 Stepper Motor Driver
The driver card is the interface between the
microcontroller and the motors. Each of the five Easy
Driver v3 Stepper Motor Drivers interpreted a step pulse
from the microcontroller and a direction line to drive a
specific motor. The drivers expects either 0 or 5 V as
inputs.
(Source: http://greta.dhs.org/EasyDriver/)
Cost: $14.95 (x5) = $74.75
Interlink Force Sensing Resistors
Touch sensors are required to provide feedback when a finger
comes in contact with an object. All the touch sensors within the
budget failed to be sensitive enough to register when grasping a
plush toy or other soft object. Therefore, it was decided to use a
force sensing resistor (FSR) and designate anything above a specific
force as a touch. The FSR is a polymer thick film device consisting of
flexible substrate with a printed semiconductor and another
substrate with a printed circuit, which are separated by a spacer.
When the FSR is touched, the circuit makes contact with the
semiconductor, allowing current to flow through the circuit. As the
applied force increases, the amount of the circuit that makes
contact increases, meaning more current flows and the effective
resistance of the FSR decreases.
a
(Source:
http://www.interlinkelectronics.com/force_sensors/products/forcesensingresistors/standardsensors.ht
m)
45
Specifications:
-
Size Range Max = 20” x 24” (51 x 61 cm)/Min = 0.2” x 0.2” (0.5 x 0.5 cm) - Device thickness:
0.008” to 0.050” (0.20 to 1.25 mm)
Force Sensitivity Range: < 100 g to > 10 kg
Pressure Sensitivity Range: < 1.5 psi to > 150 psi (< 0.1 kg/cm2 to > 10 kg/cm2)
Single Part Force Repeatability: +- 2% to +- 5% of established nominal resistance
Device Rise Time: 1-2 msec (mechanical)
Lifetime: > 10 million actuations
Temperature Range: -30ºC to +70ºC
Maximum Current: I mA/cm2 of applied force
Sensitivity to Noise/Vibration: Not significantly affected
Cost: $6.00 (x 6) = $36.00
Jameco 237472 Bipolar Stepper Motor
The stepper motors will pull/release the fishing lines attached to the fingers. This will close/open the
fingers and provide the required grabbing motion. The Jameco 237472 was decided upon, based on the
following specifications.
(Source:
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=1&storeId=10001&catalogId=10001&pa=237472&productId=237472)
Jameco 237472 Features:
- Ball bearings
- Dielectric strength: 500V, 50Hz/minute
- 18" lead wires
- Ambient temp.: -10°C to +55°C
- Insulation resistance: 100MΩ @ 500VDC
46
Spindle Caps
The spindle caps serve as a connection between the stepper motor and the monofilament line. It also
functions as a guide for the monofilament line as it is wound around the motor shaft. It was machined in
house, with a 13/64 inch diameter hole for the motor shaft, and a tapped hole for a 4x40 set screw.
Enclosure
Two aluminum enclosures were used to house the motors and their accompanying circuitry. Both were
six inches by four inches by three inches. The enclosures were cut to accommodate the components and
mounted onto the front of ISAC’s chassis.
Polymorph Plastic
Polymorph is a commercial polymer used for model making and prototyping. It can be heated molded
by hand and has a tensile strength comparable to nylon and polyethelene.
(Source: http://www.absorbables.com/properties.htm)
Chemical Name: Polycaprolactone
Density: 1.11 g/cm3
Inherent Viscosity: 1.00-1.30 dL/g
Crystalline Melt Transition: 58-63°C
Approximate Resorption: >24 months
Tensile Strength: 3000-5000 psi
Elongation: 300-500%
Modulus: 3-5x104
Cost: $40/500 g
Rapid Prototype
Rapid prototype is an ABS plastic which can be used by a rapid prototyping machine to print three
dimensional structures. It is the created through the polymerization of acrylonitrile, butadiene, and
styrene monomers.
(Source: http://www.dynalabcorp.com/technical_info_abs.asp)
Chemical Name: Acrylonitrile Butadiene Styrene
Density: 1.04 g/cm3
Melting Temperature: 105°C
Operating Temperatures:
Maximum: 80°C
Minimum: -20°C
Tensile Strength: 4,300 psi
Cost: $5/in3
47
25-lb Test Fishing Line
For the flexion tendons that run on the underside of the fingers, fishing line was used. A 25-lb test was
deemed sufficient for our purposes. While a steel cable was originally desired, problems with fraying of
the cable and subsequent chafing between the cable and the Polymorph necessitated the use of fishing
line. The cost of the fishing line is $20 for a 1 lb spool.
Nuts and Bolts
Nuts and bolts are needed to attach the fingers and thumb to the hand, and also to connect the hand to
the mounting plate to attach it to the rest of the arm. All of the hardware used on the hand was 4x40
bolts, between ½ inch and ¾ inch, and matching nuts. The fingers, especially the thumb, are attached to
the palm with nuts with tooth washers built in, which bite into the fingers and keep them from moving.
The motors came threaded with M3 mounting holes, so they were attached to the enclosure with 6mm
M3 bolts.
Bolts – 4-40, ¾ inch - $6.69 per 25
Nuts – 4-40, 1/16 inch thick, $1.75 per 100
48
Appendix C: Project Code
The microcontroller code and CodeWarrior project are available on the project website:
http://eecs.vanderbilt.edu/courses/eece295/2007%2D2008/CIS%5Fpolymorph%5Fhand/documentation
/Code.htm
The Visual C++ Console application, Windows Forms application, and source code are available on the
project website:
http://eecs.vanderbilt.edu/courses/eece295/2007%2D2008/CIS%5Fpolymorph%5Fhand/documentation
/Code.htm
49
Appendix D: Parts List
#
#
#
Needed Ordered Received
Control
APS12DT256SLK
PBMCUSLK
Jameco Stepper Motor
EasyDriver v3
Touch Sensors
Force Sensors
12v Power Supply
Structural/Mechanical
Elastic Shock Cord
Steel Cable 1/32"
Cable Housing
Housing Cutter
Machine Screws, 4x40 3/4"
Machine Screws, 4x40 5/8"
Maching Nuts, 4x40
Wooden Spools
Metal Spools
Rapid Prototype Palm v1
Rapid Prototype Palm v2
Motor/Circuit Enclosure
Polymorph
Price Per Unit
Total
Price
Actually
Paid
1
1
4
4
5
5
1
1
1
5
5
10
6
1
1
1
5
5
10
6
1
$86.99
$175.00
$21.45 + shipping
$14.95 + shipping
$0.30 + shipping
$6.00 + shipping
$25.50 + shipping
$ 86.99
$175.00
$ 27.53
$109.62
$ 7.00
$ 51.82
$ 35.77
$ 86.99
$
$ 110.12
$ 109.62
$
7.00
$ 51.82
$ 35.77
5 yd
50 ft
50 ft
1
12
12
12
4
4
1
1
1
500 g
5 yd
50 ft
50 ft
1
100
100
100
4
4
1
1
1
n/a
5 yd
50 ft
50 ft
1
100
100
100
4
4
1
1
1
n/a
$1.50
$5.00 + shipping
$30.00 + shipping
$30.00 + shipping
$2.66 + shipping
$2.84 + shipping
$0.90 + shipping
$3.00
$5.00
$27.00
$27.00
$20.00
$40.00
Total Cost
$ 1.50
$ 7.00
$ 36.00
$ 36.00
$ 4.66
$ 4.84
$ 1.75
$ 3.00
$ 40.00
$ 27.00
$ 27.00
$ 20.00
$ 40.00
$742.48
$
1.50
$
7.00
$ 36.00
$ 36.00
$
4.66
$
4.84
$
1.75
$
3.00
$
$
$
$
$
$ 496.07
50
Appendix E: User’s Guide
ISAC Anthropomorphic Hand:
A User’s Guide
51
Table of Contents
1 Software User Details............................................................................................................................... 53
1.1 Using the GUI .................................................................................................................................. 53
1.2 Debugging Help ............................................................................................................................... 54
1.2.1 Using the Hand Class ................................................................................................................ 54
1.2.2 Loading Code onto the Microcontroller ................................................................................... 54
1.2.3 Debugging using the CodeWarrior IDE..................................................................................... 55
1.2.4 Troubleshooting Suggestions ................................................................................................... 55
2 Hardware User Details ............................................................................................................................. 56
2.1 Making a New Finger....................................................................................................................... 56
2.2 Replacing a Finger ........................................................................................................................... 56
2.3 Resetting a Finger............................................................................................................................ 56
3 Normal System Operation Recommendations ........................................................................................ 57
52
1
Software User Details
1.1 Using the GUI
The GUI is intended as a test tool to make sure the hand is functioning properly and it is the easiest way
to see what the hand control is capable of. It provides access to all of the functions of the hand and it
displays hand status. It controls the hand in real time and cannot easily be integrated into another
project. It uses a modified version of the Hand class and the Serial class to communicate with the
microcontroller. The modifications are in how error conditions are handled. The GUI uses message
boxes, while the Console Application prints errors to the command window.
Upon running the GUI, the computer will attempt to contact the microcontroller. If this action is
successful then a message box will appear to inform the user. If this action fails or times out, a message
box will appear to inform the user. If this is the case, check connections, power, and manually reset the
microcontroller. Once this is complete, clicking on any of the buttons will first try to establish a
connection before performing a task. If a successful connection is made, the task will then be
performed.
There are two groups of opening/closing buttons: Group Commands and Individual Commands. A
screen shot of the GUI can be seen below in Figure 1. The group commands perform tasks involving
multiple fingers while the individual commands perform tasks with a single finger.
Figure 19: Hand Control GUI
The Change Speed button takes the integer value from the Finger text box and the Speed Factor from
the Speed Factor text boxes. Valid speed factors are 0.25, 0.5, 0.75, 1.0, 1.25, 1.50, 1.75, and 2.0. If no
value is entered in a text box it is assumed to be 0.
53
The Change Max Steps button takes the integer value from the Finger text box and the Steps value from
the Step Change text box. The range for Step Change is -127 to 127. Enter negative numbers with a (-)
sign. It is possible to enter values outside of this range, but the Hand Class will not allow that value to
pass to the microcontroller. A value of 0 corresponds to a resetting of Max Steps for the corresponding
finger.
The status area shows the status of the fingers, the current motor speeds as a percentage of their
startup value, and the current maximum steps. The Ring and Pinky fingers move together so their values
should always show up as the same. When either the speed or steps are changed successfully, the value
is updated on the labels.
Upon shutting down the GUI application, the Hand class will open any closed fingers. These fingers will
open in sequential fashion starting with the Thumb and ending with the Ring/Pinky.
1.2 Debugging Help
1.2.1 Using the Hand Class
There are seven available functions for the hand class. There are functions to open and close the fingers,
change the motor speeds, and change the maximum steps of the motors. Changing the speed of a motor
will make the finger close faster, but with less torque. Depending on the flexibility of the polymorph
joints, a finger may not be able to close all the way if the speed is increased. Changing the maximum
steps has the effect of allowing the finger to close more or less.
Available functions:
1) Close_Fingers(Close cmd)
2) Open_Fingers(Open cmd)
3) Change_Speed(int finger, double speed_factor)
4) Change_MaxSteps(int finger, int steps)
5) get_MotorSpeed(int finger)
6) get_MaxSteps(int finger)
7) get_FingerStatus(int finger)
Functions 1-4 either ask the microcontroller to move fingers or change a microcontroller control
variable. Functions 5-7 return private variables of the class. These private variables should be the same
values that are on the microcontroller because they are only updated after the microcontroller reports
that they have been updated successfully.
For Function Descriptions see documentation in Hand.cpp or Software Detail Design Description in Final
Report.
1.2.2 Loading Code onto the Microcontroller
Now that the code is loaded into the CodeWarrior IDE, click on the ‘Project button’ in the Menu Bar,
then select Make (or simply press F7) to build your project. This will make your project locally and allow
54
you to debug any compile errors in your code. If errors are present, double clicking the message will
take you to that location in the code.
1.2.3 Debugging using the CodeWarrior IDE
Once the errors have been handled, the code can be loaded onto the microcontroller for real time
debugging, but first make sure the following items have been done:
-
Select P&E Multilink Cyclone Pro (to load, Simulation mode can be used if microcontroller is not
available)
Move jumpers to correct positions: see microcontroller documentation
Set power jumper on project board to USB power: see project board documentation
Then click on the ‘Project button’ on the Menu bar, select ‘Debug’ (or press F5) to load your code onto
the microcontroller. At this point in time, a real time debugger will pop up. To add breakpoints to a
source file, right click and select ‘Open Source File’. Select the file you want, find the location for the
break point, right click and add the breakpoint. Clicking the green arrow in the Menu Bar will start the
debug (or press F5), the horizontal red T will stop the process at its current location (press F6), to reset
the microcontroller press the button with an arrow entering a circle (press CTRL-R), or just let your
mouse hover over a button for stepping into and out of functions. All the normal debugging options are
available, but you will be limited to a scant two breakpoints so use them wisely.
Once your code is functioning properly, you are ready to put it back in the control box. Make sure to
follow these steps:
-
Disconnect the power before unplugging the microcontroller.
Move jumpers to correct positions: see microcontroller documentation
Plug microcontroller into pin out on Driver Card/Microcontroller board
Now that the microcontroller is connected correctly within the Control box, the hand is ready for
another day’s work.
1.2.4 Troubleshooting Suggestions
If something is still not working properly, run through the following check list:
-
Make sure the serial connection is intact
Reset the microcontroller manually (press the reset button)
Make sure power is applied to the microcontroller
Make sure power is applied to the motors
See website for more information:
http://eecs.vanderbilt.edu/courses/eece295/2007%2D2008/CIS%5Fpolymorph%5Fhand/
IF POWER TO MOTORS IS REMOVED AND RECONNECTED, MICROCONTROLLER NEEDS TO BE
RESET BY PUSHING THE EXTERNAL RESET BUTTON.
55
2 Hardware User Details
2.1 Making a New Finger
For instructions on how to make fingers out of polymorph for the ISAC Robot anthropomorphic hand,
please refer to the "How to" video for the basic design. A few modifications and recommendations can
be followed to enhance the functionality of the finger. The specific fingers used for the robot have joints
of varying flexibility so as to produce a more uniform and life-like flexion. The joints of the finger get
progressively more flexible as they approach the palm. To create a more flexible joint, a larger area
should be pressed out by the dull ruler. For example, the distal joint was pressed out one ruler width,
the middle two rulers width, and the proximal three rulers width. Also, the designer may want to
produce fingers of differing length so as to imitate the difference in lengths seen on a human hand. This
can be done by making each of the joint segments proportionally longer.
2.2 Replacing a Finger
If a finger breaks, or is deemed no longer useful, it is fairly easy to replace it.
First, remove the sensor glove from the fingertip, and then the machine screw that runs through the
fingertip that holds the two tendons. Grab the lower tendon where it comes out of the palm and pull the
loop out of the finger. The finger should be ready to be unscrewed from the palm. After the old finger
has been removed, untie the end of the elastic cord that is tied to the palm end of the finger.
Take the elastic cord and tie a single overhand ("granny" style) knot in the hole farthest from the
fingertip in the new finger. This knot should be loose, and will be tightened later. Screw the new finger
onto the palm with the screws that were on it. Feed the lower tendon loop back through the bottom of
the finger. Start threading the screw that goes across the finger tip, and when it is about half way
through, loop both tendons around it, and then finish threading it.
The last step is to make sure that the elastic cord is tied. You want to make sure that it is relaxed when
the finger is in a relaxed position, but also that it stretches when the finger is closing. The easiest way to
do this is, with the first overhand knot on the end, to pull on the end of the cord until it is how you want
it, and then to tie an additional knot at the end to keep it from changing.
If any hardware is missing, it is fairly easy to replace, and can be found online or at a local hardware
store. The hardware used to connect the fingers to the palm are ¾ inch long 4x40 machine screws with
tooth-washer nuts. The tooth-washer nuts grip the polymorph fingers, and are especially important
when attaching the thumb to ensure that the thumb does not rotate after attachment.
2.3 Resetting a Finger
If a finger is still functional but the closing and opening routines are delayed or seem too short, the
finger can be reset without removing any parts. Over an extended work cycle the fishing line can
become slack, which causes the motors to wind the line the wrong way at first. The line then grabs, and
the correct operation is completed. However, this behavior is not characteristic of a properly
functioning system. In order to rectify this situation, motor power must be removed from the circuit so
56
that the line can be pre-wound. To initialize the finger, wind in the counterclockwise direction until the
desired starting position is reached. Repeat for each finger, as necessary. Reapply motor power to
make the hand operational once again.
3 Normal System Operation Recommendations
It is recommended that motor power be disconnected when the hand is not in use. As long as power is
applied the motors will generate heat. The motors are able to withstand high temperatures, but it is still
safer to turn them off. Also, the driver cards have a thermal tolerance and if that is exceeded then they
shut down. There is a potential for overheating, but if the motor power is turned off this should be
avoided.
The microcontroller can be left powered on. However, it is safer to unplug the power to it when not in
use. If the microcontroller is left on it will need to be reset before operating the hand.
57
Download