| 1 | /* |
|---|
| 2 | * nn_esc_1d.h |
|---|
| 3 | * |
|---|
| 4 | * Created on: Jul 26, 2012 |
|---|
| 5 | * Author: Berk Calli |
|---|
| 6 | * Organization: Delft Biorobotics Lab., Delft University of Technology |
|---|
| 7 | * Contact info: b.calli@tudelft.nl, web: www.dbl.tudelft.nl |
|---|
| 8 | * |
|---|
| 9 | * Header file of the class for one dimensional neural network based extremum seeking control |
|---|
| 10 | * |
|---|
| 11 | * * References: |
|---|
| 12 | * - M. Teixeira and S. Zak, âAnalog neural nonderivative optimizers,â IEEE Transactions on Neural Networks, vol. 9, pp. 629â638, 1998. |
|---|
| 13 | * - B. Calli, W. Caarls, P. Jonker and M. Wisse, "Comparison of Extremum Seeking Control Algorithms for Robotic Applications", IROS 2012. |
|---|
| 14 | */ |
|---|
| 15 | # |
|---|
| 16 | |
|---|
| 17 | #ifndef NN_ESC_1D_H_ |
|---|
| 18 | #define NN_ESC_1D_H_ |
|---|
| 19 | |
|---|
| 20 | #include <vector> |
|---|
| 21 | #include <string> |
|---|
| 22 | #include "esc_common/esc.h" |
|---|
| 23 | #include "stdio.h" |
|---|
| 24 | class NNESC1D : public ESC { |
|---|
| 25 | public: |
|---|
| 26 | enum { monitorSwitch, monitorPeak }; |
|---|
| 27 | |
|---|
| 28 | protected: |
|---|
| 29 | double A_,M_,ddelta_,A,delta_,B_, mpd_init_, w_switch_old_, a_switch_old_,yr_,period_; |
|---|
| 30 | double min_peak_,vel_ref_,w_switch_; |
|---|
| 31 | bool initialized_,min_peak_detect_init_; |
|---|
| 32 | |
|---|
| 33 | public: |
|---|
| 34 | NNESC1D(); |
|---|
| 35 | |
|---|
| 36 | NNESC1D(double A,double M, double B, double ddelta, double delta, double period); |
|---|
| 37 | |
|---|
| 38 | void init(double A, double M, double B, double ddelta, double delta, double period); |
|---|
| 39 | |
|---|
| 40 | std::vector<double> step(double obj_val); |
|---|
| 41 | inputType getInputType(); |
|---|
| 42 | outputType getOutputType(); |
|---|
| 43 | std::vector<double> monitor(); |
|---|
| 44 | std::vector<std::string> monitorNames(); |
|---|
| 45 | protected: |
|---|
| 46 | double wSwitch(double e_minus); |
|---|
| 47 | double minPeakDetect(double e_minus); |
|---|
| 48 | double aSwitch(double e); |
|---|
| 49 | void reset(); |
|---|
| 50 | |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | #endif /* NN_ESC_1D_H_ */ |
|---|