Week 9 – 2019 – Tamsin

This week at coding I finished my basic line following code and made the robot go over the ramp. At first it was hard and I couldn’t figure out how you could actually do it. So then I asked Sara for help and then it all fell into place.

Here is my code it’s made up of variables and comments for the variables. The variables hold things and the comments remind or tell you what is happening in the code. These will help you along the way. Here is my code.

As you can see I put in some math blocks these are here for making one wheel go backwards and one will go forwards that’s the minus is on the left side on the plus is on the right that goes for both of them except the top one is flipped around the other way .

As you can see this week at coding I made a big difference As you can see I finished my line following code . It was really fun at coding this week because last week we had to build the robot to make it so that it doesn’t go on the ramp wrong so we didn’t have that much time last week and this week we did So yeah I had a lot of fun.

Week 8 – 2019 – James

Hi guys. Today we got a new thing, it’s a ramp! (Thanks to Mrs Bennet for making it). The ramp is used in Robocup Jr.

The ramp has caused problems for almost all of us. (Sara has worked out how to go over the ramp and stop at the silver strip).

Today, I did a bit of duplicating. (I mean duplicating a whole project). I did this because Dad said to me to add comments into my other project. I just made the code a bit different for the turning bit as well. The others used one of the wheels to turn back and another to turn forward. The code for it would be this… It multiplies the turn_speed variable by minus 1 to make one wheel turn backwards instead of just stopping.

The new way of turning.

I’ve done this because my old way of turning wasn’t turning sharp enough. But when I did the new way of turning, it was way better. If the old code for the turning still worked Dad would still probably make me rewrite it to what it is now.

The final thing to talk about is the ramp. My code did not get the robot to go over. It just ran my can finder code. We were going to look at Sara’s code for getting over the ramp but we didn’t have enough time.

Before I go here is the word and quote of the day.

Nixie: A letter or parcel that is undeliverable by the post office because of a faulty or illegible address

I like people who don’t need everyone to like them – Virat Kohli

Bye…

Week 8 – 2019 – Oliver

Our task this week was to make a program that could overcome the ramp (thanks Mrs. Bennet) obstacle while still completing the rest of the course. The robot’s sensors were too far away from the wheel chassis originally, so as the robot’s wheels moved up the ramp, the sensors got farther and farther off of the ramp. The light emitted by the sensors was at too much of a distance to be reflected back effectively. This caused the robot to think both sensors were on black because the amount of reflected light was low and in turn, the robot turned in a circle and ran off the ramp.

The code above was able to go over the ramp, but to make the robot able to achieve this I needed to remove the hint section of the code. The hint-detection part of the code activated when the light changed on the ramp, so next week I aim to try and reincorporate it into the program.

When the sensors were moved closer to the wheels, the original program stopped working. This is because changes to the physical robot also make errors in the code. To counteract this, I edited my line follower so the wheel not turning turned backwards instead of staying in place. For example, if the robot turned right then the left wheel would move forward and the right wheel would move back. I experimented with multiple measures but found that the best was the wheel turning 1/4 of the way backwards for every 1 turn of the forwards-turning wheel.

I also started making a program to detect hints without getting fooled by the ramp. My logic was that if the amount of reflected light drops below a certain threshold, the robot would assume it was on the ramp and continue until the lone was found again. The problem with this code is that the amount of reflected light on the ramp changes gradually, while the amount of light on a green or silver hint changes suddenly. Next week I will seek to find a solution to this problem. This is my code so far:

Richard explained to us a concept of making a new program. He told us that instead of altering the old code and risking making errors, to make a whole new program and copy and paste our old code in to change. That way, if an error appears, the old code is always there to revert back to if needed.

Useless Fact of the Day: Intelligent people have more zinc and copper in their hair.

Week 9 – 2019 – Sara

Hi…

So before I start I just want to say a big thank you to Mrs Bennett, who made the ramp for us, and even though it brought on a lot of new challenges, it was fun to solve. If we hadn’t gotten a ramp I’m pretty sure we would have showed up at the competition unprepared to work with the ramp. So, thanks Mrs Bennett…

This week was our first week back at robotics this term, and we worked on getting the robot up the ramp again. Over the holidays Rich changed the sensors on the robot by putting them a little closer to the wheels, so that when it went up the ramp the robot wouldn’t detect its shadow to much.

At first we just tested our codes to see if they would still work after the sensors had been changed, and guess what ,THEY STILL DID! We all had different thoughts on whether it would still work or not and most of us guessed it wouldn’t, but well its good to be wrong sometimes…

My code actually worked better with the sensors down, I didn’t even have to change anything. The thing that surprised me was that the robot was following the lines, going over the ramp, turning when it found hints. It was doing all these things really well with my code, but the surprising thing was that I didn’t even have a hint detector in my code. So I’m still not completely sure how it was working.

The last challenge I had was that the robot would get through the whole course, it went up the ramp but when it came down it wouldn’t stop on silver. So I changed my code and finally the robot went up the ramp, then down and when it got to silver it actually stopped! But, (there’s always a but) in doing so the robot no longer worked when it came to detecting the hints. So this time I’ll have to work out how to fix that.

