cancel
Showing results for 
Search instead for 
Did you mean: 

FOC SDK + HALL not on TIMx

vmatos
Associate II
Posted on January 06, 2016 at 19:54

Hello,

I've just designed and populated some prototyping boards which happen to connect the HALL sensor not on the correct TIM2-5 CHX pins.

Instead of just throwing all in the garbage, I was wondering if is there a way to alternatively use the HALL information from these generic pins and forward it to the FOC speed n position classes?

Best regards

#stm32f103 #hall-sensors #foc
6 REPLIES 6
Gigi
ST Employee
Posted on January 07, 2016 at 17:13

Ciao

It is not so easy but I think that you can try using the TIM2 or 5 for the time measurement that can be started and stopped inside a generic GPIO routine.

You can reuse the conversion algorithm to get the quantity speed and position in the units that the FOC library expects.

Ciao

Gigi

vmatos
Associate II
Posted on January 08, 2016 at 11:20

That was my initial thought.

I thought about deriving SpeednPosFdbk class. But I don't have access to the confidential distribution and SpeednPosFdbk private class files.

How can I inject my position and speed readings without deriving SpeednPosFdbk class?

Cheers

vmatos
Associate II
Posted on January 13, 2016 at 14:01

I'm in the process of obtaining the confidential distribution.

Is the best method to derive SpeednPosition class and implement the required methods?

Do you have any general advice?

vmatos
Associate II
Posted on March 16, 2016 at 14:16

I was able to derive the SpeednPosFbkClass, based on the HALL_SpeednPosFbkClass.

Instead of having just one Timer ISR doing the overflow counting and Hall pin change capture, I divided into two ISR calls. One for the Timer update, and one for the EXTI Hall pin change. Using Open loop I'm able to verify that I get the same ElSpeedDpp and the same Mec speed 01Hz as the VirtualSpeedSensor_SpeednPosFdbkClass that drives the open loop. However I'm confused on how to verify I obtain the correct ElAngle on my derived class. Can I just compared the ElAngle from open loop's VirtualSpeedSensor and my HALL class? I'm running open loop on slow speeds: 3-10 01Hz. On FOC_CurrController() function:

hElAngledpp = SPD_GetElAngle(STC_GetSpeedSensor(oSTC[bMotor])); // Open loop's VirtualSpeedSensor
hElAngleDpp_aux = SPD_GetElAngle(oSpeedSensor_aux); // My derived HALL SpeednPos

I obtain different ElAngles. I have followed instructions on section 8.3.3, from FOC manual. I've confirmed the sequence of the Hall signal for the forward direction. I have manually measured the delay between the maximum Bemf_A and H1 rising transition. What would be the best method to make sure I get the correct ElAngle on my HALL sensor class?
Gigi
ST Employee
Posted on April 01, 2016 at 15:10

Ciao

It is not all clear for me. The difference is big? I mean that usually the forced angle of the Virtual Speed sensor is not exactly the angle of the motor because it have a difference that depends on the load.

Better to compare for instance the sensorless angle (running the motor in senseless) and the angle of your sensors.

Anyhow you can put the angle of you sensor in the DAC and verify if the shape is reasonable.

Ciao

Gigi

Laurent Ca...
Lead II

The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards