Robot won't stop spinning

Hi everyone. I’m a newbie coach.

I don’t have any robotics experience or coding experience. I’m self-studying to teach the kids and I’m so confused.

The robot won’t stop spinning no matter whatI put after the “drive forward for 200mm” block. How do I fix this?

Welcome to the community!

You will find that people are often asked to post the “offending” code. Can you do that? That way we don’t have to speculate as to the potential problem.

Also not sure what you mean by “spinning.”

You posted a photo. I’m probably missing something but what is the photo supposed to show?

Is it only spinning when you make it drive forward? It might be that the motors are reversed or not working on one side.

1 Like

The problem with your robot is that one of the motors needs to be reversed. The brain thinks it is going forward by turning the wheels, but it is actually spinning one the wrong way, causing the robot to spin. Try reversing one of the motors, then come back and post your code if that doesn’t work.

1 Like

I know this has been said a lot but look across the forums because this is a common topic. If you can’t find what you need tell us

Wouldn’t that make it spin for a few seconds then stop? OP said it kept spinning forever… right?

I’m not entirely sure what the logic executed by the drivetrain blocks is, but if it’s looking for a motor that’s running in the wrong direction to reach a certain rotation and it’s going the oposite direction, it will just keep spinning forever because it’s never going to get to that target rotation.

except that running a motor “forwards” should always cause the encoder count to increment. When we reverse a motor we also reverse the encoder counting.

3 Likes