In order to get more precision for the control of hydraulic valves, I implemented a 10 bit PWM on the arduino for Cytron. This basically gives 1024 steps for the PWM duty cycle instead of only 256, i.e. the gain resolution is four times higher.
The .ino works directly with the v2 PCB, you only need to switch Cytron to take the PWM from “PWM2” which is hooked to pin D9. Also no modifications needed in AOG side, the min/max PWM values are simply multiplied by a factor of four in the arduino to match the 1024 steps. Gain values are four times higher, i.e. replace 4 with 16 etc. Added a third option to the main ino, it’s also possible to adjust the frequency in the related if clause, default is 125 Hz now.
Code here: GitHub - jkonno/AOG-10-bit-PWM: Higher PWM resolution, compatible with v2 PCB and Standard AOG 4.3 Only tested thus far with a multimeter on a bench setup, so far so good. Need to do some tidying up, but feel free to test if this helps to adjusting hydraulics!