Session F1C Use of in First-Year Math Laboratory

Rod Foist and Grace Ni Dept. of Electrical & , California Baptist University 8432 Magnolia Avenue, Riverside, CA, 92504 [email protected], gni@ calbaptist.edu

Abstract - According to National Science Foundation was to increase student retention, motivation, and success in (NSF) research, engineering mathematics courses with a engineering. The WSU model focuses on a novel first-year laboratory (“hands-on”) component are more effective engineering math course, taught by engineering faculty, in helping students grasp concepts, than lecture-only which includes lecture, lab, and recitation. The course uses approaches. Beginning in 2008, California Baptist an application-oriented, hands-on approach—and only University (CBU) received NSF funding through Wright covers the math topics that students actually use in their State University to develop a first-year Engineering core engineering courses. Klingbeil et al reported in 2013, Math course (EGR 182) with laboratory projects. Our based on careful assessments, that the results have been new College of Engineering currently offers nine degrees encouraging [2]. They also point out that a student’s and all freshmen must take this course. The lab projects success in engineering is strongly linked to his/her success aim to illustrate key mathematic concepts via hands-on in math “and perhaps more importantly, on the ability to experiments representing each discipline. Two new connect the math to the engineering”. That is, to see the projects were introduced during the 2013-2014 school relevance of math to engineering. year. This paper reports on a trigonometry-with- Beginning in 2008, California Baptist University robotics lab. A companion paper describes a calculus- (CBU) received NSF funding through WSU to develop this themed project using electronic filters. The new type of first-year engineering math course (EGR 182) trigonometry lab runs for two lab sessions. In the first and create laboratory projects. Our new College of session, students focus on taking angle-versus-lengths Engineering offers ABET-accredited degrees in Civil, measurements with a sun-dial-like instrument and Mechanical, and Electrical and Computer Engineering, plus calipers. The simple Plexiglas “sun-dial” simulates a six other degrees. All freshmen must take EGR 182. The two-link planar robotic arm. Given an angle, students lab projects aim to illustrate key mathematic concepts via dial it onto the instrument, then measure the x and y hands-on experiments representing each discipline. lengths; or vice versa. They also create MATLAB function and script files to cross-check and validate the HANDS-ON APPROACHES TO measurements. In session two, a computer-controlled The use of hands-on or learn-by-doing approaches is humanoid robot replaces the “sun-dial”. Students type becoming widespread in engineering education. Another in shoulder and elbow joint angles, watch the robot name for this is “problem-based” learning. The STEM Lab move its arm, then hear the robot report verbally the Report states [3]: final location coordinates of its hand. Conversely, robot “Throughout higher education in engineering, colleges are hand coordinates can be typed in to determine the requiring students to pull their gaze from a text-book to resulting joint angles. Also, MATLAB files are edited to perform real-world, hands-on, team-based project learning. create equivalent files tailored to the robot. After In short, they are teaching students to become by running the new lab for two semesters, no statistical data having them work as engineers.” has yet been acquired regarding final grade Furthermore, they claim that research shows that such improvements. However, student feedback indicated a “project-based” learning works at all ages, even as early as high level of popularity with the lab. They felt that it pre-school. As an example of this, Ghalia [4] showed how showed a good real-world application of math concepts even high school geometry students’ outcomes improved by and was a “cool way” to introduce robotics. using hands-on projects to illustrate geometry and its importance to solving real-world problems Index Terms – lab project, mathematics with engineering in radar. Observations in the classroom also indicated applications, robotics, trigonometry greater student interest (i.e., enjoyment). Aloul et al [5] INTRODUCTION stated that first-year engineering courses often use problem- based curriculum to “…ensure that students find relevance The National Science Foundation (NSF) funded an initiative in the Physics and Math courses being taken in the first two at Wright State University (WSU), circa 2004, to “redefine years of engineering.” the way engineering mathematics is taught”[1]. The goal

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-1 Session F1C Drawing from the above references, the key benefits of LAB PROJECT ON APPLICATION OF TRIGONOMETRY IN hands-on approaches for students are better outcomes, ENGINEERING AND ROBOTICS seeing the relevance of math (and engineering) with real- world examples, deeper understanding, more enjoyment, Historically, the trigonometry lab runs for two weeks. and persistence in engineering. Originally (without robots), in the first week, students focused on taking angle-versus-lengths measurements with USING ROBOTICS TO TEACH MATH a sun-dial-like instrument (shown in Figure 1) and calipers.

