- Configuring LinuxCNC
- Advanced Configuration
- EtherCAT
- In using ECR60+NPN(GPIO), I encountered an issue.
In using ECR60+NPN(GPIO), I encountered an issue.
25 Nov 2023 18:41 - 25 Nov 2023 20:20 #286483
by MakerYang
In using ECR60+NPN(GPIO), I encountered an issue. was created by MakerYang
I have a machine configuration for XYZBC, and previously, control in the simulation worked fine. However, recently, during real-world testing, I encountered the following issue: I have only enabled the NPN limit switch on the X-axis, and the switch is connected to a GPIO pin on the control board. It can trigger the limit properly, and the motor runs through the homing process as expected. However, the X-axis position information reported by the system remains unchanged, causing no movement of the tool in the GUI. I have searched through a lot of information and noticed that most people are using the internal homing function of ECR60. Could you provide some insights into how to resolve my issue?
Attachments:
Last edit: 25 Nov 2023 20:20 by MakerYang.
Please Log in or Create an account to join the conversation.
25 Nov 2023 22:11 #286503
by rodw
Replied by rodw on topic In using ECR60+NPN(GPIO), I encountered an issue.
Hi, I don't think many people at all have got cia402 internal homing working but this recent post might have solved it.
forum.linuxcnc.org/ethercat/44508-etherc...mary?start=30#282793
I might add that the cia402.comp was written before custom homing capability was included. The correct way today would be to write a custom homecomp as discussed in the docs here linuxcnc.org/docs/devel/html/man/man9/homecomp.9.html (and also in code)
This overwrites homing.c which contains a big state machine. Many of the states can be skipped with cia402 internal homing as basically you start homing and wait until its done.
I started with this, then the base linuxcnc code was changed (to make it easier for people) which obsoleted my efforts.
my not working obsolete repo is here github.com/rodw-au/ciahome
A home component for cia402 would be a valuable contribution to linuxcnc.
forum.linuxcnc.org/ethercat/44508-etherc...mary?start=30#282793
I might add that the cia402.comp was written before custom homing capability was included. The correct way today would be to write a custom homecomp as discussed in the docs here linuxcnc.org/docs/devel/html/man/man9/homecomp.9.html (and also in code)
This overwrites homing.c which contains a big state machine. Many of the states can be skipped with cia402 internal homing as basically you start homing and wait until its done.
I started with this, then the base linuxcnc code was changed (to make it easier for people) which obsoleted my efforts.
my not working obsolete repo is here github.com/rodw-au/ciahome
A home component for cia402 would be a valuable contribution to linuxcnc.
Please Log in or Create an account to join the conversation.
26 Nov 2023 04:10 - 26 Nov 2023 05:04 #286527
by MakerYang
Replied by MakerYang on topic In using ECR60+NPN(GPIO), I encountered an issue.
After following the documentation to compile and configure everything, there were no errors during runtime. Additionally, I would like to point out a mistake in the documentation: 'joint.N.is_custom-homing' should be 'joint.N.is-custom-homing', otherwise it results in an error.
Following the above configuration, the problem still persists. When homing, the motor moves, but the tool position in the AXIS simulation does not change.
I am hoping to use a different GPIO connection for homing operations, such as the GPIO17 on a Raspberry Pi, instead of the internal method of the EtherCAT driver. I am not sure if the method you mentioned supports such an operation?
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.000
BASE_PERIOD = 200000
SERVO_PERIOD = 1000000
HOMEMOD = armcnc_homecomp
#*******************
# AXIS X
#*******************
net x-pos-cmd <= joint.0.motor-pos-cmd
net x-vel-cmd <= joint.0.vel-cmd
net x-pos-fb <= joint.0.motor-pos-fb
net x-enable <= joint.0.amp-enable-out
net x-pos-cmd => cia402.0.pos-cmd
net x-pos-fb => cia402.0.pos-fb
net x-enable => cia402.0.enable
setp cia402.0.csp-mode 1
setp cia402.0.pos-scale 10000
net x-statusword lcec.0.0.cia-statusword => cia402.0.statusword
net x-opmode-display lcec.0.0.opmode-display => cia402.0.opmode-display
net x-drv-act-pos lcec.0.0.actual-position => cia402.0.drv-actual-position
net x-drv-act-velo lcec.0.0.actual-velocity => cia402.0.drv-actual-velocity
net x-controlword cia402.0.controlword => lcec.0.0.cia-controlword
net x-modes-of-operation cia402.0.opmode => lcec.0.0.opmode
net x-drv-target-pos cia402.0.drv-target-position => lcec.0.0.target-position
net x-drv-target-velo cia402.0.drv-target-velocity => lcec.0.0.target-velocity
net debounce-home-x debounce.1.0.in <= armcncio.gpio.x-home
net both-home-x debounce.1.0.out
net both-home-x => joint.0.home-sw-in
net both-home-x => joint.0.neg-lim-sw-in
net both-home-x => joint.0.pos-lim-sw-in
net x-request-custom-homing <= joint.0.request-custom-homing
net x-is-custom-homing => joint.0.is-custom-homing
Following the above configuration, the problem still persists. When homing, the motor moves, but the tool position in the AXIS simulation does not change.
I am hoping to use a different GPIO connection for homing operations, such as the GPIO17 on a Raspberry Pi, instead of the internal method of the EtherCAT driver. I am not sure if the method you mentioned supports such an operation?
Last edit: 26 Nov 2023 05:04 by MakerYang.
Please Log in or Create an account to join the conversation.
26 Nov 2023 07:46 #286531
by rodw
Replied by rodw on topic In using ECR60+NPN(GPIO), I encountered an issue.
Yes, you can home normally without using cia402 using linuxcnc's default method.
This is what I do on my ethercat machine (except I use a Rtelligent or Weipu ethercat I/O module)
I have attached my hal file. You'll see i have commented outand replaced with
This is what I do on my ethercat machine (except I use a Rtelligent or Weipu ethercat I/O module)
I have attached my hal file. You'll see i have commented out
#net 0-home-index <= joint.0.index-enable => cia402.0.home
net 0-home lcec.0.3.in-04 => joint.0.home-sw-in
Please Log in or Create an account to join the conversation.
26 Nov 2023 08:40 #286534
by Hakan
Replied by Hakan on topic In using ECR60+NPN(GPIO), I encountered an issue.
Bring up "halshow" and watch the relevant variables for position feedback lcec.0.0.actual-position cia402.0.drv-actual-position cia402.0.ps-fb and joint.0.motor-pos-fb (you see the chain how the motor position comes in) to see where the position value gets lost, if it does get lost.
Please Log in or Create an account to join the conversation.
26 Nov 2023 11:23 #286542
by rodw
Replied by rodw on topic In using ECR60+NPN(GPIO), I encountered an issue.
Because movement is happening outside of linuxcnc, following errors happen quickly as actual position is not changing. you need to set certain positions to actual position on every call to the component while it is homing. I can't find Domic's original cia402 post where this was dscussed.Bring up "halshow" and watch the relevant variables for position feedback lcec.0.0.actual-position cia402.0.drv-actual-position cia402.0.ps-fb and joint.0.motor-pos-fb (you see the chain how the motor position comes in) to see where the position value gets lost, if it does get lost.
Please Log in or Create an account to join the conversation.
26 Nov 2023 16:40 #286558
by endian
Replied by endian on topic In using ECR60+NPN(GPIO), I encountered an issue.
excuse me gentelmen,
dominiks original post
every driver has own homing procedure and should be different from general CIA402 standard... firstly you have to have a look in the ethercat manual of your driver and should simulate it just via terminal or windows twincat3 enviroment ... I have done internal homing in the old standard DS402 which cia402 is based on... lets have a look to ds402 component ... maybe should help you...
in homing there are some delay++ counter because the scan cycle..
I have working with kollmorgen drivers for years and find very similar drivers (rebrand kollmorgen s3xx) pilz pmctendo... all stuff around looks same but homing sequence and interpolation position input has different shape...
But new drivers with cia402 standard are on the way... they will come in next weeks and I should check cia402 homing too...
but time, time is very important level and for rural guy it is too much...
regards Slav
dominiks original post
every driver has own homing procedure and should be different from general CIA402 standard... firstly you have to have a look in the ethercat manual of your driver and should simulate it just via terminal or windows twincat3 enviroment ... I have done internal homing in the old standard DS402 which cia402 is based on... lets have a look to ds402 component ... maybe should help you...
in homing there are some delay++ counter because the scan cycle..
I have working with kollmorgen drivers for years and find very similar drivers (rebrand kollmorgen s3xx) pilz pmctendo... all stuff around looks same but homing sequence and interpolation position input has different shape...
But new drivers with cia402 standard are on the way... they will come in next weeks and I should check cia402 homing too...
but time, time is very important level and for rural guy it is too much...
regards Slav
Please Log in or Create an account to join the conversation.
26 Nov 2023 18:43 #286567
by rodw
Replied by rodw on topic In using ECR60+NPN(GPIO), I encountered an issue.
@foxington, your link takes me to the component source code, not the actual forun post, Was that what you intended?
Please Log in or Create an account to join the conversation.
26 Nov 2023 18:54 #286569
by endian
Replied by endian on topic In using ECR60+NPN(GPIO), I encountered an issue.
I am sorry, my missread ... I though you want to read original code ... I saved them for bad times...
Please Log in or Create an account to join the conversation.
26 Nov 2023 19:55 #286574
by Hakan
Replied by Hakan on topic In using ECR60+NPN(GPIO), I encountered an issue.
That was interesting anyway, it says that the cia402 component gives the commanded position back as actual position, without checking with the drive. When it finds that the drive is in internal homing state.
No wonder there is no motion in the gui.
No wonder there is no motion in the gui.
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- EtherCAT
- In using ECR60+NPN(GPIO), I encountered an issue.
Time to create page: 0.126 seconds