elmoret wrote:Resistance based sensors will lose calibration with wear and temperature variations. Optical is the way to go, IMO.
Yeah, thats why I listed the non-contact version of the sensor. According to the specs, it lists over 1 million cycles for durability and an operating temperature up to 50C. I don't really know for sure, but I am guessing that the ambient temperature of my 3D printer wont go above that 50C. Also, I will probably upgrade both my printer and/or sensor by the time I reach 1 million cycles.
Mostly, it simplifies the programming. Lets assume you have an encoder hooked up to track the position of the print head as you turn the stepper. Realistically, you want it on the idler so that you can detect an actual movement rather than just counting the motions on the motor (incase of the belt slipping and the motor turning). Now, you get an encoder that can count 360 positions per turn and then you move the head so that you make 3 turns of the head. So the encoder might be saying your position is 24 while it is really 1080 (depending on starting position). Now, if you turn off the machine and come back to it later, you don't know where you are in space. Depending on the type of encoder you use, you might have a location from the most recent reading that is returned, but it tells you very little with regard to a real position. In order to fix this, you need to size your encoder so that it can count at the absolute maximum for the resolution of your micro-stepping mode and total possible distance. Let say that you have a good resolution (I have one that is 0.9 degrees / step) and a 1/16th micro stepping mode. At normal steps, it takes 400 steps to make one complete revolution, right? and with 16th micro stepping, you get a total of 6400 steps per revolution. If it takes 30 revolutions to move you from one side to the other, the minimum resolution you would need is 192000 counts. It would need to be geared so that you make one complete revolution on the encoder for the entire distance from one side to the other.
At that point, an absolute encoder would be able to tell you exactly where you are at power up and you could never miss a single step.
It will likely be very expensive. Alternatively, you have to count the number of times you make one complete revolution and do some internal math to find current position. Maybe even store the information in an eeprom so that you can get the position again at startup. You would have to store it there on every move, though, or you would lose the position if the power were lost unexpectedly.
The linear pot is just read for resistance and compared to a location table, similar to how temperatures are measured. Mostly, the code is already written.
Thats a little back of the napkin, but seems right as far as I can tell. What do you think?
In any case, there are likely to be drawbacks to any system... with resistors, the resolution might not be high enough to discern each step (don't know and haven't tested it). On the encoder side, you have more cost and slightly higher complexity but possibly greater reliability. I tend to like prototyping on the low cost side and upgrading as I need, though.