From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reverse motor issue!

Solved!
Go to solution

Hello ! ...

 

 

          I have developed a program that has the algorith as follows:

 

1. X steps and Y steps determne the pixel array size I want.

2. For each Y the X scan through a fixed number of steps and then Y increment

3. step 2 repeats untill Y is reached its MAX state.

 

Problem :

 

After the X scan lets say 10 steps I want it to reverse the direction and return to the original and then again after Y increments X should scan and return to original.

 

Its a RASTER scan basically.

 

I am not able to figure out why and how to add the part of making the motor return to the original position.

 

please find the VI and tell me my mistakes.

 

Thanks

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 1 of 9
(2,595 Views)
Solution
Accepted by topic author abikutn

Hi,

 

You have two nested while loops: one that moves in the y-direction and the one inside that moves in the x-direction.  There are two ways you could implement moving the x-direction back to zero.

 

1.  The x-direction loop stop condition is once it has traveled to the end stop.  You can add a case right after this loop that just tells the motor to go back to zero.

2.  In the y-direction loop before the x-direction executes tell the x-direction to go back to zero.  This will cause it to rezero everytime before the x-direction starts its move.

 

Both ways will accomplish the same thing but one does the rezero after the move and two does it before.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(2,557 Views)

greg thanks for the reply ...

According to your explainanations :

1 - Does the rezero after the X finishes N steps right ?

2 - I dont clearly understand what u mean when you say it will rezero before itself .

I am sorry I am not able to understand clearly what u mean But according to me the program does the following , FInd the raster scan 1. PNG ... From this I want to go to this - raster scan 2. PNG

Am I able to convey my idea to you ?

Thank you for your time.

Critical project thats why I am breaking my head over this.

Abhi Smiley Happy

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
Download All
0 Kudos
Message 3 of 9
(2,551 Views)

Sorry RASTER SCAN 1.PNG in the previous reply is not right . This is the right one.

 

Sorry again for the trouble

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 4 of 9
(2,546 Views)

Greg I have inorporated the STEP 1 technique you told me to.

 

Have a look at the VI below and check to see if what I have done is what you mentioned me to try .

 

Thanks for your patience.

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 5 of 9
(2,539 Views)

Hi,

 

Close but this will not quite work.  You have to send the command to go back to zero after the while loop.  If you do it in the while loop then the x-direction will move one step go back to zero, one step go back to zero, etc. If you move it after the while loop then it will do all of the x-direction steps then go back to zero.  See the attached picture.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(2,502 Views)

yeah check this VI . Its working fine.

 

But here is the one thing I still dont understand ...

 

In front panel ... you see that SELECT SPEED X AXIS this is to move the motor in one step forward

the Select RETURN speed X Axis is to select the motor speed to move backward to original. 

 

The question is when I run the program the FWD steps run quite slowly but when its returning to original position it goes super fast !!!

 

Why is this happening ?

 

Thank you Gerg .

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 7 of 9
(2,493 Views)

Hi,

 

I think this is because you are telling the motor to move in small steps in the forward direction and it never has a chance to accelerate to the velocity you pick.  On the way back since it is just one long move, it has the ability to accelerate to the speed you select.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(2,486 Views)

Strange because the ability to move back is also determined by one step at a time just like how it moves forward.

 

Sorry if I am mistaken with your idea. But I hope you see my point.

 

Abhi

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 9 of 9
(2,484 Views)