Hello, beginner PID does not meet the needs for my project (no limits, hardly suitable for integrating processes etc.)
I want to wrap Arduino PID library into XOD,
https://playground.arduino.cc/Code/PIDLibrary/
https://github.com/br3ttb/Arduino-PID-Library/
but I keep having errors I think originating from the way it requires linking addresses instead of normal values
Library says:
PID(double*, double*, double*,double, double, double, int, int);
Arduino example:
PID myPID(&Input, &Output, &Setpoint,2,5,1,P_ON_M, DIRECT);
one of many my unsuccessful attempts to wrap it up:
// Tell XOD where it could download the library and its dependencies:
#pragma XOD require "https://github.com/br3ttb/Arduino-PID-Library"
// Include C++ library:
#include <PID_v1.h>
node {
meta {
// Define our custom type as a pointer on the class instance.
using Type = PID*;
}
//example
//PID myPID(&Input, &Output, &Setpoint,2,5,1,P_ON_M, DIRECT);
PID aPID = PID(input_PV,output_OUT,input_SP,input_Kp,input_Ki,input_Kd,input_POM,input_DIR);
void evaluate(Context ctx) {
emitValue<output_OUT>(ctx, &aPID);
}
}
Also tried &input_PV and *input_PV but since I’m basically guessing no wonder it does not work.
Tried learning more, but could not find neither in depth explanations nor similar examples.
can you suggest a solution or an example?