LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LimitSwitch Labview

Hi,

Below I attached the code I wrote to check whether the limit switch works properly or not. Now I am struggling to integrate this to the stepper motor. My goal is to stop the stepper motor and switch direction when it touches the limit switch. There will be 2 limit switches on the x-axis. The bigger goal of this project is to automate a microscope stage movement with the limit switches but right I am stuck.

 

Thank you,

Ashiful

0 Kudos
Message 1 of 10
(1,256 Views)

@Ash4321 wrote:

Hi,

Below I attached the code I wrote to check whether the limit switch works properly or not.


Sooo... does it work or not?

 

Since we cannot see your stepper motor code where you want to integrate this, it is impossible to make any suggestions at all. What kind of architecture are you using?

 

0 Kudos
Message 2 of 10
(1,222 Views)

I'm assuming it doesn't, because he reads the switch value inside the loop and only changes motor value once he manually exits the loop.

0 Kudos
Message 3 of 10
(1,208 Views)

Also you should not rely totally on software, your limit switches should simultaneously disable the stepper motor and signal your program the limit was reached.

========================
=== Engineer Ambiguously ===
========================
Message 4 of 10
(1,188 Views)

There were signals and the limit switch worked but I need help integrating it to the motor.

0 Kudos
Message 5 of 10
(1,116 Views)

How do you expect anyone to help integrating this into your motor code if you don't even show us that?

0 Kudos
Message 6 of 10
(1,096 Views)

Sorry, I should've attached my motor code. Here I attached it below.

0 Kudos
Message 7 of 10
(1,079 Views)

I also need help with one more thing. I am using the motor to automate a microscope stage moving on the x-direction. I needed to start the stage at a certain location and control the speed. I was wondering how to go about that. I know we can control the speed using duty cycle and start the motor at that chosen speed. But how would choose the location where the motor would start.

 

Thank you,

Ash

0 Kudos
Message 8 of 10
(1,075 Views)

Well if you need certain location during your motor's travel, then you need sensors.

What kind of sensors depends on your application, if you only have one location you are worried about you could use limit switch at that location.

 

Really you are being very vague with your information here and it's been hard to help you...

0 Kudos
Message 9 of 10
(1,061 Views)

Ideally, I would want to start the microscope stage from the furthest left and move it using the motor to the right. Then, when it hits the limitswitch it would change direction to the left until hitting the left limitswitch and continue on. This way the image can be captured for the longest time. I hope this makes sense and if you need anything else I will try my best to provide.

 

Thank you

0 Kudos
Message 10 of 10
(1,052 Views)