Using robots to teach programming and math concepts is not new [6]. Over 40 years ago, MIT educator Seymour Papert used his “turtle robots” to teach programming. More recently, educational researchers at Carnegie Mellon’s Robotics Academy have used robots to teach science, technology, engineering, and mathematics (STEM) education, with a focus on math [7]. The academy’s mission is to help teachers excite their students about math and science [8]. Educational resource companies are also turning to robotics to teach math. The “RobotsLAB BOX” is an award-winning teaching aid that uses a set of robots to teach math and includes 50 specific math lessons [9]. FIGURE 1 The current paper’s contribution is to provide a complete lab THE SUN-DIAL LIKE INSTRUMENT. project that includes the use of a humanoid robot’s arm motions as a simple, fun, and enlightening real-world The simple, Plexiglas “sun-dial” simulates a two-link application of trigonometry. A computer interface program planar robotic arm (Figure 2). Given an angle, students dial for controlling the robot (described below) was developed to it onto the instrument, then measure the x and y lengths; or enable this activity. vice versa. In addition, they began to create MATLAB function and script files to cross-check and validate the EGR182 – INTRODUCTORY MATHEMATICS FOR measurements. The second week focused on finishing the ENGINEERING APPLICATIONS MATLAB work, and repeating any measurements, if necessary. Finally, students must write a carefully- CBU’s EGR 182 is a 4-credit course. Based on the WSU formatted lab report. model [1], it has a lecture and lab, but no recitation component. However, tutorial sessions are provided twice weekly throughout the semester. As in the WSU course, the lecture addresses only the “salient math topics” which are needed in the core engineering courses—such as trigonometry, vectors and complex numbers, systems of equations and matrices, and calculus. We use the textbook developed by the WSU authors [10]. The weekly lab session meets for 90 minutes and provides hands-on lab projects that illustrate selected math topics from the lecture material. Students work in teams of FIGURE 2 two to perform the lab experiments and write a carefully POLAR-RECTANGULAR COORDINATES FOR SIMPLIFIED TWO-LINK PLANAR formatted report. A substantial part of the lab grade is based ROBOTIC “ARM”. on the written report, since we believe that good writing is In the new lab, week one is much the same, but with important in an engineering career. A nearly-complete fewer measurements (and fewer MATLAB files required). sample lab report is provided for the first lab report, to serve However, in the second week, a humanoid robot, called as a guide to proper writing. In lab one, the MATLAB “NAO”, replaces the “sun-dial”. The robots were purchased software tool is introduced, and this tool is woven into with a grant provided by the W. M. Keck Foundation. A nearly all of the other labs during the semester. user-friendly computer interface was developed (see below) Two new projects were introduced during the 2013- so that during the lab, students type in shoulder and elbow 2014 school year. This paper reports on a trigonometry- joint angles, watch the robot move its arm accordingly, then with-robotics lab (an upgrade to an existing lab). A hear the robot report verbally the final location coordinates companion paper describes a calculus-themed project using of its hand. Students can also specify the coordinates of the electronic filters. robot hand, watch the robot move its arm, and hear the corresponding joint angles reported by the robot. In addition, students edit their MATLAB files to create

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-2 Session F1C equivalent files tailored to the robot (which includes real- world elbow offsets not found in the “sun-dial”). Very little programming or knowledge of the robot is required, but a pre-lab assignment requires students to watch a short introductory video, read the lab assignment, and take a short on-line quiz. The key trigonometric equations from week 1 (for sun- dial), which are used or modified in week 2 (for robot), are given below (defined in Figure 2):

