C++ examples are in the WPILib state-space PR in the wpilibcExamples folder. The main concern people have raised is people getting scared away by linear algebra, So I tried to abstract that away where it made sense. I’ve been pushing for model-based control in WPILib for a year now, but it’s taking a lot of time to put all the pieces together like documentation and teaching materials (this book), library support ( ), tutorials… WPILib wants “easy as possible” before we’re locked into an API, and I don’t think it’s quite there yet. They opted not to use the C++ example subsystems so they could get experience doing it from scratch. Now, my students are writing subsystems that use the files generated by the scripts. At the third build session, we experimented with the example scripts in the frccontrol package and got matplotlib running on WSL. My students actually read parts of the book between lectures, so that was helpful in making the build sessions more productive. I briefly walked them through an FRC subsystem derivation toward the end. At the second build session, I spent about five minutes answering questions about the previous session, then I spent the remaining two hours teaching them about state-space representation, closed-loop controller/observer design, and various details surrounding that. The linear algebra was basically just following the 3Blue1Brown video series on it. At the first build session, I spent two hours teaching my students some basic Laplace domain stuff and linear algebra. I recently alpha tested this on my students to get some feedback on it. Better ways of explaining things are appreciated. Of course, please let me know if any of the content is inaccurate. If nothing else, this book has been a teaching aid for me to teach my students this stuff for the 2019 season. It isn’t done yet (see the “future improvements” section of the readme), but it might be far enough along to help some people. The book’s source is at and the Python examples are at. See the preface for more on why I wrote the book and chapter 0 for notes to the reader. This book covers other fun stuff too like stochastic control theory since it complements the state observer stuff. This also allows decoupling electrical/mechanical and software testing. Also, model-based feedback controllers can be tuned weeks before the robot goes into the bag (or before the robot is even built). This book focuses on modern control and state-space controllers because the roboRIO has the computational resources for it and it generalizes nicely to MIMO control systems. The end goal is teaching students enough such that they can make informed decisions regarding control system design trade-offs. This book is intended to introduce FRC students to the broader field of control theory. I figured I’d finally post what I’ve been working on for about a year.
0 Comments
Leave a Reply. |