Go to Post FIRSTies always get Two Xmases! - [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 22-03-2013, 20:54
apples000's Avatar
apples000 apples000 is offline
Registered User
no team
 
Join Date: Mar 2012
Rookie Year: 2012
Location: United States
Posts: 222
apples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant future
Re: Automatic 2 Speed Drivetrain Shifting Code

We've never used one in competition, but I have a basic idea of how to get started. It's helpful to have a simple functions that approximates the fps of each joystick value. You want to be continuously checking for certain parameters that would cause shifting, so set up code to measure the speed of the wheels and also the acceleration. You need to make sure that you wait 1 second between shifts, and that you don't end up shifting while the driver is turning. The most useful is if somebody starts pushing you, and you need to shift to the slow gear to push them away. This can be detected if the actual speed of the robot is >10% away from where the joysticks are and if the average deceleration over the last second or so exceeds a certain amount. The problem with this is when the drivers hit a wall, it shifts into high gear and wears down the gear. Also, I've never tried it, but it may be possible to reach the max speed faster if you start in one gear, then shift up. If you want to try this, I would try starting with code that puts you in your slow gear when you are traveling slowly, and something that puts you in high gear if it detects that the driver has commanded a speed faster than a certain constant.
 


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