00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * * 00007 * ANY COMMERCIAL USE FORBIDDEN! * 00008 * LICENSE: * 00009 * This work is licensed under the Creative Commons * 00010 * Attribution-NonCommercial-ShareAlike 2.5 License. To view a copy of * 00011 * this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/ * 00012 * or send a letter to Creative Commons, 543 Howard Street, 5th Floor, * 00013 * San Francisco, California, 94105, USA. * 00014 * * 00015 * This program is distributed in the hope that it will be useful, * 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 00018 * * 00019 * $Log: invertmotorcontroller.h,v $ 00020 * Revision 1.33 2009/08/05 23:05:13 martius 00021 * comment for the last version: 00022 * changed to HomeokinBase type (cleaned version) 00023 * this class only adds some additional parameters 00024 * 00025 * Revision 1.32 2009/08/05 23:03:17 martius 00026 * changed to more convenient style of Matrix::mapP with normal double param 00027 * 00028 * Revision 1.31 2007/12/11 14:44:28 martius 00029 * possible segfault bug in buffer function 00030 * 00031 * Revision 1.30 2007/04/20 12:26:35 martius 00032 * *** empty log message *** 00033 * 00034 * Revision 1.29 2007/02/23 09:40:45 der 00035 * regularisation used from regularisation.h 00036 * 00037 * Revision 1.28 2007/01/24 14:39:10 martius 00038 * use new configurable addParameter feature 00039 * 00040 * Revision 1.27 2006/12/21 11:44:17 martius 00041 * commenting style for doxygen //< -> ///< 00042 * FOREACH and FOREACHC are macros for collection iteration 00043 * 00044 * Revision 1.26 2006/12/11 18:14:14 martius 00045 * delete for BNoise 00046 * delete of buffers 00047 * 00048 * Revision 1.25 2006/11/29 16:22:43 martius 00049 * name is a variable of configurable and is used as such 00050 * 00051 * Revision 1.24 2006/10/20 13:32:35 der 00052 * fantasy 00053 * 00054 * Revision 1.23 2006/08/02 09:30:16 martius 00055 * virtualized new calc functions 00056 * calcErrorFactor added 00057 * 00058 * Revision 1.22 2006/07/20 17:14:34 martius 00059 * removed std namespace from matrix.h 00060 * storable interface 00061 * abstract model and invertablemodel as superclasses for networks 00062 * 00063 * Revision 1.21 2006/07/18 15:17:16 martius 00064 * buffer operations like delayed values and smoothed values moved to invertmotorcontroller 00065 * 00066 * Revision 1.20 2006/07/18 14:47:15 martius 00067 * new regularisation of g' and g''/g' 00068 * g''/g' uses the same clipped z which used for g' 00069 * sqashing function with variable squash size 00070 * 00071 * Revision 1.19 2006/07/14 12:23:58 martius 00072 * selforg becomes HEAD 00073 * 00074 * Revision 1.17.6.10 2006/07/10 13:05:16 martius 00075 * NON-COMMERICAL LICENSE added to controllers 00076 * 00077 * * 00078 ***************************************************************************/ 00079 00080 #ifndef __INVERTMOTORCONTROLLER_H 00081 #define __INVERTMOTORCONTROLLER_H 00082 00083 #include "homeokinbase.h" 00084 #include "controller_misc.h" 00085 #include <stdlib.h> 00086 #include <string.h> 00087 00088 00089 /** 00090 * Extended HomeokinBase class (still abstract) for robot controller work in motorspace 00091 * and use possibly many steps and adaptive learning rate 00092 * 00093 * Parameters like dampA, adaptrate, noiseY... 00094 */ 00095 class InvertMotorController : public HomeokinBase { 00096 public: 00097 InvertMotorController( unsigned short buffersize , 00098 const std::string& name, const std::string& revision) 00099 : HomeokinBase(buffersize,name, revision){ 00100 addParameterDef("dampA",&dampA,0 ); 00101 addParameterDef("adaptrate",&adaptRate,0.000); 00102 addParameterDef("nomupdate",&nomUpdate,0.005); 00103 addParameterDef("desens",&desens,0); 00104 addParameterDef("steps",&steps,1); 00105 addParameterDef("zetaupdate",&zetaupdate,0); 00106 addParameterDef("noiseY",&noiseY,0); 00107 addParameterDef("noiseB",&noiseB,0.001); 00108 addParameterDef("teacher",&teacher,5); 00109 addParameterDef("relativeE",&relativeE,0); 00110 } 00111 00112 protected: 00113 paramval desens; 00114 paramval steps; ///< number of timesteps is used for controller learning 00115 paramval zetaupdate; 00116 paramval dampA; ///< damping term for model (0: no damping, 0.1 high damping) 00117 parambool relativeE; ///< if not 0: a relative error signal is used (xsi is normalised in respect to |y|) 00118 00119 paramval adaptRate; ///< adaptation rate for learning rate adaptation 00120 paramval nomUpdate; ///< nominal update of controller in respect to matrix norm 00121 paramval noiseB; ///< size of the additional noise for model bias B 00122 paramval noiseY; ///< size of the additional noise for motor values 00123 paramval teacher; ///< factor for teaching signal 00124 00125 }; 00126 00127 #endif