Go to Post FIRST has given me too much for me to leave without leaving a mark... - Joe G. [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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: 145
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 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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi