Lathe C axis homing

More
6 months 3 weeks ago #345379 by jetbadger
Replied by jetbadger on topic Lathe C axis homing
I indeed have all the axis stepgens in control_type=1, really all I changed from yours in spindle config are the step and encoder scaling pretty much.

That was sort of a weird for me that other axis work fine, but C axis has this choppy behaviour. Obviously it's the only one with actual feeedback but I tried looping back stepgen pos-fb instead of encoder feedbackk in the hal, which should in my head mirror the setup of x and z axis, however the choppiness still remained. Unless I'm missing something silly again

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

More
6 months 3 weeks ago - 6 months 3 weeks ago #345380 by spumco
Replied by spumco on topic Lathe C axis homing
I really don't know the answers here, but maybe some things you can try while you wait for someone smart to chime in...

Disconnect the encoder feedback and just use the stepgen position  - i.e. run it open loop.  Still choppy?

EDIT - nevermind, you already did that

Check the step-to-distance values.  Do you have really coarse steps per degree/rotation or something?  I'd start by:
  • Figuring out the maximum input frequency of your drive
  • Do some math
  • Set the drive's internal steps-per-rotation to as high as possible without exceeding the max input freq at your maximum spindle speed
  • Adjust INI & HAL files so the spindle and axis steps-per-whatever match your new drive parameter values

    I don't know if either of these will help, but they're free to test.
Last edit: 6 months 3 weeks ago by spumco.
The following user(s) said Thank You: jetbadger

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

More
6 months 3 weeks ago #345386 by jetbadger
Replied by jetbadger on topic Lathe C axis homing
I _will_ try to do the feedbback test again as I think I only connected the stepgen fb to joint fb, not pid fb aswell.

The drive is at 10000 PPR and around 1.45:1 spindle:motor overdrive, from my calculations 6k rpm spindle speed is around the limit. there is a 2500 step/10k line encoder on the spindle itself I use for feedback.

I am looking through the HAL again and wondering maybe I DO have the scaling wrong? Though the positions and speeds report correct, maybe the scales are backwards, the end math turns out correct, but calculations midway are off? I'm trying to think of anything now, really.
  • -ENCODER_SCALE is 10000
  • -Spindle SCALE is 114.83 (10000/1.45/60) (not sure why it needs to be divided by 60 though? I assume because RPS instead of RPM, but I thought this value should not be bound by time, only steps/rev? I'm not sure...
  • -JOINT_2 (C axis in my case) SCALE is 19.07 (10000/1.45/360). I turned on the scale switching in M102/103, not sure how you get it to work without that?
What makes me think that I have something off is the scaling by 360 of the enc-pos signal in the HAL. As in I have 10000 lines per rev, so multiplying it by 360 instead of dividing makes no sense to me the way I have it now. 

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

More
6 months 3 weeks ago #345401 by spumco
Replied by spumco on topic Lathe C axis homing
Yea, scaling and all the math made my brain hurt.

First, it helped me to stop thinking of INI file terms like ENCODER_SCALE whenever they are used to set the value of something in HAL.  Think about the underlying pins when working on the math, not the arbitrary INI parameter name.  I got confused (still do) between all the various 'NNN_SCALE' things in INI and would mix up what was affecting what.  Helps when you write them out all in one place:
  • encoder.N.scale = [SPINDLE_N] ENCODER_SCALE = 10000
  • stepgen.N.position-scale = yada yada yada

So hurdle #1 - spindle and c-axis are in different units.  Spindle is in revolutions, c-axis is in degrees.  This causes brain hurt.

#2 - as you noticed, spindle scale is a velocity thing, so it's a RPM/RPS formula not steps per degree.

#3 - remember that my spindle drive is internally in velocity mode ONLY, and my stepgen is always in velocity-mode... so I don't switch the stepgen position-scale via M102/103.

If you are switching the drive internally, you will almost certainly need to change the stepgen scale for each drive mode.
The following user(s) said Thank You: jetbadger

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

More
6 months 2 weeks ago #345509 by jetbadger
Replied by jetbadger on topic Lathe C axis homing
That makes sense, I didn't really think of what the INI parameter is actually connected to, but that makes sense now.

I'm still not wrapping my head fully around the velocity/position mode thing. It does make sense that if you have the drive in same scale and always in velocity mode both in stepgen and the drive that the scale shouldn't be crucial and the PID could take care of it, but having it the way I do which is stepgen in velocity and drive in step/dir position mode to me seems like should have to be the same thing, but it isn't for some reason.

I've spent some time today on the schaublin and the C axis hurdle. Some new progress is that I think it all has to do with the PID ratios and acceleration. I played around with it watching the plots and in the end it got slightly better, but the commanded position is still progressing very slow.

I've looped back the stepgen position-fb instead of the encoder for everything and it's still the same as with encoder so I'm still baffled. In that setup it should be the same as X/Z axis but it's still acting drunk. Maybe I'll think of something else as I didn't spend too much time today on that, instead did some other functionality of the machine, which is more practice in hal and ladder so maybe one day it'll all just click :)

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

More
6 months 2 weeks ago #345510 by spumco
Replied by spumco on topic Lathe C axis homing

 In that setup it should be the same as X/Z axis but it's still acting drunk. 

How is the servo connected to the spindle?  My biggest problem a couple years ago when I started fiddling was that my spindle servo was WAY undersized for use as a direct-drive positioning motor.

I had a "2.2kw" BLDC servo connected through a 1.5:1 belt drive.  Soon as I put a chuck on the 5C spindle the inertia ratio was so unfavorable the servo couldn't really handle precise positioning.

I now have a comparatively monsterous 3.7kw (actual rating, not inflated) motor connected to the same spindle through a 2.5:1 belt.  Night and day difference.  That motor can horse the spindle around like it's barely there.

Maybe you have a significant inertia mismatch?  Don't want to throw you a red herring, but something to think about.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.180 seconds
Powered by Kunena Forum