active learning using mechatronics in a freshman ...

2 downloads 3847 Views 60KB Size Report
ACTIVE LEARNING USING MECHATRONICS IN A FRESHMAN. INFORMATION TECHNOLOGY COURSE. Doug Wolfe. 1. , Karl Gossett. 2. , Peter D. Hanlon. 3.
Session S1D ACTIVE LEARNING USING MECHATRONICS IN A FRESHMAN INFORMATION TECHNOLOGY COURSE Doug Wolfe1 , Karl Gossett2 , Peter D. Hanlon 3 , and Curtis A. Carver Jr.4 Abstract – This paper details efforts at the United States Military Academy to employ mechatronics in an activelearning environment. We use mechatronics to teach future Army leaders information technology (IT) and problemsolving with computers, as well as introduce them to autonomous vehicles, sensors, and computer simulation. Cadets are taught a four-step problem-solving methodology to develop and implement the components for a mechatronic device using the Mindstorms Lego Robot. After cadets complete problem analysis and design, they code and test their Java programs that control the robot in a graphical simulation environment called Jago. Once cadets are confident in their solution, they download their completed Java program to the Mindstorms robot to verify that their code solves the problem in the real world. The impact on the cadets using mechatronics to solve problems has been very positive, and we are confident that the long-term impact will be substantial. Cadets are exposed to a number of different disciplines, gaining an understanding of how these disciplines work together to develop mechatronic devices. In addition, the robot projects help enforce the problem-solving methodology where cadets analyze, design, implement, and test their solutions.

and interesting to cadets. Cadets use the four-step problemsolving methodology to solve problems using a robot. Cadets develop their algorithms and code, and then observe their code instructing a robot to perform physical movements. The success or failure of the robot is discussed in terms of how well the cadets complete the problemsolving methodology, not just the completion of their code. In the spring semester of 2002, the concept of mechatronics and how we can solve problems using mechatronics was introduced into the course by including lessons on sensors and having the cadets build each component of a mechatronic device. Mechatronics are devices composed of electrical and mechanical components that are controlled through software. Specifically, we built a robot using the Lego Mindstorms Robotic Invention System and included electronic sensors to make a “smart” robot. Two of the sensors are included with the Mindstorms Robotic Invention System while one was designed by an instructor and implemented by the cadets. We introduced the concept of mechatronics into the course because the Army continues to increase its use of “smart” robotic systems on the battlefield such as bomb defusing, biohazard sensing, the Unmanned Ground Vehicle, and the Future Combat Systems .

Index Terms – Mechatronics, real-time programming, Java, robots.

M ETHODOLOGY

INTRODUCTION The United States Military Academy at West Point has the mission to produce officers for the U.S. Army. The Academy exposes all cadets to the types of information technology (IT) that they will use in the Army. Therefore, as part of the curriculum, all cadets are required to complete an IT course (hereafter referred to as IT105) taught by the Electrical Engineering and Computer Science (EECS) Department. In this course, taken during their freshman year, cadets learn a basic four-step problem-solving methodology (analyze, design, implement, and test) by performing hands-on activities, implementing basic programming projects, and through active learning in the classroom [1]. Problem-solving is taught by using the basic programming principles of sequence, selection, and iteration in Java programs. For the last two years, robots have been used to make programming solutions more visible, tangible,

Overview IT105 consists of 40 lessons during a semester and stresses problem-solving using information technology and computers. All programming problems assigned involve the use of mechatronics. A Lego Mindstorms Robot is used for the mechanical component while different types of sensors are used for the electrical component. Cadets are given problems that require them to use a robot with their sensors to execute different tasks. EECS instructors developed a simulation environment that the cadets use to validate the algorithms they develop to solve the problems presented. This environment allows the cadets to see whether their code solves the problem by watching the robot execute the code in the environment. As part of a final project, cadets are required to build their own sensor and then use that sensor with the Mindstorms robot to demonstrate that their solution works in a lab setting.

1

Doug Wolfe, Assistant Professor, United States Military Academy, [email protected] Karl Gossett, Assistant Professor, United States Military Academy, [email protected] Peter D. Hanlon, Assistant Professor, United States Military Academy, [email protected] 4 Curtis A. Carver Jr., Academy Professor, United States Military Academy, [email protected]. The views expressed in this article are those of the author and do not reflect the official policy or position of the United States Military Academy, the Department of the Army, or the Department of Defense or the U.S. Government. 2 3

