LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Robotic arm switching modes (labview)

I am working on a 3 DOF robotic arm and I want to use a push button to switch between true and false case. The true case will execute a sequence where the robotic arm will pick and drop items, and the false case will enable the user to control every servo manually using a knob. The true case works, however the false case just don't seem to work. Any help is greatly appreciated! I've tried using the manual control on a separate vi without the automatic movement and it works, is it a timing issue?

Screenshot 2023-10-30 211845.pngScreenshot 2023-10-30 211921.png

Message 1 of 6
(785 Views)

Hi JinHerng,

 

I took a quick look at your code.  A few tips:

 

1.  Try writing 2 separate VIs, both without the push button.  VI#1 should do the automatic sequence.  VI#2 should do the manual control.  You can make sure these work separately first.  This will be much easier to debug when you put them together.

 

2. Now, to put them together.  Currently you've got 4 case structures, all connected to the same boolean button condition.  No need to separate into 4 different cases, you can have just 1 big case structure.  The "true" side should contain all of the code from VI#1.  The false side should contain all of the code from VI#2.  All of this code goes inside 1 big while loop.

 

3. Make sure the mechanical action of your push button is set to the behavior you want.  Currently it is set to "switch when pressed", which means it won't release by itself.  There's a chance that your sequence will execute a second time, and you'll be too late to switch it off.  You can consider "latch when released", this will ensure that the button releases immediately after it is pressed, and you'll only get 1 sequence.

 

Try it out, have a go, let us know what you've learned!  😊

 

BR

John

Add motion to LabVIEW in 30min or less - TENET EMotion
Finding it hard to source NI hardware? Try NI Trading Post

 

 

0 Kudos
Message 2 of 6
(735 Views)

Hi,

If you are using a push button to switch between true and false cases, ensure that you have implemented a debouncing mechanism. This prevents rapid toggling between true and false states due to electrical noise or mechanical bouncing of the button.

 

 

 

Jacob 🙂

Thanks
0 Kudos
Message 3 of 6
(611 Views)

However, in addition to this, you can also verify that the hardware can handle the simultaneous execution of automatic and manual control. Because you know some platforms may have limitations on concurrent control of certain components. 

 

https://www.ni.com/en/shop/labview/add-code-other-programming-languages-linux-administration-certification.html

Thanks
0 Kudos
Message 4 of 6
(545 Views)

Hi,

 

I just posted other possible solution in this thread but it's now live. Why?

Thanks
0 Kudos
Message 5 of 6
(580 Views)

@Jacobmall wrote:

Hi,

If you are using a push button to switch between true and false cases, ensure that you have implemented a debouncing mechanism. This prevents rapid toggling between true and false states due to electrical noise or mechanical bouncing of the button.


From the code, you can clearly see that only front panel buttons and knobs are used (so software), nothing to do with hardware buttons.

0 Kudos
Message 6 of 6
(561 Views)