View Single Post
  #5   Spotlight this post!  
Unread 02-03-2016, 13:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Using a Gyro without Encoders

Quote:
Originally Posted by BitTwiddler View Post
Nope. It will continue past 360 degrees on the second time around as the documentation you provided indicates.
You might find this post and posts 1 and 36 in this thread of interest.

Quote:
the gyro sees a leftward turn and reports a process variable toward 360 degrees ... I don't think I've seen the gyro vi report angles less than zero.
Given the rationale stated in the WPILib documentation, it's hard to imagine the gyro would report anything other than angles less than zero when that occurs.

The post and thread I linked above shows how to turn any angle into +/-180 degrees.

If you compute the angle error ( = target-gyro ) and feed that error into the computation, it will give you the setpoint you should use to go the shortest angle to get to your target (or just see below).


Quote:
Originally Posted by apm4242 View Post
Is it possible that this -180 to +180 feature is built into the gyro Get Angle vi?
I think it is built into WPILib PID. See "set continuous".


Attached Thumbnails
Click image for larger version

Name:	SetContinuous.png
Views:	18
Size:	10.0 KB
ID:	20252  

Last edited by Ether : 02-03-2016 at 14:05.
Reply With Quote