Ethercat HAL driver

More
06 Apr 2014 16:36 #45609 by Coyote
Replied by Coyote on topic Ethercat HAL driver
Second hypotesis:

1. lcec_write command sends outputs to queue
2. exit form servo thread
3. at pre-determined time datagram is sent and received, latched inputs are stored in a buffer
4. wait interrupt - servo thread
5. read latched inputs from buffer
6. compute output
back to step 1.

This is more likely what is happening and it's compatible to your model.

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

More
07 Apr 2014 02:36 #45628 by roschi
Replied by roschi on topic Ethercat HAL driver

...
What is begging me is the fact that you read inputs first, you process and then you output the new states. In some literature this is so called IPO cycle (input/process/output). From what I understood a single frame of ethercat consists of output that is sent from master and slave encodes the into the same frame on the fly its inputs.
...

addf lcec.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf lcec.write-all servo-thread

I try to express the questions around the topic time delay in simple words and based on my experiences for LinuxCNC

The ethercat master makes the Ethernet Hardware send 'one' standard frame with a size of several bytes every 1000 µs.
The frame pass all slaves and the last slave sends the frame back to the master. This round trip of the frame takes
in general less than 10 µs.
The slaves read and/or write from/to this 'one' frame on the fly.

The function calls in the HAL configuration shown above do the following things in core. Times are approx. and should be seen as an EXAMPLE. Bus cycle time = servo thread = 1000 µs.

--- lcec.read-all --- start t=0 µs
ecrt_master_receive (ec_master_t *master)
--> receive frame from Ethernet Hardware (the frame is already there because the bus rate is much bigger than round trip time of the frame )
ecrt_domain_process (ec_domain_t *domain)
--> interpret the frame data
EC_READ_U32(DATA_feedback)
--> copy data e.g. to HAL pins (data_feedback was written to the frame by the slaves at t = -5µs)
--- lcec.read-all --- end t=20 µs

--- motion-* --- start t=20 µs
calculate new DATA_demand
--> write something to DATA_demand with or w/o depending on DATA_feedback
--- motion-* --- end t=40 µs


--- lcec.write-all --- start t=40 µs
EC_WRITE_U32(DATA_demand)
--> copy data to 'frame'
ecrt_domain_queue(ec_domain_t *domain)
--> mark frame as queued for sending
ecrt_master_send(ec_master_t *master)
--> make the Ethernet Hardware send the frame which are queued; The slaves read the data_demand from frame at t=65µs
--- lcec.write-all --- end t=60 µs

The next 940 µs nothing happens.
So in systems theory the sampling rate / control rate is 1 bus cycle time.

You could also see the test code for RTAI in the EtherLAB EtherCAT Master documentation/code. Where the nessesary function calls are shown in simple examples.

I'm not a expert in EtherCAT. I only make use of the great work from people at IgH (etherlab.org), S. Ittner (EtherCAT HAL Driver) and the development community of LinuxCNC.

Best Regards
Andreas
The following user(s) said Thank You: Nico2017

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

More
07 Apr 2014 15:01 #45642 by Coyote
Replied by Coyote on topic Ethercat HAL driver
After reading the examples of IgH my "second hypotesis" was born, and with your additional explanaton there is no doubt anymore. As said before, it was just non logical sequence of processing data when I looked at the first time : read input ->process-> write output .

Thank you for the explanation, and also others involved S.Itnner, IgH,.... Very good driver from Sacha, indeed. The future is here.

Regards, MArko.

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

More
11 Apr 2014 00:48 #45804 by narogon
Replied by narogon on topic Ethercat HAL driver
Hi everybody,

I've achieved some results!!

I can communicate with the drives in RT and even I've created some pyvcp to command position, to see the current state and to change the controlword



For coding the state depending of the first 7 bits of the statusword (6041) I've created a small function and installed it with comp

Next steps: Try with 4 drives and implements a delta kinematic!!

I can share all the codes if you need them!

Best Regards,
Nacho
Attachments:

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

More
11 Apr 2014 02:21 #45815 by willrat
Replied by willrat on topic Ethercat HAL driver
Nacho,

I would be interested in seeing any information or config files relating to using these drives with linuxcnc.

We have a Panasonic A5 drive we will be using in a machine; I'm reliably informed that the Omron G5 drives are actually made by Panasonic and they are the same drives (and quite economical too!)

I assume you have still got some work todo to get the drive into the OP state to issue motion commands?

Regards
Will

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

More
18 Apr 2014 18:34 #46075 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
Hi Roschi
I am new to Linux cnc i have messed around with it years ago using the parallel port but nothing major. i have just stared a conversion of a
RF45 clone and i saw your video of the estun pronet drive i already have this drive but mine is the pronet 8A same encoder but i have a ethercat box added
to the side it has the 2 ports you use in the video but i was told that these will not work for ethercat i brought it from estun in china 3 months ago. due to work
i have not sorted out using this drive withe liniux cnc. i will be back home in a month and start getting it all together
i have started on the xml file following your guide for the indra drives i am a little lost there. but as yet i am not able to test as none of my computers ethernet ports were compatible
so i ordered a new computer with a compatible chipset. I would appreciate any incite you have into setting up this drive
Warren

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

