Closed kfechter closed 10 months ago
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.
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.
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.
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.
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.
ill close this one, since my new problem isnt related to getting to OP
I am trying to control an IAI PCON-CB (EtherCat Model), using pysoem. I can get the device from PREOP into SAFEOP, but the device goes into a configuration error state whenever I try to go from SAFEOP to OP. Looking at the manuals I've found don't show much useful information (at least to me).
I tried writing to the Tx and Rx PDO assign variables, however they all appear to be read-only. I've tried doing this in both pre-op and safe-op states.
below is my example code, the only device in the chain is the PCON (Laptop -> Ethernet -> PCON)