CS 1020 - Winter 2013 - Class 1

  • General course info
       - introductions
          - three instructors
       - Class time: MWF, 9am-12
       - Work in groups of three (change groups roughly once a week)
       - General class structure:
          - First hour lecture
          - Last two hours lab
          - Leading into a homework due at the beginning of the next class
       - topics
          - LEGO design
          - Basic gears, sensors, etc.
          - Basic logo programming
          - Web design

       - administrative
          - Attendance is important!
          - 3 quizzes on Wednesdays, starting next class
          - Main work will be the homeworks (building robots)
          - Make sure to keep up with the reading too!

       - Office hours
          - Su, T, Th 7:30-10:30pm
          - I'm around most days during the day (e-mail me if you want to be sure)

       - Course web page: go/cs1020
       - Door code
       - Lab equipment
          - Don't take out of the lab
          - Don't tell other people the code
          - Be gentle :), but experiment and have fun
          - If you have any doubts, just ask one of the instructors


  • LEGO robot basics
       - We'll use legos as the building blocks for the structures
          - mostly the LEGO's people have used before
          - maybe some new additions…
          - more moving parts
             - wheels
             - gears
          - lego bricks with holes for better support structures
       - We'll use motors to power our creations
       - For the "brains" (and the power) we'll use Handy boards


  • Handy board basics (http://www.cs.middlebury.edu/~dkauchak/classes/cs1020/reading/handy_hardware.pdf)
       - LED display
          - useful for showing menu items
          - can also be used to print information in programs
       - on/off switch
       - serial (i.e. phone) line
          - can be used to provide power/charge
          - also used to communicate between the computer
             - test commands
             - download programs
       - 4 motor ports denoted a - d starting left to right
       - start/stop buttons
          - start: used to execute a menu command on the screen
          - stop: stops everything currently going on
       - 9 digital sensor inputs
          - only register on or off
          - we'll mostly use these for our "bump" sensors
       - 7 analog sensor inputs
          - values between 0 and 255
          - used for light sensors
       - scroll wheel used to scroll through menu options
       - charger jack
          - can plug in directly to the wall, though most often we'll power with serial line
       - rule of thumb:
          - generally keep plugged in to charge when not in using (yellow charge light will be on)
          - turn off when done at the end of the day
          - be gentle... especially when plugging in and removing sensors

  • LEGO basics
       - FLU: Fundamental LEGO Unit
          - distance between two pegs
          - distance between two wholes
          - the width of a single piece
       - Is the height 1 FLU?
          - no: it's actually 6/5ths an FLU (i.e. slightly larger)
       - What implications does this have?
       - What is the problem with stacking a bunch of single pieces?
          - Not very strong!
       - How could we make it strong?
          - Add vertical reinforcement! (called bracing)
       - What is the height of 3 pieces?
          - 6/5 * 3 = 18/5 = 3 3/5 FLU
       - What if we wanted to add a vertical brace... what is the height between the top and bottom holes?
          - 6/5 * 2 = 12/5th FLU
       - Solution: LEGO plates
          - A LEGO plate (i.e. skinny piece) is 1/3 of the height of a normal piece (i.e. 2/5 FLU)
       - To make a strong structure we can stack two normal and two plates:
          - 2 * 2/5 + 3/5 + 3/5 = 2 FLU
          - use the black pegs to mount pieces to the side
             - what's the difference between grey and black pegs?
       - What other structures can we build similarly?
          - 4 normal + 1 plate: 3/5 * 2 + 6/5 * 2 + 2/5 = 4 FLU
          - 6 normal: 3/5 * 2 + 6/5 * 4 = 6 FLU
          - ... (even number normal tend to work better)
       - Use bracing wherever possible!
          - Legos don't stick together well by themselves particularly as they get older

  • Motor basics
       - Two types of motors
          - grey, square motor
             - high speed
             - low torque
          - grey, with step
             - good torque
             - slower speed
       - We'll start by playing with the square motors
       - They're too fast and torque isn't good enough for most robot purposes
          - You can pretty easily stall them if you grab the axle when it's running
       - Solution: gearing!

  • LEGO Gears
       - Lego comes with four standard gear sizes
          - 8 sprocket: 0.5 FLU radius
          - 16 sprocket: 1 FLU radius
          - 24 sprocket: 1.5 FLU radius
          - 40 sprocket: 2.5 FLU radius
       - The 8, 16 and 40 sprocket can be meshed up interchangeably horizontally. Why?
          - They each have a factor of 0.5 FLU radius

  • Gearing
       - We can trade-off speed for torque (and vice versa) by interlocking different gears
       - For example, we can interlock and 8 and a 24
          - What happens as we rotate the 8?
             - It takes three rotations of the 8 to rotate the 24 once
             - This is called a 3:1 gear reduction
          - What effect does this have?
             - The 24 gear spins at 1/3rd the speed
             - The 24, however, has three times the torque!
             - Note that the 24 also spins in the *opposite* direction
       - We can chain together multiple gears to increase this ratio
          - The easiest way is to put another smaller gear on the same axle as the larger gear
          - then, connect up that smaller gear with another larger gear
          - Each time we do this we:
             - *multiply* the torque by the each added gear ratio
             - but, we *divide* the speed by the added gear ratio
          - Show the 3^4:1 (i.e. 81:1)
       - We mentioned that this gearing changes direction. What if you don't want that?
          - can introduce another gear with the same size to change direction again
          - can use a rubber band to connect to wheels (not necessarily gears)

  • Changing direction of movement
       - What if we have rotation one way and want it the other way?
       - Many solutions
          - crown gear: connect at 90 degrees (different sizes)
          - bevel gears: connect at 90 degrees (same size)
          - "worm" gear

  • worm gear
       - rotates once and advances teeth by 1
       - What does that mean for the gear reduction for a 24 tooth gear?
          - 24:1!
       - We'll use this to get us started, but it has its issues (which you're read about)

  • Rest of today
       - Build a sciborg (basic plans online)
       - Play with the bump sensors
       - Play with the light sensors
       - Get your sciborg to follow a line