Schaublin 125-CNC retrofit.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19767
- Thank you received: 4589
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: 237
- Thank you received: 118
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: 1538
- Thank you received: 571
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: 1538
- Thank you received: 571
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: 1538
- Thank you received: 571
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.
Moderators: piasdom
Time to create page: 0.091 seconds