FIGURE 3 x = x1 + x2 (1) HUMANOID ROBOT NAO - T14 MODEL. y = y1 + y2 (2) x1 = l1 cos θ1 . (3) This lab project was focused on the forward and inverse y1 = l1 sin θ1 . (4) kinematics of NAO’s left arm, with 2 DOF for the shoulder, x2 = l2 cos (θ1 + θ2) (5) 2DOF for the elbow and 1 DOF for the wrist, namely y2 = l2 sin (θ1 + θ2) . (6) LShoulderPitch (up/down), LShoulderRoll (left/right), LElbowYaw (in/out), LElbowRoll (left/right), and DEVELOPMENT OF THE ROBOTICS EXPERIMENTS LWristYaw (in/out). In order to resemble the configuration While the idea of using a humanoid robot to familiarize of the “sun-dial”, we set the LShoulderPitch, LElbowYaw freshmen with trigonometry concepts sounds appealing, we and LWristYaw angles to zeros, and only allowed the faced a few challenges in the implementation of this idea. LShoulderRoll and LElbowRoll angles to be varied, so that First of all, when this lab was delivered, some freshmen just the left arm motion was constrained in a 2D plane located at completed an introduction to computer programing course the same height as the center of shoulder. Figure 4 shows in the previous semester, and some just started taking the the overhead view of the NAO left arm. The valid ranges for programming course. In order to focus the lab exploration the LShoulderRoll and LElbowRoll angles are also on applying concepts of trigonometry to robot kinematics, specified. we had to minimize the students’ effort on programming the robot. Secondly, we had two models of the NAO humanoid robot that can be used for this lab, one with 25 Degrees of Freedom (DOF) and the other one with 14 DOF. Comparing to the sun-dial-like instrument used in the first week of this lab project, the robot could appear overwhelmingly complex to the students. In order to make the transition smooth, we had to set up the robot in similar configuration as the “sun- dial”. In addition, being a humanoid robot, NAO has physical constraints that cause difficulties in its kinematic analysis with standard trigonometric formulas. However, the student should still be able to verify their experimental FIGURE 4 results with the mathematical calculations they performed OVERHEAD VIEW OF NAO’S LEFT ARM WITH VALID RANGES FOR using MATLAB. These challenges are addressed by our LSHOULDERROLL AND LELBOWROLL ANGLES. user interface design and experimental setup. Although a complete solution for robot kinematics I. Robot Configuration includes both position and orientation, in order to make the We mainly used the NAO robot T14 models for this lab problem simple enough for freshmen, we only required project. The T14 model has 14 DOF including 2 for the students to work on the position of the end effector, which is head, 5 for each arm and 1 (open/close) for each hand, as the center of NAO’s left hand. Hence, the forward shown in Figure 3 [11]. The other model with 25 DOF was kinematics problem in this lab project is to determine the used only for one station or as backup. position of the center of NAO’s left hand given the LShoulderRoll and LElbowRoll angles, while the inverse kinematics problem is to determine the corresponding angles given the position coordinates of the center of left hand. Figure 5 illustrates the x, y coordinates of the center of left hand in the shoulder frame.

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-3 Session F1C Elbow angle roll and elbow roll joints to (slider bars†) given angles LArmGetJoint Use shoulder NAO retrieves sensor frame or torso measurements of joint angles, frame as reference and reports shoulder roll and (check boxes) elbow roll angles to user LArmSetCartesian x, y coordinates of NAO moves its left arm such left hand center that the center of its left hand (slider bars) will be at the given coordinates LArmGetCartesian Use shoulder NAO retrieves current hand frame or torso position calculated by the API FIGURE 5 frame as reference functions based on sensor THE X, Y COORDINATES OF CENTER OF LEFT HAND IN SHOULDER FRAME. (check boxes) measurements, and reports it to user We had 9 stations set up in the laboratory, each with a † The valid ranges shown in Figure 4 were used to specify the minimum NAO robot connected to a computer through WiFi. Since and maximum values of the slider bars. the 9 robots were connected via the same wireless router and could be seen by any computer in the room, we put As shown in Figure 6, the Boxes LArmSetJoint and labels (e.g. “NAOT14A”, “NAOT14B”, etc.) on the robots LArmGetCartesian are connected with other Boxes provided by the Choregraphe libraries to form the Flow and the matching computers, and instructed students to Diagram for the forward kinematics experiment. By using select the robot that belonged to their own station. the “Set Stiffness” Box, we enable the motors in the II. User Interface Design beginning of the experiment and disable them in the end. The Box “Zero” makes the NAO robot position itself to zero The user interface was designed using the NAOqi API and configuration with all the joint angles automatically set to the software called Choregraphe [11]. Both were provided zeros. We inserted a “Wait” Box with 10 seconds delay to by Aldebaran Robotics with the purchase of NAO robots. ensure that the NAO robot has plenty of time to move its Choregraphe has a user-friendly graphical interface left arm joints to desired angles before the sensor which allows a user to pick functional blocks called measurements are retrieved. “Boxes” and place them in a Flow Diagram. Behaviors such The Flow Diagram for the inverse kinematics as listen, talk, move, walk, etc. can be composed with experiment is similar to the one for forward kinematics, but proper selection of Boxes and wiring them accordingly. The with the Boxes LArmSetJoint and LArmGetCartesian programs in Flow Diagram format can be directly sent to the replaced by Boxes LArmSetCartesian and LArmGetJoint. NAO robot via WiFi. Figure 6 shows the Flow Diagram we Thus students can specify the x, y coordinates of NAO’s left developed for the forward kinematics experiment. hand center, and NAO will move its left arm accordingly

