Hello Guest it is April 25, 2024, 10:28:21 AM

Author Topic: Mach4 Lathe + servo spindle threading problem  (Read 1209 times)

0 Members and 1 Guest are viewing this topic.

Offline Azalin

*
  •  181 181
    • View Profile
Mach4 Lathe + servo spindle threading problem
« on: May 29, 2022, 01:37:49 PM »
Hi,

I recently Installed an AC servo as spindle motor. This servo runs with step-dir signals. Got some help from @joeaverage and @dazp1976 and some our friends (thanks).

It took me a while to get the servo to run smooth and steady. All turn cycles works except threading. As you see in the video when I start a threading cycle spindle starts running, X and Z axes moves to their initial position then spindle suddenly stops. Then nothing happens.

Mach4 version: 4.2.0.3804
Latest PoKeys plugin and config app installed.

Is this a software bug or something I did wrong?

https://www.youtube.com/watch?v=1hpXf1iHkz0

Here's the log file

2022-05-29 19:56:27.639 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_GUI_FOCUS (1030), wparam = 0, lparam = 0


2022-05-29 19:56:38.049 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_GUI_FOCUS (1030), wparam = 1, lparam = 0


2022-05-29 19:56:38.182 - API: mcCntlCycleStart(inst = 0) (Mach4GUI LUA script)
2022-05-29 19:56:38.284 - Attempt transition from "Idle" on event "Cycle Start" MachAPI.cpp:2851
2022-05-29 19:56:38.284 - S_IDLE_on_exit
2022-05-29 19:56:38.284 - ACTION_start_cycle
2022-05-29 19:56:38.286 - S_FILE_RUNNING_on_entry
2022-05-29 19:56:38.287 - S_FILE_RUNNING2_on_entry
2022-05-29 19:56:38.287 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2022-05-29 19:56:38.288 - [PoKeys] [msg] PluginInstanceProcessMsg mInst = 0, msg = MSG_CYCLE_START (1005), wparam = 0, lparam = 0


2022-05-29 19:56:38.296 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_SPINDLE_CHANGED (1023), wparam = 0, lparam = 500


2022-05-29 19:56:38.297 - Waiting on SetStill...
2022-05-29 19:56:38.297 - Controller::RunCanonBuffer called AddStopReportRequest() RunCanon.cpp:88
2022-05-29 19:56:38.297 - Step&Dir Spindle Direction: 0 RPM: 500.000
2022-05-29 19:56:38.298 - Requesting a stopped report for axis 0 motors.
2022-05-29 19:56:38.299 - Requesting a stopped report for motor 0.
2022-05-29 19:56:38.299 - Requesting a stopped report for axis 2 motors.
2022-05-29 19:56:38.299 - Requesting a stopped report for motor 2.
2022-05-29 19:56:38.301 - [PoKeys] EX_STOP_REQ received for motor 0 - queuing at 112 (move 220593)
2022-05-29 19:56:38.301 - [PoKeys] EX_STOP_REQ received for motor 2 - queuing at 32 (move 220593)
2022-05-29 19:56:38.426 - API: mcMotionSetStill(inst = 0, motor = 0) (unknown caller)
2022-05-29 19:56:38.426 - [PoKeys] Reporting motor 0 stopped (queued request) - delay of 0 slots stop=112 dev=112
2022-05-29 19:56:38.428 - API: mcMotionSetStill(inst = 0, motor = 2) (unknown caller)
2022-05-29 19:56:38.428 - All motors marked as still.
2022-05-29 19:56:38.428 - [PoKeys] Reporting motor 2 stopped (queued request) - delay of 2 slots stop=32 dev=32
2022-05-29 19:56:38.428 - Waiting on SetStill is Done!
2022-05-29 19:56:38.431 - Signal id 1121, (Tool Change), changed from LOW to HIGH.
2022-05-29 19:56:38.435 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_CHANGE_TOOL (1000), wparam = 1, lparam = 0


2022-05-29 19:56:38.439 - Signal id 1121, (Tool Change), changed from HIGH to LOW.
2022-05-29 19:56:38.441 - Waiting on SetStill...
2022-05-29 19:56:38.441 - Controller::RunCanonBuffer called AddStopReportRequest() RunCanon.cpp:88
2022-05-29 19:56:38.441 - Requesting a stopped report for axis 0 motors.
2022-05-29 19:56:38.441 - Requesting a stopped report for motor 0.
2022-05-29 19:56:38.441 - Requesting a stopped report for axis 2 motors.
2022-05-29 19:56:38.441 - Requesting a stopped report for motor 2.
2022-05-29 19:56:38.441 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_CHANGE_TOOL_DONE (1001), wparam = 1, lparam = 0


2022-05-29 19:56:38.441 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_CHANGE_TOOL_DONE (1001), wparam = 1, lparam = 0


2022-05-29 19:56:38.441 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_SPINDLE_CHANGED (1023), wparam = 0, lparam = 300


2022-05-29 19:56:38.441 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_SPINDLE_CHANGED (1023), wparam = 0, lparam = 300


2022-05-29 19:56:38.443 - Step&Dir Spindle Direction: 0 RPM: 300.000
2022-05-29 19:56:38.443 - [PoKeys] EX_STOP_REQ received for motor 0 - queuing at 112 (move 220738)
2022-05-29 19:56:38.443 - [PoKeys] EX_STOP_REQ received for motor 2 - queuing at 32 (move 220738)
2022-05-29 19:56:38.568 - API: mcMotionSetStill(inst = 0, motor = 0) (unknown caller)
2022-05-29 19:56:38.568 - [PoKeys] Reporting motor 0 stopped (queued request) - delay of 1 slots stop=112 dev=112
2022-05-29 19:56:38.571 - API: mcMotionSetStill(inst = 0, motor = 2) (unknown caller)
2022-05-29 19:56:38.571 - All motors marked as still.
2022-05-29 19:56:38.571 - [PoKeys] Reporting motor 2 stopped (queued request) - delay of 4 slots stop=32 dev=32
2022-05-29 19:56:38.571 - Waiting on SetStill is Done!
2022-05-29 19:56:38.573 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_SPINDLE_CHANGED (1023), wparam = 1, lparam = 300


2022-05-29 19:56:38.573 - Signal id 1142, (Spindle Fwd), changed from LOW to HIGH.
2022-05-29 19:56:38.574 - Signal id 1141, (Spindle On), changed from LOW to HIGH.
2022-05-29 19:56:38.574 - [PoKeys] [msg] PluginInstanceProcessMsg mInst = 0, msg = MSG_IO_CHANGED (1012), wparam = 151394920, lparam = 1


2022-05-29 19:56:38.574 - Waiting for spindle at speed and stable... Spindle.cpp:269
2022-05-29 19:56:38.574 - Step&Dir Spindle Direction: 1 RPM: 300.000
2022-05-29 19:56:38.832 - Waiting for spindle stable DONE Spindle.cpp:274
2022-05-29 19:56:38.835 - Waiting on SetStill...
2022-05-29 19:56:38.927 - Controller::RunCanonBuffer called AddStopReportRequest() RunCanon.cpp:88
2022-05-29 19:56:38.927 - Requesting a stopped report for axis 0 motors.
2022-05-29 19:56:38.927 - Requesting a stopped report for motor 0.
2022-05-29 19:56:38.927 - Requesting a stopped report for axis 2 motors.
2022-05-29 19:56:38.927 - Requesting a stopped report for motor 2.
2022-05-29 19:56:38.927 - [PoKeys] EX_STOP_REQ received for motor 0 - queuing at 32 (move 221224)
2022-05-29 19:56:38.927 - [PoKeys] EX_STOP_REQ received for motor 2 - queuing at 32 (move 221224)
2022-05-29 19:56:38.930 - [PoKeys] EX_STOP_REQ received for motor 0 - queuing at 32 (move 221225)
2022-05-29 19:56:38.930 - [PoKeys] EX_STOP_REQ received for motor 2 - queuing at 32 (move 221225)
2022-05-29 19:56:39.052 - API: mcMotionSetStill(inst = 0, motor = 2) (unknown caller)
2022-05-29 19:56:39.052 - [PoKeys] Reporting motor 2 stopped (queued request) - delay of 0 slots stop=32 dev=32
2022-05-29 19:56:39.058 - API: mcMotionSetStill(inst = 0, motor = 2) (unknown caller)
2022-05-29 19:56:39.058 - [PoKeys] Reporting motor 2 stopped (queued request) - delay of 1 slots stop=32 dev=32
2022-05-29 19:56:39.096 - API: mcMotionSetStill(inst = 0, motor = 0) (unknown caller)
2022-05-29 19:56:39.096 - All motors marked as still.
2022-05-29 19:56:39.096 - [PoKeys] Reporting motor 0 stopped (queued request) - delay of 44 slots stop=32 dev=32
2022-05-29 19:56:39.096 - Waiting on SetStill is Done!
2022-05-29 19:56:39.101 - API: mcMotionSetStill(inst = 0, motor = 0) (unknown caller)
2022-05-29 19:56:39.101 - All motors marked as still.
2022-05-29 19:56:39.101 - [PoKeys] Reporting motor 0 stopped (queued request) - delay of 45 slots stop=32 dev=32
2022-05-29 19:56:39.107 - Waiting on SetStill...
2022-05-29 19:56:39.107 - Controller::RunCanonBuffer called AddStopReportRequest() RunCanon.cpp:88
2022-05-29 19:56:39.107 - Requesting a stopped report for axis 0 motors.
2022-05-29 19:56:39.108 - Requesting a stopped report for motor 0.
2022-05-29 19:56:39.108 - Requesting a stopped report for axis 2 motors.
2022-05-29 19:56:39.108 - Requesting a stopped report for motor 2.
2022-05-29 19:56:39.111 - [PoKeys] EX_STOP_REQ received for motor 0 - queuing at 32 (move 221402)
2022-05-29 19:56:39.111 - [PoKeys] EX_STOP_REQ received for motor 2 - queuing at 32 (move 221402)
2022-05-29 19:56:39.236 - API: mcMotionSetStill(inst = 0, motor = 0) (unknown caller)
2022-05-29 19:56:39.236 - [PoKeys] Reporting motor 0 stopped (queued request) - delay of 1 slots stop=32 dev=32
2022-05-29 19:56:39.239 - API: mcMotionSetStill(inst = 0, motor = 2) (unknown caller)
2022-05-29 19:56:39.239 - All motors marked as still.
2022-05-29 19:56:39.239 - [PoKeys] Reporting motor 2 stopped (queued request) - delay of 4 slots stop=32 dev=32
2022-05-29 19:56:39.239 - Waiting on SetStill is Done!
2022-05-29 19:56:39.333 - [PoKeys] Threading
2022-05-29 19:56:39.464 - [PoKeys] Waiting for the buffer to flush
2022-05-29 19:56:39.511 - [PoKeys] Start threading!
2022-05-29 19:56:39.522 - [PoKeys] Trigger armed for threading
2022-05-29 19:56:55.557 - [PoKeys] [msg] PluginInstanceProcessAsyncMsg mInst = 0, msg = MSG_GUI_FOCUS (1030), wparam = 0, lparam = 0
Re: Mach4 Lathe + servo spindle threading problem
« Reply #1 on: May 31, 2022, 01:30:58 PM »
I was told by PO-LABS the maker of the Pokeys 57 that they do not support threading with a servo spindle. I spent many months everything worked except threading  . I had to change my AC SERVO from step and dir.  TO +/- 10 Volts to use the ac servo

