|
Re: NavX MXP Continuous Angle to Calculate Derivative
Quote:
Originally Posted by dougwilliams
Question though - what are you trying to achieve by closing the loop to a specific turning speed?
|
We're not running it closed loop. We've implemented a system described in the paper here. Essentially assuming all variables stay the same, powering motors at the same speed for a certain number of 'pulses'/time should send it to very similar locations each time. We used this at the Oklahoma regional but found that using one certain voltage to run the motors was too prone to the variables in our robot, like battery voltage, tire pressure and internal drivetrain friction. To fix this we implemented a system that starts powering the drivetrain at a small power and incrementally steps up the power until the robot begins to move at the speed we want it to. We then use this found speed to run our 'loops cycles'. By doing this our inconsistency problems have been mostly solved (at the Oklahoma regional we missed 3/4 of the last 4 auto shots because our battery voltages had become so consistently high).
Quote:
Originally Posted by Ether
The IEEERemainder function 1 does this with one line of code:
Code:
shortest_angle = IEEERemainder(present-previous,360);
|
Just tried this out and it works perfectly. Thank you for your help.
I haven't updated the NavX libraries yet, as we leave for Missouri State Champs at 3:00 tomorrow and we're in a time crunch. Ether's fix seemed the quickest and easiest.
Thank you everyone for all the help! I can post source code for our autoalignment command and the derivative calculator in a few days if anyone is interested.
__________________
2016: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Semifinalists, IRI Quarterfinalists
2015: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Quarterfinalists, IRI Winners
2014: Central Illinois Regional Quarterfinalists, Greater Kansas City Regional Finalists, Newton Semifinalists
2013: Greater Kansas City Regional Winners, Oklahoma Regional Winners, Galileo Quarterfinalists
|