|
Re: Need help programming our swerve with feedback?
Akshay, if you could have Rebecca IM me sometime in the next week or two, I'll do everything I can to help you out with your system.
Pretty much, if you can determine the arctangent of the joystick position, you can determine the angle you want your wheel modules at, and using the Pythagorean Theorem, you can determine magnitude of your drive motors.
Because of the fact that you cannot rotate your wheel modules around completely, I think that if the sine of your joystick value is negative (id est, less than or equal to 127) you should invert the cosine value and the magnitude, in order to have the wheel modules only travel 180degrees, total.
This could prove to be a problem when you make the transition from some small positive angle from normal to an angle just below normal (300+degrees), in which case your wheel modules would have to traverse almost all of 180 degrees in order wind up pointing in the proper direction.
There're many other considerations when you're programming a system like this, and I'm really more than willing to help you guys out with anything I can. I really want to say that I'm sorry that I didn't get to help you at Sacramento, this weekend.
<edit>
About PID control, we used a P control loop on our swerve, last year (with the BasicStamp-based control system), so I don't think that getting too far (farther than P) into feedback control systems is very necessary.
</edit>
__________________
I played hacky sack with Andy Baker.
2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
Last edited by FotoPlasma : 22-03-2004 at 03:26.
|