View Single Post
  #8   Spotlight this post!  
Unread 24-12-2013, 23:28
RyanShoff RyanShoff is offline
Registered User
FRC #4143 (Mars Wars)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Metamora, IL
Posts: 147
RyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to behold
Re: Analog potentiometer to counter

I finally got the AnalogTriggers working well counting rotations.

I was using these pots:
http://www.mouser.com/ProductDetail/...1hvDsngmWGdg==

The key was reducing the sample rate to 1000 Hz.
Code:
this->GetModule()->SetSampleRate(1000);
This value was determined experimentally.

At the max rpm of the sensor (500 rpm) that is still 120 samples per rev.

I tested two implementations. Both worked fine.

One used the rising/falling pulse feature to catch the rollover.

The other used two AnalogTriggers to convert the pot to a quadrature signal. That was fed into an Encoder object.

Code is here:
https://github.com/FRC-Team-4143/TMW...hannelVolt.cpp
__________________
Ryan Shoff
4143 Mars/Wars
CheapGears.com
Reply With Quote