0-7803-7961-6/03/$17.00 © 2003 IEEE November 5-8, 2003, Boulder, CO 33 rd ASEE/IEEE Frontiers in Education Conference S1D-24

Session S1D The Robot The mechanical aspect of the mechatronics device entails the use of a robot, which was built using the Lego Mindstorms Robotic Invention System [2]. The Mindstorms Robotic Invention System can be purchased for less than $200 at several popular national toy and electronic store chains. The kit consists of 718 Lego pieces, a manual on how to build a basic robot, and a CD that contains the Lego firmware/programming environment. The kit also includes the Robot Command Explorer (RCX) brick, motors, touch and light sensors as well as an infrared (IR) transceiver that enables a PC or other RCX bricks to communicate with the RCX brick. The RCX brick, which was inspired by research on programmable bricks at MIT, has 16K of memory for its firmware, 16K of memory for user programs and includes a Hitachi H8/300L processor [2]. The lack of memory for user programs limits program complexity but is sufficient for the 200-300 line programs that the cadets generate. Instructors are issued three robot systems that they build for their classes. The Sensors The electrical aspect of the mechatronics device incorporates the use of a number of sensors. The Lego Mindstorms Robotic Invention System includes two sensors - a light sensor and a bumper sensor. The light sensor is used to detect colors by beaming light on an object and detecting the amount of light that is reflected back off of the object. The bumper sensor is used to detect when the robot has bumped into another object. The sensor is activated when the robot bumps into an object and a button on the sensor is depressed. A third sensor, the High Intensity Tracking (HIT) sensor, is used to detect the direction of light sources. The sensor produces a voltage from 0 - 5 volts, which is then converted into a digital value between 0 and 1024. The digital value is then converted into a value which cadets will use, between – 50 and +50 (inclusive) that represents the difference between the amounts of light that each of the photo-resistors on the sensor receives. If the left photo-resistor is receiving all of the light and the right photo-resistor receives no light, the HIT sensor will return a value of –50. Conversely, if the robot’s right photo-resistor receives all the light and the left photo-resistor receives no light, the value returned by the HIT sensor will be +50. If both photo-resistors receive equal amounts of light, the HIT sensor will return a value of zero. See the diagram in Figure 1 for representative values. Cadets use this value in their programs to determine the direction of a light source. In addition to writing programs to use these sensors, cadets actually build the HIT sensor. During a two-hour lab, each cadet solders 25 electrical components onto a circuit board to create a HIT sensor at a cost of $2.50 each. As the cadet creates the sensor, he or she tests each working set of components (i.e., power circuit, the basic sensor, the RCX interface, and the sensor display) of the sensor. Then as a

-50

-30

0

30

50

-50

-30

0

30

50

FIGURE 1 HIT SENSOR RETURN VA LUES

final test, they connect their sensor to the Mindstorms robot and run a simple program that moves the robot to the brightest light. A picture of the actual HIT sensor is shown in Figure 2. The Software LeJOS Firmware The original firmware that comes with the Mindstorms robot was replaced with LeJOS firmware because the original does not support Java. LeJOS [3] is a very reliable and robust Java Virtual Machine that was written exclusively for the Mindstorms robot. LeJOS is freely downloadable from http://lejos.sourceforge.net. LeJOS provides a programmer with commands to control all of the functions of the Mindstorms robot including its sensors, motors, and communication IR port. The problem with using LeJOS for an introductory IT course was that the level of abstraction of the LeJOS commands is too low. Therefore, we developed a simulation/programming environment called Jago (Java and Lego) that gives cadets more abstract commands to program the actions of the robot [4].

FIGURE 2 HIT SENSOR WITH MINDSTORMS ROBOT

0-7803-7961-6/03/$17.00 © 2003 IEEE November 5-8, 2003, Boulder, CO 33 rd ASEE/IEEE Frontiers in Education Conference S1D-25

Session S1D Jago Simulation Environment Memb ers of the department developed the Jago simulation environment to enable cadets to run a Java program that controls a robot in a graphic simulator. Jago provides a number of commands to control the robot including moving forward and backward, turning left and right a certain number of degrees, and polling of the sensors. After cadets complete a problem analysis and design, they code and test their Java programs on the Jago simulator in their rooms without the need to load them on an actual Mindstorms robot in the lab. Once they are confident in their solution, they can bring their completed Java program to the lab and download it to the Mindstorms robot to verify that their code solves the problem in the real world. Cadets are required to demonstrate their solution in the simulator and on a Mindstorms robot in the classroom during their final project presentations. Cadets learn that even though their solution worked in the Jago simulator, it may not work on the Mindstorms robot due to the mechanical fla ws of the robot.

to go forward in the simulation environment, the robot would go in a straight line. But when the program was executed on the Mindstorms robot, the robot would veer off either left or right rather than going perfectly straight. When a cadet program instructed the robot to turn a certain number of degrees in the simulation environment, it would turn that precise amount. But when the program was executed on the Mindstorms robot, the robot would not turn the exact amount. The original version of Jago did not realistically simulate the Mindstorms robot’s motor problems. The original version also did not allow for more than one robot or the ability for robots to communicate with each other. Finally, it did not realistically simulate how the Mindstorms robot sensors worked rendering detected colors. The newest version of Jago fixes these problems by realistically simulating the robot veering off course and turning incorrectly as well as giving the ability for two or more robots to communicate with other robots. Sensor modeling was also improved so that simulation sensors more realistically represented the quantification errors inherent in

FIGURE 3 SCREENSHOT OF THE JAGO SIMULATION ENVIRONMENT

The Mindstorms robot has several mechanical flaws with its motors and gears that do not allow it to work exactly as programmed. When a cadet program instructed the robot

the Mindstorm robots. See Figure for an example of the Jago environment.

0-7803-7961-6/03/$17.00 © 2003 IEEE November 5-8, 2003, Boulder, CO 33 rd ASEE/IEEE Frontiers in Education Conference S1D-26

Session S1D Java Program Each instructor develops a different scenario in which groups of two cadets analyze, design, implement, and test a solution. Cadets write their programs in Java, test their solution in the Jago simulator, and then once they are satisfied that their solution solves the problem, they download their programs to the robot and test their programs in the lab. The cadets use the basic programming constructs of sequence, selection, and iteration to solve the problem. An example problem required students to develop an algorithm that would allow the robot to follow a black line on a hallway floor through a U.S. Embassy building. As the robot follows the black line, it uses its light sensor to detect different colors on the floor that indicate different types of bombs. Once the robot reaches the end of the black line and finds a red box, the robot uses its HIT and bumper sensors to find another robot and transfers the bomb data (light sensor readings) to that robot using its IR port. The scenario for this problem is listed in Appendix A. Examples of key pieces of code from a cadet’s solution follow. The following code directs the robot to go forward recording readings from its light sensor until it is off of the black line. goForward(); while((getLightSensor()!=WHITE)&& (getLightSensor() != RED)) { reading = getLightSensor(); if(reading != BLACK){ readings[reading] +=1; } } halt(); This code uses the robot touch sensor and HIT Sensor to find another robot and send data to it. while (getTouchSensor() == OFF) { while (getHITSensor() < 0) pivotLeft(5); while (getHITSensor() > 0) pivotRight(5); goForward(40); } goBackward(100); sendDataIR( readings ); See Figure 3 for a screen shot of the Jago simulation environment for this problem. ANALYSIS The cadets benefit from this methodology in four ways. Cadets must: (1) work as part of an interdisciplinary team;

(2) design to succeed; (3) deal with generality; and, (4) understand a number of information technologies. Cadets are exposed to a number of different disciplines (Electrical Engineering, Computer Science, and Mechanical Engineering) when they implement their solution to the final robot project. They gain an understanding of how these disciplines work together to develop mechatronic devices. The cadets build the sensor. They have to deal with inconsistencies in the mechanical platform and finally, they have to write a 200-300 line Java program to control the robot and its sensors. This experience of working on a multidisciplinary team is the first of the cadet experience but not the last. As part of their senior design project, all cadets will work on multidisciplinary teams for a real client to design, build, and implement a real system. The second key benefit of this methodology is design. The robot projects enforce the problem-solving methodology where cadets must analyze, design, implement, and test their solutions. The requirements for the final project are sufficiently complex that cadets cannot bypass design and directly implement a solution. Cadets learn that poor or incomplete problem analysis and design leads to significant coding difficulties that often jeopardize the success of the project. For the first time in many cadets’ lives, they cannot “wing” a solution to the problem and succeed. Complexity forces design. While sometimes painful, this is a valuable lesson for future leaders. Third, cadets must provide general solutions. Specific solutions that work in the Jago simulation fail miserably in the robot due to changes in scale, lighting, and robot implementation. Cadets must build software control mechanisms using Java that adjust to the situation based on feedback from the sensors and changing conditions. While humans work with general solutions to situations daily, programming control mechanisms to provide general solutions is a challenging and eye-opening task for novice programmers. However, cadets exhibit a real and palatable sense of accomplishment and pride when their programs execute correctly. They solve problems that they initially perceive as impossible. This forces many cadets to revise their mental model of their capability for solving IT problems. Finally, all of our cadets are exposed to a number of information technologies (simulation, robots, sensors, “smart” systems) that they will use as future Army officers. Since the Army increasingly employs these technologies, it becomes increasingly important that the cadets understand how they work and can be utilized. FUTURE WORK We continue to make improvements to the simulator to model the Lego Mindstorms robot behavior. Currently, the distance the robot moves in the simulator does not exactly match the distances of the Mindstorms robot movement.

