Prime Tutorials Part 2: Make your robot drive straight with simple Proportional Gyro Code!
Vložit
- čas přidán 13. 10. 2023
- In this video, I will teach you how to make your robot drive perfectly straight with the gyro sensor! Be sure to email any pictures, videos or CAD files of your teams robot to tellurium.robotics@gmail.com so you can be a part of a Tellurium Robotics CZcams video!
- Hry
I’d love to see this for distance versus time. As a new coach I’m learning slowly. We have a robot that is just not driving straight and we’d rather correct and move on versus trying to rebuild.
Thats exactly what I needed for Robot Inventor (same hub as the Spike). And it's explained crystal clear. Thank you!
You're welcome! Thanks for the complement!
Thanks for sharing. I adjusted the program to use stop until>>degrees and use relative position of motors as time isn't the most accurate variable to measure since it varies according to speed.
This guy is soooo good! Keep up the good work!
Thank you!
What if you want to run a certain distance, not just time?
How would you program that?
@@runetraeholt I actually just made a video about that! Check it out!
can you share the link here please @@TelluriumRobotics
What if you want distance instead of time?
General question do you know how to find the position of the robot on the FLL task surface and how to implement it in the code
You do a nice job informing and helping people to be better coders. Do you find time or distance to be more accurate in your gyro straight scenario?
Typically, I use distance, because with using time to measure, there are a lot of variables at play, like how clean your wheels are, how close to fully charged your robot is, and many other things. Using the rotation sensors to measure how far the robot has gone is much better, unless your robot starts to skid, but then it is probably hopelessly lost on the field anyway.
how do you make it do this but in the other way like in reverse
I didn't really got why we had to multiply the yaw angle by -1, could you explain please :]
I'll explain it with an example of what would happen if you didn't multiply yaw angle by -1.
Your robot would be at, for example, 5 degrees off of where it should be.
The gyro would read 5 degrees, and the robot would start driving, rather than at 0 Straight, at 5 Right. The gyro would now read 10. The robot starts driving at 10 Right, instead of 5 Right. Instead, if we invert it and the robot is 5 degrees off from where it should be, it will start going left 5. The robot will be at 0 degrees now, and so it will start going straight 0. Get it?
Can you change the speed to anything you choose? Say, 100, or 110?
If you make it too large, like 95 or 100, the robot will be unable to correct, because it would need one of the motors to go faster than 100, which is impossible.
It doesn’t work
Can U make it so that it turns accurately using Gyro?
I already did that! It's in an earlier video, so feel free to check it out!
you forgot to add stop moving at the end.
Whoops. Thanks for pointing that out!
What if you want to go backwards?
To make it go backwards, you would need to switch the driving motors, say C + D, to D + C. This makes the robot go backwards instead. The second thing you would need to do is to take out the math block that inverts the gyro. Give that a try, and if it doesn't work, email me at tellurium.robotics@gmail.com
Awseome toutarail
could u post the part # 1 toutarail plz
I don't know what that means. In other words: sure!
😂