![]() |
Voltage Counts Range 0-970
Now that we have slip rings on our swerve modules, we spend some time at the roll-over point of our analog encoders (the point where it rolls from 5V to 0V). We were surprised that there was significant "chatter" around this point and chalked it up to a bug in the PIDContoller to be found latter.
In trying to debug some different weirdness observed in crab, I started looking more closely at the values reported for GetAverageValue from the modules. I was surprised to find that the encoders never report anything greater than 970, but roll over all the way to 0. A few things we checked: Encoders are providing a full 0-5V output range. GetValue provides the same range. All four wheel modules on two robots exhibit the same "chatter" in the modules. Of course we can rescale all of our calculations to 970, but I'd like to know why we aren't getting to 1024. Has anybody seen anything like this before? We've not used the full range of our encoders before now. Thanks |
Re: Voltage Counts Range 0-970
Jeff,
What are you using for encoders? If you are using continuous pots then they are behaving as expected. It is possible with this device to momentarily short the 5 volt and 0 volt together at the transition. While this give a lot of noise output it also arcs the rotating contact in the pot. Eventually, this device will fail. |
Re: Voltage Counts Range 0-970
Al,
Thanks for the reply. Hardware was our first thought as well. We checked the voltage output from them and they are send as much as 4.96V to the analog module (couldn't ever get exactly 5, but I expect we weren't hitting the exact roll-over point). We are using these guys: http://www.usdigital.com/products/en...tary/shaft/ma3 They are magnetic encoders with 10-bit resolution, so I don't think shorting around the end is the issue. |
Re: Voltage Counts Range 0-970
Jeff,
Those should be fine but be aware that the rapid move from +V to 0V might occur at too high a slew rate to be used by the analog module without some filtering. That might be what is giving you the noise. You might also want to add a cap right at the power input of the encoder, say a .47 or 1ufd just to keep the power supply clean. Are you using the ball bearing version? |
Re: Voltage Counts Range 0-970
Quote:
Also keep in mind that the range of the module is -10V to 10V. Joe |
Re: Voltage Counts Range 0-970
Quote:
|
Re: Voltage Counts Range 0-970
Quote:
I really think my issue is in the control system hardware (see Joe's post above and my response below). But to confirm this I am going to short the 5V supply to the signal wire to see what reading we get. If it is in the 970 range, that takes the encoder out of the equation. I'll post results here. Quote:
Like RufflesRidge said, the PIDController uses values instead of volts for the source. I had considered changing it to volts (we have used volts for years prior), but decided that the counts should be the more "raw" reading. One less calculation between me and the raw reading must be a good thing... or so I thought. Quote:
Are you saying that it is not unexpected to get something other than 1023 when we supply 5V to the module, and the error is corrected when converting back to the voltage? If so, that's a really good reason to go back to voltage, and the PIDController should probably be changed for future seasons. |
Re: Voltage Counts Range 0-970
Quote:
Quote:
-Joe |
Re: Voltage Counts Range 0-970
Quote:
|
Re: Voltage Counts Range 0-970
Quote:
|
| All times are GMT -5. The time now is 20:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi