LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I determine phase motor voltage phase relationships in LabVIEW?

HI,

 

I have been tasked with creating a gimbal simulator in which I need to read 3 phase motor voltages (which are being generated by motor drive circuits on a test system), determine the phase relationships of these voltages to determine the intended motor direction (Voltage A phase leads B which leads C = Forward, C leads B leads A = reverse) and then generate simulated resolver readings back to the test system to make the test system "think" it is actually moving a motor and responding to the feedback generated by our simulator.

 

We're creating the simulator in LabVIEW and will be using the cRIo DAQ modules (NI 9242).

 

Is there something in the base package of LabVIEW that could quickly determine the phase relationship "order" of the three motor voltages??

 

I'm probably missing a piece of info as I'm too close to this project so please forgive me and ask questions!

Thanks!

John

0 Kudos
Message 1 of 5
(3,138 Views)

There might be an express VI (seems like there was once a Power Measurement package) to do what you want a little simpler, but the down and dirty way is simply to record the three channels (sample rate at least 10x the frequency, and record at least two cycles).

 

Search each channel for a positive zero crossing.

 

So each channel crosses zero at a different index in your array.

 

You might get A-B-C, A-C-B, B-A-C, B-C-A, C-A-B, or C-B-A

Three of those combinations mean CW, and the other three mean CCW.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 5
(3,116 Views)

There is a VI that calculates the phase angle

vi.lib\measure\matone.llb\Extract Single Tone Information 1 Chan.vi

 

As CoastalMaineBird said you will need to capture all three phases at the same time (simultaneously) for this to mean anything.

Feed an array of waveforms (A,B,C) and you will get an array of Phase Angels out.

From that you can tell the order of rotation.

Omar
0 Kudos
Message 3 of 5
(3,090 Views)

You might want to consider a different approach.  From the instantaneous A, B, C measurements, you should be able to calculate the current phase angle of the motor.  Each phase should be 120 degrees after the previous phase.  The three values should add up to twice the amplitude, I think.  You have an equation with two unknowns (amplitude, base angle) and three values. A quick least squares fit or some other simple math would give you the base angle.  I didn't work through all the details, so I'm not sure what the best way to get the base angle is, but I am sure it can be done.

 

The phase angle would cycle multiple times per rotation of the motor, so you would need to handle that.  For each move of the motor, I would measure the change in angle, divide by the number of poles, then add that to the current position.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 5
(3,043 Views)

I did the math, and came up with the following equation:  phase angle T = atan( sqrt(3)*A / (B-C) ).  I would use the atan2 function to get all four quadrants and prevent divide by zero issues when B=C.

 

This is based on the following equations:

A = R sin (T)

B = R sin (T+120)

C = R sin (T+240)

 

A couple of my earlier assumptions were wrong.  From these equations you find out A+B+C=0.  It took a little angle math to get the equation above.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 5 of 5
(2,980 Views)