My current project is a speed controller for a small engine, technically a digital speed governor.
It involves provision for adjusting the speed target or set point, measuring the actual engine speed, doing some maths and adjusting a servo to make any necessary speed adjustment.
I use pulsin for the speed measurement, the maths is a bit tricky with the integer maths rules, but all successfully programmed, and after initially setting up the servo with the servo command, I use servopos to adjust its position. A potentiometer and readadc10 provided an adjustable speed setpoint.
Just for fun, I decided to see if this could all be done on and 08M2+. Sure enough, plenty of space for the program, maths basically sorted, may be a bit dodgy algorithm, but seems to all work. Even added a few sertxd statements to display on the computer what was happening at critical points. I remmed out these statements when it was all removed from the computer. All simulates ok.
I was getting a bit of servo jitter that I could not find a rational way to minimise. So I purchased an AXE134 four line display and used the remaining free output pin on the 08M2+ to send data for display, using serout statements. A little experimenting with commands and data statements, lead to a nice readable display. So far so good.
Off to the garage to try it all out. Disappointment! The servo jitter was bad, very bad. So back to section 2. It seems that there is a conflict between time sensitive commands like serout and servo, which results in resetting the servo pulse chain. It does not mention whether pulsin also causes this problem.
Sorry for the long introduction. I hope it all makes sense and gives context to my questions. So at last the questions.
Does the pulsin command also cause conflicts with servo?
Is it possible to get around theses timing conflicts on an 08M2+? Perhaps by making gaps between serout commands, and sending shorter data quantities at one command?
I realise I am asking a lot of a little 08M2+, but it was a fun challenge. Do the bigger chips have more timer facilities that would make them more suitable in this application. I certainly have in my parts box some 14M2 and some 18M2 chips. I believe I also might have a 28X somewhere if all else fails.
I am also wondering if it might be possible to separate out the functions somehow and use two 08M2 chips to avoid the conflict.
Thank you.
Eng460
It involves provision for adjusting the speed target or set point, measuring the actual engine speed, doing some maths and adjusting a servo to make any necessary speed adjustment.
I use pulsin for the speed measurement, the maths is a bit tricky with the integer maths rules, but all successfully programmed, and after initially setting up the servo with the servo command, I use servopos to adjust its position. A potentiometer and readadc10 provided an adjustable speed setpoint.
Just for fun, I decided to see if this could all be done on and 08M2+. Sure enough, plenty of space for the program, maths basically sorted, may be a bit dodgy algorithm, but seems to all work. Even added a few sertxd statements to display on the computer what was happening at critical points. I remmed out these statements when it was all removed from the computer. All simulates ok.
I was getting a bit of servo jitter that I could not find a rational way to minimise. So I purchased an AXE134 four line display and used the remaining free output pin on the 08M2+ to send data for display, using serout statements. A little experimenting with commands and data statements, lead to a nice readable display. So far so good.
Off to the garage to try it all out. Disappointment! The servo jitter was bad, very bad. So back to section 2. It seems that there is a conflict between time sensitive commands like serout and servo, which results in resetting the servo pulse chain. It does not mention whether pulsin also causes this problem.
Sorry for the long introduction. I hope it all makes sense and gives context to my questions. So at last the questions.
Does the pulsin command also cause conflicts with servo?
Is it possible to get around theses timing conflicts on an 08M2+? Perhaps by making gaps between serout commands, and sending shorter data quantities at one command?
I realise I am asking a lot of a little 08M2+, but it was a fun challenge. Do the bigger chips have more timer facilities that would make them more suitable in this application. I certainly have in my parts box some 14M2 and some 18M2 chips. I believe I also might have a 28X somewhere if all else fails.
I am also wondering if it might be possible to separate out the functions somehow and use two 08M2 chips to avoid the conflict.
Thank you.
Eng460