LEGO Mindstorms NXT Atmel 32-bit ARM processor 4 inputs/sensors (1, 2, 3, 4) 3 outputs/motors (A, B, C) 256 KB Flash Memory 64 KB RAM USB 2.0 Communication 4 programmable buttons 100x64 b/w LCD Display Sensors Active: • Old light and rotation Passive • Touch, sensors for NXT Digital Motors 170 RPM 360 RPM for old motors, why? • Ultrasonic Minds and Computers 3.1 Preview What five steps would the robot have to take in order to go forward for 2 rotations? Spin left motor Spin right motor Wait until the motors have spun two rotations Stop left motor Minds and Computers Stop right motor 3.2 Preview Now lets examine what that would look like in the NXT Educational Programming Software. 1. Spin left motor 2. Spin right motor 3. Wait for 2 rotations 4. Stop left motor Minds and Computers 5. Stop right motor 3.3 Preview While programming your motor blocks, make sure you select the proper output ports, and set both motors to the same direction and power level. Minds and Computers 3.4 Preview Don’t forget, the comments you include in your program don’t actually have any effect on what your robot will do. Comments simply act as reminders for you when you edit your program. Here, the “wait for 1440 degrees” won’t do anything because the actual Wait Block is set to wait for 720 degrees. Minds and Computers 3.5 Opening Activity Many things affected how far your robot traveled. • The number of degrees your Wait For block is set to wait for • The size of your tires Minds and Computers 3.6 Wheels and Distance In this activity we’re going to program our robot to move an exact distance. To do so we must understand a few things about circles. START Minds and Computers FINISH 3.7 Review Let’s start with the basics. Answer the following: 1. What is a radius of a circle? 2. What is a diameter of a circle? 3. What is the formula for the circumference of a circle? Minds and Computers The distance from the r center to the outside of a circle. The distance, through a d circle’s center, from one edge to another. Circumference= diameter * π 3.8 Preview With our knowledge of circumference, we can start figuring out how to control the distance our robot goes. Minds and Computers 3.9 Preview Finally, be sure to save frequently. That way, if anything happens to your computer you don’t have to start over. Minds and Computers 3.10 Goals: Build better robots Minimize mechanical breakdowns Build robots that are easy to control Encourage good design strategy Strive for elegant, clever solutions Know your materials Plastic bricks since 1949 (wooden blocks prior) On average, 2100 different parts each year Manufacturing tolerance: 1/1000 of an inch Number of ways of combining six 8-stud bricks: 102,981,500 Widely used by scientists and engineers as a rapid prototyping tool Minds and Computers 3.11 Connector pegs Black pegs are tight-fitting for locking bricks together. Grey pegs turn smoothly in bricks for making a pivot Minds and Computers 3.12 Structure LEGO bricks are finicky: They HATE duct tape. They HATE hot glue. They HATE super glue. They HATE epoxy. You should never need adhesives to build reliable LEGO structures Minds and Computers 3.13 Drivetrain LEGO Gears 40T 8T 16T 24T Minds and Computers 1T Worm Bevel 24T Crown 3.14 Design Strategy Incremental design Test components parts as you build them • Drivetrain • Sensors, sensor mounting • Structure Don’t be afraid to redesign KISS Testing Don’t wait until you have a final robot to test • Interaction of systems • Work division (work concurrently) Develop test methods Repeatability Minds and Computers 3.15 Philosophy Build for accurate, precise control Slow vs. fast? Gear backlash Stability Skidding Have fun Be creative, unique Strive for cool solutions, that work! Aesthetics: it’s fun to make beautiful robots! Minds and Computers 3.16 Differential drive Most common kinematic choice All of the miniature robots… Khepera, Braitenberg - difference in wheels’ speeds determines its turning angle VL VR Minds and Computers 3.17 Differential drive Most common kinematic choice All of the miniature robots… Khepera, Braitenberg - difference in wheels’ speeds determines its turning angle Questions (forward kinematics) Given the wheel’s velocities or positions, what is the robot’s velocity/position ? VL VR Minds and Computers Are there any inherent system constraints? 3.18 Differential drive Most common kinematic choice All of the miniature robots… Khepera, Braitenberg - difference in wheels’ speeds determines its turning angle Questions (forward kinematics) Given the wheel’s velocities or positions, what is the robot’s velocity/position ? VL VR Are there any inherent system constraints? 1) Specify system measurements 2) Determine the point (the radius) around which the robot is turning. 3) Determine the speed at which the robot is turning to obtain the robot velocity. Minds and Computers 4) Integrate to find position. 3.19 Differential drive 1) Specify system measurements - consider possible coordinate systems y VL l q x VR Minds and Computers (assume a wheel radius of 1) 3.20 Differential drive 1) Specify system measurements - consider possible coordinate systems y 2) Determine the point (the radius) around which the robot is turning. VL l q x VR Minds and Computers (assume a wheel radius of 1) 3.21 Differential drive 1) Specify system measurements - consider possible coordinate systems y VL l x q 2) Determine the point (the radius) around which the robot is turning. - to minimize wheel slippage, this point (the ICC) must lie at the intersection of the wheels’ axles - each wheel must be traveling at the same angular velocity VR ICC Minds and Computers (assume a wheel radius of 1) “instantaneous center of curvature” 3.22 Differential drive 1) Specify system measurements - consider possible coordinate systems y w VL l x q 2) Determine the point (the radius) around which the robot is turning. - to minimize wheel slippage, this point (the ICC) must lie at the intersection of the wheels’ axles - each wheel must be traveling at the same angular velocity around the ICC VR ICC Minds and Computers (assume a wheel radius of 1) “instantaneous center of curvature” 3.23 Differential drive 1) Specify system measurements - consider possible coordinate systems y 2) Determine the point (the radius) around which the robot is turning. - each wheel must be traveling at the same angular velocity around the ICC w VL x l 3) Determine the robot’s speed around the ICC and its linear velocity VR ICC R robot’s turning radius w(R+l/2) = VL w(R- l/2) = VR (assume a wheel radius of 1) Minds and Computers 3.24 Differential drive 1) Specify system measurements - consider possible coordinate systems y 2) Determine the point (the radius) around which the robot is turning. - each wheel must be traveling at the same angular velocity around the ICC w VL x l 3) Determine the robot’s speed around the ICC and then linear velocity VR ICC w(R+d) = VL R w(R-d) = VR robot’s turning radius Thus, Minds and Computers (assume a wheel radius of 1) w = ( VR - VL ) / l R = l ( VR + VL ) / ( VR - VL ) 3.25 Differential drive 1) Specify system measurements - consider possible coordinate systems y 2) Determine the point (the radius) around which the robot is turning. - each wheel must be traveling at the same angular velocity around the ICC w VL x l 3) Determine the robot’s speed around the ICC and then linear velocity VR ICC w(R+d) = VL R w(R-d) = VR robot’s turning radius Thus, w = ( VR - VL ) / l R = l ( VR + VL ) / 2( VR - VL ) 3.26 Minds and Computers So, the robot’s velocity is V = wR = ( VR + VL ) / 2 Differential drive 4) Integrate to obtain position y Vx = V(t) cos(q(t)) w(t) Vy = V(t) sin(q(t)) VL x l VR ICC R(t) robot’s turning radius with w = ( VR - VL ) / l WhatMinds has and to Computers happen to change the ICC ? R = l( VR + VL ) / ( VR - VL ) 3.27 V = wR = ( VR + VL ) / 2 Differential drive 4) Integrate to obtain position y Vx = V(t) cos(q(t)) w(t) Thus, VL x(t) = x l Vy = V(t) sin(q(t)) y(t) = q(t) = VR ∫ V(t) cos(q(t)) dt ∫ V(t) sin(q(t)) dt ∫ w(t) dt ICC R(t) robot’s turning radius with w = ( VR - VL ) / l Minds and Computers R = l ( VR + VL ) / 2( VR - VL ) 3.28 V = wR = ( VR + VL ) / 2 Differential drive 4) Integrate to obtain position y Vx = V(t) cos(q(t)) w(t) Thus, VL x(t) = x l Vy = V(t) sin(q(t)) y(t) = q(t) = VR ∫ V(t) cos(q(t)) dt ∫ V(t) sin(q(t)) dt ∫ w(t) dt ICC Kinematics R(t) robot’s turning radius with w = ( VR - VL ) /l What has to happen to change the ICC ? Minds and Computers R = l ( VR + VL ) / 2( VR - VL ) 3.29 V = wR = ( VR + VL ) / 2