Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/25/04 14:11
Read: times


 
#81936 - Assymetry
Responding to: ???'s previous message

Most simple zero cross detectors don't give you a symmetrical zero cross point on the positive and negative cycles. also, because you should have a bit of analog filtering this causes a phase difference. Your zero cross signal is not at real zero cross! Therefore I use only one edge of the zero cross detector and re-create the missing zero cross pulse in the code. We then get back to my earlier post talking about frequency and phase locking to the mains. How do we do this with the PCA?

Firstly setup a compare channel and load with 10mS of time, have it interrupt and toggle the port pin (so we can observe operation with a scope). Setup a capture channel to capture on one edge only - no interrupts.

When we get a compare interrupt, check for any input captures. If we have one, subtract the current capture value from the previous one. Test the range (it should be around 20mS), ignore it if it is too high or too low. The difference of the current capture and the previous one is the current mains period, we also know if it is within an acceptable range from the test we did. Divide this value by two to get the half phase time. We also do a little filtering using this value to obtain the compare reload value. This gives us the frequency locking. To get phase locking we use the current capture value and compare this with the compare value (the compare value is where the software thinks the zero crossing is, the capture has the actual time of where it is). If it is a large difference, we scale that value down (say 1/10th) and add this to our next compare value. If it is a small difference, we decide if it is small enough not to worry about or we scale the value less. The idea here is that if there is a difference, we will gently correct until we get a lock. Doing this we filter out short term variations in the zero crossing input as well as tracking long term mains variations.




Add some more code and you get your phase control and pulse output.


That's my suggestion. But this doesn't necessarily address the problem at hand. I'm still not clear as to what the flickering is - is it a small variation or a large variation? This flicker should be visible on the scope. Prahlad - measure the amount of flicker and where is occurs on the mains phase. This may allow us to pinpoint the root cause rather than run around blindly trying a myriad of software 'fixes'.








List of 42 messages in thread
TopicAuthorDate
Thyristor output flickering.            01/01/70 00:00      
   Thyristor problem            01/01/70 00:00      
      No Hardware problem            01/01/70 00:00      
      Please Elaborate more.            01/01/70 00:00      
   Thyristor problem            01/01/70 00:00      
      Re: Thyristor Problem.            01/01/70 00:00      
      Mains looks seldom like pure sinus            01/01/70 00:00      
         Thanks Kai But problem seems diffrent            01/01/70 00:00      
   Did the changes but still flickering.            01/01/70 00:00      
      Did the changes ....            01/01/70 00:00      
         Russell- Where can I get DSO software            01/01/70 00:00      
   More thoughts on filtering            01/01/70 00:00      
   Flickering is not minor.            01/01/70 00:00      
      Cool Edit            01/01/70 00:00      
         Cool Edit - no more :-(            01/01/70 00:00      
         Loading is enough.            01/01/70 00:00      
      interrupt configuration            01/01/70 00:00      
         I am not using External Interrupts.            01/01/70 00:00      
            external interrupt            01/01/70 00:00      
               I am reading only the edge detect flag.            01/01/70 00:00      
                  configuration again            01/01/70 00:00      
                     Here is the configuration.            01/01/70 00:00      
   Is it Int. prioprity setting proble?            01/01/70 00:00      
      Why not use the PCA?            01/01/70 00:00      
         It's too late to change the design.            01/01/70 00:00      
   Its not a interrupt priority problem.            01/01/70 00:00      
      Real -time problems            01/01/70 00:00      
   Tried PCA!            01/01/70 00:00      
      Firing circuit            01/01/70 00:00      
      hardware modification            01/01/70 00:00      
         Already modified with PCA SYSTIME>99            01/01/70 00:00      
      Sorry I small typpo in earlier post.            01/01/70 00:00      
   ideas            01/01/70 00:00      
      Problem Solving Great Idea            01/01/70 00:00      
   Assymetry            01/01/70 00:00      
   back to root            01/01/70 00:00      
      It is for power control.            01/01/70 00:00      
   Hey Friends Problem Solved.            01/01/70 00:00      
   Happiness is...            01/01/70 00:00      
      Oh sure....            01/01/70 00:00      
   here i am?            01/01/70 00:00      
      Thanks Kuldeep.            01/01/70 00:00      

Back to Subject List