Gas station without pumps

2016 August 12

Playing with Nao humanoid robot

Filed under: Robotics — gasstationwithoutpumps @ 11:09
Tags: , , , ,

Yesterday I had an opportunity to play with a Nao robot in a three-hour workshop at UCSC, run by Dr. Denise Szecsei of the University of Iowa. I found out about the workshops through an article in Santa Cruz Tech Beat, an on-line publication about local tech events. (Santa Cruz Tech Beat is worth reading, with a high signal-to-noise ratio and only about 30 articles a month.)

The basic idea that Denise was pushing is the use of the Nao robots in introductory programming courses—she created a course at the University of Iowa called Dancing Robots that supposedly been successful in recruiting women into programming courses there (she did not give us detailed information, as the focus of the workshop was on getting us to experience programming the robots, not on academic justification). She was also looking for collaborators on either educational projects or art projects, so was glad to have some grad students from the Digital Arts and New Media project at the workshop.

You can see an example of the results of the dancing robots courses on YouTube:

I’ve always thought that the Nao robots were cute, but at $9000 from the US distributor RobotsLab (and $890/year for warranty), they are too expensive for me to buy as a toy.  So I welcomed the chance to play with one for 3 hours.

What the workshop was intended to be was a brief tutorial on Choreographe, the drag-and-drop scripting environment for the robots. That environment looks ok to use, with simple message passing along wires to trigger pre-written boxes for actions like “say” or “timeline” animation.  Most of the dancing work is done by using the timeline like stop-frame animation (at 25 “frames” per second), with the software interpolating between target poses.  The target poses are created by physically manipulating the robot, making the whole process accessible to 6th graders (though the fragility and cost of the robots makes me think that you would need careful supervision even for high-school and college students).

I was not interested in the dance aspects of the robots, so I worked with one of the workshop staff (Denise’s son) on diving into the Python SDK (there are also C++, Java, and JavaScript interfaces, but the Python one is best integrated with Choreographe and the best for rapid prototyping, which is all I had time for). I spent a little time the night before the workshop looking at the programming interface (which I did not really understand from the quick glances at the documentation) and at the capabilities of the robot in terms of sensors and actuators.

What I wanted to do was to program one action—shifting the weight of the robot onto one leg, then picking up the other leg, so that the robot stood on one foot.  I planned to do the weight shifting by coordinated motion of the hip roll and ankle roll actuators.  Initially, I had thought to do it on just one leg, but I ended up doing it on both legs, since the starting position had the feet approximately the hip distance apart, so rotating both hip-roll actuators one way and both ankle-roll actuators the other way results in a parallelogram linkage, with the hips and torso staying level while moving sideways.

To detect the weight shift, I used the force resistors in the foot.  There are several ways to access them through getData() calls: the processed “leftFootTotalWeight” and “Device/SubDeviceList/LFoot/FSR/TotalWeight/Sensor/Value”  or the raw sensor values “Device/SubDeviceList/LFoot/FSR/FrontLeft/Sensor/Value”, … .  I ended up using “leftFootTotalWeight” or “rightFootTotalWeight”.  The basic idea was to start a thread running moving the hips far to the left, and set up an interrupt routine triggered by the event footContactChanged. When that event fired, I checked the weight on the right foot, and stopped the motion if the weight was low enough (I think I used 300g, since the unloaded force resistor with the foot in the air was reporting something like 200g).

I did not have time to add a further refinement to the weight shift, to adjust the weight to be centered over the supporting foot, using the center of pressure sensor. I had the robot speak the values of that sensor, but did not use it to tweak the hip and ankle angles of the supporting leg.

Once the weight had been shifted on the left leg, I had Nao pick up the right leg by adjusting the hip pitch, knee pitch, and ankle pitch of that leg.  The posing software in Choreographe made it fairly easy to figure out what the correct signs were for the angles and for picking target values. The robot lurched a little bit as the right foot was picked up, probably because the foot had not been fully unweighted, but possibly because of the foot not being lifted quite vertically.

