r/FLL • • 23d ago

Sudden code issue after 4 weeks of working right

TL;DR code worked for 4 weeks, consistent starting point, this week consistency dropped by 50+% what can we try before messing with code?

The team I’m working with has a code that does window to the past, humongous fungus, leaf cutter, and then raises the cane on forest elder before going back to the launch area.

They’ve had the code pretty set for about 4 weeks now and it would work 4/5 times with some variation on the leaf cutter not always pushing completely in. They have a jig to keep their starting point constant.

Suddenly this week it started missing everything by a centimeter or so to the right. We tried charging the battery and cleaning the wheels and it was still very inconsistent, maybe would hit 2/5 times.

We had a mock tournament yesterday and all 3 trips to the board it missed. (Of course it worked on a practice round on the same board)

Before the kids start tweaking the code I wanted to see if there was anything else that would cause sudden wonkiness like this? Besides cleaning wheels and charging batteries are there other tips? Does doing a reset of the hub ever do anything?

The kids were frustrated yesterday with missing the points, but mostly with why it worked so long and now doesn’t with competition two weeks away.

Thanks for any help!

3 Upvotes

15 comments sorted by

2

u/gt0163c Judge, ref, mentor, former coach, grey market Lego dealer... 23d ago

Your team is right to consider other options before tweaking the code. Code doesn't just stop working or change. Something else changed. Cleaning the wheels and ensuring the battery is charged are good first steps. Using a jig to ensure a consistent starting position is good. But depending on what the jig is aligned to, differences in tables could impact how the robot moves. For instance if the jig is aligned to the south wall and your home table is perfectly square and the mat is placed exactly as it should be, but the competition table is a little out of square or the mat is placed not exactly straight (or both!), that could be an issue. Minor changes to the position of the mission models, which are still within the tolerances allowed, can also be a source of error. And there are many other small differences that can cause tiny changes which can impact a robot's performance. Differences in mat texture (mats at competition generally are very close to brand new. Mats used by teams have been used and worn down a bit), table differences (surface under the mat, bumps and imperfections, tables not being perfectly square or not being out of square in the same way as the team's home table, different wall heights), lighting, sound and temperature differences (which are probably small, but still can have an impact depending on the team's robot design, wheels and sensors used, etc.). And many, many other things. And, yes, this can be frustrating for teams. But it's all a part of doing things with robots. Robots do not operate 100% consistently every time, even industrial robots. And the robots FLL uses are plastic toys (really cool plastic toys, but still plastic toys).

So, some suggestions I always give to teams:

  • Regularly pull the mission models off your mat and set them up again. Make sure they're still within the bounds of being properly set-up. But this will still ensure that they're a little different. It will also help the team know how the models should be set-up so that they can check their competition table before their match. If anything is out of place, they can ask their referee to correct it so that it's within the bounds of the set-up instructions. (The team should NEVER change a mission model themselves without permission from their table/head referee. And most referees don't want teams touching the mission models with their hands when they're outside of home ever. But there could be exceptions.)
  • Regularly rotate the mat 180 degrees on your home table. Similarly to resetting the mission models, this will introduce some differences into the mat set-up.
  • Particularly if the team is using the color sensor, try to practice in different lighting conditions. Turn the lights off, use flashlights, turn the lights on, work on cloudy days and sunny days (assuming there are windows), use direct lighting and indirect lighting. And figure out how to shield the color sensor from the ambient light as much as possible.
  • If at all possible, work on different tables and fields. If the team can meet with another team and use their table for some runs that's ideal. And the teams can share their Innovation Projects and Robot Design work, practice giving presentations, share ideas and have fun!
  • Design their robot, attachments, and code to allow for these small differences. Introducing these small differences should help the team ensure that their robot runs can still perform as expected in a variety of conditions.

1

u/RollingThunder_CO 23d ago

This is super helpful and some fantastic ideas, thank you! I will certainly implement them to make sure that they’re ready for some inconsistencies.

The jig is based off the mat, not the board to make sure we don’t have problems there. And the robot started missing last week on the same board where they were having success previously. So I’ll check some of the other suggestions and see what might be going on.

