|
Re: arm-limitting gyro PD loop producing some strange results
Thank you for your responses! There is definitely some stuff for me to try now. I think I need to clarify a few things, though:
1) I am still pretty sure it is not positive feedback for the reasons I explained in the first post and because I tested it with pwm01_temp + 0.01*p + 0*d and got what definitely seemed more like positive feedback. It isn't error = desired - actual, it's error = actual - desired.
2) All the variables are declared at the top of the file, which I thought made them of global scope (they will hold their values between loops) but I could definitely be very wrong there. I will try changing them to static float, etc.
3) The pwm01_temp value was intended to be adjusted a small amount each loop until it hit the correct value. It is a float, so it can store those small accumulations and then typecast to an (int) (or should it be (unsigned char)?) only when setting the real pwm01. Again, if my variables aren't global as-is than this isn't doing what I think it's doing. But based on what I saw (the arm getting faster and faster), I think it is accumulating over loops, just only in one direction for some reason.
I'm gonna fiddle around with it some today and see if I can get some better results. I'd bet on the fact that I typcasted variables all over the place and some are probably not right. I'd like to be able to debug it and see the variables, but the printf function doesn't like me and especially doesn't like floats. I'll post when (and if) I get it to work properly and let everyone know what changes fixed it. Thanks so much again everyone!
-Shane
__________________
MIT Mechanical Engineering
>> College Mentor, Team 97: Cambridge Rindge and Latin School with The Edgerton Center, MIT Mechanical Engineering, Bluefin Robotics, and Draper Laboratory
>> Alumnus, Team 527: Plainedge HS
Last edited by ZZII 527 : 15-02-2005 at 09:11.
|