rigid tapping g33.1 isnt working spindle isnt sync
30 Aug 2013 11:49 - 30 Aug 2013 17:14 #38236
by fabworx
rigid tapping g33.1 isnt working spindle isnt sync was created by fabworx
I just now got around to trying to get this to work. as it is now my mill is running. spindle works with my gear change and my screen is updating with rpm and gear selection as it should. however my I never could figure out how to make the ui tell me that a gear change will be needed for the called for rpm. also at lower speeds my on target light does not stay constantly lit. so I didn't realize I had a real problem till I tried to rigid tap today for the first time. cause up until today my parts have been coming out fine.
a little run down on my equipment. the spindle is a two speed gear driven unit that is also belt feed. does that make sense? it also incorporates a power driven draw bar so putting an encoder directly on the final driven spindle is a no go. I have swapped the v belt system for a timing belt arrangement as to have a positive drive with no slip. well limited slip. I have done this so I could mount my encoder directly on the motor shaft.
so all that being said, here is the spindle section of my hal file. I feel like something has to be wrong with how I have connected things in here or haven't connected things correctly. i would appreciate it if I could get some of the expertise that I know is present here on what I should do or what needs attention. thank you in advance.
Denny Reed
a little run down on my equipment. the spindle is a two speed gear driven unit that is also belt feed. does that make sense? it also incorporates a power driven draw bar so putting an encoder directly on the final driven spindle is a no go. I have swapped the v belt system for a timing belt arrangement as to have a positive drive with no slip. well limited slip. I have done this so I could mount my encoder directly on the motor shaft.
so all that being said, here is the spindle section of my hal file. I feel like something has to be wrong with how I have connected things in here or haven't connected things correctly. i would appreciate it if I could get some of the expertise that I know is present here on what I should do or what needs attention. thank you in advance.
Denny Reed
#****************
# Spindle Control
#****************
setp hm2_5i20.0.pwmgen.04.output-type 2
net spindle-enable hm2_5i20.0.gpio.071.out <= motion.spindle-on hm2_5i20.0.gpio.045.out
net spindle-enable => hm2_5i20.0.pwmgen.04.enable
addf flipflop.0 servo-thread
addf mux2.1 servo-thread
setp mux2.1.in0 0.977
setp mux2.1.in1 0.148925
net gearchange-scale-change mux2.1.sel flipflop.0.out
net spindle-encoder-gain scale.4.gain
net spindle-encoder-gain mux2.1.out
addf flipflop.1 servo-thread
addf mux2.2 servo-thread
setp mux2.2.in0 1
setp mux2.2.in1 6.558875
net gearchange-scale-change mux2.2.sel flipflop.1.out
# Set the spindle’s top speed in RPM
setp hm2_5i20.0.pwmgen.04.scale 3540
net spindle-gain scale.3.gain
net spindle-gain mux2.2.out
# controls
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
#****************************
# Spindle Synchronized Motion
#****************************
# add the encoder
setp hm2_5i20.0.encoder.04.counter-mode 0
setp hm2_5i20.0.encoder.04.filter 0
setp hm2_5i20.0.encoder.04.index-invert 0
setp hm2_5i20.0.encoder.04.index-mask 0
setp hm2_5i20.0.encoder.04.scale 8000
net spindle-index-enable <=> hm2_5i20.0.encoder.04.index-enable
net spindle-position hm2_5i20.0.encoder.04.position
net spindle-encoder-speed scale.4.out => motion.spindle-revs
net spindle-velocity hm2_5i20.0.encoder.04.velocity => motion.spindle-speed-in scale.4.in
net spindle-index-enable hm2_5i20.0.encoder.04.index-enable <=> motion.spindle-index-enable
#*****************
# Spindle At Speed
#*****************
addf abs.1 servo-thread
addf abs.2 servo-thread
addf near.0 servo-thread
addf scale.5 servo-thread
net spindle-encoder-speed abs.1.in
net scale6 scale.5.in abs.1.out
setp scale.5.gain 1000
net spindle-encoder-nearout scale.5.out abs.2.in
net spindle-encoder-speed1 abs.2.out near.0.in1
net spindle-rpm-filtered near.0.in2
net spindle-at-speed motion.spindle-at-speed <= near.0.out
setp near.0.scale 1.01
#*********
#RPM Scale
#*********
addf abs.3 servo-thread
setp scale.0.gain 999.9666
setp lowpass.0.gain .005
addf lowpass.0 servo-thread
addf scale.0 servo-thread
#******************
#Spindle Gearchange
#******************
net spindle-cw or2.2.in0
net spindle-ccw or2.2.in1
addf toggle.0 servo-thread
addf gearchange.0 servo-thread
addf scale.3 servo-thread
addf scale.4 servo-thread
setp toggle.0.debounce 0
setp gearchange.0.min1 10
setp gearchange.0.max1 600
setp gearchange.0.min2 500
setp gearchange.0.max2 3595
setp gearchange.0.scale2 6.558875
net spindle-speed-raw motion.spindle-speed-out gearchange.0.speed-in scale.3.in
net spindle-speed scale.3.out hm2_5i20.0.pwmgen.04.value
Last edit: 30 Aug 2013 17:14 by BigJohnT. Reason: add code tags
Please Log in or Create an account to join the conversation.
30 Aug 2013 14:26 #38239
by cncbasher
Replied by cncbasher on topic rigid tapping g33.1 isnt working spindle isnt sync
you realy need to be able to attach the encoder to the spindle side , not the motor for relyable tapping and speed monitoring ,
this may be a pain depending on the spindle arrangement , where space is at a premium I have used automotive hall sensors mounted to sense the final gear teeth as used on antilock braking , with a separate sensor to give one pulse per rev , so you end up with one sensor counting the number of teeth of the gear and one per rev .
this may be a pain depending on the spindle arrangement , where space is at a premium I have used automotive hall sensors mounted to sense the final gear teeth as used on antilock braking , with a separate sensor to give one pulse per rev , so you end up with one sensor counting the number of teeth of the gear and one per rev .
The following user(s) said Thank You: fabworx
Please Log in or Create an account to join the conversation.
30 Aug 2013 17:18 #38241
by BigJohnT
I put speed changes in my G code like this:
JT
Replied by BigJohnT on topic rigid tapping g33.1 isnt working spindle isnt sync
I just now got around to trying to get this to work. as it is now my mill is running. spindle works with my gear change and my screen is updating with rpm and gear selection as it should. however my I never could figure out how to make the ui tell me that a gear change will be needed for the called for rpm. also at lower speeds my on target light does not stay constantly lit. so I didn't realize I had a real problem till I tried to rigid tap today for the first time. cause up until today my parts have been coming out fine.
I put speed changes in my G code like this:
(MSG, Set RPM to 500)
M0
JT
Please Log in or Create an account to join the conversation.
30 Aug 2013 19:27 #38243
by andypugh
I think the problem is here.
motion.spindle-revs is spindle revolutions, not revolutions-per-minute.
This is the value that is scaled to determine what the current Z-height needs to be.
A simple change to this is likely to help.
net spindle-position hm2_5i20.0.encoder.04.position => motion.spindle-revs
net spindle-encoder-speed scale.4.out
[/code]
As you are probably always going to use the same gear for rigid-tapping I would suggest setting the encoder position scale to suit that gear and the belt-drive encoder.
You can get away with having the encoder on the motor as long as the encoder scale is adjusted to suit. You still want the index pulse to be a one-pulse-per-rev directly from the spindle, but that is relatively easy to arrange.
For example, a 1024 pulse encoder on the motor and 45:60 gear ratio would need to set the encoder scale to 1365.3333333 to accurately count spindle rotations
Replied by andypugh on topic rigid tapping g33.1 isnt working spindle isnt sync
I just now got around to trying to get this to work
net spindle-position hm2_5i20.0.encoder.04.position net spindle-encoder-speed scale.4.out => motion.spindle-revs
I think the problem is here.
motion.spindle-revs is spindle revolutions, not revolutions-per-minute.
This is the value that is scaled to determine what the current Z-height needs to be.
A simple change to this is likely to help.
net spindle-position hm2_5i20.0.encoder.04.position => motion.spindle-revs
net spindle-encoder-speed scale.4.out
[/code]
As you are probably always going to use the same gear for rigid-tapping I would suggest setting the encoder position scale to suit that gear and the belt-drive encoder.
You can get away with having the encoder on the motor as long as the encoder scale is adjusted to suit. You still want the index pulse to be a one-pulse-per-rev directly from the spindle, but that is relatively easy to arrange.
For example, a 1024 pulse encoder on the motor and 45:60 gear ratio would need to set the encoder scale to 1365.3333333 to accurately count spindle rotations
Please Log in or Create an account to join the conversation.
30 Aug 2013 21:14 #38246
by fabworx
Replied by fabworx on topic rigid tapping g33.1 isnt working spindle isnt sync
Hi CNC thank you for your help. I have seen your modification to a Bridgeport J head It look like a great idea. However my mill has a enclosed gear box that has the final gear, one that's positively attached, to the spindle at the bottom of the arrangement.
Thanks andy I will be giving this a shot tomorrow when I get home.
Youguys are great I glove this forum lol.
Thanks andy I will be giving this a shot tomorrow when I get home.
Youguys are great I glove this forum lol.
Please Log in or Create an account to join the conversation.
31 Aug 2013 04:23 #38268
by BigJohnT
Are you saying what I'm thinking your saying? In the case where the encoder is not attached to the spindle or geared 1:1 with the spindle don't use the encoder index but rather provide an index directly from the spindle?
JT
Replied by BigJohnT on topic rigid tapping g33.1 isnt working spindle isnt sync
You can get away with having the encoder on the motor as long as the encoder scale is adjusted to suit. You still want the index pulse to be a one-pulse-per-rev directly from the spindle, but that is relatively easy to arrange.
Are you saying what I'm thinking your saying? In the case where the encoder is not attached to the spindle or geared 1:1 with the spindle don't use the encoder index but rather provide an index directly from the spindle?
JT
The following user(s) said Thank You: fabworx
Please Log in or Create an account to join the conversation.
31 Aug 2013 04:30 #38269
by andypugh
The encoder-counter software doesn't know what you have done
Replied by andypugh on topic rigid tapping g33.1 isnt working spindle isnt sync
That's what I am saying.Are you saying what I'm thinking your saying? In the case where the encoder is not attached to the spindle or geared 1:1 with the spindle don't use the encoder index but rather provide an index directly from the spindle?
The encoder-counter software doesn't know what you have done
The following user(s) said Thank You: fabworx
Please Log in or Create an account to join the conversation.
31 Aug 2013 09:05 #38272
by fabworx
Replied by fabworx on topic rigid tapping g33.1 isnt working spindle isnt sync
to make things a little clearer the encoder is mounted directly on the back of the motor. the gear change decides which scale to use by invoking which ultimate gear ratio is being used. so that hasn't been a problem on my gui screen it is outputting the correct rpm for each gear. which is why I couldn't figure out why im having this problem to begin with.
again thank you to everyone for the help.
again thank you to everyone for the help.
Please Log in or Create an account to join the conversation.
31 Aug 2013 09:29 #38273
by andypugh
You can choose a different encoder position scale and velocity scale for each gear, they are live pins. There will be discontinuities, and changing scale on the fly _really_ means that the index has to be on the physical spindle.
Don't expect to rigid tap with a gearchange in the middle. That is possible (in theory) with a spindle encoder, but not if you change the ratio.
Replied by andypugh on topic rigid tapping g33.1 isnt working spindle isnt sync
to make things a little clearer the encoder is mounted directly on the back of the motor. the gear change decides which scale to use by invoking which ultimate gear ratio is being used
You can choose a different encoder position scale and velocity scale for each gear, they are live pins. There will be discontinuities, and changing scale on the fly _really_ means that the index has to be on the physical spindle.
Don't expect to rigid tap with a gearchange in the middle. That is possible (in theory) with a spindle encoder, but not if you change the ratio.
Please Log in or Create an account to join the conversation.
31 Aug 2013 09:34 #38274
by fabworx
Replied by fabworx on topic rigid tapping g33.1 isnt working spindle isnt sync
so what I have here with my gear change function in the hal wont work with rigid tapping?
Please Log in or Create an account to join the conversation.
Time to create page: 0.092 seconds