I have the variator now basically working.
To the 3 problems I laid out a few days ago:
1: The problem was really at 2 points. For one, the line
setp [HMOT](CARD0).pwmgen.05.
offset-mode should have been 1 and was 0, and on top the VFD was set slightly wrong. Using open-loop FOC now, the tuning went much better.
2: The divide-by-0 issue is still somewhat there, but giving both ".in" pins a starting value greater than 0 makes it so it still throws an error at startup but works as expected thereafter.
3: It seems that I cannot manipulate the error term directly, but what works is to take commanded and feedback, calculate the error, and scale that error. With that, I can “reassemble” a feedback that leads the PID component to get the error I want it to.
With all that, I am able to have stable control over the whole RPM range of about 65 RPM to 3000 RPM.
The variator control still has to be improved, but the principle seems absolutely workable.