Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate hardware read and write #12

Open
shadowmanos opened this issue Jul 8, 2014 · 0 comments
Open

separate hardware read and write #12

shadowmanos opened this issue Jul 8, 2014 · 0 comments
Assignees
Labels

Comments

@shadowmanos
Copy link

There is a function void EthercatHardware::update(bool reset, bool halt) that does both read and write in Ethercat. The real-time loop should be:

while(true) {
read from sensors
update controllers
write to actuators
wait until 1 msec has passed
}

But what happens instead is

while(true) {
read from sensors
write to actuators
update controllers
wait until 1 msec has passed
}

That means when a discrete-time PID controller is tuned it must assume a sample-period of 1msec and a latency of 1msec. That's because the controller action calculated for current sensor readings will actually be applied in the next iteration. That means the tuning has to be less aggressive (less responsive control) compared to almost zero latency. Split the EthercatHardware::update to read and write function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants