From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot detect forward/reverse limits

Solved!
Go to solution

I'm having trouble with the forward and reverse limit switches for my stepper motor system. When I create an NI Softmotion axis in Labview, no matter how I configure the limit switches, they either show up as both active or both inactive, regardless of the position of the platform. For my limit switches, I am using photointerrupters. When I do not have any of the hardware turned on, the photointerrupters work as expected and give a 0 V signal when the platform is not at the limit and gives a 5 V signal when the platform is at the limit. But when I try to use the interactive panel in Labview (or in a VI for that matter too) the limits aren't detected and behave differently as well. I had a voltmeter hooked in to see how the voltage was behaving and the voltage readings were odd. In one case when I tested each switch's "active" signal, one of the limit switches was at 6.7 V and the other was at 3.7 V even though they had the exact same wiring and setup. I am completely stumped on how to wire these into the system to make them work or how to configure Labview in order to correctly recognize these limits (Meaning sourcing vs. sinking and active state being on/off). I have searched forums and manuals, but I cannot seem to find a solution. Here are more details on the system:

 

The stepper motor is moving a platform back and forth and the stepper motor is being driven by a Kollmorgen P70530 stepper drive. To communicate between the stepper drive and the computer, I am using a cRIO 9076 with a NI 9512 in the chassis. To connect the limit switches into the system, I have been using the NI 9512 37-pin terminal block. The photo interrupter that I am using is a Sharp GP1A05 OPIC Photointerrupter with Connector. For this photointerrupter, it has 3 pinouts: a Vcc (voltage source) input, a GND input, and a Vout output. The Vcc is supposed to be connected to a 5V source and GND to ground (obviously) with a pull-up resistor between Vcc and Vout (I am using a 10k Ohm resistor as that has what has worked for me in the past with this specific photointerrupter). Vout is supposed to give a 5V signal when the limit would be active and 0V when it isn't active. The way I had connected the photointerrupter to the 37-pin terminal block was as follows: For the forward limit, I had Vcc in pin 9 (+5V OUT), GND was in pin 3 (COM), and Vout was in pin 1 (Forward Limit). For the reverse limit, I had Vcc in pin 9 (+5V OUT), GND was in pin 24 (COM), and Vout was in pin 20 (Reverse Limit). I have also tried connecting the GND terminals of the photo interrupter into the GND (Shield) pin on the terminal block with no success either. As for Labview, I am running Labview 2011 SP1 on my computer. 

 

If you have any insights, I would greatly appreciate it if you would share them as I am truly stumped with something that seems on the surface to be quite trivial.

 

Thanks,

Steve

 

0 Kudos
Message 1 of 9
(6,764 Views)
Solution
Accepted by topic author sjphysics

Steve:

 

I am stumped too-

 

Manaual I looked at:

 

http://www.ni.com/pdf/manuals/372153d.pdf

 

Your pin numbers look correct.

I presume you have a power supply connect to Vsup and COM.

Looking at page 3-10 for sourcing shows no pullup resistor, have you tried removing the 10Kohm?

But looking at page A-3 for the limits levels, it shows <5V for LOW and 11-30V for HIGH.

I am confused- pg 3-10 looks like the 9512 provides its own pullup yet pg A-3 show voltages needed for the inputs.

 

Hopefully someone can clarify this.

 

-AK2DM

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 2 of 9
(6,745 Views)

Hi sjphysics,

 

Page 3-10 of the user manual shows how to properly connect the limits for sinking or sourcing configuration: 

http://www.ni.com/pdf/manuals/372153d.pdf

 

The Getting Started Guide is another great resource. In order to change the settings of the axis in LabVIEW, right-click the axis in the project explorer window and select Properties. The Limits & Home button will take you to the limits settings, where you can change the Input Type, Active State, and Digital Filter. Page 13 of shows some of these settings:

http://www.ni.com/pdf/manuals/372874d.pdf

 

Please make sure that your wiring and settings match these specifications. If this doesn't resolve the issue we can do further troubleshooting.

 

I hope this helps!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 3 of 9
(6,733 Views)

Thank you for the help! It was the 10K ohm resistor that was causing the issues. For normal operation of the photointerrupter it needs the pullup resistor there but it seems that the NI 9512 already accounts for the needed pullup resistor and adjusts by becoming sinking rather than sourcing. I then just had to mess around with the settings on the computer and it ended up being that I had to configure it as "Sourcing" for the input type, "Off" for the active state, and "50 microseconds" for the digital filter. But, all in all, the problem has been solved. Thanks again!

 

Thanks,

Steve

0 Kudos
Message 4 of 9
(6,706 Views)

Steve:

 

Glad you got it to work!

 

I'd still like to hear from NI why the specs on page A-3 are calling logic out voltage levels for the limits (I had to clean up some of the unit and GT/LT symbols):

 

Forward, reverse, and home inputs

Input type ........................................ Programmable: sinking or

sourcing

Digital logic levels, OFF state

Input voltage ............................

<= 5 V

Input current ............................

<=250 uA

Digital logic levels, ON state

Input voltage ............................ 11 to 30 V

Input current ............................

>=2 mA

Input impedance.............................. 30 kohm ± 5%

Min pulse width

2............................. 100 μs

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 9
(6,699 Views)

Hi AnalogKid2DigitalMan,

 

Could you please clarify what part of these specifications you're uncertain about? Page A-3 explains what voltage levels define the ON or OFF states for the limit switches. You can also change this setting between active high or active low. Does this not match the behavior you're seeing?

 

Thanks!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(6,682 Views)

Hi Emily:

 

I do not have any motion hardware, I was just assisting the OP.

 

What I am trying to say is that the voltage levels in the specs do not apply to figure 3-14 (Sourcing Input Config). Some poeple may get confused and try to add their own pull-up resistor to attain those levels when in fact the motion hardware already provides the pullup. Granted, a pull-up resistor is not shown for the limit switch in the figure.

 

Thanks

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 9
(6,623 Views)

hello

why my Arduino is not detected in my computer?

and I use the labview interface for arduino?

0 Kudos
Message 8 of 9
(6,276 Views)

Hi zuhdissmail!  

 

The procedure for setting up your Arduino is here: 

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

 

Do you have all the latest drivers?  And the VIPM?  There is a link for more Arduino examples at the bottom, definitely try those out, too.

 

Make sure everything is up to date and set up correctly, and if it still doesn't work, then we'll take it from there.

Julian R.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(6,257 Views)