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_SEQUENTIAL_FORCED 0x40000000
135#define DF_INOS_AXIS_CPD_ACTIVE 0x80000000
136//
137//------------------------------------------------------------------------------
138// includes
139//------------------------------------------------------------------------------
140//
141// system
142#include <cinosbaseaxis.h>
143#include <cinosbasecontrol.h>
144#include <cinosbasemotor.h>
145#include <inosmacro.h>
146
147//
148// C++
149//
150// project
151//
152//------------------------------------------------------------------------------
153//--- Define MOVEEX_FLAGS as enum ---------------------------------------------
154//------------------------------------------------------------------------------
155
156INOS_DEFINE_ENUM_CODE(DF_MOVEEX_FLAGS)
157
158//------------------------------------------------------------------------------
159//--- types --------------------------------------------------------------------
160//------------------------------------------------------------------------------
161//
163typedef bool (*tpMeTrgFct)(void*, void*); // pointer to trigger function
164//
165// helper struct for template casting to work around compiler... peculiarities
166template <class T>
167struct SMeTrgFunc {
168 typedef bool (*tpMeTrgFct)(T*, T*);
169};
171//
172//------------------------------------------------------------------------------
173//--- structures ---------------------------------------------------------------
174//------------------------------------------------------------------------------
175
180struct SINOSPhysicalAxis : public SINOSBaseAxis
181{
185 inosName32 m_cControlType;
186
189 inosName32 m_cMotorType;
190
191 #if defined(INOS_FORCE_CONTROL_SUPPORT)
194 inosName32 m_cForceType;
195 #endif
196
197 #if defined(INOS_MOTORCONFIG_LOAD_SUPPORT)
200 char m_cMotorConfig[63];
205 uint8 m_uMotorConfigFlags;
206 #endif
207
214 real64 m_rBorderLimit;
215
219 real64 m_rBorderRelax;
220
224 uint32 m_uBorderType;
225
228 uint32 m_uBorderDelay;
229
232 uint32 m_uBorderStop;
234
239struct SINOSCoupledAxes
240{
243 inosName64 m_cName1;
244
247 inosName64 m_cName2;
248
251 real64 m_rMaxDelta;
252
255 real64 m_rMaxCorr;
256
259 uint32 m_uOptions;
260
263 inosName32 m_cLoadBalanceAxis;
264
268};
270//------------------------------------------------------------------------------
279 CINOSDacChannel* m_pItrqSlave = nullptr;
281 real64 m_rFactor = REAL64(0.0);
283 uintid m_uHookId = 0;
284};
286//------------------------------------------------------------------------------
287// class definition
288//------------------------------------------------------------------------------
289//
290class CINOSBit;
291class CINOSPhysicalAxis : public CINOSBaseAxis
292{
293 //--- user interface ---------------------------------------------------
294
295 // public member functions
296 public :
297
298 // constructor/destructor
299
300 explicit CINOSPhysicalAxis(SINOSPhysicalAxis* apDesc);
301 //; constructor
303 CINOSBaseControl* apControl, CINOSBaseMotor* apMoto);
304 //; constructor
305 virtual ~CINOSPhysicalAxis();
306 //; destructor
307 static CINOSPhysicalAxis* GetAxis(const char* apAxisName);
308 //; return pointer to axis apAxisName
309 static CINOSPhysicalAxis* GetAxis(uint32 auNumber);
310 //; return pointer to axis auNumber
315 virtual uint32 Connect() override;
316
317 virtual uint32 Activate(bool abCheckPos = true, bool abSimulatePos = false,
318 bool abSimulateOut = false, bool abSimulateAct = false,
319 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
320 //; activate physical axis
321 virtual uint32 InActivate(CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
322 //; inactivate physical axis
323 virtual uint32 Relax(uint32 auTimeMs, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
324 //; relax
325 virtual uint32 Commutate();
326 //; commutate pysical axis
327 virtual uint32 ForceCommutate(bool abAlways = false);
328 //; force a commutation at next acitvate, abAlways=true -> always,
329 //; abAlways=false -> only if axis not yet synchronised
330 virtual uint32 ReActivate(uint32 auDelayMs = 100);
331 //; inactivate axis, wait and activate it again using the same simulation flags
333 virtual uint32 Sync(real64 arPosition, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
334 //; move to position with sync detect and set pos to 0.0 at sync
335 virtual uint32 Sync(real64 arPosition, SINOSRampParam* apParam,
336 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
337 //; move to position with sync detect and set pos to 0.0 at sync
338 virtual uint32 Sync(real64 arPosition, const char* apParam,
339 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
340 //; move to position with sync detect and set pos to 0.0 at sync
341 virtual uint32 Sync(real64 arPosition, real64 arSyncPos,
342 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
343 //; move to position with sync detect and set pos to aSyncPos, stop
344 //; if requested
345 virtual uint32 Sync(real64 arPosition, real64 arSyncPos,
346 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
347 //; move to position with sync detect and set pos to aSyncPos, stop
348 //; if requested
349 virtual uint32 Sync(real64 arPosition, real64 arSyncPos,
350 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
351 //; move to position with sync detect and set pos to aSyncPos, stop
352 //; if requested
353 virtual uint32 Sync(real64 arSyncPos, const char* apParam, CINCOObject* apObject,
354 CINOSSync* apSync = DF_INOS_SYNCHRONOUS) override;
355 //; move to position with sync detect and set pos to aSyncPos, stop
356 //; if requested
357 virtual uint32 Sync(real64 arPosition, real64 arSyncPos, uint32 auFlags,
359 //; move to position with sync detect and set pos to aSyncPos, stop
360 //; if requested
361 virtual uint32 Sync(real64 arPosition, real64 arSyncPos, uint32 auFlags,
362 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
363 //; move to position with sync detect and set pos to aSyncPos, stop
364 //; if requested
365 virtual uint32 Sync(real64 arPosition, real64 arSyncPos, uint32 auFlags,
366 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
367 //; move to position with sync detect and set pos to aSyncPos, stop
368 //; if requested
369
379 virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos,
381
392 virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos,
393 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
394
405 virtual uint32 SyncMove(real64 arPosition, real64 arSyncPos, real64 arMovePos,
406 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
407
408 virtual uint32 MoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
409 const char* apTrgName, real64 arTrgLevel, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
410 //; move extended (see MoveEx flags)
411 virtual uint32 MoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
412 const char* apTrgName, real64 arTrgLevel, SINOSRampParam* apParam,
414 //; move extended (see MoveEx flags)
415 virtual uint32 MoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
416 const char* apTrgName, real64 arTrgLevel, const char* apParam,
418 //; move extended (see MoveEx flags)
419
420 virtual uint32 MoveExApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
421 real64& arTrgPos, uint32 auFlags, const char* apTrgName, real64 arTrgLevel,
423 //; move extended (see MoveEx flags)
424 virtual uint32 MoveExApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
425 real64& arTrgPos, uint32 auFlags, const char* apTrgName, real64 arTrgLevel,
426 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
427 //; move extended (see MoveEx flags)
428 virtual uint32 MoveExApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
429 real64& arTrgPos, uint32 auFlags, const char* apTrgName, real64 arTrgLevel,
430 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
431 //; move extended (see MoveEx flags)
435 enum EBorderType {
444 enum EBorderStop {
447 };
448
452 virtual void SetBorderType(EBorderType auType)
453 // set the type
454 { m_eBorderType = auType;};
455
459 virtual void GetBorderType(EBorderType& auType)
460 // set the type
461 { auType = m_eBorderType;};
462
466 virtual void SetBorderLimit(real64 arLimit)
467 // set the limit
468 { m_rBorderLimit = arLimit;};
469
473 virtual void GetBorderLimit(real64& arLimit)
474 // set the limit
475 { arLimit = m_rBorderLimit;};
476
480 virtual void SetBorderRelax(real64 arRelax)
481 // set the value
482 { m_rBorderRelax = arRelax;};
483
487 virtual void GetBorderRelax(real64& arRelax)
488 // set the limit
489 { arRelax = m_rBorderRelax;};
490
493 virtual uint32 ReleaseFromBorder();
494
502 virtual uint32 MoveToBorder(real64 arPosition, const char* apParam,
503 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
504
513 virtual uint32 MoveToBorder(real64 arPosition, real64& arResult,
514 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
515
527 virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel,
528 real64 arVelocity, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
529
542 virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel,
543 real64 arVelocity, real64& arResult, const char* apParam,
544 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
545
559 virtual uint32 MoveToBorderApp(real64 arPosition, real64 arPositionVel,
560 real64 arVelocity, real64& arResult, uint32 auFlags, const char* apParam,
562
573 virtual uint32 MoveToDigitalSensor(const char* apName, real64 arPosition,
574 bool abSet, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
575
587 virtual uint32 MoveToDigitalSensor(const char* apName, real64 arPosition,
588 bool abSet, real64& arResult, const char* apParam,
589 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
590
610 virtual uint32 MoveToDigitalSensor(const char* apName, real64 arPosition,
611 bool abSet, real64& arResult, uint32 auFlags, const char* apParam,
612 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
613
625 virtual uint32 MoveToDigitalSensorApp(const char* apName, real64 arPosition,
626 bool abSet, real64 arPositionVel, real64 arVelocity,
627 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
628
642 virtual uint32 MoveToDigitalSensorApp(const char* apName, real64 arPosition,
643 bool abSet, real64 arPositionVel, real64 arVelocity, real64& arResult,
644 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
645
660 virtual uint32 MoveToDigitalSensorApp(const char* apName, real64 arPosition,
661 bool abSet, real64 arPositionVel, real64 arVelocity, real64& arResult,
662 uint32 auFlags, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
663
674 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
675 real64 arLevel, bool abGreater, const char* apParam,
676 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
677
689 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
690 real64 arLevel, bool abGreater, real64& arResult, const char* apParam,
691 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
692
705 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
706 real64 arLevel, bool abGreater, real64& arResult, SINOSRampParam* apParam,
708
721 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
722 real64 arLevel, bool abGreater, real64& arResult, uint32 auFlags,
723 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
724
737 virtual uint32 MoveToAnalogSensor(const char* apName, real64 arPosition,
738 real64 arLevel, bool abGreater, real64& arResult, uint32 auFlags,
739 SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
740
754 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
755 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
756 const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
757
772 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
773 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
774 real64& arResult, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
775
790 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
791 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
792 real64& arResult, SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
793
809 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
810 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
811 real64& arResult, uint32 auFlags, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
812
828 virtual uint32 MoveToAnalogSensorApp(const char* apName, real64 arPosition,
829 real64 arLevel, bool abGreater, real64 arPositionVel, real64 arVelocity,
830 real64& arResult, uint32 auFlags, SINOSRampParam* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
831
832 #if defined(INOS_FORCE_CONTROL_SUPPORT)
839 virtual uint32 ForceActivate(const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
840
846
851 virtual uint32 ForceInactivate(double adLimit, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
852
864 virtual uint32 ForceApproach(double adPosition, double adPositionVel, double adVelocity,
865 double adForce, double adForcelimit, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
866
876 virtual uint32 ForceDepart(double adPosition, double adPositionVel, double adVelocity,
877 double adForceLimit, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
878
885 virtual uint32 ForceMove(double adForce, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
892 virtual uint32 ForceMoveStop(const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
893
901 virtual uint32 ForceBreak(double adForce, const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
902
907 virtual uint32 ForceTara(double adForce = 0.0, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
908
913 virtual uint32 ForceSelect(const char* apParam, CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
914
922 virtual uint32 ForcePull(double adForce);
923
928 virtual uint32 EnableForceLimit(double adLimit);
929
933 virtual uint32 DisableForceLimit();
934
938 virtual uint32 ForceCancel();
939
940 #endif // end if INOS_FORCE_CONTROL_SUPPORT
942 // set/get property functions
944 //; set commanded path axis position
945 virtual void SetPathPosition(real64 arPosition) override
946 { m_pControl->SetPathS(arPosition); };
947 virtual uint32 SetActPosition(real64 arPosition) override;
948 //; set actual commanded position
949 virtual void GetActPosition(real64& arPosition, bool abRamp = true) override;
950 //; get actual commanded position
951 virtual void GetActPosition(real64& arPosition, uint64 auTicks) override;
952 //; get actual commanded position at bus ticks auTicks
953 virtual void GetActPosition(real64& arCmdPosition, real64& arRealPosition);
954 //; get actual commanded and real positions
955 virtual void GetActVelocity(real64& arVelocity, bool abRamp = true) override;
956 //; get actual commanded velocity
957 virtual void GetActVelocity(real64& arCmdVelocity, real64& arRealVelocity);
958 //; get actual commanded and real velocities
959 virtual void GetActAcceleration(real64& arAcceleration, bool abRamp = true) override;
960 //; get actual commanded acceleration
961 virtual void GetActAcceleration(real64& arCmdAcceleration, real64& arRealAcceleration);
962 //; get actual commanded and real accelerations
963 virtual void GetActJerk(real64& arJerk, bool abRamp = true) override;
964 //; get actual commanded jerk
965 virtual void GetActPosError(real64& arPosError) override;
966 //; get actual position error
967 virtual void GetActVelocityError(real64& arVelocityError, bool abFiltered = false) override;
968 //; get actual velocity error
969 virtual void GetPosErrorAtEvent(real64& arPosError)
970 { arPosError = m_rMePosErr;};
971 //; get pos error at moveex event
972
973 virtual uint32 SetRealPosition(real64 arPosition) override;
974 //; set actual real position
975 virtual void GetRealPosition(real64& arPosition, bool abMapped = true) override;
976 //; get actual real position
977 virtual void GetRealVelocity(real64& arVelocity) override;
978 //; get actual real velocity
979 virtual void GetRealVelocityFiltered(real64& arVelocity);
980 //; get actual filtered real velocity
981 virtual void GetRealAcceleration(real64& arAcceleration) override;
982 //; get actual real acceleration
983 virtual void GetRealJerk(real64& arJerk) override;
984 //; get actual real jerk
985
987 void SetLifetimeDistance(real64 arDistance);
989 void GetLifetimeDistance(real64& arDistance);
990
991 virtual void GetUnitsPerInc(double& adUnits) override;
992 //; get number of units per one inc
993 virtual void SetIncsPerUnit(double adIncs);
994 //; set number of incs per unit
995 virtual void GetIncsPerUnit(double& adIncs) override;
996 //; get number of incs per unit
997 virtual void SetGearRatio(double adGearRatio);
998 //; set gear ratio
999 virtual void GetGearRatio(double& adGearRatio);
1000 //; get gear ratio
1001 virtual void SetFeedPerTurn(double adFeedPerTurn);
1002 //; set feed per turn
1003 virtual void GetFeedPerTurn(double& adFeedPerTurn);
1004 //; get feed per turn
1005 virtual void SetIncsPerTurn(double adIncsPerTurn);
1006 //; set incs per turn
1007 virtual void GetIncsPerTurn(double& adIncsPerTurn);
1008 //; get incs per turn
1009 virtual void GetTurnsPerMin(double& adTurnsPerMin);
1010 //; get turns per minute
1011 virtual void GetIncPosition(uint8& auIncPosition);
1012 //; get position of increments (A=0, B=1)
1013 virtual void SetInertia(double adInertia);
1014 //; set inertia
1015 virtual void GetInertia(double& adInertia);
1016 //; get inertia
1017
1018 virtual void GetCycleTime(real64& arCycleTime, bool abOversampled=false) override;
1019 //; get axis cycle time [sec]
1020 virtual uint8 GetOversampling() override;
1021 //; get oversampling factor
1022 virtual uint16 GetCycleNumber() override;
1023 //; get axis cycle number
1024 virtual uint16 GetCycleId() override;
1025 //; get axis cycle id
1026 virtual void UpdateCycleId(uint16 auCycleId) override;
1027 //; set core id and cycle number the axis is running in
1028 virtual uint8 GetBusId() override;
1029 //; get axis bus id
1030 virtual uint32 SetParam(const char* apName, real64 arValue) override;
1031 //; universal set parameter with aName to aValue and return error code
1032 virtual uint32 GetParam(const char* apName, real64& arResult) override;
1033 //; universal get parameter with aName to aResult and return error code
1034
1035 virtual int32 GetState() override;
1036 //; get axis state
1037 virtual int32 GetState(uint32& auRampState) override;
1038 //; get axis and ramp state
1039 virtual int32 GetState(uint32& auRampState, uint32& auControlState);
1040 //; get axis, ramp and control state
1041 virtual uint32 GetError(bool abResolveExternal = false) override;
1042 //; get axis error
1043 virtual uint64 GetErrorEx(bool abResolveExternal = false) override;
1044 //; get extended axis error
1045 virtual uint32 GetError(uint32& auRampError, bool abResolveExternal = false) override;
1046 //; get axis and ramp error
1047 virtual uint64 GetErrorEx(uint64& auRampError, bool abResolveExternal = false) override;
1048 //; get extended axis and ramp error
1049 virtual uint32 GetError(uint32& auRampError, uint32& auControlError,
1050 bool abResolveExternal = false);
1051 //; get axis, ramp and control error
1052 virtual uint64 GetErrorEx(uint64& auRampError, uint64& auControlError,
1053 bool abResolveExternal = false);
1054 //; get axis, ramp and control error
1055 virtual bool IsErrorFatal() override;
1056 //; return true if error is fatal
1057 virtual uint32 GetWarning(bool abResolveExternal = false) override;
1058 //; get axis warning
1059 virtual uint64 GetWarningEx(bool abResolveExternal = false) override;
1060 //; get extended axis warning
1061 virtual uint32 GetWarning(uint32& auRampWarning, bool abResolveExternal = false) override;
1062 //; get axis and ramp warning
1063 virtual uint64 GetWarningEx(uint64& auRampWarning, bool abResolveExternal = false) override;
1064 //; get extended axis and ramp warning
1065 virtual uint32 GetWarning(uint32& auRampWarning, uint32& auControlWarning,
1066 bool abResolveExternal = false);
1067 //; get axis, ramp and control warning
1068 virtual uint64 GetWarningEx(uint64& auRampWarning, uint64& auControlWarning,
1069 bool abResolveExternal = false);
1070 //; get axis, ramp and control warning
1071 virtual uint32 AcceptError() override;
1072 //; accept all errors
1073 virtual uint32 AcceptError(uint32 auError) override;
1074 //; accept error
1075 virtual uint32 AcceptError(uint32 auError, uint32 auRampError) override;
1076 //; accept error
1077 virtual uint32 AcceptError(uint32 auError, uint32 auRampError,
1078 uint32 auControlError);
1079 //; accept error
1080 virtual uint32 AcceptWarning() override;
1081 //; accept all warnings
1082 virtual uint32 AcceptWarning(uint32 auWarning) override;
1083 //; accept warning
1084 virtual uint32 AcceptWarning(uint32 auWarning, uint32 auRampWarning) override;
1085 //; accept warning
1086 virtual uint32 AcceptWarning(uint32 auWarning, uint32 auRampWarning,
1087 uint32 auControlWarning);
1088 //; accept warning
1089 virtual uint32 SetParam(const char* apName, uint64 auValue) override
1090 //; universal set parameter with aName to aValue and return error code
1091 { return defVarNotFound;};
1092 virtual uint32 GetParam(const char* apName, uint64& auResult) override
1093 //; universal get parameter with aName to aResult and return error code
1094 { return defVarNotFound;};
1095
1096 // miscellaneous functions
1097
1098 virtual CINCOObject* GetRegister() override;
1099 //; do inco registration and return pointer to it
1100 virtual CINOSBaseControl* GetControl()
1101 { return m_pControl;};
1102 //; return pointer to axis controller
1103 virtual CINOSBaseMotor* GetMotor()
1104 { return m_pMotor;};
1105 //; return pointer to axis controller
1106 #ifdef INOS_FORCE_CONTROL_SUPPORT
1107 virtual class CINOSForceControl* GetForce()
1108 { return m_pForce;};
1109 //; return pointer to force controller
1110 #endif
1111
1112 virtual bool IsEmgInActivating();
1113 //; returns true if the axis is about to inactivate due to an emergency stop
1114
1115 // auto sync
1116
1117 virtual void EnableSync(real64 arPosition = REAL64(0.0),
1118 uint8 auSyncMode = DF_INOS_AXIS_SYNC_NOADJ) override;
1119 //; enable auto syncing (at sync set pos = arPosition)
1120 virtual void DisableSync() override;
1121 //; disable auto syncing
1122 virtual void GetSyncCount(uint32& auSyncCount) override;
1123 //; return actual sync counter
1124 virtual void SetSyncCount(uint32 auSyncCount) override;
1125 //; set sync counter
1126 virtual void GetSyncCorr(real64& arSyncCorr);
1127 //; return actual sync coorrection
1128 virtual bool EnableSafeSync();
1129 //; enable safe sync and return true if done/available
1130 virtual void DisableSafeSync();
1131 //; disable safe sync
1132
1133 // auto norm
1134
1135 virtual void EnableNorm(uint8 auMode = DF_INOS_AXIS_NORM_AFTER,
1136 uint8 auMoveDir = DF_INOS_AXIS_NORM_MOVE_DIR_NO,
1137 real64 arNormPos = REAL64(0.0)) override;
1138 //; enable auto norm of position
1139 virtual void DisableNorm() override;
1140 //; disable auto norm
1141
1143 virtual void SetNormMode(uint8 auNormMode) override;
1144
1145 // current limitation
1146
1147 virtual void EnableCurLimit() override;
1148 //; enable current limitation
1149 virtual void DisableCurLimit() override;
1150 //; disable current limitation
1151 virtual void SetCurLimit(bool abEnable);
1152 //; set current limitation to requested value
1153 virtual bool GetCurLimit() override;
1154 //; return state of current limitation
1155 virtual void SetMaxCurrent(real64 arMaxCurrent);
1156 //; set the max current
1157 virtual void GetMaxCurrent(real64& arMaxCurrent);
1158 //; get the max current
1159
1160
1161 // coupling
1162
1163 CINOSPhysicalAxis* GetCoupledAxis()
1164 { return m_pCpdAxis;};
1165 //; return pointer to my coupled axis if any
1166 uint32 GetCoupledOptions()
1167 //; return coupling options
1168 { return m_uCpdOptions;};
1169 virtual bool IsCouplingEnabled()
1170 //; checks if coupling is enabled
1171 { return m_uCpdOptions & DF_INOS_AXIS_CPD_READY;};
1172 virtual uint32 EnableCoupling(const char* apAxis, uint32 auOptions,
1173 real64 arMaxDelta);
1174 //; enable axis coupling with axis 'apAxis'
1175 virtual uint32 EnableCoupling(const char* apAxis, uint32 auOptions,
1176 real64 arMaxDelta, real64 arMaxCorr);
1177 //; enable axis coupling with axis 'apAxis'
1178 virtual uint32 EnableCoupling();
1179 //; enable axis coupling
1180 virtual uint32 DisableCoupling();
1181 //; disable axis coupling
1182 virtual uint32 EnableLoadBalancing(const char* apAxis, real64 arFactor);
1183 //; enable load balancing with axis 'apAxis'
1184 virtual uint32 DisableLoadBalancing();
1185 //; disable load balancing
1186 virtual void SetCpdOption(uint32 auOption) {
1187 INOS_OR(m_uCpdOptions, auOption);
1188 }
1189 virtual void ClrCpdOption(uint32 auOption) {
1190 INOS_AND(m_uCpdOptions, ~auOption);
1191 }
1192
1193 // border limits
1194
1195 virtual void SetBorderLimit(CINOSBit* apLimitPos, CINOSBit* apLimitNeg,
1196 bool abInverted = false)
1197 //; set border limits
1198 { m_pLimitPos = apLimitPos; m_pLimitNeg = apLimitNeg;
1199 m_bLimitInv = abInverted; if (m_pLimitPos || m_pLimitNeg) m_eBorderType = eBorderSensor;};
1200 virtual void ResetBorderLimit()
1201 //; reset border limits
1202 { m_pLimitPos = m_pLimitNeg = NULL;};
1203
1204 // power
1205
1206 virtual CINOSBit* GetPowerReady();
1207 //; get pointer to power ready bit
1208 virtual bool IsPowerReady();
1209 //; return true if power ready
1210 virtual bool IsOnline() const;
1211 //; \return true if the axis is online (physically connected to
1212 //; master). false otherwise.
1214 // enable
1215
1217 void SetAxisEnableInput(const char* apInputName);
1219 void GetAxisEnableInput(char* apResult, uint32 auSize) const;
1220
1221 // safety
1222
1223 #ifdef INOS_SAFETY_SUPPORT
1224
1225 virtual uint32 MoveMicro();
1226 //; initiate a micro move used to prevent a sincoshalt safety error
1227 //; \return true if the move was successfully initiated
1228 virtual bool iSetupSafetyRegistration() override;
1229 //; setup safety inco tree
1230
1231 #endif // INOS_SAFETY_SUPPORT
1232
1233 #if defined(INOS_MOTORCONFIG_LOAD_SUPPORT)
1234 virtual void GetMotorConfig(char* apResult, uint32 auSize) const
1235 {
1236 SINOSPhysicalAxis* desc = (SINOSPhysicalAxis*) m_pDesc;
1237 inos_strncpy(apResult, desc->m_cMotorConfig, auSize);
1238 }
1239 virtual bool IsMotorConfigValid() const
1240 {
1241 // motor config is invalid if a cpf is requested but not found, all other cases are 'valid'
1242 SINOSPhysicalAxis* desc = (SINOSPhysicalAxis*) m_pDesc;
1243 return !((nullptr != desc) && (0 != strlen(desc->m_cMotorConfig)) && (0 == (desc->m_uMotorConfigFlags & 1)));
1244 }
1245 virtual bool IsMotorConfigUnique() const
1246 {
1247 // motor config is unique if only this axis uses this config
1248 SINOSPhysicalAxis* desc = (SINOSPhysicalAxis*) m_pDesc;
1249 return ((nullptr != desc) && ((0 == strlen(desc->m_cMotorConfig)) || (2 == (desc->m_uMotorConfigFlags & 2))));
1250 }
1251 #endif
1252
1253 //--- internals --------------------------------------------------------
1254
1255 // protected member functions
1256 protected :
1257 void Create();
1258 //; create physical axis
1259 SINOSBaseRampTrqLimit* CreateTrqLimit(SINOSMotorTrqLimit* apLimit,
1260 real64 arAmax);
1261 //; create physical axis
1262 virtual void iInActivate() override;
1263 //; inactivate axis
1264 virtual void iStop(SINOSRampParam* apParam) override;
1265 //; internal stop
1266 virtual void iEmergencyStop(bool abLive = false) override;
1267 //; internal emergency stop
1268 virtual void iSetCycleTime(real64 arCycleTime) override;
1269 //; set axis cycle time [sec]
1270 virtual void iRegisterAxis() override;
1271 //; register axis
1272 virtual uint32 iMoveEx(real64 arPosition, real64& arTrgPos, uint32 auFlags,
1273 const char* apTrgName, real64 arTrgLevel, SINOSRampParam* apParam,
1274 CINOSSync* apSync = DF_INOS_SYNCHRONOUS);
1275 //; move extended (see MoveEx flags)
1276 void iiMoveEx();
1277 //; internal MoveEx (called as postbus hook)
1278 bool iMoveExSetupTrigger(const char* apTrgName, real64 arTrgLevel);
1279 //; internal MoveEx (called as postbus hook)
1280 bool iMoveExBorderReached();
1281 //; return true if border reached
1282 bool iMoveExBorder();
1283 //; return true if border reached
1284 bool iMoveExTriggerOccured();
1285 //; return true if trigger event occured
1286 void iMoveExRestoreControl();
1287 //; restore control flags
1288 void iMoveExCleanup();
1289 //; do clean up
1290 void iMoveExWaitForBorderDelayDone();
1291 //; post wait work
1292 void iMoveExWaitForEventBorderDelayDone();
1293 //; post wait work
1294 void iMoveExBorderOccured();
1295 //; border occured handler
1296 void iMoveExBorderRelaxStart();
1297 //; border relax start
1298 void iMoveExBorderRelaxStop();
1299 //; border relax stop
1300 ICACHE virtual void iPostMap() override;
1301 //; post mapping handler
1302 ICACHE virtual void iPostMapCpd();
1303 //; post mapping handler (coupled axis)
1304 ICACHE virtual void iPostWrite() override;
1305 //; post bus write handler
1306 ICACHE virtual void iPostWriteCpd();
1307 //; post bus write handler (coupled axis)
1308 virtual uint32 iEnableCoupling();
1309 //; enable axis coupling
1310 virtual void iActivateCoupling();
1311 //; activate coupling
1312 virtual void iInActivateCoupling();
1313 //; inactivate coupling
1314 void iCheckErrors();
1315 //; check for pending errors
1316 void iCheckWarnings();
1317 //; check for pending Warnings
1318 virtual void iSetActRampPosition(real64 arPosition) override;
1319 //; set actual ramp geni position
1320 static bool TestBit_0(void* apAddress , void* apNumber);
1321 //; returns true if bit apAddress:*apNumber = 0
1322 static bool TestBit_1(void* apAddress , void* apNumber);
1323 //; returns true if bit apAddress:*apNumber = 1
1324 static bool TestBit_true(void* apAddress , void* apNumber);
1325 //; returns always true
1326 uint32 eMoveEx(real64 arPosition, real64 arTrgPosition, uint32 auFlags,
1327 char* apTrgName, real64 arTrgLevel);
1328 //; MoveEx
1329 uint32 eMoveEx(real64 arPosition, real64 arTrgPosition, uint32 auFlags,
1330 char* apTrgName, real64 arTrgLevel, char* apParam);
1331 //; MoveEx
1332 uint32 eMoveToBorder(real64 arPosition, char* apParam);
1333 //; MoveToBorder
1334 uint32 eSync(real64 arPosition, real64 arSyncPosition, uint32 auFlags);
1335 //; sync axis
1336 uint32 eSync(real64 arPosition, real64 arSyncPosition, uint32 auFlags, char* apParam);
1337 //; sync axis
1338
1339 void iLoadBalancingHook();
1340 //; load balancing hook
1341
1342#ifdef INOS_SAFETY_SUPPORT
1343 void iHandleSafety(uint32& uError);
1344 //; handle safety support
1345#endif // INOS_SAFETY_SUPPORT
1346
1347 // protected members
1348 protected:
1349 CINOSBaseMotor* m_pMotor;
1350 //; pointer to according motor
1351 CINOSBaseControl* m_pControl;
1352 //; pointer to according axis controller
1353 bool m_bSyncStop;
1354 //; true if stop requested after sync
1355 bool m_bPowerOnCtr0;
1356 //; true if ctr0 has to be taken to read power ready
1357
1358 // MoveEx properties
1359
1360 uint32 m_uMeFlags;
1361 //; actual move ex flags
1362 SINOSRampParam* m_pMeParam;
1363 //; move params
1364 uint32 m_uMeCtrFlag;
1365 //; control flags at start of moveex
1366 uint32 m_uMeRmpFlag;
1367 //; ramp flags at start of moveex
1368 real64 m_rMePosS;
1369 //; position at start of move
1370 real64 m_rMePosErr;
1371 //; position error at border
1372 real64 m_rMePos1;
1373 //; first end pos of range
1374 real64 m_rMePos2;
1375 //; second end pos of range
1376 real64* m_pMePosT;
1377 //; pointer to trigger position
1378 EBorderType m_eBorderType;
1379 //; type of border detection
1380 EBorderStop m_eBorderStop;
1381 //; type of stop at border
1382 real64 m_rBorderLimit;
1383 //; pos error indicating a border
1384 real64 m_rBorderRelax;
1385 //; move away distance after border detection before reactivating pos check
1386 //; supervision
1387 uint32 m_uBorderDelay;
1388 //; relax time [ms], during this time the controller is informed
1389 //; about the fact that we've just touched a border
1390 bool m_bBorderRelaxActive;
1391 //; true if border relax active
1392 void* m_pMeTrgSrcAdr;
1393 //; source address of trigger
1394 uint64 m_uMeTrgLevel;
1395 //; source address of trigger level
1396 tpMeTrgFct m_pMeTrgFct;
1397 //; pointer to actual trigger function
1398 uint16 m_uMeTrgSrcTyp;
1399 //; type of trigger
1400 uint16 m_uMeTrgSrcBit;
1401 //; bit number if trigger of type bit
1402 real64 m_rMePositionVel;
1403 //; used for moveexapp
1404 real64 m_rMeVelocity;
1405 //; used for moveexapp
1406 real64 m_rMePositionMove;
1407 //; used for syncmove
1408 bool m_bMeMoveApp;
1409 //; move app pending
1410 bool m_bMeCurrentLimit;
1411 //; current limit pending
1412 bool m_bMeRestoreControlFlags;
1413 //; restore control flags pending
1414 bool m_bMeTriggerMasked;
1415 //; trigger masked out
1416 real64 m_rMePositionAtBorder;
1417 //; axis position at border detection
1418
1419 // coupling
1420
1421 uint32 m_uCpdOptions;
1422 //; 'coupling' options
1423 CINOSPhysicalAxis* m_pCpdAxis;
1424 //; pointer to coupled axis
1425 CINOSBaseControl* m_pCpdControl;
1426 //; pointer to coupled controller
1427 uint16 m_uCpdWait;
1428 //; internal wait
1429 uint16 m_uCpdWaitCns;
1430 //; internal wait constant (4ms in cycles)
1431 real64 m_rCpdOffset;
1432 //; coupling offset between the two axes
1433 real64 m_rCpdMaxDelta;
1434 //; max. allowed S delta between coupled axes
1435 real64 m_rCpdMaxCorr;
1436 //; max. allowed correction if auto correction enabled (bit 3=1)
1437 real64 m_rCpdDelta;
1438 //; actual S delta between coupled axes
1439 uint32 m_uRelaxTime;
1440 //; relax time [ms]
1441 SINOSLoadBalancing m_CpdLoadBalancing;
1442 //; load balancing for coupled axes
1443
1444 // border
1445
1446 bool m_bLimitInv;
1447 //; true if limi switch handling inverted
1448 CINOSBit* m_pLimitPos;
1449 //; pointer to pos border limit (if available)
1450 CINOSBit* m_pLimitNeg;
1451 //; pointer to neg border limit (if available)
1452
1453 // command parameters
1454 private:
1455 uint32 m_ueFlagsSync;
1456 //; param : Sync flags
1457 uint32 m_ueFlagsMoveEx;
1458 //; param : MoveEx flags
1459 real64 m_reTrgPos;
1460 //; param : TrgPos
1461 real64 m_reTrgLevel;
1462 //; param : TrgLevel
1463
1464 char m_ceCpdAxis[16];
1465 //; param CpdAxis
1466 uint32 m_ueCpdOptions;
1467 //; param CpdOptions
1468 real64 m_reCpdMaxDelta;
1469 //; param CpdMaxDelta
1470 real64 m_reCpdMaxCorr;
1471 //; param CpdMaxCorr
1472 real64 m_reStretchFactor;
1473 //; param StretchFactor
1474 real64 m_reInertia;
1475 //; param inertia
1476
1477 #if defined(INOS_FORCE_CONTROL_SUPPORT)
1478 double m_deForce = 5.0;
1479 double m_deForceLimit = 10.0;
1480 double m_deForceTara = 0.0;
1481 uint32 m_uForceControlFlags = 0;
1482 inosName32 m_ceForceParam{};
1483 class CINOSForceControl* m_pForce = nullptr;
1484 uintid m_uForceHookId = 0;
1485 CINOSSync* m_pForceSync = nullptr;
1486 uint32 eForceActivate(const char*);
1487 uint32 eForceInactivate();
1488 uint32 eForceInactivate(double);
1489 uint32 eForceApproach(double,double,double,double,double,const char*);
1490 uint32 eForceDepart(double,double,double,double,const char*);
1491 uint32 eForceMove(double,const char*);
1492 uint32 eForceMoveStop(const char*);
1493 uint32 eForceBreak(double,const char*);
1494 uint32 eForceTara(double);
1495 uint32 eForceSelect(const char*);
1496 // force methods protected to give descendants a chance to use them
1497 protected :
1498 void ForceSignal();
1499 void ForceSignal(CINOSSync* apSync);
1500 void ForcePosition();
1501 void ForceHook();
1502 void ForceHookEnable();
1503 void ForceHookDisable();
1504 #endif
1505
1506 // allow dynamic object handling (new/delete)
1508};
1509
1510//
1511//------------------------------------------------------------------------------
1512// end of file
1513//------------------------------------------------------------------------------
1514
1515#endif // INC_CINOSPHYSICALAXIS_H
#define DF_INOS_AXIS_NORM_MOVE_DIR_NO
Definition cinosbaseaxis.h:184
#define DF_INOS_AXIS_NORM_AFTER
Definition cinosbaseaxis.h:167
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:676
Definition cinosbasecontrol.h:319
Definition cinosbasemotor.h:204
Definition cinosbaseramp.h:752
Definition cinosbit.h:54
Definition cinosdacchannel.h:52
Provides physical aka real axis functionality.
Definition cinosphysicalaxis.h:286
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:474
virtual void SetBorderLimit(real64 arLimit)
Set border limit value (used in MoveToBorder method)
Definition cinosphysicalaxis.h:460
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:467
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:429
@ eBorderSpeed
use the current speed error to detect border
Definition cinosphysicalaxis.h:431
@ eBorderPosition
use the current position check error to detect border
Definition cinosphysicalaxis.h:430
@ eBorderSpeedAbs
use real speed to detect border
Definition cinosphysicalaxis.h:433
@ eBorderSensor
use a digital input to detect border
Definition cinosphysicalaxis.h:432
virtual uint32 DisableForceLimit()
Disable force limitation.
virtual void SetBorderType(EBorderType auType)
Set border limit type (used in MoveToBorder method)
Definition cinosphysicalaxis.h:446
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:453
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:481
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:438
@ eBorderStopRamp
stop the move with a stopping ramp (cmdB)
Definition cinosphysicalaxis.h:440
@ eBorderStopHard
immediately stop the trajectory by setting cmdV = 0.0
Definition cinosphysicalaxis.h:439
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:390
torque limitation
Definition cinosbaseramp.h:661
Descriptor structure used to configure the behaviour of two coupled axes It is usually defined in a c...
Definition cinosphysicalaxis.h:234
real64 m_rMaxDelta
Max. allowed delta [units] of the two coupled axes before an error is triggered.
Definition cinosphysicalaxis.h:245
inosName64 m_cName1
Name of first axis to be coupled.
Definition cinosphysicalaxis.h:237
inosName32 m_cLoadBalanceAxis
Axis whose position determines the load balancing (used only when option DF_INOS_AXIS_CPD_LOAD_BALANC...
Definition cinosphysicalaxis.h:257
real64 m_rLoadBalanceFactor
load balance factor (used only when option DF_INOS_AXIS_CPD_LOAD_BALANCE is set)
Definition cinosphysicalaxis.h:261
uint32 m_uOptions
Coupling options, see DF_INOS_AXIS_CPD_SEQUENTIAL.
Definition cinosphysicalaxis.h:253
inosName64 m_cName2
Name of second axis to be coupled.
Definition cinosphysicalaxis.h:241
real64 m_rMaxCorr
Max. allowed correction if auto correction enabled, see DF_INOS_AXIS_CPD_CORR.
Definition cinosphysicalaxis.h:249
Definition cinosphysicalaxis.h:267
CINOSDacChannel * m_pItrqSlave
pointer to Itrq output of slave axis (aka Y1)
Definition cinosphysicalaxis.h:273
uintid m_uHookId
load scale hook
Definition cinosphysicalaxis.h:277
CINOSDacChannel * m_pItrqMaster
pointer to Itrq output of master axis (aka Y)
Definition cinosphysicalaxis.h:271
CINOSBaseAxis * m_pAxis
pointer to the axis whose position determines the load balancing (aka X)
Definition cinosphysicalaxis.h:269
real64 m_rFactor
load balancing factor
Definition cinosphysicalaxis.h:275
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:175
uint32 m_uBorderDelay
Defines the time [ms] to wait at the border till controller settled.
Definition cinosphysicalaxis.h:222
inosName32 m_cMotorType
Motor type name. Currently only INOSBaseMotor is a valid name.
Definition cinosphysicalaxis.h:183
inosName32 m_cForceType
Force control type name.
Definition cinosphysicalaxis.h:188
uint32 m_uBorderType
Defines the type of border detection or in other words, tells the system what kind of border detectio...
Definition cinosphysicalaxis.h:218
real64 m_rBorderLimit
Border limit. If working with border methods like CINOSPhysicalAxis::MoveToBorder this value defines ...
Definition cinosphysicalaxis.h:208
inosName32 m_cControlType
Controller type name. Valid types are INOSPosControl, INOSCurControl or a customer specific controlle...
Definition cinosphysicalaxis.h:179
uint32 m_uBorderStop
Defines how to stop a move after a border detection, see CINOSPhysicalAxis::EBorderStop.
Definition cinosphysicalaxis.h:226
real64 m_rBorderRelax
This value defines the move away distance [units] after border detection before reactivating position...
Definition cinosphysicalaxis.h:213
ramp parameters
Definition cinosbaseramp.h:503