Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

stepper motor pulses per step measurement (Step Angle)

Hi everybody,
 
Recently I have one project to do step angle measurement for a stepper motor. The motor will couple with A,B phase encoder, and PXI-6602 card is used to count the pulse from encoder.
Well, the test will make the motor to rotate 1 revolutuion (360 degree) i.e. 200 steps are required. The software must able to measure and record the pulses per stepper's step i.e. 1.8 degree until 1 revolution is reached. But now the PXI-6602 will only present the accumulative counts per revolution, Any idea can split the accumulative count into small per step count with high speed and accurate method.
 
Thanks & Best regard. 
0 Kudos
Message 1 of 10
(10,154 Views)
My opinion: the best thing is to use the step pulse as an external sampling clock and configure a angular position measurement task for finite sampling.  You may want to go 201 steps though so you can capture each of the 200 step intervals.  The first step pulse captures your initial base position, then each of the next 200 captures a 1.8 degree interval.
 
You're going to get cumulative position per interval, but a simple finite difference on the array will give you what you need.  I don't have LV on my network PC or I'd illustrate how right here.  The basic idea is very simple.  Send the array into a For Loop using auto-indexing.  Add a shift register to the Loop as well.  Before the loop starts, feed in array(0) to the left-hand-side shift register.  Inside the loop, pass the current array element to the right-hand-side shift register.  Also in the loop, subtract the left-hand-side shift register value from the current array element.  Pass the result to the loop boundary with auto-indexing on.  This makes an output array of (delta pos) / step.
 
Depending on what you are trying to characterize, you may want to either:
 
1. step very very slowly, making sure the system settles to equilibrium between steps.
2. step fairly quickly, well above the motor & system resonance frequencies.  If you do this, you may need to ramp up and not start the measurement until the motor reaches a steady speed.
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 10
(10,148 Views)

Hi Kevin,

Thanks for your kind support!

Do you mean "External sampling clock" is the step trigger command generated by software itself or other external triggering source?

Basically, I do understand your idea but if you can provide me some samples or explain more will be highly appreciated?

Thanks a lot...Smiley Happy

0 Kudos
Message 3 of 10
(10,137 Views)

Re: "external sampling clock."

The finite position measurement task will need you to specify the source signal that acts as the sampling clock.  You can do this with DAQmx Timing.vi     Because the sampling clock is a signal from the external world rather than a singal internal to the board, I referred to it as an external sampling clock.  Some of the shipping examples use that terminology too.

I don't know where the step pulses are being generated, but you can use them whether you generate them yourself in software or whether they come from elsewhere.  

Also, note that a "sampling clock" is considered as something quite different from a "trigger" in data acq.  Nothing about your app sounds like it needs to concern itself with a trigger.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 10
(10,132 Views)
Thanks Kevin,
 
The UUT( Stepper Motor) will connect to stepper drive board, and I will use motion card to generate pulses and feed into stepper driver board to make stepper motor rotate, meanwhile there is an encoder coupling with UUT. The feedback pulses will connect to Counter/Timer PXI card.
 
Can I do in this way :
1.The software will generate pulses(measurement trigger signal) to drive the stepper drive board,
2. At this time, read the accumulative feedback pulse value from Counter/Timer PXI card as initial value.
3. Wait mili time or detect no increment of value from PXI to determine the stepper motor already settle down and read current value from PXI card. Caculate the difference between current and initial value and record into an array and so on.... 
4. Repeat item.1 until stepper one revolution.
 
The above test will assume stepper motor run in quite slow manner i.e. within 10 sec to complete test..
 
Thanks & Best regards.
0 Kudos
Message 5 of 10
(10,127 Views)

Hi Kevin,

I wonder If there a way to do step angle measurement without using external sampling clock? For example using the phase A,B detection direct from the encoder.

 

Thanks advice.

0 Kudos
Message 6 of 10
(10,124 Views)

Hi Simon,

You can take a look at the example "Measure Angular Position" in the NI Example Finder (Help >> Find Examples in LabVIEW).  It does not use an external sample clock so hopefully it will be useful to you.

Regards,

Laura

0 Kudos
Message 7 of 10
(10,104 Views)
What is it you need to characterize?  For what purpose?  Using an external sampling clock can help make the test run much more quickly, but is not absolutely necessary.
 
One of my first counter-based apps was to characterize a stepper motor with a microstepping drive.  1 counter measured the step and direction signals going from the motor controller to the microstepping drive.  1 counter measured a quadrature encoder.  Only the encoder measurement used a sampling clock, and it was internal.
 
My technique included considerations such as:
 
1. I did not move in single steps.  It may be a little less crucial to you with a 200 step/rev motor & drive.  I had something like 3200 step/rev as I recall.  Friction alone could have prevented any motion from occurring on single steps. 
 
2. Each motion moved some small-ish prime number of steps so I could move around many many revs and be sure to land on each stopping position an equal # of times.  A simpler method would be to move 1 rev + 1 step.  In your case, that's 201 steps.  The downside is that you extend testing time.  With a 200 step/rev motor, this shouldn't be such a burden though.
 
3. After all step pulses were issued, I started monitoring the encoder data.  I looped around evaluating chunks of position data to determine when I had a dataset that looked "settled."  The main criteria I used were slope and standard deviation.  When the criteria were met, I would store the median value.  You could consider using a mean or an RMS as well.
 
4. Repeat enough times that you land on each stopping position a statistically significant # of times.  Rule of thumb seems to be about 30.  That would give you 6000 actuations of 201 steps each.  Seems feasible that test time might be in the 1-2 hour realm.
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 10
(10,098 Views)
Thanks everybody,
 
I will look into the possible solutions and get back to you.
0 Kudos
Message 9 of 10
(10,090 Views)

hello,

 

i want to move a unipolar stepper motor(24v ,0.6A) in SHM......(+90 TO -90,+80 TO -80......)

i hope u hav got it..as i thnk there shld nt b ne modification in d circuit.it can be connected juz noramally.

i m using L293D as a motor driver.

 

i m nt gtng d xact concept for d programming part

 

cn u plz help me giving a logic..???

plz rply as soon as possible..itz a lil urgent.....

 

regards,

milind agarwal

0 Kudos
Message 10 of 10
(8,096 Views)