INOS
cinosbaseramp.h
Go to the documentation of this file.
1//******************************************************************************
27//******************************************************************************
28
29#ifndef INC_CINOSBASERAMP_H
30#define INC_CINOSBASERAMP_H
31
32//------------------------------------------------------------------------------
33// defines
34//------------------------------------------------------------------------------
35//
36#define DF_INOS_BASE_RAMP_DBT "INOS-BASE-RAMP"// db table name
37#define DF_INOS_BASE_RAMP_TRQ_LIMIT_ACC_DBT "INOS-BASE-RAMP-TRQ-LIMIT-ACC" // db table name
38#define DF_INOS_BASE_RAMP_TRQ_LIMIT_DEC_DBT "INOS-BASE-RAMP-TRQ-LIMIT-DEC" // db table name
39//
40#define DF_INOS_RAMP_MAX_JERK 4 // max. number of supported jerks
41//
42// --- ramp states -------------------------------------------------------------
43//
44#define DF_INOS_RAMP_STATE_PEACE 0 // state 'peace'
45#define DF_INOS_RAMP_STATE_BREAK 1 // state 'break'
46#define DF_INOS_RAMP_STATE_RUNNING 2 // state 'running'
47#define DF_INOS_RAMP_STATE_PULLING 3 // state 'pulling'
48#define DF_INOS_RAMP_STATE_STOPPING 4 // state 'stopping'
49//
50// --- ramp errors -------------------------------------------------------------
51//
52#define ER_INOS_RAMP_POSRANGE 0x00000001 // position out of range
53#define ER_INOS_RAMP_FAILED 0x00000002 // requested command failed
54#define ER_INOS_RAMP_MIM_RANGE 0x00000004 // position out of range during mov in move
55#define ER_INOS_RAMP_OVERSAMPLING 0x00000008 // number of samples was not a
56 // multiple of oversampling number
57#define ER_INOS_RAMP_VMAX_REACHED 0x00000010 // allowed Vmax reached
58#define ER_INOS_RAMP_MOVE_NOT_IN_CACHE 0x00000020 // trajectory was not in cache as expected
59#define ER_INOS_RAMP_CORE_MISMATCH 0x00000040 // core mismatch
60//
61#define DF_INOS_RAMP_MAX_ERR 32 // max. number of errors
62//
63// --- ramp warnings -----------------------------------------------------------
64//
65#define WR_INOS_RAMP_MIM_DEC 0x00000001 // move in move during deceleration
66#define WR_INOS_RAMP_CORE_MISMATCH 0x00000002 // core mismatch
67//
68// --- ramp flags --------------------------------------------------------------
69//
70#define DF_INOS_BASE_RAMP_FLAG_CHK_LIMITS 0x00000001 // check position limits
71#define DF_INOS_BASE_RAMP_FLAG_ENB_BASE 0x00000002 // take base class geni
72#define DF_INOS_BASE_RAMP_FLAG_ENB_TRQLIMIT 0x00000004 // enable torque limitation
73#define DF_INOS_BASE_RAMP_FLAG_DIS_MIM 0x00000008 // disable 'move in move'
74#define DF_INOS_BASE_RAMP_FLAG_LIMIT_MOVE 0x00000010 // limit move to min/max instead of range error
75#define DF_INOS_BASE_RAMP_FLAG_DIS_MIM_DEC 0x00000020 // disable 'move in move' if axis is in deceleration already
76#define DF_INOS_BASE_RAMP_FLAG_SET_CACHE_EPSILON 0x00000040 // set cache epsilon == ramp epsilon
77#define DF_INOS_BASE_RAMP_FLAG_OPT_MIM 0x00000080 // enable optimized move in move handling
78#define DF_INOS_BASE_RAMP_FLAG_CHK_LIMITS_IN_SEG 0x00000200 // check position limits within segments
79#define DF_INOS_BASE_RAMP_FLAG_BACKLASH 0x00000400 // do backlash compensation
80#define DF_INOS_BASE_RAMP_FLAG_FORCE_BACKLASH 0x00000800// do always a backlash move at target position
81#define DF_INOS_BASE_RAMP_FLAG_IGNORE_LIMITS_AT_STOP 0x00001000// always ignore soft limits at stop
82#define DF_INOS_BASE_RAMP_FLAG_LOOK_AHEAD 0x00002000 // enable look ahead (used e.g. for move in move on slow targets)
83#define DF_INOS_BASE_RAMP_FLAG_CACHE_ONLY 0x00004000 // consume trajectory from ramp cache only. Reject move request with a failure in case of a cache miss
84#define DF_INOS_BASE_RAMP_FLAG_IGNORE_VMAX 0x00008000 // ignore Vmax reached error (should only be used for testing purposes)
85#define DF_INOS_BASE_RAMP_FLAG_IGNORE_JERK 0x00010000 // ignore cmdJ to speed up move calculation
86#define DF_INOS_BASE_RAMP_FLAG_IGNORE_CORE 0x00020000 // ignore core mismatch failure (should only be used in desperate situations)
87#define DF_INOS_BASE_RAMP_FLAG_OVRS_LAST 0x00800000 // restore last oversampled value
88#define DF_INOS_BASE_RAMP_FLAG_SLOW_SPEED 0x01000000 // slowmotion is done with only speed reduction
89#define DF_INOS_BASE_RAMP_FLAG_SHAPE_CALC 0x02000000 // internal flag used for shape calculation
90#define DF_INOS_BASE_RAMP_FLAG_SETUPMODE 0x04000000 // setup mode active
91#define DF_INOS_BASE_RAMP_FLAG_JOB_SLOW 0x08000000 // use job slowmotion in 'move in move'
92#define DF_INOS_BASE_RAMP_FLAG_CACHE_FLUSH 0x10000000 // force a cache flush at next move
93#define DF_INOS_BASE_RAMP_FLAG_CRS_PEACE 0x20000000 // geni requests peace during critical section
94#define DF_INOS_BASE_RAMP_FLAG_CRS_ACTIVE 0x40000000 // critical section active
95#define DF_INOS_BASE_RAMP_FLAG_ENABLED 0x80000000 // ramp geni is enabled
96//
97// no caching
98#define DF_INOS_BASE_RAMP_FLAG_NO_CACHE (DF_INOS_BASE_RAMP_FLAG_SETUPMODE|DF_INOS_BASE_RAMP_FLAG_BACKLASH)
99//
100// --- cache critical flags (changing them -> cache flush) ---------------------
101//
102#define DF_INOS_BASE_RAMP_FLAG_CACHE_CRITICAL \
103 (DF_INOS_BASE_RAMP_FLAG_ENB_BASE | DF_INOS_BASE_RAMP_FLAG_ENB_TRQLIMIT | DF_INOS_BASE_RAMP_FLAG_CACHE_FLUSH)
104//
105// --- ramp options ------------------------------------------------------------
106//
109#define DF_INOS_BASE_RAMP_OPT_CHK_LIMITS 0x00000001
113#define DF_INOS_BASE_RAMP_OPT_ENB_BASE 0x00000002
116#define DF_INOS_BASE_RAMP_OPT_ENB_TRQLIMIT 0x00000004 // enable torque limitation
119#define DF_INOS_BASE_RAMP_OPT_DIS_MIM 0x00000008
125#define DF_INOS_BASE_RAMP_OPT_LIMIT_MOVE 0x00000010
128#define DF_INOS_BASE_RAMP_OPT_DIS_MIM_DEC 0x00000020
132#define DF_INOS_BASE_RAMP_OPT_OPT_MIM 0x00000080
135#define DF_INOS_BASE_RAMP_OPT_TRQ_LIMIT 0x00000100
138#define DF_INOS_BASE_RAMP_OPT_BACKLASH 0x00000400
141#define DF_INOS_BASE_RAMP_OPT_FORCE_BACKLASH 0x00000800
144#define DF_INOS_BASE_RAMP_OPT_IGNORE_LIMITS_AT_STOP 0x00001000
151#define DF_INOS_BASE_RAMP_OPT_LOOK_AHEAD 0x00002000
154#define DF_INOS_BASE_RAMP_OPT_IGNORE_VMAX 0x00008000
158#define DF_INOS_BASE_RAMP_OPT_IGNORE_CORE 0x00020000
159//
160// --- ramp data flags ---------------------------------------------------------
161//
162#define DF_INOS_BASE_RAMP_DATA_FLAG_DEL 0x00000001 // structure has to be deleted
163#define DF_INOS_BASE_RAMP_DATA_FLAG_LST 0x00000002 // last block in chain
164//
165// --- others ------------------------------------------------------------------
166//
167#define DF_INOS_RAMP_JERK_ALL 0xFFFFFFFF // jerk number for all jerks
168#ifdef INOS_SLOWMOTION_ZERO_SUPPORT
169#define DF_INOS_RAMP_MIN_SLOW REAL64(0.0000) // min. allowed slowmotion factor
170#else
171#define DF_INOS_RAMP_MIN_SLOW REAL64(0.0001) // min. allowed slowmotion factor
172#endif
173#define DF_INOS_RAMP_MAX_SLOW REAL64(2.0000) // max. allowed slowmotion factor
174#define DF_INOS_RAMP_EPS_V_STOP REAL64(1.0e-6) // epsilon value used to determine when a velocity reaches zero during a stop
175//
176// --- max. velocity flags -----------------------------------------------------
177//
178enum {
179 eMaxVelocityNone = 0x00000000,
180 eMaxVelocityIgnoreSetup = 0x00000001,
181 eMaxVelocityIgnoreSLS = 0x00000002,
182};
183//
184//------------------------------------------------------------------------------
185// includes
186//------------------------------------------------------------------------------
187//
188// system
189#ifdef INOS_RAMP_DLL
190#include <_inos.h>
191#else
192#include <inos.h>
193#endif
194#ifdef INOS_SAFETY_SUPPORT
195#include <cinossafetyconfig.h>
196#endif
197//
198// C++
199//
200// project
201//
202//------------------------------------------------------------------------------
203//--- structures ---------------------------------------------------------------
204//------------------------------------------------------------------------------
205//
211{
214 inosName64 m_cName;
215
219 inosName m_cUnit;
220
227
230 real64 m_rScmd;
231
235 real64 m_rVcmd;
236
240 real64 m_rAcmd;
241
245 real64 m_rBcmd;
246
251 real64 m_rCcmd;
252
256 real64 m_rJcmd;
257
262 real64 m_rJbcmd;
263
268 real64 m_rJm1cmd;
269
274 real64 m_rJm2cmd;
275
280 real64 m_rJecmd;
281
284 real64 m_rBemg;
285
290 real64 m_rJemg;
291
296 real64 m_rJeemg;
297
301 real64 m_rSmin;
302
306 real64 m_rSmax;
307
310 real64 m_rVmin;
311
314 real64 m_rVmax;
315
319
323
328 real64 m_rVtrq;
329
332 real64 m_rAmin;
333
336 real64 m_rAmax;
337
346
349 real64 m_rArms;
350
355 real64 m_rAtrq;
356
359 real64 m_rBmin;
360
363 real64 m_rBmax;
364
369 real64 m_rBtrq;
370
373 real64 m_rCmin;
374
377 real64 m_rCmax;
378
381 real64 m_rJmin;
382
385 real64 m_rJmax;
386
395 real64 m_rMiMTol;
396
407
411
415
419
435
440
446
450
452 uint8 m_uInternal0[1];
454
455 // constructor
457};
458
459// generic param extension
460#if defined(INOS_AXIS_EXTENSION_SUPPORT)
461struct SINOSParamSetExtension
462{
464 uint32 m_uId;
466 char m_cName[32];
468 SINOSParamSetExtension* m_pNext;
469
471 SINOSParamSetExtension(uint32 auId, const char* apName)
472 : m_uId(auId), m_cName{0}, m_pNext(0)
473 { inos_strncpy(m_cName, apName, sizeof(m_cName));};
475 virtual ~SINOSParamSetExtension(){};
476
478 uint32 GetId() const
479 { return m_uId; };
481 const char* GetName() const
482 { return &m_cName[0]; };
484 virtual SINOSParamSetExtension& operator=(const SINOSParamSetExtension& src)
485 {
486 // we do not need to copy anything, because this operator is only called
487 // if id and name are already equal, see SINOSRampParam::CloneExtensions in
488 // cinosbaseramp.cpp
489 return *this;
490 }
492 virtual SINOSParamSetExtension* Clone() = 0;
494 virtual CINCOObject* CreateInco() = 0;
495
496 // dynamic object
497 DECLARE_DYNAMIC(SINOSParamSetExtension);
498};
499#endif
500
503{
504 // ramp param flags
505 enum {
506 eFlgFix = 0x00000001, // speed set is fixed (ignore slowmotion, ...)
507 eFlgOk = 0x00000002, // speed set is ok checked already
508 eFlgTim = 0x00000004, // required time for the move is m_rTime [sec]
509 eFlgP5 = 0x00000008, // use a P5 for the move
510 eFlgWindow = 0x00000010, // use position type 'window'
511 eFlgWindowOpt = 0x00000020, // use position type 'windowopt'
512 eFlgEco = 0x00000040, // use a ecological params
513 eFlgAwayLight = 0x00000080, // move with disabled torque limitation
514 // and jerks = 0.0 at move away from border to speed up calculation
515 eFlgIgnoreLimits = 0x00000100, // ignore position limits
516 eFlgTriggerReduced = 0x00000200,// MoveEx trigger only active with reduced speed
517 eFlgIgnoreCache = 0x00000400,// ignore ramp cache. useful to avoid interference between concurrent calculation and move calls.
518 eFlgTemporary = 0x80000000, // temporary structure
519 };
521 real64 m_rVcmd;
523 real64 m_rAcmd;
525 real64 m_rBcmd;
527 real64 m_rCcmd;
529 real64 m_rJcmd[DF_INOS_RAMP_MAX_JERK];
531 real64 m_rJCcmd;
533 real64 m_rTime;
536 real64 m_rSlow;
538 uint32 m_uFlags = 0;
541 { m_uFlags |= eFlgTemporary; }
544 { return (m_uFlags & eFlgTemporary)!=0; }
547 { m_uFlags |= eFlgIgnoreCache; }
550 { m_uFlags &= ~eFlgIgnoreCache; }
553 { return (m_uFlags & eFlgIgnoreCache)!=0; }
554 #if !defined(INOS_AXIS_EXTENSION_SUPPORT)
556 uint32 m_uDummy;
557 #else
559 struct SINOSParamSetExtension* m_pExtension;
563 SINOSRampParam(const SINOSRampParam& aParam);
566 // assignment operator
567 SINOSRampParam& operator= (const SINOSRampParam& src);
569 void Copy(const SINOSRampParam& src);
571 void DestroyExtensions();
573 void CloneExtensions(const SINOSRampParam& src);
575 void AddExtension(SINOSParamSetExtension* apExtension);
577 void RemoveExtension(const char* apName);
579 SINOSParamSetExtension* GetExtension(uint32 auId)
580 {
581 // search
582 SINOSParamSetExtension* ext = m_pExtension;
583 while (ext){
584 // found ?
585 if (ext->m_uId == auId) {
586 // found
587 return ext;
588 } // end if
589 ext = ext->m_pNext;
590 }
591 // not found
592 return 0;
593 }
594 #endif
595
598};
599
602{
604 real64 m_rS;
606 real64 m_rV;
608 real64 m_rA;
610 real64 m_rJ;
611 // allow new/delete
613};
614
617{
619 uint32 m_uFlags;
622 // allow new/delete
624};
625
627typedef struct{
628 real64 m_rAccelerationTime;
629 real64 m_rMoveTime;
630 real64 m_rConstTime;
631 real64 m_rDecelerationTime;
633
636{
638 inosName32 m_cName;
640 uint32 m_uNumber;
642 uint32 m_uDummy;
644 real64 m_rV;
646 real64 m_rA;
647};
648
653
658
661{
663 uint32 m_uNumber;
665 uint32 m_uDummy;
667 real64* m_rV;
669 real64* m_rA;
670
672 explicit SINOSBaseRampTrqLimit(uint32 auNumber = 0);
677
680 {
681 if (m_uNumber != b.m_uNumber) return false;
682 for (uint32 i=0; i<m_uNumber; i++){
683 if (m_rV[i] != b.m_rV[i]) return false;
684 if (m_rA[i] != b.m_rA[i]) return false;
685 }
686 return true;
687 }
688};
689
690//------------------------------------------------------------------------------
691// class definition
692//------------------------------------------------------------------------------
693//
694class CINOSBaseRamp;
695#ifndef INOS_RAMP_DLL
697{
698 //--- user interface ---------------------------------------------------
699
700 // public member functions
701 public :
702
703 #if defined(INOS_AXIS_EXTENSION_SUPPORT)
705 void AddExtension(SINOSParamSetExtension* apExtension);
707 void RemoveExtension(const char* apName);
708 #endif
709
711 virtual CINCOObject* GetRegister(CINOSBaseRamp* apRamp);
712
713 //--- internals --------------------------------------------------------
714
715 // public but just for internal use
716 public:
717 explicit CINOSBaseRampParamSet(SINOSRampParam* apParam = 0);
718 //; constructor
720 //; copy constructor. Note: m_pRegister will not be copied,
721 //; it'll be initialized to NULL.
722 CINOSBaseRampParamSet& operator=(
723 const CINOSBaseRampParamSet& aOther);
724 //; assignment operator. Note that this function does not alter
725 //; m_pRegister!
726 virtual ~CINOSBaseRampParamSet();
727 //; destructor
728 SINOSRampParam m_Param{};
729 //; ramp params
730 CINCOObject* m_pRegister;
731 //; pointer to inco registration of set
732
733 // allow dynamic object handling (new/delete)
735};
736#endif
737
738//------------------------------------------------------------------------------
739// class definition
740//------------------------------------------------------------------------------
741//
742class CINOSRampJob;
743class CINOSRampJobPart;
744class CINOSRampCache;
745class CINOSRampSeg;
746class CINOSRampSegTra;
747class CINOSRampSegCns;
748class CINOSRampSegPos;
749class CINOSMapping;
750class CINOSBus;
752{
753 //--- user interface ---------------------------------------------------
754
755 public:
756
757 // constructor/destructor
758
759 explicit CINOSBaseRamp(SINOSBaseRamp* apDesc);
760 //; constructor
761 virtual ~CINOSBaseRamp();
762 //; destructor
763 const char* GetName();
764 //; get axis generator name
765 const char* GetType();
766 //; get ramp generator type
767 static uint32 GetVersion();
768 //; get ramp generator version
769 #ifndef INOS_RAMP_DLL
770 static CINOSBaseRamp* GetRamp(const char* apAxisName, const char* apRampType);
771 //; create ramp and return pointer to it (gets ramp properties from
772 //; database table
773 static CINOSBaseRamp* GetRamp(const char* apType);
774 //; create ramp of type 'apType' return pointer to it or NULL if 'apType'
775 //; not available
776 #endif
777
778 enum EMoveFlags{
779 eFlgMoveNone= 0x00000000,
780 eFlgMoveWithoutDec1 = 0x00000001,
781 eFlgMoveWithoutDec2 = 0x00000002,
782 eFlgMoveWithoutDec3 = 0x00000004
783 };
784
785 // moving functions
786
787 virtual bool Move(real64 arPosition, SINOSRampParam* apParam = 0);
788 //; move to position with apParam values or actual commanded values if
789 //; apParam = 0 and return true if move was really started and false
790 //; if move was not started for some reason (e.g. nothing to move or
791 //; position range error)
792 virtual bool Move(real64 arPosition, real64 arSave1, real64 arSave2,
793 real64& arTime, SINOSRampParam* apParam1 = 0, SINOSRampParam* apParam2 = 0);
794 //; move to arPosition with apParam values in considering arSave1
795 //; and arSave2
796 virtual bool MoveApp(real64 arPosition, real64 arPositionVel, real64 arVelocity,
797 SINOSRampParam* apParam = 0, EMoveFlags aeFlags = eFlgMoveNone);
798 //; move to position with apParam, ensure after arPositionVel a
799 //; velocity that is smaller than or equal to arVelocity
800 virtual bool MoveDep(real64 arPosition, real64 arPositionVel, real64 arVelocity,
801 SINOSRampParam* apParam = 0);
802 //; move to position with apParam, ensure before arPositionVel a
803 //; velocity that is smaller than or equal to arVelocity
804 virtual bool Endless(bool abPositive = true, SINOSRampParam* apParam = 0);
805 //; start an endless move in the requested direction and return true
806 //; if really started
807 virtual bool Update(SINOSRampParam* apParam = 0);
808 //; update a running Move to apParam values or actual commanded values
809 //; if apParam = 0
810
811
816 virtual SINOSTimeCharacteristics GetTimeCharacteristics(real64 arPosition, real64 arDelta,
817 SINOSRampParam* apParam);
822 virtual SINOSTimeCharacteristics GetTimeCharacteristics(real64 arStartPosition, real64 arEndPosition,
823 real64 arDelta, SINOSRampParam* apParam);
824
825
826 virtual real64 GetMoveTime(real64 arPosition, real64 arDelta = REAL64(0.0),
827 SINOSRampParam* apParam = 0);
828 //; return time [sec] a Move(adPosition) needs until arPosition-arDelta
829 virtual real64 GetAccelerationTime(real64 arPosition, real64 arDelta = REAL64(0.0),
830 SINOSRampParam* apParam = 0);
831 //; return time [sec] a Move(adPosition) needs for the acceleration part
832 virtual real64 GetConstTime(real64 arPosition, real64 arDelta = REAL64(0.0),
833 SINOSRampParam* apParam = 0);
834 //; return time [sec] a Move(adPosition) needs for the const part
835 virtual real64 GetDecelerationTime(real64 arPosition, real64 arDelta = REAL64(0.0),
836 SINOSRampParam* apParam = 0);
837 //; return time [sec] a Move(adPosition) needs for the deceleration part
838
839 virtual real64 GetMoveTime(real64 arStartPosition, real64 arEndPosition,
840 real64 arDelta, SINOSRampParam* apParam = 0);
841 //; return time [sec] a Move needs from arStartPosition
842 //; until arEndPosition-arDelta
843 virtual real64 GetAccelerationTime(real64 arStartPosition, real64 arEndPosition,
844 real64 arDelta, SINOSRampParam* apParam = 0);
845 //; return time [sec] a Move needs for the acceleration part
846 virtual real64 GetConstTime(real64 arStartPosition, real64 arEndPosition,
847 real64 arDelta, SINOSRampParam* apParam = 0);
848 //; return time [sec] a Move needs for the const part
849 virtual real64 GetDecelerationTime(real64 arStartPosition, real64 arEndPosition,
850 real64 arDelta, SINOSRampParam* apParam = 0);
851 //; return time [sec] a Move needs for the deceleration part
852
853 virtual real64 GetMoveTime(real64 arStartPosition, real64 arEndPosition,
854 real64 arDelta, real64& arDeltaTime, SINOSRampParam* apParam = 0);
855 //; return time [sec] a Move needs from arStartPosition
856 //; until arEndPosition-arDelta
857
858 virtual real64 GetMoveAppTime(real64 arPosition, real64 arPositionVel,
859 real64 arVelocity, real64 arDelta = REAL64(0.0), SINOSRampParam* apParam = 0);
860 //; return time [sec] an according MoveApp needs
861 virtual real64 GetMoveAppTime(real64 arStartPosition, real64 arEndPosition,
862 real64 arPositionVel, real64 arVelocity, real64 arDelta, SINOSRampParam* apParam = 0);
863 //; return time [sec] an according MoveApp needs
864 virtual real64 GetMoveDepTime(real64 arPosition, real64 arPositionVel,
865 real64 arVelocity, real64 arDelta = REAL64(0.0), SINOSRampParam* apParam = 0);
866 //; return time [sec] an according MoveDep needs
867 virtual real64 GetMoveDepTime(real64 arStartPosition, real64 arEndPosition,
868 real64 arPositionVel, real64 arVelocity, real64 arDelta, SINOSRampParam* apParam = 0);
869 //; return time [sec] an according MoveDep needs
870 virtual real64 GetMoveDist(real64 arTime, SINOSRampParam* apParam = 0);
871 //; return distance [unit] a Move progresses in arTime [sec]
872 virtual real64 GetMoveDist(real64 arPosition, real64 arTime,
873 SINOSRampParam* apParam = 0);
874 //; return distance [unit] a Move(arPosition) progresses in arTime [sec]
875 virtual real64 GetMoveDist(real64 arStartPosition, real64 arEndPosition,
876 real64 arTime, SINOSRampParam* apParam = 0);
877 //; return distance [unit] a Move from arStartPosition to arEndPosition
878 //; progresses in arTime [sec]
879 virtual uint64 GetStartTicks(real64 arDelta);
880 //; return absolut bus ticks the actual move reaches the start + arDelta
881 virtual uint64 GetTargetTicks()
882 //; return absolut bus ticks the actual move reaches the target
883 { return inos_atomic_gettickcount(&m_uTargetTicks);};
884 virtual uint64 GetTargetTicks(real64 arDelta);
885 //; return absolut bus ticks the actual move reaches the target - arDelta
886
887 // segmentation moving functions
888
889 virtual uint32 SegBegin(real64 arSlowMotion = REAL64(1.0), real64 arStartVelocity = REAL64(0.0));
890 //; start new segmentation move
891 virtual uint32 SegBegin(real64 arSlowMotion, real64 arStartPosition, real64 arStartVelocity);
892 //; start new segmentation move
893 virtual uint32 SegMove(real64 arPosition, real64 arVelocity = REAL64(0.0),
894 SINOSRampParam* apParam = 0, real64 arAcceleration = REAL64(0.0), real64 arDuration = REAL64(-1.0));
895 //; move to 'arPosition', the velocity in 'arPosition' has to be
896 //; 'arVelocity' and the acceleration arAcceleration.
897 //; The duration (tim can be stretched by arDuration != -1.0
898 //; The base implementation only supports = -1.0
899 virtual uint32 SegMoveResult()
900 //; get result of last seg move
901 { return m_eSegMoveResult;};
902 virtual uint32 SegConst(real64 arPosition);
903 //; move to 'arPosition' with the actual velocity
904 virtual uint32 SegPos(real64 arTime);
905 //; stay at 'arPosition' for arTime
906 virtual uint32 SegPosSetTime(real64 arTime);
907 //; set the requested time of a previous added pos segment
908 virtual uint32 SegVelocity(real64 arVelocity, SINOSRampParam* apParam = 0);
909 //; stay at 'arPosition' for arTime
910 virtual real64 SegTime(bool abRoundedtoCycleTime=true);
911 //; return time [sec] the actual SegMove needs already
912 virtual uint32 GetSegEnd (real64& arS);
913 //; seg job must fit into cycle
914 virtual void SegJobMustFitInCycle (bool abMustFitInCycle);
915 //; get the end position of the segment
916 virtual uint32 SegRun();
917 //; run actual segmentation move
918 virtual CINOSRampJob* GetSegJob()
919 { return m_pSegJob;};
920
921 // pulling methods
922
923 virtual void Pull(real64 arS, real64 arV, real64 arA, real64 arJ);
924 //; add s, v, a, j to the actual pull list (starts pull if not yet done)
925 virtual void Pull(SINOSRampData& aData);
926 //; add aData to the actual pull list (starts pull if not yet done)
927 virtual void Pull(SINOSRampDataEx* apData);
928 //; add apData to the actual pull list (starts pull if not yet done)
929 //; apData IS deleted after processed
930 //; \note Be aware of the following: If an axis is in 'pulling' state
931 //; and the axis was not 'running' before (i.e. m_uNxtState is 'READY')
932 //; if FlushPull() is called, the ramp state will become 'READY'/'PEACE'
933 //; during the next call to GetData(). Be aware that, if after calling this
934 //; function, a task switch happens that cause the fieldbus task
935 //; calling GetData(), that function will immediately return
936 //; V,A,J = 0.0 - without properly ramping down these properties.
937 //; Among others, when this happens, calling EmergencyStop afterwards
938 //; doesn't do anything, because the ramp state is already 'READY'/'PEACE'.
939 virtual void FlushPull();
940 //; flush actual pending pull list
941 void Enable();
942 //; enable pull mode
943 void Disable()
944 //; disable pull mode (needed to be able to fill up pull list without
945 //; starting immediately)
946 { ClrFlag(DF_INOS_BASE_RAMP_FLAG_ENABLED);};
947
948 // stop/break/continue functions
949
950 virtual bool Stop(SINOSRampParam* apParam = 0);
951 //; stop move with acc/deceleration
952 virtual bool StopLive(real64 arSlowMotion = 1.0, SINOSRampParam* apParam = 0);
953 //; live stop move with acc/deceleration
954 virtual bool StopLiveDelta(real64 arDelta, real64 arSlowMotion = 1.0, SINOSRampParam* apParam = 0);
955 //; live stop move with acc/deceleration, the move should be stopped 'arDelta' after current position
956 virtual bool Stop(real64 arPosition, SINOSRampParam* apParam = 0);
957 //; stop move with acc/deceleration at adPosition
958 virtual bool Break(SINOSRampParam* apParam = 0);
959 //; break move with acc/deceleration (move still pending)
960 virtual bool BreakLive(SINOSRampParam* apParam = 0);
961 //; live break move with acc/deceleration (move still pending)
962 virtual bool Break(real64 arPosition, SINOSRampParam* apParam = 0);
963 //; break move with acc/deceleration at adPosition (move still
964 //; pending)
965 virtual bool EmergencyStop();
966 virtual bool EmergencyStop(SINOSRampParam* apParam);
967 virtual bool EmergencyStop(real64 arPosition, SINOSRampParam* apParam, bool abPosValid = true);
968 //; emergency stop as quick as possible
969 virtual void EmergencyStopLive();
970 virtual void EmergencyStopLive(SINOSRampParam* apParam);
971 //; emergency stop as quick as possible (do the calculation live)
972 virtual bool Continue(SINOSRampParam* apParam = 0);
973 //; continue paused move
974
975 // set/get property functions
976
977 enum ECmdFlags{
978 eFlgCmdNone = 0x00000000,
979 eFlgCmdPeak = 0x00000001
980 };
981
982 virtual void SetCmdFlags(uint32 auFlags);
983 //; set commanded flags
984 ICACHE virtual void SetCmdPosition(real64 arPosition);
985 //; set commanded axis position
986 ICACHE virtual void GetCmdPosition(real64& arPosition);
987 //; get commanded axis position
988 virtual void SetCmdVelocity(real64 arVelocity);
989 //; set commanded velocity
990 virtual void GetCmdVelocity(real64& arVelocity, ECmdFlags aeFlags = eFlgCmdNone);
991 //; get commanded velocity
992 virtual void SetCmdAcceleration(real64 arAcceleration);
993 //; set commanded acceleration
994 virtual void GetCmdAcceleration(real64& arAcceleration, ECmdFlags aeFlags = eFlgCmdNone);
995 //; get commanded acceleration
996 virtual void SetCmdDeceleration(real64 arDeceleration);
997 //; set commanded deceleration
998 virtual void GetCmdDeceleration(real64& arDeceleration, ECmdFlags aeFlags = eFlgCmdNone);
999 //; get commanded deceleration
1000 virtual void SetCmdCruiseleration(real64 arCruiseleration);
1001 //; set commanded cruiseleration
1002 virtual void GetCmdCruiseleration(real64& arCruiseleration);
1003 //; get commanded cruiseleration
1004 virtual void SetCmdJerk(real64 arJerk, uint32 auNumber = DF_INOS_RAMP_JERK_ALL);
1005 //; set commanded jerk
1006 virtual void GetCmdJerk(real64& arJerk, uint32 auNumber = 0);
1007 //; get commanded jerk
1008 virtual void SetCmdCruiseJerk(real64 arCruiseJerk);
1009 //; set commanded cruise jerk
1010 virtual void GetCmdCruiseJerk(real64& arCruiseJerk);
1011 //; get commanded jerk
1012 virtual void GetCmdRealJerk(real64& arJerk, uint32 auNumber = 0);
1013 //; get commanded real jerk and update a running move if requested
1014 virtual void SetCmdSlowMotion(real64 arSlowMotion, bool abUpdate = false);
1015 //; set commanded slowmotion factor
1016 virtual void SetCmdSlowMotion(real64 arSlowMotion, bool abUpdate, bool abStopping);
1017 //; set commanded slowmotion factor
1018 virtual void GetCmdSlowMotion(real64& arSlowMotion, SINOSRampParam* apParam = 0);
1019 //; get commanded slowmotion factor
1020 virtual void GetActSlowMotion(real64& arSlowMotion, SINOSRampParam* apParam = 0);
1021 //; get actual slowmotion factor (slowmotion>slowmotionmax?slowmotionmax : slowmotion)
1022 #ifdef INOS_SAFETY_SUPPORT
1023 virtual void GetSafetySlowMotion(real64& arSlowMotion, SINOSRampParam* apParam = 0);
1024 //; get safety slowmotion factor
1025 #endif
1026 virtual void SetCmdRelaxTime(real64 arRelaxTime);
1027 //; set commanded relax time
1028 virtual void GetCmdRelaxTime(real64& arRelaxTime);
1029 //; get commanded relax time
1030 virtual void SetEmgDeceleration(real64 arDeceleration);
1031 //; set commanded emergency deceleration
1032 virtual void GetEmgDeceleration(real64& arDeceleration);
1033 //; get commanded emergency deceleration
1034 virtual void SetEmgJerk(real64 arJerk);
1035 //; set commanded emergency jerk
1036 virtual void SetEmgJerk(real64 arJerk, real64 arJerkEnd);
1037 //; set commanded emergency jerk
1038 virtual void GetEmgJerk(real64& arJerk);
1039 //; get commanded emergency jerk
1040 virtual void GetEmgJerk(real64& arJerk, real64& arJerkEnd);
1041 //; get commanded emergency jerk
1042 virtual void SetCmdParam(SINOSRampParam* apParam)
1043 { *m_pParam = *apParam; };
1044 //; get pointer to commanded parameters
1045 virtual SINOSRampParam* GetCmdParam()
1046 { return m_pParam; };
1047 //; get pointer to commanded parameters
1048 ICACHE virtual void SetActPosition(real64 arPosition);
1049 //; set actual axis position
1050 ICACHE virtual void AdjActPosition(real64 arPosition);
1051 //; adjust actual axis position
1052 ICACHE virtual void GetActPosition(real64& arPosition);
1053 //; get actual axis position
1054 ICACHE virtual void GetActPosition(real64& arPosition, uint64 auTicks);
1055 //; get actual axis position
1056 virtual void GetStopPosition(real64& arPosition, SINOSRampParam* apParam);
1057 //; get axis position if we would stop a running move
1058 virtual void GetBgnPosition(real64& arPosition)
1059 { arPosition = m_rSbgn;};
1060 //; get position the actual/last move/endless was started from
1061 virtual void SetActVelocity(real64 arVelocity);
1062 //; set actual velocity
1063 virtual void GetActVelocity(real64& arVelocity);
1064 //; get actual velocity
1065 virtual void SetActAcceleration(real64 arAcceleration);
1066 //; set actual acceleration
1067 virtual void GetActAcceleration(real64& arAcceleration);
1068 //; get actual acceleration
1069 virtual void SetActJerk(real64 arJerk);
1070 //; set actual jerk
1071 virtual void GetActJerk(real64& arJerk);
1072 //; get actual jerk
1073 virtual void SetAct(SINOSRampData& aAct);
1074 //; set actuals
1075 virtual void GetActSVAJ(SINOSRampData& arData, bool abIrqSafe = true);
1076 //; get all actuals
1077 virtual void AdjActTime(real64 arDelta);
1078 //; adjust actual move time
1079 virtual void SetMinPosition(real64 arPosition);
1080 //; set min. allowed position
1081 virtual void GetMinPosition(real64& apPosition) const;
1082 //; get min. allowed position
1083 virtual void SetMaxPosition(real64 arPosition);
1084 //; set max. allowed position
1085 virtual void GetMaxPosition(real64& arPosition) const;
1086 //; get max. allowed position
1087 virtual bool CheckPosition(real64& arPosition, bool abIgnoreMapping = false, SINOSRampParam* apParam = nullptr);
1088 //; return true if arPosition within the range or no range requested
1089 virtual void SetMaxVelocity(real64 arVelocity);
1090 //; set max. allowed velocity
1091 virtual void GetMaxVelocity(real64& arVelocity, uint32 auFlags = eMaxVelocityNone);
1092 //; get max. allowed velocity
1093 virtual void SetMaxSetupVelocity(real64 arVelocity);
1094 //; set max. allowed velocity in setup mode
1095 virtual void GetMaxSetupVelocity(real64& arVelocity);
1096 //; get max. allowed velocity in setup mode
1097 virtual void SetMaxInitVelocity(real64 arVelocity);
1098 //; set max. allowed velocity during initialization
1099 virtual void GetMaxInitVelocity(real64& arVelocity);
1100 //; get max. allowed velocity during initialization
1101 virtual void SetMinVelocity(real64 arVelocity);
1102 //; set min. allowed velocity
1103 virtual void GetMinVelocity(real64& arVelocity);
1104 //; get min. allowed velocity
1105 virtual void SetTrqVelocity(real64 arVelocity);
1106 //; set torque velocity
1107 virtual void GetTrqVelocity(real64& arVelocity);
1108 //; get torque velocity
1109 virtual void AdjustMinMaxValues (real64 arFactor);
1110 //; adjust min max values
1111 virtual void SetMinAcceleration(real64 arAcceleration);
1112 //; set min. allowed acceleration
1113 virtual void GetMinAcceleration(real64& arAcceleration);
1114 //; get min. allowed acceleration
1115 virtual void SetMaxAcceleration(real64 arAcceleration);
1116 //; set max. allowed acceleration
1117 virtual void GetMaxAcceleration(real64& arAcceleration);
1118 //; get max. allowed acceleration
1119 virtual void SetMaxAccelerationPull(real64 arAcceleration);
1120 //; set max. allowed acceleration during pull
1121 virtual void GetMaxAccelerationPull(real64& arAcceleration);
1122 //; get max. allowed acceleration during pull
1123 virtual void SetTrqAcceleration(real64 arAcceleration);
1124 //; set torque acceleration
1125 virtual void GetTrqAcceleration(real64& arAcceleration);
1126 //; get torque acceleration
1127 virtual void SetMinDeceleration(real64 arDeceleration);
1128 //; set min. allowed deceleration
1129 virtual void GetMinDeceleration(real64& arDeceleration);
1130 //; get min. allowed deceleration
1131 virtual void SetMaxDeceleration(real64 arDeceleration);
1132 //; set max. allowed deceleration
1133 virtual void GetMaxDeceleration(real64& arDeceleration);
1134 //; get max. allowed deceleration
1135 virtual void SetTrqDeceleration(real64 arDeceleration);
1136 //; set torque deceleration
1137 virtual void GetTrqDeceleration(real64& arDeceleration);
1138 //; get torque deceleration
1139 virtual void SetMinCruiseleration(real64 arCruiseleration);
1140 //; set min. allowed cruiseleration
1141 virtual void GetMinCruiseleration(real64& arCruiseleration);
1142 //; get min. allowed cruiseleration
1143 virtual void SetMaxCruiseleration(real64 arCruiseleration);
1144 //; set max. allowed cruiseleration
1145 virtual void GetMaxCruiseleration(real64& arCruiseleration);
1146 //; get max. allowed cruiseleration
1147 virtual void SetMinJerk(real64 arJerk);
1148 //; set min. allowed jerk
1149 virtual void GetMinJerk(real64& arJerk);
1150 //; get min. allowed jerk
1151 virtual void SetMaxJerk(real64 arJerk);
1152 //; set max. allowed jerk
1153 virtual void GetMaxJerk(real64& arJerk);
1154 //; get max. allowed jerk
1155
1156 virtual void GetCycleTime(real64& arCycleTime);
1157 //; get ramp cycle time
1158 virtual void SetCycleTime(real64 arCycleTime);
1159 //; set ramp cycle time
1160 virtual uint8 GetOversampling();
1161 //; get oversampling factor
1162 virtual void SetOversampling(uint8 auOversampling);
1163 //; set oversampling factor
1164 virtual void GetCycleTimeUs(uint32& auCycleTime)
1165 { auCycleTime = m_uCycleTimeUs;};
1166 //; get ramp cycle time
1167 virtual void GetCycleTimeNs(uint32& auCycleTime)
1168 { auCycleTime = m_uCycleTimeNs;};
1169 //; get ramp cycle time
1170 virtual const char* GetUnit();
1171 //; get ramping base unit (e.g. mm, deg, ...)
1172 virtual void SetUnit(const char* apUnit);
1173 //; get ramping base unit (e.g. mm, deg, ...)
1174 #ifndef INOS_RAMP_DLL
1175 virtual uint32 GetCharacteristics();
1176 //; get ramping base unit inco characteristics
1177 virtual void SetCharacteristics(uint32 auCharacteristics);
1178 //; get ramping base unit inco characteristics
1179 virtual uint8 GetTypeChar() {return m_uTypeChar;};
1180 //; get type character, e.g. 'T' for temperature ramp
1181 virtual void SetTypeChar(uint8 auTypeChar) {m_uTypeChar = auTypeChar;};
1182 //; set type character, e.g. 'T' for temperature ramp
1183 virtual uint32 GetParam(const char* apName, real64& arResult);
1184 //; universal get parameter with apName to arResult and return error code
1185 virtual volatile real64* GetParamAdr(const char* apName);
1186 //; universal get address of parameter with aName or NULL if not found
1187 virtual uint32 SetParam(const char* apName, real64 arValue);
1188 //; universal set parameter with apName to arValue and return error code
1189 #endif
1190
1191 void SetFlag(uint32 auFlag)
1192 { INOS_OR(m_uFlag, auFlag);};
1193 //; set ramp flags
1194 void ClrFlag(uint32 auFlag)
1195 { INOS_AND(m_uFlag, ~auFlag);};
1196 //; clear ramp flags
1197 uint32 GetFlag()
1198 { return m_uFlag & m_uFlagEnb;};
1199 //; get ramp flags
1200 void EnbFlag(uint32 auFlag)
1201 { INOS_OR(m_uFlagEnb, auFlag);};
1202 //; set ramp flags
1203 void DisFlag(uint32 auFlag)
1204 { INOS_AND(m_uFlagEnb, ~auFlag);};
1205
1206 ICACHE void SetState(uint32 auState)
1207 {
1208 // set new state
1209 m_uState = auState;
1210 // state peace ?
1211 if (m_uState == DF_INOS_RAMP_STATE_PEACE) {
1212 // yes -> clear also m_pActParam to prevent e.g.
1213 // following Pulls from inheriting speed set properties
1214 // like input shaping or others
1215 m_pActParam = nullptr;
1216 } // end if
1217 };
1218 //; set ramp state
1219 ICACHE uint32 GetState()
1220 { return m_uState;};
1221 //; get ramp state
1222 virtual uint32 GetError();
1223 //; get ramp error
1224 virtual uint64 GetErrorEx();
1225 //; get ramp error
1226 virtual uint32 GetWarning();
1227 //; get ramp warning
1228 virtual uint64 GetWarningEx();
1229 //; get ramp warning
1230 virtual void AcceptError(uint32 auError=0xffffffff);
1231 //; accept ramp error (auError=0xffffffff -> accept all errors)
1232 virtual void AcceptWarning(uint32 auWarning=0xffffffff);
1233 //; accept ramp warning (auWarning=0xffffffff -> accept all warnings)
1234
1235 ICACHE virtual void GetS(real64& arS);
1236 //; get actual S
1237 ICACHE virtual void GetSV(real64& arS, real64& arV);
1238 //; get actual S and V
1239 ICACHE virtual void GetSVA(real64& arS, real64& arV, real64& arA);
1240 //; get actual S, V and A
1241 ICACHE virtual void GetSVAJ(real64& arS, real64& arV, real64& arA, real64& arJ);
1242 //; get actual S, V, A and J
1243 ICACHE virtual SINOSRampDataEx* GetData();
1244 //; get actual S, V, A and J
1245 virtual void GetData (SINOSRampDataEx* apData, bool abSingleSample=false);
1246
1247 // param set functions
1248 #ifndef INOS_RAMP_DLL
1249 virtual CINOSBaseRampParamSet* CloneParamSet();
1250 //; return a copy of the actual param set
1251 virtual void SelectParamSet(CINOSBaseRampParamSet* apSet);
1252 //; set actual param set to apSet
1253 virtual void PreDestroyRampParam(SINOSRampParam* apParam);
1254 //; use this method to inform geni, that we're about to destroy a previously
1255 //; used speed set
1256 #endif
1257
1258 // caching functions
1259
1260 void EnableCache(uint32 auSize = 32);
1261 //; create moving cache with size auSize if nessecary and enable it
1262 CINOSRampCache* EnableCache(CINOSRampCache* apCache);
1263 //; set actual moving cache to apCache and return old one or 0
1264 CINOSRampCache* DisableCache();
1265 //; disable moving cache and return old one
1266 void ReEnableCache();
1267 //; Reenables a previously disabled ramp cache. This function is
1268 //; useful if the cache feature has temporarily been disabled
1269 //; before (DisableCache). Note: This function has no effect if
1270 //; the ramp does not yet owns a cache object. Also: It's safe
1271 //; to call this function while the cache is already enabled.
1272 void FlushCache();
1273 //; flush moving cache
1274 void SetEpsilon(real64 arEpsilon);
1275 //; set new internal 'epsilon' (standard is = 0.0)
1276 void GetEpsilon(real64& arEpsilon)
1277 {arEpsilon = m_rEpsilon;};
1278 //; get internal 'epsilon'
1279 void SetCacheEpsilon(real64 arEpsilon);
1280 //; set new cache 'epsilon' (standard is = 0.0)
1281
1282 // miscellaneous functions
1283
1284 virtual CINOSBaseRamp* Clone();
1285 //; clone myself and return pointer to it
1286 #ifndef INOS_RAMP_DLL
1287 SINOSBaseRamp* GetRampDesc()
1288 { return m_pDesc;};
1289 //; return pointer to my ramp descritpor
1290 virtual CINCOObject* GetRegister(const char* apName = "Ramp");
1291 //; return pointer to my inco object
1292 void RegisterFlags(CINCOObject* apParent, uint32* auBase);
1293 //; register flags, used for real flags and flags enable.
1294 virtual CINCOObject* GetParamSetRegister(CINOSBaseRampParamSet* apSet);
1295 //; create registration for apSet and return pointer to it
1296 static CINCOObject* GetBaseParamSetRegister(CINOSBaseRampParamSet* apSet);
1297 //; create registration for apSet and return pointer to it
1298 #endif
1299
1300 // safety move
1301
1302 virtual void SetMoveSafeMin(real64 arMin, real64 arFact1=REAL64(0.0),
1303 real64 arFact2=REAL64(0.0));
1304 //; set move safe minimum : arMin=requested minimum,
1305 //; safe1=safe1+arFact(MoveSafeMin-calcedMin), safe2=dito
1306 virtual void ResetMoveSafeMin();
1307 //; reset move safe minimum
1308
1309 // mapping
1310
1311 void SetMapping(CINOSMapping* apMapping, uint32 auIndex)
1312 { m_pMapping = apMapping; m_uMappingIndex = auIndex;};
1313 //; set actual axis mapping
1314 void ResetMapping()
1315 { m_pMapping = 0; m_uMappingIndex = 0;};
1316 //; reset actual axis mapping
1317
1318 // setup mode
1319
1320 void EnableSetupMode();
1321 //; enable setup mode
1322 void DisableSetupMode();
1323 //; disable setup mode
1324 bool CheckSetupMode();
1325 //; return true if setup mode active and fullfilled
1326
1329 {
1330 // locals
1331 real64 rAmax;
1332 // decide witch Amax to take
1333 if (m_rAmaxPull != REAL64(0.0))
1334 rAmax = m_rAmaxPull;
1335 else
1336 rAmax = m_rAmax;
1337 // max. allowed rest V = Amax * cycletime
1338 real64 rVzero = rAmax * m_rCycleTime;
1339 // underrun if no data and V!= 0.0
1340 return (m_pFstData == 0) && ((m_Act->m_rV > rVzero) || (m_Act->m_rV < -rVzero));
1341 }
1342
1343 // torque limitation
1344
1357
1360
1361 // multi core
1362
1365 { return m_uCoreId; };
1366
1367 //--- internals --------------------------------------------------------
1368
1369 friend class CINOSMapping;
1370 friend class CINOSShape;
1371 friend class CINOSBaseAxis;
1372 friend class CINOSPhysicalAxis;
1373 friend class CINOSBaseRampTest;
1374 friend class CINOSMcRobotCmdLinear;
1375 friend class CINOSRemoteControlWorker;
1376 friend void _INI_0400_CINOSBaseRamp();
1377
1378 // public member methods but just for internal use
1379 public :
1380 virtual const char* GetStateText();
1381 //; get pointer to actual state text
1382 virtual CINOSRampJob* iMove(real64 arSbgn, real64 arSend, bool abReturnError,
1383 SINOSRampParam* apParam);
1384 //; create a move job from arSbgn to arSend with apParam parameters
1385 virtual CINOSRampJob* iMove(real64 arPosition, real64 arSave1, real64 arSave2,
1386 real64& arTime, SINOSRampParam* apParam1, SINOSRampParam* apParam2);
1387 //; create a move job from arSbgn to arSend with apParam parameters
1388 virtual CINOSRampJob* iMoveApp(real64 arSbgn, real64 arSend, real64 arSvel,
1389 real64 arVelocity, bool abReturnError, SINOSRampParam* apParam, EMoveFlags aeFlags);
1390 //; create a move job from arSbgn to arSend with apParam parameters
1391 virtual CINOSRampJob* iMoveDep(real64 arSbgn, real64 arSend, real64 arSvel,
1392 real64 arVelocity, bool abReturnError, SINOSRampParam* apParam);
1393 //; create a move job from arSbgn to arSend with apParam parameters
1394 virtual SINOSRampParam* CheckParam(SINOSRampParam* apOrgParam,
1395 SINOSRampParam* apTmpParam);
1396 //; check OrgParam for limits, if OrgParam has to be adjusted, copy
1397 //; them to tmp param, return pointer to result
1398 virtual void CopyParam(SINOSRampParam* apDstParam, SINOSRampParam*& apSrcParam);
1399 //; copy src params to dst params
1400
1401 enum ECalcMoveResult {
1402 eClcMoveResOk = 0,
1403 eClcMoveResAdjusted = 1,
1404 eClcMoveResShrinked = 2,
1405 eClcMoveResFailed = 3,
1406 }; //; calc move result
1407
1408 virtual ECalcMoveResult CalcMove(real64 arSlen, SINOSRampParam* apParam, CINOSRampSegTra*& apSegAcc,
1409 CINOSRampSegCns*& apSegCns, CINOSRampSegTra*& apSegDec, real64 arVbgn = REAL64(0.0),
1410 real64 arVend = REAL64(0.0), real64 arAbgn = REAL64(0.0),
1411 real64 arAend = REAL64(0.0), real64 arDuration = REAL64(-1.0));
1412 //; calc acc, cns and dec segments for a move to arS and return true
1413 //; if requested V was adjusted
1414 virtual void CalcMoveApp(real64 arS, real64 arSred, real64 arVred,
1415 SINOSRampParam* apParam, CINOSRampSegTra*& apAcc, CINOSRampSegCns*& apCns,
1416 CINOSRampSegTra*& apDec1, CINOSRampSegCns*& apDec2, CINOSRampSegTra*& apDec3);
1417 //; calc acc, cns and dec segments for a moveapp to arS
1418 virtual void CalcMoveDep(real64 arS, real64 arSred, real64 arVred,
1419 SINOSRampParam* apParam, CINOSRampSegTra*& apAcc1, CINOSRampSegCns*& apAcc2,
1420 CINOSRampSegTra*& apAcc3, CINOSRampSegCns*& apCns, CINOSRampSegTra*& apDec);
1421 //; calc acc, cns and dec segments for a movedep to arS
1422 virtual bool CalcStop(uint32 auNxtState, SINOSRampParam* apParam, bool abEmergency=false);
1423 //; calc dec segment for a stop and return true if a calculation was done
1424 virtual bool CalcStopLive(uint32 auNxtState, SINOSRampParam* apParam, bool abEmergency=false);
1425 //; calc dec segment for a stop and return true if a calculation was done
1426 virtual bool CalcStop(real64 arS, uint32 auNxtState, SINOSRampParam* apParam, bool abEmergency=false);
1427 //; calc acc, cns and dec segments for a stop at arS and return true
1428 //; if a calculation was done
1429 virtual real64 CalcEscape(real64 arSlen, SINOSRampParam* apParam);
1430 //; ...
1431 virtual bool iCalcApp(real64 arS, real64 arSred, real64 arVred, SINOSRampParam* apParam);
1432 //; calc acc, cns and dec segments for a moveapp at arS and return true
1433 //; if a calculation was done
1434 virtual void iStopping();
1435 //; calc live stopping
1436
1437 enum ECalcSegTraType {
1438 eClcSegTraCompatible = 0,
1439 eClcSegTraAccelerate = 1,
1440 eClcSegTraDecelerate = 2,
1441 eClcSegTraMiddle = 3
1442 }; //; calc move result
1443
1444 virtual CINOSRampSegTra* CalcSegTra(
1445 real64 arVb, // starting velocity
1446 real64 arAb, // starting acceleration
1447 real64 arVe, // ending velocity
1448 SINOSRampParam* apParam, // requested parameters
1449 CINOSRampSegTra* apResult=0,// result
1450 real64 arJb=REAL64(-1.0), // requested begin jerk
1451 real64 arJe=REAL64(-1.0), // requested end jerk
1452 ECalcSegTraType aeType = eClcSegTraCompatible
1453 );
1454 //; calc transition segment
1455 virtual void CalcSegApp(
1456 real64 arSr, // position of reduced velocity
1457 real64 arVr, // reduced velocity
1458 real64 arVb, // beginning velocity
1459 SINOSRampParam* apParam, // requested parameters
1460 CINOSRampSegTra*& apResult1,// result seg1
1461 CINOSRampSegCns*& apResult2,// result seg2
1462 CINOSRampSegTra*& apResult3,// result seg3
1463 uint32 auMoveInMove = 0
1464 );
1465 virtual void CalcSegDep(
1466 real64 arSr, // position of reduced velocity
1467 real64 arVr, // reduced velocity
1468 real64 arVe, // ending velocity
1469 SINOSRampParam* apParam, // requested parameters
1470 CINOSRampSegTra*& apResult1,// result seg1
1471 CINOSRampSegCns*& apResult2,// result seg2
1472 CINOSRampSegTra*& apResult3 // result seg3
1473 );
1474 //; calc transition segment
1475 CINOSRampSegCns* CalcSegCns(
1476 real64 arS, // requested length
1477 real64 arV, // requested velocity
1478 CINOSRampSegCns* aResult=0 // result
1479 );
1480 //; calc constant segment
1481 CINOSRampSegPos* CalcSegPos(
1482 real64 arS, // requested position
1483 real64 arT, // requested time
1484 CINOSRampSegPos* aResult=0 // result
1485 );
1486 //; calc position segment
1487 bool StartJob(CINOSRampJob* apJob);
1488 //; start apJob and return true if started
1489 bool ReleaseJob(CINOSRampJob* apJob);
1490 //; release job if its handled by me
1491 bool RestartJob();
1492 //; restart last given job return true if started
1493 CINOSRampJob* SwitchJob(CINOSRampJob* apJob, uint32 auNxtState,
1494 uint32 auBusTicks, bool bLookAhead = false);
1495 //; switch to apJob and return old job
1496 CINOSRampJob* GetActJob(bool abIncRefCounter = true);
1497 //; return pointer to actual job and increase job reference counter
1498 real64 RoundUpToCycleTime(real64 arTime);
1499 //; round arTime up to a multiple of cycletime
1500 real64 RoundToCycleTime(real64 arTime);
1501 //; round arTime to a multiple of cycletime
1502 uint64 RoundUpToBusTicks(real64 arTime);
1503 //; return number of bus ticks needed for arTime
1504 void SetBusTicksPerAxisTick(uint32 auBusTicksPerAxisTick)
1505 //; init target ticks calculation
1506 { m_uBusTicksPerAxisTick = auBusTicksPerAxisTick; };
1507
1508 real64 CalcVmax(real64 adS, SINOSRampParam* apParam);
1509 //; calc max. allowed V for S
1510 double _vx(double p, double s, SINOSRampParam* apParam);
1511 //; helper function for CalcVmax
1512 double _vy(double s, SINOSRampParam* apParam);
1513 //; helper function for CalcVmax
1514 double _vz(double s, SINOSRampParam* apParam);
1515 //; helper function for CalcVmax
1516
1517 bool IsGreater(real64 arA, real64 arB, bool bPos);
1518 //; return a > b sign dependent
1519
1520 bool Enter(uint32 auState, bool abEqual=true);
1521 //; enter critical section
1522 bool Exit(bool abExitCode);
1523 //; exit critical section
1524
1525 void SaveActParam(SINOSRampParam* apParam);
1526 //; save apParam in m_pActParam
1527
1528 bool Sign(real64& arValue)
1529 //; return true if sign bit set
1530 { return (*((uint64*)&arValue)&0x8000000000000000LL) ? true : false;};
1531
1533 void SetupTrqLimit(real64 arAmax, real64 arVmax, real64 arAtrq,
1534 real64 arVtrq, class CINCOTable* apPoints, SINOSBaseRampTrqLimit*& apLimit);
1536 void UpdatedMaximum(real64* apValue, real64 rOld, real64 rNew);
1538 void UpdateSlowMotion(real64 arFactor = REAL64(0.0));
1540 real64 GetRequestedJobSlowMotion(CINOSRampJob* apJob);
1541
1543 uint32 GetJobOptions(bool abPositive);
1545 uint32 GetJobOptions(real64 arSbgn, real64 arSend);
1546
1548 bool PrepareBacklash(bool abPositiveMoveDirection, real64& arBacklash);
1550 void AppendBacklash(CINOSRampJob* apJob, SINOSRampParam* apParam, real64 arBacklash);
1551
1552 #ifdef INOS_SAFETY_SUPPORT
1554 virtual void SetSafetyFunction(ESafetyFunction auFunction, real64 arLimit, uint32 auDelay,
1555 bool abUpdate);
1557 virtual void SetSafetyFunction(ESafetyFunction auFunction);
1559 virtual real64 CalcSlsLimit(real64 arSlsLimit);
1561 void SetSLSVmax(real64 arSLSVmax)
1562 { m_rSLSVmax = arSLSVmax; m_rSLSValue = arSLSVmax; m_eSLSType = eSLSReduceFixed; };
1563 #endif
1564
1565 #if defined(INOS_AXIS_EXTENSION_SUPPORT)
1567 void AddExtension(SINOSParamSetExtension* apExtension);
1569 void RemoveExtension(const char* apName);
1570
1572 SINOSParamSetExtension* GetParamSetExtension(uint32 auExtensionId)
1573 {
1574 // get pointer to actual selected param set
1575 SINOSRampParam* act = m_pActParam;
1576 // available ?
1577 if (0 == act) {
1578 // no -> use default
1579 act = m_pParam;
1580 }
1581 // locals
1582 SINOSParamSetExtension* ext = act->m_pExtension;
1583 // find given extension
1584 while (ext) {
1585 // check id
1586 if (ext->m_uId == auExtensionId) {
1587 // found
1588 return ext;
1589 }
1590 // next
1591 ext = ext->m_pNext;
1592 } // end while
1593
1594 // not available
1595 return 0;
1596 }
1597 #endif
1598
1599 // protected member functions
1600 protected:
1601 void iCoreMismatchError();
1602 //; set core mismatch axis error
1603 void iCoreMismatchWarning();
1604 //; set core mismatch axis warning
1605
1606 // protected members
1607 protected:
1608 uint32 m_uState;
1609 //; actual state
1610 uint32 m_uNxtState;
1611 //; next state
1612 uint32 m_uError;
1613 //; actual errors
1614 uint32 m_uWarning;
1615 //; actual warnings
1616 uint32 m_uFlag;
1617 //; actual flags
1618 uint32 m_uFlagEnb;
1619 //; actual flags enabled
1620 uint32 m_uFlagOld;
1621 //; actual flags at last move
1622 volatile uint32 m_uAlive;
1623 //; alive counter
1624 CINOSRampJob* m_pActJob;
1625 //; pointer to actual ramp job
1626 CINOSRampJob* m_pNxtJob;
1627 //; pointer to next ramp job
1628 CINOSRampJob* m_pBrkJob;
1629 //; pointer to paused ramp job
1630 CINOSRampJob* m_pSegJob;
1631 //; pointer to segmentation job
1632 CINOSRampSegPos* m_pSegPosLast;
1633 //; pointer to last added segpos segment
1634 CINOSRampCache* m_pCache;
1635 //; pointer to cache of jobs
1636 bool m_bCacheable;
1637 //; true if cache enabled
1638 bool m_bSetupModeOk;
1639 //; true if setup mode ok
1640 SINOSRampDataEx* m_pFstData;
1641 //; pointer to first ramp data structure in list
1642 SINOSRampDataEx* m_pLstData;
1643 //; pointer to last ramp data structure in list
1644 bool m_bDataValid;
1645 //; true if ramp data is valid
1646 SINOSBaseRamp* m_pDesc;
1647 //; pointer to object descriptor
1648 #ifndef INOS_RAMP_DLL
1649 CINCOObject* m_pRegister;
1650 //; pointer to inco registration
1651 CINCOObject* m_pCmd;
1652 //; pointer to inco registration of commanded values
1653 CINCOObject* m_pAct;
1654 //; pointer to inco registration of actual values
1655 CINCOObject* m_pMax;
1656 //; pointer to inco registration of max values
1657 CINCOObject* m_pProp;
1658 //; pointer to inco registration of properties
1659 CINCOObject* m_pError;
1660 //; pointer to inco registration of errors
1661 CINCOObject* m_pWarning;
1662 //; pointer to inco registration of warnings
1663 CINCOObject* m_pFlag;
1664 //; pointer to inco registration of flags
1665 CINCOObject* m_pFlagEnb;
1666 //; pointer to inco registration of flags enable
1667 uint32 m_uCharacteristics;
1668 //; inco registration characteristics
1669 uint8 m_uTypeChar;
1670 //; type character, e.g. 'T' for temperature
1671 #endif
1672 const char* m_pType;
1673 //; ramp type
1674 inosName32 m_cName;
1675 //; ramp name
1676 inosName m_cUnit;
1677 //; ramp unit
1678
1679 // cycle time
1680
1681 real64 m_rCycleTime;
1682 //; cycle time in sec
1683 real64 m_rCycleTimeOversampled;
1684 //; cycle time in sec inclusive oversampling factor
1685 real64 m_rCycleTime_1;
1686 //; 1/cycle time
1687 uint32 m_uCycleTimeUs;
1688 //; cycle time in us
1689 uint32 m_uCycleTimeNs;
1690 //; cycle time in ns
1691 uint8 m_uOversampling;
1692 //; oversampling factor
1693 real64 m_rMiMTol;
1694 //; move in move constant segment tolerance [sec]
1695 real64 m_rLastOvrs;
1696 //; last oversampled value
1697
1698 // commanded values
1699
1700 real64 m_rScmd;
1701 //; commanded position
1702 real64 m_rBemg;
1703 //; commanded emergency deceleration
1704 real64 m_rJemg;
1705 //; commanded emergency jerk (only valid before the deceleration phase)
1706 real64 m_rJeemg;
1707 //; commanded end emergency jerk (only valid before stop)
1708 real64 m_rPausedEnd;
1709 //; commanded end position at Break command (needed for Continue)
1710 SINOSRampParam* m_pParam;
1711 //; commanded acc,dec,vel,jerk
1712 SINOSRampParam* m_pActParam;
1713 //; commanded acc,dec,vel,jerk of actual running move
1714 SINOSRampParam* m_pStartParam;
1715 //; commanded acc,dec,vel,jerk at last startjob
1716 SINOSRampParam m_sSavParam;
1717 //; saved commanded acc,dec,vel,jerk of actual running move (this is
1718 //; only used if the given speed set pointed to stack memory of the
1719 //; calling task, if this is the case a copy is taken to avoid working
1720 //; with an invalid speedset pointer in later commands , e.g. Stop, ..)
1721 real64 m_rVpeak;
1722 //; peak velocity of current/last move
1723 real64 m_rApeak;
1724 //; peak acceleration of current/last move
1725 real64 m_rBpeak;
1726 //; peak deceleration of current/last move
1727
1728 // segmentation moves
1729
1730 real64 m_rSseg;
1731 //; requested position at end of actual segment
1732 real64 m_rVseg;
1733 //; requested velocity at end of actual segment
1734 real64 m_rAseg;
1735 //; requested velocity at end of actual segment
1736 ECalcMoveResult m_eSegMoveResult;
1737 //; result of last seg move
1738
1739 // actual values
1740
1741 real64 m_rAdjPos;
1742 //; actual requested position adjust
1743 SINOSRampDataEx* m_Act;
1744 //; actual values
1745 real64 m_rSbgn;
1746 //; position the actual/last move/endless was started from
1747
1748 // min./max. values
1749
1750 real64 m_rSmin;
1751 //; min. allowed position
1752 real64 m_rSmax;
1753 //; max. allowed position
1754 real64 m_rVmin;
1755 //; min. allowed velocity
1756 real64 m_rVmax;
1757 //; max. allowed velocity
1758 real64 m_rVmaxSetup;
1759 //; max. allowed velocity in setup mode
1760 real64 m_rVmaxInit;
1761 //; max. allowed velocity during initialization
1762 real64 m_rVmaxLimit;
1763 //; max. allowed velocity during pull (1.01*m_rVmax)
1764 real64 m_rVtrq;
1765 //; max. allowed velocity
1766 real64 m_rAmin;
1767 //; min. allowed acceleration
1768 real64 m_rAmax;
1769 //; max. allowed acceleration
1770 real64 m_rAmaxPull;
1771 //; max. allowed acceleration during pull
1772 real64 m_rArms;
1773 //; max. allowed rms acceleration
1774 real64 m_rAtrq;
1775 //; max. allowed acceleration
1776 real64 m_rBmin;
1777 //; min. allowed deceleration
1778 real64 m_rBmax;
1779 //; max. allowed deceleration
1780 real64 m_rBtrq;
1781 //; max. allowed deceleration
1782 real64 m_rCmin;
1783 //; min. allowed cruiseleration
1784 real64 m_rCmax;
1785 //; max. allowed cruiseleration
1786 real64 m_rJmin;
1787 //; min. allowed jerk
1788 real64 m_rJmax;
1789 //; max. allowed jerk
1790 real64 m_rEpsilon;
1791 //; calculation epsilon
1792
1793 // torque limitation
1794
1799
1800 uint64 m_uTickCount;
1801 //; bus tickcount at last ramp handle
1802 // target ticks calculation
1803 uint64 m_uTargetTicks;
1804 //; bus tickcount the actual move reaches the target
1805 uint64 m_uStartTicks;
1806 //; bus tickcount at target ticks calculation
1807 uint64 m_uStartTicks_;
1808 //; bus tickcount at target ticks calculation
1809 uint32 m_uBusTicksPerAxisTick;
1810 //; number of bus ticks per axis tick
1811 uint32 m_uNxtTicks;
1812 //; number of ticks the next job needs
1813 uint16 m_uIterCount;
1814 //; iteration counter
1815 uint16 m_uIterCountMax;
1816 //; max. ever reached iteration counter
1817 uint16 m_uStopAliveDelta;
1818 //; number of alive ticks during stop calculation
1819 uint16 m_uStopAliveDeltaMax;
1820 //; max. ever reached alive delta
1821 int16 m_iStoppingState;
1822 //; stopping state
1823 real64 m_rStoppingJerk;
1824
1826 CINOSRampSegTra* m_pStopLiveSeg;
1845
1846 // move safe
1847 bool m_bMoveSafeMin;
1848 //; actual move safe min valid
1849 real64 m_rMoveSafeMin;
1850 //; actual move safe min
1851 real64 m_rMoveSafeFact1;
1852 //; actual move safe factor for safe1
1853 real64 m_rMoveSafeFact2;
1854 //; actual move safe factor for safe2
1855
1856 // backlash
1857
1859 enum {
1860 eFlgBacklashCompensationRequired = 0x00000001,
1861 };
1868
1869 // safety
1870
1871 #ifdef INOS_SAFETY_SUPPORT
1873 enum ESLSType {
1874 eSLSReduceAbsolute = 0, // Vmax = m_rSafetyLimit - m_rSLSValue
1875 eSLSReducePercent = 1, // Vmax = m_rSafetyLimit * (100.0 - m_rSLSValue) / 100.0
1876 eSLSReduceFixed = 2, // Vmax = m_rSLSValue;
1877 };
1878 ESLSType m_eSLSType;
1880 real64 m_rSLSValue;
1882 real64 m_rSLSJerk;
1884 real64 m_rSLSVmax;
1885
1887 ESafetyFunction m_eSafetyFunction;
1889 uint8 m_uSafetyType;
1891 real64 m_rSafetyLimit;
1893 uint32 m_uSafetyDelay;
1894 #endif
1895
1896 // mapping
1897 CINOSMapping* m_pMapping;
1898 //; pointer to actual mapping
1899 uint32 m_uMappingIndex;
1900 //; index this axis has in the actual mapping
1901 static char m_cStateCombo[494];
1902 //; ramp state INCO item text. Use 494 (=defMaxDataLength). I fear
1903 //; to include inco_com.h here, that's why a plain number is used)
1904
1905 // timing
1906
1919
1920 // multi core
1921 uint8 m_uCoreId = DF_INOS_CORE_DEFAULT;
1922
1923 // allow dynamic object handling (new/delete)
1925};
1926
1927
1928//------------------------------------------------------------------------------
1929// class registration
1930//------------------------------------------------------------------------------
1931
1932typedef CINOSBaseRamp *(*TCreateRamp)(const char* apAxisName);
1933
1935{
1936 // after this function you can register new ramps
1937 friend void _INI_0000_CINOSBaseRamp();
1938
1939 //--- internals --------------------------------------------------------
1940
1941 // private members
1942private:
1943 // pointer to the first registered ramp
1944 static CINOSRegisterBaseRamp* m_pFirst;
1945 // pointer to the next ramp
1946 CINOSRegisterBaseRamp* m_pNext;
1947 // create funtion for the ramp
1948 TCreateRamp m_pCreate;
1949 // ramp type name
1950 const char* m_pType;
1951
1952 //--- user interface ---------------------------------------------------
1953
1954public:
1955 // register a new ramp type
1956 CINOSRegisterBaseRamp(TCreateRamp apFunction, const char* apRampType);
1957
1958 // create and return and new ramp instance
1959 static CINOSBaseRamp* GetRamp(const char* apType);
1960 // create and return and new ramp instance
1961 static CINOSBaseRamp* GetRamp(const char* apAxisName, const char* apType);
1962};
1963
1964//------------------------------------------------------------------------------
1965//--- helper macros ------------------------------------------------------------
1966//------------------------------------------------------------------------------
1967//
1968#if defined(INOS_MULTICORE)
1969#define INOS_RAMP_CORE_MISMATCH_IS_ERROR(ret) \
1970if ((m_uCoreId != DF_INOS_CORE_DEFAULT) && (::GetCoreId() != m_uCoreId)) { \
1971 if (!(GetFlag() & DF_INOS_BASE_RAMP_FLAG_IGNORE_CORE)) { \
1972 iCoreMismatchError(); \
1973 return ret; \
1974 } \
1975}
1976#define INOS_RAMP_CORE_MISMATCH_IS_WARNING(ret) \
1977if ((m_uCoreId != DF_INOS_CORE_DEFAULT) && (::GetCoreId() != m_uCoreId)) { \
1978 if (!(GetFlag() & DF_INOS_BASE_RAMP_FLAG_IGNORE_CORE)) { \
1979 iCoreMismatchWarning(); \
1980 return ret; \
1981 } \
1982}
1983#else
1984#define INOS_RAMP_CORE_MISMATCH_IS_ERROR(ret)
1985#define INOS_RAMP_CORE_MISMATCH_IS_WARNING(ret)
1986#endif
1987
1988//------------------------------------------------------------------------------
1989//--- fast math functions ------------------------------------------------------
1990//------------------------------------------------------------------------------
1991//
1992extern double inos_sqrt(double adValue);
1993//
1994//------------------------------------------------------------------------------
1995// end of file
1996//------------------------------------------------------------------------------
1997
1998#endif // INC_CINOSBASERAMP_H
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
Provides axis functionality.
Definition cinosbaseaxis.h:694
Definition cinosbaseramp.h:697
virtual CINCOObject * GetRegister(CINOSBaseRamp *apRamp)
return pointer to my inco object
Definition cinosbaseramp.h:752
real64 m_rBacklashSlowmotion
configured backlash slowmotion
Definition cinosbaseramp.h:1867
uint32 GetJobOptions(real64 arSbgn, real64 arSend)
get job options from given parameters
void SetTrqLimitAcceleration(SINOSBaseRampTrqLimit *apLimit)
set torque limit acceleration
Definition cinosbaseramp.h:1346
uint32 GetJobOptions(bool abPositive)
get job options from given parameters
void SetupTrqLimit(real64 arAmax, real64 arVmax, real64 arAtrq, real64 arVtrq, class CINCOTable *apPoints, SINOSBaseRampTrqLimit *&apLimit)
setup torque limit
uint32 m_uTimStopCalcAct
actual number of ticks used for CalcStop
Definition cinosbaseramp.h:1914
real64 m_rBacklash
configured backlash
Definition cinosbaseramp.h:1865
SINOSBaseRampTrqLimit * m_pTrqLimitAcc
torque limit points acceleration
Definition cinosbaseramp.h:1796
SINOSBaseRampTrqLimit * GetTrqLimitAcceleration()
get torque limit acceleration
Definition cinosbaseramp.h:1349
real64 m_rStopLiveDelta
current stop live delta
Definition cinosbaseramp.h:1842
SINOSBaseRampTrqLimit * GetTrqLimitDeceleration()
get torque limit deceleration
Definition cinosbaseramp.h:1355
real64 m_rStopLiveSlowMotion
current stop live slowmotion
Definition cinosbaseramp.h:1844
void UpdateTrqLimit()
update torque limit configuration
real64 m_rStopLiveSegV
current stop live tra seg V
Definition cinosbaseramp.h:1828
uint8 GetCoreId()
get core id the axis is running on
Definition cinosbaseramp.h:1364
SINOSBaseRampTrqLimit * m_pTrqLimitDec
torque limit points deceleration
Definition cinosbaseramp.h:1798
bool CheckPullUnderrun()
return true if pull would underrun
Definition cinosbaseramp.h:1328
void SetTrqLimitDeceleration(SINOSBaseRampTrqLimit *apLimit)
set torque limit deceleration
Definition cinosbaseramp.h:1352
bool PrepareBacklash(bool abPositiveMoveDirection, real64 &arBacklash)
prepare backlash compensation
real64 m_rStopLiveSegB
current stop live tra seg B
Definition cinosbaseramp.h:1830
void AppendBacklash(CINOSRampJob *apJob, SINOSRampParam *apParam, real64 arBacklash)
calculate backlash compensation
real64 m_rStopLiveSegJ2
current stop live tra seg J2
Definition cinosbaseramp.h:1832
uint32 m_uTimMoveCalcMax
maximal number of ticks used for CalcMove
Definition cinosbaseramp.h:1912
uint32 m_uTimMoveCalcMin
minimal number of ticks used for CalcMove
Definition cinosbaseramp.h:1910
uint32 m_uBacklashFlags
backlash flags
Definition cinosbaseramp.h:1863
real64 m_rStopLivePos
current stop live pos
Definition cinosbaseramp.h:1840
real64 m_rStopLiveSegJ3
current stop live tra seg J3
Definition cinosbaseramp.h:1834
uint32 m_uTimMoveCalcAct
actual number of ticks used for CalcMove
Definition cinosbaseramp.h:1908
real64 m_rStopLiveSegDelta
current stop live tra seg delta
Definition cinosbaseramp.h:1836
uint32 m_uTimStopCalcMin
minimal number of ticks used for CalcStop
Definition cinosbaseramp.h:1916
void UpdateSlowMotion(real64 arFactor=REAL64(0.0))
update job slowmotion if nessecary
void UpdatedMaximum(real64 *apValue, real64 rOld, real64 rNew)
called whenever a max value was changed
virtual SINOSTimeCharacteristics GetTimeCharacteristics(real64 arStartPosition, real64 arEndPosition, real64 arDelta, SINOSRampParam *apParam)
Calculate time characteristics of a move.
real64 GetRequestedJobSlowMotion(CINOSRampJob *apJob)
get requested job slowmotion
virtual SINOSTimeCharacteristics GetTimeCharacteristics(real64 arPosition, real64 arDelta, SINOSRampParam *apParam)
Calculate time characteristics of a move.
CINOSRampSegTra * m_pStopLiveSeg
current stop live tra seg
Definition cinosbaseramp.h:1826
uint32 m_uTimStopCalcMax
maximal number of ticks used for CalcStop
Definition cinosbaseramp.h:1918
real64 m_rStopLiveTime
current stop live time
Definition cinosbaseramp.h:1838
Definition cinosbus.h:565
Provides physical aka real axis functionality.
Definition cinosphysicalaxis.h:289
Definition cinosbaseramp.h:1935
#define DF_INOS_CORE_DEFAULT
Definition inosdefine.h:175
#define INOS_OR(variable, mask)
Definition inosmacro.h:201
#define INOS_AND(variable, mask)
Definition inosmacro.h:210
torque limitation point acceleration
Definition cinosbaseramp.h:651
torque limitation point deceleration
Definition cinosbaseramp.h:656
torque limitation point
Definition cinosbaseramp.h:636
real64 m_rA
acceleration
Definition cinosbaseramp.h:646
uint32 m_uNumber
point number
Definition cinosbaseramp.h:640
inosName32 m_cName
axis name
Definition cinosbaseramp.h:638
uint32 m_uDummy
alignment dummy
Definition cinosbaseramp.h:642
real64 m_rV
velocity
Definition cinosbaseramp.h:644
torque limitation
Definition cinosbaseramp.h:661
uint32 m_uNumber
number of points
Definition cinosbaseramp.h:663
real64 * m_rA
acceleration
Definition cinosbaseramp.h:669
uint32 m_uDummy
alignment dummy
Definition cinosbaseramp.h:665
SINOSBaseRampTrqLimit(const SINOSBaseRampTrqLimit &aLimit)
copy constructor
bool operator==(const SINOSBaseRampTrqLimit &b) const
equal operator
Definition cinosbaseramp.h:679
SINOSBaseRampTrqLimit(uint32 auNumber=0)
constructor
~SINOSBaseRampTrqLimit()
destructor
real64 * m_rV
velocity
Definition cinosbaseramp.h:667
Descriptor structure used to configure a ramp. It is usually defined in a corresponding xxx....
Definition cinosbaseramp.h:211
real64 m_rSLSValue
: SLS reduction value, see also http://doc.indel.ch/doku.php?id=software:embedded:inos:safety
Definition cinosbaseramp.h:414
real64 m_rAtrq
Maximal allowed torque acceleration [units/s^2]. This parameter is deprecated. One should work with t...
Definition cinosbaseramp.h:355
real64 m_rBmax
Maximal allowed deceleration [units/s].
Definition cinosbaseramp.h:363
real64 m_rJm2cmd
The default commanded middle2 jerk [units/s^3]. Used if one starts a move without any given speed set...
Definition cinosbaseramp.h:274
real64 m_rVmaxInit
Maximal allowed velocity [units/s] during initialisation.
Definition cinosbaseramp.h:322
real64 m_rJm1cmd
The default commanded middle1 jerk [units/s^3]. Used if one starts a move without any given speed set...
Definition cinosbaseramp.h:268
real64 m_rArms
Maximal allowed rms acceleration [units/s^2].
Definition cinosbaseramp.h:349
real64 m_rVcmd
The default commanded velocity [units]. Used if one starts a move without any given speed set.
Definition cinosbaseramp.h:235
real64 m_rJeemg
The end jerk [units/s^3] used in all emergency stop situations after the constant deceleration phase....
Definition cinosbaseramp.h:296
real64 m_rJbcmd
The default commanded begin jerk [units/s^3]. Used if one starts a move without any given speed set....
Definition cinosbaseramp.h:262
real64 m_rVmaxSetup
Maximal allowed velocity [units/s] in all setup modes.
Definition cinosbaseramp.h:318
real64 m_rBcmd
The default commanded deceleration [units/s^2]. Used if one starts a move without any given speed set...
Definition cinosbaseramp.h:245
uint8 m_uCacheSize
Internal moving cache size. Calculating a requested trajectory can be time consuming To reduce the us...
Definition cinosbaseramp.h:445
real64 m_rBmin
Minimal allowed deceleration [units/s].
Definition cinosbaseramp.h:359
uint8 m_uSLSType
: SLS reduction type, see also http://doc.indel.ch/doku.php?id=software:embedded:inos:safety
Definition cinosbaseramp.h:449
real64 m_rScmd
The default commanded position [units].
Definition cinosbaseramp.h:230
inosName m_cUnit
Axis unit, e.g. m, mm, deg, ... The string has no special meaning and is just for displaying purposes...
Definition cinosbaseramp.h:219
real64 m_rSmax
Maximal allowed position [units]. If m_rSmin and m_rSmax are both 0.0, the software limits are switch...
Definition cinosbaseramp.h:306
real64 m_rAmax
Maximal allowed acceleration [units/s^2].
Definition cinosbaseramp.h:336
real64 m_rJemg
The jerk [units/s^3] used in all emergency stop situations before the deceleration phase....
Definition cinosbaseramp.h:290
real64 m_rBemg
The deceleration [units/s^2] used in all emergency stop situations.
Definition cinosbaseramp.h:284
real64 m_rAmin
Minimal allowed acceleration [units/s].
Definition cinosbaseramp.h:332
real64 m_rCmin
Minimal allowed cruiseleration [units/s^2], see also m_rCcmd.
Definition cinosbaseramp.h:373
real64 m_rCycleTime
Axis cycletime the trajectory generator should work with [ms]. Do not configure this value in modern ...
Definition cinosbaseramp.h:226
real64 m_rJcmd
The default commanded jerk [units/s^3]. Used if one starts a move without any given speed set.
Definition cinosbaseramp.h:256
real64 m_rAmaxPull
Maximal allowed acceleration during pull [units/s^2] This value is also used to detect pull underruns...
Definition cinosbaseramp.h:345
real64 m_rVtrq
Maximal allowed torque velocity [units/s]. This parameter is deprecated. One should work with torque ...
Definition cinosbaseramp.h:328
real64 m_rAcmd
The default commanded acceleration [units/s]. Used if one starts a move without any given speed set.
Definition cinosbaseramp.h:240
real64 m_rJmin
Minimal allowed jerk [units/s^3].
Definition cinosbaseramp.h:381
uint32 m_uOptions
Ramp options, see DF_INOS_BASE_RAMP_OPT_CHK_LIMITS, DF_INOS_BASE_RAMP_OPT_ENB_BASE,...
Definition cinosbaseramp.h:434
real64 m_rCmax
Maximal allowed cruiseleration [units/s^2], see also m_rCcmd.
Definition cinosbaseramp.h:377
real64 m_rVmin
Minimal allowed velocity [units/s].
Definition cinosbaseramp.h:310
real64 m_rBacklashSlowmotion
: Backlash compensation slowmotion factor, see also m_rBacklash
Definition cinosbaseramp.h:410
real64 m_rMiMTol
Move in move constant speed tolerance [sec]. In 'Move in Move' situations the internal optimisation a...
Definition cinosbaseramp.h:395
real64 m_rJmax
Maximal allowed jerk [units/s^3].
Definition cinosbaseramp.h:385
uint8 m_uDigits
Number of digits to use in INCO explorer. This parameter has no functional meaning and has just displ...
Definition cinosbaseramp.h:439
real64 m_rVmax
Maximal allowed velocity [units/s].
Definition cinosbaseramp.h:314
real64 m_rBtrq
Maximal allowed torque deceleration [units/s^2]. This parameter is deprecated. One should work with t...
Definition cinosbaseramp.h:369
real64 m_rCcmd
The default commanded cruiseleration [units/s^2]. The cruiseleration is used in move in move or speed...
Definition cinosbaseramp.h:251
real64 m_rBacklash
If backlash compensation is enabled, see also DF_INOS_BASE_RAMP_OPT_BACKLASH this parameter defines t...
Definition cinosbaseramp.h:406
real64 m_rSmin
Minimal allowed position [units]. If m_rSmin and m_rSmax are both 0.0, the software limits are switch...
Definition cinosbaseramp.h:301
real64 m_rJecmd
The default commanded end jerk [units/s^3]. Used if one starts a move without any given speed set....
Definition cinosbaseramp.h:280
inosName64 m_cName
Axis name.
Definition cinosbaseramp.h:214
real64 m_rSLSJerk
: SLS jerk reduction value, see also http://doc.indel.ch/doku.php?id=software:embedded:inos:safety
Definition cinosbaseramp.h:418
extended ramp data
Definition cinosbaseramp.h:617
SINOSRampDataEx * m_pNext
pointer to next data object in chain
Definition cinosbaseramp.h:621
uint32 m_uFlags
structure flags
Definition cinosbaseramp.h:619
ramp data
Definition cinosbaseramp.h:602
real64 m_rJ
jerk
Definition cinosbaseramp.h:610
real64 m_rS
position
Definition cinosbaseramp.h:604
real64 m_rV
velocity
Definition cinosbaseramp.h:606
real64 m_rA
acceleration
Definition cinosbaseramp.h:608
ramp parameters
Definition cinosbaseramp.h:503
real64 m_rJCcmd
commanded cruise jerk
Definition cinosbaseramp.h:531
bool GetTemporary()
return true if structure is temporary
Definition cinosbaseramp.h:543
uint32 m_uFlags
additional flags
Definition cinosbaseramp.h:538
real64 m_rJcmd[4]
commanded jerks
Definition cinosbaseramp.h:529
real64 m_rSlow
Definition cinosbaseramp.h:536
void SetIgnoreCache()
ignore ramp cache
Definition cinosbaseramp.h:546
bool GetIgnoreCache()
returns true if ramp cache is ignored
Definition cinosbaseramp.h:552
void ClrIgnoreCache()
do not ignore ramp cache
Definition cinosbaseramp.h:549
real64 m_rVcmd
commanded velocity
Definition cinosbaseramp.h:521
DECLARE_DYNAMIC(SINOSRampParam)
dynamic object handling
real64 m_rAcmd
commanded acceleration
Definition cinosbaseramp.h:523
uint32 m_uDummy
8 bytes alignment dummy
Definition cinosbaseramp.h:556
void SetTemporary()
mark structure as temporary
Definition cinosbaseramp.h:540
real64 m_rBcmd
commanded deceleration
Definition cinosbaseramp.h:525
real64 m_rTime
time (RMS: relax time, P5: move time)
Definition cinosbaseramp.h:533
real64 m_rCcmd
commanded cruiseleration
Definition cinosbaseramp.h:527
time characteristics of a move
Definition cinosbaseramp.h:627