Go to Post Why did they get rid of the headphone jack though? =p - sportzkrazzy [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2011, 22:33
spidey619 spidey619 is offline
Registered User
FRC #1796
 
Join Date: Jan 2010
Location: L.I.C.
Posts: 3
spidey619 is an unknown quantity at this point
Exclamation Slowing Down Motor On Java

I am a new person to the world of java and i have stumbled on to a problem. When trying to program a prototype arm it goes to fast.

How can i reduce the speed without changing the arm itself?
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2011, 01:27
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Slowing Down Motor On Java

Quote:
Originally Posted by spidey619 View Post
I am a new person to the world of java and i have stumbled on to a problem. When trying to program a prototype arm it goes to fast.

How can i reduce the speed without changing the arm itself?
Just divide the number you are sending to the set() function by some number greater than 1.
Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2011, 20:22
germansamurai16's Avatar
germansamurai16 germansamurai16 is offline
Registered User
AKA: Jonathan Nagel
FRC #0224 (The Tribe)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Piscataway
Posts: 8
germansamurai16 is on a distinguished road
Send a message via AIM to germansamurai16 Send a message via MSN to germansamurai16 Send a message via Yahoo to germansamurai16
Re: Slowing Down Motor On Java

the code looks for a magnitude value from the controller that ranges from -1 to 1. like jhersh said, divide by some number.

2 would give half speed, for the best results if 2 is too large move the number by increments of .5
__________________
--Nagel
Reply With Quote
  #4   Spotlight this post!  
Unread 26-01-2011, 22:30
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: Slowing Down Motor On Java

Are you using a Jaguar? A Victor? or a Spike?
Reply With Quote
  #5   Spotlight this post!  
Unread 26-01-2011, 22:46
spidey619 spidey619 is offline
Registered User
FRC #1796
 
Join Date: Jan 2010
Location: L.I.C.
Posts: 3
spidey619 is an unknown quantity at this point
Re: Slowing Down Motor On Java

Currently i am using a victor to control the arm system.
Reply With Quote
  #6   Spotlight this post!  
Unread 26-01-2011, 22:55
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: Slowing Down Motor On Java

So based on what you said I am assuming you are doing something along this line

Code:
Victor a_motor = new Victor(1);
a_motor.set(1);
If you wanted to go slower you would want a percentage of the power so for example 25% power

Code:
Victor a_motor = new Victor(1);
a_motor.set(0.25);
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2011, 21:38
spidey619 spidey619 is offline
Registered User
FRC #1796
 
Join Date: Jan 2010
Location: L.I.C.
Posts: 3
spidey619 is an unknown quantity at this point
Re: Slowing Down Motor On Java

okay yayyyy it worked so awesome.............
but now i have a situation which is causing me a headache.



how can i control the motor, using the victor, going forward and reverse using different buttons on the joystick cause i need the arm to go up and down.


Thanks so much for your help people i really appreciate it.
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2011, 20:15
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: Slowing Down Motor On Java

Quote:
Originally Posted by spidey619 View Post
okay yayyyy it worked so awesome.............
but now i have a situation which is causing me a headache.



how can i control the motor, using the victor, going forward and reverse using different buttons on the joystick cause i need the arm to go up and down.


Thanks so much for your help people i really appreciate it.

Set the value to a negative number for reverse direction

e.g. set (0.5) for 50% forward and set(-0.5) for 50% reverse
Reply With Quote
  #9   Spotlight this post!  
Unread 31-01-2011, 10:49
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Slowing Down Motor On Java

Thats easy
Replace # with the button numbers and motor with your victor
Code:
if (joystick.getRawButton(#) == true)
{
motor.set(0.25)
}
else
{
motor.set(0.0)
}
if (joystick.getRawButton(#) == true)
{
motor.set(-0.25)
}
else
{
motor.set(0.0)
}
Programmer Matt,
Gus Robotics, team228.org
Reply With Quote
Reply


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 22:16.

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