* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download EE100 Sensors and Robotics
Survey
Document related concepts
Regenerative circuit wikipedia , lookup
Counter-IED equipment wikipedia , lookup
Operational amplifier wikipedia , lookup
Flexible electronics wikipedia , lookup
Lego Mindstorms wikipedia , lookup
Schmitt trigger wikipedia , lookup
Radio transmitter design wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Index of electronics articles wikipedia , lookup
Valve RF amplifier wikipedia , lookup
Field-programmable gate array wikipedia , lookup
Flip-flop (electronics) wikipedia , lookup
Integrated circuit wikipedia , lookup
Rectiverter wikipedia , lookup
Transistor–transistor logic wikipedia , lookup
Transcript
EE100 Experiment – Digital Logic Circuits Sensors and Robotics Experiment Purpose: To acquaint you with how logic circuits use information from other common electrical components. In this laboratory sensors detect what a simple moving robot is doing and the output of the logic circuit serves to adjust the motion of the robotic vehicle. Equipment Needed: 1. DigiBot 2. AA Batteries (4) 3. Wire Bundle 4. 74HC10 (NAND logic gates) (3) Getting Acquainted: The DigiBot is a mobile platform (means a vehicle that can move) equipped with several sensors whose logic output allows you to control the vehicle’s motion and functions. The sensors detect both the presence of obstacles and the position of the DigiBot relative to a black stripe that the vehicle can be made to follow. A prototyping board on the vehicle allows you to implement the desired digital logic circuits to control the functions of the DigiBot. The sensor outputs are combined by the logic circuit in a manner to control two motors which power the vehicle. Sensors Logic Circuitry Left Motor/ Wheel Right Motor/ Wheel Figure 1. DigiBot Block Diagram Main Components: • Sharp GP2D15 infrared object detector takes continuous distance measurements. The distance is reported as a logic level. The output is normally low and produces a logic high when an obstacle is detected within a distance of approximately ten inches of the sensor. • TRA-01 line tracker allows the DigiBot to follow a path made from black electrical tape. The TRA-01 has three infrared sensors spaced about a half inch apart. The sensors produce a logic low when over a black surface and a logic high when over a white surface. • Two motors that respond to input signals formed from the combined sensor logic outputs. Each motor has a separate direction control and motor enable. To turn ON the motor requires a logic high to its enable input. The direction of motor rotation is determined by the logic level applied to the motor’s direction control. A logic high input to the direction control causes the motor to propel the DigiBot forward and a logic low propels it backward. The motors are either fully ON or OFF. The DigiBot can be instructed to execute a turn by powering the wheels in opposite directions. • 74HC10 NAND logic gates are one of the fundamental building blocks for implementing logic circuits. The gates are packaged in groups of three in what is called a 14-lead DIP (Dual In-Line Package). All logic circuits and components (including building blocks) are active devices. That means they require attachment to a power source such a battery or power supply in order to operate. This attachment is in addition to the logic inputs and outputs. This is as opposed to passive devices (or components), such as resistors, which do not require any connection to a power source. System Outputs and Inputs: A – Input Direction control for the right motor B – Input Enable for the right motor C – Output Right sensor of the line tracker D – Output Collision Sensor E – GND Ground, return path for current F – Vcc Power connection to the batteries G – Output Center sensor of the line tracker H – Output Left sensor of the line tracker I – Input Enable for the left motor J – Input Direction control for the left motor To function ALL active devices require that the appropriate pins of each DIP be connected to VCC and to GND. See the pin connection requirements for each active device for guidance. DigiBot: Top and Bottom views of the DigiBot are shown in Figures 2 and 3. DigiBot Schematics: The schematic for the available pins of the DigiBot are shown in Figure 4 and the pin functions are listed in the System Inputs and Outputs section. Figure 5 shows the circuit logic schematic which you are to implement. The logic circuit takes the outputs from all the sensors, converts these outputs to form new logic signals that become the logic inputs to the motors. The inputs serve to control the motor based on what the sensors detect. Figure 4. DigiBot Electrical Connectors The Vcc connections shown in Figure 4 are already internally attached. It is only necessary to flip the switch into the ON (closed) position to direct power to all of the components. Figure 5. DigiBot Logic Circuitry Connecting Inputs to Outputs The logic is implemented using NAND gates – one of the basic types of logic gates. See Appendix B for more details. Experimental Procedure: Step 1 – Become more familiar with the DigiBot by performing a few simple tests to check its functionality. At this point the circuitry of Figure 5 is NOT needed. For all tests, flip the power switch located on the underside of the DigiBot into the ON position. Motor Test: For the following test, put the DigiBot on blocks to keep it from moving when the wheels turn. First, test the function of the left motor by running a wire from VCC to the enable of the left motor, I. Then, connect a wire from VCC to the direction control of the left motor, J. Record the direction of rotation of the left wheel. Connect J to GND and again record the direction of rotation of the left wheel. Connect I to ground to stop the left motor. Repeat these steps for the right motor. Obstacle detector test: Keep the motor enables connected to GND. The motors do not have to be running for this test. Using a logic probe or a multi-meter, check the logic level on the obstacle detector output, D. If there is no obstacle within ten inches of the sensor, there should be a logic low present. If using a multi-meter, this will be a voltage between 0 volts and .8 volts. Now, place your hand or some other object in front of the obstacle sensor. There should be a logic high present. If using a multimeter, this will be a voltage between 3 volts and VCC (around 5.5 volts). Line tracker test: The motors do not have to be running for this test. You will need a piece of white paper with strip of black electrical tape attached. Place the black tape beneath the center sensor of the line tracker. The left and right sensors should both have the white paper below them. Now, check and record the logic level present on the track sensor outputs. The left and right sensors, H and C, should have a logic high present and the center sensor, G, should have a logic low. Repeat this test by moving the black electrical tape beneath the right and left sensors. Record the logic levels for each test. The sensor with the black tape beneath it should have a logic low and the sensors with the white paper below them should have a logic high. Performing all of the tests provides assurance that the individual components of the DigiBot are performing properly. Step 2 – Insert the three 74HC10 DIPs along the center groove of the Protoboard. They should be assigned names IC1, IC2, IC3, starting the count from the front of the board. Using the experience of the last experiment attach the wires to implement the circuit of Figure 5. Note: The three NAND gates of IC2 are shared between two parts of the overall circuit. Note: Each IC package must have connections of F (Vcc) to Pin 14 and E (Ground) to Pin 7. Refer to the previous experiment for identifying the Pin numbers. Step 3 – Test the operation of the DigiBot on the provided track. The vehicle should follow the tape path defined by the black tape. Step 4 – Some things you can do to achieve a better understanding of the logic circuit: • • If there is any additional black tape placed crossing the original path so that all tracking sensors are seeing black tape, what will be the sensor outputs? What will be the effect on the performance of the DigiBot? If an obstacle is placed on the track, what does the DigiBot do? • If you attach a wire from D to Ground, what will that do? How will that affect the operation of the DigiBot? Appendix A: Hardwired versus Programmed There is no microprocessor in the logic circuit for the DigiBot. Hence, as long as the wires of the circuit are connected in a specific manner, the performance of the DigiBot is fixed within a limited range of capability. That means whatever change in performance you wish to effect could only be done by changing the DigiBot circuit, such as changing the circuit connections, adding more gates, etc. If circuit performance can only be changed by a change in wiring and/or components, the circuit is referred to as being hardwired. If there are only limited things you want a circuit to do, having a hardwired circuit is a very reasonable thing to have. But if you want versatility, an ability to easily make changes in performance, some programming capability must be introduced in the circuit. A microprocessor of some type must be used. Then you can change performance via programming commands and there is no need to solder any connections or detach/attach wires. But software can be corrupted and crash. Hence, the both hardwired circuits and microprocessor controlled circuits exist in industry. Appendix B: Logic Gate Electrical Characteristics Logic gates are the building blocks of digital circuits. In particular, the DigiBot circuit uses NAND gates. This is a gate that combines the performance of an AND gate followed by a NOT gate. The electrical performance of circuits in general is specified in terms of the input and output behavior of the circuits. For logic circuits, simple and complicated, that behavior can be provided by what is called a truth table, a relationship between input and output, if the input is such and such, the output is so and so. Let us begin with the AND gate. Its symbol and its truth table for a gate with 2 input is as follows: The truth table has all possible logic levels for the input and the corresponding output logic level that defines what an AND gate does. Only if both inputs are HIGH, have a value of 1, is the output also high. Otherwise the output is always LOW, a value of 0. What if the output of the AND gate is inputted into a NOT gate, a gate whose output logic state is the opposite as that of the input logic state. An input of 0 results in an output of 1 and an input of 1 results in an output of 0. That combination of a AND gate followed by a NOT gate is the defining behavior of the NAND gate. The symbol and truth table are: The amazing thing is that it is possible to transform any desired logic relationship between input and outputs into a functioning circuit using NAND gates. The schematic of Figure 5 was generated from a larger truth table with 4 inputs (from the 3 tracking sensors and the collision sensor) and 4 outputs (an enable signal and the directional signal to each motor). The information of that truth table was then converted into a circuit using standard Electrical Engineering digital circuit procedures.