Lecture 2: Bits, Bytes, and Intro to the Galumphing Robot Project Professor Carr Everbach Course web page: http://www.swarthmore.edu/NatSci/ceverba1/Class/e5/ 10 Years Ago A moment of silence and reflection… Remember… Wizards available Tuesdays/Wednesdays 7:00-10:00 pm (Hicks 213) for Engin and Sundays/Tuesdays 7:00-9:00 pm Physics & Math Thursday 9/8 – your personal web page is due Friday 9/9 Tennis Ball Drop starts at 3:30 pm. Choose one person to describe your design in about a minute (for the video). Engineering Department Picnic starts at about 4:30 Add/Drop period ends Next Thursday 9/15 Tennis Ball Report (on website) is due Short response essays on Fork and Mirrored articles due Shop class (not required – only if you are interested). Starts 9/16 (Friday). Sign up is in Engineering Department Office. Also… Paolo-‐Alexander Debuque left his iPod touch in this room on Sunday. Anyone see it? The Big Picture The next 7 weeks we will be building and programming one-armed robots. You will also be learning Matlab™, and will be individually responsible for completing the assignments. Solutions should be uploaded to Moodle, so please log in to check. Today we’ll review basic concepts of digital representation and control. In lab this week, we’ll visit the Machine Shop and play with servo motors. Next week, I’ll start teaching Matlab, but you can start reading Chapter 1 of the Palm text now. Bits, Bytes, and Words Basic unit of digital information is a “bit.” TTL: zero volts vs. 5 volts CMOS: -‐3 volts vs. +3 volts Coming soon: Memristors Each Bit uses approximately 1 transistor in silicon Byte = 8 bits (MB = 1 million bytes = 8 million bits) Densities ~ 100 MB/cm2 in VLSI Memristors ~20 GB/cm2 CD example CD example 1 bit = 2 possibilities 2 bits = 4 possibilities (00, 01, 10, 11) N bits = 2N possibilities On CD, 44,100 samples/second, 2 channels 16 bits/sample (2 Bytes) = 216 possible voltages = 65,536 How many bytes on a 70-‐min. CD? 2 bytes • 44,100 samples/sec • 60 sec/min • 70 min • 2 channels 740,880,000 = 740 MB Genome Example Human genome has 3 billion nucleotides Each nucleotide can take one of 4 possible values: Adenine, cytosine, guanine, thymine How many bytes is this? 3 billion nucleotides • 2 bits/nucleotide = 6 billion bits 6 billion / 8 bits = 750,000,000 = 750 MB DNA density: 1 EB/mm2 Servo Motors (1) Output shaft of motor turns to angle specified by input pulses. We send a stream of pulses to servo through wires connected to it. Width of pulses defines angle of output shaft. http://www.lynxmotion.com/images/Products/Full/hsr-5980.jpg Image adapted from: http://www.electronicsteacher.com/robotics/images/pulsewidthdiagram.gif 9 Servo Motors (2) Relatively precise, but not accurate Images adapted from: http://www.lynxmotion.com/images/data/ssc-32.pdf 10 Controlling the Servo Open a serial port connection Send a string of characters to the I/O board The I/O board controls the motors by varying the width of pulses sent to the servo 11 Control Format #<ch>P<pw>...#<ch>P<pw>T<time><cr> <ch> = channel number (0-31) <pw> = pulse width in microseconds (500-2500) <time> = time in milliseconds for move (optional) <cr> = carriage return http://www.youtube.com/watch?v=Pp2IJIk5qvc 12 Control Format Examples #<ch>P<pw>...#<ch>P<pw>T<time><cr> Sending the string: ‘#1P1500T200<cr>’ ch=1, pw=1500, time=200 This will set the pulsewidth on motor 1 to 1500 microseconds, and will make the change over 200 milliseconds. (1500 ms ≈ 0°) 13 Another Control Format Examples #<ch>P<pw>...#<ch>P<pw>T<time><cr> Sending the string: ‘#1P900T300<cr>’ ch=1, pw=900, time=300 This will set the pulsewidth on motor 1 to 900 microseconds, and will make the change over 300 milliseconds. (900 ms ≈ -45°) 14 Control Format Example Again #<ch>P<pw>...#<ch>P<pw>T<time><cr> Sending the string: ‘#1P1200#5P2100T1500<cr>’ ch=1, pw=1200 ch=5, pw=2100 time=1500 This will set the pulsewidth on motor 1 to 900 microseconds, the pulsewidth on motor 5 to 2100 microseconds, and will make the change over 1500 milliseconds. 15 Servo motor demo Ball Drop Teams Dana-‐Hallowell Parrish and off-‐ campus folks Wharton Mertz Alice Paul-‐ David Kemp Mary Lyons Hicks 303 Hicks 301 Hicks 310 Hicks 309 Hicks 312 Hicks 308 Willets Hicks 314
© Copyright 2026 Paperzz