Quadrature encoder - maximum input pulse frequency (by Ziggy)
Would it be fair to say that the maximum input pulse frequency should be one quarter of the PLC loop frequency?
Given the PLC loop time of say 10ms this would then translate into a maximum pulse rate of 25Hz.
Is 25Hz ( 1500RPM at best) good enough?
Is 10ms too conservative?
Let us say micro controller is running at 16MHz. Then a 10ms slice of time implies 160000clock cycles.
On a RISC machine that is a lot of instructions.
How many instructions does a fully utilised program memory of a ATmega328 hold?
Assuming the program is a simple sequential series of instructions ( no conditional loops) what is minimum PLC loop time?
Just trying to unravel the story and find a good starting point.
(no subject) (by David R)
Hi I just test the time after the code is finished and then set the cycle time a bit longer to make it stable and known,
Please see attached sample of the line I add to my code.
Kind Regards
David
(no subject) (by Ziggy)
Hello David,
Yes testing is great and works a treat provided the processor has the legs to do it.
How ever I am hoping to establish a "rule of thumb" kind of a feel before committing to a program and a loop time setting.
I am faced with a fairly pedestrian problem at the moment.
A permanent magnet DC motor needs to be driven bidirectionally with a specific velocity/acceleration profile over a fixed ( constant ) distance.
It has a quadrature encoder consisting of a ring magnet with 8 pole pairs and a couple of hall sensors.
It needs to traverse this profile in a limited time with a minimum jerk.
jerk is defined as first time derivative of acceleration.
Obviously this will involve a trajectory planner of sorts , however i was just hoping to figure out the loop time issue which will get into the trajectory planner.