More
20 Apr 2014 13:32 - 20 Apr 2014 13:34 #46128 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
Ok I have just found out that they have now fully integrated Ethercat into the drive and it is no longer a add on module
but from what i see it is still the same if it all works out i will buy the rest of these drives for my mill i want to do a 5 axis machine.
After seeing Roschi's effort with this drive i have a idea now of where i have been going wrong and i cant want until I finish this work tour
so i can try it out. also Roschi on your video at the beginning you have the drive as a Pronet E but this drive will not support the absolute encoder
but i see you say it is a Pronet 10A like my 8A.
p.s. what is the current 10.04 Lucid Lynx kernel version? Is it 2.6.32
Warren
Last edit: 20 Apr 2014 13:34 by wazza77.

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

More
21 Apr 2014 01:30 #46145 by roschi
Replied by roschi on topic Ethercat HAL driver

... Roschi on your video at the beginning you have the drive as a Pronet E but this drive will not support the absolute encoder but i see you say it is a Pronet 10A like my 8A.
Warren


Hi Warren,

I have the drive 'Pronet-10AEA-EC' and the motor EMJ-10ASB22 in use for the A-Axis ( Image/link ,4th axis, with battery unit --> multiturn absolut, 17 bit). If and only if the suffix '-EC' is added in the drive specification it is EtherCAT field bus. It does not depend on the design of the housing (external or internal RJ45 connectors). If you have RJ45 connectors and no '-EC' named on the drive it is the MODBUS version.


If more and more and more succes stories rise up with the use of EtherCAT drives and LinuxCNC the 'community' can start the disccusion about a special driver (=kernel module) or setup wizzard for drives which use EtherCAT and the CIA 402 profile. (Like the concept of the software 'TwinCAT', XML Files, Project setup files,....)
Up to now I hear/read of people using drives from Bosch Rexroth, LTI, Delta, Omron, Panasonic Minas 5, Estun...
--> Should we start/expand the LinuxCNC wiki about this experiences?

But keep in mind. The EtherCAT will 'taint' the LinuxCNC because it is not licensed under GPL. (I'm not really sure about that; There was/is a controverse disscusion)
Perhaps it should be better to switch to Powerlink to get industrial digital drives working with LCNC.

Regards
Andreas

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

More
21 Apr 2014 05:18 - 21 Apr 2014 05:53 #46148 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
Hi Roschi

My drive is Pronet-08AMA-E with an EC100 EtherCAT module. If you look at the ethercat users manual V1.1 it is described in it i have looked everywhere for the v1.2 manual but i can't
find it. drives labeled Pronet-E-8 for example wont support the absolute Encoder and also wont support the external EC100 module. i have been back to Estun and i see that they have
Released new drives like yours with the erthercat system integral to the unit I must have just revived old stock! not that important as long as i get it working!

I think you are right about success stories this is almost a plug and play CNC system when you look at other systems out there Ethercat makes a lot of sense
The only reason why i started my project was because i watched your video. I wanted to do one before this and i had built drives on the uhu servo drive design
but i found the system unreliable and with my work i will be away for a month at a time so when i get home i don't want to spend my time trouble shooting i would like to be machining.

i have read the posts about the license issues and i could see both sides points it is a shame because this could (with some effort ) become a very polished
system like you say you could load the product xml and automatically generate the HAL .xml . I see where you are coming from with powerlink. with a powerlink
stack under a bsd lenience on sourcforge and i have already found a supplier of powerlink servo drives with the absolute encoders in china i saw them at a trade fair.
Might have to pay them a visit next time I am back in china

I was following your document on the Bosch Rexroth drives and i wanted something a little less expensive so i thought i would blaze my own trail and go with Estun
But you beat me to it :). I have been trying to get my head around it all and following your example but as you show in your video i can hook it up and talk straight away with the
Ethercat master. but I am afraid i will need your help with the hal file I am a little lost with some of it your video helped a lot and i will give it a few more goes but i think i will need help.
i love the no homing this is why i wanted the Estun drive

Well i better get back to work Happy Easter
Warren
Last edit: 21 Apr 2014 05:53 by wazza77.

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

More
21 Apr 2014 07:19 - 21 Apr 2014 16:52 #46157 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
My biggest problem right now is trying to get NC-cycle time and the watchdog also if you are looking for the pdo for torque it is 0x6077 and it is given as per 1000 of rated torque

edit.
OK i see you have this already i don't know why this isn't listed in the manual. i have found your
.xml file i understand now use sdo raw commands to configure the drive and the rest is history
thanks. also i now have manual v1.02 there is a lot more information in there now and some parts have been
clarified recived a quote on the new drives they are cheaper because i don't have to buy an EC 100 module
Last edit: 21 Apr 2014 16:52 by wazza77.
The following user(s) said Thank You: Nico2017

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

Time to create page: 0.175 seconds
Powered by Kunena Forum