18 #ifndef DRIVEPARAM_INCLUDEDEF_H 19 #define DRIVEPARAM_INCLUDEDEF_H 76 int iEncIncrPerRevMot,
81 double dVelMaxEncIncrS,
86 m_iDriveIdent = iDriveIdent;
87 m_iEncIncrPerRevMot = iEncIncrPerRevMot;
88 m_dVelMeasFrqHz = dVelMeasFrqHz;
89 m_dBeltRatio = dBeltRatio;
90 m_dGearRatio = dGearRatio;
92 m_dVelMaxEncIncrS = dVelMaxEncIncrS;
93 m_dAccIncrS2 = dAccIncrS2;
94 m_dDecIncrS2 = dDecIncrS2;
98 double dPI = 3.14159265358979323846;
100 m_dPosGearRadToPosMotIncr = m_iEncIncrPerRevMot * m_dGearRatio
101 * m_dBeltRatio / (2. * dPI);
107 int iEncIncrPerRevMot,
108 double dVelMeasFrqHz,
112 double dVelMaxEncIncrS,
117 double dCurrToTorque,
121 m_iDriveIdent = iDriveIdent;
122 m_iEncIncrPerRevMot = iEncIncrPerRevMot;
123 m_dVelMeasFrqHz = dVelMeasFrqHz;
124 m_dBeltRatio = dBeltRatio;
125 m_dGearRatio = dGearRatio;
127 m_dVelMaxEncIncrS = dVelMaxEncIncrS;
128 m_dAccIncrS2 = dAccIncrS2;
129 m_dDecIncrS2 = dDecIncrS2;
130 m_iEncOffsetIncr = iEncOffsetIncr;
131 m_bIsSteer = bIsSteer;
135 double dPI = 3.14159265358979323846;
137 m_dPosGearRadToPosMotIncr = m_iEncIncrPerRevMot * m_dGearRatio
138 * m_dBeltRatio / (2. * dPI);
140 m_dCurrToTorque = dCurrToTorque;
141 m_dCurrMax = dCurrMax;
147 int iEncIncrPerRevMot,
148 double dVelMeasFrqHz,
152 double dVelMaxEncIncrS,
157 double dCurrToTorque,
162 m_iDriveIdent = iDriveIdent;
163 m_iEncIncrPerRevMot = iEncIncrPerRevMot;
164 m_dVelMeasFrqHz = dVelMeasFrqHz;
165 m_dBeltRatio = dBeltRatio;
166 m_dGearRatio = dGearRatio;
168 m_dVelMaxEncIncrS = dVelMaxEncIncrS;
169 m_dAccIncrS2 = dAccIncrS2;
170 m_dDecIncrS2 = dDecIncrS2;
171 m_iEncOffsetIncr = iEncOffsetIncr;
172 m_bIsSteer = bIsSteer;
174 double dPI = 3.14159265358979323846;
176 m_dPosGearRadToPosMotIncr = m_iEncIncrPerRevMot * m_dGearRatio
177 * m_dBeltRatio / (2. * dPI);
179 m_dCurrToTorque = dCurrToTorque;
180 m_dCurrMax = dCurrMax;
181 m_iHomingDigIn = iHomingDigIn;
215 void PosVelRadToIncr(
double dPosRad,
double dVelRadS,
int* piPosIncr,
int* piVelIncrPeriod)
228 double dTempMeasGradCel;
230 dTempMeasGradCel = 0.0002 * (iTempIncr * iTempIncr) - 0.2592 * iTempIncr + 105;
232 return (
int)dTempMeasGradCel;
241 return ((
int)(dPosGearRad * m_dPosGearRadToPosMotIncr));
247 return ((
double)iPosIncr / m_dPosGearRadToPosMotIncr);
253 return ((
int)(dVelGearRadS * m_dPosGearRadToPosMotIncr / m_dVelMeasFrqHz));
259 return ((
double)iVelMotIncrPeriod / m_dPosGearRadToPosMotIncr * m_dVelMeasFrqHz);
268 m_dAccIncrS2 = dMaxAcc;
286 m_dDecIncrS2 = dMaxDec;
304 m_dVelMaxEncIncrS = dMaxVel;
384 m_iHomingDigIn = HomingDigIn;
void setParam(int iDriveIdent, int iEncIncrPerRevMot, double dVelMeasFrqHz, double dBeltRatio, double dGearRatio, int iSign, double dVelMaxEncIncrS, double dAccIncrS2, double dDecIncrS2)
void setMaxAcc(double dMaxAcc)
int getEncIncrPerRevMot()
void setMaxDec(double dMaxDec)
int PosGearRadToPosMotIncr(double dPosGearRad)
int VelGearRadSToVelMotIncrPeriod(double dVelGearRadS)
Conversions of gear velocity in rad/s to encoder increments per measurment period.
int TempMeasIncrToGradCel(int iTempIncr)
double m_dPosGearRadToPosMotIncr
void setHomingDigIn(int HomingDigIn)
void setParam(int iDriveIdent, int iEncIncrPerRevMot, double dVelMeasFrqHz, double dBeltRatio, double dGearRatio, int iSign, double dVelMaxEncIncrS, double dAccIncrS2, double dDecIncrS2, int iEncOffsetIncr, bool bIsSteer, double dCurrToTorque, double dCurrMax, int iHomingDigIn)
double PosMotIncrToPosGearRad(int iPosIncr)
Conversions of encoder increments to gear position in radians.
void setParam(int iDriveIdent, int iEncIncrPerRevMot, double dVelMeasFrqHz, double dBeltRatio, double dGearRatio, int iSign, double dVelMaxEncIncrS, double dAccIncrS2, double dDecIncrS2, int iEncOffsetIncr, bool bIsSteer, double dCurrToTorque, double dCurrMax)
void setMaxVel(double dMaxVel)
double VelMotIncrPeriodToVelGearRadS(int iVelMotIncrPeriod)
Conversions of encoder increments per measurment period to gear velocity in rad/s.
void PosVelRadToIncr(double dPosRad, double dVelRadS, int *piPosIncr, int *piVelIncrPeriod)