Go to Post work? I can't remember when the last time i did that was... - Carolyn Duncan [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 05-03-2015, 21:24
microman1934 microman1934 is offline
Registered User
AKA: Uday SHarma
FRC #4939 (Allspark9)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2014
Location: Vaughan
Posts: 7
microman1934 is an unknown quantity at this point
Limit speed of 4 chassis CIM motors

Hi there,

I'm from team 4939 and for this year's competition, our robot turned out quite tall. So in order to decrease tipping of the robot, I was wondering if it was possible to limit the speed of the 4 chassis CIM motors.

Thank you,
Uday Sharma
  #2   Spotlight this post!  
Unread 05-03-2015, 21:27
Qmcdonn Qmcdonn is offline
Registered User
FRC #2374
 
Join Date: Jan 2015
Location: Portland, OR
Posts: 3
Qmcdonn is an unknown quantity at this point
Re: Limit speed of 4 chassis CIM motors

You could certainly do this in software by setting a multiplier for the speed to 0.5 or something like that. I do not know of any electrical way to achieve the same result.
  #3   Spotlight this post!  
Unread 05-03-2015, 21:30
DanielPlotas DanielPlotas is offline
Registered User
FRC #1984 (Raider Revolution Robotics)
Team Role: College Student
 
Join Date: Mar 2013
Rookie Year: 2012
Location: OP Kansas
Posts: 98
DanielPlotas will become famous soon enoughDanielPlotas will become famous soon enough
Re: Limit speed of 4 chassis CIM motors

What language?
__________________
Sleep? What is that? A rare Pokemon?
  #4   Spotlight this post!  
Unread 05-03-2015, 21:46
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: Limit speed of 4 chassis CIM motors

You have a few ways to do this:

One way would to just multiply your inputs from the joystick by a constant, less than 1, and pass that value to your motor.Set() function.

Another way, would be to limit the actual speed of your robot. For this to work, you would need encoders on each side of the robot, to monitor your speed.

Then you have an if statement, comparing the current speed of your robot, to a predefined "maximum" speed. If you are approaching your maximum speed, lower the output of the motors by a certain amount.

I would suggest, for either solution, you have a toggle to turn it on and off. Maybe you will want to go full speed for some reason? Who knows.
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)
  #5   Spotlight this post!  
Unread 05-03-2015, 21:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Limit speed of 4 chassis CIM motors

Quote:
Originally Posted by microman1934 View Post
So in order to decrease tipping of the robot, I was wondering if it was possible to limit the speed of the 4 chassis CIM motors.
You may want to limit acceleration.


  #6   Spotlight this post!  
Unread 05-03-2015, 21:52
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 578
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Limit speed of 4 chassis CIM motors

http://thinktank.wpi.edu/article/140

If you are underweight, you can also lower the center of gravity by adding ballast low in the robot.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
  #7   Spotlight this post!  
Unread 05-03-2015, 21:56
microman1934 microman1934 is offline
Registered User
AKA: Uday SHarma
FRC #4939 (Allspark9)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2014
Location: Vaughan
Posts: 7
microman1934 is an unknown quantity at this point
Re: Limit speed of 4 chassis CIM motors

we are using java and we are underweight but by about 2 pounds
  #8   Spotlight this post!  
Unread 05-03-2015, 22:04
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 578
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Limit speed of 4 chassis CIM motors

http://www.chiefdelphi.com/media/papers/2211 could be translated to Java fairly straightforwardly.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
  #9   Spotlight this post!  
Unread 05-03-2015, 22:11
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Limit speed of 4 chassis CIM motors


What motor controllers are you using for your drivetrain motors? CAN or PWM?


  #10   Spotlight this post!  
Unread 05-03-2015, 22:17
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Limit speed of 4 chassis CIM motors

Quote:
Originally Posted by Ether View Post
You may want to limit acceleration.
http://www.chiefdelphi.com/forums/sh...69&postcount=8

http://www.chiefdelphi.com/forums/sh...22&postcount=2


  #11   Spotlight this post!  
Unread 05-03-2015, 22:22
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,653
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: Limit speed of 4 chassis CIM motors

Quote:
Originally Posted by microman1934 View Post
So in order to decrease tipping of the robot, I was wondering if it was possible to limit the speed of the 4 chassis CIM motors.
Quote:
Originally Posted by Ether View Post
You may want to limit acceleration.
Quote:
Originally Posted by nighterfighter View Post
You have a few ways to do this:

One way would to just multiply your inputs from the joystick by a constant, less than 1, and pass that value to your motor.Set() function.

Another way, would be to limit the actual speed of your robot. For this to work, you would need encoders on each side of the robot, to monitor your speed.
Limiting acceleration using encoders would require writing some code to calculate the acceleration from the speed (just the change in speed divided by the elapsed time). I don't know of any libraries to do this, so unless you have some experienced programmers, you probably wouldn't want to attempt it at this late date.

On the other, hand, limiting the maximum value you send to the motors will reduce acceleration by itself. You can improve stability a bit more by combining this with a throttle change limiter - and that's rather easier. All you have to do is to determine what the maximum acceptable change in the throttle is for each poll of the joysticks and update of the motors. In java it would look like:

Code:
//in initializer
double maxSpeedDelta = 0.05; // larger values allow faster changes




// inside loop

//assumes that your current call looks like:
//     motor.set(joystick.getY())
newSpeed = joystick.getY(); // or your original argument to motor.set()
curSpeed = motor.getSpeed();
if (newSpeed > curSpeed + maxSpeedDelta)
     newspeed = curSpeed + maxSpeedDelta;
if (newSpeed < curSpeed - maxSpeedDelta)
     newspeed = curSpeed - maxSpeedDelta;
motor.set(newSpeed);
__________________

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.
  #12   Spotlight this post!  
Unread 05-03-2015, 22:38
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: Limit speed of 4 chassis CIM motors

Quote:
Originally Posted by GeeTwo View Post
Limiting acceleration using encoders would require writing some code to calculate the acceleration from the speed (just the change in speed divided by the elapsed time). I don't know of any libraries to do this, so unless you have some experienced programmers, you probably wouldn't want to attempt it at this late date.
I know what we used in previous years, on the cRIO using C++, we had a 2-speed transmission with automatic shifting, based on the speed, but we also used the timer class to prevent us from rapidly shifting from high to low gear within a certain period of time.

Code:
double time = GetTime();
double left_dist = leftSide.GetDistance();
double right_dist = -rightSide.GetDistance();
double left_rate = (left_dist - leftPrevDist) / (time- leftPrevTime);
double right_rate = (right_dist - rightPrevDist) / (time - rightPrevTime);
leftPrevDist = left_dist;
rightPrevDist = right_dist;
leftPrevTime = time;
rightPrevTime = time;
//printf("left: %f, right: %f, Speed! %f\n", left_rate, right_rate, absd((left_rate + right_rate) / 2));
if (!HighGear && absd((left_rate + right_rate) / 2) > 3.7) {
shift.Set(true);
HighGear = true;
} else if (HighGear && absd((left_rate + right_rate) / 2) < 2) {
shift.Set(false);
HighGear = false;
}
That's the relevant portion of what we did in 2011, and 2012. It was placed inside of our main tele-op loop.
The "shift" object was a solenoid, that shifted the pnuematic shifter in the gearbox.


While there probably isn't a library to do that, writing the code for it shouldn't be too difficult. (You could probably just modify that to do what you need it to...)
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)
  #13   Spotlight this post!  
Unread 05-03-2015, 22:45
zinthorne's Avatar
zinthorne zinthorne is offline
Registered User
AKA: Avery
FRC #5827 (Code Purple)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Seattle
Posts: 143
zinthorne will become famous soon enough
Re: Limit speed of 4 chassis CIM motors

I'm driving this year and so we made a button that while held places the max output of all drive motors at 25% you could do something similar and keep you ability to use all power and the ability to go slow at the same time... The other thought I would have is possibly removing a 2 cims from your drivetrain If you are running 4 already. We dropped from 4 to 2 and still have more than enough speed. We also have a build up in acceleration and deceleration too.
  #14   Spotlight this post!  
Unread 05-03-2015, 23:05
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,653
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: Limit speed of 4 chassis CIM motors

Oh, duh!

If you really want to limit acceleration, you can use the accelerometers built into the RoboRIO; just select the one oriented along the axis that you're driving, or a vector sum of them that points you that way. For example, if your RIO is laid out on a board 30 degrees from horizontal, with the USB end towards the front and elevated, your acceleration in the drive direction would be
Code:
driveAccel = accelYaxis.getAcceleration() * .866 + accelZaxis.getAcceleration() * 0.5;
__________________

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.
  #15   Spotlight this post!  
Unread 05-03-2015, 23:19
jblay's Avatar
jblay jblay is offline
Here comes StuyPulse
AKA: Joe Blay
FRC #0694 (StuyPulse)
Team Role: Coach
 
Join Date: Feb 2008
Rookie Year: 2006
Location: New York, NY
Posts: 984
jblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond repute
Re: Limit speed of 4 chassis CIM motors

Also, what might help is limiting deceleration. I would make sure my motor controllers are set to coast and not brake, this way you don't decelerate as rapidly so that you have less tipping issues when stopping.
__________________
It's pronounced StighPulse like HighPulse
2016 Curie Champions
2016 New York City Champions
2016 New York City Engineering Inspiration
2015 New York City Finalists
2013 New York City Champions
2012 Connecticut Chairman's
2011 Connecticut Chairman's
2010 Connecticut Chairman's

2010 New York City Champions
2008 New York City Engineering Inspiration
2007 New York City Finalists
2006 New York City Finalists
2005 New York City Chairman's
2003 New York City Champions
2002 New York City Engineering Inspiration
2001 New York City Finalists
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 09:56.

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