mirror of
https://github.com/WallabyLester/RBF-aPID-Controller.git
synced 2026-05-10 13:09:12 +08:00
Changing main to implement simulation.
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
||||
#include "rbf_model.h"
|
||||
#include "apid_controller.h"
|
||||
|
||||
const double Kp = 1.0, Ki = 0.1, Kd = 0.01, dt = 0.1;
|
||||
// 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;
|
||||
|
||||
aPIDController apid(Kp, Ki, Kd, dt);
|
||||
|
||||
double target = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user