mirror of
https://github.com/WallabyLester/RBF-aPID-Controller.git
synced 2026-05-31 03:29:16 +08:00
Changing main to implement simulation.
This commit is contained in:
@@ -1,9 +1,21 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
#include "rbf_model.h"
|
||||||
#include "apid_controller.h"
|
#include "apid_controller.h"
|
||||||
|
|
||||||
|
// Simple first order system
|
||||||
|
double systemResponse(double input, double measurement, double dt) {
|
||||||
|
return (input - measurement) * dt ;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// Seed random number generator for reproducibility
|
||||||
|
std::srand(static_cast<unsigned int>(std::time(0)));
|
||||||
|
|
||||||
const double Kp = 1.0, Ki = 0.1, Kd = 0.01, dt = 0.1;
|
const double Kp = 1.0, Ki = 0.1, Kd = 0.01, dt = 0.1;
|
||||||
|
|
||||||
int main() {
|
|
||||||
aPIDController apid(Kp, Ki, Kd, dt);
|
aPIDController apid(Kp, Ki, Kd, dt);
|
||||||
|
|
||||||
double target = 1.0;
|
double target = 1.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user