RDunn (@RDunn) and I worked together to create a C++ PID controller and would like to share to Qspice community. Symbol, C++ Code, Schematic example and explanation document can be download from RDunn’s Github in this link - github.com/robdunn4/QSpice
The operation principle, formula to implement integral and derivative and verification of code can be found in User Guide - Qspice C++ Discrete PID Controller Implementation.pdf.
Our purpose is to provide a startup kit for anyone who would like to include a digital PID in your Qspice simulation. You can modify the C++ code based on your application and we are welcome for feedback.
This collaborative effort wouldn’t have been possible without the help of RDunn in converting our idea into C++. This work is also based on a demo code from Qspice author Mike Engelhardt.