![]() |
Re: Slow down teh motors!
Quote:
|
Re: Slow down teh motors!
We tried the same thing with the same results last year...
Thats when we learned why the FIRST code always added 2000 calucations then subtracted it from the final result in their mix limit. It prevented sign and overflow issues. Another project for you to consider is to ramp the motor commands to the new speed when your driver slams the stick from one direction to the other.(or pushed the button). With 26 Ms between pwm updates your motor could be commanded to go full forward at one update and then full backwards at the next up date. Your poor drive train won't last to long doing that. Good Luck BC |
Re: Slow down teh motors!
I did this a couple of days ago. here's the jist of it:
if (buttonpressed) motorspeed = transmission else motorspeed = joystickinput transmission(){ speed -= 127; speed /= divider; speed +=127; } p.s. you'll have to modify this to make it work with your robot, but this should help you. Also, in binary, division is better than multiplication for using the transmission. {edit} you can have the motors running through the transmission normally, and have when the buttonpressed equals transmission bypass. Have fun playing around with it. {/edit} |
Re: Slow down teh motors!
A dead zone is a very good idea for your input controls. If you establish this zone in the input from 125-129 on each input it helps, keeps from jerking the drive back and forth. Test if the input is in the zone and if true set the value to 127, if not then the input value would be used as Full_Speed. Now set scaled values for speeds such as ½ by using the value of Full_Speed. Therefore: Half_Speed = 127 - ( 127 - Full_Speed ) / 2. You would need to do this for each side/motor. If you wanted ¼ speed just divide by 4 instead of 2 and so on. Now test for the inputs of the triggers and set the output to the desired value either the Full_Speed or Half_Speed results. This has been tested and works, hope it helps. Remember you can test for either trigger or even both to form an “AND” so you can have multiple speeds. :cool:
|
Re: Slow down teh motors!
If using the Vector 884 speed controllers, these already have a built-in deadband from 117-137.
http://www.ifirobotics.com/victor-88...r-robots.shtml |
Re: Slow down teh motors!
Here's a quick and simple way of reducing speed, by any factor you like (ex, 2, 3, 4, etc. Non whole numbers make the RC unhappy, it dosen't like fractions)
_NEW_VALUE_=127+((_INPUT_SPEED_-127)/_FACTOR_); Simply replace the bold words with your variables. |
Re: Slow down teh motors!
Thanks all!
Joey's fix worked perfectly |
| All times are GMT -5. The time now is 10:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi