Schaublin 125-CNC retrofit.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19802
- Thank you received: 4609
28 Nov 2025 21:02 #339396
by andypugh
Replied by andypugh on topic Schaublin 125-CNC retrofit.
You probably don't need ladder logic. I would think that it is do-able with HAL components. Maybe latch-on the spindle-enable when spindle commanded-speed is zero until measured spindle-speed is very, very near zero.
Maybe linuxcnc.org/docs/stable/html/man/man9/flipflop.9.html
I would need to experiment, but I am thinking setting "in" permanently to "true", clck being triggered by spindle-on ans reset triggered by spindle-off AND speed ~= 0.
(Spindle-off would be inverted spindle-on, and stopped status would use wcomp. )
Maybe linuxcnc.org/docs/stable/html/man/man9/flipflop.9.html
I would need to experiment, but I am thinking setting "in" permanently to "true", clck being triggered by spindle-on ans reset triggered by spindle-off AND speed ~= 0.
(Spindle-off would be inverted spindle-on, and stopped status would use wcomp. )
The following user(s) said Thank You: RotarySMP
Please Log in or Create an account to join the conversation.
- Unlogic
- Offline
- Elite Member
-
Less
More
- Posts: 239
- Thank you received: 119
29 Nov 2025 20:41 #339449
by Unlogic
Replied by Unlogic on topic Schaublin 125-CNC retrofit.
I added the following HAL code to the configuration of my mill to keep the spindle on for a few seconds after the spindle is disabled just to get the nice smooth ramp down you are looking for:
# --- timedelay before disable spindle output for deceleration ramp --- #
loadrt timedelay names=timedelay.spindle-enable-soft-stop
addf timedelay.spindle-enable-soft-stop servo-thread
setp timedelay.spindle-enable-soft-stop.on-delay 0
setp timedelay.spindle-enable-soft-stop.off-delay 3
net spindle-enable => timedelay.spindle-enable-soft-stop.in
net spindle-enable-soft-stop <= timedelay.spindle-enable-soft-stop.out
net spindle-enable-soft-stop => hm2_7i96s.0.7i84.0.0.output-01
For more information see my post here: forum.linuxcnc.org/12-milling/50559-opti...sion?start=70#309845
# --- timedelay before disable spindle output for deceleration ramp --- #
loadrt timedelay names=timedelay.spindle-enable-soft-stop
addf timedelay.spindle-enable-soft-stop servo-thread
setp timedelay.spindle-enable-soft-stop.on-delay 0
setp timedelay.spindle-enable-soft-stop.off-delay 3
net spindle-enable => timedelay.spindle-enable-soft-stop.in
net spindle-enable-soft-stop <= timedelay.spindle-enable-soft-stop.out
net spindle-enable-soft-stop => hm2_7i96s.0.7i84.0.0.output-01
For more information see my post here: forum.linuxcnc.org/12-milling/50559-opti...sion?start=70#309845
The following user(s) said Thank You: RotarySMP, tommylight
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1565
- Thank you received: 573
30 Nov 2025 08:08 #339477
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
I currently have my minimum frequency set in the VFD to 20Hz, as I thought driving the motor near zero would cause overheating. I'll try resetting that to 0Hz, and try your two options. I do like having the spindle disabled when the spindle is not on. So the real solution is to finally send my damaged spare 7i84 to Peter (Talla83), pray he can fix it, and install it so I have enough 24VDC outputs to command the VFD's quick stop pin, and also to control the electromechanical brake, which is lounging around in the motor cabinet, not pulling it's weight.
While I am also thinking spindles:
I currently have:
The VFD analog command voltage:
net spindle-vel-cmd-rpm-scaled => [HMOT](CARD0).7i83.0.1.analogout0
...and the spindle RPM measured from the encoder
net spindle-vel-fb-rps <= [HMOT](CARD0).encoder.00.velocity
In between these two is a dumb back gear and a dumb variator, and without feedback the gear ratio, and this the scale value for to scale the VFD analog command voltage to RPM is unknown.
To caclulate my instantenous gear ratio, I need to multiply the frequency by a constant to give motor RPM, and then divide encoder RPM. That value can then be setp'd to scale.0.gain
I read that HAL supports all the maths operations of the rtapi_math.h, but I could not find any syntax examples. Do I need any braces or brackets to for this? Can you use HAL signals and HAL pins as variables?
If you have to do this with INI variables, how do you get the value out of a HAL signal into the INI variable?
setp inst-gear-ratio <= spindle-vel-cmd-rpm-scaled * 56 / spindle-vel-fb-rps
verses
setp inst-gear-ratio <= [HMOT](CARD0).7i83.0.1.analogout0 * 56 / [HMOT](CARD0).encoder.00.velocity
setp scale.0.gain = {inst-gear-ratio}
It is cold in the basement, and I would prefer not to spend a couple of hours motionless in front of the control trying every imaginable combination of syntax idea
Cheers,
Mark
While I am also thinking spindles:
I currently have:
The VFD analog command voltage:
net spindle-vel-cmd-rpm-scaled => [HMOT](CARD0).7i83.0.1.analogout0
...and the spindle RPM measured from the encoder
net spindle-vel-fb-rps <= [HMOT](CARD0).encoder.00.velocity
In between these two is a dumb back gear and a dumb variator, and without feedback the gear ratio, and this the scale value for to scale the VFD analog command voltage to RPM is unknown.
To caclulate my instantenous gear ratio, I need to multiply the frequency by a constant to give motor RPM, and then divide encoder RPM. That value can then be setp'd to scale.0.gain
I read that HAL supports all the maths operations of the rtapi_math.h, but I could not find any syntax examples. Do I need any braces or brackets to for this? Can you use HAL signals and HAL pins as variables?
If you have to do this with INI variables, how do you get the value out of a HAL signal into the INI variable?
setp inst-gear-ratio <= spindle-vel-cmd-rpm-scaled * 56 / spindle-vel-fb-rps
verses
setp inst-gear-ratio <= [HMOT](CARD0).7i83.0.1.analogout0 * 56 / [HMOT](CARD0).encoder.00.velocity
setp scale.0.gain = {inst-gear-ratio}
It is cold in the basement, and I would prefer not to spend a couple of hours motionless in front of the control trying every imaginable combination of syntax idea
Cheers,
Mark
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1565
- Thank you received: 573
30 Nov 2025 17:02 #339505
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Hi Unlogic,
I took a look at using your code, but I have the opposite problem. Your spindle stops abruptly with max braking with the enable pin deactivated, but mine just disconnects the power section and lets it coast down.
I took a look at using your code, but I have the opposite problem. Your spindle stops abruptly with max braking with the enable pin deactivated, but mine just disconnects the power section and lets it coast down.
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1565
- Thank you received: 573
05 Dec 2025 10:24 #339755
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Here is the update on my VFD braking.
The following user(s) said Thank You: tommylight, Unlogic
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1565
- Thank you received: 573
24 Feb 2026 20:00 #343425
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Weird one here. I have three physical buttons on my control panel connected to halui.spindle.0.forward, halui.spindle.0.reverse, and halui.spindle.0.stop. These are working normally.
But if I type an M3 or M4 command, I get no spindle rotation. It was working before, and just stopped working abbruptly. I would have expected the external buttons to trigger the same signal path as M3 M4? Any thoughts what I need to be looking for would be appreciated.
Cheers,
Mark
But if I type an M3 or M4 command, I get no spindle rotation. It was working before, and just stopped working abbruptly. I would have expected the external buttons to trigger the same signal path as M3 M4? Any thoughts what I need to be looking for would be appreciated.
Cheers,
Mark
Please Log in or Create an account to join the conversation.
- Dudelbert
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 7
24 Feb 2026 20:30 #343427
by Dudelbert
Replied by Dudelbert on topic Schaublin 125-CNC retrofit.
I may be totally wrong, but I think when using M3 for the first time in MDI after startup, you need to give it a speed (M3 S400). Afterwards, that speed is assumed.
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1565
- Thank you received: 573
24 Feb 2026 20:55 #343430
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Thanks, but I gave it an S command, both on a separate entry before, and on the same entry as the M3, but that doesn't correct it. When I command spindle on with S100 M3, the green spindle turning indications on the Gmoccapy display goes on, but the VFD is not commanded. Pushing the physical button I get both the display indication, and the spindle turning.
Please Log in or Create an account to join the conversation.
- Finngineering
- Away
- Premium Member
-
Less
More
- Posts: 87
- Thank you received: 40
25 Feb 2026 12:28 #343461
by Finngineering
Replied by Finngineering on topic Schaublin 125-CNC retrofit.
I have no real idea what may be the problem. But for troubleshooting, check pins:
spindle.0.on
spindle.0.forward
spindle.0.reverse
linuxcnc.org/docs/html/man/man9/motion.9.html
If you have spindle.0.on and spindle.0.forward on/true after a M3 command, then I imagine you have a HAL configuration problem. Have you published your configuration somewhere?
spindle.0.on
spindle.0.forward
spindle.0.reverse
linuxcnc.org/docs/html/man/man9/motion.9.html
If you have spindle.0.on and spindle.0.forward on/true after a M3 command, then I imagine you have a HAL configuration problem. Have you published your configuration somewhere?
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1565
- Thank you received: 573
25 Feb 2026 13:50 #343466
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Thanks for looking at it.
I was also thinking that the last major change I did was to wire in the spindle VFD brake command. The system worked fine for some time after that, and then didn't.
I did add some Classic ladder Fu in there as well, but that was to the brake command, and spindle brakes normally when I stop it with the external button. I suspect there is something there though, like maybe the physical buttons change switches off the brake command, but the M3/M5 doesn't.
I have the HAL uploaded to the first thread, but haven't uploaded the most recent change, so I will update it this evening.
I was also thinking that the last major change I did was to wire in the spindle VFD brake command. The system worked fine for some time after that, and then didn't.
I did add some Classic ladder Fu in there as well, but that was to the brake command, and spindle brakes normally when I stop it with the external button. I suspect there is something there though, like maybe the physical buttons change switches off the brake command, but the M3/M5 doesn't.
I have the HAL uploaded to the first thread, but haven't uploaded the most recent change, so I will update it this evening.
Please Log in or Create an account to join the conversation.
Moderators: piasdom
Time to create page: 0.189 seconds