Electronics • Pneumatics • Machiningsinghose.marc.gatech.edu/courses/me2110...
Transcript of Electronics • Pneumatics • Machiningsinghose.marc.gatech.edu/courses/me2110...
© GIT 2007 1
• Electronics• Pneumatics• Machining
ME 2110 - Creative Decisions & Design
Lecture 9 v.3
© GIT 2007 2
Introduction to the ME 2110 Kit
Controller Box
Pneumatics
Electro Mechanical Actuators & Sensors
© GIT 2007 3
Features of the Controller Box
• BASIC Stamp II-SX microcontroller• Interfaces with various external
devices• Stepper Motors• DC Motors• Pneumatic Valves• IR Distance Sensor• Rotary Encoder• Microswitches• Solenoids
• RS-232 Communication Port
© GIT 2007 4
Layout of I/O Ports
© GIT 2007 5
Electro/Mechanical Supplies
© GIT 2007 6
Sensors
• Micro-switches• Push button switches• Infrared (IR) sensors• Rotary encoders
© GIT 2007 7
Micro-switch
• Lever arm closes circuit
• Status of IN register holds status of port
• 0 = Open Circuit• 1 = Closed Circuit
• Same action is going to start competition
© GIT 2007 8
Push Button Switch
• Latches “on” when depressed
• Must be depressed again to switch off
• Not the exact one supplied in kits – kit one is rectangular
© GIT 2007 9
Infrared Distance Sensor
• 4” to 30” Range• Infrared beam is emitted• Beam reflects off object• Detected by receiver• Output voltage (not
linearly) proportional to distance
• A/D Converter: Reading between 0 and 255
© GIT 2007 10
Rotary Encoder• Rotational motion of shaft
converted to electrical pulses, or counts, that are read by microcontroller.
• The rotational measurement is based upon the number of counts.
• Kit’s encoder is a relative encoder; it only counts relative to its starting position for each count command.
© GIT 2007 11
A/D Converter
• Converts a continuous voltage to a multi-level discrete digital value
• Used with Distance Sensor (0-255)
• Use these values to convert to desired quantities using conversion factors
© GIT 2007 12
A/D Converter
© GIT 2007 13
Using the A/D Converter• Power up chip
• Choose channel
• Serially send a “Take Reading” command
• Serially receive the value
• Power down chip
© GIT 2007 14
Actuators
• Solenoid• DC motor• Stepper motor
© GIT 2007 15
Solenoid• Consists of a coil of wire – Electromagnet• When powered up, pulls in plunger• One way device
• Does not return automatically
© GIT 2007 16
DC Motor• Speed is proportional to
voltage• Moves in both directions
• depends on sign of voltage
• Gearbox to slow down shaft
• Very high torque• Requires time to ramp up
and down
© GIT 2007 17
DC Brush Motor• Fixed Field Magnet• Coils create an
electromagnet• Field magnet rotates
armature• As armature turns,
polarity reverses• Cycle continues• Both directions
N S
© GIT 2007 18
Pulse Width Modulation (PWM)
• Controller box can only send 0 or 5 volts• PWM is used to run motor at intermediate
speeds• PWM uses cycles of pulses
5 Volts
0 Volts
Off On One Cycle
© GIT 2007 19
Stepper Motors• Both motors are
controlled through P10• Speed is a value
chosen between 2 and 240
• Can move both directions
• Amount of motion can be specified
• Negligible ramping time
• Low Power• When off, shaft rotates
freely
© GIT 2007 20
Stepper Motor
• Clockwise rotation shown• Reverse process for counterclockwise
rotation
© GIT 2007 21
Programming the Stamp
• PBASIC (a version of BASIC) is used to program the Stamp
• Everything is global• Variables• Constants• Subroutines
• Programming and commenting style is very important
• Programming syntax is explained in the manual
© GIT 2007 22
Programming EditorSave
Transfer to Controller
BoxRun Motor 1Read EncoderRelease WhackerGrab StuffClose DoorPut Down Weapons
© GIT 2007 23
• Versioning• Keep old versions of your programs• Do not just overwrite old versions with new versions
• Transfer is uni-directional. • Computer to controller
• You can’t “read” the box when it is running. • You can only determine if the problem is the program or the
component by changing the components.
• The box does not support “interrupts.”• Save program on thumb drive, not on studio
computers.• Download basic stamp program from Parallax web
site to your computer.
Programming Editor
© GIT 2007 24
Program Structure
• Constants Table• Constants are substituted at compile time
• Variable declaration• Reserves portions of the Stamp’s limited memory
• Main program loop• Subroutines
• Often much of the work is done in subroutines
© GIT 2007 25
Variables
• Variables are memory reservations on the BASIC Stamp
• Variables must be declared before they can be used
• Variable types are: • Word (16 bits): 0-65535• Byte (8 bits): 0-255• Nibble (4 bits): 0-7• Bit: 0-1
© GIT 2007 26
Bytes, Nibbles, and Bits
1 byte = 2 nibbles = 8 bits:
B7 B6 B4 B3 B2 B1 B0B5
High Nibble Low Nibble
Most SignificantBit (MSB)
Least SignificantBit (LSB)
© GIT 2007 27
Words and Bytes
1 word = 2 bytes = 4 nibbles = 16 bits:
High Byte Low Byte
Word
© GIT 2007 28
Selected Commands
• Branching• If…Then• Goto• GoSub…Return
• Looping• For…Next
• Debugging• Debug
• Sounds (Music)• Freqout
• DC Motor Control• PWM
• Digital I/O• Input, Output• High, Low
• Serial I/O • Serout• Shiftin, Shiftout
• Time• Pause
• Power Management• End
© GIT 2007 29
Best Way to Learn is to Do
• Read through the manual • Examine the sample programs and program
fragments• Studio assignment• Ask questions• Additional Information and Program
• www.parallaxinc.com (BASIC Stamp)
© GIT 2007 30
Pneumatic Supplies
© GIT 2007 31
Pneumatic Actuator• Pressurized Extension• Spring Return• 2.5 in Stroke
© GIT 2007 32
Pressure Vessel• Pressurize with Bike Pump• Max 100 psi• Supplies 10-15 Actuator strokes
© GIT 2007 33
Pneumatic ValveDoes not operate below 25 psi
© GIT 2007 34
Machining
Bracket Coupler
© GIT 2007 35
Machining Studio
• Learn to Respect Machine Tools• Learn to Cut• Gain Experience• Generate Design Ideas• Build Confidence• Preserve Digits
Goals:
© GIT 2007 36
Safety• No fooling around• Follow directions• Long pants (to your shoes)• Short sleeves or roll up sleeves• Socks• Closed toe shoes• Remove all jewelry
• watches, bracelets, rings, necklaces, dangling earrings
• Long hair must be tied back• No ties, scarves, dangling clothes• Always wear safety glasses• Violations will result in immediate removal from shop• Report all broken or non-working machines
© GIT 2007 37
The Coupler
All tolerances ±0.010 unless otherwise specifiedAll dimensions in inches
0.500 0.650 ± 1/32 0.750
1/2-20 UNF6-32 UNCTHRU
0.125 φ0.750 DP
0.900 0.500
0.250
0.500+0.000-0.005
© GIT 2007 38
The Lathe
© GIT 2007 39
The Bracket
0.250
0.325
0.325
0.250
0.250
0.400
0.400
1.5002.300 REF.
0.950 REF.
0.700
10-24 UNCTHRU2 PL TYP
0.950
All tolerances ±0.010 unless otherwise specif ied
1/8 RAD.
Bracket
All dimensions in inches
© GIT 2007 40
The Mill
© GIT 2007 41
Don’t Rush
Be Safe
Ask Questions
© GIT 2007 42