Questions About DriveBase on Spike Prime #1649
-
Hello, I am about to guide my students into using Pybricks, but I encountered an issue with moving straight forward and backward. Just like in the video, my robot veers off course when using the gyroscope to move forward and backward. However, there doesn't seem to be any problem with the program itself. I would like to ask everyone for any thoughts and suggestions. Thank you all. I have attached the video and program for everyone's reference and brainstorming. 738671081.841965.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Thanks for sharing this. At first glance it looked unusual, but I think there is a straightforward explanation. You've configured the drive speed at 620 mm/s. With 56 mm wheels, that amounts to about 1268 degrees per second, which is far more than the LEGO Spike motors can do (about 1000 deg/s). With some load, they would go even slower. At that speed, there is no more room for automatic speed/direction correction, since it is already going at maximum speed. This is why we're seeing it happen in the middle of each run in your video, which is where it hits top speed. As it slows down, it has some breathing room for corrections again, so we see it recover. I replicated your program but added an extra parallel loop to print the motor speeds, which makes it possible to see it without doing the math. As you can see below, it peaks at about 1000 deg/s, which is about the limit for these motors. And this is if I lift it up. Under a heavy robot, the top speed is usually lower. When I change your program to run at 300 mm/s (30 cm/s is still pretty fast!), it does go straight. At 400 mm/s, which is closer to the theoretical limit (about 820 deg/s), it also still goes straight, but I would probably avoid running on the limit. You could go a lot faster with bigger wheels, but that's a design trade off against other aspects of your robot. |
Beta Was this translation helpful? Give feedback.
Thanks for sharing this. At first glance it looked unusual, but I think there is a straightforward explanation.
You've configured the drive speed at 620 mm/s. With 56 mm wheels, that amounts to about 1268 degrees per second, which is far more than the LEGO Spike motors can do (about 1000 deg/s). With some load, they would go even slower.
At that speed, there is no more room for automatic speed/direction correction, since it is already going at maximum speed.
This is why we're seeing it happen in the middle of each run in your video, which is where it hits top speed. As it slows down, it has some breathing room for corrections again, so we see it recover.
I replicated your program but add…