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 GetEmgJerk(real64& arJerk);
1037 //; get commanded emergency jerk
1038 virtual void SetCmdParam(SINOSRampParam* apParam)
1039 { *m_pParam = *apParam; };
1040 //; get pointer to commanded parameters
1041 virtual SINOSRampParam* GetCmdParam()
1042 { return m_pParam; };
1043 //; get pointer to commanded parameters
1044 ICACHE virtual void SetActPosition(real64 arPosition);
1045 //; set actual axis position
1046 ICACHE virtual void AdjActPosition(real64 arPosition);
1047 //; adjust actual axis position
1048 ICACHE virtual void GetActPosition(real64& arPosition);
1049 //; get actual axis position
1050 ICACHE virtual void GetActPosition(real64& arPosition, uint64 auTicks);
1051 //; get actual axis position
1052 virtual void GetStopPosition(real64& arPosition, SINOSRampParam* apParam);
1053 //; get axis position if we would stop a running move
1054 virtual void GetBgnPosition(real64& arPosition)
1055 { arPosition = m_rSbgn;};
1056 //; get position the actual/last move/endless was started from
1057 virtual void SetActVelocity(real64 arVelocity);
1058 //; set actual velocity
1059 virtual void GetActVelocity(real64& arVelocity);
1060 //; get actual velocity
1061 virtual void SetActAcceleration(real64 arAcceleration);
1062 //; set actual acceleration
1063 virtual void GetActAcceleration(real64& arAcceleration);
1064 //; get actual acceleration
1065 virtual void SetActJerk(real64 arJerk);
1066 //; set actual jerk
1067 virtual void GetActJerk(real64& arJerk);
1068 //; get actual jerk
1069 virtual void GetActSVAJ(SINOSRampData& arData, bool abIrqSafe = true);
1070 //; get all actuals
1071 virtual void AdjActTime(real64 arDelta);
1072 //; adjust actual move time
1073 virtual void SetMinPosition(real64 arPosition);
1074 //; set min. allowed position
1075 virtual void GetMinPosition(real64& apPosition) const;
1076 //; get min. allowed position
1077 virtual void SetMaxPosition(real64 arPosition);
1078 //; set max. allowed position
1079 virtual void GetMaxPosition(real64& arPosition) const;
1080 //; get max. allowed position
1081 virtual bool CheckPosition(real64& arPosition, bool abIgnoreMapping = false, SINOSRampParam* apParam = nullptr);
1082 //; return true if arPosition within the range or no range requested
1083 virtual void SetMaxVelocity(real64 arVelocity);
1084 //; set max. allowed velocity
1085 virtual void GetMaxVelocity(real64& arVelocity, uint32 auFlags = eMaxVelocityNone);
1086 //; get max. allowed velocity
1087 virtual void SetMaxSetupVelocity(real64 arVelocity);
1088 //; set max. allowed velocity in setup mode
1089 virtual void GetMaxSetupVelocity(real64& arVelocity);
1090 //; get max. allowed velocity in setup mode
1091 virtual void SetMaxInitVelocity(real64 arVelocity);
1092 //; set max. allowed velocity during initialization
1093 virtual void GetMaxInitVelocity(real64& arVelocity);
1094 //; get max. allowed velocity during initialization
1095 virtual void SetMinVelocity(real64 arVelocity);
1096 //; set min. allowed velocity
1097 virtual void GetMinVelocity(real64& arVelocity);
1098 //; get min. allowed velocity
1099 virtual void SetTrqVelocity(real64 arVelocity);
1100 //; set torque velocity
1101 virtual void GetTrqVelocity(real64& arVelocity);
1102 //; get torque velocity
1103 virtual void AdjustMinMaxValues (real64 arFactor);
1104 //; adjust min max values
1105 virtual void SetMinAcceleration(real64 arAcceleration);
1106 //; set min. allowed acceleration
1107 virtual void GetMinAcceleration(real64& arAcceleration);
1108 //; get min. allowed acceleration
1109 virtual void SetMaxAcceleration(real64 arAcceleration);
1110 //; set max. allowed acceleration
1111 virtual void GetMaxAcceleration(real64& arAcceleration);
1112 //; get max. allowed acceleration
1113 virtual void SetMaxAccelerationPull(real64 arAcceleration);
1114 //; set max. allowed acceleration during pull
1115 virtual void GetMaxAccelerationPull(real64& arAcceleration);
1116 //; get max. allowed acceleration during pull
1117 virtual void SetTrqAcceleration(real64 arAcceleration);
1118 //; set torque acceleration
1119 virtual void GetTrqAcceleration(real64& arAcceleration);
1120 //; get torque acceleration
1121 virtual void SetMinDeceleration(real64 arDeceleration);
1122 //; set min. allowed deceleration
1123 virtual void GetMinDeceleration(real64& arDeceleration);
1124 //; get min. allowed deceleration
1125 virtual void SetMaxDeceleration(real64 arDeceleration);
1126 //; set max. allowed deceleration
1127 virtual void GetMaxDeceleration(real64& arDeceleration);
1128 //; get max. allowed deceleration
1129 virtual void SetTrqDeceleration(real64 arDeceleration);
1130 //; set torque deceleration
1131 virtual void GetTrqDeceleration(real64& arDeceleration);
1132 //; get torque deceleration
1133 virtual void SetMinCruiseleration(real64 arCruiseleration);
1134 //; set min. allowed cruiseleration
1135 virtual void GetMinCruiseleration(real64& arCruiseleration);
1136 //; get min. allowed cruiseleration
1137 virtual void SetMaxCruiseleration(real64 arCruiseleration);
1138 //; set max. allowed cruiseleration
1139 virtual void GetMaxCruiseleration(real64& arCruiseleration);
1140 //; get max. allowed cruiseleration
1141 virtual void SetMinJerk(real64 arJerk);
1142 //; set min. allowed jerk
1143 virtual void GetMinJerk(real64& arJerk);
1144 //; get min. allowed jerk
1145 virtual void SetMaxJerk(real64 arJerk);
1146 //; set max. allowed jerk
1147 virtual void GetMaxJerk(real64& arJerk);
1148 //; get max. allowed jerk
1149
1150 virtual void GetCycleTime(real64& arCycleTime);
1151 //; get ramp cycle time
1152 virtual void SetCycleTime(real64 arCycleTime);
1153 //; set ramp cycle time
1154 virtual uint8 GetOversampling();
1155 //; get oversampling factor
1156 virtual void SetOversampling(uint8 auOversampling);
1157 //; set oversampling factor
1158 virtual void GetCycleTimeUs(uint32& auCycleTime)
1159 { auCycleTime = m_uCycleTimeUs;};
1160 //; get ramp cycle time
1161 virtual void GetCycleTimeNs(uint32& auCycleTime)
1162 { auCycleTime = m_uCycleTimeNs;};
1163 //; get ramp cycle time
1164 virtual const char* GetUnit();
1165 //; get ramping base unit (e.g. mm, deg, ...)
1166 virtual void SetUnit(const char* apUnit);
1167 //; get ramping base unit (e.g. mm, deg, ...)
1168 #ifndef INOS_RAMP_DLL
1169 virtual uint32 GetCharacteristics();
1170 //; get ramping base unit inco characteristics
1171 virtual void SetCharacteristics(uint32 auCharacteristics);
1172 //; get ramping base unit inco characteristics
1173 virtual uint8 GetTypeChar() {return m_uTypeChar;};
1174 //; get type character, e.g. 'T' for temperature ramp
1175 virtual void SetTypeChar(uint8 auTypeChar) {m_uTypeChar = auTypeChar;};
1176 //; set type character, e.g. 'T' for temperature ramp
1177 virtual uint32 GetParam(const char* apName, real64& arResult);
1178 //; universal get parameter with apName to arResult and return error code
1179 virtual volatile real64* GetParamAdr(const char* apName);
1180 //; universal get address of parameter with aName or NULL if not found
1181 virtual uint32 SetParam(const char* apName, real64 arValue);
1182 //; universal set parameter with apName to arValue and return error code
1183 #endif
1184
1185 void SetFlag(uint32 auFlag)
1186 { INOS_OR(m_uFlag, auFlag);};
1187 //; set ramp flags
1188 void ClrFlag(uint32 auFlag)
1189 { INOS_AND(m_uFlag, ~auFlag);};
1190 //; clear ramp flags
1191 uint32 GetFlag()
1192 { return m_uFlag & m_uFlagEnb;};
1193 //; get ramp flags
1194 void EnbFlag(uint32 auFlag)
1195 { INOS_OR(m_uFlagEnb, auFlag);};
1196 //; set ramp flags
1197 void DisFlag(uint32 auFlag)
1198 { INOS_AND(m_uFlagEnb, ~auFlag);};
1199
1200 ICACHE void SetState(uint32 auState)
1201 {
1202 // set new state
1203 m_uState = auState;
1204 // state peace ?
1205 if (m_uState == DF_INOS_RAMP_STATE_PEACE) {
1206 // yes -> clear also m_pActParam to prevent e.g.
1207 // following Pulls from inheriting speed set properties
1208 // like input shaping or others
1209 m_pActParam = nullptr;
1210 } // end if
1211 };
1212 //; set ramp state
1213 ICACHE uint32 GetState()
1214 { return m_uState;};
1215 //; get ramp state
1216 virtual uint32 GetError();
1217 //; get ramp error
1218 virtual uint64 GetErrorEx();
1219 //; get ramp error
1220 virtual uint32 GetWarning();
1221 //; get ramp warning
1222 virtual uint64 GetWarningEx();
1223 //; get ramp warning
1224 virtual void AcceptError(uint32 auError=0xffffffff);
1225 //; accept ramp error (auError=0xffffffff -> accept all errors)
1226 virtual void AcceptWarning(uint32 auWarning=0xffffffff);
1227 //; accept ramp warning (auWarning=0xffffffff -> accept all warnings)
1228
1229 ICACHE virtual void GetS(real64& arS);
1230 //; get actual S
1231 ICACHE virtual void GetSV(real64& arS, real64& arV);
1232 //; get actual S and V
1233 ICACHE virtual void GetSVA(real64& arS, real64& arV, real64& arA);
1234 //; get actual S, V and A
1235 ICACHE virtual void GetSVAJ(real64& arS, real64& arV, real64& arA, real64& arJ);
1236 //; get actual S, V, A and J
1237 ICACHE virtual SINOSRampDataEx* GetData();
1238 //; get actual S, V, A and J
1239 virtual void GetData (SINOSRampDataEx* apData, bool abSingleSample=false);
1240
1241 // param set functions
1242 #ifndef INOS_RAMP_DLL
1243 virtual CINOSBaseRampParamSet* CloneParamSet();
1244 //; return a copy of the actual param set
1245 virtual void SelectParamSet(CINOSBaseRampParamSet* apSet);
1246 //; set actual param set to apSet
1247 virtual void PreDestroyRampParam(SINOSRampParam* apParam);
1248 //; use this method to inform geni, that we're about to destroy a previously
1249 //; used speed set
1250 #endif
1251
1252 // caching functions
1253
1254 void EnableCache(uint32 auSize = 32);
1255 //; create moving cache with size auSize if nessecary and enable it
1256 CINOSRampCache* EnableCache(CINOSRampCache* apCache);
1257 //; set actual moving cache to apCache and return old one or 0
1258 CINOSRampCache* DisableCache();
1259 //; disable moving cache and return old one
1260 void ReEnableCache();
1261 //; Reenables a previously disabled ramp cache. This function is
1262 //; useful if the cache feature has temporarily been disabled
1263 //; before (DisableCache). Note: This function has no effect if
1264 //; the ramp does not yet owns a cache object. Also: It's safe
1265 //; to call this function while the cache is already enabled.
1266 void FlushCache();
1267 //; flush moving cache
1268 void SetEpsilon(real64 arEpsilon);
1269 //; set new internal 'epsilon' (standard is = 0.0)
1270 void GetEpsilon(real64& arEpsilon)
1271 {arEpsilon = m_rEpsilon;};
1272 //; get internal 'epsilon'
1273 void SetCacheEpsilon(real64 arEpsilon);
1274 //; set new cache 'epsilon' (standard is = 0.0)
1275
1276 // miscellaneous functions
1277
1278 virtual CINOSBaseRamp* Clone();
1279 //; clone myself and return pointer to it
1280 #ifndef INOS_RAMP_DLL
1281 SINOSBaseRamp* GetRampDesc()
1282 { return m_pDesc;};
1283 //; return pointer to my ramp descritpor
1284 virtual CINCOObject* GetRegister(const char* apName = "Ramp");
1285 //; return pointer to my inco object
1286 void RegisterFlags(CINCOObject* apParent, uint32* auBase);
1287 //; register flags, used for real flags and flags enable.
1288 virtual CINCOObject* GetParamSetRegister(CINOSBaseRampParamSet* apSet);
1289 //; create registration for apSet and return pointer to it
1290 static CINCOObject* GetBaseParamSetRegister(CINOSBaseRampParamSet* apSet);
1291 //; create registration for apSet and return pointer to it
1292 #endif
1293
1294 // safety move
1295
1296 virtual void SetMoveSafeMin(real64 arMin, real64 arFact1=REAL64(0.0),
1297 real64 arFact2=REAL64(0.0));
1298 //; set move safe minimum : arMin=requested minimum,
1299 //; safe1=safe1+arFact(MoveSafeMin-calcedMin), safe2=dito
1300 virtual void ResetMoveSafeMin();
1301 //; reset move safe minimum
1302
1303 // mapping
1304
1305 void SetMapping(CINOSMapping* apMapping, uint32 auIndex)
1306 { m_pMapping = apMapping; m_uMappingIndex = auIndex;};
1307 //; set actual axis mapping
1308 void ResetMapping()
1309 { m_pMapping = 0; m_uMappingIndex = 0;};
1310 //; reset actual axis mapping
1311
1312 // setup mode
1313
1314 void EnableSetupMode();
1315 //; enable setup mode
1316 void DisableSetupMode();
1317 //; disable setup mode
1318 bool CheckSetupMode();
1319 //; return true if setup mode active and fullfilled
1320
1323 {
1324 // locals
1325 real64 rAmax;
1326 // decide witch Amax to take
1327 if (m_rAmaxPull != REAL64(0.0))
1328 rAmax = m_rAmaxPull;
1329 else
1330 rAmax = m_rAmax;
1331 // max. allowed rest V = Amax * cycletime
1332 real64 rVzero = rAmax * m_rCycleTime;
1333 // underrun if no data and V!= 0.0
1334 return (m_pFstData == 0) && ((m_Act->m_rV > rVzero) || (m_Act->m_rV < -rVzero));
1335 }
1336
1337 // torque limitation
1338
1351
1354
1355 // multi core
1356
1359 { return m_uCoreId; };
1360
1361 //--- internals --------------------------------------------------------
1362
1363 friend class CINOSMapping;
1364 friend class CINOSShape;
1365 friend class CINOSBaseAxis;
1366 friend class CINOSPhysicalAxis;
1367 friend class CINOSBaseRampTest;
1368 friend class CINOSMcRobotCmdLinear;
1369 friend class CINOSRemoteControlWorker;
1370 friend void _INI_0400_CINOSBaseRamp();
1371
1372 // public member methods but just for internal use
1373 public :
1374 virtual const char* GetStateText();
1375 //; get pointer to actual state text
1376 virtual CINOSRampJob* iMove(real64 arSbgn, real64 arSend, bool abReturnError,
1377 SINOSRampParam* apParam);
1378 //; create a move job from arSbgn to arSend with apParam parameters
1379 virtual CINOSRampJob* iMove(real64 arPosition, real64 arSave1, real64 arSave2,
1380 real64& arTime, SINOSRampParam* apParam1, SINOSRampParam* apParam2);
1381 //; create a move job from arSbgn to arSend with apParam parameters
1382 virtual CINOSRampJob* iMoveApp(real64 arSbgn, real64 arSend, real64 arSvel,
1383 real64 arVelocity, bool abReturnError, SINOSRampParam* apParam, EMoveFlags aeFlags);
1384 //; create a move job from arSbgn to arSend with apParam parameters
1385 virtual CINOSRampJob* iMoveDep(real64 arSbgn, real64 arSend, real64 arSvel,
1386 real64 arVelocity, bool abReturnError, SINOSRampParam* apParam);
1387 //; create a move job from arSbgn to arSend with apParam parameters
1388 virtual SINOSRampParam* CheckParam(SINOSRampParam* apOrgParam,
1389 SINOSRampParam* apTmpParam);
1390 //; check OrgParam for limits, if OrgParam has to be adjusted, copy
1391 //; them to tmp param, return pointer to result
1392 virtual void CopyParam(SINOSRampParam* apDstParam, SINOSRampParam*& apSrcParam);
1393 //; copy src params to dst params
1394
1395 enum ECalcMoveResult {
1396 eClcMoveResOk = 0,
1397 eClcMoveResAdjusted = 1,
1398 eClcMoveResShrinked = 2,
1399 eClcMoveResFailed = 3,
1400 }; //; calc move result
1401
1402 virtual ECalcMoveResult CalcMove(real64 arSlen, SINOSRampParam* apParam, CINOSRampSegTra*& apSegAcc,
1403 CINOSRampSegCns*& apSegCns, CINOSRampSegTra*& apSegDec, real64 arVbgn = REAL64(0.0),
1404 real64 arVend = REAL64(0.0), real64 arAbgn = REAL64(0.0),
1405 real64 arAend = REAL64(0.0), real64 arDuration = REAL64(-1.0));
1406 //; calc acc, cns and dec segments for a move to arS and return true
1407 //; if requested V was adjusted
1408 virtual void CalcMoveApp(real64 arS, real64 arSred, real64 arVred,
1409 SINOSRampParam* apParam, CINOSRampSegTra*& apAcc, CINOSRampSegCns*& apCns,
1410 CINOSRampSegTra*& apDec1, CINOSRampSegCns*& apDec2, CINOSRampSegTra*& apDec3);
1411 //; calc acc, cns and dec segments for a moveapp to arS
1412 virtual void CalcMoveDep(real64 arS, real64 arSred, real64 arVred,
1413 SINOSRampParam* apParam, CINOSRampSegTra*& apAcc1, CINOSRampSegCns*& apAcc2,
1414 CINOSRampSegTra*& apAcc3, CINOSRampSegCns*& apCns, CINOSRampSegTra*& apDec);
1415 //; calc acc, cns and dec segments for a movedep to arS
1416 virtual bool CalcStop(uint32 auNxtState, SINOSRampParam* apParam, bool abEmergency=false);
1417 //; calc dec segment for a stop and return true if a calculation was done
1418 virtual bool CalcStopLive(uint32 auNxtState, SINOSRampParam* apParam, bool abEmergency=false);
1419 //; calc dec segment for a stop and return true if a calculation was done
1420 virtual bool CalcStop(real64 arS, uint32 auNxtState, SINOSRampParam* apParam, bool abEmergency=false);
1421 //; calc acc, cns and dec segments for a stop at arS and return true
1422 //; if a calculation was done
1423 virtual real64 CalcEscape(real64 arSlen, SINOSRampParam* apParam);
1424 //; ...
1425 virtual bool iCalcApp(real64 arS, real64 arSred, real64 arVred, SINOSRampParam* apParam);
1426 //; calc acc, cns and dec segments for a moveapp at arS and return true
1427 //; if a calculation was done
1428 virtual void iStopping();
1429 //; calc live stopping
1430
1431 enum ECalcSegTraType {
1432 eClcSegTraCompatible = 0,
1433 eClcSegTraAccelerate = 1,
1434 eClcSegTraDecelerate = 2,
1435 eClcSegTraMiddle = 3
1436 }; //; calc move result
1437
1438 virtual CINOSRampSegTra* CalcSegTra(
1439 real64 arVb, // starting velocity
1440 real64 arAb, // starting acceleration
1441 real64 arVe, // ending velocity
1442 SINOSRampParam* apParam, // requested parameters
1443 CINOSRampSegTra* apResult=0,// result
1444 real64 arJb=REAL64(-1.0), // requested begin jerk
1445 real64 arJe=REAL64(-1.0), // requested end jerk
1446 ECalcSegTraType aeType = eClcSegTraCompatible
1447 );
1448 //; calc transition segment
1449 virtual void CalcSegApp(
1450 real64 arSr, // position of reduced velocity
1451 real64 arVr, // reduced velocity
1452 real64 arVb, // beginning velocity
1453 SINOSRampParam* apParam, // requested parameters
1454 CINOSRampSegTra*& apResult1,// result seg1
1455 CINOSRampSegCns*& apResult2,// result seg2
1456 CINOSRampSegTra*& apResult3,// result seg3
1457 uint32 auMoveInMove = 0
1458 );
1459 virtual void CalcSegDep(
1460 real64 arSr, // position of reduced velocity
1461 real64 arVr, // reduced velocity
1462 real64 arVe, // ending velocity
1463 SINOSRampParam* apParam, // requested parameters
1464 CINOSRampSegTra*& apResult1,// result seg1
1465 CINOSRampSegCns*& apResult2,// result seg2
1466 CINOSRampSegTra*& apResult3 // result seg3
1467 );
1468 //; calc transition segment
1469 CINOSRampSegCns* CalcSegCns(
1470 real64 arS, // requested length
1471 real64 arV, // requested velocity
1472 CINOSRampSegCns* aResult=0 // result
1473 );
1474 //; calc constant segment
1475 CINOSRampSegPos* CalcSegPos(
1476 real64 arS, // requested position
1477 real64 arT, // requested time
1478 CINOSRampSegPos* aResult=0 // result
1479 );
1480 //; calc position segment
1481 bool StartJob(CINOSRampJob* apJob);
1482 //; start apJob and return true if started
1483 bool ReleaseJob(CINOSRampJob* apJob);
1484 //; release job if its handled by me
1485 bool RestartJob();
1486 //; restart last given job return true if started
1487 CINOSRampJob* SwitchJob(CINOSRampJob* apJob, uint32 auNxtState,
1488 uint32 auBusTicks, bool bLookAhead = false);
1489 //; switch to apJob and return old job
1490 CINOSRampJob* GetActJob(bool abIncRefCounter = true);
1491 //; return pointer to actual job and increase job reference counter
1492 real64 RoundUpToCycleTime(real64 arTime);
1493 //; round arTime up to a multiple of cycletime
1494 real64 RoundToCycleTime(real64 arTime);
1495 //; round arTime to a multiple of cycletime
1496 uint64 RoundUpToBusTicks(real64 arTime);
1497 //; return number of bus ticks needed for arTime
1498 void SetBusTicksPerAxisTick(uint32 auBusTicksPerAxisTick)
1499 //; init target ticks calculation
1500 { m_uBusTicksPerAxisTick = auBusTicksPerAxisTick; };
1501
1502 real64 CalcVmax(real64 adS, SINOSRampParam* apParam);
1503 //; calc max. allowed V for S
1504 double _vx(double p, double s, SINOSRampParam* apParam);
1505 //; helper function for CalcVmax
1506 double _vy(double s, SINOSRampParam* apParam);
1507 //; helper function for CalcVmax
1508 double _vz(double s, SINOSRampParam* apParam);
1509 //; helper function for CalcVmax
1510
1511 bool IsGreater(real64 arA, real64 arB, bool bPos);
1512 //; return a > b sign dependent
1513
1514 bool Enter(uint32 auState, bool abEqual=true);
1515 //; enter critical section
1516 bool Exit(bool abExitCode);
1517 //; exit critical section
1518
1519 void SaveActParam(SINOSRampParam* apParam);
1520 //; save apParam in m_pActParam
1521
1522 bool Sign(real64& arValue)
1523 //; return true if sign bit set
1524 { return (*((uint64*)&arValue)&0x8000000000000000LL) ? true : false;};
1525
1527 void SetupTrqLimit(real64 arAmax, real64 arVmax, real64 arAtrq,
1528 real64 arVtrq, class CINCOTable* apPoints, SINOSBaseRampTrqLimit*& apLimit);
1530 void UpdatedMaximum(real64* apValue, real64 rOld, real64 rNew);
1532 void UpdateSlowMotion(real64 arFactor = REAL64(0.0));
1534 real64 GetRequestedJobSlowMotion(CINOSRampJob* apJob);
1535
1537 uint32 GetJobOptions(bool abPositive);
1539 uint32 GetJobOptions(real64 arSbgn, real64 arSend);
1540
1542 bool PrepareBacklash(bool abPositiveMoveDirection, real64& arBacklash);
1544 void AppendBacklash(CINOSRampJob* apJob, SINOSRampParam* apParam, real64 arBacklash);
1545
1546 #ifdef INOS_SAFETY_SUPPORT
1548 virtual void SetSafetyFunction(ESafetyFunction auFunction, real64 arLimit, uint32 auDelay,
1549 bool abUpdate);
1551 virtual void SetSafetyFunction(ESafetyFunction auFunction);
1553 virtual real64 CalcSlsLimit(real64 arSlsLimit);
1555 void SetSLSVmax(real64 arSLSVmax)
1556 { m_rSLSVmax = arSLSVmax; m_rSLSValue = arSLSVmax; m_eSLSType = eSLSReduceFixed; };
1557 #endif
1558
1559 #if defined(INOS_AXIS_EXTENSION_SUPPORT)
1561 void AddExtension(SINOSParamSetExtension* apExtension);
1563 void RemoveExtension(const char* apName);
1564
1566 SINOSParamSetExtension* GetParamSetExtension(uint32 auExtensionId)
1567 {
1568 // get pointer to actual selected param set
1569 SINOSRampParam* act = m_pActParam;
1570 // available ?
1571 if (0 == act) {
1572 // no -> use default
1573 act = m_pParam;
1574 }
1575 // locals
1576 SINOSParamSetExtension* ext = act->m_pExtension;
1577 // find given extension
1578 while (ext) {
1579 // check id
1580 if (ext->m_uId == auExtensionId) {
1581 // found
1582 return ext;
1583 }
1584 // next
1585 ext = ext->m_pNext;
1586 } // end while
1587
1588 // not available
1589 return 0;
1590 }
1591 #endif
1592
1593 // protected member functions
1594 protected:
1595 void iCoreMismatchError();
1596 //; set core mismatch axis error
1597 void iCoreMismatchWarning();
1598 //; set core mismatch axis warning
1599
1600 // protected members
1601 protected:
1602 uint32 m_uState;
1603 //; actual state
1604 uint32 m_uNxtState;
1605 //; next state
1606 uint32 m_uError;
1607 //; actual errors
1608 uint32 m_uWarning;
1609 //; actual warnings
1610 uint32 m_uFlag;
1611 //; actual flags
1612 uint32 m_uFlagEnb;
1613 //; actual flags enabled
1614 uint32 m_uFlagOld;
1615 //; actual flags at last move
1616 volatile uint32 m_uAlive;
1617 //; alive counter
1618 CINOSRampJob* m_pActJob;
1619 //; pointer to actual ramp job
1620 CINOSRampJob* m_pNxtJob;
1621 //; pointer to next ramp job
1622 CINOSRampJob* m_pBrkJob;
1623 //; pointer to paused ramp job
1624 CINOSRampJob* m_pSegJob;
1625 //; pointer to segmentation job
1626 CINOSRampSegPos* m_pSegPosLast;
1627 //; pointer to last added segpos segment
1628 CINOSRampCache* m_pCache;
1629 //; pointer to cache of jobs
1630 bool m_bCacheable;
1631 //; true if cache enabled
1632 bool m_bSetupModeOk;
1633 //; true if setup mode ok
1634 SINOSRampDataEx* m_pFstData;
1635 //; pointer to first ramp data structure in list
1636 SINOSRampDataEx* m_pLstData;
1637 //; pointer to last ramp data structure in list
1638 bool m_bDataValid;
1639 //; true if ramp data is valid
1640 SINOSBaseRamp* m_pDesc;
1641 //; pointer to object descriptor
1642 #ifndef INOS_RAMP_DLL
1643 CINCOObject* m_pRegister;
1644 //; pointer to inco registration
1645 CINCOObject* m_pCmd;
1646 //; pointer to inco registration of commanded values
1647 CINCOObject* m_pAct;
1648 //; pointer to inco registration of actual values
1649 CINCOObject* m_pMax;
1650 //; pointer to inco registration of max values
1651 CINCOObject* m_pProp;
1652 //; pointer to inco registration of properties
1653 CINCOObject* m_pError;
1654 //; pointer to inco registration of errors
1655 CINCOObject* m_pWarning;
1656 //; pointer to inco registration of warnings
1657 CINCOObject* m_pFlag;
1658 //; pointer to inco registration of flags
1659 CINCOObject* m_pFlagEnb;
1660 //; pointer to inco registration of flags enable
1661 uint32 m_uCharacteristics;
1662 //; inco registration characteristics
1663 uint8 m_uTypeChar;
1664 //; type character, e.g. 'T' for temperature
1665 #endif
1666 const char* m_pType;
1667 //; ramp type
1668 inosName32 m_cName;
1669 //; ramp name
1670 inosName m_cUnit;
1671 //; ramp unit
1672
1673 // cycle time
1674
1675 real64 m_rCycleTime;
1676 //; cycle time in sec
1677 real64 m_rCycleTimeOversampled;
1678 //; cycle time in sec inclusive oversampling factor
1679 real64 m_rCycleTime_1;
1680 //; 1/cycle time
1681 uint32 m_uCycleTimeUs;
1682 //; cycle time in us
1683 uint32 m_uCycleTimeNs;
1684 //; cycle time in ns
1685 uint8 m_uOversampling;
1686 //; oversampling factor
1687 real64 m_rMiMTol;
1688 //; move in move constant segment tolerance [sec]
1689 real64 m_rLastOvrs;
1690 //; last oversampled value
1691
1692 // commanded values
1693
1694 real64 m_rScmd;
1695 //; commanded position
1696 real64 m_rBemg;
1697 //; commanded emergency deceleration
1698 real64 m_rJemg;
1699 //; commanded emergency jerk (only valid before the deceleration phase)
1700 real64 m_rJeemg;
1701 //; commanded end emergency jerk (only valid before stop)
1702 real64 m_rPausedEnd;
1703 //; commanded end position at Break command (needed for Continue)
1704 SINOSRampParam* m_pParam;
1705 //; commanded acc,dec,vel,jerk
1706 SINOSRampParam* m_pActParam;
1707 //; commanded acc,dec,vel,jerk of actual running move
1708 SINOSRampParam* m_pStartParam;
1709 //; commanded acc,dec,vel,jerk at last startjob
1710 SINOSRampParam m_sSavParam;
1711 //; saved commanded acc,dec,vel,jerk of actual running move (this is
1712 //; only used if the given speed set pointed to stack memory of the
1713 //; calling task, if this is the case a copy is taken to avoid working
1714 //; with an invalid speedset pointer in later commands , e.g. Stop, ..)
1715 real64 m_rVpeak;
1716 //; peak velocity of current/last move
1717 real64 m_rApeak;
1718 //; peak acceleration of current/last move
1719 real64 m_rBpeak;
1720 //; peak deceleration of current/last move
1721
1722 // segmentation moves
1723
1724 real64 m_rSseg;
1725 //; requested position at end of actual segment
1726 real64 m_rVseg;
1727 //; requested velocity at end of actual segment
1728 real64 m_rAseg;
1729 //; requested velocity at end of actual segment
1730 ECalcMoveResult m_eSegMoveResult;
1731 //; result of last seg move
1732
1733 // actual values
1734
1735 real64 m_rAdjPos;
1736 //; actual requested position adjust
1737 SINOSRampDataEx* m_Act;
1738 //; actual values
1739 real64 m_rSbgn;
1740 //; position the actual/last move/endless was started from
1741
1742 // min./max. values
1743
1744 real64 m_rSmin;
1745 //; min. allowed position
1746 real64 m_rSmax;
1747 //; max. allowed position
1748 real64 m_rVmin;
1749 //; min. allowed velocity
1750 real64 m_rVmax;
1751 //; max. allowed velocity
1752 real64 m_rVmaxSetup;
1753 //; max. allowed velocity in setup mode
1754 real64 m_rVmaxInit;
1755 //; max. allowed velocity during initialization
1756 real64 m_rVmaxLimit;
1757 //; max. allowed velocity during pull (1.01*m_rVmax)
1758 real64 m_rVtrq;
1759 //; max. allowed velocity
1760 real64 m_rAmin;
1761 //; min. allowed acceleration
1762 real64 m_rAmax;
1763 //; max. allowed acceleration
1764 real64 m_rAmaxPull;
1765 //; max. allowed acceleration during pull
1766 real64 m_rArms;
1767 //; max. allowed rms acceleration
1768 real64 m_rAtrq;
1769 //; max. allowed acceleration
1770 real64 m_rBmin;
1771 //; min. allowed deceleration
1772 real64 m_rBmax;
1773 //; max. allowed deceleration
1774 real64 m_rBtrq;
1775 //; max. allowed deceleration
1776 real64 m_rCmin;
1777 //; min. allowed cruiseleration
1778 real64 m_rCmax;
1779 //; max. allowed cruiseleration
1780 real64 m_rJmin;
1781 //; min. allowed jerk
1782 real64 m_rJmax;
1783 //; max. allowed jerk
1784 real64 m_rEpsilon;
1785 //; calculation epsilon
1786
1787 // torque limitation
1788
1793
1794 uint64 m_uTickCount;
1795 //; bus tickcount at last ramp handle
1796 // target ticks calculation
1797 uint64 m_uTargetTicks;
1798 //; bus tickcount the actual move reaches the target
1799 uint64 m_uStartTicks;
1800 //; bus tickcount at target ticks calculation
1801 uint64 m_uStartTicks_;
1802 //; bus tickcount at target ticks calculation
1803 uint32 m_uBusTicksPerAxisTick;
1804 //; number of bus ticks per axis tick
1805 uint32 m_uNxtTicks;
1806 //; number of ticks the next job needs
1807 uint16 m_uIterCount;
1808 //; iteration counter
1809 uint16 m_uIterCountMax;
1810 //; max. ever reached iteration counter
1811 uint16 m_uStopAliveDelta;
1812 //; number of alive ticks during stop calculation
1813 uint16 m_uStopAliveDeltaMax;
1814 //; max. ever reached alive delta
1815 int16 m_iStoppingState;
1816 //; stopping state
1817 real64 m_rStoppingJerk;
1818
1820 CINOSRampSegTra* m_pStopLiveSeg;
1839
1840 // move safe
1841 bool m_bMoveSafeMin;
1842 //; actual move safe min valid
1843 real64 m_rMoveSafeMin;
1844 //; actual move safe min
1845 real64 m_rMoveSafeFact1;
1846 //; actual move safe factor for safe1
1847 real64 m_rMoveSafeFact2;
1848 //; actual move safe factor for safe2
1849
1850 // backlash
1851
1853 enum {
1854 eFlgBacklashCompensationRequired = 0x00000001,
1855 };
1862
1863 // safety
1864
1865 #ifdef INOS_SAFETY_SUPPORT
1867 enum ESLSType {
1868 eSLSReduceAbsolute = 0, // Vmax = m_rSafetyLimit - m_rSLSValue
1869 eSLSReducePercent = 1, // Vmax = m_rSafetyLimit * (100.0 - m_rSLSValue) / 100.0
1870 eSLSReduceFixed = 2, // Vmax = m_rSLSValue;
1871 };
1872 ESLSType m_eSLSType;
1874 real64 m_rSLSValue;
1876 real64 m_rSLSJerk;
1878 real64 m_rSLSVmax;
1879
1881 ESafetyFunction m_eSafetyFunction;
1883 uint8 m_uSafetyType;
1885 real64 m_rSafetyLimit;
1887 uint32 m_uSafetyDelay;
1888 #endif
1889
1890 // mapping
1891 CINOSMapping* m_pMapping;
1892 //; pointer to actual mapping
1893 uint32 m_uMappingIndex;
1894 //; index this axis has in the actual mapping
1895 static char m_cStateCombo[494];
1896 //; ramp state INCO item text. Use 494 (=defMaxDataLength). I fear
1897 //; to include inco_com.h here, that's why a plain number is used)
1898
1899 // timing
1900
1913
1914 // multi core
1915 uint8 m_uCoreId = DF_INOS_CORE_DEFAULT;
1916
1917 // allow dynamic object handling (new/delete)
1919};
1920
1921
1922//------------------------------------------------------------------------------
1923// class registration
1924//------------------------------------------------------------------------------
1925
1926typedef CINOSBaseRamp *(*TCreateRamp)(const char* apAxisName);
1927
1929{
1930 // after this function you can register new ramps
1931 friend void _INI_0000_CINOSBaseRamp();
1932
1933 //--- internals --------------------------------------------------------
1934
1935 // private members
1936private:
1937 // pointer to the first registered ramp
1938 static CINOSRegisterBaseRamp* m_pFirst;
1939 // pointer to the next ramp
1940 CINOSRegisterBaseRamp* m_pNext;
1941 // create funtion for the ramp
1942 TCreateRamp m_pCreate;
1943 // ramp type name
1944 const char* m_pType;
1945
1946 //--- user interface ---------------------------------------------------
1947
1948public:
1949 // register a new ramp type
1950 CINOSRegisterBaseRamp(TCreateRamp apFunction, const char* apRampType);
1951
1952 // create and return and new ramp instance
1953 static CINOSBaseRamp* GetRamp(const char* apType);
1954 // create and return and new ramp instance
1955 static CINOSBaseRamp* GetRamp(const char* apAxisName, const char* apType);
1956};
1957
1958//------------------------------------------------------------------------------
1959//--- helper macros ------------------------------------------------------------
1960//------------------------------------------------------------------------------
1961//
1962#if defined(INOS_MULTICORE)
1963#define INOS_RAMP_CORE_MISMATCH_IS_ERROR(ret) \
1964if ((m_uCoreId != DF_INOS_CORE_DEFAULT) && (::GetCoreId() != m_uCoreId)) { \
1965 if (!(GetFlag() & DF_INOS_BASE_RAMP_FLAG_IGNORE_CORE)) { \
1966 iCoreMismatchError(); \
1967 return ret; \
1968 } \
1969}
1970#define INOS_RAMP_CORE_MISMATCH_IS_WARNING(ret) \
1971if ((m_uCoreId != DF_INOS_CORE_DEFAULT) && (::GetCoreId() != m_uCoreId)) { \
1972 if (!(GetFlag() & DF_INOS_BASE_RAMP_FLAG_IGNORE_CORE)) { \
1973 iCoreMismatchWarning(); \
1974 return ret; \
1975 } \
1976}
1977#else
1978#define INOS_RAMP_CORE_MISMATCH_IS_ERROR(ret)
1979#define INOS_RAMP_CORE_MISMATCH_IS_WARNING(ret)
1980#endif
1981
1982//------------------------------------------------------------------------------
1983//--- fast math functions ------------------------------------------------------
1984//------------------------------------------------------------------------------
1985//
1986extern double inos_sqrt(double adValue);
1987//
1988//------------------------------------------------------------------------------
1989// end of file
1990//------------------------------------------------------------------------------
1991
1992#endif // INC_CINOSBASERAMP_H
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
Provides axis functionality.
Definition cinosbaseaxis.h:676
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:1861
uint32 GetJobOptions(real64 arSbgn, real64 arSend)
get job options from given parameters
void SetTrqLimitAcceleration(SINOSBaseRampTrqLimit *apLimit)
set torque limit acceleration
Definition cinosbaseramp.h:1340
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:1908
real64 m_rBacklash
configured backlash
Definition cinosbaseramp.h:1859
SINOSBaseRampTrqLimit * m_pTrqLimitAcc
torque limit points acceleration
Definition cinosbaseramp.h:1790
SINOSBaseRampTrqLimit * GetTrqLimitAcceleration()
get torque limit acceleration
Definition cinosbaseramp.h:1343
real64 m_rStopLiveDelta
current stop live delta
Definition cinosbaseramp.h:1836
SINOSBaseRampTrqLimit * GetTrqLimitDeceleration()
get torque limit deceleration
Definition cinosbaseramp.h:1349
real64 m_rStopLiveSlowMotion
current stop live slowmotion
Definition cinosbaseramp.h:1838
void UpdateTrqLimit()
update torque limit configuration
real64 m_rStopLiveSegV
current stop live tra seg V
Definition cinosbaseramp.h:1822
uint8 GetCoreId()
get core id the axis is running on
Definition cinosbaseramp.h:1358
SINOSBaseRampTrqLimit * m_pTrqLimitDec
torque limit points deceleration
Definition cinosbaseramp.h:1792
bool CheckPullUnderrun()
return true if pull would underrun
Definition cinosbaseramp.h:1322
void SetTrqLimitDeceleration(SINOSBaseRampTrqLimit *apLimit)
set torque limit deceleration
Definition cinosbaseramp.h:1346
bool PrepareBacklash(bool abPositiveMoveDirection, real64 &arBacklash)
prepare backlash compensation
real64 m_rStopLiveSegB
current stop live tra seg B
Definition cinosbaseramp.h:1824
void AppendBacklash(CINOSRampJob *apJob, SINOSRampParam *apParam, real64 arBacklash)
calculate backlash compensation
real64 m_rStopLiveSegJ2
current stop live tra seg J2
Definition cinosbaseramp.h:1826
uint32 m_uTimMoveCalcMax
maximal number of ticks used for CalcMove
Definition cinosbaseramp.h:1906
uint32 m_uTimMoveCalcMin
minimal number of ticks used for CalcMove
Definition cinosbaseramp.h:1904
uint32 m_uBacklashFlags
backlash flags
Definition cinosbaseramp.h:1857
real64 m_rStopLivePos
current stop live pos
Definition cinosbaseramp.h:1834
real64 m_rStopLiveSegJ3
current stop live tra seg J3
Definition cinosbaseramp.h:1828
uint32 m_uTimMoveCalcAct
actual number of ticks used for CalcMove
Definition cinosbaseramp.h:1902
real64 m_rStopLiveSegDelta
current stop live tra seg delta
Definition cinosbaseramp.h:1830
uint32 m_uTimStopCalcMin
minimal number of ticks used for CalcStop
Definition cinosbaseramp.h:1910
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:1820
uint32 m_uTimStopCalcMax
maximal number of ticks used for CalcStop
Definition cinosbaseramp.h:1912
real64 m_rStopLiveTime
current stop live time
Definition cinosbaseramp.h:1832
Definition cinosbus.h:600
Definition cinosmcrobot.h:2434
Provides physical aka real axis functionality.
Definition cinosphysicalaxis.h:286
Definition cinosbaseramp.h:1929
#define DF_INOS_CORE_DEFAULT
Definition inosdefine.h:170
#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