Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Slowing Down Motor On Java (http://www.chiefdelphi.com/forums/showthread.php?t=90024)

spidey619 24-01-2011 22:33

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.::safety::

How can i reduce the speed without changing the arm itself?

jhersh 25-01-2011 01:27

Re: Slowing Down Motor On Java
 
Quote:

Originally Posted by spidey619 (Post 1007669)
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.::safety::

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.

germansamurai16 26-01-2011 20:22

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

drakesword 26-01-2011 22:30

Re: Slowing Down Motor On Java
 
Are you using a Jaguar? A Victor? or a Spike?

spidey619 26-01-2011 22:46

Re: Slowing Down Motor On Java
 
Currently i am using a victor to control the arm system.

drakesword 26-01-2011 22:55

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);


spidey619 28-01-2011 21:38

Re: Slowing Down Motor On Java
 
okay yayyyy it worked so awesome.............
but now i have a situation which is causing me a headache.:confused:



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. :D

drakesword 30-01-2011 20:15

Re: Slowing Down Motor On Java
 
Quote:

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



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. :D


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

ProgrammerMatt 31-01-2011 10:49

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


All times are GMT -5. The time now is 22:16.

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