Reading a lot...Learning slowly, but learning!
Andy, I have some 'practical' questions regarding functions I wish to implement and am not sure if this is the better place to ask - I will ask here, but if inappropriate will start a new post else where.
Firstly, I have read as many posts as I could find on both subjects below, but have not found definitive direction for a solution.
I need to implement some form of spindle motor deceleration before stop on M command. The motor as I explained is a 2KW plus stepper - it is internally closed loop ( encoder, etc), can spin @ 2500rpm, 40NM torque, etc.
When spinning with the lathe inertial masses ( chuck, etc) and coming to an immediate halt, bad things happen! I have found a number of posts on this subject, but all refer to not disabling the motor enable signal when giving the stop command. I tried to simulate this manually - disconnected the enable from the MESA 7i76 and enabled permanently - ground to enable. Then run my Gcode file, spindle @ 500RPM, and then M02. Spindle slams to a halt - which stands to reason, as the motor is enabled and step pulses cease so motion ceases as fast as possible.
I then set the spindle @ 500RPM again, enable active, and then set enable inactive ( remove the connection to ground manually)
The motor slams to a halt again - The motor can be rotated by hand when stopped, with enable inactive, same as when the motor is just turned on, but not enabled - it can be rotated, but is stiff. The motor still 'slams' to a halt in this test due to the re-generation effect in the motor creating a powerful magnetic brake. At 1000rpm, removing the enable, the motor comes to a standstill within 1-1/2 to max 2 revolutions!
So, playing with enables won't work - I need to actually decelerate the motor with decreasing step pulse frequency.
I also tried using 'spindle at speed' modes - and set the speed in the Gcode file to slower speeds, expecting L_CNC to wait till the spindle speed is achieved before the next speed command - did not - ran through the Sxxx commands in one shot..
The wait till speed reached works in the cnc file - the next G0 or G1 commands seem to pause till preceding spindle speed commands are achieved.
The second is a bigger project...To implement a C axis with the same Spindle Stepper motor.
Again, I have read all I could find, but the poster knew far more than me each time, and was able to glean solutions from replies that I am unable to understand!
Thank you for any help!
Joe