G32 sync spindle to Z axis lathe

Moderators: TomKerekes, dynomotion

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Thu Jul 18, 2019 1:55 am

i was just setting the Feed high so i could just rock the chuck back and forth by hand and get a long distance out of the Z

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Fri Jul 26, 2019 1:10 am

hmmmm, so i tried to cut some threads today and the Z axis was acting very lazy
i can tell the Z axis has a slow start and end. i think it might not even get up to the full cutting speed

sample of my code i was running....

Code: Select all

N158 G00X0.5 Z0.1  

N163 G97 S800  
     g04p2
N164 X0.285 Z0.02 G95 
N165 X0.235 Z0.02 
N166 G01 X0.228 Z0.02 F0.0492 
N167 G32 X0.228 Z-0.45 
N168 G00 X0.285 Z-0.45 G95 
N169 X0.285 Z0.02 
N170 X0.235 Z0.02 
N171 G01 X0.2252 Z0.02 F0.0492 
N172 G32 X0.2252 Z-0.45 
N173 G00 X0.285 Z-0.45 G95 
N174 X0.285 Z0.02 
N175 X0.235 Z0.02 
N176 G01 X0.223 Z0.02 F0.0492 
N177 G32 X0.223 Z-0.45 
N178 G00 X0.285 Z-0.45 G95 
N179 X0.285 Z0.02 
N180 X0.235 Z0.02 
N181 G01 X0.2211 Z0.02 F0.0492 
N182 G32 X0.2211 Z-0.45 
N183 G00 X0.285 Z-0.45 G95 
N184 X0.285 Z0.02 
N185 X0.235 Z0.02 
N186 G01 X0.2194 Z0.02 F0.0492 
N187 G32 X0.2194 Z-0.45 
N188 G00 X0.285 Z-0.45 G95 
N189 X0.285 Z0.02 
N190 X0.235 Z0.02 
N191 G01 X0.218 Z0.02 F0.0492 
N192 G32 X0.218 Z-0.45 
N193 G00 X0.285 Z-0.45 G95 
N194 X0.285 Z0.02 
N195 X0.235 Z0.02 
N196 G01 X0.2166 Z0.02 F0.0492 
N197 G32 X0.2166 Z-0.45 
N198 G00 X0.285 Z-0.45 G95 
N199 X0.285 Z0.02 
N200 X0.235 Z0.02 
N201 G01 X0.2153 Z0.02 F0.0492 
N202 G32 X0.2153 Z-0.45 
N203 G00 X0.285 Z-0.45 G95 
N204 X0.285 Z0.02 
N205 X0.235 Z0.02 
N206 G01 X0.2141 Z0.02 F0.0492 
N207 G32 X0.2141 Z-0.45 
N208 G00 X0.285 Z-0.45 G95 
N209 X0.285 Z0.02 
N210 X0.235 Z0.02 
N211 G01 X0.213 Z0.02 F0.0492 
N212 G32 X0.213 Z-0.45 
N213 G00 X0.285 Z-0.45 G95 
N214 X0.285 Z0.02 
N215 X0.235 Z0.02 
N216 G01 X0.213 Z0.02 F0.0492 
N217 G32 X0.213 Z-0.45 
N218 G00 X0.285 Z-0.45 G95 
N219 X0.285 Z0.02 
N220 X0.235 Z0.02 
N221 G01 X0.213 Z0.02 F0.0492 
N222 G32 X0.213 Z-0.45 
N223 G00 X0.285 Z-0.45 G95 
N224 X0.285 Z0.02 
N225 X0.235 Z0.02 
N226 G01 X0.213 Z0.02 F0.0492 
N227 G32 X0.213 Z-0.45 
N228 G00 X0.285 Z-0.45 G95 
N229 X0.285 Z0.02 
N230 X0.3 Z0.0 M05
N233 M30 

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Sun Aug 11, 2019 6:08 pm

so i got the lathe working productively but it does some strange cut with the G32 mode
looks like the G32 does not start at the same spindle index.
my servo has a 18T pulley and the lathe spindle is 26T (belt drive)
i am assuming the encoder on the servo is the start index and this changes over time too
going off this info i would need an index signal right on the lathe spindle right?
a hall sensor would be easy enough to mount.
any recommendations on the software and input?
i can get a 26T pulley for the servo to make it 1:1 ratio but i fear for the max RPM it could run the spindle!
thanks

picture of the varying pitch

Image

User avatar
TomKerekes
Posts: 2543
Joined: Mon Dec 04, 2017 1:49 am

Re: G32 sync spindle to Z axis lathe

Post by TomKerekes » Sun Aug 11, 2019 6:56 pm

Hi turbothis,

You should be able to get it to work without requiring a index signal.

It is unfortunate that 26/18 isn't a simple number but if you use enough digits (8) any round off error causing a drift should be negligible over a reasonable time. Maybe a few degrees of drift after spinning at 10000RPM for an hour.

What is the resolution of your spindle encoder? What exact value did you enter for the Threading Counts/rev?
Regards,

Tom Kerekes
Dynomotion, Inc.

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Mon Aug 12, 2019 4:25 pm

can there be a code written to have the g32 start on every (EXAMPLE) 45th start on the servo. like when the spindle and servo teeth align again....
i got 8192 count servo
servo drives a larger pulley at 0.69 ratio
so 11872.46 counts per revolution
Last edited by turbothis on Mon Aug 12, 2019 4:40 pm, edited 1 time in total.

User avatar
TomKerekes
Posts: 2543
Joined: Mon Dec 04, 2017 1:49 am

Re: G32 sync spindle to Z axis lathe

Post by TomKerekes » Mon Aug 12, 2019 4:36 pm

Hi turbothis,

You should be more exact. Try: 11832.8889
Regards,

Tom Kerekes
Dynomotion, Inc.

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Mon Aug 12, 2019 4:42 pm

hmmm i must have botched my numbers along the way
i will try that
thanks

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Mon Aug 12, 2019 5:32 pm

it still cuts the thread at different spindle starts.

User avatar
TomKerekes
Posts: 2543
Joined: Mon Dec 04, 2017 1:49 am

Re: G32 sync spindle to Z axis lathe

Post by TomKerekes » Mon Aug 12, 2019 6:30 pm

Hi turbothis,

Possibilities are the number is still incorrect or the encoder is simply not working properly.

You might do some sort of sanity experiments. Such as:

1 mark the Spindle angular position
2 record the KMotion.exe Axis Position
3 manually rotate the Spindle 100 revolutions and to the same angular position
4 verify the Position count changed by 1183289 counts +/- several counts depending on the accuracy of your mark.
Regards,

Tom Kerekes
Dynomotion, Inc.

turbothis
Posts: 309
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: G32 sync spindle to Z axis lathe

Post by turbothis » Mon Aug 12, 2019 6:46 pm

i get 1187246 (multiple times)
i run the spindle as the rotary axis for 3600 degrees (100 spins) and it shows about 6 degrees extra.
of course i cant count the 100 spins to make sure that happened though...

i run the A axis 36000 and back to 0 and it shows spot on the mark

Post Reply