Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit switch and encoder wiring to NI9512 module

Hi,

 

I am using a NI NEMA23 stepper motor, P70530 power drive, NI quadrature encoder, and a compact RIO chassis.

 

My motor is working just fine but I am having trouble with the limit switches and the encoder. The limit switches are wired for normally closed operation and are wired to the 37 pin block that came with the P7000 to NI9512 connectivity bundle. I've tried multiple settings (sourcing, sinking, active on, active off) using the NI Softmotion module in LabVIEW and tried switching the limit switch leads but I still cannot get them to work properly. It seems like no combination works properly. They are either non-reactive when pressed or both active when not pressed. I'm wondering if there is a typical setup in the software for limit switches wired to the 37pin block?

 

For the encoder, I have it connected to the 37 pin block included in the P7000 to NI9512 connectivity bundle but the NI9512 module is not receiving encoder pulses. I've tried narrowing down the problem through different active/inactive settings in LabVIEW but I can't get a response. I'm wondering if the problem sounds like it is coming from my wiring or from the settings in the software or a combination? Also, does my motor wiring effect the encoder at all? For example, if I switch the A and Abar leads on the motor, do I need to switch them on the encoder?

 

Any advice and/or help would be greatly appreciated! Thanks

0 Kudos
Message 1 of 13
(6,627 Views)

Hi cforem5,

 

Thanks for posting to the forums! The 9512 has some helpful indicator lights that will help shed some light into the problem. When the limit switches are pressed, what do you see on the third LED from the left? You can also diagnose the encoder connection in the same way by observing the second LED. I'm sure you might have browsed through the manual here: http://www.ni.com/pdf/manuals/374555d.pdf. The explanation of the LED indicator lights and their associated meanings is on page 20. If you can let me know what the LEDs are indicating, we'll be able to work from there. 

 

Another document that might be helpful to you is the Getting Started Guide for the 951x module in LabVIEW: http://www.ni.com/pdf/manuals/372874d.pdf. If you haven't seen this already, I think it would be greatly beneficial for you to look through it.

 

0 Kudos
Message 2 of 13
(6,616 Views)

Yeah I've looked through both of those already. Turns out my wiring was backwards but now it is working properly. Probably happens a lot, sorry. 

 

Thanks for your help

0 Kudos
Message 3 of 13
(6,613 Views)

I have a similar 9512 question. I am trying to use the SoftMotion Find Reference Move (Index), but stepper 70530 just turns continuously when I run it. I have wired A,A-,B,B-,I,I- to the 37 pin terminal of the 9512 to my (external encoder) Encoder 0 terminals. I have checked with a scope and the second LED from the left that my A and B encoder terminals are pulsing when I wiggle the motor as you suggested above, although this doesn't check I. First, do I have to do a home move before the index with this function? The example Home and Index does this, but I'm not sure if it is required. I used this example, but replaced the functions with an express, synchronous vi. Secondly, is Find Reference (Index) looking at my external Encoder 0, or is it reading stepper index? I need to read index off my external encoder. Thirdly, I would use my old FPGA code for the find index, however I cannot figure out how to stop/disable 9512 in FPGA code. The RT is too delayed by the time I find the index in FPGA and stop the motor in RT with SoftMotion. This does prove the encoder is giving out a z pulse.

0 Kudos
Message 4 of 13
(6,270 Views)

Hi RJ12, 

 

To increase visibility of your questions, it may be beneficial to post your questions in a new thread. 

 

To perform a reference move, you have to perform a 'home' move at some point, or have an absolute encoder. 

 

I was able to find some references on 9512 FPGA code here:

 

Getting Started guide:

http://www.ni.com/pdf/manuals/372596b.pdf

 

functions available in FPGA property nodes:

http://zone.ni.com/reference/en-XX/help/370984T-01/target4devicehelp/9512_io_reference/

 

-N

National Instruments
Staff Certification Engineer
0 Kudos
Message 5 of 13
(6,258 Views)

Hi Nathanael,

Thanks for ensuring me I need a home move before my index move in SoftMotion code, like the example. For our system, the "home" move is finding the index of the external (incremental) encoder and we reset position there. So, I don't have a home in the way the function implies. However, can I just wire the home terminal high and trick it into thinking it did a home move? I think you are telling me I have to have something wired to the home terminal. Is the purpose of the home move to get it within < 360 degrees of the index? For example, why can't I rotate 5 degrees, reset position, and then find reference (index) in the same direction if this is the case? I also don't understand why it doesn't just read A/B or I to Find Reference(index) based on my Axis settings.

Also, my 9512 is in scan interface mode and the other cards are in FPGA mode. I think this means I cannot use FPGA functions for the 9512, is this correct, or can I read the A/B or I myself in FPGA code and just drop this SoftMotion function?

0 Kudos
Message 6 of 13
(6,253 Views)

Please note I cannot put the 9512 in FPGA interface mode on the cRIO-9076. So, my question above is asking whether I can use 9512 FPGA properties/functions (ie disable motion/read index)  at the same time as using SoftMotion functions which I don't think I can. This would mean I need to get this Find Reference (index) working in SoftMotion.

0 Kudos
Message 7 of 13
(6,252 Views)

When I run just Find Reference(index) with no home function before it, the motor goes one way close to commanded distance and then the reverse direction. This happens for axis setting Encoder>Index Reference Criteria>(A,B=1), (A=0,B=1). When I change criteria to (A=1,B=0) or (A,B=0), it just goes in one direction the commanded search distance. Every time, it passes my Encoder 0 index and does not stop. It has no errors in the index subvi when it does the reversing action, and a waitUntilDone error when it just goes one direction. Please let me know if there are other settings I can try below. I know my encoder index is active high and working because I read it fine on my digital 9401.

Here are some troubleshooting tips for other people new to SoftMotion. From all my reading, the following axis settings need to be set for using Find Reference(Index) as described above: General>feedback>Encoder 0,  Encoder>counts/rev (lines of encoder), Stepper>steps/rev including microstepping setting used. Right click on the SoftMotion function you are having trouble with, convert to subvi and probe/read errors in there. They are more descriptive.

0 Kudos
Message 8 of 13
(6,229 Views)

Hi RJ12, 

 

I found a KB on how to use the 951x modules in Hybrid mode, which should allow you to use some of the FPGA properties/nodes while in scan mode. 

 

http://digital.ni.com/public.nsf/allkb/12287236ED86B789862576630059572C?OpenDocument

 

When testing this, what code are you running? Have you been able to try any of the shipping example? There is a Reference Move - Home and Index.vi that can be found in the NI Example finder under Toolkits and Modules>>NI SoftMotion>>Express VIs>>Basic

 

The settings you mentioned sound right for a reference move sound correct. I'll bring this issue up with some other engineers this afternoon and see if we can come up with some other solutions. 

 

National Instruments
Staff Certification Engineer
0 Kudos
Message 9 of 13
(6,212 Views)

Thanks Nathanael,

I've been through this knowledgebase and got hybrid mode working. So, my 9512 module is in scan interface mode (I'm using SoftMotion) and the other modules (9401) are in FPGA interface mode and everything moves great. The only function I need to add to the system is a "Find Encoder 0 index" move so that I have a reliable home/start position for my incremental encoder. It would be great if I could use a "Disable/Stop 9512 move" when index is found by 9401 in FPGA code while using SoftMotion in Real time to command the "Move 9512"s. I don't think this is possible. This would be "hybrid module mode" as opposed to "hybrid chassis mode", in my mind. Or it would be higher than SoftMotion Lite.

I used Home and Index example as the basis for my code. I tried wiring my encoder index into home and index pins so that I could run the example as is, but now I am trying to just get the Reset>Find Reference(index) move to work without the Find Reference(home) move before it. I think using my encoder index as the input to the home pin is the wrong type of signal anyway. I thought about doing a Capture because it is more accurate for fast pulses, but haven't tried yet.

I know feedback in axis settings needs to be set to Encoder 0 for this, but can Stepper Axis Loop Mode still be Open-Loop?

During axis settings I found this helpful just to ensure my counts/rev and steps/rev was correct:

http://zone.ni.com/reference/en-XX/help/371093P-01/mclvhowto/howtoclosedloopstepper/

So I see me as having a few options:

1. Start the move in RT SoftMotion, and stop/disable in FPGA code, both functions operating on 9512. Is it possible??

2. Figure out the settings that will detect my index with Find Reference(Index) express vi << should work, working on it

3. Use Capture to see the index signal instead. Is it possible??

4. Hard wire a disable of some sort when my 9401 in FPGA interface mode sees the index. Possibly capture this. Sending an indicator from FPGA to RT is not fast/reliable enough.

I still don't know what's happening when it rotates forward and then reverse during Find Reference(Index).

0 Kudos
Message 10 of 13
(6,208 Views)