Forigo / Mbed 2 deprecated FORIGO_Modula_V7_3_VdcStep_DICEMBRE2020

Dependencies:   mbed X_NUCLEO_IHM03A1_for

Committer:
nerit
Date:
Fri May 24 10:29:09 2019 +0000
Revision:
31:92a9e183be8e
Parent:
30:32e770e91998
Child:
50:144a92eeddb9
Versione del 24 maggio 2019 per Francia con modifica allarmi. Gli allarmi sono attivi solo dopo 3 secondi che la macchina rileva la velocita di avanzamento. L'allarme di mancata lettura sensore di velocita e' invece sempre attivo.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nerit 3:a469bbd294b5 1 /* Variables -----------------------------------------------------------------*/
nerit 3:a469bbd294b5 2
nerit 3:a469bbd294b5 3 /* Initialization parameters of the motor connected to the expansion board. */
nerit 3:a469bbd294b5 4 /* Voltage mode. */
nerit 3:a469bbd294b5 5 powerstep01_init_u_t init =
nerit 3:a469bbd294b5 6 {
nerit 3:a469bbd294b5 7 /* common parameters */
nerit 17:9629eb019892 8 .cm.cp.cmVmSelection = POWERSTEP01_CM_VM_CURRENT, // enum powerstep01_CmVm_t
nerit 17:9629eb019892 9 //.cm.cp.cmVmSelection = POWERSTEP01_CM_VM_VOLTAGE, // enum powerstep01_CmVm_t
nerit 31:92a9e183be8e 10 500, // Acceleration rate in step/s2, range 14.55 to 59590 steps/s^2 582
nerit 31:92a9e183be8e 11 500, // Deceleration rate in step/s2, range 14.55 to 59590 steps/s^2 582
nerit 28:0534c86365ec 12 122.00, // Maximum speed in step/s, range 15.25 to 15610 steps/s 488 92.45 180.45
nerit 3:a469bbd294b5 13 1.0, // Minimum speed in step/s, range 0 to 976.3 steps/s
nerit 3:a469bbd294b5 14 POWERSTEP01_LSPD_OPT_ON, // Low speed optimization bit, enum powerstep01_LspdOpt_t
nerit 3:a469bbd294b5 15 15624.00, // Full step speed in step/s, range 7.63 to 15625 steps/s 244.16
nerit 3:a469bbd294b5 16 POWERSTEP01_BOOST_MODE_OFF, // Boost of the amplitude square wave, enum powerstep01_BoostMode_t
nerit 17:9629eb019892 17 968.75, // Overcurrent threshold settings via enum powerstep01_OcdTh_t 281.25
nerit 3:a469bbd294b5 18 STEP_MODE_1_8, // Step mode settings via enum motorStepMode_t
nerit 3:a469bbd294b5 19 POWERSTEP01_SYNC_SEL_DISABLED, // Synch. Mode settings via enum powerstep01_SyncSel_t
nerit 3:a469bbd294b5 20 (POWERSTEP01_ALARM_EN_OVERCURRENT|
nerit 3:a469bbd294b5 21 POWERSTEP01_ALARM_EN_THERMAL_SHUTDOWN|
nerit 3:a469bbd294b5 22 POWERSTEP01_ALARM_EN_THERMAL_WARNING|
nerit 3:a469bbd294b5 23 POWERSTEP01_ALARM_EN_UVLO|
nerit 3:a469bbd294b5 24 POWERSTEP01_ALARM_EN_STALL_DETECTION|
nerit 3:a469bbd294b5 25 POWERSTEP01_ALARM_EN_SW_TURN_ON|
nerit 3:a469bbd294b5 26 POWERSTEP01_ALARM_EN_WRONG_NPERF_CMD), // Alarm settings via bitmap enum powerstep01_AlarmEn_t
nerit 3:a469bbd294b5 27 POWERSTEP01_IGATE_64mA, // Gate sink/source current via enum powerstep01_Igate_t 64
nerit 3:a469bbd294b5 28 POWERSTEP01_TBOOST_0ns, // Duration of the overboost phase during gate turn-off via enum powerstep01_Tboost_t
nerit 3:a469bbd294b5 29 POWERSTEP01_TCC_500ns, // Controlled current time via enum powerstep01_Tcc_t 500
nerit 3:a469bbd294b5 30 POWERSTEP01_WD_EN_DISABLE, // External clock watchdog, enum powerstep01_WdEn_t
nerit 3:a469bbd294b5 31 POWERSTEP01_TBLANK_375ns, // Duration of the blanking time via enum powerstep01_TBlank_t 375
nerit 3:a469bbd294b5 32 POWERSTEP01_TDT_125ns, // Duration of the dead time via enum powerstep01_Tdt_t 125
nerit 18:7c978f69cc51 33 #if defined(provaStepper)
nerit 18:7c978f69cc51 34 93.60, // KVAL Hold torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 35 233.00, // KVAL RUN torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 36 233.00, // KVAL ACC torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 37 233.00, // KVAL DEC torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 38 #else
nerit 18:7c978f69cc51 39 93.60, // KVAL Hold torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 40 273.00, // KVAL RUN torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 41 273.00, // KVAL ACC torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 42 273.00, // KVAL DEC torque in mV, range from 0.0mV to 0.996 mV
nerit 18:7c978f69cc51 43 #endif
nerit 17:9629eb019892 44 POWERSTEP01_TOFF_FAST_28us, //Maximum fast decay time , enum powerstep01_ToffFast_t 8
nerit 17:9629eb019892 45 POWERSTEP01_FAST_STEP_28us, //Maximum fall step time , enum powerstep01_FastStep_t 12
nerit 3:a469bbd294b5 46 3.0, // Minimum on-time in us, range 0.5us to 64us 3.0
nerit 3:a469bbd294b5 47 20.5, // Minimum off-time in us, range 0.5us to 64us 21.0
nerit 3:a469bbd294b5 48 POWERSTEP01_CONFIG_INT_16MHZ_OSCOUT_2MHZ, // Clock setting , enum powerstep01_ConfigOscMgmt_t
nerit 3:a469bbd294b5 49 POWERSTEP01_CONFIG_SW_HARD_STOP, // External switch hard stop interrupt mode, enum powerstep01_ConfigSwMode_t
nerit 3:a469bbd294b5 50 POWERSTEP01_CONFIG_TQ_REG_TVAL_USED, // External torque regulation enabling , enum powerstep01_ConfigEnTqReg_t
nerit 3:a469bbd294b5 51 POWERSTEP01_CONFIG_VS_COMP_ENABLE, // Motor Supply Voltage Compensation enabling , enum powerstep01_ConfigEnVscomp_t
nerit 6:e8c18f0f399a 52 POWERSTEP01_CONFIG_OC_SD_DISABLE, // Over current shutwdown enabling, enum powerstep01_ConfigOcSd_t
nerit 3:a469bbd294b5 53 POWERSTEP01_CONFIG_UVLOVAL_LOW, // UVLO Threshold via powerstep01_ConfigUvLoVal_t
nerit 3:a469bbd294b5 54 POWERSTEP01_CONFIG_VCCVAL_7_5V, // VCC Val, enum powerstep01_ConfigVccVal_t
nerit 18:7c978f69cc51 55 POWERSTEP01_CONFIG_TSW_124us, // Switching period, enum powerstep01_ConfigTsw_t 048
nerit 3:a469bbd294b5 56 POWERSTEP01_CONFIG_PRED_ENABLE // Predictive current enabling , enum powerstep01_ConfigPredEn_t
nerit 3:a469bbd294b5 57 };
nerit 3:a469bbd294b5 58 /* Motor Control Component. */
nerit 3:a469bbd294b5 59 PowerStep01 *motor;