Gavin Lambert
2017-05-05 04:44:58 UTC
2) Your 0054 patch successfully moved the slave sdo request processing
from the master fsm's idle state to be called every cycle of the master
thread.
However, I have my Linux environment set to run at 100Hz, so this
thread would only fire once every 10ms. Each SDO read/write request
would take approx. 30ms to complete. I didn't want to change Linux to
run at 1000Hz so I
created patch "etherlabmaster-0010-
allow_app_to_process_sdo_requests_from_realtime.patch".
Maybe I'm missing something about how the RTAI version works, but all Ifrom the master fsm's idle state to be called every cycle of the master
thread.
However, I have my Linux environment set to run at 100Hz, so this
thread would only fire once every 10ms. Each SDO read/write request
would take approx. 30ms to complete. I didn't want to change Linux to
run at 1000Hz so I
created patch "etherlabmaster-0010-
allow_app_to_process_sdo_requests_from_realtime.patch".
was to move the logic from inside fsm_master to inside fsm_slave; AFAIK
both of these execute on the same thread (either the master IDLE or master
OPERATION thread). This is independent of the application realtime loop
either way, so this should not have changed how frequently they run; it
justboth of these execute on the same thread (either the master IDLE or master
OPERATION thread). This is independent of the application realtime loop
either way, so this should not have changed how frequently they run; it
allows multiple slave requests to run in parallel rather than forcing them
toexecute sequentially, so it should be a net performance gain.
Though it does seem reasonable in your use case to want to run the slave
FSMs more often. I don't see how you could do that safely, though -- you
can't run ec_master_exec_slave_fsms outside of the master_sem lock, and
your RTAI task might interrupt Linux while it's still holding that lock,
which willThough it does seem reasonable in your use case to want to run the slave
FSMs more often. I don't see how you could do that safely, though -- you
can't run ec_master_exec_slave_fsms outside of the master_sem lock, and
your RTAI task might interrupt Linux while it's still holding that lock,
deadlock your RTAI task.
Are you configuring with --enable-hrtimer? After having a quick look at thecode, I can see a potential performance degradation from the patch if you
aren't using it (or did enable it but didn't call
ec_master_set_send_interval with an appropriate value after activating the
master). Perhaps you could try enabling that instead of using your patch
and see if it helps?