I think it’s a great point about the mat getting worn down. They have run that code a LOT by this point. Ugh but then why do the same thing on the mock competition board? Sorry I’m thinking out loud but feel like it must be something with the robot.

Thanks again for the awesome info / suggestions! This is only my second year helping a team but I love how much everyone is willing to help other teams!

2

u/gt0163c Judge, ref, mentor, former coach, grey market Lego dealer... 23d ago

You're welcome. A few other things the team can think about/try.

Did they make ANY changes to the robot or attachments recently? Did a piece fall off or come loose? Is there something dragging on the mat or on a wheel? Did the robot somehow become unbalanced? Is it always missing to the same side or in the same way? Sometimes the robot just needs a quick "hug" to ensure that all of the parts are firmly pushed together. Or if a part came loose, ensure that

The team could also try removing ALL of the programs from the robot and then reloading them. This is probably less of a thing than it used to be with named programs and the EV3 (where it was easy to have multiple similarly named programs and for the team to not be running the one they thought they were running). But if there are multiple similar programs in different slots, it would be easy for the team to run the wrong program.

2

u/RollingThunder_CO 20d ago

Just wanted to report back that the kids gave the wheels a good clean and dry and then a good "hug" and it stopped doing the little turn and back to 4/5 consistency. Thank you again! I will certainly be making sure they clean their wheels at the competition!

1

u/gt0163c Judge, ref, mentor, former coach, grey market Lego dealer... 20d ago

Woo-hoo! I'm glad that's fixed their issue. I would add, as a judge, that the team should include the story of what happened, what they investigated and tried to fix the issue and what finally worked to their robot design presentation. Hearing about how teams encountered problems and the process they used to try to fix them (even if they weren't ultimately successful) is one of my favorite things to hear about during a team's judging session. A lot of teams assume the judges are judging them on how well they did, the awesome stuff they accomplished, etc. So they only tell the good stuff. But if you look at the rubrics, they're all about the process the team went through. And good judges follow that rubric. And we know that very little ever goes right the first time you try something.

1

u/RollingThunder_CO 21d ago

Watched the videos from the mock tournament and if you slow them down you can clearly see the robot do a little turn to the right as it starts moving. It does it on multiple missions on multiple boards and multiple starting positions, so definitely not code related.

So we'll do the cleaning and definitely give it a "hug" to see if something was loose. Do the motors ever wear out too? Curious if the right one is just slow to get going for whatever reason. Or is it helpful to factory reset the hub? Thanks for all the info!

1

u/gt0163c Judge, ref, mentor, former coach, grey market Lego dealer... 21d ago

The "little turn" right when the motor starts moving is not uncommon. With the robot off (or on, but do it with the motor off to prove the point), if you pick up the robot and, by hand, gently move the wheel back and forth you should be able to feel it turn a little before the resistance of the motor kicks in (for lack of a better word). That's called lash/backlash/slop, etc. Wikipedia has a good explanation: https://en.wikipedia.org/wiki/Backlash_(engineering) . This will be worse with larger wheels because small movements of the motor or amplified by the larger circumference of the wheel.

So what's probably happening is that when the student sets up the robot, they're slightly dragging one wheel on the mat just a tiny bit more than the other. This could easily happen if the student is slightly off to the side or a little short/working on a slightly taller than usual table, or just because.

There are a number of ways to fix it. One is to have a practice of setting the robot onto the mat and then, by hand, dragging/backing it up into the starting position. This can work. But in the heat of competition, team members do not always remember to do this. And it can put extra strain on the robot cause the axles holding the wheels to bend/crack/break over time and/or the motors to wear out more quickly. Another option is to start each program with the robot backing into something immovable (wall, jig, something). It's best to run the motors for time so that the robot doesn't stall if it's already against the wall and it doesn't have to be a lot (the team can play around with the value to see what works and uses the least time). This will eliminate the unequal lash in the motors and should help the robot drive straight. This is often called "squaring" against a wall/jig/whatever. And it often helps to slow down the robot, particularly when it first moves from a stop. I think some of the motor blocks also have the ability to have the acceleration set. Slowing that down could also help.

2

u/RollingThunder_CO 21d ago

Ok that’s great info. They already back into the wall actually but I’ll look into the acceleration piece that’s a great idea.

I can look at the videos from last weekend and it’s not doing it (and coincidentally also completed the missions just fine) so either one wheel got sloppier (either motor, axle, or loose pieces) or the wheel was slipping I guess.

Thanks for all these tips, I’m excited to present them to the kids this afternoon and let them work the problem!

1

u/Hellothere_1 23d ago edited 23d ago

Cleaning the wheels is a good first step, but have you tried switching them out? Wheels do degrade over time. It depends a bit on the type of wheel you're using, but on some wheels we used to run through 2-3 sets of tires per season per robot.

Check the state of your caster wheels/balls as well, because those can also lead to weird behavior if they're degraded.

Finally you should also check the axles and pins of your main wheels and caster wheels if you have them. In one of our seasons the pins connecting our caster wheels to the robot frame had degraded so much the entire sockets were filled with fine plastic dust, so we had to swap out the wheels, pins and the frame elements they were connected to.

Lego is not really intended for continous long term operation, and a busy FLL season can push some parts way past their intended lifetime.

1

u/RollingThunder_CO 23d ago

Oh interesting never thought of the wheels actually wearing out! We’re using the blue ones but not using the balls so we can rule that out at least. Are the blue wheels some of the ones you’d see wear out?

2

u/Hellothere_1 23d ago

Are the blue wheels some of the ones you’d see wear out?

No idea. Back when I was competing we were still using EV3 so I don't have any hands on experience with Spike parts. However, all wheels wear out eventually, the only difference is how fast, so switching them out is worth a try either way.

It's also not just the wheels, the design of your robot and your mission strategies can also heavily influce how fast certain parts degrade.

but not using the balls so we can rule that out at least.

What are you using instead then? Because whatever wheels/gliders/whatever you're using to balance the robot opposite the driving wheels is still going to be one of the parts that will most heavily experience degradation, so it's definitely something your should check.

2

u/RollingThunder_CO 21d ago

Watched the videos from the mock tournament and if you slow them down you can clearly see the robot do a little turn to the right as it starts moving. It does it on multiple missions on multiple boards and multiple starting positions, so definitely not code related.

So we'll do the cleaning and swap out wheels if they look worn. Do the motors even wear out too? Curious if the right one is just slow to get going for whatever reason. Or is it helpful to factory reset the hub? Thanks for all the help!

1

u/Hellothere_1 21d ago

I don't think we've ever had to swap a motor mid season but that doesn't mean it can't happen. If nothing else works it's certainly worth a try.

One other thing that immediately sprung to mind based on your description is that the way you put your robot down on the mat can affect how it moves based on the initial position of the wheels and the slight internal play of the motors. If you switched out the person who starts the robot or they subconsciously changed how they set down the robot that might explain why it's now starting with a slight turn. In our team we had a rule to always put down the robot slightly in front of the starting position and then push it back by roughly a centimeter to get it into the right spot so the internal motor backlash is always in the same state.

Personally I wouldn't expect the hub to be at fault, since during my entire 6 years of doing FLL we never once noticed any differences between how different hubs execute programs that wasn't related to battery level. But once again no guarantees and maybe the Spike hub is different from the EV3 and NXT hubs in this regard.

Also, are you using the gyroscope sensor to drive straight or measure your turns, or are you just doing motor rotations? Because if you're using the gyro that might be another explanation. In my experience gyro sensors would sometimes just behave a bit strangely all of a sudden. Though that was with the EV3's external gyro sensor, whereas the Spike hub has an internal one which from what I heard runs a lot more reliably, so take what I said with a grain of salt.

Finally as a general tip, assuming you can afford it, I recommend always building two identical copies of your robot each season. This not only allows your team to work faster, since two groups can work on their programs at the same time, but it also allows you to spot much earlier when one of them starts to behave differently and figure out the issue more easily by comparing how both of them behave.

1

u/RollingThunder_CO 20d ago

Great to know about the hub, and they are using gyro sensor. They do have two of the same robot so I'll have them try the other one, too. Thank you!

1

u/RollingThunder_CO 22d ago

Ok good point. We’re using the black pulley wheels (for lack of the official name) so I’ll have them check those out too