Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   servo (http://www.chiefdelphi.com/forums/showthread.php?t=91714)

Ian McShane 16-02-2011 13:08

Re: servo
 
I am also having trouble connecting the unbundled buttons going through the case structure and into the motor set output vi. :confused:

Vikesrock 16-02-2011 13:39

Re: servo
 
Quote:

Originally Posted by Ian McShane (Post 1024361)
I am also having trouble connecting the unbundled buttons going through the case structure and into the motor set output vi. :confused:

A Joystick button returns a boolean. The motor set output requires a number. If you want to feed the numeric value of a boolean (0 or 1) into the set output VI (this would run a motor in one direction whenever the button is held and stop it when released there is a small VI block that will do the conversion.

I don't have Labview in front of me here at work, but I would guess that it is in the Boolean palette and if I recall correctly has "0:1" on the icon.

Ian McShane 16-02-2011 14:04

Re: servo
 
When you get the chance, can you modify the attachment i added before and show me that.:D

Vikesrock 16-02-2011 14:09

Re: servo
 
Quote:

Originally Posted by Ian McShane (Post 1024410)
When you get the chance, can you modify the attachment i added before and show me that.:D

I head straight from work over to the school to work with 3573 where I don't have Internet access. I will take a look at the attached code when I get home this evening (6 or 7 ET).

Ian McShane 16-02-2011 17:05

Re: servo
 
that is great, thanks.

Ian McShane 16-02-2011 17:29

Re: servo
 
When i attach the green button wire to the sync group input on the set output motor vi, it just says that it's error wire. that the wire does not match the vi input.

Ian McShane 16-02-2011 18:33

Re: servo
 
any other homemade diagrams would be welcome too:D

Vikesrock 16-02-2011 19:46

Re: servo
 
1 Attachment(s)
A While Loop in Teleop set to run once with nothing passed in or out has no real purpose. I would remove it for ease of reading.

Your servo code creates a race condition. You are setting the value two separate times with two separate pieces of code. Where the servo will end up is not determinate and may not be consistent. I have shown one way of wiring the up and down commands using a single Servo Set VI. You should be able to follow that example to fix the left-right servo code.

I have included an example of controlling a motor with a joystick y-axis, a button that runs it one direction and two buttons that run it in opposite directions.

The PWM channels are specified when you open the device in Begin.VI. I have included an example of how to open a motor and set the refnum in the attached teleop file but this is NOT where that code should go in your project. It must be done in Begin.

Sync groups are an advanced function used with CAN that you don't need to worry about right now. You want to be wiring into the terminal labeled "output" on the Motor Set Output VI.

If you have any other questions or are having difficulty understanding any of the examples please feel free to ask.

Ian McShane 16-02-2011 19:53

Re: servo
 
omg thank you so much!!!!you are awsome!!!!!!hopefully we will see you at the nationals.:D :D :D :D :D

Ian McShane 17-02-2011 16:31

Re: servo
 
And how do i program an arm in autonomous, example pleeeeeeeeeeeeease. say i want to wait 6 seconds for the arm to move up for 3 seconds.

Ian McShane 17-02-2011 17:55

Re: servo
 
and how do i make a motor move for some odd amount of seconds and then stop.


All times are GMT -5. The time now is 20:36.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi