EtherCAT servo as main spindle

More
10 months 4 weeks ago #339733 by Hexagon
The problem in spindle mode is, that the cia402 pos-fb is mapped to joint motor-pos-fb, but joint motor-pos-cmd is fixed. So joint f-error increases over time. Now I'm not sure how to solve this problem, cause I can't manipulate joint motor-pos-cmd. One way would be to freeze joint motor pos-fb, this way there is no f-error and track the movement to set an offset. But I can't figure out how to solve this, without writing to joint motor-pos-cmd.

The following error should also be a problem for aDm1N. But I assume it is less important, cause he only has 8000inc/rev, where I have 131072inc/rev, so the error adds up much slower. This would also explain FERROR = 1000000 in his ini.

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

More
10 months 4 weeks ago #339734 by Aciera
I'm not familiar with ethercat but the somewhat 'established' strategy when switching between spindle and rotary is to use a hal component to freeze the encoder position feedback when switching to spindle mode and reposition the spindle using M19 before switching back to rotary mode and reconnecting the encoder signal.

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

More
10 months 4 weeks ago #339735 by Hakan
I thought ADm1N solved this with the c_pos_sync component?

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

More
10 months 4 weeks ago #339736 by Hexagon
The sync component only calculates the c-pos-sync.0.pos_cmd_out, but has no effect to the joint.0.motor-pos-cmd.

It takes joint.0.motor-pos-cmd as c-pos-sync.0.pos-cmd-in and joint.0.motor-pos-fb as c-pos-sync.0.pos-fb_in. The calculated delta is called offset. So in spindle mode cmd_out = fb_in, but cmd_in is fixed. That results in the following joint error.

FUNCTION(_) {
    if (!c_mode_active) {
        offset = pos_fb_in - pos_cmd_in;
        pos_cmd_out = pos_fb_in;
    } else {
        pos_cmd_out = pos_cmd_in + offset;
    }
}

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

More
10 months 4 weeks ago #339744 by Hexagon
I noticed that if I disable the machine the joint.0.motor-pos-cmd tracks the joint.0.motor-fb. So I set up a new hal file with only one cia402 and no cia402pv. Because you can't change the mode of the cia402 while LinuxCNC is running, I change between CSP and CSV by writing directly into the mode of the frequency drive via EtherCAT.

In CSP mode cia402.0.pos-fb -> joint.0.motor-pos-fb. 
In CSV mode joint.0.motor-pos-cmd -> joint.0.motor-pos-fb.

So I have no following error in CSV mode, but I need to change the position before changing from CSV back to CSP or I can turn the machine off and back on again. I built a network with mux2, oneshot and flipflop to toggle the machine for a very short amount and to reset all my mode switching logic. This works surprising well and isn't noticable.

I know that this soultion is not good and only works for my usecase because I only have one servo and nothing gets interrupted by the power cycle.

The bigger problem is that my gcode file gets stopped aswell and I can't resume. Maybe there is a way by tracking the executed lines and then starting from there... But I'm not happy with the power cycle solution in the first place.

Is there any other situation where joint.0.motor-pos-cmd tracks joint.0.motor-fb?

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

More
10 months 3 weeks ago - 10 months 3 weeks ago #339754 by Aciera
You can also disable motion by setting 'motion.enable' to FALSE but machine state will still be switched to Off.

the relevant code section is here:
github.com/LinuxCNC/linuxcnc/blob/master...tion/control.c#L1465

If it is possible to do this for a specific joint during program execution would have to be explored. I expect that the interpreter would need to restarted at the very least.
Last edit: 10 months 3 weeks ago by Aciera.

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

Time to create page: 0.360 seconds
Powered by Kunena Forum