We've been using @sittner's `linuxcnc-ethercat` for several years now at 
Tormach.  It's a driver for the IgH EtherCAT Master [1].  We use it in the ZA6 
robot arm with Machinekit, and in the new 1500MX milling machine with LinuxCNC. 
 I've also used it in another, very different, robot project with another 
company.  It has worked very well, and we've successfully used it with a 
variety of motor drives, as well as other types of I/O modules and junction 
boxes.

For the CiA402 stuff, we use the `hw_device_mgr` [2].  It's a Python library 
that does quite a lot, working with a wide range of devices in a range of 
applications.  For example, it supports the above-mentioned device types, reads 
EtherCAT ESI XML device descriptions (though I'd like to rewrite that 
ugliness), works with or without ROS, works with Machinekit or LinuxCNC HAL, 
and was designed to work with regular CANopen devices in the future.  It would 
be pretty easy to add support for a new device, including the CiA301 and 
optional CiA402 features, and replace the EtherCAT interface with CAN bus 
instead.

    John

[1]: https://gitlab.com/etherlab.org/ethercat
[2]: https://github.com/tormach/hw_device_mgr

________________________________________
From: Nicklas SB Karlsson <n...@nksb.eu>
Sent: Sunday, June 16, 2024 1:35 PM
To: emc-developers@lists.sourceforge.net
Subject: Re: [Emc-developers] CANopen syntax for configuration file(s) for 
mapping and initialization

This driver looks promising and seems good. Could see it require module 
compiled into Linux kernel and vaguely remember
I had some problem with it though might be a better choice is sucessful, my 
fast hack then there sometimes is a real
time delay message.

My fast hack do work including read mapping parameters from configuration file 
but start to reach a point there it is
time to either improve it make a pull request so that it could become a part 
official part of Linuxcnc or find something
else.

In any case XML path for configuration file is probably a good choice even 
though it add an extra depency to Linuxcnc.


Regards Nicklas Karlsson



tor 2024-06-13 klockan 21:41 +1000 skrev Rod Webster:
> I'm not sure if this would help but I would look at what Scott Laird has
> done with the Hal Ethercat driver recently
> https://github.com/linuxcnc-ethercat/linuxcnc-ethercat
> I would try and use a similar XML to what is used for Ethercat. eg Look at
> his CIA402 driver and its settings.
> And of course, you will probably find that all the hard stuff is already
> done to support Canopen over Ethercat.
> Note this repo has a buildbot that sends the debs to the
> etherlabmaster repository where the Ethercat master is distributed from.
> And this repo is already set up in the LinuxCNC 2.9.2 ISO so its a very
> quick process to get a working ethercat build.
> Scotts a great guy and will be only too happy to help if you raise an issue
> there.
>
>
> Rod Webster
> *1300 896 832*
> +61 435 765 611
> Vehicle Modifications Network
> www.vehiclemods.net.au
>
>
> On Thu, 13 Jun 2024 at 06:38, Nicklas SB Karlsson <n...@nksb.eu> wrote:
>
> > Are currently trying to use CANopen with a device and have done some
> > development. Have until now run hard coded mappings
> > but now reached a point there configuration is needed. Implement graphical
> > configuration and store configuration in
> > binary format would of course be one option but have chosen a text file
> > possible to edit manually. Use maps like below.
> >
> >
> > map={.cobId=181h, .name="encoder.cnt", .dir=HAL_OUT, .type=HAL_S32,
> > .bitlen=32, .bitpos=32, .name_scaled="encoder.pos",
> > .name_gain="encoder.pos.scale", .gain=0.13}
> > map={.cobId=201h, .name="pos.cnt", .dir=HAL_IN, .type=HAL_S32, .bitlen=32,
> > .bitpos=0}
> >
> >
> > First field is message "identifier" for the messages on the network.
> > Second is name of hal pin. Third is hal direction.
> > Fourth is hal datatype. Fifth is length of number in message which may be
> > one for a single bit. Sixth to eigth is
> > optional, if availabe it is name of hal pin for scaled value. Seventh if
> > available is name of hal parameter for scaling
> > gain. Eigth if available is gain default value. There is probably a need
> > to add one parameter before the first to
> > identify network in case several are available.
> >
> > This should work for CANopen both over CAN networks but also over Ethercat
> > but are a little bit unsure about how to
> > identify the message if used over Ethercat. CAN network use rather small
> > messages 8 bytes maximum for ordinary CAN and
> > some order of magnitude larger for CAN FD, all variables in same message
> > same direction. Ethercat use much larger
> > messages and may have both inputs and outputs in "same" message, message
> > is sent in a ring similar principle as cascaded
> > shift register so outputs is written in message before sent while inputs
> > are read from message then it arrive back. Need
> > for mapping is same so should hovewer be possible to use same syntax in
> > configuration file.
> >
> > Syntax in configuration file is currently more or less as an array in C as
> > I copied the hard coded mappings from C to
> > configuration file. Have a simple first far from perfect implementation or
> > hack that read the mappings from the
> > configuration file. Anybody have any suggestions about the syntax for the
> > configuration file? There is some more or less
> > standard to write down these kind of mappings for CANopen I have missed?
> > Any parser in Linuxcnc which may be reused to
> > read this configuration file possible with other syntax?
> >
> >
> > There is also sometimes a need for a "configuration script" before nodes
> > enter mode of operation normal. First idea is
> > to borrow the CANopen CiA309-3 standard and simply enter the command(s) in
> > a file, possible same file as used for the
> > mapping. Anybody have any other suggestion?
> >
> >
> > Regards Nicklas Karlsson
> >
> >
> >
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-developers@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
> >
>
> _______________________________________________
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers




_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to