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