Friday, December 22, 2017

Success...sort of

Yesterday, we were going to do a robotics demo to a kindergarten class. For a variety of reasons, I ended up doing the demo myself. I had three kindergartners come up to the white board and draw a picture of a robot. They looked similar, boxy bodies, arms with claw hands, random buttons and lights, and maybe an antenna on the head. I asked them if they had ever seen a robot and if they thought robots were real or not. Some said they were not real, while others said they were real. Then I pulled out our team robot that currently looks mostly like a car with a small arm on the front. I told them that robots can be used to cook food, drive cars, get books at the library, vacuum the floor, or just about anything you could imagine.

I wrote two quick programs. The first just made it drive around in a figure 8. I asked what they thought, and they wanted it to do more, so I changed the program to make it have the arm go up and down while it was driving around. They thought that was pretty good, but wanted two arms to alternate up and down, which I told them I could do but would take more work than we had time for at the moment.

Then I showed them another program I wrote, called Feeding the Tiger. Basically it drives forward until they put the little box of food down in front of it, then it grabs the food, makes a growling sound, and then turns around and drives off with it. A few of them got to take turns holding the food out in front of the "tiger" although they had a hard time with it, since they didn't always line up the box very well with the arms.

It was fun, and I'm glad I had just me and the kindergartners. I think it would have been too much to have several of the team in there as well, since they can be out of control at times. Their teacher had to tell them several times to back off, since they would creep closer and closer trying to get a better look. They all want to do another robotics day in the future, so I'll have to think of something else cool to demonstrate for them, hopefully something they can interact with. Maybe I'll do something with colors and the light sensor.

After school, when it was official robotics club time, at the beginning of our sixth meeting, a few of the team asked about the kindergarten thing, but no one seemed very upset that they didn't get to actually do the demo. I told them we would split the group into two teams, and each team was to try to program the robot to follow a line. I used black electrical tape to draw a rectangle on one table and one that looked kind of like a digital sine wave. I let them split up however they wanted.

I should have attached the light sensor myself beforehand. I usually leave the parts box put away in the closet, because if it is out, they just want to build stuff with the Legos instead of working on what we are supposed to be working on. I figured I should let them attach the light sensor, so the parts were out, but as usual, about half the group just started playing with parts. About half of the team did work on getting the light sensor attached and went over to the table with the rectangular box to start working. I went over with the half that were working, and we started trying things out. The thing I'm most concerned with is that they are going to break or lose parts if they are just playing around.

A couple of the team that were paying attention were just lost. They were trying to program something but didn't really know where to start. One team member knew how to read in colors from the light sensor, so he worked on that and eventually was able to get it to start going if it was on the black line, although he didn't get very far with it turning at the corner.

I built a basic switch algorithm that was constantly checking the light level and would make it go straight forward if it registered black and stop if it registered anything else. Once I got that working, I had it turn a little to the left if it was on something other than black. Eventually I had it drift slightly to the right if it was on the black and turn sharply left if it was off the black. Tweaking slightly how much it was turning and driving and how fast, I was eventually able to get it to follow the rectangle. Every once in a while it would get off the tape and would drive in a circle until it found it again and then start following again. It wasn't driving totally smoothly, as it would wobble a bit right and left, but it followed the line pretty well. I think some more tweaks can get it moving better.

The bigger challenge is having it be able to follow the line that curves in both directions. I'm not sure yet how to tell it which way to turn, but I think the general idea is to actually follow the edge of the line instead of the middle of the line, so it will always turn right if it's on the line and left if it's off the line and go straight if it's on the edge of the line, which means it can turn in either direction. Of course, the boys should be coming up with their own algorithm or researching how to do it, but I'm trying to model a bit how to try things out and think through the problem logically. I may recommend they spend some time looking at videos others have uploaded for how to perform basic tasks but not too much that they're just copying what others have done. The problem solving mindset is what they need to develop, so they can start to think critically about designing something to work, rather than not knowing where to start.

No comments: