Hi Tom
I am trying to implement css on my lathe. To do this I have taken your examples and altered them to my needs. My intention is to let one thread handle all the S parameter changes. This is why I added an other if-statement for RPM mode. I attach the c-program I am using.
Before going live on my machine I am testing with a slowed down loop and printing out the rpms that would be sent to my machine. Doing this I noticed sudden changes in RPM that I did not understand.
While investigating I found out that the calculation of the radius is not working as expected.
To test this I
- set the x-axis to about 200mm (diameter)
- do the "G96 D2500 S159.6" of your css sample in MIDI
- start my attached css c-program
- do a "G01 X50.8 F100" in MIDI
The attached console output shows that at some point while traveling from 200mm to 50.8mm the radius suddently drops and comes back up again. The end value seams also to be wrong. I think it should read one inch and not 0.89 inch.
The console output was done with a linear move from 200mm to 50.8mm. The radius does not reflect a linear move.
In the attached picture you see the end position in KMotion and the console.