Go to Post However I did tell my wife I wanted to lose 20lbs of ugly fat quickly. She told me to cut off my head. Go figure. - Ed Coleman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-03-2015, 09:57
DonavanAnnalise DonavanAnnalise is offline
Registered User
FRC #4284
 
Join Date: Jan 2015
Location: Cincinnati, Ohio
Posts: 1
DonavanAnnalise is an unknown quantity at this point
Only One side of the "mock elevator" is working

When we have one of the two mock sides commented out they work but when placed together they don't work only one dose
**This is on a prototype for testing code**

Jaguar E1 = new Jaguar(5);
Jaguar E2 = new Jaguar(4);

float Elivate = 1f;
float Elivate2 = 1f;

if(totestick.getRawButton(4)){
E1.set(-Elivate);
E2.set(Elivate2);
Relay1.set(Relay.Value.kForward);
Relay2.set(Relay.Value.kReverse);

}else if (totestick.getRawButton(1)){
// turns the elevator to Reverse
E1.set(Elivate);
E2.set(-Elivate2);
Relay1.set(Relay.Value.kOff);
Relay2.set(Relay.Value.kOn);

} else {
E1.set(0.0);
E2.set(0.0);
// else it is off
}
  #2   Spotlight this post!  
Unread 30-03-2015, 10:20
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,679
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Only One side of the "mock elevator" is working

I'm trying to figure out what you're doing here.

Do you have two separate sides of the elevator which run in opposite directions to lift, controlled by jaguars? If so, it would probably make more sense to have the Elevator2 "constant" equal -1, then when you set the speeds, the code inside the loop is either both positive or both negative.

Also, what is the function of the relays in your setup? Should you set them to some value when stopped?

Finally, just to verify that you are only declaring/assigning objects to E1 and E2 once in initialization, not once per loop? Re-declaring controller and sensor objects repeatedly can cause them to work inconsistently as they cycle through shutdown and startup. Re-declaring the floats would be a waste of CPU cycles, but is less likely to be noticeable in terms of performance.

Oh, also to verify -- java, right?
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.

Last edited by GeeTwo : 30-03-2015 at 10:22.
  #3   Spotlight this post!  
Unread 30-03-2015, 10:58
AnnaliseDonavan AnnaliseDonavan is offline
Registered User
FRC #4284
 
Join Date: Jan 2015
Location: Cincinnati,Ohio
Posts: 20
AnnaliseDonavan is an unknown quantity at this point
Re: Only One side of the "mock elevator" is working

The beginning part is set up during iterative robot then the if and else if loop is set up during the teleop Periodic the relays are for lights I just forgot to remove that part of the code
  #4   Spotlight this post!  
Unread 30-03-2015, 11:38
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is online now
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 162
nickbrickmaster is an unknown quantity at this point
Re: Only One side of the "mock elevator" is working

Have you checked the motor/jag connections to make sure they are the same polarity?

If so, and it jams while lifting, remove the negation from the second elevator jag.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:09.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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