LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Stepper Motor as an Encoder

Solved!
Go to solution

I saw that picture a couple weeks ago (and sadly I must admit I found it in a couple minutes)!

 

Here is the link:

 

https://decibel.ni.com/content/docs/DOC-17346

 

I can't foresee the need for caps unless that thay are bypass caps to filter the power. What make and model is the encoder you plan to use?

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 31 of 42
(1,633 Views)

Hello

 

Iam planning to use an incremental rotary encoder....below is the link of the datasheet, and Iam trying to find out, what will I need to make sure when connecting it  to my NI ELVIS II daq device.....the link below shows the datasheet, but it does not say what type of encoding it is using...

 

Here is the link

 

http://www.parallax.com/tabid/768/txtSearch/27805/List/0/SortField/4/Default.aspx

 

I just need to know when configuring this device into my DAQ board, what will I need to make sure.

 

Thanks

SK

0 Kudos
Message 32 of 42
(1,612 Views)

2 bit quadrature per product details:

 

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/27805/List/0/SortField/4/ProductID/68...

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 33 of 42
(1,601 Views)

Iam using a simple quadrature Encoder.... it has just three terminals A, B, C....where C is the common and A and B are the ones that are to be connected to the counter inputs....

 

Iam using an NI Elvis II with a built-in Data Acquisition, I see that it has two available counters..CTR0 and CTR1....the inputs they have are Source, GATE and Out....I know that A need to be connected to the Source, and B need to be connect to the up/down....but I dont see any UP/DOWN input in the Counter so where should I connect this B.

 

THanks

Shaham K

0 Kudos
Message 34 of 42
(1,580 Views)

Page 7-28 of the M-series user manual has the information you need. You do not hook up any of the encoder inputs to the source or gate lines, but rather to the PFI lines and then define whether they are A or B programmatically.

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 35 of 42
(1,559 Views)

Page 7-28 of the M-series user manual has the information you need. You do not hook up any of the encoder inputs to the source or gate lines, but rather to the PFI lines and then define whether they are A or B programmatically.

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 36 of 42
(1,559 Views)

This is the information I've found below, now you are saying to define the A and B signal Programmatically, how would I do that.

 

Counter/Timer Signal

Default Connector 0 Pin

Number (Name)

CTR 0 SRC 37 (PFI 😎

CTR 0 GATE 3 (PFI 9)

CTR 0 AUX 45 (PFI 10)

CTR 0 OUT 2 (PFI 12)

CTR 0 A 37 (PFI 😎

CTR 0 Z 3 (PFI 9)

CTR 0 B 45 (PFI 10)

 

0 Kudos
Message 37 of 42
(1,544 Views)

SK,

 

According to the documentation that you found, you will use PFI8 and PFI10 for your A and B inputs respectively. Since these PFI lines relate to Counter 0, you can programmatically choose this counter by using the following examples Measure Angular Position and Velocity with one counter and no external clock, or Measure Velociy AND Position of your angular encoder with one counter. These examples were located using our Developer Community. There are many examples of "How-To" do things programmatically.

 

Larry H.

Applications Engineer
National Instruments
0 Kudos
Message 38 of 42
(1,523 Views)

Iam tryiing get the positon of a stepper motor using an encoder and how do I calibrate the encoder so that it gives me same position as the motor.

 

I have an encoder with a with a resolution of 16 pulses/revolution and a Motor that has a step angle of 1.8 degrees.

 

what is the best way to measure the position using such encoder.... I know how to get the encoder measurement using a DAQ.. when I go to DAQ assistant and click on ACQUIRE signal it has the following options... Count Edges, position...

 

when I click on edges...so it gives me edge count as the motor rotates but the problem--and what I see---is that 10 steps correespond to 1 edge... and sometimes it does give me that sometimes it doesnot ...i dont know whether is the vibration or something.

when measure the angular position using the encoder...it sometimes gives 11.25 degrees for every 10 steps and sometimes it does not..

 

so what can I do to measure the position accurately..

0 Kudos
Message 39 of 42
(1,508 Views)

Do the math: 360 degrees per revolution/(1.8 degrees per step) = 200 steps per revolution >> 16 steps per revolution of your encoder.

Or 360 degrees per revolution/(16 steps per revolution) = 22.5 degrees per step.

 

With that encoder you CANNOT measure the position of the motor on a per step basis!!!

 

Approximately every 25 steps of the motor will produce 2 pulses on the encoder.  But because you cannot align the motor and encoder to switch at exactly the same point you might get a +/-1 pulse variation in the encoder switching points.

 

Lynn

0 Kudos
Message 40 of 42
(1,499 Views)