and report to user the shoulder roll and elbow roll joint angles. Another feature in Choregraphe called “Robot view” is that it displays a simulated version of the NAO robot reflecting the same motion it undergoes and also displays the text of what NAO says. This feature makes it easier for the students to record data during the experiments by not only listening but also seeing the data displayed on the

FIGURE 6 screen. Figure 7 shows a screenshot of the “Robot view” FLOW DIAGRAM IN CHOREGRAPHE FOR FORWARD KINEMATICS. when the NAO robot is reporting its joint angles to the user.

Boxes for Choregraphe programming are grouped in libraries such as “Audio”, “Motions”, “Sensing”, “Vision”, etc. However, there were no existing Boxes that could provide the behaviors we needed for this lab. Choregraphe allows users to create their own Boxes by specifying inputs, outputs, parameters and writing Python scripts that control detailed behaviors. Therefore, we developed a small library with four Boxes: LArmSetJoint, LArmGetJoint, LArmSetCartesian, and LArmGetCartesian. The descriptions of these four Boxes are listed in Table I.

TABLE I

DESCRIPTIONS OF BOXES FIGURE 7 Box Name Parameters Behavior ROBOT VIEW. LArmSetJoint Shoulder angle, NAO moves its left shoulder

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-4 Session F1C DELIVERY OF THE ROBOTICS EXPERIMENTS I. Pre-lab Preparation To help students get prepared before they came to the lab, we videotaped a demonstration that shows how to turn on the robot, connect it to the computer wirelessly, open the software and run the program, perform the experiments and record data, etc. We required each student to watch the video demonstration and then complete a short multiple- choice quiz as a pre-lab assignment. The quiz counts toward 5% of their grades for this lab project.

