In using ECR60+NPN(GPIO), I encountered an issue.

More
2 years 11 months ago - 2 years 11 months ago #286483 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?  

 

File Attachment:

File Name: machine_20...1-25.hal
File Size:6.51 KB

 

File Attachment:

File Name: machine_20...1-25.ini
File Size:3.55 KB

 

File Attachment:

File Name: machine_20...1-25.xml
File Size:7.22 KB
Last edit: 2 years 11 months ago by MakerYang.

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

More
2 years 11 months ago #286503 by rodw
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.

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

More
2 years 11 months ago - 2 years 11 months ago #286527 by MakerYang
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.
Code:
[EMCMOT] EMCMOT = motmod COMM_TIMEOUT = 1.000 BASE_PERIOD = 200000 SERVO_PERIOD = 1000000 HOMEMOD = armcnc_homecomp
Code:
#******************* # 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: 2 years 11 months ago by MakerYang.

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

More
2 years 11 months ago #286531 by rodw
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 out 
Code:
#net 0-home-index <= joint.0.index-enable  => cia402.0.home
and replaced with
Code:
net 0-home          lcec.0.3.in-04          => joint.0.home-sw-in

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

More
2 years 11 months ago #286534 by Hakan
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.

More
2 years 11 months ago #286542 by rodw

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.
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.

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

Time to create page: 0.314 seconds
Powered by Kunena Forum