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_,delta_,B_, mpd_init_, w_switch_old_, a_switch_old_,yr_,period_; |
---|
30 | double min_peak_,vel_ref_,w_switch_,obj_val_cycle_init_; |
---|
31 | double stoping_min_val_,vel_ref_old_; |
---|
32 | int stopping_cycle_number_,nn_cycle_count_; |
---|
33 | bool initialized_,min_peak_detect_init_; |
---|
34 | |
---|
35 | public: |
---|
36 | NNESC1D(); |
---|
37 | |
---|
38 | NNESC1D(double A,double M, double B, double ddelta, double delta, double period, int stopping_cycle_number, double stoping_min_val); |
---|
39 | |
---|
40 | void init(double A, double M, double B, double ddelta, double delta, double period, int stopping_cycle_number, double stoping_min_val); |
---|
41 | |
---|
42 | std::vector<double> step(double obj_val); |
---|
43 | inputType getInputType(); |
---|
44 | outputType getOutputType(); |
---|
45 | std::vector<double> monitor(); |
---|
46 | std::vector<std::string> monitorNames(); |
---|
47 | protected: |
---|
48 | double wSwitch(double e_minus); |
---|
49 | double minPeakDetect(double e_minus); |
---|
50 | double aSwitch(double e); |
---|
51 | void reset(); |
---|
52 | bool isStoppingConditionsMet(); |
---|
53 | |
---|
54 | }; |
---|
55 | |
---|
56 | |
---|
57 | #endif /* NN_ESC_1D_H_ */ |
---|