![]() |
Joystick sensitivity
Hey guys, I'm having trouble with the sensitivity of my joystick. We are running a 4-motor setup and the joystick causes the robot to speed up and turn too quick with the slightest movement of the joystick. Turning the robot causes a quick jerk which is giving us control issues. Are there any block functions in easyC to adjust the sensitivity? This is my team's first year in FIRST and the first time I'm doing C programming, so my understanding of the code is basic at best. Any help will be much appreciated.
|
Re: Joystick sensitivity
This is what we have used for the past few years as ramping code :
Code:
long ramping (unsigned char ramp)We've never used EasyC, so I don't know if there's anything there to help you... |
Re: Joystick sensitivity
Hi, I really like the idea of your ramping function. I was wondering if you could provide some reasoning behind your calculations. I would like to know the thought procedure behind the steps.
|
Re: Joystick sensitivity
1 Attachment(s)
That code above should produce a curve that reduces the motor outputs when the joystick is at a low level, but still maintain a max speed. (See attachment.) Of course, you could just multiply by some fraction, but that decreases your top speed. Or maybe reduce speed when motors are turning in opposite directions, (turning?)
The reason it's cubed is to get that sort of curve for the entire function. The random huge number in there is 128, (the maximum value) squared. It's basically to center the cubic equation on 128,128. (I believe I came up with it with experimentation on a graphing calculator, I really forget why it works) |
Re: Joystick sensitivity
Let us not forget that the speed controllers have a calibrate function. If you do not provide for one in your code then follow the calibrate procedure in the 884 manual available on the IFI website. This insures that the controller learns the full travel of your joystick, the end points of travel and the center rest position.
|
Re: Joystick sensitivity
If you're using ROBOTC after the [p1_y] statement in " motor[port1] = frcRF[p1_y] just add the division sign ( / ) and put a number down (we're using 5)
This is what it should look like. motor[port1] = frcRF[p1_y/5]; and that's all. hope this helps. |
Re: Joystick sensitivity
Only problem with actual division is the reduction of max speed. You can only go up to one fifth of your mechanical maximum with that code. Another thing we did last year was have a 'precision button,' that divided the value only when you pressed a certain button. That way you can limit responsiveness but not speed using true division.
|
Re: Joystick sensitivity
You sure? We got max speed even when we divided directly but, hey, I'll take your word for it.
|
Re: Joystick sensitivity
I'm fairly sure. Unless... What is your frcRF function? If that's a ramping function, I wouldn't think that's direct division. (I've never used RobotC anyway.)
If it's not, you might not be getting the max speed, as the maximum value you're getting from the joystick (256) divided by 5 is 51. That's less than your max of 127, (or 256 if that's how you're using the values.) Whatever works for you. (Though I'd check just in case you don't really know your max speed.) Good luck. |
Re: Joystick sensitivity
;) Thanks, looks like you're the one helping me instead.:p
(But just for a teaser, our robot moves (at max speed of course) at 10 ft.ps) I don't know where the site is but it is in a thread called FREE ROBOTC FOR FIRST MEMBERS |
Re: Joystick sensitivity
Here on Team 612 we've used the cube function for several years. It gives the drivers much better control at low speeds.
We also include an acceleration limiter, which eliminates any chance of tripping the circuit breakers. We do this by allowing the PWM signal sent to the drive motors to increase by only a certain amount on each pass through the user routine. This reduces the maximum current sent to the motors. It also minimizes strain on the drive system (chains, belts, tread wear, etc.). The effect on the robot's performance on the field is barley noticeable. This year, however, we are doing something completely different....:) . |
| All times are GMT -5. The time now is 11:30. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi