----- Original Message ----- From: "Alan B. Pearce" To: Sent: Wednesday, April 30, 2003 9:45 AM Subject: Re: [PIC]: Frequency multiplier? > >I implemented it in software on an 16F84A, I know they are > >outdated, but I have lots of them!. When the shaft accelerates > >fast then I start to miss about 3 to 10% of the pulses > >depending on the acceleration, getting offsets in position. > > I suspect that using any micro is going to cause you problems. I think you > may have to resort to something like Direct Digital Synthesis, or a proper > phase lock loop system as a minimum. Whatever you do there will be a time > lag between the encoder speeding up and your multiplied output catching up, > as the multiplier cannot predict when the next edge is going to occur that > it will need to measure. That's exactly what I thought until I saw the post here about multiplying a frequency with a PIC. Perhaps it's because the input frequency was fixed and didn't matter a few periods lost for adjustments. Perhaps I missunderstood the whole thing; but I had to ask, this is why this list is for after all. Using DDS was not an option because of the price of those. > > Your other problem is going to occur with the lowest rotation rate of the > encoder that you wish to lock to. I cannot recall you stating this, but I > seriously doubt you will be able to go right down to 0 rpm, and I get the > feeling that is what you want to do. You're right again. The minimum was 0 rpm, and yes I did had to use a time out for that. Otherwise the output pulses would have been way too long. > > When you refer to offsets in position, are you trying to make an x-y plotter > or something similar? It seems to me that what you really need to do is get > an encoder that has more steps per revolution. Your only other way to option > that I can think of is to remove the encoder from its current connection, > and have a suitable gearbox between it and the drive shaft to increase the > shaft speed into the encoder. One of these two solutions is going to be the > only way you will get a satisfactory low speed performance. No is not an x-y plotter.The encoder is on a moving cart with a scanning system on it. The pulses are used to trigger one scan per pulse. The encoder is connected to the shaft of one of the wheels. I used magnets placed on the wheel to trigger an Allegro hall effect sensor with quadrature output. Because of the size of the wheel I could not mount more magnets on it. I used the smallest ones I could found 1mm diameter. The magnets were used because this equipment goes into water, dust and many other tough conditions, where optical systems are difficult to implement. So the end was to get an E4 encoder from USdigital and get a rugged case for it. The whole construction is a cylinder 120mm long and 29mm diameter and solved all the problems. I spent quite a while trying to do the trick with a micro, that's why I was interested in some opinions regarding this. I guess from the beginning it was a doomed project. Anyway, I always try to listen to other people because one can never learn to much. Thanks a lot for your time. RA > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body