Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   PROGRAMMING HELP PLEASE ! (http://www.chiefdelphi.com/forums/showthread.php?t=83432)

dcarswell 22-02-2010 20:39

PROGRAMMING HELP PLEASE !
 
1 Attachment(s)
Hello,

My name is DeAndre and I was wondering if someone could possibly tell me what is wrong with my code:

We have two Limit Switches on our Robot:

Limit Switch 1: When hit reverses Kicker Motor .

Limit Switch 2: When hit stops the Kicker Motor .

Limit Switch 1 is in front of Limit Switch 2 .

And also the Kicker Motor is attached to Button 1 on the joystick .

So when we press Button 1 it enables the Kicker Motor to move forward, then when it hits Limit Switch 1 it automatically reverses to consequentially hit Limit Switch 2 and stop. Then it should automatically reset it self back to its original state. (Hope I provided enough description)

Attached is our Teleop.vi !

dcarswell 22-02-2010 21:09

Re: PROGRAMMING HELP PLEASE !
 
1 Attachment(s)
Here is also a picture !

663.keith 22-02-2010 21:10

Re: PROGRAMMING HELP PLEASE !
 
I would highly recommend checking out the FRC mastery site, especially the section on state machines http://frcmastery.com/try-me/state-machines/. The provided example is very similar to the method you are describing.

I hope this helps

anyheck 23-02-2010 00:54

Re: PROGRAMMING HELP PLEASE !
 
I think that you are encountering a problem because you are referencing the motor power three times with different 'set speed' VIs and are hitting some sort of race condition.

One thing that is not obvious is that the case statement can accept numeric inputs as well as Boolean inputs.

An 'easy' way to make a case statement that takes multiple booleans and does different things when they are set is to make a case statement and build an array of your booleans using 'build array'.

You can then wire the boolean array to "boolean array to number' operator and wire the output of that to your case statement.

Then you just need to use boolean math and put a motor speed value in each case.

00=0 -> (FF= case 0)
01=1 -> (FT= case 1)
10=2 -> (TF= case 2)
11=3 -> (TT= case 3)

So there you have 4 different values with two boolean inputs and you can just use one "motor set speed" vi.

Hope this is clear I don't have labview available at the moment or I'd take a screen shot.

Regards,
Sten

Omar 23-02-2010 11:41

Re: PROGRAMMING HELP PLEASE !
 
Also check the "Limit 1" string fed into the RefNum Registry Get.vi

You have two (2) spaces between "Limit" and the "1".
If that is the way you set it up in your Begin VI then you are OK
But if it is different that will cause you problems

Omar 23-02-2010 11:50

Re: PROGRAMMING HELP PLEASE !
 
2 Attachment(s)
This is what Sten is talking about.

kws4000 23-02-2010 15:48

Re: PROGRAMMING HELP PLEASE !
 
1 Attachment(s)
I believe I am trying to accomplish the same thing. I have 2 normally open switches which should turn off the relay motor once a true is recieved, which will be turned to a false, which is combined with a true from the joystick in a XOR (Not Exclusive Or) which will return false, which will turn it off. By default with nothing touching the buttons or switches, the relay should all be off, right?

Thanks

Omar 23-02-2010 17:48

Re: PROGRAMMING HELP PLEASE !
 
1 Attachment(s)
Let me restate what I think you want

IF Button 1 is pressed .AND. limit switch 1 is .NOT. true then run forward
else
IF button 2 is pressed .AND. limit switch 2 is .NOT true then run rev.
else
Stop

kws4000 23-02-2010 17:56

Re: PROGRAMMING HELP PLEASE !
 
Exactly

kws4000 23-02-2010 18:37

Re: PROGRAMMING HELP PLEASE !
 
that's right

whcirobotics 23-02-2010 19:56

Re: PROGRAMMING HELP PLEASE !
 
PLEASE HELP robot is due in 3 hours, and our C-Rio isnt communiting!!!!

WE TRIED WIRELESSLY USING THE ROUTER, WITH THE IP : 10.15.15.10, SUBNET: 255.0.0.0 GATEWAY 10.15.14.4 PLEASE HELP!!! IS SOMETHING WRONG PLZ ONLY 3 HOURS LEFT HELP IS MUCH AP[PRECIATED

kws4000 23-02-2010 19:59

Re: PROGRAMMING HELP PLEASE !
 
are you sure your ip addresses were correct? what you posted is 10.15.15.10
and 10.15.14.4, right? check the third set of numbers, they should be the same.

can someone please answer my problem now?

whcirobotics 23-02-2010 20:10

Re: PROGRAMMING HELP PLEASE !
 
yes i have:Classmate :
IP: 10.15.14.10
SUBNET 255.0.0.0
GATEWAY: 10.15.14.4

kws4000 23-02-2010 20:14

Re: PROGRAMMING HELP PLEASE !
 
Are the bridge(robot) and router(DS) correct?

whcirobotics 23-02-2010 20:24

Re: PROGRAMMING HELP PLEASE !
 
DENINATELY (dont mind my spelling only got 1 hour till robot due )

we had it working like 3 hours ago. SUDDENLY STOPPED!!!

kws4000 23-02-2010 20:30

Re: PROGRAMMING HELP PLEASE !
 
common mistake: is the cable plugged into #2 on the cRIO? it should be #1. have you downloaded the new 2.1 labview and 1.1 ds updates? reformated cRIO(v20), reloaded code, rebooted?

whcirobotics 23-02-2010 20:32

Re: PROGRAMMING HELP PLEASE !
 
Quote:

Originally Posted by kws4000 (Post 927467)
common mistake: is the cable plugged into #2 on the cRIO? it should be #1. have you downloaded the new 2.1 labview and 1.1 ds updates? reformated cRIO(v20), reloaded code, rebooted?

Yes we gave plugged it into port #1 and yes we have updated to 2.1 update, BUT 1.1 does not update. If you could please be kind enough to guide us through how to update the DS, if thats the reason the C-RIo isnt giving any packets to the classmate.

kws4000 23-02-2010 20:35

Re: PROGRAMMING HELP PLEASE !
 
first, do you have 1.1 DS? once you do, just click autorun.exe. Long time to install it's componenets.

whcirobotics 23-02-2010 20:38

Re: PROGRAMMING HELP PLEASE !
 
IT DOES NOT TAKE A LONG TIME TO INSTALL. IT JUST COMPLETES FAST

DS IS NOT UPDATED

kws4000 23-02-2010 20:41

Re: PROGRAMMING HELP PLEASE !
 
does the dashboard have a gyro compass on it? if yess, then it is updated.

whcirobotics 23-02-2010 20:46

Re: PROGRAMMING HELP PLEASE !
 
OO i already had the ds updated b4, yes it has the compass, but when i entered the driver station:
I get this error " There is an ip address conflict with another system on the network"

WE have not changed the ip but it just happened i dont know why please help much appreciated

kws4000 23-02-2010 20:51

Re: PROGRAMMING HELP PLEASE !
 
there should only be the classmate, router, bridge, cRIO, and camera(optional). wild card: any other wireless network in area that for some freak reason has the same IP addresses?

whcirobotics 23-02-2010 20:55

Re: PROGRAMMING HELP PLEASE !
 
Quote:

Originally Posted by kws4000 (Post 927494)
there should only be the classmate, router, bridge, cRIO, and camera(optional). wild card: any other wireless network in area that for some freak reason has the same IP addresses?

no we have only the C-Rio with the modules in the correct spot, the classmate which is not broken from all the stress we put on it, the Bridge is connected, and the camera is connected also atm. I do not know any other devices with the same ip address . But for some freaking reason it was working before and suddenly something went horrifically wrong internally, which i got to know about as i came back from eating. So I do not know what happened.

Please if you have any suggestions as to get it to communicate please help, time is golden. only 30 minutes help much appreaciated

whcirobotics 23-02-2010 21:18

Re: PROGRAMMING HELP PLEASE !
 
tnx for all the help, our time is up. We packed it up. :( unfortuanetetly did not finish :(

Alan Anderson 23-02-2010 22:57

Re: PROGRAMMING HELP PLEASE !
 
Quote:

Originally Posted by whcirobotics (Post 927446)
yes i have:Classmate :
IP: 10.15.14.10
SUBNET 255.0.0.0
GATEWAY: 10.15.14.4

You should never have to set the Classmate's IP address. The Driver Station application sets it for you when you configure it with your team number. But if you've indeed managed to set it to 10.15.14.10, you need to fix it immediately -- it's supposed to be 10.15.14.5 instead.

(The router is probably configured to give out dynamic addresses starting at 10.15.14.10, and that would be why you got an IP address conflict from some other system that connected to the router.)


All times are GMT -5. The time now is 02:57.

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