Homing signal processing

More
09 Jul 2023 21:45 #275089 by saiko
Replied by saiko on topic Homing signal processing
Hello Masa,

I will be looking into this problem as I have Nanotec C5-E drives controlled with CiA 402. I am a programmer in general but I'm new to linuxcnc.
If I understand correctly, the problem with using linuxcnc homing method is propagation delays in EtherCAT, although they are short, it still affects the home position of axis because the control loop is through master and that's bad.

Therefore servo amplifier's internal homing procedure is better.
I come from open source world and I can't find official CiA 402 documentation , which as far as I know is free, so I'm not even sure which addresses belong to CiA 402.

thank you.

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

More
09 Jul 2023 22:00 #275091 by rodw
Replied by rodw on topic Homing signal processing

Hello Masa,

I will be looking into this problem as I have Nanotec C5-E drives controlled with CiA 402. I am a programmer in general but I'm new to linuxcnc.
If I understand correctly, the problem with using linuxcnc homing method is propagation delays in EtherCAT, although they are short, it still affects the home position of axis because the control loop is through master and that's bad.

Therefore servo amplifier's internal homing procedure is better.
I come from open source world and I can't find official CiA 402 documentation , which as far as I know is free, so I'm not even sure which addresses belong to CiA 402.

thank you.


The second post gives links to what you need to study.
It's not really necessary to fully understand as Dominc's cia402.comp manages all the modes and how to enter homing. But ideally it would be replaced with a custom homemod.
If you look at homing.c there is a huge switch statement dealing with all the steps for Linuxcnc homing. But if you use internal homing, most can be skipped. Just start homing and wait until done, then carry on.

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

More
10 Jul 2023 02:20 #275117 by Masa
Replied by Masa on topic Homing signal processing
Hello, saiko, rodw

The purpose of my question in this thread is to find a way to use the Homing mode signal, Index-enable, for synchronous operation such as thread cutting with LinuxCNC. There is no Index-enable like the Encoder module for the signal of the driver directly operated by EtherCAT. That was the problem, but I got advice from many people and solved it by creating an external module.

Regarding the delay in signal processing that saiko was worried about, I found that I didn't have to worry about the error in reading the timing of the coordinates by using the signal processing in the touch-probe of the servo driver. Since resetting the Encoder count is done in the servo drive, there was almost no synchronization deviation.

This turned out to be a simpler solution than dealing with signal processing delays in Index-enable with Beckhoff EM-7004, other systems using EtherCAT and LinuxCNC.

If you are satisfied with the processing just by homing the servo amplifier, there will be no problem with your proposal, but please understand that it cannot be solved for synchronous operation such as thread cutting.

I hope that LinuxCNC's EtherCAT driver will be able to handle all the processing perfectly. But that was my conclusion because I couldn't wait.

Thank you for your suggestions.

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

More
12 Aug 2023 21:40 #277758 by saiko
Replied by saiko on topic Homing signal processing
So turns out that I simply used cia402 hal component and it worked. Turns out that for this component the joint.N.index-enable signal is used simply to detect that we initiated homing sequence by clicking Home button. During homing procedure your position will change and it will trigger "following error" in LinuxCNC. But really, since I use servo drive I have following error calculation done inside a servo so the solution is to simply set FERROR and MIN_FERROR to some very high number and now I can home my drives using any internal method my servo drive supports.    

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

More
13 Aug 2023 00:43 #277780 by Masa
Replied by Masa on topic Homing signal processing
I use a Yaskawa Electric servo amplifier. It is CiA402 compatible on spec. Yaskawa's servo amplifier is Sigma-X series. Absolute encoder is the standard position detector. The output to EtherCAT is set to output as an incremental encoder. According to the manual, "Touch Probe Function (690B8h)" has a setting of "Trigger with encoder zero signal (C phase)" in bit-1 or bit-2. The trigger result is stored in "Touch Probe 1 Position Value (60BAh)" or "Touch Probe 2 Position Value (60BCh)". If you use this value to update the Encoder value on the LinuxCNC side, the error caused by the EtherCAT delay will disappear.

So I made a hal component.
component toggle2index "Index-Enable signal processing component for Yaskawa_SGDXS-xxxxA0x";
//
//    Copyright (C) 2023 Masao Sakai <msakai@sakaigiken.co.jp>
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
//
author "Masao Sakai";


pin in bit tgl_in = false                        "Toggle bit for touch probe trigger signal";
pin io bit index_enable = false            "Connect the joint.N.index-enable signal";
pin in float tchprb_pos                            "Touch probe position value";
pin in float cmd_pos                                "Connect the joint.N.motor-pos-cmd signal";
pin in float sv_ac_pos                            "Position Actual Value";
pin out float tg_pos                                "Interpolation Data Record(60C1h)";
pin out float fb_pos                                "Connect joint.N.motor-pos-fb signal";
pin out float fb_vel                                " ";
pin out float fb_rps                                " ";

param rw float scale = 0.001                    "Encoder and joint unit conversion scale";
param rw float revcount = 10000                "Number of pulses per rotation of encoder";

variable bool old_tgl = false;
variable bool toggled = false;
variable float old_fbpos = 0;
variable float offset = 0;

function _;
license "GPL"; //indicates GPL v2 or later
;;

// Memorize that the toggle signal has switched
    if (old_tgl ^ tgl_in) {
        old_tgl = tgl_in;
        toggled = true;
    }

//Reset the encoder counter and memorize the reference position
// when toggled and index-enable is ON
    if index_enable {
        if (toggled && index_enable){
            offset = tchprb_pos;
            index_enable = false;
        }
    }
    toggled = false;
    fb_pos = (sv_ac_pos - offset) * scale;
    tg_pos = cmd_pos / scale + offset;
    fb_vel = (fb_pos - old_fbpos) / fperiod;
    fb_rps = fb_vel / (revcount * scale);
    old_fbpos = fb_pos;


Please let me know if there are any issues with the components.
I'm not an English-speaking person, so there may be inconvenient descriptions.


The driver of the EtherCAT Endcorder adapter coped with the fact that there was no speed calculation, and it was possible to avoid the inconvenient phenomenon of PID control due to the delay during synchronous operation such as thread cutting.

Please understand that the reason why I do not use homing processing on the servo amplifier side is that I use the synchronous operation function of LinuxCNC.

In addition, failure to properly set error judgments such as FError may cause machine accidents. Setting an inappropriately large value is not recommended to avoid errors in the amplifier's computational behavior.

thank you
The following user(s) said Thank You: rodw

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

Time to create page: 0.194 seconds
Powered by Kunena Forum