> From: Shawn Ellis > > >[SJH wrote:] > >Certain analogue filters will also give sine _and_ cosine output, which > >could be put to good use generating a nice rotating magnetic field: > >two coils angled at 90 deg to each other. Stick a permanent magnet > >inside this and voila - a synchronous motor. > > > Interesting suggestion, let me clarify by saying the motor I'm using is a > Globe model with 3 coils at 120 Deg. apart. > Motor theory is one of the many things I'm ignorant of. Do these 3-coil motors have a permanent magnet rotor? 3-phase AC motors have an inductively coupled 'squirrel cage' rotor which would slip relative to the rotating field if non-zero torque was applied. I presume this is the same for those small single phase 'synchronous' motors used to drive tape recorder capstans etc. I presume for a permanent magnet rotor, it will stay in lockstep with the rotating field, with a varying lag depending on the required torque. Anyway, now I see why analogue filtering of a single square wave wasn't satisfactory for you, since you need three phases. Since your clock is 20KHz, it needs to be divided by 320 to get the 62.5Hz fundamental. Rather than using the PIC to generate 3 sine waves, how about using it to divide the 20KHz by 320, producing 3 square wave outputs 120 degrees apart. The three square waves are fed into separate filters tuned to the same frequency (62.5Hz). Unfortunately, 320 is not divisible by 3. You can get around this in several ways: . Use the PIC to interpolate. . Use a PLL to multiply the 20KHz up to 60KHz, and use this as the clock. . Just don't worry: use phase spacing of 107, 107 and 106 cycles. In the latter case, the worst case angular error of the field vector will be of the order of 12 minutes of arc. This would probably be better than the accuracy at which the field coils were placed. Of course you would have to ensure there is no torsional resonance at harmonics of the rotational speed in any case. Another technique may be to use phase shift networks to produce successive phase lags of 120 degrees. This may have the advantage of being able to tweak the outputs for maximum smoothness of the rotation. If you used a 320-count shaft encoder (Litton, HP etc.) you could compare the 20KHz output from the encoder with the clock signal - use an XOR gate which would show up any speed difference as a varying PWM, or the PIC could count the encoder pulses to derive an error signal. The possibilities are endless. Good luck. Regards, SJH Canberra, Australia