![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I've tried to implement a complete phase locked loop in an atmega16, and got succeed to follow the 50Hz mains frequency.It works as follows: A rising edge of the mains sine wave (converted into square wave) triggers an interrupt, a lookup table is used to make an internal sine wave, and interrupt service routine decides whether this internal sine wave is lagging or leading, and makes the pwm period longer or shorter. But PLL works somewhat oscillatory, it doesn't stay fixed at, say, 50Hz. it goes around 49 Hz to 51 Hz. And it makes a dangerous phase difference. Probably because of a low resolution VCO, or bad designed transfer function. Can anyone give a good algorithm for a microcontroller based PLL? Thank You | |
| |
| | (permalink) |
| No idea on Atmel, but your original premise sounds wrong? - it's normal to use a zero-crossing detector, not convert it to a squarewave. | |
| |
| | (permalink) |
| The interrupt works as the zero crossing detector, I've just converted it into a square wave to detect its zero crossing easily using external interrupts, besides I'm not so stuck to Atmel, any idea which can be implemented using micros is appreciated. | |
| |
| | (permalink) | |
| Quote:
Lefty
__________________ Measurement changes behavior | ||
| |
| | (permalink) |
| If you don't detect the zero-crossing as accurately as possible, and are depending on a rising/falling threshhold value to create your signal, then you will have phase problems relative to the original signal. You have to lock-in on zero and not some threshhold value. | |
| |
| | (permalink) | |
| Quote:
As rightly indicated by Leftyretro, this observable oscillatory behavior can't be avoided if PLL is attampted at 50Hz. The attempt by Alisarhangpour is appreciable and there and perhaps may form a good topic for debate.
__________________ Regards, Sarma. Last edited by mvs sarma; 20th November 2007 at 08:23 PM. | ||
| |
| | (permalink) |
| There are a number of good zero-crossing detection circuits which are fast enough so that phasing differences relative to 50Hz are of no appreciable significance. http://www.discovercircuits.com/XYZ/zerocross.htm | |
| |
| | (permalink) | |
| Quote:
__________________ L.Chung | ||
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Variable capacitor circuits | walters | General Electronics Chat | 83 | 11th March 2008 03:59 PM |
| phase locked loop (PLL) design for tx and rx | missy | Electronic Projects Design/Ideas/Reviews | 3 | 4th October 2005 02:26 AM |
| phase locked loop ic for robotic localization | xmat | Robotics Chat | 1 | 11th February 2005 02:14 AM |
| learning phase locked loops | Kurupt | General Electronics Chat | 1 | 27th January 2005 03:05 AM |
| phase locked loop?? | jovabiot | Electronic Projects Design/Ideas/Reviews | 0 | 27th February 2004 10:18 PM |