INOS
cinosphysicalaxis.h
Go to the documentation of this file.
1//******************************************************************************
28//******************************************************************************
29
30#ifndef INC_CINOSPHYSICALAXIS_H
31#define INC_CINOSPHYSICALAXIS_H
32//
33//------------------------------------------------------------------------------
34// defines
35//------------------------------------------------------------------------------
36//
37#define DF_INOS_PHYSICAL_AXIS_DBT "INOS-PHYSICAL-AXIS" // db table name
38#define DF_INOS_COUPLED_AXES_DBT "INOS-COUPLED-AXES"// db table name
39#define DF_INOS_PHYSICAL_AXIS_NAME "CINOSPhysicalAxis" // axis name
40//
41// --- axis sub states ---------------------------------------------------------
42//
43#define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_BORDER 10
44 #define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_BORDER_DELAY 11
45#define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_EVENT 20
46 #define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_EVENT_BORDER_DELAY 21
47 #define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_EVENT_BORDER_DELAY1 22
48#define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_STOP 30
49#define DF_INOS_AXIS_SUBSTATE_MOVINGEX_WAIT_FOR_END 40
50//
51// --- MoveEx flags ------------------------------------------------------------
52//
53#define DF_MOVEEX_FLAGS(X) \
54 X( DF_MOVEEX_STOP_AT_EVENT, 0x00000001) \
55 /* handle range (invert direction at range end) */ \
56 X( DF_MOVEEX_HANDLE_RANGE, 0x00000002) \
57 /* handle border (disable pos errors and invert direction at border) */ \
58 X( DF_MOVEEX_HANDLE_BORDER, 0x00000004) \
59 /* needs border before event (event trigger active AFTER border) */ \
60 X( DF_MOVEEX_NEEDS_BORDER, 0x00000008) \
61 /* move with reduced current */ \
62 X( DF_MOVEEX_REDUCE_CURRENT, 0x00000010) \
63 /* the requested position defines the searching range and the starting direction */ \
64 X( DF_MOVEEX_RANGE_IS_POS, 0x00000020) \
65 /* the requested position defines just the starting direction, the range is defined
66 by the software limits */ \
67 X( DF_MOVEEX_RANGE_IS_LIMIT, 0x00000040) \
68 /* set actPos = trgPos at event */ \
69 X( DF_MOVEEX_SET_ACT_POS, 0x00000000) \
70 /* set trgPos = actPos at event. This is useful to "know" the position at
71 which the trigger occurred. NOTE: If this flag is not set, then the "actual
72 axis position" will be SET to the trigger position. This latter use case is
73 useful for e.g. axis init. */ \
74 X( DF_MOVEEX_SET_TRG_POS, 0x00000080) \
75 /* no error if event NOT found */ \
76 X( DF_MOVEEX_NO_ERROR, 0x00000100) \
77 /* return back to origin at event */ \
78 X( DF_MOVEEX_BACK_TO_ORIGIN, 0x00000200) \
79 /* signal sync object already at event (normally it is signaled at the end of the
80 move) */ \
81 X( DF_MOVEEX_SIGNAL_AT_EVENT, 0x00000400) \
82 /* move away from border */ \
83 X( DF_MOVEEX_AWAY_FROM_BORDER, 0x00000800) \
84 /* let current reduced after end of move */ \
85 X( DF_MOVEEX_LET_CURRENT_REDUCED, 0x00001000) \
86 /* return back to event */ \
87 X( DF_MOVEEX_BACK_TO_EVENT, 0x00002000) \
88 \
89 /* event trigger mask */ \
90 X( DF_MOVEEX_TRG_MASK, 0x00ff0000) \
91 /* event trigger type mask */ \
92 X( DF_MOVEEX_TRG_TYPE_MASK, 0x00070000) \
93 \
94 /* event trigger 'less than' */ \
95 X( DF_MOVEEX_TRG_LS, 0x00000000) \
96 /* event trigger 'less than or equal' */ \
97 X( DF_MOVEEX_TRG_LE, 0x00010000) \
98 /* event trigger 'equal' */ \
99 X( DF_MOVEEX_TRG_EQ, 0x00020000) \
100 /* event trigger 'greater than or equal' */ \
101 X( DF_MOVEEX_TRG_GE, 0x00030000) \
102 /* event trigger 'greater than' */ \
103 X( DF_MOVEEX_TRG_GR, 0x00040000) \
104 /* event trigger 'not equal' */ \
105 X( DF_MOVEEX_TRG_NE, 0x00050000) \
106 \
107 /* edge triggered (otherwise level triggered) */ \
108 X( DF_MOVEEX_TRG_EDGE, 0x00080000) \
109 /* trigger level is actual value (level parameter is ignored) */ \
110 X( DF_MOVEEX_TRG_ACTUAL, 0x00100000) \
111 \
112 /* special trigger */ \
113 X( DF_MOVEEX_TRG_SPECIAL, 0x00200000) \
114 /* event trigger 'sync' */ \
115 X( DF_MOVEEX_TRG_SYNC, DF_MOVEEX_TRG_SPECIAL + 0x00000000) \
116 /* event trigger 'border' */ \
117 X( DF_MOVEEX_TRG_BORDER, DF_MOVEEX_TRG_SPECIAL + 0x00010000) \
118 /*
119 live flags */ \
120 X( DF_MOVEEX_EVT_BORDER, 0x01000000) \
121 /* direct move to m_rMePositionMove position after event */ \
122 X( DF_MOVEEX_DIRECT_MOVE, 0x02000000) \
123 /* direct move relative to m_rMePositionMove position after event */ \
124 X( DF_MOVEEX_DIRECT_MOVE_REL, 0x04000000)
126// --- coupling options --------------------------------------------------------
128#define DF_INOS_AXIS_CPD_SEQUENTIAL 0x00000001
129#define DF_INOS_AXIS_CPD_OWN_POS 0x00000002
130#define DF_INOS_AXIS_CPD_READY 0x00000004
131#define DF_INOS_AXIS_CPD_CORR 0x00000008
132#define DF_INOS_AXIS_CPD_LOAD_BALANCE 0x00000010
133#define DF_INOS_AXIS_CPD_SIM_ALWAYS 0x00000020
134#define DF_INOS_AXIS_CPD_CALIB_DISABLED 0x00000040
135#define DF_INOS_AXIS_CPD_RESPECT_SLAVE_INIT 0x00000080
136#define DF_INOS_AXIS_CPD_SEQUENTIAL_FORCED 0x40000000
137#define DF_INOS_AXIS_CPD_ACTIVE 0x80000000
138//
139//------------------------------------------------------------------------------
140// includes
141//------------------------------------------------------------------------------
142//
143// system
144#include <cinosbaseaxis.h>
145#include <cinosbasecontrol.h>
146#include <cinosbasemotor.h>
147#include <inosmacro.h>
148
149//
150// C++
151//
152// project
153//
154//------------------------------------------------------------------------------
155//--- Define MOVEEX_FLAGS as enum ---------------------------------------------
156//------------------------------------------------------------------------------
157
158INOS_DEFINE_ENUM_CODE(DF_MOVEEX_FLAGS)
159
160//------------------------------------------------------------------------------
161//--- types --------------------------------------------------------------------
162//------------------------------------------------------------------------------
163//
165typedef bool (*tpMeTrgFct)(void*, void*); // pointer to trigger function
166//
167// helper struct for template casting to work around compiler... peculiarities
168template <class T>
169struct SMeTrgFunc {
170 typedef bool (*tpMeTrgFct)(T*, T*);
171};
173//
174//------------------------------------------------------------------------------
175//--- structures ---------------------------------------------------------------
176//------------------------------------------------------------------------------
177
182struct SINOSPhysicalAxis : public SINOSBaseAxis
183{
187 inosName32 m_cControlType;
188
191 inosName32 m_cMotorType;
192
193 #if defined(INOS_FORCE_CONTROL_SUPPORT)
196 inosName32 m_cForceType;
197 #endif
198
199 #if defined(INOS_MOTORCONFIG_LOAD_SUPPORT)
202 char m_cMotorConfig[63];
205 uint16 m_uMSAxisNumber;
210 uint8 m_uMotorConfigFlags;
211 #endif
212
219 real64 m_rBorderLimit;
220
224 real64 m_rBorderRelax;
225
229 uint32 m_uBorderType;
230
233 uint32 m_uBorderDelay;
234
237 uint32 m_uBorderStop;
239
244struct SINOSCoupledAxes
245{
248 inosName64 m_cName1;
249
252 inosName64 m_cName2;
253
256 real64 m_rMaxDelta;
257
260 real64 m_rMaxCorr;
261
264 uint32 m_uOptions;
265
268 inosName32 m_cLoadBalanceAxis;
269
273};
275//------------------------------------------------------------------------------
284 CINOSDacChannel* m_pItrqSlave = nullptr;
286 real64 m_rFactor = REAL64(0.0);
288 uintid m_uHookId = 0;
289};
291//------------------------------------------------------------------------------
292// class definition
293//------------------------------------------------------------------------------
294//
295class CINOSBit;
296class CINOSPhysicalAxis : public CINOSBaseAxis
297{
298 //--- user interface ---------------------------------------------------
299
300 // public member functions
301 public :
302
303 // constructor/destructor
304
305 explicit CINOSPhysicalAxis(SINOSPhysicalAxis* apDesc);
306 //; constructor
308 CINOSBaseControl* apControl, CINOSBaseMotor* apMoto);
309 //; constructor
310 virtual ~CINOSPhysicalAxis();
311 //; destructor
312 static CINOSPhysicalAxis* GetAxis(const char* apAxisName);
313 //; return pointer to axis apAxisName
314 static CINOSPhysicalAxis* GetAxis(uint32 auNumber);
315 //; return pointer to axis auNumber
320 virtual uint32 Connect() override;
321
322 virtual uint32 Activate(bool abCheckPos = true, bool abSimulatePos = false,
323 bool abSimulateOut = false, bool abSimulateAct = false,
324 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
325 //; activate physical axis
326 virtual uint32 InActivate(CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
327 //; inactivate physical axis
328 virtual uint32 Relax(uint32 auTimeMs, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
329 //; relax
330 virtual uint32 Commutate();
331 //; commutate pysical axis
332 virtual uint32 ForceCommutate(bool abAlways = false);
333 //; force a commutation at next acitvate, abAlways=true -> always,
334 //; abAlways=false -> only if axis not yet synchronised
335 virtual uint32 ReActivate(uint32 auDelayMs = 100);
336 //; inactivate axis, wait and activate it again using the same simulation flags
338 virtual uint32 Sync(real64 arPosition, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
339 //; move to position with sync detect and set pos to 0.0 at sync
340 virtual uint32 Sync(real64 arPosition, SINOSRampParam* apParam,
341 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
342 //; move to position with sync detect and set pos to 0.0 at sync
343 virtual uint32 Sync(real64 arPosition, const char* apParam,
344 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
345 //; move to position with sync detect and set pos to 0.0 at sync
346 virtual uint32 Sync(real64 arPosition, real64 arSyncPos,
347 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
348 //; move to position with sync detect and set pos to aSyncPos, stop
349 //; if requested
350 virtual uint32 Sync(real64 arPosition, real64 arSyncPos,
351 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
352 //; move to position with sync detect and set pos to aSyncPos, stop
353 //; if requested
354 virtual uint32 Sync(real64 arPosition, real64 arSyncPos,
355 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
356 //; move to position with sync detect and set pos to aSyncPos, stop
357 //; if requested
358 virtual uint32 Sync(real64 arSyncPos, const char* apParam, CINCOObject* apObject,
359 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
360 //; move to position with sync detect and set pos to aSyncPos, stop
361 //; if requested
362 virtual uint32 Sync(real64 arPosition, real64 arSyncPos, uint32 auFlags,
364 //; move to position with sync detect and set pos to aSyncPos, stop
365 //; if requested
366 virtual uint32 Sync(real64 arPosition, real64 arSyncPos, uint32 auFlags,
367 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
368 //; move to position with sync detect and set pos to aSyncPos, stop
369 //; if requested
370 virtual uint32 Sync(real64 arPosition, real64 arSyncPos, uint32 auFlags,
371 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
372 //; move to position with sync detect and set pos to aSyncPos, stop
373 //; if requested
374
384 virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos,
386
397 virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos,
398 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
399
410 virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos,
411 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
412
413 virtual uint32 MoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
414 const char* apTrgName, real64 arTrgLevel, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
415 //; move extended (see MoveEx flags)
416 virtual uint32 MoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
417 const char* apTrgName, real64 arTrgLevel, SINOSRampParam* apParam,
419 //; move extended (see MoveEx flags)
420 virtual uint32 MoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
421 const char* apTrgName, real64 arTrgLevel, const char* apParam,
423 //; move extended (see MoveEx flags)
424
425 virtual uint32 MoveExApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
426 real64& arTrgPos, uint32 auFlags, const char* apTrgName, real64 arTrgLevel,
428 //; move extended (see MoveEx flags)
429 virtual uint32 MoveExApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
430 real64& arTrgPos, uint32 auFlags, const char* apTrgName, real64 arTrgLevel,
431 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
432 //; move extended (see MoveEx flags)
433 virtual uint32 MoveExApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
434 real64& arTrgPos, uint32 auFlags, const char* apTrgName, real64 arTrgLevel,
435 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
436 //; move extended (see MoveEx flags)
440 enum EBorderType {
449 enum EBorderStop {
452 };
453
457 virtual void SetBorderType(EBorderType auType)
458 // set the type
459 { m_eBorderType = auType;};
460
464 virtual void GetBorderType(EBorderType& auType)
465 // set the type
466 { auType = m_eBorderType;};
467
471 virtual void SetBorderLimit(real64 arLimit)
472 // set the limit
473 { m_rBorderLimit = arLimit;};
474
478 virtual void GetBorderLimit(real64& arLimit)
479 // set the limit
480 { arLimit = m_rBorderLimit;};
481
485 virtual void SetBorderRelax(real64 arRelax)
486 // set the value
487 { m_rBorderRelax = arRelax;};
488
492 virtual void GetBorderRelax(real64& arRelax)
493 // set the limit
494 { arRelax = m_rBorderRelax;};
495
498 virtual uint32 ReleaseFromBorder();
499
507 virtual uint32 MoveToBorder(real64 arPosition, const char* apParam,
508 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
509
518 virtual uint32 MoveToBorder(real64 arPosition, real64& arResult,
519 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
520
532 virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel,
533 real64 arVelocity, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
534
547 virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel,
548 real64 arVelocity, real64& arResult, const char* apParam,
549 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
550
564 virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel,
565 real64 arVelocity, real64& arResult, uint32 auFlags, const char* apParam,
567
578 virtual uint32 MoveToDigitalSensor(const char* apName, real64 arPosition,
579 bool abSet, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
580
592 virtual uint32 MoveToDigitalSensor(const char* apName, real64 arPosition,
593 bool abSet, real64& arResult, const char* apParam,
594 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
595
615 virtual uint32 MoveToDigitalSensor(const char* apName, real64 arPosition,
616 bool abSet, real64& arResult, uint32 auFlags, const char* apParam,
617 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
618
630 virtual uint32 MoveToDigitalSensorApp(const char* apName, real64 arPosition,
631 bool abSet, real64 arPositionVel, real64 arVelocity,
632 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
633
647 virtual uint32 MoveToDigitalSensorApp(const char* apName, real64 arPosition,
648 bool abSet, real64 arPositionVel, real64 arVelocity, real64& arResult,
649 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
650
665 virtual uint32 MoveToDigitalSensorApp(const char* apName, real64 arPosition,
666 bool abSet, real64 arPositionVel, real64 arVelocity, real64& arResult,
667 uint32 auFlags, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
668
679 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
680 real64 arLevel, bool abGreater, const char* apParam,
681 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
682
694 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
695 real64 arLevel, bool abGreater, real64& arResult, const char* apParam,
696 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
697
710 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
711 real64 arLevel, bool abGreater, real64& arResult, SINOSRampParam* apParam,
713
726 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
727 real64 arLevel, bool abGreater, real64& arResult, uint32 auFlags,
728 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
729
742 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
743 real64 arLevel, bool abGreater, real64& arResult, uint32 auFlags,
744 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
745
759 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
760 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
761 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
762
777 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
778 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
779 real64& arResult, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
780
795 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
796 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
797 real64& arResult, SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
798
814 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
815 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
816 real64& arResult, uint32 auFlags, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
817
833 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
834 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
835 real64& arResult, uint32 auFlags, SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
836
837 #if defined(INOS_FORCE_CONTROL_SUPPORT)
844 virtual uint32 ForceActivate(const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
845
851
856 virtual uint32 ForceInactivate(double adLimit, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
857
869 virtual uint32 ForceApproach(double adPosition, double adPositionVel, double adVelocity,
870 double adForce, double adForcelimit, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
871
881 virtual uint32 ForceDepart(double adPosition, double adPositionVel, double adVelocity,
882 double adForceLimit, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
883
890 virtual uint32 ForceMove(double adForce, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
897 virtual uint32 ForceMoveStop(const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
898
906 virtual uint32 ForceBreak(double adForce, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
907
912 virtual uint32 ForceTara(double adForce = 0.0, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
913
918 virtual uint32 ForceSelect(const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
919
927 virtual uint32 ForcePull(double adForce);
928
933 virtual uint32 EnableForceLimit(double adLimit);
934
938 virtual uint32 DisableForceLimit();
939
943 virtual uint32 ForceCancel();
944
945 #endif // end if INOS_FORCE_CONTROL_SUPPORT
947 // set/get property functions
949 //; set commanded path axis position
950 virtual void SetPathPosition(real64 arPosition) override
951 { m_pControl->SetPathS(arPosition); };
952 virtual uint32 SetActPosition(real64 arPosition) override;
953 //; set actual commanded position
954 virtual void GetActPosition(real64& arPosition, bool abRamp = true) override;
955 //; get actual commanded position
956 virtual void GetActPosition(real64& arPosition, uint64 auTicks) override;
957 //; get actual commanded position at bus ticks auTicks
958 virtual void GetActPosition(real64& arCmdPosition, real64& arRealPosition);
959 //; get actual commanded and real positions
960 virtual void GetActVelocity(real64& arVelocity, bool abRamp = true) override;
961 //; get actual commanded velocity
962 virtual void GetActVelocity(real64& arCmdVelocity, real64& arRealVelocity);
963 //; get actual commanded and real velocities
964 virtual void GetActAcceleration(real64& arAcceleration, bool abRamp = true) override;
965 //; get actual commanded acceleration
966 virtual void GetActAcceleration(real64& arCmdAcceleration, real64& arRealAcceleration);
967 //; get actual commanded and real accelerations
968 virtual void GetActJerk(real64& arJerk, bool abRamp = true) override;
969 //; get actual commanded jerk
970 virtual void GetActPosError(real64& arPosError) override;
971 //; get actual position error
972 virtual void GetActVelocityError(real64& arVelocityError, bool abFiltered = false) override;
973 //; get actual velocity error
974 virtual void GetPosErrorAtEvent(real64& arPosError)
975 { arPosError = m_rMePosErr;};
976 //; get pos error at moveex event
977
978 virtual uint32 SetRealPosition(real64 arPosition) override;
979 //; set actual real position
980 virtual void GetRealPosition(real64& arPosition, bool abMapped = true) override;
981 //; get actual real position
982 virtual void GetRealVelocity(real64& arVelocity) override;
983 //; get actual real velocity
984 virtual void GetRealVelocityFiltered(real64& arVelocity);
985 //; get actual filtered real velocity
986 virtual void GetRealAcceleration(real64& arAcceleration) override;
987 //; get actual real acceleration
988 virtual void GetRealJerk(real64& arJerk) override;
989 //; get actual real jerk
990
992 void SetLifetimeDistance(real64 arDistance);
994 void GetLifetimeDistance(real64& arDistance);
995
996 virtual void GetUnitsPerInc(double& adUnits) override;
997 //; get number of units per one inc
998 virtual void SetIncsPerUnit(double adIncs);
999 //; set number of incs per unit
1000 virtual void GetIncsPerUnit(double& adIncs) override;
1001 //; get number of incs per unit
1002 virtual void SetGearRatio(double adGearRatio);
1003 //; set gear ratio
1004 virtual void GetGearRatio(double& adGearRatio);
1005 //; get gear ratio
1006 virtual void SetFeedPerTurn(double adFeedPerTurn);
1007 //; set feed per turn
1008 virtual void GetFeedPerTurn(double& adFeedPerTurn);
1009 //; get feed per turn
1010 virtual void SetIncsPerTurn(double adIncsPerTurn);
1011 //; set incs per turn
1012 virtual void GetIncsPerTurn(double& adIncsPerTurn);
1013 //; get incs per turn
1014 virtual void GetTurnsPerMin(double& adTurnsPerMin);
1015 //; get turns per minute
1016 virtual void GetIncPosition(uint8& auIncPosition);
1017 //; get position of increments (A=0, B=1)
1018 virtual void SetInertia(double adInertia);
1019 //; set inertia
1020 virtual void GetInertia(double& adInertia);
1021 //; get inertia
1022
1023 virtual void GetCycleTime(real64& arCycleTime, bool abOversampled=false) override;
1024 //; get axis cycle time [sec]
1025 virtual uint8 GetOversampling() override;
1026 //; get oversampling factor
1027 virtual uint16 GetCycleNumber() override;
1028 //; get axis cycle number
1029 virtual uint16 GetCycleId() override;
1030 //; get axis cycle id
1031 virtual void UpdateCycleId(uint16 auCycleId) override;
1032 //; set core id and cycle number the axis is running in
1033 virtual uint8 GetBusId() override;
1034 //; get axis bus id
1035 virtual uint32 SetParam(const char* apName, real64 arValue) override;
1036 //; universal set parameter with aName to aValue and return error code
1037 virtual uint32 GetParam(const char* apName, real64& arResult) override;
1038 //; universal get parameter with aName to aResult and return error code
1039
1040 virtual int32 GetState() override;
1041 //; get axis state
1042 virtual int32 GetState(uint32& auRampState) override;
1043 //; get axis and ramp state
1044 virtual int32 GetState(uint32& auRampState, uint32& auControlState);
1045 //; get axis, ramp and control state
1046 virtual uint32 GetError(bool abResolveExternal = false) override;
1047 //; get axis error
1048 virtual uint64 GetErrorEx(bool abResolveExternal = false) override;
1049 //; get extended axis error
1050 virtual uint32 GetError(uint32& auRampError, bool abResolveExternal = false) override;
1051 //; get axis and ramp error
1052 virtual uint64 GetErrorEx(uint64& auRampError, bool abResolveExternal = false) override;
1053 //; get extended axis and ramp error
1054 virtual uint32 GetError(uint32& auRampError, uint32& auControlError,
1055 bool abResolveExternal = false);
1056 //; get axis, ramp and control error
1057 virtual uint64 GetErrorEx(uint64& auRampError, uint64& auControlError,
1058 bool abResolveExternal = false);
1059 //; get axis, ramp and control error
1060 virtual bool IsErrorFatal() override;
1061 //; return true if error is fatal
1062 virtual uint32 GetWarning(bool abResolveExternal = false) override;
1063 //; get axis warning
1064 virtual uint64 GetWarningEx(bool abResolveExternal = false) override;
1065 //; get extended axis warning
1066 virtual uint32 GetWarning(uint32& auRampWarning, bool abResolveExternal = false) override;
1067 //; get axis and ramp warning
1068 virtual uint64 GetWarningEx(uint64& auRampWarning, bool abResolveExternal = false) override;
1069 //; get extended axis and ramp warning
1070 virtual uint32 GetWarning(uint32& auRampWarning, uint32& auControlWarning,
1071 bool abResolveExternal = false);
1072 //; get axis, ramp and control warning
1073 virtual uint64 GetWarningEx(uint64& auRampWarning, uint64& auControlWarning,
1074 bool abResolveExternal = false);
1075 //; get axis, ramp and control warning
1076 virtual uint32 AcceptError() override;
1077 //; accept all errors
1078 virtual uint32 AcceptError(uint32 auError) override;
1079 //; accept error
1080 virtual uint32 AcceptError(uint32 auError, uint32 auRampError) override;
1081 //; accept error
1082 virtual uint32 AcceptError(uint32 auError, uint32 auRampError,
1083 uint32 auControlError);
1084 //; accept error
1085 virtual uint32 AcceptWarning() override;
1086 //; accept all warnings
1087 virtual uint32 AcceptWarning(uint32 auWarning) override;
1088 //; accept warning
1089 virtual uint32 AcceptWarning(uint32 auWarning, uint32 auRampWarning) override;
1090 //; accept warning
1091 virtual uint32 AcceptWarning(uint32 auWarning, uint32 auRampWarning,
1092 uint32 auControlWarning);
1093 //; accept warning
1094 virtual uint32 SetParam(const char* apName, uint64 auValue) override
1095 //; universal set parameter with aName to aValue and return error code
1096 { return defVarNotFound;};
1097 virtual uint32 GetParam(const char* apName, uint64& auResult) override
1098 //; universal get parameter with aName to aResult and return error code
1099 { return defVarNotFound;};
1100
1101 // miscellaneous functions
1102
1103 virtual CINCOObject* GetRegister() override;
1104 //; do inco registration and return pointer to it
1105 virtual CINOSBaseControl* GetControl()
1106 { return m_pControl;};
1107 //; return pointer to axis controller
1108 virtual CINOSBaseMotor* GetMotor()
1109 { return m_pMotor;};
1110 //; return pointer to axis controller
1111 #ifdef INOS_FORCE_CONTROL_SUPPORT
1112 virtual class CINOSForceControl* GetForce()
1113 { return m_pForce;};
1114 //; return pointer to force controller
1115 #endif
1116
1117 virtual bool IsEmgInActivating();
1118 //; returns true if the axis is about to inactivate due to an emergency stop
1119
1120 // auto sync
1121
1122 virtual void EnableSync(real64 arPosition = REAL64(0.0),
1123 uint8 auSyncMode = DF_INOS_AXIS_SYNC_NOADJ) override;
1124 //; enable auto syncing (at sync set pos = arPosition)
1125 virtual void DisableSync() override;
1126 //; disable auto syncing
1127 virtual void GetSyncCount(uint32& auSyncCount) override;
1128 //; return actual sync counter
1129 virtual void SetSyncCount(uint32 auSyncCount) override;
1130 //; set sync counter
1131 virtual void GetSyncCorr(real64& arSyncCorr);
1132 //; return actual sync coorrection
1133 virtual bool EnableSafeSync();
1134 //; enable safe sync and return true if done/available
1135 virtual void DisableSafeSync();
1136 //; disable safe sync
1137
1138 // auto norm
1139
1140 virtual void EnableNorm(uint8 auMode = DF_INOS_AXIS_NORM_AFTER,
1141 uint8 auMoveDir = DF_INOS_AXIS_NORM_MOVE_DIR_NO,
1142 real64 arNormPos = REAL64(0.0)) override;
1143 //; enable auto norm of position
1144 virtual void DisableNorm() override;
1145 //; disable auto norm
1146
1148 virtual void SetNormMode(uint8 auNormMode) override;
1149
1150 // current limitation
1151
1152 virtual void EnableCurLimit() override;
1153 //; enable current limitation
1154 virtual void DisableCurLimit() override;
1155 //; disable current limitation
1156 virtual void SetCurLimit(bool abEnable);
1157 //; set current limitation to requested value
1158 virtual bool GetCurLimit() override;
1159 //; return state of current limitation
1160 virtual void SetMaxCurrent(real64 arMaxCurrent);
1161 //; set the max current
1162 virtual void GetMaxCurrent(real64& arMaxCurrent);
1163 //; get the max current
1164
1165
1166 // coupling
1167
1168 CINOSPhysicalAxis* GetCoupledAxis()
1169 { return m_pCpdAxis;};
1170 //; return pointer to my coupled axis if any
1171 uint32 GetCoupledOptions()
1172 //; return coupling options
1173 { return m_uCpdOptions;};
1174 virtual bool IsCouplingEnabled()
1175 //; checks if coupling is enabled
1176 { return m_uCpdOptions & DF_INOS_AXIS_CPD_READY;};
1177 virtual uint32 EnableCoupling(const char* apAxis, uint32 auOptions,
1178 real64 arMaxDelta);
1179 //; enable axis coupling with axis 'apAxis'
1180 virtual uint32 EnableCoupling(const char* apAxis, uint32 auOptions,
1181 real64 arMaxDelta, real64 arMaxCorr);
1182 //; enable axis coupling with axis 'apAxis'
1183 virtual uint32 EnableCoupling();
1184 //; enable axis coupling
1185 virtual uint32 DisableCoupling();
1186 //; disable axis coupling
1187 virtual uint32 EnableLoadBalancing(const char* apAxis, real64 arFactor);
1188 //; enable load balancing with axis 'apAxis'
1189 virtual uint32 DisableLoadBalancing();
1190 //; disable load balancing
1191 virtual void SetCpdOption(uint32 auOption) {
1192 INOS_OR(m_uCpdOptions, auOption);
1193 }
1194 virtual void ClrCpdOption(uint32 auOption) {
1195 INOS_AND(m_uCpdOptions, ~auOption);
1196 }
1197 virtual uint32 GetCpdOptions() {
1198 return m_uCpdOptions;
1199 }
1200
1201 // border limits
1202
1203 virtual void SetBorderLimit(CINOSBit* apLimitPos, CINOSBit* apLimitNeg,
1204 bool abInverted = false)
1205 //; set border limits
1206 { m_pLimitPos = apLimitPos; m_pLimitNeg = apLimitNeg;
1207 m_bLimitInv = abInverted; if (m_pLimitPos || m_pLimitNeg) m_eBorderType = eBorderSensor;};
1208 virtual void ResetBorderLimit()
1209 //; reset border limits
1210 { m_pLimitPos = m_pLimitNeg = NULL;};
1211
1212 // power
1213
1214 virtual CINOSBit* GetPowerReady();
1215 //; get pointer to power ready bit
1216 virtual bool IsPowerReady();
1217 //; return true if power ready
1218 virtual bool IsOnline() const;
1219 //; \return true if the axis is online (physically connected to
1220 //; master). false otherwise.
1222 // enable
1223
1225 void SetAxisEnableInput(const char* apInputName);
1227 void GetAxisEnableInput(char* apResult, uint32 auSize) const;
1228
1229 // safety
1230
1231 #ifdef INOS_SAFETY_SUPPORT
1232
1233 virtual uint32 MoveMicro();
1234 //; initiate a micro move used to prevent a sincoshalt safety error
1235 //; \return true if the move was successfully initiated
1236 virtual bool iSetupSafetyRegistration() override;
1237 //; setup safety inco tree
1238
1239 #endif // INOS_SAFETY_SUPPORT
1240
1241 #if defined(INOS_MOTORCONFIG_LOAD_SUPPORT)
1242 virtual void GetMotorConfig(char* apResult, uint32 auSize) const
1243 {
1244 SINOSPhysicalAxis* desc = (SINOSPhysicalAxis*) m_pDesc;
1245 inos_strncpy(apResult, desc->m_cMotorConfig, auSize);
1246 }
1247 virtual bool IsMotorConfigValid() const
1248 {
1249 // motor config is invalid if a cpf is requested but not found, all other cases are 'valid'
1250 SINOSPhysicalAxis* desc = (SINOSPhysicalAxis*) m_pDesc;
1251 return !((nullptr != desc) && (0 != strlen(desc->m_cMotorConfig)) && (0 == (desc->m_uMotorConfigFlags & 1)));
1252 }
1253 virtual bool IsMotorConfigUnique() const
1254 {
1255 // motor config is unique if only this axis uses this config
1256 SINOSPhysicalAxis* desc = (SINOSPhysicalAxis*) m_pDesc;
1257 return ((nullptr != desc) && ((0 == strlen(desc->m_cMotorConfig)) || (2 == (desc->m_uMotorConfigFlags & 2))));
1258 }
1259 #endif
1260
1261 //--- internals --------------------------------------------------------
1262
1263 // protected member functions
1264 protected :
1265 void Create();
1266 //; create physical axis
1267 SINOSBaseRampTrqLimit* CreateTrqLimit(SINOSMotorTrqLimit* apLimit,
1268 real64 arAmax);
1269 //; create physical axis
1270 virtual void iInActivate() override;
1271 //; inactivate axis
1272 virtual void iStop(SINOSRampParam* apParam) override;
1273 //; internal stop
1274 virtual void iEmergencyStop(bool abLive = false) override;
1275 //; internal emergency stop
1276 virtual void iPowerEmergencyStop() override;
1277 //; internal power failre emergency stop
1278 virtual void iSetCycleTime(real64 arCycleTime) override;
1279 //; set axis cycle time [sec]
1280 virtual void iRegisterAxis() override;
1281 //; register axis
1282 virtual uint32 iMoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
1283 const char* apTrgName, real64 arTrgLevel, SINOSRampParam* apParam,
1284 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
1285 //; move extended (see MoveEx flags)
1286 void iiMoveEx();
1287 //; internal MoveEx (called as postbus hook)
1288 bool iMoveExSetupTrigger(const char* apTrgName, real64 arTrgLevel);
1289 //; internal MoveEx (called as postbus hook)
1290 bool iMoveExBorderReached();
1291 //; return true if border reached
1292 bool iMoveExBorder();
1293 //; return true if border reached
1294 bool iMoveExTriggerOccured();
1295 //; return true if trigger event occured
1296 void iMoveExRestoreControl();
1297 //; restore control flags
1298 void iMoveExCleanup();
1299 //; do clean up
1300 void iMoveExWaitForBorderDelayDone();
1301 //; post wait work
1302 void iMoveExWaitForEventBorderDelayDone();
1303 //; post wait work
1304 void iMoveExBorderOccured();
1305 //; border occured handler
1306 void iMoveExBorderRelaxStart();
1307 //; border relax start
1308 void iMoveExBorderRelaxStop();
1309 //; border relax stop
1310 ICACHE virtual void iPostMap() override;
1311 //; post mapping handler
1312 ICACHE virtual void iPostMapCpd();
1313 //; post mapping handler (coupled axis)
1314 ICACHE virtual void iPostWrite() override;
1315 //; post bus write handler
1316 ICACHE virtual void iPostWriteCpd();
1317 //; post bus write handler (coupled axis)
1318 virtual uint32 iEnableCoupling();
1319 //; enable axis coupling
1320 virtual void iActivateCoupling();
1321 //; activate coupling
1322 virtual void iInActivateCoupling();
1323 //; inactivate coupling
1324 void iCheckErrors();
1325 //; check for pending errors
1326 void iCheckWarnings();
1327 //; check for pending Warnings
1328 virtual void iSetActRampPosition(real64 arPosition) override;
1329 //; set actual ramp geni position
1330 static bool TestBit_0(void* apAddress , void* apNumber);
1331 //; returns true if bit apAddress:*apNumber = 0
1332 static bool TestBit_1(void* apAddress , void* apNumber);
1333 //; returns true if bit apAddress:*apNumber = 1
1334 static bool TestBit_true(void* apAddress , void* apNumber);
1335 //; returns always true
1336 uint32 eMoveEx(real64 arPosition, real64 arTrgPosition, uint32 auFlags,
1337 char* apTrgName, real64 arTrgLevel);
1338 //; MoveEx
1339 uint32 eMoveEx(real64 arPosition, real64 arTrgPosition, uint32 auFlags,
1340 char* apTrgName, real64 arTrgLevel, char* apParam);
1341 //; MoveEx
1342 uint32 eMoveToBorder(real64 arPosition, char* apParam);
1343 //; MoveToBorder
1344 uint32 eSync(real64 arPosition, real64 arSyncPosition, uint32 auFlags);
1345 //; sync axis
1346 uint32 eSync(real64 arPosition, real64 arSyncPosition, uint32 auFlags, char* apParam);
1347 //; sync axis
1348
1349 void iLoadBalancingHook();
1350 //; load balancing hook
1351
1352#ifdef INOS_SAFETY_SUPPORT
1353 void iHandleSafety(uint32& uError);
1354 //; handle safety support
1355#endif // INOS_SAFETY_SUPPORT
1356
1357 // protected members
1358 protected:
1359 CINOSBaseMotor* m_pMotor;
1360 //; pointer to according motor
1361 CINOSBaseControl* m_pControl;
1362 //; pointer to according axis controller
1363 bool m_bSyncStop;
1364 //; true if stop requested after sync
1365 bool m_bPowerOnCtr0;
1366 //; true if ctr0 has to be taken to read power ready
1367
1368 // MoveEx properties
1369
1370 uint32 m_uMeFlags;
1371 //; actual move ex flags
1372 SINOSRampParam* m_pMeParam;
1373 //; move params
1374 uint32 m_uMeCtrFlag;
1375 //; control flags at start of moveex
1376 uint32 m_uMeRmpFlag;
1377 //; ramp flags at start of moveex
1378 real64 m_rMePosS;
1379 //; position at start of move
1380 real64 m_rMePosErr;
1381 //; position error at border
1382 real64 m_rMePos1;
1383 //; first end pos of range
1384 real64 m_rMePos2;
1385 //; second end pos of range
1386 real64* m_pMePosT;
1387 //; pointer to trigger position
1388 EBorderType m_eBorderType;
1389 //; type of border detection
1390 EBorderStop m_eBorderStop;
1391 //; type of stop at border
1392 real64 m_rBorderLimit;
1393 //; pos error indicating a border
1394 real64 m_rBorderRelax;
1395 //; move away distance after border detection before reactivating pos check
1396 //; supervision
1397 uint32 m_uBorderDelay;
1398 //; relax time [ms], during this time the controller is informed
1399 //; about the fact that we've just touched a border
1400 bool m_bBorderRelaxActive;
1401 //; true if border relax active
1402 void* m_pMeTrgSrcAdr;
1403 //; source address of trigger
1404 uint64 m_uMeTrgLevel;
1405 //; source address of trigger level
1406 tpMeTrgFct m_pMeTrgFct;
1407 //; pointer to actual trigger function
1408 uint16 m_uMeTrgSrcTyp;
1409 //; type of trigger
1410 uint16 m_uMeTrgSrcBit;
1411 //; bit number if trigger of type bit
1412 real64 m_rMePositionVel;
1413 //; used for moveexapp
1414 real64 m_rMeVelocity;
1415 //; used for moveexapp
1416 real64 m_rMePositionMove;
1417 //; used for syncmove
1418 bool m_bMeMoveApp;
1419 //; move app pending
1420 bool m_bMeCurrentLimit;
1421 //; current limit pending
1422 bool m_bMeRestoreControlFlags;
1423 //; restore control flags pending
1424 bool m_bMeTriggerMasked;
1425 //; trigger masked out
1426 real64 m_rMePositionAtBorder;
1427 //; axis position at border detection
1428
1429 // coupling
1430
1431 uint32 m_uCpdOptions;
1432 //; 'coupling' options
1433 CINOSPhysicalAxis* m_pCpdAxis;
1434 //; pointer to coupled axis
1435 CINOSBaseControl* m_pCpdControl;
1436 //; pointer to coupled controller
1437 uint16 m_uCpdWait;
1438 //; internal wait
1439 uint16 m_uCpdWaitCns;
1440 //; internal wait constant (4ms in cycles)
1441 real64 m_rCpdOffset;
1442 //; coupling offset between the two axes
1443 real64 m_rCpdMaxDelta;
1444 //; max. allowed S delta between coupled axes
1445 real64 m_rCpdMaxCorr;
1446 //; max. allowed correction if auto correction enabled (bit 3=1)
1447 real64 m_rCpdDelta;
1448 //; actual S delta between coupled axes
1449 uint32 m_uRelaxTime;
1450 //; relax time [ms]
1451 SINOSLoadBalancing m_CpdLoadBalancing;
1452 //; load balancing for coupled axes
1453
1454 // border
1455
1456 bool m_bLimitInv;
1457 //; true if limi switch handling inverted
1458 CINOSBit* m_pLimitPos;
1459 //; pointer to pos border limit (if available)
1460 CINOSBit* m_pLimitNeg;
1461 //; pointer to neg border limit (if available)
1462
1463 // command parameters
1464 private:
1465 uint32 m_ueFlagsSync;
1466 //; param : Sync flags
1467 uint32 m_ueFlagsMoveEx;
1468 //; param : MoveEx flags
1469 real64 m_reTrgPos;
1470 //; param : TrgPos
1471 real64 m_reTrgLevel;
1472 //; param : TrgLevel
1473
1474 char m_ceCpdAxis[16];
1475 //; param CpdAxis
1476 uint32 m_ueCpdOptions;
1477 //; param CpdOptions
1478 real64 m_reCpdMaxDelta;
1479 //; param CpdMaxDelta
1480 real64 m_reCpdMaxCorr;
1481 //; param CpdMaxCorr
1482 real64 m_reStretchFactor;
1483 //; param StretchFactor
1484 real64 m_reInertia;
1485 //; param inertia
1486
1487 #if defined(INOS_FORCE_CONTROL_SUPPORT)
1488 double m_deForce = 5.0;
1489 double m_deForceLimit = 10.0;
1490 double m_deForceTara = 0.0;
1491 uint32 m_uForceControlFlags = 0;
1492 inosName32 m_ceForceParam{};
1493 class CINOSForceControl* m_pForce = nullptr;
1494 uintid m_uForceHookId = 0;
1495 CINOSSync* m_pForceSync = nullptr;
1496 uint32 eForceActivate(const char*);
1497 uint32 eForceInactivate();
1498 uint32 eForceInactivate(double);
1499 uint32 eForceApproach(double,double,double,double,double,const char*);
1500 uint32 eForceDepart(double,double,double,double,const char*);
1501 uint32 eForceMove(double,const char*);
1502 uint32 eForceMoveStop(const char*);
1503 uint32 eForceBreak(double,const char*);
1504 uint32 eForceTara(double);
1505 uint32 eForceSelect(const char*);
1506 // force methods protected to give descendants a chance to use them
1507 protected :
1508 void ForceSignal();
1509 void ForceSignal(CINOSSync* apSync);
1510 void ForcePosition();
1511 void ForceHook();
1512 void ForceHookEnable();
1513 void ForceHookDisable();
1514 #endif
1515
1516 // allow dynamic object handling (new/delete)
1518};
1519
1520//
1521//------------------------------------------------------------------------------
1522// end of file
1523//------------------------------------------------------------------------------
1524
1525#endif // INC_CINOSPHYSICALAXIS_H
#define DF_INOS_AXIS_NORM_MOVE_DIR_NO
Definition cinosbaseaxis.h:188
#define DF_INOS_AXIS_NORM_AFTER
Definition cinosbaseaxis.h:171
Short comment.
Short comment.
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
#define DF_INOS_AXIS_CPD_READY
coupled axis ready to activate
Definition cinosphysicalaxis.h:124
Provides axis functionality.
Definition cinosbaseaxis.h:694
Definition cinosbasecontrol.h:329
Definition cinosbasemotor.h:204
Definition cinosbaseramp.h:761
Definition cinosbit.h:54
Definition cinosdacchannel.h:52
Provides physical aka real axis functionality.
Definition cinosphysicalaxis.h:291
virtual uint32 Relax(uint32 auTimeMs, CINOSSync *apSync=DF_INOS_SYNCHRONOUS) override
Relax a coupled slave axis for a given time.
virtual void DisableNorm() override
virtual uint32 ReleaseFromBorder()
Release from border (used after MoveToBorder)
virtual uint32 ForceMoveStop(const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Stop a running ForceMove with the given param set.
virtual uint32 ForcePull(double adForce)
Set a new force point start force pull mode if not et done. If one is running an axis in force pull m...
virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search reference till max. arPosition. If reference found, set position at reference to arSyncPos and...
virtual uint32 ForceActivate(const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Switch from position to force mode.
virtual uint32 ForceApproach(double adPosition, double adPositionVel, double adVelocity, double adForce, double adForcelimit, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search requested force [N], stop if found and switch to force mode.
virtual uint32 MoveToDigitalSensor(const char *apName, real64 arPosition, bool abSet, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search digital sensor till arPosition and stop if found. If not found, the axis will go into "Failed"...
virtual uint32 InActivate(CINOSSync *apSync=DF_INOS_SYNCHRONOUS) override
Inactivate axis.
virtual uint32 ForceDepart(double adPosition, double adPositionVel, double adVelocity, double adForceLimit, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Switch to position mode and depart from force point.
virtual void SetBorderRelax(real64 arRelax)
Set border relax value (used in MoveToBorder method)
Definition cinosphysicalaxis.h:479
virtual void SetBorderLimit(real64 arLimit)
Set border limit value (used in MoveToBorder method)
Definition cinosphysicalaxis.h:465
virtual void GetActPosition(real64 &arPosition, bool abRamp=true) override
Gets the actual axis position.
virtual uint32 Connect() override
Connect axis to hardware.
virtual uint32 SetRealPosition(real64 arPosition) override
Sets the real axis position. This method ignores a current following error and should therefore NOT b...
virtual uint32 Sync(real64 arPosition, CINOSSync *apSync=DF_INOS_SYNCHRONOUS) override
Search reference mark till arPosition and set actual position to 0.0 at mark.
virtual void EnableNorm(uint8 auMode=DF_INOS_AXIS_NORM_AFTER, uint8 auMoveDir=DF_INOS_AXIS_NORM_MOVE_DIR_NO, real64 arNormPos=REAL64(0.0)) override
virtual uint32 ForceSelect(const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Select given param set.
virtual uint32 MoveToBorder(real64 arPosition, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search border till arPosition and stop if found (use ReleaseFromBorder before other moves are initiat...
virtual void GetBorderLimit(real64 &arLimit)
Get border limit value (used in MoveToBorder method)
Definition cinosphysicalaxis.h:472
virtual uint32 ForceMove(double adForce, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Ramp the commanded force to the requested value [N] with the given param set.
virtual void SetNormMode(uint8 auNormMode) override
EBorderType
The different border types the system supports.
Definition cinosphysicalaxis.h:434
@ eBorderSpeed
use the current speed error to detect border
Definition cinosphysicalaxis.h:436
@ eBorderPosition
use the current position check error to detect border
Definition cinosphysicalaxis.h:435
@ eBorderSpeedAbs
use real speed to detect border
Definition cinosphysicalaxis.h:438
@ eBorderSensor
use a digital input to detect border
Definition cinosphysicalaxis.h:437
virtual uint32 DisableForceLimit()
Disable force limitation.
virtual void SetBorderType(EBorderType auType)
Set border limit type (used in MoveToBorder method)
Definition cinosphysicalaxis.h:451
virtual uint32 MoveToAnalogSensorApp(const char *apName, real64 arPosition, real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search analog sensor till arPosition and stop if found.
virtual uint32 MoveToDigitalSensorApp(const char *apName, real64 arPosition, bool abSet, real64 arPositionVel, real64 arVelocity, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search digital sensor till arPosition and stop if found.
virtual uint32 Activate(bool abCheckPos=true, bool abSimulatePos=false, bool abSimulateOut=false, bool abSimulateAct=false, CINOSSync *apSync=DF_INOS_SYNCHRONOUS) override
Activate axis in a given mode, e.g Activate(true,true,true,true) enables the axis in a full simulated...
void SetLifetimeDistance(real64 arDistance)
set lifetime distance (only used at startup by either mcrobot or user code)
virtual void GetBorderType(EBorderType &auType)
Get border limit type (used in MoveToBorder method)
Definition cinosphysicalaxis.h:458
virtual uint32 EnableForceLimit(double adLimit)
Enable force limitation to given limit.
void SetAxisEnableInput(const char *apInputName)
set name of axis enable input
virtual void GetBorderRelax(real64 &arRelax)
Get border relax value (used in MoveToBorder method)
Definition cinosphysicalaxis.h:486
virtual uint32 SetActPosition(real64 arPosition) override
Sets the actual axis position. This method doesn't change a current following error and it is therefo...
virtual uint32 ForceInactivate(double adLimit, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Switch from force to position mode but still limit force to given value [N].
virtual uint32 ForceBreak(double adForce, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Ramp the commanded force to the requested value [N] with the given param set. Expect a collapse befor...
EBorderStop
The different border stopping types the system supports.
Definition cinosphysicalaxis.h:443
@ eBorderStopRamp
stop the move with a stopping ramp (cmdB)
Definition cinosphysicalaxis.h:445
@ eBorderStopHard
immediately stop the trajectory by setting cmdV = 0.0
Definition cinosphysicalaxis.h:444
virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel, real64 arVelocity, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search border till arPosition and stop if found. The current limitation is switched on at the reduced...
void GetAxisEnableInput(char *apResult, uint32 auSize) const
get name of axis enable input
virtual uint32 ForceInactivate(CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Switch from force to position mode.
void GetLifetimeDistance(real64 &arDistance)
get current lifetime distance
virtual uint32 ForceCancel()
Cancels force controller.
virtual uint32 ForceTara(double adForce=0.0, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Set current force [N] to given value.
virtual uint32 Sync(real64 arPosition, real64 arSyncPos, CINOSSync *apSync=DF_INOS_SYNCHRONOUS) override
Search reference mark till arPosition and set actual position to arSyncPos at mark.
virtual void GetRealPosition(real64 &arPosition, bool abMapped=true) override
Gets the real axis position.
virtual uint32 MoveToAnalogSensor(const char *apName, real64 arPosition, real64 arLevel, bool abGreater, const char *apParam, CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
Search analog sensor till arPosition and stop if found.
Definition inos_syn.h:67
The macro definition file.
#define INOS_OR(variable, mask)
Definition inosmacro.h:201
#define DF_INOS_SYNCHRONOUS
Definition inosmacro.h:332
#define INOS_AND(variable, mask)
Definition inosmacro.h:210
Descriptor structure used to configure a base axis. It is usually only used in conjunction with SINOS...
Definition cinosbaseaxis.h:399
torque limitation
Definition cinosbaseramp.h:670
Descriptor structure used to configure the behaviour of two coupled axes It is usually defined in a c...
Definition cinosphysicalaxis.h:239
real64 m_rMaxDelta
Max. allowed delta [units] of the two coupled axes before an error is triggered.
Definition cinosphysicalaxis.h:250
inosName64 m_cName1
Name of first axis to be coupled.
Definition cinosphysicalaxis.h:242
inosName32 m_cLoadBalanceAxis
Axis whose position determines the load balancing (used only when option DF_INOS_AXIS_CPD_LOAD_BALANC...
Definition cinosphysicalaxis.h:262
real64 m_rLoadBalanceFactor
load balance factor (used only when option DF_INOS_AXIS_CPD_LOAD_BALANCE is set)
Definition cinosphysicalaxis.h:266
uint32 m_uOptions
Coupling options, see DF_INOS_AXIS_CPD_SEQUENTIAL.
Definition cinosphysicalaxis.h:258
inosName64 m_cName2
Name of second axis to be coupled.
Definition cinosphysicalaxis.h:246
real64 m_rMaxCorr
Max. allowed correction if auto correction enabled, see DF_INOS_AXIS_CPD_CORR.
Definition cinosphysicalaxis.h:254
Definition cinosphysicalaxis.h:272
CINOSDacChannel * m_pItrqSlave
pointer to Itrq output of slave axis (aka Y1)
Definition cinosphysicalaxis.h:278
uintid m_uHookId
load scale hook
Definition cinosphysicalaxis.h:282
CINOSDacChannel * m_pItrqMaster
pointer to Itrq output of master axis (aka Y)
Definition cinosphysicalaxis.h:276
CINOSBaseAxis * m_pAxis
pointer to the axis whose position determines the load balancing (aka X)
Definition cinosphysicalaxis.h:274
real64 m_rFactor
load balancing factor
Definition cinosphysicalaxis.h:280
torque limitation
Definition cinosbasemotor.h:188
Descriptor structure used to configure a physical axis. It is usually defined in a corresponding xxx....
Definition cinosphysicalaxis.h:177
uint32 m_uBorderDelay
Defines the time [ms] to wait at the border till controller settled.
Definition cinosphysicalaxis.h:227
inosName32 m_cMotorType
Motor type name. Currently only INOSBaseMotor is a valid name.
Definition cinosphysicalaxis.h:185
inosName32 m_cForceType
Force control type name.
Definition cinosphysicalaxis.h:190
uint32 m_uBorderType
Defines the type of border detection or in other words, tells the system what kind of border detectio...
Definition cinosphysicalaxis.h:223
real64 m_rBorderLimit
Border limit. If working with border methods like CINOSPhysicalAxis::MoveToBorder this value defines ...
Definition cinosphysicalaxis.h:213
inosName32 m_cControlType
Controller type name. Valid types are INOSPosControl, INOSCurControl or a customer specific controlle...
Definition cinosphysicalaxis.h:181
uint32 m_uBorderStop
Defines how to stop a move after a border detection, see CINOSPhysicalAxis::EBorderStop.
Definition cinosphysicalaxis.h:231
real64 m_rBorderRelax
This value defines the move away distance [units] after border detection before reactivating position...
Definition cinosphysicalaxis.h:218
ramp parameters
Definition cinosbaseramp.h:512