If I’d had more time, I would have done the centering of the weight over the supporting leg before lifting the other foot. I would also have moved the motion of the supporting foot into a separate script, so that different gestures could be made from the one-legged stance. In doing that, I’d probably want to have any one-legged boxes run a balancing thread to keep the weight centered over the supporting foot, so that sticking out an arm or a leg doesn’t topple the robot. Either that, or have a one-legged balance box that is runs in parallel with any gesture actions.  It would probably take me a day or two of programming to create one-legged action boxes robust enough for someone else to use them, and probably a few weeks of use testing before they would be worth adding to Choreographe.

Working with the robots definitely needs two people, as one person needs to spot the robot any time it is moving (remember, fragile and expensive!).

It was very useful working with someone familiar with part of the programming interface, so that I did not have to waste much time figuring out how to create a new box or test it out. He was the one who suggested outputting a string to pass into a “say” box for reporting the foot sensor values for debugging, for example. I started out just reading the sensors and reporting the weight, then tried figuring out how to interrupt an ongoing motion by raising one arm very slowly, to be interrupted by any of the touch sensors. Once I had the basics of starting a parallel thread and stopping it on an interrupt, I programmed the weight shift. Once that was working I added lifting and lowering the non-supporting leg.

I fully expected that the spotter would be called on to catch the robot as it fell during my development of the program, but despite a little worrisome lurching as the unweighted foot was lifted, the robot never toppled.

I doubt that the Python SDK is fast enough to do a closed-loop feedback system for balance, but it was certainly good enough for a slow weight shift onto a single leg, and the feet are wide enough that no dynamic balancing was needed. It would be a fun programming environment for a Python course, as long as the students were into humanoid robotics.

The Choreographe environment provides a reasonable interface for fairly simple sequencing and synchronization, but I suspect one hits its limits pretty soon. Being able to create new blocks rapidly, by copying existing blocks and editing the Python in them, makes the system a lot more powerful, though I got the impression that the “Dancing Robots” courses rarely get that far.

The Nao robots were, as I expected, a lot of fun, but I couldn’t really recommend them for a beginning programming class. At $9000 for each pair of students, they are way too expensive and way too fragile.  For beginning programmers, you really want things that students don’t have to worry about breaking if they make a little mistake. One can get fun robot toys for students to program for $100 each, since wheeled robots are much cheaper and easier to make than humanoid ones. Not only is the financial risk lower with cheap robots, but they can be made much more robust (though educational robots needn’t be made to sturdiness required of combat bots).

To break into the consumer market or school market, I think that Nao would have to come down in price by about a factor of 10, which would be difficult to manage, given what the robots contain.  There are 24 actuators (2 head, 6 in each arm, 6 in each leg), plus cameras, ultrasonic range finder, touch sensors, foot pressure sensors (4 per foot), gyroscope, accelerometer, LEDs, … . The motors and 12-bit joint angle sensors (magnetic rotary encoders) alone probably cost close to $1000.

 

2016 July 8

Flipped Learning

Filed under: Circuits course — gasstationwithoutpumps @ 23:39
Tags: , , , ,

In A call for flipped learning experiences – Casting Out Nines, Robert Talbert has asked for help finding examples of flipped learning outside math and statistics:

Flipped Learning is a pedagogical approach in which first contact with new concepts moves from the group learning space to the individual learning space in the form of structured activity, and the resulting group space is transformed into a dynamic, interactive learning environment where the educator guides students as they apply concepts and engage creatively in the subject matter.

If you teach a face-to-face in-seat class (not online) then “group space” = “in class” and “individual space” = “outside of class”. (This definition is a recent modification of mine, based on the one at FlippedLearning.org and I may have more to say about it in another post.)

What I’d like to hear from you, is

  • The reasons why you chose to use flipped learning in your class;
  • What students in your class do during the “group space” and the “individual space”; and
  • Any evidence of effectiveness of flipped learning you may have, including anecdotal (student comments, etc.)

Also: I especially would like to hear from people not in mathematics or statistics. Back in November I tweeted out a request very similar to this and got several responses, only one of which was from someone outside of math or statistics. I know that flipped learning is used in a variety of disciplines and I want to showcase that variety as much as I can.

I have not done a lot of “flipped learning” in the most commonly used sense of preparing video lectures that students watch on their own. I did add one video (voiced and acted by my son) on using oscilloscopes to the Applied Electronics course this spring, but that isn’t really “flipped learning”, because the intent is not for the students to watch the video before class, but to watch it in the lab and step through the process of setting up the oscilloscope while running the video.

In general, I don’t find videos a good way to help students learn new concepts—they are too slow and too passive, even worse than lectures, where students can at least ask questions.  Videos are useful for certain limited tasks (such as demonstrating how to use a tool, as long as students can follow along and use the tool at the same time), and I do plan to make a few more this summer for training students in using other lab tools (different model of oscilloscope, function generators, power supplies, multimeters, maybe calipers and micrometers).  The key here is that the students are expected to use the tool as they watch the video—the video is a substitute for me standing beside them guiding them (which is still a better approach, but is hard to scale up—a 13-minute video for setting up the oscilloscope would take me 2.6 hours to do with a class of 24 students, working with a pair of students at a time—with 66 students, it would take over 14 hours of my time).

I do use “flipped learning” in my classes is in a more old-school way: I require students to read the textbook, and often even do homework before I lecture on the subject in class.  (See, for example, my early blog post on live-action math.)

My value as a teacher is enhanced if the students have made some attempt to understand the material before class, so that their questions can be more focussed on the things that confused them. I can then spend time in class on the boundary between what they understand and what they don’t understand, maximizing the learning, rather than on covering stuff that they could have learned in the same amount of time on their own, or on stuff that they don’t understand even after my explanation.  (When students don’t ask enough questions in class, I tend to err on the side of giving them stuff beyond what they understand, rather than re-iterating basics, so questions are super-important to keeping my lectures at the right level.)

To use a textbook for “flipped learning”, it needs to be very well matched to the course—either the course is designed around the book, or the book is designed around the course.  For my applied electronics course, I wanted the course to center around the labs, which need to be carefully ordered to build up design and debugging skills, so I ended up writing my own book.

Students are motivated to read the book, because each chapter provides just-in-time material they need to solve the design problems they are facing in the lab.  Students need to learn something new for each lab, adding it to the material they have already learned.  The old material is used over and over, so that students aren’t tempted into cram-and-forget learning.

Requiring students to read how to do something and work problems on the new concepts before being given a carefully worked example helps them learn how to learn from written references—a skill that all engineers need to develop, but that students often have not developed (particularly not in lower-division biology, chemistry, and physics courses, which tend to spoon-feed them just what they need for the problem at hand, encouraging cram-and-forget strategies) .

Getting explanations and corrections after students have struggled with a new concept helps the explanation sink in—they aren’t just memorizing a meaningless series of steps, but seeing how to get around barriers that they’ve been struggling to bypass. Having to demonstrate a working design and write a design report on it further deepens the learning.  Students have to not only learn the material, but use it and explain how they have used it.

So the electronics course uses some flipped learning, but it would probably work just about as well with no flipped learning.  The key to the course is having design tasks that students are motivated to complete, and that require them to use, demonstrate, and describe the concepts they are learning, and using the same set of concepts over and over in different concepts, until they seem second nature. Having students struggle with some material on their own before lecture makes the lecture time a bit more efficient, but the effect is probably pretty small.

2016 June 11

Teaching writing lab reports

Filed under: Circuits course — gasstationwithoutpumps @ 09:24
Tags: , , ,

Greg Jacobs, in his post Jacobs Physics: Report from the AP reading: Teach your class to write concise laboratory procedures. Please., asks high-school physics teachers to teach students how to write concisely:

Part (a) of our question asks for a description of a laboratory procedure. It could be answered in 20 words: “Use a meterstick to measure the height of a dropped ball before and after it bounces. Repeat for multiple heights.

“But oh, no … when America’s physics students are asked to describe a procedure, they go all Better Homes and Gardens Cookery Manual on us. Folks, it’s not necessary to tell me to gather the materials, nor to remind me to first obtain a ball and a wall to throw it against. Nor do you have to tell me that I’m going to record all data in a lab notebook, nor that I’m going to do anything carefully or exactly. Just get to the point—what should I measure, and how should I measure it.

Please don’t underestimate the emotional impact on the exam reader of being confronted with a wall of text. We have to grade over a hundred thousand exams. When we turn the page and see dense writing through which we have to wade to find the important bits that earn points, we figuratively—sometimes literally, especially near 5:00 PM—hit ourselves in the forehead. Now, we’re professionals, and I know that we all take pride in grading each exam appropriately to the rubric. Nevertheless, don’t you think it’s worth making things easy for us, when we be nearing brain fatigue? Just as good businesspeople make it easy for customers to give them money, a good physics student makes it easy for the grader to award points. 

Don’t think I’m making fun of or whining about students here. Writing a wall of text where a couple of sentences would suffice is a learned behavior. The students taking the AP exam are merely writing the same kinds of procedures that they’ve been writing in their own physics classes. It is thus our collective responsibility as physics teachers to teach conciseness.

As I’ve been spending far too much time this week grading an 11-cm-thick stack of design reports from my applied electronics course, I have considerable sympathy with Greg Jacobs’s view.

Technical writing is all about the 4 Cs: clear, correct, concise, and complete. Although there is always some tension between clarity and correctness, and between completeness and being concise, I generally find pretty high correlations between the four properties. Often, the very long reports are muddled, incomprehensible bundles of improperly applied factoids, while the essential information is missing entirely.

Part of the reason I have such a huge stack of papers to grade at the end of the quarter is that I have been giving “redo” grades for any errors in non-redundant representations (like schematic diagrams), putting a very high premium on correctness. For the class-D amplifier lab, 80% of the class had to redo the reports, mostly because they had not gotten the orientation of the FET transistors right in the schematics (a serious error that could lead to fires in the amplifier). I must have done a worse job at explaining the FET symbols—several times—than I thought, or maybe it is one of those things that people don’t learn unless they make a mistake and have it pointed out to them, repeatedly. I’ll be trying to fix the book and the lectures next year to reduce this problem.

I’ve also been down-grading students for lack of clarity (especially when the writing seems to indicate a lack of understanding, and not just inability to communicate) and for leaving out essential material (like not providing the schematics for their preamplifier as part of their amplifier lab report, not providing the parameters of the models they fit, or not providing the models they used at all). So clarity and completeness have had a fairly big impact on grades.

But I have not been giving bonus points for being concise, which I probably should start doing, as some students have started using a kitchen-sink approach, throwing in anything that might be tangentially related to the subject. Unfortunately, these are the students most likely to have unclear and incorrect reports, and they leave out the essential material in an attempt to throw in useless background, so their attempts at completeness generally backfire. I need to discourage this behavior, undoubtedly learned in middle school and high school, and get them to focus on the stuff that is unique to their design, rather than telling me Ohm’s Law or the voltage-divider formula over and over.

2016 May 16

DASL Updated

Filed under: Uncategorized — gasstationwithoutpumps @ 08:25
Tags: ,

Tim Erickson, a statistics teacher, announced in his blog, A Best-Case Scenario DASL Updated. Mostly improved.

The Data and Story Library, originally hosted at Carnegie-Mellon, was a great resource for data for many years. But it was unsupported, and was getting a bit long in the tooth. The good people at Data Desk have refurbished it and made it available again.

Here is the link. If you teach stats, make a bookmark:  http://dasl.datadesk.com/

It looks like there are a number of good small data sets there, suitable for toy problems in statistics classes.

2016 April 10

Transfer of learning

