Let's say Jirachi wants to eat a berry, and finds one ten feet away.
Jirachi wants to go straight to the berry, but he is in a constant wobble the whole way, due to his proportional controller (which simply measures the object's error times a gain, and then corrects).
Jirachi needs a controller that will take the past, present, and future corrections, and adds them up to make on big correction. How can we do that?
Well, the answer is My Blocks! First off, we measure the error, which is our current gyro minus the wanted angle. Then, we take that times a gain (just a number we multiply by to slightly or massively change our correction.).
Then, we take the past correction, which is all of our past errors times one gain (usually small so we don't get a number that is 1000+). We need this to gauge where we are compared to where we need to be.
Finally, we need a future correction, which based on the gyro rate, slows the robot down a little or a lot. We need this to predict where we will be.
After we get those three, we add them together for our one correction! Then, we repeat 20 times a second!
After all of this, Jirachi should get his berry, and he will eat it and be happy!
Jirachi is owned by Nintendo™.
Until next time, keep building!
Cody W., Brickstormers




No comments:
Post a Comment