![]() |
Stick Saturation
I noticed that our stick outputs max out at 0 and 254 long before the stick reach their mechanical stops. It appears that their is a mismatch between the actual stick output and the a/d scale factor. Is this normal? Is there anything that can be done to get variable stick output over the full range of the stick movement?
|
Make sure your victors are calibrated correctly that might be the problem.
|
i noticed the same problem with one of our new joysticks. my solution, rip the ones off of last year's controls and use those. of course, that doesn't work if you're a rookie team. in that case, i would suggest finding an old joystick that has a gameport hookup, and using that. we tried that also today, worked fine. but yeah, the joysticks have some sort of defect this year, and as you cannot alter them in anyway, well, leaves you with one choice, which is to buy new ones
|
Here's what I was thinking today in relation to the whole problem of maxing out too quickly on the diagonal throws-
The points outside the unit circle don’t appear to mean anything. All of the acceleration is done within the radius of the circle in any direction. When the joystick reaches the outside barrier of the circle, one of the motors is going to be going at full. The purpose of the MIN and MAX in the code is to ensure the PWMs are not fed false data. They accept input from 0-254… but the distance traveled to the corner of the joystick box is going to be longer than the distance of the throw straight up or straight back. If this were any different, the acceleration would be inconsistent. It seems to me that this unit circle idea must be central to any code written dealing with the acceleration of the motors. Basically the PWM has accelerated to its full speed after it travels a distance of 127. This happens at (x,y) = (sqrt(2)/2, sqrt(2)/2), (on 45 degree angles off the 127-axis) because the joystick is traveling in the diagonal motion... it has gone the equivalent of the distance between (127, 127) (127, 254) before it reaches the upper-right-hand corner (254, 254). The same goes for any of the extremes. |
Yes, I see what you are trying to do but the fact remains that if you think of the top of the stick operating in a square or a unit circle, the physical movement of the top of the stick is about + or - 3 inches in the x and y directions and the a/d appears to be saturating when the stick is outside of a box that is about + or - 1.5 inches. All the stick motion outside this smaller square does not change the value of the stick position as seen by the program. That does not make for a very controllable situation.
|
The Flightsticks are a very good joystick, but reaching 254 before reaching the UL corner of the rectangle means that they can get to 254 at all. All potentiometers have a conductive portion from the ends of the high-resistance element to the connecting lugs. In the joysticks, the conductive (or low resistance) portion is longer, so that if the joystick goes 75 degrees, the high-resistance portion corresponds to, say 60 degrees.
Without having say, 5 degrees of "no change" at the extremes of rotation, after the trimwheel has been adjusted for the connected circuit's idea of neutral, the stick might have to go farther than the "box" to reach 0 or 254. It makes little difference in most applications, but if you are worried, you might make your own joystick like the one I made for my Apple ][+. Use a geared-up regular pot with a handle. You'd need gearing to compensate for the disparity between the approx 90 degree travel of a joystick, compared with the approx 270 degree rotation of the pot, or you'd lose range. |
1 Attachment(s)
But here's the thing... On a diagonal, the joystick will have traveled the distance between neutral and full forward at the point (217,217)... What if you were to work out a drive-system equation based on the distance of the stick from neutral? I was thinking about it... the computer operates based on powers of two... it seems like you could make the FIRST controller calculate square roots and things fairly quickly.
|
In regards to the flightstick... have you guys noticed your joysticks behaving backwards?
PWM1 = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000) PWM2 = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000) The thing is, though... that formula won't work when calculating with theoretical values... But when plugged into the program it works like a charm... We did one of these: relay1_fwd = off if p1_x< 200 then dumb relay1_fwd = on dumb: relay1_rev = off if p1_x> 100 then dumber relay1_rev = on dumber: And sure enough, the joystick reads for values less than 100 when you push to the right and greater than 200 when you push to the left. |
| All times are GMT -5. The time now is 13:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi