Since I was able to create a usable tool changer control comp with the coding assistance of AI, I figured I had better confront the final boss beast of this CNC conversion... the spindle control. I was already crastinating on this before I turned pro.
If you remember, I retained the original motor, CVT and back gear, and added a VFD instead of the Dahlander motor winding switching. So far I was just manually controlling the back gear and CVT, and guessing what VFD frequency to command, with a single ratio hard coded on the INI, which is roughing right for about 1000 rpm.
I want to believe that I can use a comp to have the system follow S commands, including for CSS cuts.
So I have:
- huge variation in inertia, requiring PI gain scheduling based on overall reduction ratio
- no feedback of CVT or back gear position, which lead to the attempt to infer gear ratio from spindle encoder / analog motor speed command.
I got it sort of working with the assistance of ChatGPT(free) for coding. However, the need to freeze the ratio calculation during CVT bumps, or commanded speed changes means it very laggy, with speed corrections happening long into cuts.
I have attached the ChatGPT created comp and hal, for general interest...
... continued next post, to separate the ChatGPT attachments from the Antropic AI generated files.