Generates a PID controller with parameters K_p, K_d and K_i
Dependents: locomotion_pid_action_refactor_EMG
controller.cpp
- Committer:
- tvlogman
- Date:
- 2017-10-16
- Revision:
- 0:229271adbb37
File content as of revision 0:229271adbb37:
#include "controller.h" #include "mbed.h" // Member function definitions controller::controller(float k_p, float k_d, float k_i):k_p(k_p), k_d(k_d), k_i(k_i){ } float controller::control(float e_pos, float e_der, float e_int){ float motorValue; motorValue = k_p*e_pos + k_d*e_der + k_i*e_int; return motorValue; }