Giter Club home page Giter Club logo

ecat_servo's Introduction

ECAT servo

Free EtherCAT CiA402 servo drive implementation on STM32 (F1, F4), with Arduino example

EtherCAT is realtime Ethernet protocol for automation. It lets you control standard industrial equipment with your PC or laptop, without interface cards or special adapters. All it needs is just standard Ethernet card with RJ45 port. It offers low, very predictable latency, so it perfect motion control network for building modern CNC, robots and other machines. The most popular EtherCAT application protocol for servo drives seems to be CANopen (over EtherCAT) CiA402.

This project is free implementation of CoE CiA402 standard, for use with open motor controllers like ODrive, STMBL, or your next thing. Along the way, it shows how to do EtherCAT device development using free and open source tools.

Axis struct has states, transitions and action flags, its up for application to act on these.

cia402_axis_t cia402axis;                           // create instance of motion control axis
cia402_initialize(&cia402axis, &OD.Status_Word, &mockOD.ALstatus);  // initalize

// ...
while (true) {                                      // in main loop
    // ...                                          // read PDOs from CANbus,    
                                                    // or EtherCAT
    cia402_state_machine(&cia402axis, controlword); // process state machine

    if (axis.flags.axis_func_enabled) { /* implement your drive following command */ }
    if (axis->flags.hv_power_applied) { /* enable HV power if applicable */ }
    if (axis->flags.brake_applied) { /* release brake if applicable */ }

    if( /* application detected error condition */ ) {
        cia402axis.state = FAULT_REACTION_ACTIVE;    // trigger fault reaction
        cia402_state_machine(&cia402axis, controlword); // process SM
    }
}

Example application for STM32 is is here

./examples dir contains platform.io projects showing how to use LAN9252 and AX58100 ESCs with STM32 and SOES library.

Documentation in /docs contains progress log with rationale on some decisions

Hackaday.io project is here for more convinient discussion

Disclaimer

The EtherCAT Technology, the trade name and logo "EtherCAT" are the intellectual property of, and protected by Beckhoff Automation GmbH.

ecat_servo's People

Contributors

kubabuda avatar

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.