0-7803-7961-6/03/$17.00 © 2003 IEEE November 5-8, 2003, Boulder, CO 33 rd ASEE/IEEE Frontiers in Education Conference S1D-27

Session S1D The interaction between multiple robots in the simulator needs to be improved to allow different types of communication through the IR port. We are also planning to add a 3D simulator and a debugging facility to the simulator. We are looking at other sensors that can be used with the Mindstorms robot including sound sensors and voice command sensors. In addition, we are considering the replacement of the RCX brick that comes with the Mindstorms robot with another that has larger memory and faster processor speed. Finally, we have considered expanding the use of sensor and robots in a second information technology course that is currently being developed and will be offered in 2003. REFERENCES [1]

Felder, R.M. Felder and R. Brent. "Cooperative Learning in Technical Courses: Procedures, Pitfalls, and Payoffs". ERIC Document Reproduction Service, ED 377038 (1994).

[2]

Lego Robot Invention System. http://mindstorms.lego.com/ eng/products/ris/index.asp. Accessed on 26 March 2003.

[3]

Solarzano, J. “LeJOS, Java for the RCX web site”, http://lejos.sourceforge.net/. Accessed on 27 February 2003.

[4]

Flowers, Thomas and Gossett, Karl. 2003. "Using Robots and Simulation to Teach Problem Solving in an Introductory Course in Computing and Information Technology". In Proceedings of the Advanced Simulation Technologies Conference 2003, Orlando, Florida, March 30 - April 3.

bombs that were present. All U.S. Embassies have been using a floor-cleaning robot that follows a black stripe on the floor, which you believe can be used to allow your robot to navigate the hallways. You also have a sensor that can be used to detect both the black stripe on the floor and any bombs (indicated by color stripes across the black stripe) that are on the black stripe. An Explosives Ordinance Disposal (EOD) team has another robot that can communicate with your robot and “hopefully” deactivate each bomb, but they need your robot to scan the entire hallway, following the black stripe, and to gather information about all bombs in the building. In addition, your hardware team has recently designed a light-detecting sensor (High Intensity Tracking, or HIT sensor) that is sufficient to detect a headlight on the EOD team’s robot. This will allow you to find the EOD team’s robot and transmit the bomb data you’ve collected as you followed the black stripe in the hallway.

APPENDIX A Last week, U.S. intelligence sources detected transmissions from a terrorist cell in Iraq. The initial context of the message was missing, but the portion of the message intercepted indicated a probable terrorist attack on a U.S. Embassy. Unfortunately, the intercepted message did not contain the embassy that was targeted. With some pressure, sources indicated that the attack would consist of bombs placed throughout the embassy building and would be delivered by an individual in the embassy—reducing the ability of anyone to escape before being killed by the bomb. Intelligence sources also indicated that the bombs have certain characteristics: 1. All the different types of bombs have a distinct color; 2. Because of the type of flooring used in the embassies, all of the bombs could be detected using some sort of sensor reflecting light off the floor. 3. The bombs are too dangerous to be deactivated by humans. From the initial research, it seems that the embassies could be quarantined in the event of an attack, if the bombs could be detected. The Tactical Mobile Robot (TMR) project team was tasked to develop a robot that could conduct reconnaissance of a building and identify any 0-7803-7961-6/03/$17.00 © 2003 IEEE November 5-8, 2003, Boulder, CO 33 rd ASEE/IEEE Frontiers in Education Conference S1D-28