Labview motor control

I made a motor control to implement one of the triggers to make the robot move foreward so i set the motor speed on both pwm 1 and 2 to -1. it sort of worked but only the right motor was working and it was very jerky. any ideas?

and also… im trying to find a way to ramp up the motors when moving it foreward with the trigger.

Im going to try to get a print screen of the code so you guys can see it.

code.doc (106 KB)


code.doc (106 KB)

Sean,

You are opening the Jaguar for PWM1 and PWM2 twice. Should be once…

When the trigger is pressed, you are controlling the Jaguars via the tank drive VI and the button control both. This is the jerkiness you see.

If I understand your intent, I think that you want to move the tank drive VI into the FALSE block of your button controlled case statement.

Regards,

Mike

i get the part about moving the tank drive VI but i dont get what you mean by wiring it twice. where else would i wire it to?

On the left side of the picture in the document you posted, you have an “DRIVE OPEN 2 MOTOR” and two “MOTOR OPEN JAGUAR” vi blocks.

You only need to open each motor once. Delete the other two.

For your two motor opens, the dev ref goes outside the while loop to the close. Thus, you will be closing them very quickly after opening them. You need to run the device references through the while loop, so that there is a data dependency on the while loop. That way it won’t close until after the while loop has stopped.

Ok i think i’m getting it now, i have attached the robot main to this post. Can you guys see if anything is wrong with the code because i am at home right now and therefore i cannot compile and debug the code.

Basic Robot Main.vi (82.3 KB)


Basic Robot Main.vi (82.3 KB)