Ethercat installation summary

More
02 Jan 2022 21:28 #230574 by rodw
Replied by rodw on topic Ethercat installation summary
Hakan, thanks for helping out. Your forum post and video was very helpful when I put this together.
Padstar should refer to your xml file to see how to install his Beckhoff hardware.
forum.linuxcnc.org/ethercat/42048-notes-...aspberry-pi-4#206936

Padstar, you need to create the servo thread in your minimal config. The example in my repo shows how it is done.
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS

loadusr -W ./lcec_conf ethercat-conf.xml
loadrt lcec
loadrt cia402 count=3

github.com/rodw-au/linuxcnc-cia402/blob/main/cia402.hal
cia402 is a standard so it should work for you. Haken used an ETC60 drive and I used its functionally identical but larger ETC86 drive from Rtelligent.
If you do not have documentation, rtelligent have a Google Drive folder containing it and a Windows Program that queries the ethercat devices on the bus. drive.google.com/drive/folders/1qOJOkts4...tsHrmLaM?usp=sharing
You may glean enough info from it to get going.

Its funny, I've installed it twice now both on a clean install of Debian 11 and never had the missing header file bite. I've yet to test the second one with hardware.

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

More
02 Jan 2022 22:04 - 02 Jan 2022 22:13 #230576 by 3radfahrer
Hi rodw, thanks for your initative and efforts on this documentation

last year, I got my machine, runnung with LinuxCNC 2.8, successfully configured to run on EtherCat.
The EK1100 with some IOs are read/writeable and one axis attached to a Servo/Stepper Amplifier from "Technosoft Motion" was controllable from LinuxCNC.
Although I temporalily switched back to "parallel Port only with steppers" - I first have to tune my drive-Amps for smooth stepper-operation - I like to share my (presumably personal) obstacles I had to go File Attachment:
On my own ToDo-List is still a „clean“ documentation of my steps: my notes are containing several deadlock steps. Therefor I plan to set up an EtherCat config again on a clean machine and document my neccessary steps… Since I don‘t know which struggles were my own fault and which are actually important for your documentation, I just discribe them all.
Suggestions and improvements and further hints are welcome File Attachment:


Etherlab
after installing Etherlab, I changed the „DEVICE_MODULES“ in the /etc/default/ethercat file to „e1000e“ which resulted in a kernel-panic after reboot.The correct file that had to be changed was in /opt/etherlab/etc/ethercat.confAdditionally, the file „/opt/etherlab/etc/init.d/ethercat“ has to be modified to point on the ethercat.conf from above

Network Card
the Etherlab master didn‘t work with my onboard network adapter. I got a Intel PCI Network card (82571EB GigE Controller) that works. Supported hardware is listed on the etherlab site www.etherlab.org/en/ethercat/hardware.php

lcec Error on LinuxCNC
startupsince both the Beckhoff EK1100 and my ServoAmps were now visible after „# ethercat slaves“, I also got a lcec-error when starting LinuxCNC. As db1981 already mentioned, after a „make clean“ and „make install“ of the linuxcnc-ethercat driver, this error was solved EtherCat

Statemachine
in order to switch the drives on, I had to go to the defined transitions from the beckhoff statemachine. The solution for me was here deep in the forum: forum.linuxcnc.org/ethercat/22346-etherc...ver?start=850#159273

Generic EC Driver
After that, it was „just“ the configuration of the generic EC-driver with the correct initial-commands for my ServoAmps, since the Technosoft Amplifiers were not natively supported yet. As far as I remember, I got them all out of TwinCAT and the esi-file from the manufacturer of the Amps.

As I said above, any hints or improvements are heartily welcome
Last edit: 02 Jan 2022 22:13 by 3radfahrer. Reason: formatting
The following user(s) said Thank You: rodw

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

More
02 Jan 2022 22:26 #230580 by rodw
Replied by rodw on topic Ethercat installation summary
I think one possible catch is the instructions assume installing to master branch of linuxcnc. Installing it with the adoption of Python 3.9 is a bit tricky. 
Building against the master branch (the default with git clone) and running with an existing 2.8 deb install sound dangerous to me. You could consider checking out the 2.8 branch after cloning linuxcnc if thats the way you want to go. I have not tested it.

I've installed Debian 11 (Bullseye) several times now to totally avoid any Python  2.7 issues which have hurt me in the past. Fortunately, Installing Bullseye is now well documented here
www.qtpyvcp.com/install/bullseye.html
I did review these instructions when they were written and they are solid. Many thanks to Joco James in NZ for writing these. They pull in all the dependencies to run QTPYVCP and QTVCP configs as a bonus.

I did not encounter any deadlocks on a clean install. I do not have any Beckhoff devices yet.

But I have been unable to use the drives cia402 internal homing functions.

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

More
03 Jan 2022 05:31 - 03 Jan 2022 05:57 #230624 by Hakan
Replied by Hakan on topic Ethercat installation summary
Do the ect86 support homing? I don't recall seeing that in the ect60 manual. I think the stepper motors need an index signal for that and there is only A and B on the ones I have, also only inputs for A and B on the drive.
When I installed ethercat on the raspberry it was smooth sailing, none of that ecrt.h nonsense. The only thing I can think of I made different was to reboot after installing etherlab-master, which is mandatory it said. But I knew better this time and didn't do that, perhaps I should have restarted.
Last edit: 03 Jan 2022 05:57 by Hakan.

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

More
03 Jan 2022 06:03 #230628 by rodw
Replied by rodw on topic Ethercat installation summary

