Dear all,
I have been toying with settimer count for my little robot car. All in all, I have mechanics/optics and software sorted and I can reliably count rotations of the main motor with Sharp GP2S60 connected to C.0 pin. I have tried three types of segmented black and white discs - one black-white-black transition, two transitions and three transitions just to see how much resolution is realistically achievable with my setup. All three work well, however, each rotation is ~0.9mm motion of the car forward or backward and I have a hard time thinking I would ever need more resolution than that. The period between low-high edges never go shorter than 2ms and the slowest the motor is capable of is about 50ms.
Then, out of curiosity, I googled the forum for other solutions using settimer count and found a lot of, hmm, controversy about missing pulses seemingly due to the chip being busy handling interrupt for timer variable overflow. Two such threads linked to below.
http://www.picaxeforum.co.uk/archive/index.php/t-28157.html
http://www.picaxeforum.co.uk/archive/index.php/t-26376.html
While I don't think I should be particularly concerned because of my longish pulses (in micro controller terms), if the problem persists, I might be better off selecting three pulses per rotation and loose one of them and one third of a rotation rather than loose a full rotation if I select to use a single pulse per rotation (?).
Is the problem still there or has there been a solution found? Would I be better off with more pulses per rotation? I.e. the problem has to do with missing a single pulse or not registering any pulses for x milliseconds and thus missing any pulses incoming during x?
Thank you for your input,
Edmunds
I have been toying with settimer count for my little robot car. All in all, I have mechanics/optics and software sorted and I can reliably count rotations of the main motor with Sharp GP2S60 connected to C.0 pin. I have tried three types of segmented black and white discs - one black-white-black transition, two transitions and three transitions just to see how much resolution is realistically achievable with my setup. All three work well, however, each rotation is ~0.9mm motion of the car forward or backward and I have a hard time thinking I would ever need more resolution than that. The period between low-high edges never go shorter than 2ms and the slowest the motor is capable of is about 50ms.
Then, out of curiosity, I googled the forum for other solutions using settimer count and found a lot of, hmm, controversy about missing pulses seemingly due to the chip being busy handling interrupt for timer variable overflow. Two such threads linked to below.
http://www.picaxeforum.co.uk/archive/index.php/t-28157.html
http://www.picaxeforum.co.uk/archive/index.php/t-26376.html
While I don't think I should be particularly concerned because of my longish pulses (in micro controller terms), if the problem persists, I might be better off selecting three pulses per rotation and loose one of them and one third of a rotation rather than loose a full rotation if I select to use a single pulse per rotation (?).
Is the problem still there or has there been a solution found? Would I be better off with more pulses per rotation? I.e. the problem has to do with missing a single pulse or not registering any pulses for x milliseconds and thus missing any pulses incoming during x?
Thank you for your input,
Edmunds