Goodbye, for now…

Week 8 – 2019 – Tamsin

This week at coding we found a ramp that Mrs Bennett made for us. So we tried our line following program on it . The line following program didn’t work because the sensors were reading a lower intensity . That made the robot think it was on black and It turned in circles.

Then we had to pull apart the robot and pull the senses up a little bit so that took a chunk of our time away. In the end we finally got to the robot to work on the ramp but then we had to take it all apart again and put it out how it was normally set up so that we could do our coding on it. Here is some of my finished work that I have set up.

This week at coding I had a lot of fun but we didn’t get that much time to finish our coding but I finished mine because I had worked on it the previous week and now it works but we didn’t have that much time to finish

Week 7 – 2019 – Tamsin

This week at coding Sara and I finished our straight line following code here it is.

To finish my code from last week I did some research and noticed that I needed variables so I added just a couple of variables but I had no idea what to do with them

To solve this problem I looked at some of last years coders line following work and they for one had heaps of variables and two had heaps of code inside of ‘My Variables’

I also had a hard time knowing what the word threshold meant so I had to look it up and to me it meant a value that had to be met.

This week I had a fun time at coding and I was so excited that my code finally worked. I was stoked .

Week 8 – 2019 – Sara

Hey again…

Unlike lasts weeks blog this is going to be short. At robotics this week we were working on how to get the robot to go up and down the ramp. You may think, oh that’s easy, but it’s not. Why? Because when the robot starts going up the shadow of the robot gets in the way making it reflect back less light, and when the robot starts coming down the sensors get too big and cover up the black line.

Our first idea was too dismantle the robot and put the sensors a bit higher, but that didn’t work because that just made the sensors even bigger. So we had to dismantle it again and rebuild it the normal way.

Our next idea was that, when the robot started going up the ramp it would reflect less light due to shadows, that meant that in our code where we told the robot to stop when both sensors detected less then 40 the robot would stop at the bottom of the ramp. To fix this problem all we had to do was change that piece of code telling the robot it should keep going when it detected less than 40 on both sensors.

But that brought on a new problem, after the robot had gone over the ramp it would still follow lines but when it got to the silver part it just kept going and wouldn’t stop. That’s what we’ll have to figure out next time, how to make the robot stop after it has gone over the ramp.

Hope next time we figure this problem out, bye…

Week 7 – 2019 – Sara

Hi there….

If your wondering why I didn’t write my blog last week well it’s because there was no robotics (James was sick). But I’m back at it again this week, and here’s what I did.

I worked on my 2 Sensor Line Follower again, the one from week 6 worked only on straight lines and some curves but this week I managed to get it going on staright lines and all curves. First Rich showed me a truth table, here’s an example of one…

This pretty much explains what should happen on all four of these situations. The first three are self explanatory but the last one is a bit different, the last one says not black on both sensors which means it’s either on green or silver. Green and silver also reflect less than 40 which is like black.

Line Follower 2.0
You can click on the picture to make it bigger

That was today’s finished code, I put in some notes to make it easier to understand. Here’s the big (and long) explanation…

I created 3 variable blocks, Speed, Turn Angle and Reflected Light. This is so that when I have to change one of these things I only change it on the variable block and it automatically changes the rest. After all these variable blocks theres a switch block, using the left sensor it will look for how much reflected light there is if its greater than 40 then it should continue by going upwards, if its less than 40 then it should go down ( I’ll explain the up part first). After this theres another switch block telling it the same thing (if its greater than 40 go up, if not go down.) The only difference is that this time its using the right sensor to do this. (Going up once again) This part says that since both sensor are greater than 40 indicating its on white, it should go forward with a speed of 37.5 ( I’ll explain why that is soon). Now if the left sensor is greater than 40 and the right sensor is not then the robot should turn right 187.5 degrees with a speed of 37.5. By turning it will make the robot get back with both sensors on white again and when that happens it will move forward.

We’re finally at the bottom part of the code! The bottom part is when the left sensor is less than 40, it then has another switch block. Using the right sensor it asks if its less than 40, if yes go up if not go down. (Going up this time, it’s the last time.) Now it gets a bit complicated, it takes the Turning Angle times it by -1 and then puts the answer as the new Turning Angle. Which now means that when the left sensor is less than 40 (meaning its black) and the right sensor is greater than 40 (meaning white) the robot will turn left -187.5 degrees. The last and final line of my code is when neither one of the sensors are greater than 40, (which means they are both a dark colour) when they are under 40 the robot must stop.

For me to get the right Speed and Turning Angle I changed the speed right down to 15 and experimented with which Turning Angle worked best on the sharp curves. In the end I had Speed at 15 and Turning Angle at 75, but I found that the robot was really slow so I multiplied both these numbers by 2.5 and got the answer that I used on my code, a Speed of 37.5 and a Turning Angle of 187.5.

Finally done with it all, ok bye…