TurbTroll is event-driven wind turbine control software targeted at ATMega (Arduino-based) hardware platforms.
TurbTroll has been built with the PlatformIO framework, at current, things are setup to work on an Arduino Uno host. Although this can easily be modified for other target platforms by changing platformio.ini. The platformio.ini file also includes references to libraries used and serial config.
To get setup with development, I'd reccomend using the PlatformIO plugin for VSCode. Check it out here.
TurbTroll uses an event-driven observer design pattern to drive a chain of callbacks which update a PWM duty cycle for a given input frequency at the ADC.
The Eventually Library by Jonathan Bartlett is used to trigger the pipeline and can be scaled to add more/alternative triggers in the future.
To store ADC samples, a ring buffer is created (thanks to rlogiacco/CircularBuffer) and a simple time-domain (per sample) frequency detection scheme is proposed in DspEngine.cpp.
The DecisionMaker object handles the logic for converting a measured speed into action on the PWM duty cycle. This is achieved with a basic state-machine.
Speed is adjusted using a very basic proportional control system which currently does not do any proper MPPT.
Add a circuit diagram (TODO)