Filed under: Circuits course — gasstationwithoutpumps @ 09:58
Tags: , , , , ,
In a recent e-mail list discussion, being a math major was justified by the transferability of problem-solving skills from one domain (math) to others (banking, sales, and other jobs).  This justification for studying math is a popular one with mathematicians and math teachers.  One of the primary justifications for requiring geometry, for example, is that it teaches students how to prove things rigorously.​  The same case for transferable problem solving can be (and has been) made, perhaps even more strongly, for computer science and for engineering fields that do a lot of design work.
I was a math major (through and MS) and I got my PhD in computer science, and I certainly believed that the constant practice at problem solving made me better at solving certain classes of problems—ones with clear rules, not social problems or biological ones.
Education researchers have tried to measure this transfer effect, but so far have come up empty, with almost no indication of transfer except between very, very close domains.  I don’t know whether the problem is with the measurement techniques that the education researchers use, or whether (as they claim) transferability is mainly an illusion.  Perhaps it is just because I’m good at problem solving of a certain sort that I went into math and computer science, and that the learning I did there had no effect on my problem-solving skill, other than tuning it to particular domains (that is, perhaps the transferable skill was innate, at the learning reduced transfer, by focusing the skills in a specialized domain).
Two of the popular memes of education researchers, “transferability is an illusion” and “the growth mindset”, are almost in direct opposition, and I don’t know how to reconcile them.
One possibility is that few students actually attempt to learn the general problem-solving skills that math, CS, and engineering design are rich domains for.  Most are content to learn one tiny skill at a time, in complete isolation from other skills and ideas. Students who are particularly good at memory work often choose this route, memorizing pages of trigonometric identities, for example, rather than learning how to derive them at need from a few basics. If students don’t make an attempt to learn transferable skills, then they probably won’t.  This is roughly equivalent to claiming that most students have a fixed mindset with respect to transferable skills, and suggests that transferability is possible, even if it is not currently being learned.
Teaching and testing techniques are often designed to foster an isolation of ideas, focusing on one idea at a time to reduce student confusion. Unfortunately, transferable learning comes not from practice of ideas in isolation, but from learning to retrieve and combine ideas—from doing multi-step problems that are not scaffolded by the teacher.
“Scaffolding” is the process of providing the outline of a multi-step solution, on which students fill in the details—the theory is that showing them the big picture helps them find out how to do multi-step solutions themselves.  The big problem with this approach is that students can provide what looks like excellent work, without ever having done anything other than single-step work.  De-scaffolding is essential, so that students have to do multi-step work themselves, but often gets omitted (either by the teacher, or by students cheating a little on the assignments that remove the scaffolding and getting “hints”).
I find myself gradually increasing the scaffolding of the material in my textbook, so that a greater proportion of the students can do the work, but I worry that in doing so I’m not really helping them learn—just providing a crutch that keeps them from learning what I really want them to learn.  I don’t think I’ve gone too far in that direction yet, but it is a constant risk.
I’ve already seen students copying material from this blog as an “answer” to one of the problems, without understanding what they are doing—not being able to identify what the variables mean, for example. (I used different notation in class than I used in the corresponding blog post—a trivial change in the name of one variable.)  I’m trying to wean students off of “answer-getting” to finding methods of solution—the entire process of breaking problems into subproblems, defining the interfaces between subproblems, and solving the subproblems while respecting the interfaces.
I do require that the students put together a description of the entire solution to their main assignments—a design report that not only describes the final design, but how the various design decisions were made (what optimizations were done, what constraints dictated what part choices, and so forth).  This synthesis of the multi-step solution at least has the student aware of the scaffold, unlike the fill-in-the-blank sorts of lab report which makes the scaffold as invisible as possible to the student.
I also try very hard for each design problem to have multiple “correct” solutions, though some solutions are aesthetically more appealing than others.  This reduces the focus on “the right answer” and redirects students to finding out how to test their designs and justify their design decisions.
I have been encouraged by signs of problem-solving skills in several students in the course (both this year and in previous classes).  Often it is in areas where I had not set up the problem for the students.  One year, a student came up with a good method for keeping his resistor assortment organized and quickly accessible, for example.  This year, one pair of students used their wire strippers and blue tape as an impromptu lab stand for their thermometer and thermistor, to save the trouble of holding them.
The problems students set themselves often lead to more creative solutions than the ones set for the class as a whole—but how do you set up situations in which students are routinely identifying and solving problems that no one has presented to them?  I believe that the students who identify problems that no one has pointed out to them are the ones who become good engineers, but that attempts to teach others to have this skill are doomed by the very attempt to teach.  Capstone engineering classes are one attempt to get students the desired experience, but I think that in many cases they are too little, too late.
Next Page »

Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 351 other followers

%d bloggers like this: