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

how to simulate the pid on PC, without actual devices #145

Open
MiKiJT opened this issue Aug 8, 2024 · 2 comments
Open

how to simulate the pid on PC, without actual devices #145

MiKiJT opened this issue Aug 8, 2024 · 2 comments

Comments

@MiKiJT
Copy link

MiKiJT commented Aug 8, 2024

how to simulate the pid on PC, without actual devices

@drf5n
Copy link

drf5n commented Oct 17, 2024

You would need to simulate the missing devices to make the system provide the feedback from the PI/D Output into the PID Input. Otherwise it is open-loop, and the PID will not produce sensible results.

@TuxLeon
Copy link

TuxLeon commented Oct 17, 2024

The dependencies to the HW and Arduino are very little.
I don't see any dependency to HW.
There is only one dependency to Arduino.h. This ist the function millies() in the line
unsigned long now = millis();

So if you provide a Arduino Stub with the implementation of this function you should be fine to compile PID_V1.cpp on your PC.
To get some output you should
-instantiate PID
-periodically call PID::Compute() and increment the the milli seconds in the Millies() stub
-Inputs and Outputs of the PID are provided by pointers. So should be quite easy. The example folder should help you.

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

3 participants