LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to control 2 motors

hi every body

 

i am working in joystick to control two motors

i used DAQ 6009 and syren to control the speed and direction

i did the program but i have one problem

that when i move the joystic forword or backword only one motor is moving

and when i move the joystic left or right the other motor is moving

i connected x-axis to a0

and i connected y-axis to a1

the DAQ just has a0 and a1 output

my question is

how to move two motors at the same time

that for example when i move the joystick forword the two motors move clockwise and when move backword the two motors move counter clockwise

please i need help

thank you

0 Kudos
Message 1 of 15
(3,723 Views)

Hi Sara,

 

"i connected x-axis to a0

and i connected y-axis to a1"

 

What would happen when you "connect" Y axis (joystick for-/backward) to both outputs (a0/a1)? Would that solve your problem?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(3,716 Views)

hi

 

no i can't connect y-axis to both because there is error appear

thank you

 

0 Kudos
Message 3 of 15
(3,714 Views)

Hi Sara,

 

i would be much easier to help, if you could provide more details...

 

What kind of error? Example VIs? What have you tried so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(3,709 Views)

hi

the error that i cannot connect the y-axis to bothe a0 and a1

i connected x-axis to a0

and i connected y-axis to a1

i tryed to connected each axis to both a0 and a1 but i cannot

and this is the problem

thank you

 

0 Kudos
Message 5 of 15
(3,703 Views)

Hi Sara,

 

"i tryed to connected each axis to both a0 and a1 but i cannot and this is the problem"

 

Again the same question! Please provide more details!

 

You can't connect. Ok. But why can't you connect? What is the error you receive? Can you attach an example VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(3,699 Views)

hi

 

this is the prentscreen of my vi

 

and the error appear when i connect y or x axis is that there is one data and two tasks

 

 

0 Kudos
Message 7 of 15
(3,693 Views)

Hi Sara,

 

why can't you attach the VI? So you have to make the changes on your own...

 

What is hidden in the FALSE case of all those case structures? Surely a FALSE constant, I guess Smiley Wink

Have you ever heard the word "Rube-Goldberg"? There is a special thread here in the forum about it!

 

-You have a construct like IF TRUE THEN output TRUE - 4 times in this litte VI. Please remove it and connect the output of the comparison directly to the LEDs.

- The "IndexArray" function can be resized to show more outputs. So you can put the functionality of the 3 IndexArray nodes into just one. Well, you could also replace the whole ClusterToArray+IndexArray with just one UnbundleByName function...

 

Why can't you connect the input of both DaqAssistants with the output of one Add function???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(3,653 Views)

hi

thank ypu very much for your comment

all what you said are correct

but

still my problem is with DAQ

 

you said

Why can't you connect the input of both DaqAssistants with the output of one Add function???

 

i didnot under stand

do you mean

i should connect x and y to an add function then to DAQ

if you mean this i tryed this solution but there is error appear sais min is 0 and max 5

because the output should be 0V to 5V

 

thank you

0 Kudos
Message 9 of 15
(3,623 Views)

Hi Sara,

 

at the moment you have connected the input of the DAQAssistant with an ADD node (x + 2.5), one ADD for the X-axis, the other for the Y-axis.

 

You said you want to connect both DAQs with the Y-axis. Hence my suggestion to connect the output of the ADD, that is wired in the Y-axis dataflow, with both DAQAssistants...

 

Please attach your VI (the real VI, not a picture...) for easier helping!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 15
(3,615 Views)