Simulation is ok but actual application behaves differently
Posted: Mon Nov 22, 2010 3:26 pm
Hello,
I have a program wherein i read ADC as integer potentiometer location and read target location ADC as integer (0-1023). I then get the distance between the two by comparing the potentio reading to the target (either Distance=target-reading or Distance=reading-target whichever is higher). If the distance is small (around 120), the motor should slow down. Simulation of this program is perfect.
Ex. Target= 860
Reading = 184
Distance= Target-Reading = 676
Why is it that in my actual application, the motor slows down at a reading of approximately 604 (which is a distance of 860-604=256)? This is quite far.
Another observation is that I don't seem to have this problem when I go in the opposite direction.
Ex. Target= 184
Reading = 860
Distance= Reading-Target = 676
The motor seems to behave correctly. It slows down at a distance of around 120.
Am I missing something here? Please help.
Thanks
I have a program wherein i read ADC as integer potentiometer location and read target location ADC as integer (0-1023). I then get the distance between the two by comparing the potentio reading to the target (either Distance=target-reading or Distance=reading-target whichever is higher). If the distance is small (around 120), the motor should slow down. Simulation of this program is perfect.
Ex. Target= 860
Reading = 184
Distance= Target-Reading = 676
Why is it that in my actual application, the motor slows down at a reading of approximately 604 (which is a distance of 860-604=256)? This is quite far.
Another observation is that I don't seem to have this problem when I go in the opposite direction.
Ex. Target= 184
Reading = 860
Distance= Reading-Target = 676
The motor seems to behave correctly. It slows down at a distance of around 120.
Am I missing something here? Please help.
Thanks