Here is the Bit Bucket’s code from Destination: Deep Space:
Along with the code used in competition, it includes untested autonomous code and a work in progress “AutoTuner” that was supposed to give a sequence of commands to the motors in order to automatically obtain PID(F) constants. To determine whether a motor response was too oscillatory (and therefore needed to further tuned), the AutoTuner would’ve run a discrete Fourier transform (using our DFT_DataWindow class - as we get new data points and removed old ones, we would update the frequency spectrum accordingly, instead of running a FFT every time). We’re not sure if this would’ve been the best way - hopefully we’ll get to keep developing the AutoTuner to find out
Additionally, for Infinite Recharge, we will start experimenting with state-space control methods. To get to the state equations for a simple motor, we took VEX’s motor curve data and ran it through this program to extrapolate the torque and viscous friction constants, resistance, and back-emf constants of the motor. We haven’t yet measured inductances, but likely we’ll assume a high enough time constant that we don’t need to consider changes in current. As for moment of inertia, we’ll probably measure/estimate it on a case by case basis.
And one last thing: we’ve been working on an off season project called ARTHUR (A Robot To Help Us Robot). ARTHUR has two purposes in software: (1) train the software team and (2) start working on features we intend to use for the new season (such as state-space control, but also our BBMotorController class, which is a way to handle different types of motor controllers and their units and APIs now that we have Talons, Falcons, and Sparks). The “training” code can be found here and in all the forks, while the code for future use can be found on this branch.
Happy new year and season!