MASSACHVSETTS INSTITVTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6 081 Introduction to EECS I Spring Semester 2007 Thursday Laboratory for Week 9 This handout contains Thursday April 12th lab on connecting eyes to the robot head IMPORTANT There is no nanoquiz today but we are handing out a take home open notes mid term due April 19th Also if you wish to retake either or both of the last two nanoquizzes actually modified versions of these quizzes you can do that today See s the Day In this lab you will add a pair of eyes to your robot head so that when you attach your robot head to a robot the robot will be able to see Next week you will break up in to groups of four and design the software needed to make your seeing robot chase another robot with a flashlight tail To add eyes to your robot head you will be using two photoresistors resistors whose values change with light intensity You will use these photoresistors the robot head you modified last week an NI box a laptop and your knowledge of circuits control and python to take two approaches to designing a light tracking robot head One approach will just use circuits and the other approach will use the NI box the laptop and a program in python The reason for trying both methods is that each method has its own merits and you may chose one or the other for your task next week chasing a robot Finally we do not expect that everyone or perhaps anyone will finish today s lab by 5pm We fully expect that many of you will finish the lab at the beginning of next Thursday April 19th Also the LA s only saw this new lab last night and may need to appeal to the lab designer me when things go wrong There are a number of tasks you will need to complete along the way to making a light tracking head They include Temporarily interfacing the protoboard postive supply voltage to the NI box AI2 input so that you can set the supply voltage to twelve volts you will need a voltage divider Interfacing the motor position potentiometer to the NI box AI2 input so you can report the robot head position to a python program Designing a circuit only light tracking head Designing a resistor network to interface the NI box AO0 output to the robot head Designing a circuit to interface the photoresistors to the NI box AI0 and AI1 inputs Designing a light tracking head based on a python controller program Use the protoboard variable suppy to generate a twelve volt supply for your robot Next week you will be attaching the robot heads to the robot so it is important that you design your circuits using a twelve volt supply If you do not see how to adjust the supply ask your LA Use the NI box GND and AI2 input a resistor divider and the daqtry py software in the NILab directory to measure that your supply voltage is properly set to twelve volts WARNING Any time you restart daqtry py you must unplug and then replug in the NI box Sorry about this we are not very good linux USB driver hackers Checkpoint 2 30 PM Demonstrate that your protoboard supply is set to twelve volts Demonstrate that your robot head works on a single twelve volt supply Sense Robot Position from Python Use the divider network and connection to the NI box you just designed for measuring the protoboard supply to measure the voltage generated by the robot head potentiometer You will notice that the voltage generated by the robot head potentiometer does not vary from zero volts to twelve volts as you rotate the head Think about the range of motion of the rotating head and explain the voltage range that you measure You may find it easiest to unplug the electrical connector from the motor while you are rotating the head as then you can turn the head freely Checkpoint 3 00 PM Determine and explain to your LA the range of voltages produced by your robot head position potentiometer Add Photoresistor Eyes to the Robot Head and Track a Light As one might expect from the name photoresistors are resistors whose resistance decreases with increasing light intensity Ask a staff member for a pair of photoresistors to use as robot eyes and then design a circuit which uses the two photoresistors to replace the position control potentiometer in your robot head circuit note that the position control potentiometer is the potentiometer you adjusted by hand to change the head position Add the two photoresistors to the protoboard on the Robot head Use three wires from head to the base board but think carefully about how to wire the photoresistors so they generate a signal that can be used by your robot head to turn towards the light Also we have special wires to make connections between the rotating protoboard and the fixed protoboard that do not strain the robot head motor ask your LA or a staff member Finally if you are clever you will not need any extra components beyond the two photoresistors Checkpoint 3 30 PM Demonstrate that your robot head tracks the light Demonstrate that your python program can display the head position Control the Robot Head Position from Python Design resistor networks so that the AO0 output from the NI box can be used to control the robot head position Show that you can use a python program to make the head rotate through its full range of motion and that your program can read the position of the robot head You can use a modification of daqtry py WARNING If you eliminate all the print statements from the daqtry program the loop accesses the NI too frequently and crashes the program Please be sure to print something to slow down that loop One of your fellow students found a fix to this problem but we have yet to implement it Calibrate your program so that the program indicates the robot head is at position zero when the head is parallel to the straight edge at the back of the grey mounting plate The NI box output generates a signal that varies from zero volts to five volts but the original control potentiometer that you adjusted by hand generates a voltage than varies from zero volts to twelve volts You will have to think carefully and refer to the extra notes posted about Tuesday s lecture to figure out how to rescale the five volt output Checkpoint 4 15 PM Demonstrate that you can use python to rotate the robot head Use Photoresistors to inform Python about light intensity As one might expect from the name photoresistors are resistors where the resistance varies with light intensity Design some experiments to determine how the photoresistor resistance varies with
View Full Document