View Single Post
  #4   Spotlight this post!  
Unread 26-01-2015, 17:00
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 522
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Programming US Digital Encoder

You're sensor is not single-direction (not a tachometer). So you want to select Quad-encoder. That's part of the problem.

So you're initial closedloopErr is +270 ( target - currentPos), such that currentPos is about '0'. 270 times a pgain of '1' will yield '270'. That's about 26% positive throttle (1023 is full, see Duty-Cycle Section 17.5 in software reference manual). So I think that's ok.

Also I see that you reversed the sensor. I'm guessing you followed the procedure in section 7.4 (or similar) to ensure that positive throttle makes "Sensor Position" move in the positive direction.

Just curious how did you hookup the encoder to the motor mechanically. I mean what's the gear ratio between the two?