- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working on my final project for a PLD course using the CY8CKIT-050BU board. I am trying to create an AC light dimming circuit controlled by the PSoC. The concept is simple and I've got the zero cross detector interrupt working and stable, but every timer/counter combination I've tried to count the wait time before firing the trigger interrupt has had inconsistent timing, resulting in a light blinking in varying intensity. I am testing it with an LED and trigger it on with the Zero Cross interrupt and shut it off with the end of count interrupt. The oscilloscope show that the zero cross is ok, but the wait timer is sporadic, what am I missing? Attached is the latest version of this trouble.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All signals into PSOC are basically constrained as follows -
Vdd >= Vinx >= Vss. So generally speaking you have to offset
signals in order for PSOC to work correctly. Otherwise you will
get very erratic results. For some OpAmps, Comparators, signals
below ground will actuall create phase reversal, or trigger the
parasitic SCR mechanism in all CMOS and latch the part up,
blow it up.
If you are using a comparator you should use it with Hysterisis.
Also if you are looking at AC line consider a LPF to get rid of
transient noise from motor starting as an example.
Some methods of offsetting signals -
www.dropbox.com/s/k1yn4m7heaixvmg/ADinput%20negative%20inputs.zip
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider using a comparator based circuit and an analog pin into the
comparator.
Note its tempting to just use a R divider from the neutral to the hot line
side to limit V into PSOC, google "AC line interface zero cross", there
are a number of threads on how to do this. Note high value R's cause
offsets, and you need to calc their Pdiss to insure they won't smoke.
I have seen some use a high value R with clamp diodes at input of UP,
so that current is limited on negative cycle, and also for positive cycle
above Vdd. Not sure if this would pass UL safety though.
Regards, Dana.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One approach -
Basically you are working with low V and isolation due to transformer.
Another approach (circuit to right, you would have to debounce it) -
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The h11aa1 is not a zero cross detector per se, just an opto isolator.
As such any power line noise will be coupled and trip the output driver
at different phase angles in the AC cycle. Aditionally it has no hysterisis,
so that in turn will cause "bounce" in the trigger signal.
You have the edge detector being clocked at 1 Khz, so that in turn could
be generating multiple triggers as the optoisolator "hangs" in its threshold
region. You might consider the pulse converter component or set a D then
clear it thru software.
Use PSOC to set up a test bed where you create noise and a sine with Wavedac
and test the robustness of the zero cross solution.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, bad post
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, I have solved the problem. After unhooking my AC source yesterday I noticed that the Trigger Timer was still running, it should have stopped after each cycle, which I figured it being configured as a one shot would take care of. It did not and so I had to manually stop it in the interrupt function triggered by it's completion. This solved the problem. Oddly enough the Zero Cross detector works better without the debouncer, I am new at this and maybe didin't configure it right, but with the debouncer component hooked up to the same clock and the zero in pin it actually missed triggers. It does not miss without the debouncer and makes a beautifully smooth light.(On the LED, haven't tested it in the full circuit yet). Thanks for the stimulation of thought Dana, attached is the working circuit for the test. In the actual circuit the zero cross will turn on the Trigger Timer/counter and then at the second interrupt turn on the triac with a short pulse of 55.6 microseconds. (I hope)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right now your timer only allows 1/2 the line waveform control,
no reason not to set it up so that you can control into the other 1/2
of the sine.
Food for thought.
Regards, Dana.