From f5eec0c446ebe7952667143dc98f3be94c2a6186 Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Sun, 29 Jan 2017 17:00:51 +0200 Subject: New commutation sensor parameters --- simplemotion_defs.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/simplemotion_defs.h b/simplemotion_defs.h index ec3e2f7..026e538 100644 --- a/simplemotion_defs.h +++ b/simplemotion_defs.h @@ -352,6 +352,8 @@ #define SMP_SYSTEM_CONTROL_GET_SPECIAL_DATA 1024 //stores encoder index position in SMP_DEBUGPARAM_1. while busy (index not found) SMP_DEBUGPARAM_2 will be 100, after found it is 200. #define SMP_SYSTEM_CONTROL_CAPTURE_INDEX_POSITION 2048 + //start a procedure to automatically configure hall sensors direction & offset, or other absolute sensor capable of commutation + #define SMP_SYSTEM_CONTROL_START_COMMUTATION_SENSOR_AUTOSETUP 4096 //write SM bus SM_CRCINIT constant modifier. special purposes only, don't use if unsure because //it is one time programmable variable (permanently irreversible operation, can't be ever reset to default by provided methods) #define SMP_SYSTEM_CONTROL_MODIFY_CRCINIT 262144 @@ -429,7 +431,7 @@ #define FLAG_ALLOW_VOLTAGE_CLIPPING BV(10) #define FLAG_USE_INPUT_LP_FILTER BV(11) #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0/*obsolete*/ - #define FLAG_INVERTED_HALLS BV(13) + #define FLAG_INVERT_COMMUTATION_SENSOR_DIRECTION BV(13) /*inverts direction of commutation sensor instead, used together with SMP_COMMUTATION_SENSOR_OFFSET*//*originally was: invert hall sensors digital states*/ #define FLAG_USE_HALLS BV(14) #define FLAG_MECH_BRAKE_DURING_PHASING BV(15) #define FLAG_LIMIT_SWITCHES_NORMALLY_OPEN_TYPE BV(16) @@ -539,7 +541,9 @@ #define SMP_PHASESEARCH_VOLTAGE_SLOPE 480 //by default this is calculated from other motor params: #define SMP_PHASESEARCH_CURRENT 481 -//selector value 0-9 = 100 - 3300Hz (see Granity): +//commutation angle calibration, i.e. for hall sensors or absolute encoder. can be set with SMP_SYSTEM_CONTROL_START_COMMUTATION_SENSOR_AUTOSET +#define SMP_COMMUTATION_SENSOR_OFFSET 482 +//low pass filter selector, value 0=100Hz, 9=3300Hz, 10=4700Hz, 11=unlimited (see Granity for all options): #define SMP_TORQUE_LPF_BANDWIDTH 490 //motor rev to rotary/linear unit scale. like 5mm/rev or 0.1rev/rev. 30bit parameter & scale 100000=1.0 -- cgit v1.2.3 From ba6b2a32db48ccd6decfcdb3c42c92691915b32d Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Mon, 30 Jan 2017 01:01:52 +0200 Subject: Rename FLAG_USE_HALLS to FLAG_USE_COMMUTATION_SENSOR (backwards compatible change) --- simplemotion_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplemotion_defs.h b/simplemotion_defs.h index 026e538..0b1628b 100644 --- a/simplemotion_defs.h +++ b/simplemotion_defs.h @@ -432,7 +432,7 @@ #define FLAG_USE_INPUT_LP_FILTER BV(11) #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0/*obsolete*/ #define FLAG_INVERT_COMMUTATION_SENSOR_DIRECTION BV(13) /*inverts direction of commutation sensor instead, used together with SMP_COMMUTATION_SENSOR_OFFSET*//*originally was: invert hall sensors digital states*/ - #define FLAG_USE_HALLS BV(14) + #define FLAG_USE_COMMUTATION_SENSOR BV(14) #define FLAG_MECH_BRAKE_DURING_PHASING BV(15) #define FLAG_LIMIT_SWITCHES_NORMALLY_OPEN_TYPE BV(16) #define SMP_MOTION_FAULT_THRESHOLD 568 -- cgit v1.2.3 From fdec7c0e027b3e9f4c7fd977ee846291bb86617d Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Tue, 31 Jan 2017 21:52:16 +0200 Subject: Revert "Rename FLAG_USE_HALLS to FLAG_USE_COMMUTATION_SENSOR (backwards compatible change)" This reverts commit ba6b2a32db48ccd6decfcdb3c42c92691915b32d. --- simplemotion_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplemotion_defs.h b/simplemotion_defs.h index 0b1628b..026e538 100644 --- a/simplemotion_defs.h +++ b/simplemotion_defs.h @@ -432,7 +432,7 @@ #define FLAG_USE_INPUT_LP_FILTER BV(11) #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0/*obsolete*/ #define FLAG_INVERT_COMMUTATION_SENSOR_DIRECTION BV(13) /*inverts direction of commutation sensor instead, used together with SMP_COMMUTATION_SENSOR_OFFSET*//*originally was: invert hall sensors digital states*/ - #define FLAG_USE_COMMUTATION_SENSOR BV(14) + #define FLAG_USE_HALLS BV(14) #define FLAG_MECH_BRAKE_DURING_PHASING BV(15) #define FLAG_LIMIT_SWITCHES_NORMALLY_OPEN_TYPE BV(16) #define SMP_MOTION_FAULT_THRESHOLD 568 -- cgit v1.2.3 From 991845467391138bbb1200d76fc7a97f5a2f4cd5 Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Tue, 31 Jan 2017 23:13:57 +0200 Subject: Reverse some changes: keep original halls sensor flags intact, and instead use SMP_COMMUTATION_SENSOR_CONFIG for new FW and ignore hall sensor flags (these flags becoming obsolete) --- simplemotion_defs.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/simplemotion_defs.h b/simplemotion_defs.h index 026e538..51e4123 100644 --- a/simplemotion_defs.h +++ b/simplemotion_defs.h @@ -431,8 +431,8 @@ #define FLAG_ALLOW_VOLTAGE_CLIPPING BV(10) #define FLAG_USE_INPUT_LP_FILTER BV(11) #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0/*obsolete*/ - #define FLAG_INVERT_COMMUTATION_SENSOR_DIRECTION BV(13) /*inverts direction of commutation sensor instead, used together with SMP_COMMUTATION_SENSOR_OFFSET*//*originally was: invert hall sensors digital states*/ - #define FLAG_USE_HALLS BV(14) + //#define FLAG_INVERTED_HALLS BV(13) /*becoming obsolete, no effect on device where param SMP_COMMUTATION_SENSOR_CONFIG is present */ + //#define FLAG_USE_HALLS BV(14) /*becoming obsolete, no effect on device where param SMP_COMMUTATION_SENSOR_CONFIG is present */ #define FLAG_MECH_BRAKE_DURING_PHASING BV(15) #define FLAG_LIMIT_SWITCHES_NORMALLY_OPEN_TYPE BV(16) #define SMP_MOTION_FAULT_THRESHOLD 568 @@ -541,8 +541,17 @@ #define SMP_PHASESEARCH_VOLTAGE_SLOPE 480 //by default this is calculated from other motor params: #define SMP_PHASESEARCH_CURRENT 481 -//commutation angle calibration, i.e. for hall sensors or absolute encoder. can be set with SMP_SYSTEM_CONTROL_START_COMMUTATION_SENSOR_AUTOSET -#define SMP_COMMUTATION_SENSOR_OFFSET 482 +/* Commutation angle congiuration, i.e. for hall sensors or absolute encoder. can be automatically set with SMP_SYSTEM_CONTROL_START_COMMUTATION_SENSOR_AUTOSET. + * Format: + * bits 0-15 LSB: commutation sensor offset 0-65535 represents commutation angle offset 0-360 electical degrees + * bit 16: invert sensor count direction + * bit 17: enable commutation sensor + * bits 18-31: reserved, always 0 + */ +#define SMP_COMMUTATION_SENSOR_CONFIG 482 + #define SMP_COMMUTATION_SENSOR_CONFIG_ANGLE_MASK 0xFFFF + #define SMP_COMMUTATION_SENSOR_CONFIG_INVERT_MASK 0x10000 + #define SMP_COMMUTATION_SENSOR_CONFIG_ENABLE_MASK 0x20000 //low pass filter selector, value 0=100Hz, 9=3300Hz, 10=4700Hz, 11=unlimited (see Granity for all options): #define SMP_TORQUE_LPF_BANDWIDTH 490 -- cgit v1.2.3 From ed98f0292d7510141fdb754c249719f11efba3d9 Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Wed, 1 Feb 2017 14:03:08 +0200 Subject: Restore mistakenly commented-out definitions --- simplemotion_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simplemotion_defs.h b/simplemotion_defs.h index 51e4123..0a4e779 100644 --- a/simplemotion_defs.h +++ b/simplemotion_defs.h @@ -431,8 +431,8 @@ #define FLAG_ALLOW_VOLTAGE_CLIPPING BV(10) #define FLAG_USE_INPUT_LP_FILTER BV(11) #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0/*obsolete*/ - //#define FLAG_INVERTED_HALLS BV(13) /*becoming obsolete, no effect on device where param SMP_COMMUTATION_SENSOR_CONFIG is present */ - //#define FLAG_USE_HALLS BV(14) /*becoming obsolete, no effect on device where param SMP_COMMUTATION_SENSOR_CONFIG is present */ + #define FLAG_INVERTED_HALLS BV(13) /*becoming obsolete, no effect on device where param SMP_COMMUTATION_SENSOR_CONFIG is present */ + #define FLAG_USE_HALLS BV(14) /*becoming obsolete, no effect on device where param SMP_COMMUTATION_SENSOR_CONFIG is present */ #define FLAG_MECH_BRAKE_DURING_PHASING BV(15) #define FLAG_LIMIT_SWITCHES_NORMALLY_OPEN_TYPE BV(16) #define SMP_MOTION_FAULT_THRESHOLD 568 -- cgit v1.2.3