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

output status updated only every 250 ms #6

Open
t0mpr1c3 opened this issue Sep 24, 2013 · 4 comments
Open

output status updated only every 250 ms #6

t0mpr1c3 opened this issue Sep 24, 2013 · 4 comments

Comments

@t0mpr1c3
Copy link

in osPID-Firmware.ino the output status is written to the relay only every 250ms. This seems excessively granular in a default cycle period of 5s. (line 175, 250 is added to ioTime, meaning that the output status will not be updated for another 250ms).

@br3ttb
Copy link
Collaborator

br3ttb commented Sep 24, 2013

This is because the PID Loop itself is evaluated every 250mS. There is no reason to do the io any faster than the PID is dealing with them.

@br3ttb br3ttb closed this as completed Sep 24, 2013
@t0mpr1c3
Copy link
Author

Perhaps I should clarify. I was referring to the writing of the output to the relay using WriteToOutputCard() which is not an asynchronous process. As far as I can see WriteToOutputCard() needs to be called repeatedly during the cycle until it is time for the relay to go high or low. For that reason calling WriteToOutputCard() every 250 ms seems too infrequent.

@br3ttb
Copy link
Collaborator

br3ttb commented Sep 24, 2013

AH! that. is a legitimate point. sorry that I misunderstood. having separate input and output times instead of one ioTime is probably the way to go.

@br3ttb br3ttb reopened this Sep 24, 2013
@t0mpr1c3
Copy link
Author

Yes. Perhaps even do away with the output time altogether and call WriteToOutputCard in every iteration of the loop, because it is a high priority task and quick to execute.

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

No branches or pull requests

2 participants