Expansion SW library to control high power stepper motor(s) using IHM03A1 expansion board(s) with Powerstep01 driver.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: IHM03A1_ExampleFor1Motor HelloWorld_IHM03A1 IHM03A1_ExampleFor3Motors KYPHOS_Stepper_Motor_Control
Fork of X_NUCLEO_IHM03A1 by
PowerStep01_config.h
00001 /** 00002 ****************************************************************************** 00003 * @file PowerStep01_config.h 00004 * @author IPC Rennes 00005 * @version V1.2.0 00006 * @date March 18th, 2016 00007 * @brief Predefines values for the Powerstep01 registers 00008 * and for the devices parameters 00009 * @note (C) COPYRIGHT 2016 STMicroelectronics 00010 ****************************************************************************** 00011 * @attention 00012 * 00013 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> 00014 * 00015 * Redistribution and use in source and binary forms, with or without modification, 00016 * are permitted provided that the following conditions are met: 00017 * 1. Redistributions of source code must retain the above copyright notice, 00018 * this list of conditions and the following disclaimer. 00019 * 2. Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00023 * may be used to endorse or promote products derived from this software 00024 * without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00027 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00029 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00030 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00031 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00032 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00033 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00034 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00035 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 * 00037 ****************************************************************************** 00038 */ 00039 00040 00041 /* Define to prevent recursive inclusion -------------------------------------*/ 00042 00043 #ifndef __POWERSTEP01_CONFIG_H 00044 #define __POWERSTEP01_CONFIG_H 00045 00046 #ifdef __cplusplus 00047 extern "C" { 00048 #endif 00049 00050 /* Definitions ---------------------------------------------------------------*/ 00051 00052 /** @addtogroup PowerStep01 00053 * @{ 00054 */ 00055 00056 /** @addtogroup Powerstep01_Exported_Defines 00057 * @{ 00058 */ 00059 00060 /** @defgroup Predefined_Powerstep01_Registers_Values Predefined Powerstep01 Registers Values 00061 * @{ 00062 */ 00063 00064 /// The maximum number of devices in the daisy chain 00065 #define MAX_NUMBER_OF_DEVICES (3) 00066 00067 /****************************************************************************/ 00068 /* Device 0 */ 00069 /****************************************************************************/ 00070 00071 /**************************** Speed Profile *********************************/ 00072 /// Register : ACC 00073 /// Acceleration rate in step/s2, range 14.55 to 59590 steps/s^2 00074 #define POWERSTEP01_CONF_PARAM_ACC_DEVICE_0 (582) 00075 00076 /// Register : DEC 00077 /// Deceleration rate in step/s2, range 14.55 to 59590 steps/s^2 00078 #define POWERSTEP01_CONF_PARAM_DEC_DEVICE_0 (582) 00079 00080 ///Register : MAX_SPEED 00081 /// Maximum speed in step/s, range 15.25 to 15610 steps/s 00082 #define POWERSTEP01_CONF_PARAM_MAX_SPEED_DEVICE_0 (488) 00083 00084 /// Register : MIN_SPEED 00085 /// Minimum speed in step/s, range 0 to 976.3 steps/s 00086 #define POWERSTEP01_CONF_PARAM_MIN_SPEED_DEVICE_0 (0) 00087 00088 /// Register : FS_SPD 00089 /// Full step speed in step/s, range 7.63 to 15625 steps/s 00090 #define POWERSTEP01_CONF_PARAM_FS_SPD_DEVICE_0 (244.16) 00091 00092 /// Register : FS_SPD - field : BOOST_MODE 00093 /// Boost of the amplitude square wave, enum powerstep01_BoostMode_t 00094 #define POWERSTEP01_CONF_PARAM_BOOST_MODE_DEVICE_0 (POWERSTEP01_BOOST_MODE_OFF) 00095 00096 00097 /************************ Voltage mode parameters **************************/ 00098 /// Register : KVAL_ACC 00099 /// Acceleration duty cycle (torque) in %, range 0 to 99.6% 00100 #define POWERSTEP01_CONF_PARAM_KVAL_ACC_DEVICE_0 (16.02) 00101 00102 /// Register : KVAL_DEC 00103 /// Deceleration duty cycle (torque) in %, range 0 to 99.6% 00104 #define POWERSTEP01_CONF_PARAM_KVAL_DEC_DEVICE_0 (16.02) 00105 00106 /// Register : KVAL_RUN 00107 /// run duty cycle (torque) in %, range 0 to 99.6% 00108 #define POWERSTEP01_CONF_PARAM_KVAL_RUN_DEVICE_0 (16.02) 00109 00110 /// Register : KVAL_HOLD 00111 /// Hold duty cycle (torque) in %, range 0 to 99.6% 00112 #define POWERSTEP01_CONF_PARAM_KVAL_HOLD_DEVICE_0 (16.02) 00113 00114 /// Register : CONFIG - field : EN_VSCOMP 00115 /// Motor Supply Voltage Compensation enabling , enum powerstep01_ConfigEnVscomp_t 00116 #define POWERSTEP01_CONF_PARAM_VS_COMP_DEVICE_0 (POWERSTEP01_CONFIG_VS_COMP_DISABLE) 00117 00118 /// Register : MIN_SPEED - field : LSPD_OPT 00119 /// Low speed optimization bit, enum powerstep01_LspdOpt_t 00120 #define POWERSTEP01_CONF_PARAM_LSPD_BIT_DEVICE_0 (POWERSTEP01_LSPD_OPT_OFF) 00121 00122 /// Register : K_THERM 00123 /// Thermal compensation param, range 1 to 1.46875 00124 #define POWERSTEP01_CONF_PARAM_K_THERM_DEVICE_0 (1) 00125 00126 /// Register : INT_SPEED 00127 /// Intersect speed settings for BEMF compensation in steps/s, range 0 to 3906 steps/s 00128 #define POWERSTEP01_CONF_PARAM_INT_SPD_DEVICE_0 (61.512) 00129 00130 /// Register : ST_SLP 00131 /// BEMF start slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00132 #define POWERSTEP01_CONF_PARAM_ST_SLP_DEVICE_0 (0.03815) 00133 00134 /// Register : FN_SLP_ACC 00135 /// BEMF final acc slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00136 #define POWERSTEP01_CONF_PARAM_FN_SLP_ACC_DEVICE_0 (0.06256) 00137 00138 /// Register : FN_SLP_DEC 00139 /// BEMF final dec slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00140 #define POWERSTEP01_CONF_PARAM_FN_SLP_DEC_DEVICE_0 (0.06256) 00141 00142 /// Register : CONFIG - field : F_PWM_INT 00143 /// PWM Frequency Integer division, enum powerstep01_ConfigFPwmInt_t 00144 #define POWERSTEP01_CONF_PARAM_PWM_DIV_DEVICE_0 (POWERSTEP01_CONFIG_PWM_DIV_2) 00145 00146 /// Register : CONFIG - field : F_PWM_DEC 00147 /// PWM Frequency Integer Multiplier, enum powerstep01_ConfigFPwmDec_t 00148 #define POWERSTEP01_CONF_PARAM_PWM_MUL_DEVICE_0 (POWERSTEP01_CONFIG_PWM_MUL_1) 00149 00150 /******************** Advance current control parameters *********************/ 00151 00152 /// Register : TVAL_ACC 00153 /// Acceleration torque in mV, range from 7.8mV to 1000 mV 00154 #define POWERSTEP01_CONF_PARAM_TVAL_ACC_DEVICE_0 (328.12) 00155 00156 /// Register : TVAL_DEC 00157 /// Deceleration torque in mV, range from 7.8mV to 1000 mV 00158 #define POWERSTEP01_CONF_PARAM_TVAL_DEC_DEVICE_0 (328.12) 00159 00160 /// Register : TVAL_RUN 00161 /// Running torque in mV, range from 7.8mV to 1000 mV 00162 #define POWERSTEP01_CONF_PARAM_TVAL_RUN_DEVICE_0 (328.12) 00163 00164 /// Register : TVAL_HOLD 00165 /// Holding torque in mV, range from 7.8mV to 1000 mV 00166 #define POWERSTEP01_CONF_PARAM_TVAL_HOLD_DEVICE_0 (328.12) 00167 00168 /// Register : CONFIG - field : EN_TQREG 00169 /// External torque regulation enabling , enum powerstep01_ConfigEnTqReg_t 00170 #define POWERSTEP01_CONF_PARAM_TQ_REG_DEVICE_0 (POWERSTEP01_CONFIG_TQ_REG_TVAL_USED) 00171 00172 /// Register : CONFIG - field : PRED_EN 00173 /// Predictive current enabling , enum powerstep01_ConfigPredEn_t 00174 #define POWERSTEP01_CONF_PARAM_PRED_DEVICE_0 (POWERSTEP01_CONFIG_PRED_DISABLE) 00175 00176 /// Register : TON_MIN 00177 /// Minimum on-time in us, range 0.5us to 64us 00178 #define POWERSTEP01_CONF_PARAM_TON_MIN_DEVICE_0 (3.0) 00179 00180 /// Register : TOFF_MIN 00181 /// Minimum off-time in us, range 0.5us to 64us 00182 #define POWERSTEP01_CONF_PARAM_TOFF_MIN_DEVICE_0 (21.0) 00183 00184 /// Register : T_FAST - field: TOFF_FAST 00185 /// Maximum fast decay time , enum powerstep01_ToffFast_t 00186 #define POWERSTEP01_CONF_PARAM_TOFF_FAST_DEVICE_0 (POWERSTEP01_TOFF_FAST_8us) 00187 00188 /// Register : T_FAST - field: FAST_STEP 00189 /// Maximum fall step time , enum powerstep01_FastStep_t 00190 #define POWERSTEP01_CONF_PARAM_FAST_STEP_DEVICE_0 (POWERSTEP01_FAST_STEP_12us) 00191 00192 /// Register : CONFIG - field : TSW 00193 /// Switching period, enum powerstep01_ConfigTsw_t 00194 #define POWERSTEP01_CONF_PARAM_TSW_DEVICE_0 (POWERSTEP01_CONFIG_TSW_048us) 00195 00196 /****************************** Gate Driving **********************************/ 00197 00198 /// Register : GATECFG1 - field : IGATE 00199 /// Gate sink/source current via enum powerstep01_Igate_t 00200 #define POWERSTEP01_CONF_PARAM_IGATE_DEVICE_0 (POWERSTEP01_IGATE_64mA) 00201 00202 /// Register : CONFIG - field : VCCVAL 00203 /// VCC Val, enum powerstep01_ConfigVccVal_t 00204 #define POWERSTEP01_CONF_PARAM_VCCVAL_DEVICE_0 (POWERSTEP01_CONFIG_VCCVAL_15V) 00205 00206 /// Register : CONFIG - field : UVLOVAL 00207 /// UVLO Threshold via powerstep01_ConfigUvLoVal_t 00208 #define POWERSTEP01_CONF_PARAM_UVLOVAL_DEVICE_0 (POWERSTEP01_CONFIG_UVLOVAL_LOW) 00209 00210 /// Register : GATECFG1 - field : TBOOST 00211 /// Duration of the overboost phase during gate turn-off via enum powerstep01_Tboost_t 00212 #define POWERSTEP01_CONF_PARAM_TBOOST_DEVICE_0 (POWERSTEP01_TBOOST_0ns) 00213 00214 /// Register : GATECFG1 - field : TCC 00215 /// Controlled current time via enum powerstep01_Tcc_t 00216 #define POWERSTEP01_CONF_PARAM_TCC_DEVICE_0 (POWERSTEP01_TCC_500ns) 00217 00218 /// Duration of the blanking time via enum powerstep01_TBlank_t 00219 #define POWERSTEP01_CONF_PARAM_TBLANK_DEVICE_0 (POWERSTEP01_TBLANK_375ns) 00220 00221 /// Register : GATECFG2 - field : TDT 00222 /// Duration of the dead time via enum powerstep01_Tdt_t 00223 #define POWERSTEP01_CONF_PARAM_TDT_DEVICE_0 (POWERSTEP01_TDT_125ns) 00224 00225 /******************************* Others *************************************/ 00226 00227 /// Register : OCD_TH 00228 /// Overcurrent threshold settings via enum powerstep01_OcdTh_t 00229 #define POWERSTEP01_CONF_PARAM_OCD_TH_DEVICE_0 (POWERSTEP01_OCD_TH_281_25mV) 00230 00231 /// Register : CONFIG - field : OC_SD 00232 /// Over current shutwdown enabling, enum powerstep01_ConfigOcSd_t 00233 #define POWERSTEP01_CONF_PARAM_OC_SD_DEVICE_0 (POWERSTEP01_CONFIG_OC_SD_DISABLE) 00234 00235 /// Register : STALL_TH 00236 /// Stall threshold settings in mV, range 31.25mV to 1000mV 00237 #define POWERSTEP01_CONF_PARAM_STALL_TH_DEVICE_0 (531.25) 00238 00239 /// Register : ALARM_EN 00240 /// Alarm settings via bitmap enum powerstep01_AlarmEn_t 00241 #define POWERSTEP01_CONF_PARAM_ALARM_EN_DEVICE_0 (POWERSTEP01_ALARM_EN_OVERCURRENT | \ 00242 POWERSTEP01_ALARM_EN_THERMAL_SHUTDOWN | \ 00243 POWERSTEP01_ALARM_EN_THERMAL_WARNING | \ 00244 POWERSTEP01_ALARM_EN_UVLO | \ 00245 POWERSTEP01_ALARM_EN_STALL_DETECTION | \ 00246 POWERSTEP01_ALARM_EN_SW_TURN_ON | \ 00247 POWERSTEP01_ALARM_EN_WRONG_NPERF_CMD) 00248 00249 /// Register : CONFIG - field : SW_MODE 00250 /// External switch hard stop interrupt mode, enum powerstep01_ConfigSwMode_t 00251 #define POWERSTEP01_CONF_PARAM_SW_MODE_DEVICE_0 (POWERSTEP01_CONFIG_SW_HARD_STOP) 00252 00253 /// Register : STEP_MODE - field : STEP_MODE 00254 /// Step mode settings via enum motorStepMode_t 00255 #define POWERSTEP01_CONF_PARAM_STEP_MODE_DEVICE_0 (STEP_MODE_1_16) 00256 00257 /// Register : STEP_MODE - field : CM_VM 00258 /// Current mode or Voltage mode via enum powerstep01_CmVm_t 00259 #define POWERSTEP01_CONF_PARAM_CM_VM_DEVICE_0 (POWERSTEP01_CM_VM_CURRENT) 00260 00261 /// Register : STEP_MODE - Field : SYNC_MODE and SYNC_EN 00262 /// Synch. Mode settings via enum powerstep01_SyncSel_t 00263 #define POWERSTEP01_CONF_PARAM_SYNC_MODE_DEVICE_0 (POWERSTEP01_SYNC_SEL_DISABLED) 00264 00265 /// Register : CONFIG - field : OSC_CLK_SEL 00266 /// Clock setting , enum powerstep01_ConfigOscMgmt_t 00267 #define POWERSTEP01_CONF_PARAM_CLOCK_SETTING_DEVICE_0 (POWERSTEP01_CONFIG_INT_16MHZ_OSCOUT_2MHZ) 00268 00269 /// Register : GATECFG1 - field : WD_EN 00270 /// External clock watchdog, enum powerstep01_WdEn_t 00271 #define POWERSTEP01_CONF_PARAM_WD_EN_DEVICE_0 (POWERSTEP01_WD_EN_DISABLE) 00272 00273 /****************************************************************************/ 00274 /* Device 1 */ 00275 /****************************************************************************/ 00276 00277 /**************************** Speed Profile *********************************/ 00278 /// Register : ACC 00279 /// Acceleration rate in step/s2, range 14.55 to 59590 steps/s^2 00280 #define POWERSTEP01_CONF_PARAM_ACC_DEVICE_1 (2008.16) 00281 00282 /// Register : DEC 00283 /// Deceleration rate in step/s2, range 14.55 to 59590 steps/s^2 00284 #define POWERSTEP01_CONF_PARAM_DEC_DEVICE_1 (2008.16) 00285 00286 ///Register : MAX_SPEED 00287 /// Maximum speed in step/s, range 15.25 to 15610 steps/s 00288 #define POWERSTEP01_CONF_PARAM_MAX_SPEED_DEVICE_1 (991.82) 00289 00290 /// Register : MIN_SPEED 00291 /// Minimum speed in step/s, range 0 to 976.3 steps/s 00292 #define POWERSTEP01_CONF_PARAM_MIN_SPEED_DEVICE_1 (0) 00293 00294 /// Register : FS_SPD 00295 /// Full step speed in step/s, range 7.63 to 15625 steps/s 00296 #define POWERSTEP01_CONF_PARAM_FS_SPD_DEVICE_1 (595.09) 00297 00298 /// Register : FS_SPD - field : BOOST_MODE 00299 /// Boost of the amplitude square wave, enum powerstep01_BoostMode_t 00300 #define POWERSTEP01_CONF_PARAM_BOOST_MODE_DEVICE_1 (POWERSTEP01_BOOST_MODE_OFF) 00301 00302 00303 /************************ Voltage mode parameters **************************/ 00304 /// Register : KVAL_ACC 00305 /// Acceleration duty cycle (torque) in %, range 0 to 99.6% 00306 #define POWERSTEP01_CONF_PARAM_KVAL_ACC_DEVICE_1 (16.02) 00307 00308 /// Register : KVAL_DEC 00309 /// Deceleration duty cycle (torque) in %, range 0 to 99.6% 00310 #define POWERSTEP01_CONF_PARAM_KVAL_DEC_DEVICE_1 (16.02) 00311 00312 /// Register : KVAL_RUN 00313 /// run duty cycle (torque) in %, range 0 to 99.6% 00314 #define POWERSTEP01_CONF_PARAM_KVAL_RUN_DEVICE_1 (16.02) 00315 00316 /// Register : KVAL_HOLD 00317 /// Hold duty cycle (torque) in %, range 0 to 99.6% 00318 #define POWERSTEP01_CONF_PARAM_KVAL_HOLD_DEVICE_1 (16.02) 00319 00320 /// Register : CONFIG - field : EN_VSCOMP 00321 /// Motor Supply Voltage Compensation enabling , enum powerstep01_ConfigEnVscomp_t 00322 #define POWERSTEP01_CONF_PARAM_VS_COMP_DEVICE_1 (POWERSTEP01_CONFIG_VS_COMP_DISABLE) 00323 00324 /// Register : MIN_SPEED - field : LSPD_OPT 00325 /// Low speed optimization bit, enum powerstep01_LspdOpt_t 00326 #define POWERSTEP01_CONF_PARAM_LSPD_BIT_DEVICE_1 (POWERSTEP01_LSPD_OPT_OFF) 00327 00328 /// Register : K_THERM 00329 /// Thermal compensation param, range 1 to 1.46875 00330 #define POWERSTEP01_CONF_PARAM_K_THERM_DEVICE_1 (1) 00331 00332 /// Register : INT_SPEED 00333 /// Intersect speed settings for BEMF compensation in steps/s, range 0 to 3906 steps/s 00334 #define POWERSTEP01_CONF_PARAM_INT_SPD_DEVICE_1 (61.512) 00335 00336 /// Register : ST_SLP 00337 /// BEMF start slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00338 #define POWERSTEP01_CONF_PARAM_ST_SLP_DEVICE_1 (0.03815) 00339 00340 /// Register : FN_SLP_ACC 00341 /// BEMF final acc slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00342 #define POWERSTEP01_CONF_PARAM_FN_SLP_ACC_DEVICE_1 (0.06256) 00343 00344 /// Register : FN_SLP_DEC 00345 /// BEMF final dec slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00346 #define POWERSTEP01_CONF_PARAM_FN_SLP_DEC_DEVICE_1 (0.06256) 00347 00348 /// Register : CONFIG - field : F_PWM_INT 00349 /// PWM Frequency Integer division, enum powerstep01_ConfigFPwmInt_t 00350 #define POWERSTEP01_CONF_PARAM_PWM_DIV_DEVICE_1 (POWERSTEP01_CONFIG_PWM_DIV_2) 00351 00352 /// Register : CONFIG - field : F_PWM_DEC 00353 /// PWM Frequency Integer Multiplier, enum powerstep01_ConfigFPwmDec_t 00354 #define POWERSTEP01_CONF_PARAM_PWM_MUL_DEVICE_1 (POWERSTEP01_CONFIG_PWM_MUL_1) 00355 00356 /******************** Advance current control parameters *********************/ 00357 00358 /// Register : TVAL_ACC 00359 /// Acceleration torque in mV, range from 7.8mV to 1000 mV 00360 #define POWERSTEP01_CONF_PARAM_TVAL_ACC_DEVICE_1 (328.12) 00361 00362 /// Register : TVAL_DEC 00363 /// Deceleration torque in mV, range from 7.8mV to 1000 mV 00364 #define POWERSTEP01_CONF_PARAM_TVAL_DEC_DEVICE_1 (328.12) 00365 00366 /// Register : TVAL_RUN 00367 /// Running torque in mV, range from 7.8mV to 1000 mV 00368 #define POWERSTEP01_CONF_PARAM_TVAL_RUN_DEVICE_1 (328.12) 00369 00370 /// Register : TVAL_HOLD 00371 /// Holding torque in mV, range from 7.8mV to 1000 mV 00372 #define POWERSTEP01_CONF_PARAM_TVAL_HOLD_DEVICE_1 (328.12) 00373 00374 /// Register : CONFIG - field : EN_TQREG 00375 /// External torque regulation enabling , enum powerstep01_ConfigEnTqReg_t 00376 #define POWERSTEP01_CONF_PARAM_TQ_REG_DEVICE_1 (POWERSTEP01_CONFIG_TQ_REG_TVAL_USED) 00377 00378 /// Register : CONFIG - field : PRED_EN 00379 /// Predictive current enabling , enum powerstep01_ConfigPredEn_t 00380 #define POWERSTEP01_CONF_PARAM_PRED_DEVICE_1 (POWERSTEP01_CONFIG_PRED_DISABLE) 00381 00382 /// Register : TON_MIN 00383 /// Minimum on-time in us, range 0.5us to 64us 00384 #define POWERSTEP01_CONF_PARAM_TON_MIN_DEVICE_1 (3.0) 00385 00386 /// Register : TOFF_MIN 00387 /// Minimum off-time in us, range 0.5us to 64us 00388 #define POWERSTEP01_CONF_PARAM_TOFF_MIN_DEVICE_1 (21.0) 00389 00390 /// Register : T_FAST - field: TOFF_FAST 00391 /// Maximum fast decay time , enum powerstep01_ToffFast_t 00392 #define POWERSTEP01_CONF_PARAM_TOFF_FAST_DEVICE_1 (POWERSTEP01_TOFF_FAST_8us) 00393 00394 /// Register : T_FAST - field: FAST_STEP 00395 /// Maximum fall step time , enum powerstep01_FastStep_t 00396 #define POWERSTEP01_CONF_PARAM_FAST_STEP_DEVICE_1 (POWERSTEP01_FAST_STEP_12us) 00397 00398 /// Register : CONFIG - field : TSW 00399 /// Switching period, enum powerstep01_ConfigTsw_t 00400 #define POWERSTEP01_CONF_PARAM_TSW_DEVICE_1 (POWERSTEP01_CONFIG_TSW_048us) 00401 00402 /****************************** Gate Driving **********************************/ 00403 00404 /// Register : GATECFG1 - field : IGATE 00405 /// Gate sink/source current via enum powerstep01_Igate_t 00406 #define POWERSTEP01_CONF_PARAM_IGATE_DEVICE_1 (POWERSTEP01_IGATE_64mA) 00407 00408 /// Register : CONFIG - field : VCCVAL 00409 /// VCC Val, enum powerstep01_ConfigVccVal_t 00410 #define POWERSTEP01_CONF_PARAM_VCCVAL_DEVICE_1 (POWERSTEP01_CONFIG_VCCVAL_15V) 00411 00412 /// Register : CONFIG - field : UVLOVAL 00413 /// UVLO Threshold via powerstep01_ConfigUvLoVal_t 00414 #define POWERSTEP01_CONF_PARAM_UVLOVAL_DEVICE_1 (POWERSTEP01_CONFIG_UVLOVAL_LOW) 00415 00416 /// Register : GATECFG1 - field : TBOOST 00417 /// Duration of the overboost phase during gate turn-off via enum powerstep01_Tboost_t 00418 #define POWERSTEP01_CONF_PARAM_TBOOST_DEVICE_1 (POWERSTEP01_TBOOST_0ns) 00419 00420 /// Register : GATECFG1 - field : TCC 00421 /// Controlled current time via enum powerstep01_Tcc_t 00422 #define POWERSTEP01_CONF_PARAM_TCC_DEVICE_1 (POWERSTEP01_TCC_500ns) 00423 00424 /// Duration of the blanking time via enum powerstep01_TBlank_t 00425 #define POWERSTEP01_CONF_PARAM_TBLANK_DEVICE_1 (POWERSTEP01_TBLANK_375ns) 00426 00427 /// Register : GATECFG2 - field : TDT 00428 /// Duration of the dead time via enum powerstep01_Tdt_t 00429 #define POWERSTEP01_CONF_PARAM_TDT_DEVICE_1 (POWERSTEP01_TDT_125ns) 00430 00431 /******************************* Others *************************************/ 00432 00433 /// Register : OCD_TH 00434 /// Overcurrent threshold settings via enum powerstep01_OcdTh_t 00435 #define POWERSTEP01_CONF_PARAM_OCD_TH_DEVICE_1 (POWERSTEP01_OCD_TH_281_25mV) 00436 00437 /// Register : CONFIG - field : OC_SD 00438 /// Over current shutwdown enabling, enum powerstep01_ConfigOcSd_t 00439 #define POWERSTEP01_CONF_PARAM_OC_SD_DEVICE_1 (POWERSTEP01_CONFIG_OC_SD_DISABLE) 00440 00441 /// Register : STALL_TH 00442 /// Stall threshold settings in mV, range 31.25mV to 1000mV 00443 #define POWERSTEP01_CONF_PARAM_STALL_TH_DEVICE_1 (531.25) 00444 00445 /// Register : ALARM_EN 00446 /// Alarm settings via bitmap enum powerstep01_AlarmEn_t 00447 #define POWERSTEP01_CONF_PARAM_ALARM_EN_DEVICE_1 (POWERSTEP01_ALARM_EN_OVERCURRENT | \ 00448 POWERSTEP01_ALARM_EN_THERMAL_SHUTDOWN | \ 00449 POWERSTEP01_ALARM_EN_THERMAL_WARNING | \ 00450 POWERSTEP01_ALARM_EN_UVLO | \ 00451 POWERSTEP01_ALARM_EN_STALL_DETECTION | \ 00452 POWERSTEP01_ALARM_EN_SW_TURN_ON | \ 00453 POWERSTEP01_ALARM_EN_WRONG_NPERF_CMD) 00454 00455 /// Register : CONFIG - field : SW_MODE 00456 /// External switch hard stop interrupt mode, enum powerstep01_ConfigSwMode_t 00457 #define POWERSTEP01_CONF_PARAM_SW_MODE_DEVICE_1 (POWERSTEP01_CONFIG_SW_HARD_STOP) 00458 00459 /// Register : STEP_MODE - field : STEP_MODE 00460 /// Step mode settings via enum powerstep01_StepSel_t 00461 #define POWERSTEP01_CONF_PARAM_STEP_MODE_DEVICE_1 (STEP_MODE_1_16) 00462 00463 /// Register : STEP_MODE - field : CM_VM 00464 /// Current mode or Voltage mode via enum powerstep01_CmVm_t 00465 #define POWERSTEP01_CONF_PARAM_CM_VM_DEVICE_1 (POWERSTEP01_CM_VM_CURRENT) 00466 00467 /// Register : STEP_MODE - Field : SYNC_MODE and SYNC_EN 00468 /// Synch. Mode settings via enum powerstep01_SyncSel_t 00469 #define POWERSTEP01_CONF_PARAM_SYNC_MODE_DEVICE_1 (POWERSTEP01_SYNC_SEL_DISABLED) 00470 00471 /// Register : CONFIG - field : OSC_CLK_SEL 00472 /// Clock setting , enum powerstep01_ConfigOscMgmt_t 00473 #define POWERSTEP01_CONF_PARAM_CLOCK_SETTING_DEVICE_1 (POWERSTEP01_CONFIG_INT_16MHZ_OSCOUT_2MHZ) 00474 00475 /// Register : GATECFG1 - field : WD_EN 00476 /// External clock watchdog, enum powerstep01_WdEn_t 00477 #define POWERSTEP01_CONF_PARAM_WD_EN_DEVICE_1 (POWERSTEP01_WD_EN_DISABLE) 00478 00479 /****************************************************************************/ 00480 /* Device 2 */ 00481 /****************************************************************************/ 00482 00483 /**************************** Speed Profile *********************************/ 00484 /// Register : ACC 00485 /// Acceleration rate in step/s2, range 14.55 to 59590 steps/s^2 00486 #define POWERSTEP01_CONF_PARAM_ACC_DEVICE_2 (2008.16) 00487 00488 /// Register : DEC 00489 /// Deceleration rate in step/s2, range 14.55 to 59590 steps/s^2 00490 #define POWERSTEP01_CONF_PARAM_DEC_DEVICE_2 (2008.16) 00491 00492 ///Register : MAX_SPEED 00493 /// Maximum speed in step/s, range 15.25 to 15610 steps/s 00494 #define POWERSTEP01_CONF_PARAM_MAX_SPEED_DEVICE_2 (991.82) 00495 00496 /// Register : MIN_SPEED 00497 /// Minimum speed in step/s, range 0 to 976.3 steps/s 00498 #define POWERSTEP01_CONF_PARAM_MIN_SPEED_DEVICE_2 (0) 00499 00500 /// Register : FS_SPD 00501 /// Full step speed in step/s, range 7.63 to 15625 steps/s 00502 #define POWERSTEP01_CONF_PARAM_FS_SPD_DEVICE_2 (595.09) 00503 00504 /// Register : FS_SPD - field : BOOST_MODE 00505 /// Boost of the amplitude square wave, enum powerstep01_BoostMode_t 00506 #define POWERSTEP01_CONF_PARAM_BOOST_MODE_DEVICE_2 (POWERSTEP01_BOOST_MODE_OFF) 00507 00508 00509 /************************ Voltage mode parameters **************************/ 00510 /// Register : KVAL_ACC 00511 /// Acceleration duty cycle (torque) in %, range 0 to 99.6% 00512 #define POWERSTEP01_CONF_PARAM_KVAL_ACC_DEVICE_2 (16.02) 00513 00514 /// Register : KVAL_DEC 00515 /// Deceleration duty cycle (torque) in %, range 0 to 99.6% 00516 #define POWERSTEP01_CONF_PARAM_KVAL_DEC_DEVICE_2 (16.02) 00517 00518 /// Register : KVAL_RUN 00519 /// run duty cycle (torque) in %, range 0 to 99.6% 00520 #define POWERSTEP01_CONF_PARAM_KVAL_RUN_DEVICE_2 (16.02) 00521 00522 /// Register : KVAL_HOLD 00523 /// Hold duty cycle (torque) in %, range 0 to 99.6% 00524 #define POWERSTEP01_CONF_PARAM_KVAL_HOLD_DEVICE_2 (16.02) 00525 00526 /// Register : CONFIG - field : EN_VSCOMP 00527 /// Motor Supply Voltage Compensation enabling , enum powerstep01_ConfigEnVscomp_t 00528 #define POWERSTEP01_CONF_PARAM_VS_COMP_DEVICE_2 (POWERSTEP01_CONFIG_VS_COMP_DISABLE) 00529 00530 /// Register : MIN_SPEED - field : LSPD_OPT 00531 /// Low speed optimization bit, enum powerstep01_LspdOpt_t 00532 #define POWERSTEP01_CONF_PARAM_LSPD_BIT_DEVICE_2 (POWERSTEP01_LSPD_OPT_OFF) 00533 00534 /// Register : K_THERM 00535 /// Thermal compensation param, range 1 to 1.46875 00536 #define POWERSTEP01_CONF_PARAM_K_THERM_DEVICE_2 (1) 00537 00538 /// Register : INT_SPEED 00539 /// Intersect speed settings for BEMF compensation in steps/s, range 0 to 3906 steps/s 00540 #define POWERSTEP01_CONF_PARAM_INT_SPD_DEVICE_2 (61.512) 00541 00542 /// Register : ST_SLP 00543 /// BEMF start slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00544 #define POWERSTEP01_CONF_PARAM_ST_SLP_DEVICE_2 (0.03815) 00545 00546 /// Register : FN_SLP_ACC 00547 /// BEMF final acc slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00548 #define POWERSTEP01_CONF_PARAM_FN_SLP_ACC_DEVICE_2 (0.06256) 00549 00550 /// Register : FN_SLP_DEC 00551 /// BEMF final dec slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step 00552 #define POWERSTEP01_CONF_PARAM_FN_SLP_DEC_DEVICE_2 (0.06256) 00553 00554 /// Register : CONFIG - field : F_PWM_INT 00555 /// PWM Frequency Integer division, enum powerstep01_ConfigFPwmInt_t 00556 #define POWERSTEP01_CONF_PARAM_PWM_DIV_DEVICE_2 (POWERSTEP01_CONFIG_PWM_DIV_2) 00557 00558 /// Register : CONFIG - field : F_PWM_DEC 00559 /// PWM Frequency Integer Multiplier, enum powerstep01_ConfigFPwmDec_t 00560 #define POWERSTEP01_CONF_PARAM_PWM_MUL_DEVICE_2 (POWERSTEP01_CONFIG_PWM_MUL_1) 00561 00562 /******************** Advance current control parameters *********************/ 00563 00564 /// Register : TVAL_ACC 00565 /// Acceleration torque in mV, range from 7.8mV to 1000 mV 00566 #define POWERSTEP01_CONF_PARAM_TVAL_ACC_DEVICE_2 (328.12) 00567 00568 /// Register : TVAL_DEC 00569 /// Deceleration torque in mV, range from 7.8mV to 1000 mV 00570 #define POWERSTEP01_CONF_PARAM_TVAL_DEC_DEVICE_2 (328.12) 00571 00572 /// Register : TVAL_RUN 00573 /// Running torque in mV, range from 7.8mV to 1000 mV 00574 #define POWERSTEP01_CONF_PARAM_TVAL_RUN_DEVICE_2 (328.12) 00575 00576 /// Register : TVAL_HOLD 00577 /// Holding torque in mV, range from 7.8mV to 1000 mV 00578 #define POWERSTEP01_CONF_PARAM_TVAL_HOLD_DEVICE_2 (328.12) 00579 00580 /// Register : CONFIG - field : EN_TQREG 00581 /// External torque regulation enabling , enum powerstep01_ConfigEnTqReg_t 00582 #define POWERSTEP01_CONF_PARAM_TQ_REG_DEVICE_2 (POWERSTEP01_CONFIG_TQ_REG_TVAL_USED) 00583 00584 /// Register : CONFIG - field : PRED_EN 00585 /// Predictive current enabling , enum powerstep01_ConfigPredEn_t 00586 #define POWERSTEP01_CONF_PARAM_PRED_DEVICE_2 (POWERSTEP01_CONFIG_PRED_DISABLE) 00587 00588 /// Register : TON_MIN 00589 /// Minimum on-time in us, range 0.5us to 64us 00590 #define POWERSTEP01_CONF_PARAM_TON_MIN_DEVICE_2 (3.0) 00591 00592 /// Register : TOFF_MIN 00593 /// Minimum off-time in us, range 0.5us to 64us 00594 #define POWERSTEP01_CONF_PARAM_TOFF_MIN_DEVICE_2 (21.0) 00595 00596 /// Register : T_FAST - field: TOFF_FAST 00597 /// Maximum fast decay time , enum powerstep01_ToffFast_t 00598 #define POWERSTEP01_CONF_PARAM_TOFF_FAST_DEVICE_2 (POWERSTEP01_TOFF_FAST_8us) 00599 00600 /// Register : T_FAST - field: FAST_STEP 00601 /// Maximum fall step time , enum powerstep01_FastStep_t 00602 #define POWERSTEP01_CONF_PARAM_FAST_STEP_DEVICE_2 (POWERSTEP01_FAST_STEP_12us) 00603 00604 /// Register : CONFIG - field : TSW 00605 /// Switching period, enum powerstep01_ConfigTsw_t 00606 #define POWERSTEP01_CONF_PARAM_TSW_DEVICE_2 (POWERSTEP01_CONFIG_TSW_048us) 00607 00608 /****************************** Gate Driving **********************************/ 00609 00610 /// Register : GATECFG1 - field : IGATE 00611 /// Gate sink/source current via enum powerstep01_Igate_t 00612 #define POWERSTEP01_CONF_PARAM_IGATE_DEVICE_2 (POWERSTEP01_IGATE_64mA) 00613 00614 /// Register : CONFIG - field : VCCVAL 00615 /// VCC Val, enum powerstep01_ConfigVccVal_t 00616 #define POWERSTEP01_CONF_PARAM_VCCVAL_DEVICE_2 (POWERSTEP01_CONFIG_VCCVAL_15V) 00617 00618 /// Register : CONFIG - field : UVLOVAL 00619 /// UVLO Threshold via powerstep01_ConfigUvLoVal_t 00620 #define POWERSTEP01_CONF_PARAM_UVLOVAL_DEVICE_2 (POWERSTEP01_CONFIG_UVLOVAL_LOW) 00621 00622 /// Register : GATECFG1 - field : TBOOST 00623 /// Duration of the overboost phase during gate turn-off via enum powerstep01_Tboost_t 00624 #define POWERSTEP01_CONF_PARAM_TBOOST_DEVICE_2 (POWERSTEP01_TBOOST_0ns) 00625 00626 /// Register : GATECFG1 - field : TCC 00627 /// Controlled current time via enum powerstep01_Tcc_t 00628 #define POWERSTEP01_CONF_PARAM_TCC_DEVICE_2 (POWERSTEP01_TCC_500ns) 00629 00630 /// Duration of the blanking time via enum powerstep01_TBlank_t 00631 #define POWERSTEP01_CONF_PARAM_TBLANK_DEVICE_2 (POWERSTEP01_TBLANK_375ns) 00632 00633 /// Register : GATECFG2 - field : TDT 00634 /// Duration of the dead time via enum powerstep01_Tdt_t 00635 #define POWERSTEP01_CONF_PARAM_TDT_DEVICE_2 (POWERSTEP01_TDT_125ns) 00636 00637 /******************************* Others *************************************/ 00638 00639 /// Register : OCD_TH 00640 /// Overcurrent threshold settings via enum powerstep01_OcdTh_t 00641 #define POWERSTEP01_CONF_PARAM_OCD_TH_DEVICE_2 (POWERSTEP01_OCD_TH_281_25mV) 00642 00643 /// Register : CONFIG - field : OC_SD 00644 /// Over current shutwdown enabling, enum powerstep01_ConfigOcSd_t 00645 #define POWERSTEP01_CONF_PARAM_OC_SD_DEVICE_2 (POWERSTEP01_CONFIG_OC_SD_DISABLE) 00646 00647 /// Register : STALL_TH 00648 /// Stall threshold settings in mV, range 31.25mV to 1000mV 00649 #define POWERSTEP01_CONF_PARAM_STALL_TH_DEVICE_2 (531.25) 00650 00651 /// Register : ALARM_EN 00652 /// Alarm settings via bitmap enum powerstep01_AlarmEn_t 00653 #define POWERSTEP01_CONF_PARAM_ALARM_EN_DEVICE_2 (POWERSTEP01_ALARM_EN_OVERCURRENT | \ 00654 POWERSTEP01_ALARM_EN_THERMAL_SHUTDOWN | \ 00655 POWERSTEP01_ALARM_EN_THERMAL_WARNING | \ 00656 POWERSTEP01_ALARM_EN_UVLO | \ 00657 POWERSTEP01_ALARM_EN_STALL_DETECTION | \ 00658 POWERSTEP01_ALARM_EN_SW_TURN_ON | \ 00659 POWERSTEP01_ALARM_EN_WRONG_NPERF_CMD) 00660 00661 /// Register : CONFIG - field : SW_MODE 00662 /// External switch hard stop interrupt mode, enum powerstep01_ConfigSwMode_t 00663 #define POWERSTEP01_CONF_PARAM_SW_MODE_DEVICE_2 (POWERSTEP01_CONFIG_SW_HARD_STOP) 00664 00665 /// Register : STEP_MODE - field : STEP_MODE 00666 /// Step mode settings via enum powerstep01_StepSel_t 00667 #define POWERSTEP01_CONF_PARAM_STEP_MODE_DEVICE_2 (STEP_MODE_1_16) 00668 00669 /// Register : STEP_MODE - field : CM_VM 00670 /// Current mode or Voltage mode via enum powerstep01_CmVm_t 00671 #define POWERSTEP01_CONF_PARAM_CM_VM_DEVICE_2 (POWERSTEP01_CM_VM_CURRENT) 00672 00673 /// Register : STEP_MODE - Field : SYNC_MODE and SYNC_EN 00674 /// Synch. Mode settings via enum powerstep01_SyncSel_t 00675 #define POWERSTEP01_CONF_PARAM_SYNC_MODE_DEVICE_2 (POWERSTEP01_SYNC_SEL_DISABLED) 00676 00677 /// Register : CONFIG - field : OSC_CLK_SEL 00678 /// Clock setting , enum powerstep01_ConfigOscMgmt_t 00679 #define POWERSTEP01_CONF_PARAM_CLOCK_SETTING_DEVICE_2 (POWERSTEP01_CONFIG_INT_16MHZ_OSCOUT_2MHZ) 00680 00681 /// Register : GATECFG1 - field : WD_EN 00682 /// External clock watchdog, enum powerstep01_WdEn_t 00683 #define POWERSTEP01_CONF_PARAM_WD_EN_DEVICE_2 (POWERSTEP01_WD_EN_DISABLE) 00684 00685 /** 00686 * @} 00687 */ 00688 00689 /** 00690 * @} 00691 */ 00692 00693 /** 00694 * @} 00695 */ 00696 00697 #ifdef __cplusplus 00698 } 00699 #endif 00700 00701 #endif /* __POWERSTEP01_CONFIG_H */ 00702 00703 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Thu Jul 14 2022 15:33:06 by
1.7.2

X-NUCLEO-IHM03A1 High Power Stepper Motor Driver