Threading problem

More
15 Nov 2015 01:36 - 15 Nov 2015 01:39 #65265 by brianbonedoc
I hope the gurus can help.
I am having trouble getting the lathe to thread anything that looks decent.
Basic machine - grizzly 0602, Mesa 5i25->C35 BOB. Encoder is 1024 PPR w/ A,B,Z
Running Tormachs PathPilot version of Linuxcnc

When I run the G76 threading it works, but the threads look awful, like it's starting a little bit off with each pass.
I attached the hal and ini files - which are largely unchanged from their original for their lathe. I only really changed the encoder scale to 4096 to reflect my quadrature encoder.

Here is how the encoder is attached to the spindle - w/ a 1:1 pulley (maybe off by about 3% however)


Here is a video of the crappy threading:



Here is a video of the same code but turning the spindle by hand to show synchronized motion w/ Z-axis




Heres the snippet of the encoder part of .hal file:

# Spindle Encoder
setp hm2_5i25.0.encoder.00.counter-mode 0

# setting scale negative makes spindle position increase in CW
# and decrease in CCW - if this not done threading and rigid tapping stall
# perhaps swapping the A-B encoder inputs would have the same effect
# for quad encoder change counter mode to 0 above and scale below to 1024x4=-4096

setp hm2_5i25.0.encoder.00.scale -4096
setp hm2_5i25.0.encoder.00.filter 1

# see 'man hostmot2' for descriptions
setp hm2_5i25.0.encoder.00.index-mask 0


net spindle-position hm2_5i25.0.encoder.00.position => motion.spindle-revs
net spindle-raw-velocity hm2_5i25.0.encoder.00.velocity => motion.spindle-speed-in lowpass.0.in
net spindle-velocity lowpass.0.out
net spindle-index-enable hm2_5i25.0.encoder.00.index-enable <=> motion.spindle-index-enable

# note: gpio pins only read at servo thread frequency
# these nodes are only for driving diagnostic "LEDs" in the UI
# this is only going to be useful when the spindle is rotated by hand slowly
net spindle-phase-A hm2_5i25.0.gpio.014.in
net spindle-phase-B hm2_5i25.0.gpio.015.in
net spindle-phase-Z hm2_5i25.0.gpio.013.in_not

Hope you guys have some ideas!
Thanks!
Brian



File Attachment:

File Name: tormach_la...5i25.ini
File Size:4 KB
Attachments:
Last edit: 15 Nov 2015 01:39 by brianbonedoc.

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 05:56 #65267 by cmorley
Replied by cmorley on topic Threading problem
What have you done to diagnose your problem?
What happens if you slow the spindle down?
It's hard to see in your video if the index position is changing.

First thing that comes to mind is the encoder index not being consistent. This could be mechanical slip.
If you rotate the spindle one rev does the encoder count aprox 4096?
how about if you rotate several times? Does the index stay in the same place?

The next is electrical interference of the pulses.
Are you using differential wiring? a- a+ b- b+ i- i+

Chris M

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 06:28 - 15 Nov 2015 06:30 #65269 by brianbonedoc
Replied by brianbonedoc on topic Threading problem
Chris thanks for the tips.
I don't think it's mechanical slip as the encoder is all in one not a diy optical disc.

My feeling is that something is funky with the index pulse.
When I put the oscilloscope on the A and B leads I get pretty nice looking square waves, the index pulse is a square wave too, but for some reason a little more rare on the scope.

I will try to rotate the spindle by hand and check the encoder counts tomorrow.

I did slow the spindle down to 400 rpm, and still get crummy looking threads.

The wiring from the encoder is 5 leads - a shield and common - which I tied together. A +V power, and then the A,B,Z single wires. I don't have separate A+ and A- , B+/B-, etc., leads.

It runs in shielded cable to an aviation connector on the NEMA box I have everything in.
Last edit: 15 Nov 2015 06:30 by brianbonedoc.

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 06:53 #65270 by Rick G
Replied by Rick G on topic Threading problem
As Chris said it looks like your set up might be subject to slippage with what looks like a v belt instead of a timing belt.

Rick G

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 10:23 - 15 Nov 2015 13:02 #65274 by cncbasher
Replied by cncbasher on topic Threading problem
try setting counter mode to 1 as here
setp hm2_5i25.0.encoder.00.counter-mode 1

also can you show a better picture of the result , a static pic will be better than a vid , so we can see clearly
also you would be better as has been mentioned on using a timing belt and pullys

can you also send me or post your gcode you used
this is so i can mimic your setup ,

i'm currently working on pathpilot so i'll take a closer look and if needed i'll modify it

i have a feeling this is also a little to do with sync ,
so how are you connecting your encoder mechanicaly to the spindle ?
and which encoder is it your using ?
Last edit: 15 Nov 2015 13:02 by cncbasher.

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 13:04 - 15 Nov 2015 13:04 #65279 by cncbasher
Replied by cncbasher on topic Threading problem
this looks more as if the vfd is possibly over running and slipping on it's reverse ,
this is where toothed pullys and belts come in .

thought i'd clarify our thoughts
Last edit: 15 Nov 2015 13:04 by cncbasher.

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 18:51 - 15 Nov 2015 18:51 #65292 by brianbonedoc
Replied by brianbonedoc on topic Threading problem
Rick and Chris - I am fairly certain the belt isn't slipping, it's pretty tight and there is almost no resistance on the encoder.

CNCBasher - I think you are on to something with the scale.

I did a test, turning the spindle by hand over 10 revolutions I get the scale at 4134 PPR rather than the 4096 - this obviously is the small mismatch between my encoder pulley and the spindle pulley.

Any ideas how to alter the hal file. I tried just changing the encoder scale to 4134 but that didn't seem to make a difference as I think the index pulse would need to be scaled too?

Basically the math seems that 1 revolution of the spindle = (4134/4096) = 1.00928 revolutions of the encoder.
Last edit: 15 Nov 2015 18:51 by brianbonedoc.

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 21:34 #65299 by cncbasher
Replied by cncbasher on topic Threading problem
Chances are the pulleys on the encoder and spindle are not identical.

Please Log in or Create an account to join the conversation.

More
15 Nov 2015 21:52 #65301 by brianbonedoc
Replied by brianbonedoc on topic Threading problem
Exactly - I can adjust the scale to account for it but how do i adjust for the index being off a bit in Hal?

Please Log in or Create an account to join the conversation.

More
16 Nov 2015 01:27 #65305 by joekline9
Replied by joekline9 on topic Threading problem
:(
Adjusting the scale will NOT work. You MUST have a positive 1:1 ratio spindle to encoder.
At least the index pulse must be 1:1.
Please save youself a lot of trouble and get a timing belt or gears.

Please Log in or Create an account to join the conversation.

Time to create page: 0.265 seconds
Powered by Kunena Forum