View Single Post
  #7   Spotlight this post!  
Unread 30-07-2008, 19:07
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Almost balancing Scooter

Quote:
Originally Posted by gohan22 View Post
...i added a delay at the end of the of the loop to also reduce the vibrations,...
Maybe you could do a "delay" in the other direction. Do a simple prediction of what the angle is likely be the next time through the loop, and use that as your feedback value instead of the current angle.

I didn't look closely enough at your code to be certain, but are you sure you have the right sign on your Kd term? It should act to reduce motor speed, but you describe it as causing more current to be drawn.

Also, are you using Victor speed controllers? They have a dead band around the neutral point that makes them a bit unsuited for applications requiring the motors to hold a given position. If you're very careful, you can account for the dead band in software, but you have to make sure everything is appropriately calibrated.