Spindle Step/Dir and as C axis one the same Servo

More
2 years 2 months ago #308984 by ustaL

do you have a servo driver that can work in two independent modes step/dir (position), and analog input (velocity mode)? take a look at the video, I did it by introducing ``A `` as standard axis for changing the position, and the motor rotates like a classic lathe through the gcode M3 ``S``command by analog signal.
 
I saw your lathe. Yes, my servo could work with analog and step/dir. But my board 7i95T hasn't analog output. But this is not a problem (my spindle works via S3, M codes fine). Main issue for now is "when the spindle rotates in velocity mode pos-cmd change (stepgen module) it's value, but axis A (joint and pid modules) have old one". From LinuxCNC perspective Axis A have no action, but stepgen "somehow" changed it's position (because there is another module spindle and spindle.pid who send commands for velocity). To avoid this issue I'm making reset BEFORE using Axis A, and rotate to 0.0 AFTER using Axis A (so stepgen pos-cmd became 0.0, joint became 0.0, pid.a became 0.0). Then I making reset (block pos-cmd to change it's value) and start working with Spindle (velocity mode). So only in this case pid.a == joint == stepgen.pos-cmd == 0.0 EVEN is stepgen is rotating via Spindle commands.
So if you have tips how I could switch back to Velocity mode without rolling back to pos-cmd == 0.0 -> please give an advice.
How to fix out of sync joint/pid.a-axis pos-cmd with stepgen, when spindle/pid.spindle works with the same stepgen. I feel it looks like the problem should be resolved in 1-2 rows in HAL/INI file.

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

More
2 years 2 months ago #308996 by PCW
I would always leave the stepgen in velocity mode
and use a mux component to switch the source of the
stepgen velocity command from the PID output (C mode)
to commanded spindle speed (spindle mode)

Then a change to velocity mode is trivial. To maintain
position reference when changing back to C mode, you likely
need to home the C axis to index. Does the spindle have an encoder?

If not, a single index input will do if you have 7I95T firmware
with Step/Dir index (7i95t_sdid.bin)

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

More
2 years 2 months ago #309013 by Masiwood123
I don't know how linuxcnc can bypass the count of Axis since it uses the same step generator for two modes. I believe it can, that's more a question for professionals, from my point of view I'm not very far from ``pncconfig``-:). in my case, i bypassed it with only one relay that changes the mode on the driver via the M command M64, M65. but since you don't have an analog output, unfortunately really don't know how to help.

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

More
2 years 2 months ago #309038 by ustaL

Then a change to velocity mode is trivial. To maintain
position reference when changing back to C mode, you likely
need to home the C axis to index
. Does the spindle have an encoder?
That's correct. And I'm asking if is it possible not to take any action and just enable Spindle.
Example: spindle mode -> axis mode -> rotate to 300 degrees -> enable spindle with MDI command
How it works now: spindle mode -> axis mode -> rotate to 300 degrees ->rotate back to 0.0 -> enable spindle with MDI command

For the first mode change Spindle to Axis I'm, disabling (stepgen.position-reset = true). It mean that nothing happen with stepgen.position-fb (it be 0.0 instead of rotation count). So when I'm enabling Axis with joint.pos-fb == 0.0 everything is fine. But I can't do it twice OR I need somehow set stepgen.position-fb to zero with joint.pos-fb before enable Spindle mode.

 

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

More
2 years 2 months ago - 2 years 2 months ago #309040 by PCW
I'm not sure I understand, the stepgen position feedback
should not be connected to anything when in spindle mode.
Last edit: 2 years 2 months ago by PCW.

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

More
2 years 2 months ago #309083 by ustaL

I'm not sure I understand, the stepgen position feedback
should not be connected to anything when in spindle mode.
Stepgen has two connections. To Spidnle and Axis. That's why it has both feedbacks: velocity-fb and position-fb.
 

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

Time to create page: 0.414 seconds
Powered by Kunena Forum