Do the ect86 support homing? I don't recollect seeing that in the ect60 manual.


Yes, the ETC60 and ETC86 both support internal homing and there are several homing methods using home switches similar to Linuxcnc's homing sequence. The one I was interested in was the stall homing methods. I thought these were part of the CIA402 standard.

From reading the CIA402 component docs, it indicated that that the drives would home using the index signal.I found that they would commence their cycle and would stop if the sensor was triggered but they issued a following error soon after.

I concluded that the component assumed it homed to an index on the drive as you mentioned. I don't know about the linuxcnc homing code to work around this. It would be pretty cool to home without home switches.

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

More
04 Jan 2022 12:26 #230751 by db1981
Hi people,

unfortunaly i have work for ~24h a day at the moment, so linuxcnc time is reduced...

@rodw

may be i did misunderstand something:

-does your drive starts its internal home function?
-the following error is in the drive? at the moment the drive finished its internal homing?

if yes: you have to set the homepositions from lcnc and the drive to the same values. That means if the drive finished its home routine and resets his poscounter to 0 for example the home position from the lcnc joint has to be the same value.
Because after finishing the internal routine and setting the drives pos register , op mode changes back to position mode. If in this moment the command position from lcnc is different to the drives internal position, the drives raises his following error.
it is right that lcnc sets an offset on the feedback position at the homing end cycle and zeros the DRO or set it to ini homeposition, but in the situation with an drive in position mode the commanded signal to the drive has to be equal to the drives feedback.

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

More
04 Jan 2022 16:51 #230779 by rodw
Replied by rodw on topic Ethercat installation summary

Hi people,

may be i did misunderstand something:

-does your drive starts its internal home function?
-the following error is in the drive? at the moment the drive finished its internal homing?


Yes, this what I observed.
I was reviewing homing.c source and I noted that V 2.9 as a new .INI value for homing HOME_INDEX_NO_ENCODER_RESET
Ref: linuxcnc.org/docs/devel/html/config/ini-...dex_no_encoder_reset
Source: github.com/LinuxCNC/linuxcnc/blob/master...otion/homing.c#L1104
		if (H[joint_num].home_flags & HOME_INDEX_NO_ENCODER_RESET) {
		   /* Special case: encoder does not reset on index pulse.
		      This moves the internal position but does not affect
		      the motor position */
		   offset = H[joint_num].home_offset - joint->pos_fb;
		   joint->pos_cmd          += offset;
		   joint->pos_fb           += offset;
		   joint->free_tp.curr_pos += offset;
		   joint->motor_offset     -= offset;
		}

I will see if this setting helps but from what you have said,pos_fb might need to be set to pos_cmd

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

More
05 Jan 2022 12:15 - 05 Jan 2022 12:19 #230857 by rodw
Replied by rodw on topic Ethercat installation summary
Hmm, this is strange. I got my ECT86 CIA402 drive to home internally in an unexpected way but it forgets to tell Linuxcnc its homed.
Here's how (Must use V 2.9):
In the ini file set 
HOME_USE_INDEX = YES
HOME_INDEX_NO_ENCODER_RESET = YES (new in V 2.9)
do not set HOME_SEARCH_VEL 
set HOME_LATCH_VEL = internal drive homing velocity (converted from pulses per second set in drive)
Connect a proximity sensor to home input (ECT60/ECT86 = input 5)
Make sure the input is set to home function (ECT60/ETC86 = default function for input 5
Turn Linuxcnc on
Press home all and wait for inevitable joint following error. This leaves the drive in a unanticipated state (I think)
Power cycle the drive
Turn on Linuxcnc (orange button)
A few seconds later, the drive will enter its internal homing mode and will commence motion
Trigger the proximity sensor against some  metal.
The drive will stop motion
Remove the sensor from the metal and the drive will home internally!
Linuxcnc does not know it though.

Don't ask how I worked this out. First time was an accident. Then it took ages to work out a repeatable process.

So I think the cia402.comp is buggy. From the ECT60 manual, we may need to wait for the status to change so I have to look at the cia402.comp code..
Last edit: 05 Jan 2022 12:19 by rodw.

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

More
06 Jan 2022 08:23 - 06 Jan 2022 08:24 #230928 by db1981
ok,

is there a manual for your drives for download?

cia402 works as follows :

-home triggerd by lcnc
-cia sets op mode to home
-cia waits that drive has changed op mode to home
-cia sets the home bit
-if the drive clears the is_homing bit and has set the homed bit, cia tells lcnc that homing is finished and sets drive mode back to position.

with the drives i had for testing  (nanotec and stöber) it has worked.
Last edit: 06 Jan 2022 08:24 by db1981.

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

More
06 Jan 2022 08:53 #230929 by rodw
Replied by rodw on topic Ethercat installation summary
Yes, its in a shared google drive folder here:
drive.google.com/drive/folders/1qOJOkts4...tsHrmLaM?usp=sharing

Homing is covered from Page 42.
It does not appear to change to opmode = 6 on a home all from axis.
To me the docs imply that we should wait for the change to opmode is confirmed in the status word but you component does not do that.

Enable Homing mode:
To enable the zero return mode, the value of object dictionary 6060h (operation mode) must beset to 0006h. The object dictionary 6061h (operation mode display) can be used to confirm whether the drive has entered the correct operation mode.


I was going to see if I could rewrite the homing so it followed a state machine switch statement to track the states.

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

Time to create page: 0.098 seconds
Powered by Kunena Forum