00001 #ifndef DCMOTOR_H
00002 #define DCMOTOR_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef __GNUC__
00037 #ifndef __attribute__
00038 #define __attribute__(x)
00039 #endif
00040 #endif
00041
00042 static char __attribute__((unused)) dcmotor_h[] = "$Id: dcmotor.h,v 1.2 2000/10/27 20:34:42 terrylr Exp $";
00043
00044 typedef struct
00045 {
00046
00047 double Ra;
00048 double La;
00049 double Kb;
00050 double Jm;
00051 double Bm;
00052
00053
00054 double ia;
00055 double dia;
00056 double wm;
00057 double dwm;
00058 double thm;
00059 double dthm;
00060 double lastTime;
00061
00062
00063 int configured;
00064 double cycleTime;
00065 double offset;
00066 double revsPerUnit;
00067
00068 } DC_MOTOR_STRUCT;
00069
00070
00071 #ifdef __cplusplus
00072 extern "C" {
00073 #endif
00074
00075 extern int dcmotorInit(DC_MOTOR_STRUCT * dcmotor);
00076 extern int dcmotorResetState(DC_MOTOR_STRUCT * dcmotor);
00077 extern int dcmotorSetCycleTime(DC_MOTOR_STRUCT * dcmotor, double seconds);
00078 extern double dcmotorGetCycleTime(DC_MOTOR_STRUCT * dcmotor);
00079 extern int dcmotorSetParameters(DC_MOTOR_STRUCT * dcmotor, DC_MOTOR_STRUCT params);
00080 extern DC_MOTOR_STRUCT dcmotorGetParameters(DC_MOTOR_STRUCT * dcmotor);
00081 extern int dcmotorSetOffset(DC_MOTOR_STRUCT * dcmotor, double _offset);
00082 extern double dcmotorGetOffset(DC_MOTOR_STRUCT * dcmotor);
00083 extern int dcmotorSetRevsPerUnit(DC_MOTOR_STRUCT * dcmotor, double _revsPerUnit);
00084 extern double dcmotorGetRevsPerUnit(DC_MOTOR_STRUCT * dcmotor);
00085 extern double dcmotorGetOutput(DC_MOTOR_STRUCT * dcmotor);
00086 extern double dcmotorRunCycle(volatile DC_MOTOR_STRUCT * dcmotor, volatile double ea);
00087 extern int dcmotorIniLoad(DC_MOTOR_STRUCT * dcmotor, const char * filename, const char *section);
00088
00089 #ifdef __cplusplus
00090 }
00091 #endif
00092
00093 #endif