
04-16-2012, 08:27 PM
|
 |
systems engineer (retired)
no team
|
|
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,000
|
|
|
Re: Unexpected results from Encoder::GetRate()
Joe, Vamfun: could you guys please update the status of the items bolded below? If there's an update somewhere else, my apologies, I could not find it. Thanks.
Posted by vamfun:
I still would like you to add a SetMovingAveragePulseCount(int max_count) procedure to allow user control of this.
Response by jhersh:
I agree. It's always been my intention to have this configurable by the user, I just never got around to adding the function to expose it. Fortunately the rest of the code can handle when the value is changed, so last year the worst a team would have to do is hack in their own little accessor. It's on my list of things to do this year.
Posted by vamfun:
2)Did you set the rate = zero at a same edge event rather than no report at all in your subcode? If not is this in your plans?
Response by jhersh:
This would be an FPGA change... I'm looking into it. Setting the rate to 0 would involve setting the count to 0. This is directly related to #3.
Posted by vamfun:
3)Did you try to implement the signed pipeline as I suggested so you don't have to reset the pipeline at zero crossings http://www.chiefdelphi.com/forums/sh...5&postcount=85 ?
Response by jhersh:
I have not tried it yet, but I have looked at the code and have a good idea of how it would fit in. Essentially, I would add a sign bit to the count output, and instead of resetting the count to 1 on a direction change, I would just set the direction as the sign bit. This way if you change direction, the counts cancel out and gives you 0 (from #2 above). I believe this is the signed sum behavior you were looking for.
It also means that the direction is available in this TimerOutput register as well as the position output register. We would no longer need to access the position register to determine the direction as we do today. I still need to decide whether to reduce the range of the timer or the resolution to get the bit I need for the sign bit.
|