cancel
Showing results for 
Search instead for 
Did you mean: 

6 step with PTOOLS1V1 firmware with STEVAL-PTOOL1V1 board

ORaph.1
Associate II

I am working with the 6 step hall sensor firmware PTOOLS1V1. problem that i face is

This firmware is designed for 7 polepair and the motor with me is single polepair.i need to change the code to single polepair.

plz any one help me to change code to 1 polepair.

6 REPLIES 6
Cristiana SCARAMEL
ST Employee

Hello @ORaph.1​,

you can change the Number of Motor Pole pairs in the STSW-PTOOL1V1 firmware opening the project file (refer to user manual UM2771 for more FW details).

The project has been implemented for:

  • IAR Embedded Workbench v8.40.2 or later
  • MDK-ARM v5.30.0 or later
  • STM32CubeIDE v1.2.0 or later

In the “Inc�? folder you find the 6step_conf_hs_vm_spdlp.h file, here you can set the MOTOR_NUM_POLE_PAIRS parameter.

After the change, save, re-compile and load the new firmware in the device.

 

Let me know if this help you.

If you feel a post has answered your question, please click "Accept as Solution"
ORaph.1
Associate II

I have changed MOTOR_NUM_POLE_PAIRS to 1. But there is no change. Is there any other methods to overcome this .?

Hello @ORaph.1​,

could you share more details on your issue?

After the last change, there was no change compared to before? Or something happens?

If you feel a post has answered your question, please click "Accept as Solution"
ORaph.1
Associate II

Hi Cristiana @Cristiana SCARAMEL​ ,

when I change the pole pair to 1 the motor didn't move any step. So I do the following changes,

1). I put Motor_Device1.status = MC_ALIGNMENT in infinite loop so that motor will keep align continuously ,this started motor to rotate.

2). When the motor enters to MC_RUN the motor will go to MC_STOP immediately.

3). I just changed to 4 pair motor and run the code with 1 pole pair, by this code also 4 pair motor start to rotate with wrong speed calculation.

Hi @ORaph.1​ 

I suggest to check whether the Hall sensors decoding table (included in the same config file of MOTOR_NUM_POLE_PAIRS) is properly set according to your motor.

Let me know if this solve your problem

If you feel a post has answered your question, please click "Accept as Solution"

Hi @ORaph.1​,

any progress on your tests?

About my last suggestion, you can try to swap the correspondence between the hall status and the step number from CW direction to CCW direction (old --> new):

#define VALIDATION_HALL_STATUS_DIRECT1_STEP1 ((uint8_t) 4) --> #define VALIDATION_HALL_STATUS_DIRECT0_STEP1 ((uint8_t) 4)  

#define VALIDATION_HALL_STATUS_DIRECT1_STEP2 ((uint8_t) 6) --> #define VALIDATION_HALL_STATUS_DIRECT0_STEP2 ((uint8_t) 6)  

#define VALIDATION_HALL_STATUS_DIRECT1_STEP3 ((uint8_t) 2) --> #define VALIDATION_HALL_STATUS_DIRECT0_STEP3 ((uint8_t) 2)  

#define VALIDATION_HALL_STATUS_DIRECT1_STEP4 ((uint8_t) 3) --> #define VALIDATION_HALL_STATUS_DIRECT0_STEP4 ((uint8_t) 3)  

#define VALIDATION_HALL_STATUS_DIRECT1_STEP5 ((uint8_t) 1) --> #define VALIDATION_HALL_STATUS_DIRECT0_STEP5 ((uint8_t) 1)  

#define VALIDATION_HALL_STATUS_DIRECT1_STEP6 ((uint8_t) 5) --> #define VALIDATION_HALL_STATUS_DIRECT0_STEP6 ((uint8_t) 5)  

#define VALIDATION_HALL_STATUS_DIRECT0_STEP1 ((uint8_t) 3) --> #define VALIDATION_HALL_STATUS_DIRECT1_STEP1 ((uint8_t) 3)  

#define VALIDATION_HALL_STATUS_DIRECT0_STEP2 ((uint8_t) 1) --> #define VALIDATION_HALL_STATUS_DIRECT1_STEP2 ((uint8_t) 1)  

#define VALIDATION_HALL_STATUS_DIRECT0_STEP3 ((uint8_t) 5) --> #define VALIDATION_HALL_STATUS_DIRECT1_STEP3 ((uint8_t) 5)  

#define VALIDATION_HALL_STATUS_DIRECT0_STEP4 ((uint8_t) 4) --> #define VALIDATION_HALL_STATUS_DIRECT1_STEP4 ((uint8_t) 4)  

#define VALIDATION_HALL_STATUS_DIRECT0_STEP5 ((uint8_t) 6) --> #define VALIDATION_HALL_STATUS_DIRECT1_STEP5 ((uint8_t) 6)  

#define VALIDATION_HALL_STATUS_DIRECT0_STEP6 ((uint8_t) 2) --> #define VALIDATION_HALL_STATUS_DIRECT1_STEP6 ((uint8_t) 2)  

Let me know if this helped you.

If you feel a post has answered your question, please click "Accept as Solution"