- Posts: 2180
- Thank you received: 905
Schaublin 125-CNC retrofit.
- spumco
- Offline
- Platinum Member
-
Less
More
11 months 4 days ago #339361
by spumco
Replied by spumco on topic Schaublin 125-CNC retrofit.
Mark,
My spindle drive enable pin is tied to a 'machine-is-on' signal, and not to the M3/M4/M5 0-10v signal. The drive isn't disabled at M5.
Check your HAL file (and watch the VFD enable pin in halshow) to see if you've got something connected funny.
My spindle drive enable pin is tied to a 'machine-is-on' signal, and not to the M3/M4/M5 0-10v signal. The drive isn't disabled at M5.
Check your HAL file (and watch the VFD enable pin in halshow) to see if you've got something connected funny.
The following user(s) said Thank You: RotarySMP
- RotarySMP
- Offline
- Platinum Member
-
Less
More
- Posts: 1635
- Thank you received: 595
11 months 4 days ago - 11 months 4 days ago #339369
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Well, we now know what I did to set the VFD into "coast down" mode. I pinned the drive enable to spindle on, and just disabled the drive to stop it. Doh! No wonder I didn't document it.
Now I know that, I have a few options.
1/ Use ladder to react to a spindle stop command with an S0, wait a second, and then disable the drive. I had the VFD set for min 20 hz, max 70 Hz, so this would only brake down to 20, and coast down from there. It has the advantage that the spindle is not sitting on an enabled drive with an analog input, which could cause rotation from EMI induced voltage.
2/ Add a 24VDC output, wire that to Pin E3, and command the VFD to brake to a stop. I would probably still add a delay and disable the drive after a couple seconds. That would seem to be the proper way.
3/ But if I am adding another relay to to get me an extra 24VDC out, I may as well add more. Then I can also wire up the electro-mechanical brake, and have both VFD braking and mechanical braking commanded. This would also give me an option to add some ladder logic to use the mechanical brake on an E-stop.
Ideally, I would add the extra outputs with a second 7i84, as I maxed out the current one due to needing one I/O bank on 5V (for the Hall sensors for homing and tool change). I ended up scavenging a few extra outputs by using the unused axis enables on the 7i85, still ran out of 24V outputs, and put in a cheap relay board to use the excess 5V outputs to control 24V loads. I have an 8 relay card floating around, and could bodge that in instead of the 4 relay card to try this all out.
I will make a video to feedback what I actually do.
Cheers,
Mark
Now I know that, I have a few options.
1/ Use ladder to react to a spindle stop command with an S0, wait a second, and then disable the drive. I had the VFD set for min 20 hz, max 70 Hz, so this would only brake down to 20, and coast down from there. It has the advantage that the spindle is not sitting on an enabled drive with an analog input, which could cause rotation from EMI induced voltage.
2/ Add a 24VDC output, wire that to Pin E3, and command the VFD to brake to a stop. I would probably still add a delay and disable the drive after a couple seconds. That would seem to be the proper way.
3/ But if I am adding another relay to to get me an extra 24VDC out, I may as well add more. Then I can also wire up the electro-mechanical brake, and have both VFD braking and mechanical braking commanded. This would also give me an option to add some ladder logic to use the mechanical brake on an E-stop.
Ideally, I would add the extra outputs with a second 7i84, as I maxed out the current one due to needing one I/O bank on 5V (for the Hall sensors for homing and tool change). I ended up scavenging a few extra outputs by using the unused axis enables on the 7i85, still ran out of 24V outputs, and put in a cheap relay board to use the excess 5V outputs to control 24V loads. I have an 8 relay card floating around, and could bodge that in instead of the 4 relay card to try this all out.
I will make a video to feedback what I actually do.
Cheers,
Mark
Last edit: 11 months 4 days ago by RotarySMP.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
11 months 3 days ago #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
- Unlogic
- Offline
- Elite Member
-
Less
More
- Posts: 257
- Thank you received: 128
11 months 2 days ago #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
- RotarySMP
- Offline
- Platinum Member
-
Less
More
- Posts: 1635
- Thank you received: 595
11 months 2 days ago #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
- RotarySMP
- Offline
- Platinum Member
-
Less
More
- Posts: 1635
- Thank you received: 595
11 months 1 day ago #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.
Moderators: piasdom
Time to create page: 0.574 seconds