Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Motor Speed Values (http://www.chiefdelphi.com/forums/showthread.php?t=126534)

LFRobotics 15-02-2014 19:34

Motor Speed Values
 
What is the max speed value I can give a motor?

Like is

Code:

motor.set(10);
any faster than

Code:

motor.set(1);
THANKS!

matthewdenny 15-02-2014 19:41

No. The motor values go from -1 to 1. Giving it a value of 10 is either going I cause an error or be the same as 1.

otherguy 15-02-2014 19:57

Re: Motor Speed Values
 
Quote:

Originally Posted by LFRobotics (Post 1343658)
What is the max speed value I can give a motor?

The set method calls the setSpeed method of the PWM class.

If you look at the source code of this class, you can see that any input is constrained to be between 1.0 to -1.0.

Code:

final void setSpeed(double speed) {
            // clamp speed to be in the range 1.0 >= speed >= -1.0
            if (speed < -1.0) {
                speed = -1.0;
            } else if (speed > 1.0) {
                speed = 1.0;
            }
...

1.0 and -1.0 don't directly correlate to an actual motor speed. They will just dump 100% battery voltage to the motor in the specified direction. The speed the motor will travel at under this condition is dependent on a number of factors like gearing, load, battery voltage, etc.

LFRobotics 15-02-2014 22:56

Re: Motor Speed Values
 
Okay - THANKS!


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

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