View Single Post
  #6   Spotlight this post!  
Unread 24-03-2012, 14:27
StevenB StevenB is offline
is having FRC withdrawal symptoms.
AKA: Steven Bell
no team
Team Role: College Student
 
Join Date: May 2005
Rookie Year: 2005
Location: Stanford, CA
Posts: 416
StevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond repute
Re: PID algorithm using Arduino

Quote:
Originally Posted by tb0508 View Post
So, to get the values that you used of 200 to 800 with the center being 500. Is that the same as me using the min and max of the steering wheel pot?
Probably, but not necessarily; think about the values you're trying to convert, rather than how to plug it into an equation. The graph below shows an example mapping of input values to output values. The input is the x-axis; these are the readings you get from the steering wheel. The output is the y axis; these are the desired positions for the output. Draw this graph for whatever values you have, and the equation for Y in terms of X will follow naturally from that.



Quote:
Originally Posted by tb0508 View Post
Also, I plan to send the outputPower value to the roboclaw to determine left/right and how fast. Is this correct way? And I am a little confused on how exactly to send the value/data to the roboclaw for it to interpret.
Look through the Roboclaw datasheet and Arduino examples, if you haven't already. In theory you could use any of the four control modes the RoboClaw allows.

As a side note, it would be simpler and more efficient to use Serial.write() and Serial.read() to send the bytes directly, rather than converting them to character strings and back. But if you've got it working with print() and atoi(), then carry on!
__________________
Need a physics refresher? Want to know if that motor is big enough for your arm? A FIRST Encounter with Physics

2005-2007: Student | Team #1519, Mechanical Mayhem | Milford, NH
2008-2011: Mentor | Team #2359, RoboLobos | Edmond, OK
2014-??: Mentor | Looking for a team...