Lathe with C axis (almost done, need some help)

More
23 Aug 2016 20:34 #79339 by emcPT
Chears,

Currently working on a retrofit of a large lathe. Until now we have X Z and spindle working. We are also able to move correctly the spindle in controlled fashion as the original drive (Siemens) have two modes: spindle or axis, so basically we are able to precisely "jog" the spindle to a position that we want, so very close from having a C axis.
However we are only able to do this with the spindle disconnected, this is, or we have a spindle on the configuration or a C axis. Why? Because when the spindle rotates the C axis is moving for a position that is not being commanded, so a following error pops out.

Would a mux be a solution? Or a better approach is recommended? Would like to receive recommendations before trying things that already have a solution for.

Maybe someone on the forum already have a C axis working? Do you know any? If so please step in or tell me who.

Thank you!

www.eusurplus.com
Attachments:

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

More
24 Aug 2016 12:48 - 24 Aug 2016 15:57 #79353 by andypugh

Why? Because when the spindle rotates the C axis is moving for a position that is not being commanded, so a following error pops out.

Would a mux be a solution?


Not really, because whenever you activate the C-axis the machine will try to unwind every revolution that the spindle has done since power-up

You probably want to use the "orient" HAL component to give you an output for the PID that is only the fractional portion of the spindle position.

I would be tempted to just short-circuit the C-axis following error (net axis.C.motor-position-cmd => axis.C.motor-position-fb ) as a runaway of the spindle isn't really that much of a disaster.
Last edit: 24 Aug 2016 15:57 by andypugh.

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

More
24 Aug 2016 15:55 #79358 by jtc
Hi.


We are currently working on a lathe retrofit that has livetool and Caxis. The spindle drive has 2 modes, to control the spindle mode and axis mode.

These 2 modes are configured and "working" on linuxcnc. In spindle mode i can command the speed and in if I run in axis mode I can control the angle.

The big problem is when try to mix both. By default when linuxcnc starts it is in C axis mode. I can home it, and jog. Then I have a Mcode to change to Spindle mode. when it changes to spindle mode, to prevent the C axis have follwing error I fix the c-pos-fb to be equal to c-pos-cmd. I'm able to set rpm speed and everything looks ok... but in Spindle mode the encoder position keeps refreshing like ii shoult, and when change to C axis mode again, the feedback value don't match the c-pos-cmd (axis.5.motor-pos-cmd) and obviously I get a following error.

Another issue is that in Spindle mode the C axis DRO should update between 0 and 360º like I see in most machines.

I can try a work around orienting the spindle and creating a "virtual encoder" but i think that isn't the way to solve this problem, and I will never be able to see the degrees changing on C axis DRO when in Spindle mode.


So, the problem looks relatively simple, If I'm in Spindle mode, the c-pos-cmd (axis.5.motor-pos-cmd) should match his encoder input (c-pos-fb), so the DRO updates, when change back to C axis mode, c-pos-cmd and c-pos-fb match (no following error will occur), so it will operate in C axis mode.


Where can I look in the source code to try to implement this?



João

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

More
24 Aug 2016 15:59 #79359 by andypugh

Where can I look in the source code to try to implement this?


I think you can do it all in HAL, no need to make a custom LinuxCNC version.
The following user(s) said Thank You: emcPT

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

More
24 Aug 2016 17:49 #79367 by emcPT
Can you share your thoughts about implementing this in HAL? If true then we would have a C axis working in no time!

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

More
24 Aug 2016 18:15 #79368 by andypugh

Can you share your thoughts about implementing this in HAL? If true then we would have a C axis working in no time!


It will be a bit like spindle-orient (and, for most lathe work, using M19 rather than a C-axis is probably appropriate)
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient
(look at the svg image)

You would need to link the position command to the C-axis position rather than motion.spindle-orient-angle and use an M-code to switch modes rather than motion.spindle-orient

You could use (orient.N.poserr + axis.c.position-command) as the feedback term, but set the f-error to a bit more than one spindle revolution. There are more elaborate ways to do it, but I am not sure that it is worth it. (when you enable the C-axis the spindle can be up to one full turn out of position, so you would need to cunningly ramp-in the C-axis.

An alternative might be to only enable the PID on a falling-edge of spindle-index-enable, and to run the spindle slowly with the index enabled from the M-code that switches mode.
The following user(s) said Thank You: emcPT, jtc

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

Time to create page: 0.076 seconds
Powered by Kunena Forum