cancel
Showing results for 
Search instead for 
Did you mean: 

powerstep01_target_config generated by SPINFamily tool

ahagh.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
ahagh.1
Associate II

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

View solution in original post

4 REPLIES 4
Enrico Poli
ST Employee

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

ahagh.1
Associate II

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

ahagh.1
Associate II

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

Hi @ahagh.1​ ,

Glad to read you found the solution and thanks for sharing it with the community!

Kind Regards

Enrico