Code Monkey home page Code Monkey logo

Comments (6)

kfechter avatar kfechter commented on August 17, 2024

the commented out code was other things I tried based on other examples. however I'm 99.9% sure that most of the other motor controller code won't cross over to this PCON.

from pysoem.

bnjmnp avatar bnjmnp commented on August 17, 2024

Hi @kfechter,
to go into SafeOP state you should only use the config_map() function. If your PDO mapping is fixed this is good, less options to do something wrong.

You might want to use the code from the minimal_example.py to go into OP state.

            self._master.state = pysoem.OP_STATE
            self._master.write_state()

            self._master.state_check(pysoem.OP_STATE, 50000)
            if self._master.state != pysoem.OP_STATE:
                self._master.read_state()
                for slave in self._master.slaves:
                    if not slave.state == pysoem.OP_STATE:
                        print('{} did not reach OP state'.format(slave.name))
                        print('al status code {} ({})'.format(hex(slave.al_status),
                                                              pysoem.al_status_code_to_string(slave.al_status)))
                raise Exception('not all slaves reached OP state')

The "al status code" might give you a hint on what went wrong.

Same state_check() on SAFEOP_STATE you should actually also do after the config_map() function call.

from pysoem.

kfechter avatar kfechter commented on August 17, 2024

Thank you for the reply! I will try the minimal example the next time I have access to the equipment. I know using the examples from the base SOEM, it at least seems to get to OP State so I'm most likely doing something wrong. I'm also learning ethercat at the same time so its a bit of a process.

from pysoem.

kfechter avatar kfechter commented on August 17, 2024

definitely getting further, so that's nice. With the example, I get to safe_op properly, however during the transition to op state, the alarm status code is 0x1b (Sync Manager Watchdog). through my research it seems to have to do with dc_sync, just gotta figure out where the values come from.

from pysoem.

kfechter avatar kfechter commented on August 17, 2024

making some more progress. If i do a master.send_processdata() and a master.recieve_processdata(timeout=2000) before calling op state, everything seems to get to op.

from pysoem.

kfechter avatar kfechter commented on August 17, 2024

ill close this one, since my new problem isnt related to getting to OP

from pysoem.

Related Issues (20)

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.