cancel
Showing results for 
Search instead for 
Did you mean: 

Detection of wrong direction run

luter
Associate II
Posted on September 07, 2005 at 12:31

Detection of wrong direction run

8 REPLIES 8
luter
Associate II
Posted on May 17, 2011 at 10:18

Hi, All.

I am new in this field and have a problem: how to realize whether motor run in wroght direction or not? (Position sensor mode). One of the problems is that z-int can not be generated in direct access mode(as far as i understood). Am i right? It causes a lot of problems.

My idea is that:

During start phase mc is in direct access mode. I read hall sensors to detect current rotor position. write corresponding phase configuration in mphst. it causes com interrupt to fill preload registers(but now we don't need it).Motor starts. i read continuously hall sensor until on of them changes state. if next hall sensors signals match required => motor runs in right direction :D , i switch off direct access mode and run normal loop. if hall sensor signals don't match next expecting set=> motor runs in wrong direction :-[ .

I didn't try it yet.

This method is for start phase only. But i have no idea about controlling direction of rotation while motor runs in normal loop.

I would be very happy if someone shares his/her more experienced ideas about start phase and normal run.

Tnx.

gaetano
Associate II
Posted on May 17, 2011 at 10:18

Hi,

please, might you specify how many sensors are you using?

Regards,

Tanio

luter
Associate II
Posted on May 17, 2011 at 10:18

Ye, it is clear. but as i mentioned before the problem is that: to read hall sensors i need direct access mode. because only this mode allows direct reading of sensors, but it blocks z interrupt. that is why switching on and off direct mode during normal run can cause numerous problems. how to overcome it?

Regards, luter

luter
Associate II
Posted on May 17, 2011 at 10:18

3 sensors, 120 degrees

gaetano
Associate II
Posted on May 17, 2011 at 10:18

With 3 sensors you know exactly which has to be the right pattern configuration to provide at the MCU outputs for starting in the right direction.

When the rotor is already in rotation, you have to read the three sensor levels; then according to next occured transition, you can determine if it is rotating CW or CCW and, consequently, provide the right ouput pattern. This procedure should be done at the very beginning of your program execution; if after a timeout you don't receive any edge transition on the sensors level, it means that the motor is at rest and the execution can proceed with the startup procedure as stated above.

Regards,

Tanio

gaetano
Associate II
Posted on May 17, 2011 at 10:18

Hi,

if I have well understood, you are looking for a method that allows to you to know exactly the direction sense, although the motor is running normally according to the seqences you are providing during runtime. If it is, your request sounds strange... :-?

By the way, here are two methods that should allow to you how to perform that (please, refer to table 36 of ST7FMC datasheet for PCN=0, TES=00, SR=1). Please, consider also the drawing contained in the attached .ppt file:

------------------------ Method 1 ----------------------

a) Let's suppose that, during runtime, the code execution is waiting for a falling transition on input MCIA (IS[1:0]=00). This means, you are in the points T1 or T2 depending on the motor is rotating in CW or CCW direction respectively;

b) After Z detection, in Z ISR, you can read MCIB and MCIC as they are Standard I/O as stated in the datasheet. If you got MCIB=0 and MCIC=1 then the motor direction is CW (see attached .ppt file); otherwise, if MCIB=1 and MCIC=0 then the motor dir is CCW.

------------------------ Method 2 ---------------------

a) Under the same initial hypothesis of the previous method, after receiving a Z event due to an MCIA input falling transition, during Z ISR you can set DAC bit (so validating direct access mode) and write IS[1:0]=11.In this case you can read the three MCIA, MCIB and MCIC levels as they were Standard I/Os. If you got MCIA=0, MCIB=0, MCIC=1 the motor dir. is CW; if you got MCIA=0, MCIB=1, MCIC=0 the dir. is CCW. Don't forget to reset DAC bit and update IS[1:0] to a proper value to enable again the MTC peripheral normal running mode. In this case DAC bit is set for a very short period, doesn't affecting any Z event generation.

I know that in datasheet you don't have this information at this regarding, but in the new release it will be updated as I explained to you before.

I hope that helps you.

If yes, since you are a German guy, you should owe to me a beer... at least! :-]

Regards,

Tanio

luter
Associate II
Posted on May 17, 2011 at 10:18

According to my request.

First: start in wrong directon can really occure, i have seen it.

Second: detection of change of direction while motor is running normally goes from my boss. for me it looks a little bit strange as well, but what can i do?

Third: tnx for help. i just didn't pay attention on table 36. now i know, that reading of sensors is possible. it solves my problem. now i m about coding and testing.

And the main thing: Beer waits for you :-]

Regards

gaetano
Associate II
Posted on May 17, 2011 at 10:18

Ok!

good, for all the points!...

...especially for the last! I will let you know when.. :D

Have a good work.

Tanio