II. Experiments FIGURE 8 OVERHEAD VIEW OF NAO’S LEFT ARM IN “ELBOW UP” CONFIGURATION. Students were required to complete experiments for the forward kinematics and inverse kinematics respectively. For Students were instructed to record the values obtained forward kinematics, they were given six sets of shoulder roll in MATLAB as x′ and y′ in the table and there were two and elbow roll angles in degrees. After entering each set of more columns in the table for x and y. The reason for doing angle values as parameters for the Box LArmSetJoint in this is that there is an offset in the elbow joint of the NAO Choregraphe, students ran the Flow Diagram and observed robot which causes discrepancy between the measured x, y the NAO robot moving its left arm corresponding to the coordinates of the hand center and the x′, y′ values obtained angle values. They recorded the x, y coordinates of NAO’s in MATLAB. The offset is illustrated in Figure 9. left hand center by either listening to NAO or reading from the Robot view. For inverse kinematics, students were given five sets of x, y coordinates in millimeters. After entering each set of coordinates as parameters for the Box LArmSetCartesian in Choregraphe, students ran the Flow Diagram and observed the NAO robot moving its left arm corresponding to the coordinates of its hand. They recorded the shoulder and elbow angles reported by NAO as well. All the measurements were tabulated (one table for forward kinematics and another one for inverse kinematics), and values calculated using MATLAB based on trigonometric equations were also listed in the same tables for comparison. FIGURE 9 III. Validation of Experimental Results using MATLAB ILLUSTRATION OF ELBOW OFFSET COMPENSATION.

Similar to the first week of the lab project, students In order to compensate for the discrepancy, we gave computed theoretical values using MATLAB to validate students the following two equations to be added to their their experimental results. Trigonometric equations were MATLAB files. given in the lab manual. Students first applied the same equations as Eqn. (1)-(6) for forward kinematics, but instead ′ x = x - ElbowOffsetY × sin θ1 . (7) of the length measures of the “sun-dial”, the values of l and ′ 1 y = y + ElbowOffsetY × cos θ1 . (8) l2 were given as the NAO robot upper arm length and lower arm length plus the distance from wrist to the center of hand After the compensation, students obtained results as respectively. Another difference is that the elbow angle is calculated x, y values, which are much closer to the always negative because NAO’s left arm is always in the measured x, y values, as compared to the uncompensated “elbow up” configuration as shown in Figure 8, with θ1 values x′ and y′. being the shoulder angle and θ2 being the elbow angle. For inverse kinematics, we gave students the following equations according to the Law of Cosines and Law of Sines, and asked them to implement the equations in MATLAB as if the x′ and y′ values are available. Figure 10 shows the variables used in the equations.

r  (x')2  (y')2 (9)  l 2  l 2  r 2  o  1 2  (10) 2  180  arccos   2l1l2 

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-5 Session F1C  l sin(180o  )  teaching and use of MATLAB—scripts, functions, and   arcsin 2 2  (11)  r  trigonometric calculations.   The humanoid robots are expensive, but our impression  y'    arctan  (12) is that they are powerfully effective in helping students  x'  connect math and engineering to the real-world. One student, after being exposed to the robots, has already 1    (13) become our “student outreach assistant”—and NAO robot “expert”—in sharing CBU’s engineering program with local high schools. After running the new version of the lab for two semesters (approx. 135 students), no statistical data has yet been acquired regarding final grade improvements. However, an informal written survey about the lab component included the question: “How did you feel about the Robotics Lab?” Student responses reveal a high level of popularity with it. They felt that this lab showed a good real-world application of math concepts and it was a “cool way” to introduce robotics. Negative comments were FIGURE 10 mainly tied to some robot malfunctions and difficulties of ILLUSTRATION OF INVERSE KINEMATICS CALCULATION. the MATLAB work—problems which we are addressing.

However, the parameters specified in the inverse ACKNOWLEDGMENTS kinematics experiment are x and y. x′ and y ′ are not available and cannot be calculated from Equations (7) and We would like to acknowledge the W. M. Keck foundation for awarding California Baptist University the engineering (8) because θ1 is unknown. In order to compensate for the elbow offset, we provided students a MATLAB file that equipment grant of $250,000, part of which was spent on performs the following iterative process: the purchase of our NAO robots. We also acknowledge the National Science Foundation for funding that enabled the Step 1: Set initial value of θ1 to zero degrees. creation of our EGR 182 course and this new lab project. Step 2: Calculate x′ and y ′ from Equations (7) and (8) for Additionally, we are grateful to Wright State University for given x and y values. their leadership and collaboration in developing this type of Step 3: Calculate θ1 and θ2 from Equations (9) through (13). course. Step 4: Go back to Step 2 using the new θ1 value. Stop the process when the difference of current value and the value REFERENCES from previous iteration for θ1 is below or at 0.5 degrees. [1] Klingbeil, N.W., Mercer, R.E., Rattan, K.S., Raymer, M.L. and Reynolds, D.B., "Rethinking Engineering Mathematics Education: A Students integrated their MATLAB file for Equations Model for Increased Retention, Motivation and Success in Engineering," Proceedings 2004 ASEE Annual Conference & (9)-(13) into the iterative process described above and Exposition, June 2004. obtained more accurate results for the joint angles. [2] Klingbeil, N. and Bourne, T., "A National Model for Engineering DISCUSSION AND CONCLUSION Mathematics Education: Longitudinal Impact at Wright State University", Proceedings 2013 ASEE Annual Conference & This paper provides a complete lab project that includes the Exposition, June 2013. use of a humanoid robot’s arm motions as a simple, fun, and [3] Author not given, "Engineering and Hands-On Learning: Examining enlightening real-world application of trigonometry. the Importance of Project-Based Learning in STEM Fields ", The We found that using a two-session format—“sun-dial” STEM Lab Report, Vol. 7, April 2011, http://ocstem.org/NewsletterUpload/April2011.pdf, accessed May 21, instrument in week one, robot in week two—seems 2014. effective. Although the sun-dial is a simple instrument [4] Ghalia, M. B., “Integration of Sensors and Electrical Engineering into (made in-house by a technician), it literally is a hands-on Secondary Geometry Curriculum”, Proceedings 2013 IEEE Frontiers way of illustrating such basic trigonometric concepts as in Education Conference, pp. 1771 – 1775. polar-to-rectangular and rectangular-to-polar concepts. We [5] Aloul, F., Zualkernan, I., El-Hag, A., Husseini, G., Al-Assaf, Y., “A observe student enjoyment in making the measurements (as Case Study of a College Wide First Year Undergraduate Engineering a team) and sense there is deeper understanding of Course”, IEEE Global Engineering Education Conference trigonometry as a result. Then, in the second week, using (EDUCON) – "Learning Environments and Ecosystems in the robots (to replace the simple instrument with the robotic Engineering Education”, 2011, pp. 179-184 arm movement) really seems to bring home the value and [6] Guizzo, E., "These Robots Will Teach Kids Programming Skills", understanding of how trigonometry is used in real IEEE Spectrum, Posted on-line 30 Oct 2013, http://spectrum.ieee.org/automaton/robotics/home-robots/play-i-bo- engineering and math. The lab project also facilitates the yana-robots, accessed May 23, 2014.

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-6 Session F1C [7] Silk, E.M., Higashi, R., Shoop, R., and Schunn, C.D., "Designing Technology Activities that Teach Mathematics", THE TECHNOLOGY TEACHER, December/January 2010, pp. 21-27. [8] Robotics Academy website, http://www.education.rec.ri.cmu.edu/content/educators/start/index.ht m,accessed May 23, 2014. [9] RoboticsLAB website, http://www.robotslab.com/Robots/Family/BOX#gsc.tab=0, accessed May 23, 2014. [10] Rattan, K.S. and Klingbeil, N.W., Introductory Mathematics for Engineering Applications, 1st Edition, John Wiley & Sons, 2014. [11] Aldebaran Robotics, "NAO Software 1.14.3 Documentation”.

AUTHOR INFORMATION Rod Foist Associate Professor of Electrical and Computer Engineering, Gordon & Jill Bourns College of Engineering, California Baptist University, [email protected]

Grace Ni Associate Professor of Electrical and Computer Engineering, Gordon & Jill Bourns College of Engineering, California Baptist University, [email protected]

6th First Year Engineering Experience (FYEE) Conference August 7 – 8, 2014, College Station, TX F1C-7