Offline Azalin

*
  •  181 181
    • View Profile
Re: Mach4 Lathe + servo spindle threading problem
« Reply #2 on: May 31, 2022, 02:23:07 PM »
Yes, I got the same response from Polabs:

Quote
Hi, Suat

Unfortunately, step/dir driven spindles are not supported by the PoKeys device during threading cycle. During normal operation, all axes are fed by a constant flow of position references and at the moment of waiting for the threading trigger, the flow is stopped, which stops the spindle as well. Alternatively, threading can be executed as a CAM operation instead of G-code operation.

I already switched the servo to analog mode.
Re: Mach4 Lathe + servo spindle threading problem
« Reply #3 on: June 07, 2022, 01:07:34 PM »
Did you change the settings in the Po-labs plugin ?

Offline Azalin

*
  •  181 181
    • View Profile
Re: Mach4 Lathe + servo spindle threading problem
« Reply #4 on: June 07, 2022, 02:19:02 PM »
Yes.
Re: Mach4 Lathe + servo spindle threading problem
« Reply #5 on: June 08, 2022, 11:02:13 AM »
Do you have an encoder running 1;1 off the spindle ? Have you tried index in the plug in ?

Offline Azalin

*
  •  181 181
    • View Profile
Re: Mach4 Lathe + servo spindle threading problem
« Reply #6 on: June 08, 2022, 01:34:20 PM »
Hi,
 
I think there is some kind of misunderstanding or I should have mention that I can do threading after I switched to analog mode.

Thanks.
Re: Mach4 Lathe + servo spindle threading problem
« Reply #7 on: June 08, 2022, 02:32:09 PM »
Oh good your problem is fixed .Congrats.

Offline Azalin

*
  •  181 181
    • View Profile
Re: Mach4 Lathe + servo spindle threading problem
« Reply #8 on: June 08, 2022, 02:33:05 PM »
Thanks Gabe.
Best

Offline Azalin

*
  •  181 181
    • View Profile
Re: Mach4 Lathe + servo spindle threading problem
« Reply #9 on: June 08, 2022, 02:41:22 PM »
By the way I noticed something strange in the latest Mach4 Hobby. In the threading cycle, say I enter 0.5mm as thread depth then Mach4 posts the g-code with doubled depth value. I mean it puts -1mm where it should be -0.5mm. Here's the sample line I just generated:

N105 G76 X-1.0 Z-5.0 R0.0 P0.5 Q0.1 F0.75

You might ask the Control Mode in settings. It is "Lathe (Diameter)"

It wasn't like this in previous Mach4 versions.

It is not a big problem because I can enter 0.25mm if I want 0.5mm thread depth but it's weird.