Question about live tooling

More
04 Apr 2021 17:41 #204789 by Anonymous
Hello everyone!

I have a lathe with an X- and Z-Axis and I'm driving the Spindle with a Servo Motor(130st m10015) over a timing belt.
I currently only have control over the Spindle Speed.
I would like to use live Tooling on this machine by controlling the position of the Servo spindle(I think it would be called the C-Axis).
Sorry for my ignorance but i have no idea how to do this and cant seem to find a lot in the internet about how to set this up.
Could i just wire up the spindle with pulse/dir signals and configure it as the 4th-Axis in stepconf? But how would linuxcnc switch between speed and Position control? Is it just a G- or M-Code?
I would appreciate any help.

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

More
04 Apr 2021 18:37 #204799 by andypugh
Typically you would set up two PID controllers to control the spindle.
One would be used for speed control, the other for position control.

You can either use the M19 command to switch mode and set the angle, or create a custom M-code to do the same thing and run the spindle as a C-axis.

The logic is shown in this diagram:
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient

But note that the spindle pin names have changed, and the (for example) motion.spindle-orient it now spindle.0.orient
The following user(s) said Thank You: NewGuyJim

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

More
04 Apr 2021 19:04 #204802 by andypugh

note that the spindle pin names have changed, and the (for example) motion.spindle-orient it now spindle.0.orient


I changed the file

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

More
05 Apr 2021 10:50 #204876 by Anonymous
Wow
Thanks for the quick reply.
I would like to wire the servo spindle in a closed loop system, because my breakout board doesn't accept any encoder inputs. Sorry for my ignorance but do I really need encoder feedback, or could i just use the spindle index as a Reference for the Spindle?
Sorry for my ignorance but I'm also pretty new to HAL and don't really know how this works. Are there any examples or presets for this? If not I'm ready to learn something new.
Attachments:

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

More
05 Apr 2021 13:08 #204893 by andypugh

I would like to wire the servo spindle in a closed loop system, because my breakout board doesn't accept any encoder inputs


Do you mean "open loop"?

I assume that you are controlling the spindle with step-dir pulses?

Are you using a velocity-mode stepgen to control the spindle speed?

If you are, then are you happy to use M19 for C-axis positioning, or does it need to be controlled by a C-command in the Gcode?

I can see two ways to do this, either with two stepgens (one in velocity mode, one in position mode) and switching the step/dir source with a bit-type mux_generic .

Or, keep the single stepgen and add a PID to control it when in position mode. This would look like a sub-set of the diagram posted earlier, except that the velocity PID is removed (as is much of the downstream stuff) and stepgen position-fb is used in place of encoder feedback.

You would use a mux to switch the velocity command from straight spindle.0.speed control to pid.spindle control. I _think_ that the "orient" command is clever enough to allow for the (thousands) of complete revolutions "in" the stepgen.
You don't get consistent orient to a spindle encoder this way. That would matter if you planned on leaving the part in the chuck through shutdowns.

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

More
05 Apr 2021 15:40 #204910 by Anonymous
Yes I meant open loop, sorry.
No I'm not controlling the spindle speed with step/dir pulses but the servo drive does have these inputs though(haven't wired them up yet).
I currently control the spindle speed with an analog voltage.
I want to use an analog voltage to control the spindle speed for turning and step/dir pulses when using C-axis.
The servo drive could switch between speed and position control (I'd probably do this with a relay).
I'm not using step/dir pulses for turning because I think it would be a bit too much for my PC, so i would like to switch between speed and position control like that.

Another question could i just hook the servo drive up over rs232 or rs485 to a usb port and let linuxcnc control the speed/position of the servo like that, or would that not work?

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

More
05 Apr 2021 16:36 #204918 by andypugh

Y
I want to use an analog voltage to control the spindle speed for turning and step/dir pulses when using C-axis.
The servo drive could switch between speed and position control (I'd probably do this with a relay).

Are you sure that the drive supports changing command type on the fly?

Another question could i just hook the servo drive up over rs232 or rs485 to a usb port and let linuxcnc control the speed/position of the servo like that, or would that not work?


That might be possible. Is there a LinuxCNC HAL driver for the drive?
The following user(s) said Thank You: Anonymous

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

Moderators: piasdom
Time to create page: 0.075 seconds
Powered by Kunena Forum