Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Program so far - help please (http://www.chiefdelphi.com/forums/showthread.php?t=75031)

chinckley 20-02-2009 10:48

Program so far - help please
 
1 Attachment(s)
Here is what we have so far. I have added the Main vi.

I have looked at all the TipJar videos pertaining to FRC.
I have read much of the FRC Programming Guide.
I had trouble with Chapter 4 as there were no screen prints or samples
to explain what we were suppose to do. I got ahold of the Electrical diagrams for our robot today. They tell me I need these. I was able to get through the Chapters 5 and 29. I am going to work on Chapter 32 today.
The others I read but do not think we need.

Can anyone please help me understand if we are even on the right path.

Our robot is simple. It moves forward, back and turns beautifully with 2 joysticks and 2 CIMS motors. This part of the program works.

We have a chain mechanism that has hooks that picks up the balls.
The motor it uses is the globe motor. We want the following:

1. Right hand joystick trigger - make the globe motor move the chain forward.
2. Left hand joystick trigger - make the globe motor move the chain backwards. This only is used if something gets stuck.

The dumper is using the keyang motor and we want it to do the following:

3. Button that thumb rests on (right hand) make the keyang motor move the dumper forward.
4. Button that thumb rests on (left hand) make the keyang motor move the dumper back. This is only used if a ball gets stuck.


Please if you have any ideas that could help us I would appreciate it.
We compete on Thursday at Traverse City.

Luke Pike 20-02-2009 12:26

Re: Program so far - help please
 
Are the motors run off speed controllers or relays? In your code you have two relays, I was just wondering as it makes a difference how they are wired.

chinckley 20-02-2009 13:06

Re: Program so far - help please
 
Quote:

Originally Posted by Luke Pike (Post 825465)
Are the motors run off speed controllers or relays? In your code you have two relays, I was just wondering as it makes a difference how they are wired.

We are using Spike relays.

Uberbots 20-02-2009 13:25

Re: Program so far - help please
 
1 Attachment(s)
Well first you have to do the obvious, you need to open the relay device, and the joystick devices if you still havent.

you can use the joystick "get.vi" which (among other things) returns a cluster of button values for you to use. simply do an "unbundle by name" to access the individual buttons (button 1, 2, 7, etc)

i dont know which buttons are the ones you are referring to, but they should be clearly numbered on the joystick itself (i think 5 is the trigger and 2 is the thumb button. i think)

next you need to make a case structure. because you have two different buttons that dont neccesarily operate independently (and telling a motor to go both forwards and backwards doesnt work) you need to make the labview equivalent of an if-elseif-else structure. see the attached VI for details. im assuming you are somewhat familiar with binary numbers with this one (-;

i have those random controls in there so the VI wouldnt be broke. you can turn it into a subvi if you want to.

Luke Pike 20-02-2009 13:44

Re: Program so far - help please
 
1 Attachment(s)
Beat me to it Uberbots. Oh well, here's my version. Same concept, converts the joystick button values to binary and only sets the relay if its 0, 1, or 2.

chinckley 20-02-2009 16:07

Re: Program so far - help please
 
1 Attachment(s)
How does this look?

Can I use the autonomous vi with just changing the time it is moving forward in the given file or do I need to attach it into the Tank drive?


All times are GMT -5. The time now is 10:35.

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