Velocity Closed Loop Dynamic error correction
Dependencies: mbed QEI PID DmTftLibraryEx
SWPos/SWPos.h@39:be7055a0e9a4, 2022-04-15 (annotated)
- Committer:
- lex9296
- Date:
- Fri Apr 15 07:01:02 2022 +0000
- Revision:
- 39:be7055a0e9a4
- Parent:
- 23:b9d23a2f390e
Retroazione di velocita e correzione
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lex9296 | 23:b9d23a2f390e | 1 | #include "mbed.h" |
lex9296 | 23:b9d23a2f390e | 2 | |
lex9296 | 23:b9d23a2f390e | 3 | struct in_sPosizionatoreSW { |
lex9296 | 23:b9d23a2f390e | 4 | bool b_AxisPowered; |
lex9296 | 23:b9d23a2f390e | 5 | bool b_ACPos_Homed; |
lex9296 | 39:be7055a0e9a4 | 6 | float f_Max_Speed; |
lex9296 | 39:be7055a0e9a4 | 7 | float f_ZeroSpeed; |
lex9296 | 23:b9d23a2f390e | 8 | |
lex9296 | 23:b9d23a2f390e | 9 | bool b_JogMode; |
lex9296 | 23:b9d23a2f390e | 10 | bool b_JogFW; |
lex9296 | 23:b9d23a2f390e | 11 | bool b_JogBW; |
lex9296 | 23:b9d23a2f390e | 12 | // |
lex9296 | 23:b9d23a2f390e | 13 | int32_t i32_JogAccel_ms; |
lex9296 | 23:b9d23a2f390e | 14 | int32_t i32_JogDecel_ms; |
lex9296 | 23:b9d23a2f390e | 15 | // |
lex9296 | 23:b9d23a2f390e | 16 | float f_JogSpeed_x100_FW; // in_rJogSpeed%_FW |
lex9296 | 23:b9d23a2f390e | 17 | float f_JogSpeed_x100_BW; // in_rJogSpeed%_BW |
lex9296 | 23:b9d23a2f390e | 18 | |
lex9296 | 23:b9d23a2f390e | 19 | bool b_ServoLock; |
lex9296 | 23:b9d23a2f390e | 20 | bool rtServoLock_Q; |
lex9296 | 23:b9d23a2f390e | 21 | // |
lex9296 | 23:b9d23a2f390e | 22 | int64_t i64_TargetPosition; |
lex9296 | 23:b9d23a2f390e | 23 | int64_t i64_ActualPosition; |
lex9296 | 23:b9d23a2f390e | 24 | int64_t i64_AccelerationWindow; |
lex9296 | 23:b9d23a2f390e | 25 | int64_t i64_DecelerationWindow; |
lex9296 | 23:b9d23a2f390e | 26 | int64_t i64_diToleranceWindow; |
lex9296 | 23:b9d23a2f390e | 27 | // |
lex9296 | 23:b9d23a2f390e | 28 | float f_ServoLockSpeed_x100_FW; // in_rServoLockSpeed%_FW |
lex9296 | 23:b9d23a2f390e | 29 | float f_ServoLockSpeed_x100_BW; // in_rServoLockSpeed%_BW |
lex9296 | 23:b9d23a2f390e | 30 | float f_MaximumSpeed_x100_FW; // LA: in_rMaximumSpeed%_FW |
lex9296 | 23:b9d23a2f390e | 31 | float f_MaximumSpeed_x100_BW; // LA: in_rMaximumSpeed%_BW |
lex9296 | 23:b9d23a2f390e | 32 | }; |
lex9296 | 23:b9d23a2f390e | 33 | |
lex9296 | 23:b9d23a2f390e | 34 | struct out_sPosizionatoreSW { |
lex9296 | 39:be7055a0e9a4 | 35 | int64_t i64_StartPosition; |
lex9296 | 39:be7055a0e9a4 | 36 | int64_t i64_Distance; |
lex9296 | 23:b9d23a2f390e | 37 | |
lex9296 | 39:be7055a0e9a4 | 38 | bool b_Accelerating; // LA: bACPos_Accelerating |
lex9296 | 39:be7055a0e9a4 | 39 | bool b_MaxSpeedReached; |
lex9296 | 23:b9d23a2f390e | 40 | // |
lex9296 | 39:be7055a0e9a4 | 41 | bool b_Decelerating; // bACPos_Decelerating |
lex9296 | 39:be7055a0e9a4 | 42 | bool b_InPosition; |
lex9296 | 39:be7055a0e9a4 | 43 | bool b_InToleranceFW; |
lex9296 | 39:be7055a0e9a4 | 44 | bool b_InToleranceBW; |
lex9296 | 23:b9d23a2f390e | 45 | |
lex9296 | 39:be7055a0e9a4 | 46 | float f_ATVSpeed; |
lex9296 | 39:be7055a0e9a4 | 47 | bool b_ATVDirectionFW; |
lex9296 | 39:be7055a0e9a4 | 48 | bool b_ATVDirectionBW; |
lex9296 | 23:b9d23a2f390e | 49 | // |
lex9296 | 39:be7055a0e9a4 | 50 | bool b_STW1_On; |
lex9296 | 39:be7055a0e9a4 | 51 | bool b_STW1_NoCStop; |
lex9296 | 39:be7055a0e9a4 | 52 | bool b_STW1_NoQStop; |
lex9296 | 39:be7055a0e9a4 | 53 | bool b_STW1_Enable; |
lex9296 | 23:b9d23a2f390e | 54 | |
lex9296 | 23:b9d23a2f390e | 55 | // LA: Disposizioni transitorie e finali |
lex9296 | 23:b9d23a2f390e | 56 | // |
lex9296 | 23:b9d23a2f390e | 57 | uint32_t ui32_PreviousStep_ms; |
lex9296 | 23:b9d23a2f390e | 58 | uint32_t ui32_ActualStepSampled_ms; |
lex9296 | 23:b9d23a2f390e | 59 | uint32_t ui32_PassedActual_ms; |
lex9296 | 23:b9d23a2f390e | 60 | }; |
lex9296 | 23:b9d23a2f390e | 61 | |
lex9296 | 23:b9d23a2f390e | 62 | void PosizionatoreSW (const in_sPosizionatoreSW &in, out_sPosizionatoreSW &out); |