Go to Post I have died and gone to heaven. :) - dlavery [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 14-02-2009, 08:12
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Programmer a motor with a trigger

hello, the idea im trying to do is program leftStick Get Raw Button(1) to set the drive motors on pwm1 and pwm 2 leftmotor and rightmotor to run at a speed of .2, now if i have set 0.2 and set 0.2, the left motor goes in reverse, if i do -0.2, it doesnt move at all, what is the proper way to set these two motors to the same speed by holding a trigger?
__________________
"I would love to change the world but no one will give me the source code"
  #2   Spotlight this post!  
Unread 14-02-2009, 08:14
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Programmer a motor with a trigger

First make sure that the Open Motor or Drive ref is for the right kind of motor controller. The PWM period is different and especially talking to a victor as if it is a jaguar is not a good idea.

If that isn't it, try bumping the value a bit higher. -0.2 may not be enough to move it.

Greg McKaskle
  #3   Spotlight this post!  
Unread 14-02-2009, 08:34
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Programmer a motor with a trigger

i tried that, but here let me give you the code i tried and maybe you could find somethign thats wrong

RobotDrive* myRobot;
Jaguar* leftmotor;
Jaguar* rightmotor;
myRobot = new RobotDrive(1, 2);
leftmotor = new Jaguar(1);
rightmotor = new Jaguar(2);


if (!ds->GetDigitalIn(ARCADE_MODE)) {
myRobot->TankDrive(leftStick, rightStick);
}
else {
myRobot->ArcadeDrive(leftStick);
}

if (rightStick->GetRawButton(1)) {
leftmotor->Set(-0.5);
rightmotor->Set(0.5);
}
else {
leftmotor->Set(0.0);
rightmotor->Set(0.0);
}

that's what i have, can someone please help tell me why the left motor doesnt work when i do this. if i have both positive numbers, then the left motor goes in reverse
__________________
"I would love to change the world but no one will give me the source code"
  #4   Spotlight this post!  
Unread 14-02-2009, 08:39
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Programmer a motor with a trigger

I'm not a jaguar expert. Is there a jumper that affects this?

Greg McKaskle
  #5   Spotlight this post!  
Unread 14-02-2009, 08:41
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Programmer a motor with a trigger

no there isnt a jumper that affects this.. does anyone else have any ideas?
__________________
"I would love to change the world but no one will give me the source code"

Last edited by programmr : 14-02-2009 at 08:48.
  #6   Spotlight this post!  
Unread 14-02-2009, 12:47
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Programmer a motor with a trigger

does anyone else have any ideas as to why this doesnt work....???? PLEASE HELP! Thank You
__________________
"I would love to change the world but no one will give me the source code"
  #7   Spotlight this post!  
Unread 14-02-2009, 18:43
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Programmer a motor with a trigger

OK, I had more time to look up what I was thinking. The jaguar has jumpers that need to be installed if you are not using the limit switches. If you don't have the jumpers, I think that can result in a motor controller that will not move in one of the directions.

It seems like something to double check.

Greg McKaskle
  #8   Spotlight this post!  
Unread 14-02-2009, 19:06
Golto's Avatar
Golto Golto is offline
Registered User
AKA: Pat Plude
FRC #4572 (BArlow RobAutics)
Team Role: Mentor
 
Join Date: Oct 2006
Rookie Year: 2007
Location: Bethel, CT
Posts: 91
Golto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of light
Re: Programmer a motor with a trigger

try this (modify as needed)

Code:
while (IsOperatorControl)
if (LeftStick.GetRawButton(1) == true)
{
    roller.Set(1.0);
}
if (LeftStick.GetRawButton(1) == false)
{
    roller.Set(0.0);
}
Wait(0.005);
LeftStick is your left joystick variable
Roller is the function to be used with the trigger

No need for semaphores, and don't worry, the cRIO is so fast, you'd never notice the lag.

This is part of 558's codebase. If you need more help email me:

pplude@freehugalliance.com
__________________
  #9   Spotlight this post!  
Unread 14-02-2009, 22:00
yarb65 yarb65 is offline
Coach
AKA: T Bray
FRC #3189 (Circuit Breakers)
Team Role: Coach
 
Join Date: Jan 2005
Rookie Year: 2005
Location: El Dorado, CA
Posts: 85
yarb65 has a spectacular aura aboutyarb65 has a spectacular aura about
Re: Programmer a motor with a trigger

I think the original question was about getting a motor to reverse using a button. I have tried using a -1 and nothing happens when button is pushed. I am using a Victor and Windriver. If someone has actually done it, how?
__________________
2013 Sacramento Regional Winner (3189,701,2489))
2012 Israel Regional Winner (1662,1690,1937)
2008 Sacramento Regional Winner (1662,115,2122)
2006 Sacramento Regional Winner (1662,852,1726)
  #10   Spotlight this post!  
Unread 14-02-2009, 23:16
Golto's Avatar
Golto Golto is offline
Registered User
AKA: Pat Plude
FRC #4572 (BArlow RobAutics)
Team Role: Mentor
 
Join Date: Oct 2006
Rookie Year: 2007
Location: Bethel, CT
Posts: 91
Golto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of lightGolto is a glorious beacon of light
Re: Programmer a motor with a trigger

would something along the lines of

Code:
if (LeftStick.GetRawButton(1) == true)
{
RobotDrive = RobotDrive * (-1);
}
work?
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help with some questions~new programmer bilal1219 Programming 2 29-01-2008 11:44
New Programmer working with cmu cam2 pbrules15 Programming 13 14-07-2007 22:40
NEED PROGRAMMER TO HELP WITH PROGRAMING Reaper40 Programming 4 02-02-2007 17:31
pic: The programmer needs some alone time with the robot! Karthik1 Extra Discussion 7 23-02-2005 10:35
problems with our programmer AlphaOmega870 Programming 12 31-01-2003 08:23


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

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