View Single Post
  #5   Spotlight this post!  
Unread 09-05-2016, 17:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Continuous Feedback Sensor on CANTalon

Quote:
Originally Posted by ozrien View Post
Attached is an excel sheet demonstrating a few examples of how to do this.
If I may:

Let P be your present angle sensor reading (converted to degrees)

Let T be your desired angle position (in degrees)

the angle between them (let's call it ERR) is found by the equation:

ERR = (T-P) - 360*floor(0.5+(T-P)/360);

the above returns a value for ERR between -180 and +180 degrees,
the shortest angle path to the target.

So it tells you which direction to rotate as well as how much to rotate.

So compute your setpoint:

SetPoint = P + ERR


Reply With Quote