LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple project with robotic arm and vision module

Hello,

i have decided to create sipmle detect system in work area of the robotic arm. My task: detection system during operation robotic arm finds match well then robotic arm stop his operation. If after x seconds there are no matches robotic arm starts his operation again. I have tried find a solution:

first, i have split my project on 2 parts. Part 1 Autonomus sequence for robotic arm using arduino.

 

Autonomous sequence.png

  

Part 2 sipmle template detection.Template detection.png

 

 

Next i combined 2 parts and have tried to implement my task as follows: i connected output of my comparison mode (gteater or equal) to loop condition like on image.

 

number of matching.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ofc it was a stupid mistake and when i pressed run my robotic arm turned on the angle 110 and stopped before success matching. Maybe anyone have solution or somebody can to advice me?

Best regards 

 

 

Message 1 of 8
(4,271 Views)

Don't embed pictures of code -- attach the actual VI so we can really see what you are doing.  Don't use the Sequence structure (it is almost never needed).  Do you understand the notion of Data Flow, the "Main Idea" behind LabVIEW?  If so, then you should see that simply running error lines between functions "sequences" them!  Also, having the same function run 12 times with 12 different sets of inputs cries out for a For loop (for the repetition, but with nothing wired to the "N" input) and a pair of Arrays holding the sets of inputs you want to use (even better would be to create a Cluster of your two inputs and have a single Array of Clusters, but I'm guessing you don't know about clusters ...).

 

Bob Schor

Message 2 of 8
(4,239 Views)

Thank you for reply, 

I use the Sequence structure because don't know how to get the desired result as a aotunomous sequence. Also i don't know about clusters, so need to learn more about them. Attached th VI.

Best regards

0 Kudos
Message 3 of 8
(4,230 Views)

Yes, the Timer functions are the "exception" to the rule "You (almost) never need the Sequence Structure".  Sorry, I couldn't see your VI

 

But here's what I was hoping you'd do -- turn the Sequence into a Loop with arguments.  I created a Servo Arg Cluster of two U8's, Servo and Arg (as your Servo VIs appear to have two U8 arguments and I'm guessing the first is the Server number), and a second Timed Servo Arg cluster that added a Duration parameter.  I then built arrays of these clusters (it's easy to see the sequence by looking at the Array, and economical of Block Diagram space).  Here's how it looks (I left the Cluster, unwired, on the Front Panel so you could see it).

DEMO Servo Sequence.png

I've also attached the code as LabVIEW 2016 (I can't safely install 2017).

 

Bob Schor

 

Message 4 of 8
(4,207 Views)

Thank you sir,

I've some modified your VI and replaced UTIL configure servo and servo write angle.Yes, you're right about "the first is the Server number". Sorry you can't see my code ( just deleted 2015 version and uses only 2017 now), so i've attached image:DEMO Sequence.png

It's very useful for me, now i can use clusters for my previous project and future projects i hope.

Now l'll search solution for stop servo when match template is detected.

Best regards,

N

Message 5 of 8
(4,196 Views)

One "side benefit" to this scheme is that if you have an algorithm for the servo sequence, you can build the array programmatically using a For loop or a Simple State Machine rather than manually creating an Array Constant.

 

Bob Schor

0 Kudos
Message 6 of 8
(4,190 Views)

I'm still a beginner in the labview so can you explain to me how you did it

0 Kudos
Message 7 of 8
(3,937 Views)

AIUUUUDAAAA!!! 

0 Kudos
Message 8 of 8
(3,051 Views)