Git Product home page Git Product logo

kickcat's People

Contributors

eyusd avatar leducp avatar nicolas71640 avatar rdk-t avatar trns1997 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kickcat's Issues

Improve examples

Create a tool (serving as example):

  • scan slaves
  • send/get SDO data
  • display object dictionary list
  • display object desc
  • display object entry
  • display/dump/flash eeprom
  • display topology
  • display error counters

Use the tool on elmo/ingenia example.

Multi-OS support

Codebase is mainly OS agnostic but it still needs a few API to work properly (mainly socket and sleep()). C++ standard API that implement such interfaces are not really portable and as such the project cannot rely on it.

Proposal: Enable different OS port through CMake project.

[slave] Mailbox follow-up

  • Mailbox in/out order is confusing with standard/eeprom
  • Mailbox out shall check if there is something to read (reminder: in/out are master POV)
  • Mailbox shall handle repeat sending as per standard expectation

Import kickCat as third party lib to nuttx app

Create a simple nuttx ethercat app using kickcats slave stack.

  • Build xmc4800 board using CMake (apache/nuttx#11679)
  • Create simple app inspired from @Rdk-T amazing work
  • I was thinking of building the kickcat lib using conan (so once we're happy with the slave stack then we should consider tagging a new version and updating the recipe)
  • If all goes well "maybe" build the board and app using Makefile

Architecture questions

I really like how simple the current source code is, congrats!

The Bus class is starting to grow in size and could become difficult to maintain.

Should functions like waitForMessage, getCurrentState, readMappedPDO, read/writeSDO be moved to the Slave class? Slaves would be listed in the bus and initialized with a shared pointer (or whatever) to the bus.

Other possibilities would be to move some of the Frames (datagrams) and Eeprom (read/fetch/ready) logic to dedicated classes.

Mailbox - timeout support

Mailbox is not aware of any kind of timeout right now. This can be problematic if the message is lost (i.e. frame error) as there is no re-transmission mechanism. It leads to a potential memory leak, message collision (same counter after one loop) and user as no easy way to catch this kind of error.

Add unit description in master mailbox

ETG1004 extension unit_specification specify all the units supported in ethercat

Master mailbox is expected to answer to their description (index 0X400 -> 0X4FF)

Allow to add callbacks on IRQ change

Enable the client to enable/disable ECAT event (IRQ field in EtherCAT header) and attach a callback on each.

It is useful to react on topology change through DL status (hotplug or cable break) or on AL status change for instance.

ECAT Event Mask (0x0200:0x0201) -> for activation / deactivation

See ECAT Event Request (0x0210:0x0211) for details in hardware section 2.

Allow client to override waitForState timeout callback

use case: when a slave is slower to switch from safe op to op than the PDO watchdog set, it leads the slave to trigger its internal PDO watchdog.

To avoid this, as a client, we need to send multiple PDO while waiting for the switch to OP to prevent the watchdog to be triggered.

Add support for ETG.8200 - Mailbox Gateway

Mailbox Gateway enable external mailbox access to a master that support it. It is useful for configuration tool and maintenance tools.
Note: the Mailbox Gateway standard is required to add support for the Master Diagnostic standard (ETG.1510).

Distributed clocks / SYNC message

I'm currently working on a robotics project and have been entertaining the idea of replacing CODESYS which I have been using for the RT aspects of the system with an open source stack. Found this library and it's very cool, took maybe all of an hour to adapt the example and get my drive booted and PDO mapped. The problem I now face is its a Delta B3 drive and apparently wont move unless it's receiving some form of sync message.

Delta servo drives only support synchronous operation which is the controller periodically sends the SYNC object (COB-ID = 0x80).

The drive is fully powered up (locked shaft), receiving control word, target position and mode of operation, it's sending back all the right status word bits as well as actual position + velocity. But it refuses to budge. The only configuration difference between this and CODESYS I can see is that its not receiving a distributed clock.

Now the problem is that I only know a little bit about CoE, and next to nothing about EtherCAT itself. Reading what's out there it seems as though SYNC messages and distributed clocks are two different things, if that's true is there a quick and dirty way to generate that payload and get this project moving forward? I assume the only reason we don't already have DC in this library is because it's a non trivial task and unfortunately I'm probably not in the position to contribute one even though I would like to.

Any help would be much appreciated.

Link unit test - Uninteresting mock function call setTimeout

Current Link unit test do not check properly the applied timeout:

GMOCK WARNING:
Uninteresting mock function call - returning directly.
    Function call: setTimeout(8-byte object <22-5B 1E-00 00-00 00-00>)
NOTE: You can safely ignore the above warning unless this call should not happen.  Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call.  See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.

GMOCK WARNING:
Uninteresting mock function call - returning directly.
    Function call: setTimeout(8-byte object <80-84 1E-00 00-00 00-00>)
NOTE: You can safely ignore the above warning unless this call should not happen.  Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call.  See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.

GMOCK WARNING:
Uninteresting mock function call - returning directly.
    Function call: setTimeout(8-byte object <34-54 1E-00 00-00 00-00>)
NOTE: You can safely ignore the above warning unless this call should not happen.  Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call.  See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.

GMOCK WARNING:
Uninteresting mock function call - returning directly.
    Function call: setTimeout(8-byte object <80-84 1E-00 00-00 00-00>)
NOTE: You can safely ignore the above warning unless this call should not happen.  Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call.  See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.

Diagnostic file format

Here is a proposal to post analyse a network behavior with a dedicated tool.

File/Stream Header

Entry type value if constant meaning
Magic number u32 TODO To recognize file format
Version u16 1 File format version
Start time u64 N/A Start time in ns since UNIX Epoch)
Data section u64 N/A Offset of the data section

Data block header

Entry type meaning
Block type u16 To recognize block format
Slave address u16 Slave address that generates this block
Timestamp u64 timestamp of the block in ns
Data Block type dependent Data of the block. Cf. following sections

Slave description

Block type: 1

Entry type meaning
Vendor ID u32 cf. SSI doc
Product code u32 cf. SSI doc
Revision number u32 cf. SSI doc
Serial number u32 cf. SSI doc

DL Status

Block type: 2

Entry type meaning
DL status u16 cf. register doc

AL Status

Block type: 3

Entry type meaning
AL status u16 cf. register doc
AL code u16 cf. register doc

Error counters

Block type: 4

Entry type meaning
Error counters sizeof(ErrorCounters) cf. register doc

Fix circulating frame bit never set

In the datagram header in Frame.cc the field circulating was never reset.

The circulating field is set to 1 to indicate that the given frame has already been processed by a slave with the port0 closed. If a slave with a port0 closed try to set set it to 1 and it's already 1, the slave destroy the frame to prevent a frame to circulate indefinitely in a cut network (preventing the slaves to trigger their watchdog when communication with the master is lost).

The problem with kickcat not resetting this field to 0 was that it is not possible to communicate to a slave on its port out, leading to not being able to implement the redundancy handling.

More information about the circulating bit can be found in https://download.beckhoff.com/download/document/io/ethercat-development-products/ethercat_esc_datasheet_sec1_technology_2i2.pdf chapter 3.5, schematics explain the problem in details.

Source tree - tools

To ease the source maintenance, tools shall be separated in dedicated subfolder instead of a stack of files which are built in differents tools

detectSlave api

It would be nice that in the bus class, detectSlave() return directly the number of detected slaves instead of having to call for the getter afterward.

Print rework

Transform print call to print() and rely on overloading to select the right one.

Improve Bus.cc API for diagnostic

When trying to use Bus.cc from the client side to investigate cable losses a few issues arise:

  • We can't call detectSlaves after init to count the number of slaves still connected on the network, because detectSlaves modify the slaves vector -> we should rework this function and split it in two to allow scanning for the slaves without modifying the bus object.

  • The api to send / get datagram on the bus should be split in two to allow client to choose what to send / receive and at which moment.

Improve FMMU display

Current SII display FMMU type with a numeric information that could be translated in human readable langage (unused, read, write, unknown)

Windows support

Add a windows socket and a windows build system through CMake

since_epoch() missing symbol

since_epoch() is a weak symbol with a default implementation. However some examples are not linked with the default implementation, which lead to a crash when since_epoch() is called (function pointer initialized with nullptr).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.