INOS
cinosbasemotor.h
Go to the documentation of this file.
1//******************************************************************************
27//******************************************************************************
28
29#ifndef INC_CINOSBASEMOTOR_H
30#define INC_CINOSBASEMOTOR_H
31
32//------------------------------------------------------------------------------
33// defines
34//------------------------------------------------------------------------------
35//
36#define DF_INOS_BASE_MOTOR_DBT "INOS-BASE-MOTOR"// db table name
37#define DF_INOS_BASE_MOTOR_NAME "CINOSBaseMotor" // motor name
38//
39#define DF_INOS_MOTOR_TRQ_LIMIT_DBT "INOS-MOTOR-TRQ-LIMIT" // db table name
40//
41// --- motor states ------------------------------------------------------------
42//
43//
44// --- motor errors ------------------------------------------------------------
45//
46//
47// --- motor warnings ----------------------------------------------------------
48//
49//
50// --- motor flags -------------------------------------------------------------
51//
52//
53//------------------------------------------------------------------------------
54// includes
55//------------------------------------------------------------------------------
56//
57// system
58#include <cinosprocessimage.h>
59//
60// C++
61//
62// project
63//
64//------------------------------------------------------------------------------
65//--- structures ---------------------------------------------------------------
66//------------------------------------------------------------------------------
67//
73{
76 inosName64 m_cName;
77
80 inosName32 m_cType;
81
85 inosName m_cUnit;
86
89 inosName32 m_cTrqLimitAcc;
90
93 inosName32 m_cTrqLimitDec;
94
98
104
108
112
117
121
126
131
135
139
141 real64 m_rInternal0[4];
143
148
152
157
162
164 uint8 m_uInternal1[2];
166
169};
170
173{
175 inosName32 m_cName;
177 uint32 m_uNumber;
179 uint32 m_uDummy;
181 real64 m_rRpm;
183 real64 m_rN;
184};
185
188{
190 uint32 m_uNumber;
192 uint32 m_uDummy;
194 real64* m_rRpm;
196 real64* m_rN;
197};
198
199//------------------------------------------------------------------------------
200// class definition
201//------------------------------------------------------------------------------
202//
204{
205 //--- user interface ---------------------------------------------------
206
207 // public member functions
208 public :
209
214
216 static CINOSBaseMotor* GetMotor(const char* apAxisName,
217 const char* apMotorType);
218
220 const char* GetName()
221 { return m_pDesc->m_cName; };
222
223 virtual uint32 GetParam(const char* apName, real64& arResult);
224 //; universal get parameter with apName to arResult and return error code
225 virtual uint32 SetParam(const char* apName, real64 arValue);
226 //; universal set parameter with apName to arValue and return error code
227
228 virtual void GetUnitsPerInc(double& arUnits);
229 //; get number of units per one inc
230 virtual void SetIncsPerUnit(double& arIncs);
231 //; set number of incs per unit
232 virtual void GetIncsPerUnit(double& arIncs);
233 //; get number of incs per unit
234 virtual void SetInertia(double arInertia);
235 //; set inertia
236 virtual void GetInertia(double& arInertia);
237 //; get inertia
238 virtual void SetGearRatio(double adGearRatio);
239 //; set gear ratio
240 virtual void GetGearRatio(double& arGearRatio);
241 //; get gear ratio
242 virtual void SetFeedPerTurn(double arFeedPerTurn);
243 //; set feed per turn (b)
244 virtual void GetFeedPerTurn(double& arFeedPerTurn);
245 //; get feed per turn (b)
246 virtual void SetIncsPerTurn(double arIncsPerTurn);
247 //; set incs per turn
248 virtual void GetIncsPerTurn(double& arIncsPerTurn);
249 //; get incs per turn
250 virtual void GetTurnsPerMin(double& arTurnsPerMin);
251 //; get turns per min
252 virtual void GetIncPosition(uint8& auIncPosition);
253 //; get position of increments (A=0, B=1)
254 virtual void GetIncReference(uint32& auIncReference);
255 //; get length of reference in [inc]
256
257 virtual CINCOObject* GetRegister();
258 //; do inco registration and return pointer to it
259
261 void GetTrqLimit(SINOSMotorTrqLimit*& apLimitAcc, SINOSMotorTrqLimit*& apLimitDec)
262 { apLimitAcc = m_pTrqLimitAcc; apLimitDec = m_pTrqLimitDec; }
263
264 //--- internals --------------------------------------------------------
265
266 // protected member functions
267 protected:
269 void iCalc();
271 void SetupTrqLimit(const char* apName, SINOSMotorTrqLimit*& apLimit);
272
273 // protected members
274 protected:
275
276 // pointers
277
279 CINCOObject* m_pRegister;
281 CINCOObject* m_pCfg;
285 const char* m_pType;
286
287 // parameters
288
301
302 // factors
303
305 double m_dKnf_s;
307 double m_dKnf_1s;
308
311
312 // torque limitation
313
318
319 // allow dynamic object handling (new/delete)
321};
322
323//------------------------------------------------------------------------------
324// class registration
325//------------------------------------------------------------------------------
326
327typedef CINOSBaseMotor *(*TCreateMotor)(const char* apAxisName);
328
330{
331 // after this function you can register new controllers
332 friend void _INI_0000_CINOSBaseMotor();
333
334 //--- internals --------------------------------------------------------
335
336 // private members
337private:
338 // pointer to the first registered motor
339 static CINOSRegisterBaseMotor* m_pFirst;
340 // pointer to the next motor
341 CINOSRegisterBaseMotor* m_pNext;
342 // create funtion for the motor
343 TCreateMotor m_pCreate;
344 // motor type name
345 const char* m_pMotorType;
346
347 //--- user interface ---------------------------------------------------
348
349public:
350 // register a new motor type
351 CINOSRegisterBaseMotor(TCreateMotor apFunction,
352 const char* apMotorType);
353
354 // create and return and new motor instance
355 static CINOSBaseMotor* GetMotor(const char* apAxisName,
356 const char* apMotorType);
357};
358
359//------------------------------------------------------------------------------
360// end of file
361//------------------------------------------------------------------------------
362
363#endif // INC_CINOSBASEMOTOR_H
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
Short comment.
Definition cinosbasemotor.h:204
double m_dGearRatio
gear ratio (a/b)
Definition cinosbasemotor.h:300
CINCOObject * m_pRegister
pointer to inco registration
Definition cinosbasemotor.h:279
double m_dIncsPerTurn
number of increments per turn
Definition cinosbasemotor.h:292
SINOSMotorTrqLimit * m_pTrqLimitAcc
torque limit points acceleration
Definition cinosbasemotor.h:315
CINCOObject * m_pCfg
pointer to inco config registration
Definition cinosbasemotor.h:281
static CINOSBaseMotor * GetMotor(const char *apAxisName, const char *apMotorType)
create motor and return pointer to it
void GetTrqLimit(SINOSMotorTrqLimit *&apLimitAcc, SINOSMotorTrqLimit *&apLimitDec)
get torque limits
Definition cinosbasemotor.h:261
CINOSBaseMotor(SINOSBaseMotor *apDesc)
constructor
double m_dFeedPerTurn
feed per turn ( m/U(b) )
Definition cinosbasemotor.h:294
const char * GetName()
get motor name
Definition cinosbasemotor.h:220
void SetupTrqLimit(const char *apName, SINOSMotorTrqLimit *&apLimit)
setup torque limit
double m_dKnf_s
factor : inc = pos * m_rKnf_s
Definition cinosbasemotor.h:305
double m_dTurnsPerMin
rotation per minute (Vmax in rpm)
Definition cinosbasemotor.h:290
const char * m_pType
motor type
Definition cinosbasemotor.h:285
SINOSBaseMotor * m_pDesc
pointer to motor descriptor
Definition cinosbasemotor.h:283
double m_dKnf_1s
factor : pos = inc * m_rKnf_1s
Definition cinosbasemotor.h:307
double m_dInertia
inertia
Definition cinosbasemotor.h:298
SINOSMotorTrqLimit * m_pTrqLimitDec
torque limit points deceleration
Definition cinosbasemotor.h:317
void iCalc()
calc internal factors
uint32 m_uCharacteristics
inco registration characteristics
Definition cinosbasemotor.h:310
virtual ~CINOSBaseMotor()
destructor
double m_dUnitsPerInc
units per inc
Definition cinosbasemotor.h:296
Definition cinosbasemotor.h:330
Descriptor structure used to configure a motor. It is usually defined in a corresponding xxx....
Definition cinosbasemotor.h:73
double m_dIncsPerTurn
Number of increments per motor or application turn depending on where the encoder is connected,...
Definition cinosbasemotor.h:103
inosName32 m_cType
Motor type name. Currently only INOSBase is a valid name.
Definition cinosbasemotor.h:80
double m_dGearOut2
Second stage gear output, ratio = input/output.
Definition cinosbasemotor.h:138
double m_dGearInp
Gear input, ratio = input/output. Using m_rGearInp and m_rGearOut is an alternative way to define a g...
Definition cinosbasemotor.h:125
SINOSBaseMotor()
constructor
double m_dGearRatio
Gear ratio motor to application.
Definition cinosbasemotor.h:120
double m_dUnitsPerInc
Units per increment (only used in special cases)
Definition cinosbasemotor.h:111
uint8 m_uDigits
Number of digits to use in INCO explorer. This parameter has no functional meaning and has just displ...
Definition cinosbasemotor.h:156
double m_dGearOut
Gear output, ratio = input/output. Using m_rGearInp and m_rGearOut is an alternative way to define a ...
Definition cinosbasemotor.h:130
double m_dTurnsPerMin
Motor nominal speed [rpm].
Definition cinosbasemotor.h:97
double m_dGearInp2
Second stage gear input, ratio = input/output.
Definition cinosbasemotor.h:134
uint8 m_uIncPosition
Defines where the axis encoder is connected. Two values are allowed: 0-directly on the motor,...
Definition cinosbasemotor.h:161
inosName64 m_cName
Axis name.
Definition cinosbasemotor.h:76
uint32 m_uOptions
Motor options (currently not used).
Definition cinosbasemotor.h:151
uint32 m_uIncReference
Length of reference input in [inc]. Used during homing to move away from the reference if the referen...
Definition cinosbasemotor.h:147
double m_dInertia
Application inertia. Used to calculate acceleration from torque/force (preliminary)
Definition cinosbasemotor.h:116
inosName32 m_cTrqLimitAcc
The name of the acceleration torque limitation table.
Definition cinosbasemotor.h:89
inosName m_cUnit
Axis unit, e.g. m, mm, deg, ... The string has no special meaning and is just for displaying purposes...
Definition cinosbasemotor.h:85
double m_dFeedPerTurn
Feed per turn [units] after gear.
Definition cinosbasemotor.h:107
inosName32 m_cTrqLimitDec
The name of the deceleration torque limitation table.
Definition cinosbasemotor.h:93
torque limitation point
Definition cinosbasemotor.h:173
real64 m_rRpm
velocity (RPM)
Definition cinosbasemotor.h:181
inosName32 m_cName
axis name
Definition cinosbasemotor.h:175
uint32 m_uNumber
point number
Definition cinosbasemotor.h:177
uint32 m_uDummy
alignment dummy
Definition cinosbasemotor.h:179
real64 m_rN
force/torque
Definition cinosbasemotor.h:183
torque limitation
Definition cinosbasemotor.h:188
uint32 m_uNumber
number of points
Definition cinosbasemotor.h:190
uint32 m_uDummy
alignment dummy
Definition cinosbasemotor.h:192
real64 * m_rRpm
velocity
Definition cinosbasemotor.h:194
real64 * m_rN
force/torque
Definition cinosbasemotor.h:196