View Single Post
  #4   Spotlight this post!  
Unread 04-02-2012, 10:16
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
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: Integrating Gyro Code

Quote:
Originally Posted by adf0221 View Post
We have the first two of our gyros working with that code, however the third one cannot perform that code because there are only two FPGA ports that are active on the crio. We need to write an integral to take the rate that plugging the gyro into the analog port and using the analogchannel in the code.
You could try using simple trapezoidal integration:

Code:
read the new_rate

new_position = ½(new_rate + previous_rate)*cycle_time

previous_rate = new_rate
"cycle_time" would be 0.02 seconds if you're doing this in TeleOp

Is that what you meant?

Reply With Quote