2021-11-08 08:31 PM
when I use powerstep01_target_config generated by SPINFamily tool on 401re the speed profile run 10 times faster that it runs on SPINFamily tool. I also change sys clock speed but no luck. please let me know if there is a solution to my problem.
and also is there any source code or example of this file Guifw-STM32F4xx-Nucleo.bin
thanks
Solved! Go to Solution.
2021-11-14 05:28 PM
HI @Enrico Poli
I found out what is causing this problem, because I was using current mode I only update the current section of powerstep01_target_config
there for old parameter from section of Voltage mode parameters was used and it had different values from my motor.
generated file from SPINFamily tool need to replaced completely.
I also saw if I use BSP_MotorControl_Init(BSP_MOTOR_CONTROL_BOARD_ID_POWERSTEP01, &initDeviceParameters);
it will use Voltage mode parameters from powerstep01_target_config.
it is best to replace config with generated one
2021-11-12 07:40 AM
Hello @ahagh.1,
Welcome to the community.
Could you please share the powerstep01_target_config.h file generated by the SPINFamily tool and describe with more details the mismatch you found in the motor speed?
About the "Guifw-STM32F4xx-Nucleo.bin" firmware, it manages the interfacing between PC and POWERSTEP01 SPI communication.
Sorry, but the source code is not available.
Enrico
2021-11-12 04:50 PM
Hello @Enrico Poli and thank you for reply,
For example i want spin motor 360 at the speed i want, i use SPINFamily tool in Current mode and set parameters at Speed profile section.
it spin the way i want .
/**************************** Speed Profile *********************************/
/// Register : ACC
/// Acceleration rate in step/s2, range 14.55 to 59590 steps/s^2
#define POWERSTEP01_CONF_PARAM_ACC_DEVICE_0 (8003.55)
/// Register : DEC
/// Deceleration rate in step/s2, range 14.55 to 59590 steps/s^2
#define POWERSTEP01_CONF_PARAM_DEC_DEVICE_0 (8003.55)
///Register : MAX_SPEED
/// Maximum speed in step/s, range 15.25 to 15610 steps/s
#define POWERSTEP01_CONF_PARAM_MAX_SPEED_DEVICE_0 (1297)
/// Register : MIN_SPEED
/// Minimum speed in step/s, range 0 to 976.3 steps/s
#define POWERSTEP01_CONF_PARAM_MIN_SPEED_DEVICE_0 (0)
/// Register : FS_SPD
/// Full step speed in step/s, range 7.63 to 15625 steps/s
#define POWERSTEP01_CONF_PARAM_FS_SPD_DEVICE_0 (15624.98)
/// Register : FS_SPD - field : BOOST_MODE
/// Boost of the amplitude square wave, enum powerstep01_BoostMode_t
#define POWERSTEP01_CONF_PARAM_BOOST_MODE_DEVICE_0 (POWERSTEP01_BOOST_MODE_OFF)
but when i use this parameters powerstep01_target_config or even change it with API commands motor stalls it is too fast,
for example if i change #define POWERSTEP01_CONF_PARAM_MAX_SPEED_DEVICE_0 (1297) to 200 and 8003.55 to 500
it is kind of going to be the speed that i want but it make motor jerky because it is not correct parameters.
i use en.x-cube-spn3_v1.6.0 example to spin the motor and i think the pulse this example is generating is too high and it run faster.
at least if we know what board setting is used in Guifw-STM32F4xx-Nucleo.bin we can use same parameters inside the code.
thanks
2021-11-14 05:28 PM
HI @Enrico Poli
I found out what is causing this problem, because I was using current mode I only update the current section of powerstep01_target_config
there for old parameter from section of Voltage mode parameters was used and it had different values from my motor.
generated file from SPINFamily tool need to replaced completely.
I also saw if I use BSP_MotorControl_Init(BSP_MOTOR_CONTROL_BOARD_ID_POWERSTEP01, &initDeviceParameters);
it will use Voltage mode parameters from powerstep01_target_config.
it is best to replace config with generated one
2021-11-15 05:59 AM
Hi @ahagh.1 ,
Glad to read you found the solution and thanks for sharing it with the community!
Kind Regards
Enrico