Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Switching Led

Status
Not open for further replies.
For the moment lets consider an ideal signal that's 50 Hz and almost looks like a square wave.

From 0 to 180 deg it's say 100 and from 180+ to 360- it's zero.

Now lets think about pulsing it for 100 uS every 100 uS.

With this signal it's easy to find the start or rising edge. This would be the zero cross for an AC signal which we know is not ideal. You can call an ISR (TRIGGER) when this signal goes high easy enough.

Now since you want a 100 uS pulse train, then make an ISR (FIRE) that is to be called every 100 uS starting at the edge.

FIRE might look like:

Disable interrupts

IF SLOT < WHAT_SLOT, then 1$

If CYCLE is TRUE, then TURN SCR ON; CYCLE = FALSE : RETURN from interrupt
IF CYCLE is FALSE then turn SCR off ; CYCLE = TRUE; RETURN from interrupt

1$: CYCLE = FALSE

Return from interrupt

END FIRE



TRIGGER might look like
Disable interrupts
CYCLE = LOW : Set up Timer based call to FIRE every 100 uS
Set SLOT to 0
END TRIGGER


PID could run every X slots or could run by itself every so often.
PID just has to update the slot variable after indexing for % ON.


Caveats:
I didn;t play computer
I didn;t pay any attention to starting at counting at zero or one.
I didn't correct for varying frequency.
I didn;t correct for dead time.
I didn't pretend it is a sine wave with a top and a bottom.

The waveform is super simple and only deal with the first half.

So, the idea is to divide the waveform into slots of on/off which is the trigger length and use that as your basic timing. You start the timing when you get a voltage zero cross. Now, the problem is to handle the weirdness. You have a delayed zero cross, so maybe start some x*100 us later or start at slot 2 and maybe ignore the last two slots. e.g. Don't fire the SCR if in the last two slots.

Do you have to slightly correct for frequency or even correct for frequency. Do you care if it doesn't work in 60 Hz environments?

The idea is to get a consistent trigger during the power cycle without accidentally trigging one at the end or put another way, the SCR firing pulse is not there some time before the next zero cross.
 
Thanks Kiss,

I'll have a think about what you have written, I have to get it right for the motor control PID no matter what.

I have been looking at various ways to achieve this, it's easy enough to create the pulse train but to get it to Fire n times only then stop has me stumped at this stage.

I am trying to get the PID for the Lamp sorted a bit better regarding your thoughts in Post 140.

Thanks again, I'll keep trying & post some more details when done.

Cheers
 
I forgot to ask something that I was thinking about.

Instead of a pulse train to the gate, would there be any issues if the single pulse to the gate was held high for a longer duration- Time, if the Triac turns off at 0 current wouldn't it turn back on with the high signal held at the Gate?
Thinking about it I can't see a problem & it wouldn't interfere with other equipment as much?

Just a thought, I would just like to know if it would be problematic somehow.

Cheers
 
Thanks Kiss,

How you find some of this info is beyond me, that looks like a good read.
I normally can't find anything I want on the net, probably due to not knowing exactly what to look for though.

Thanks again, i'll read through it properly now.

Cheers
 
I've been told that before, so it's nothing new. I have a very very wide skill set from rudimentary glass blowing (Quartz tubes in a Hydrogen flame sealing in vaccum) to reconstructing a chimney. Mechanical, electrical, electronics, automotive and plumbing design and repair just to name a few things. I had nearly full machine shop privs where I used to work. Welding was "off limits", but I did have a stick, TIG and MIG welder in my hand at least once and did really well, but I would have trouble with setups. I've operated in the low current extremes like pA and high voltage extremes of say 100 kV with some 1000 W RF thrown in. I worked on tube stuff when I was a kid. I also have high power audio building from scratch and repair. I built a version of the Leach Amp in the 80's,. https://users.ece.gatech.edu/mleach/lowtim/ HVAC design; small structure design, HVAC repair (EPA Certified for automotive and small appliance). We did have a system that used 3000 A at 6V. I've changed lamps where you have to suit up to change them. The envelope is 10-15 atmospheres and a fingerprint can be deadly. I did minor chemistry stuff and even used concentrated hydrofloric acid which is very deadly. It eats glass and penetrates the skin way to easily. Then there is the High vacuum, vacuum and ultra high vacuum stuff. Then add cryogenics to the mix. I also know that each "world: has it's practices. Like the thermocouple worlds, RED is negative, You don't assume anything.
 
Yes, I also turn my hand to most things, Electronics & Programming being my downfall though, started to late & have some issues now which makes life difficult.

I may be concerned about nothing here but I had better ask, better to be safe than sorry. Like you say "Assume Nothing", that's the way I go about life!

Ok, i'll try to spit this out so you have a chance of understanding it.
I read in the application note attached that a 400uS pulse is good up until 7deg Current Lag which was suitable for the single vacuum motor test they conducted, which made me immediately think that I have 4 motors connected in parallel.


Do Ac motors follow the Inductance formula's when connected in Parallel?
If so the Inductance of the 4 motors will be less so I should be fine---BUT.
In saying that I also don't know if an Inductive Load has more Current Lag if it has more Inductance more Inductive Reactance or a combination of those or more variables?

To further that I have my Motors mounted in close proximity to each other for a Technical reason that I won't go into here which made me think that Inductors in close proximity to each other can have Mutual Inductance issues & with the Iron Cores - Laminations of the motors being close together may have a Magnetic Coupling issue as well all of which will or may have an affect on the total Inductance & also the total current lag of the system.

I have attached a quick drawing (TOP VIEW) of how the motors are mounted & there proximity to each other for reference.

As mentioned I may be concerned about nothing but on the other hand all the variables need to be thought out first to make the Control System operated effectively.

The trouble being I can think of apparent issues but don't know the damn answers to my own questions?

What do you think?

Cheers
 

Attachments

  • Motor Mountings.PNG
    Motor Mountings.PNG
    29.5 KB · Views: 211
Last edited:
I'll sleep on it. The 7 comes from 50*2*3.14159*0.0004 * (180/3.14159) which is 7.2.

Inductors in parallel follow the same rule as resistances in parallel, so the inductance would be a factor of 4 lower.
 
I have spent a bit of time changing the PID Sketch, I mentioned before that the Lamp was Flickering to keep the set point Temperature which I didn't like, the power to the lamp was basically ON-OFF making it flicker & wasn't a smooth dimming effect.

Anyway I have changed things & now it is nice & smooth & I can control the Lamp from around 26 deg C to around 495 deg C.

There is still more adjusting & tuning to do, I realise that but I will attach some screen shots from the serial readout.
In these shots you will see more tuning needs to be done on the step tests as it takes to long to settle but I think the shots will show that the PID is starting to work OK.
This is really interesting stuff.

With a few more changes & some tuning I think I may be able to get this which just makes my day!

The serial readout is now in degrees C & also shows the output to the Lamp 0 being off & 255 full power output.

The readings are 1 second apart.

Getting there slowly.

Cheers
 

Attachments

  • 26 deg Static.PNG
    26 deg Static.PNG
    30.4 KB · Views: 212
  • 200 deg Static.PNG
    200 deg Static.PNG
    39.2 KB · Views: 234
  • 294 deg Ascending Step.PNG
    294 deg Ascending Step.PNG
    28.5 KB · Views: 186
  • 482 deg Ascending Step.PNG
    482 deg Ascending Step.PNG
    40.3 KB · Views: 187
Nice!

How are you doing in terms of % full scale of the inputs or is the thermometer doing quantization errors on you?

e.g. Are you operating at the bottom end of the A/D?
Is the thermometer responsible for the xx.62 degrees?

PS: I think you should come up with a different title for this thread eventually and then ask a moderator to change it.
 
Ahh, I see what your saying, obviously I have not got that right yet.
I'll have a look & get some answers for you.

PS: If a Moderator has a look & sees how much fumbling around I'm doing they may just delete this thread entirely, Ha!

Cheers
 
Yes, it was a novice error on my part.

I was multiplying things by odd steps resulting in fractional results, all fixed now & I did a little more tuning.

See results attached.

Do you think I am ready to attempt the Motor Control setup?

If so I will start working some things out for the circuit etc.

I remember you have mentioned that detecting Zero Crossing is not a good way to do things, I have been thinking about that & the only other way that I can think of is to detect Zero Current is this what you were referring to?

Cheers
 

Attachments

  • 100 Deg Ascending Step.PNG
    100 Deg Ascending Step.PNG
    38.1 KB · Views: 212
Off the subject for a moment.
When I ventured to town last time there was a huge Power Factor Control cabinet at the scrap yard that was removed in working order from a closed down factory, just another import tragedy.

They didn't want to dismantle the cabinet due to it having 12 large cylinders mounted inside containing 3 big capacitors in each, total 36 capacitors.
There were 18 THYCON SCR's & all the control circuits, heat sinks, huge chokes etc inside it as well.

I told the owner that I would discharge the capacitors for him if I could have the SCR's, Circuit boards, Capacitors & the heat sinks & he said they only throw away all those things except for the heat sinks being Aluminium anyway so go for it.

So, I have all the components now.

I have attached a picture of one of the Hockey Puk or Disc SCR's, I have been trying to find a datasheet on these with no luck.

They are marked ( THYCON USA 6K14 P0 95 39 )

I bought the huge cabinet as well for $20, makes a good lockable tool cabinet.

The circuit boards are full of goodies as well including Pulse Trigger Tansformers, etc.

Any help with a datasheet would be appreciated.

Cheers
 

Attachments

  • Thycon SCR.JPG
    Thycon SCR.JPG
    273.5 KB · Views: 218
Yes, it was a novice error on my part.

I remember you have mentioned that detecting Zero Crossing is not a good way to do things, I have been thinking about that & the only other way that I can think of is to detect Zero Current is this what you were referring to?

No, I was referring to the asymmetry of your zero cross, but you might be OK because you won't be operating at the extremes. What could happen, is that 0- to (some number) degrees ON may have issues. e.g. Operating close to full power and very low power/

I finally found this **broken link removed** circuit, which is free for use that appears simple enough.
 
I know exactly what your talking about now with reference to problems operating at full power, I already encountered that problem with this setup, it was ok at low to mid power settings but it seemed like it was tripping over itself (novice talk there) at high power from about 350deg up to full power.

After a serious headache from it I finally found a solution in the sketch to correct the timing & now it is very good from low to high settings.

The circuit you found is easy enough, I have 4N25 Optocouplers but not the 4N35.

Yes, i'll try to contact Thycon on Monday.

Thanks for trying.

Cheers
 
I finally found this **broken link removed** circuit, which is free for use that appears simple enough.

I simulated the Zero Cross Circuit to see how it looked in LTspice & have a couple of questions regarding some things I have wanted to know for a while, pretty basic stuff I suppose, if you know that is.

I noticed on the schematic (Attached) that they say C1 can be a 10V capacitor?

Also that C2 doesn't specify what Voltage rating it has to be which led me to simulate it in the first place to have a look.

In the simulation C1 has around 118V RMS on the Positive side & the Negative side.

So my question is that even though the Capacitor is rated at 10V it will still take a higher Voltage if the DIFFERENTIAL across the capacitor is say 10V or less.

Is this correct?

C2 has around 120V RMS on the AC hot side & around 115V on the ground side obviously a differential of around 5V, so a normal 1nF 100V cap will easily do it?

Now Q1 the 2N3904, I don't really understand, it has approx 118V on the Emitter, Base & Collector.

How high a voltage can you put on a small transistor like the 2N3904 or does the same thing apply, is it the differential voltage limits like from the Datasheets & not the applied voltage?

All this is taking into account that the simulation is correct which I think it would be.

Cheers
 

Attachments

  • Accurate Zero Cross Circuit.PNG
    Accurate Zero Cross Circuit.PNG
    87.5 KB · Views: 2,556
willeng said:
So my question is that even though the Capacitor is rated at 10V it will still take a higher Voltage if the DIFFERENTIAL across the capacitor is say 10V or less.

That makes NO sense.

willeng said:
Now Q1 the 2N3904, I don't really understand, it has approx 118V on the Emitter, Base & Collector.

Applied voltage is always differential. A datasheet might specify V thing like Vce or the max voltage from the collector to the emitter not some other point,

C2 has around 120V RMS on the AC hot side & around 115V on the ground side obviously a differential of around 5V, so a normal 1nF 100V cap will easily do it?

C2 should be ceramic. In fact an, X or Y cap, I forget which is which. In any event, this https://www.digikey.com/product-detail/en/VY2102M29Y5US63V7/BC2354-ND/1983393 is suitable.

There are capacitors with X and Y ratings. One is for across the line applications and one is line to ground applications. I for get which is which, They also have numbers after then like X1Y2 and again, I'd have to research their meanings. The point is, these capacitors are designed to "fail safe" when compromised. See the datasheet/brochure: Here https://www.vishay.com/docs/49572/49572_pt9159.pdf is the brochure. Note: across the line applications and line bypass.

In this particular circuit R1 and R2 do offer a lot of protection and it's less important.

Probably strictly not required, but metal oxide resistors would probably be a good choice on the line side. They basically fail open which is a good thing. Carbon composition basically get higher in value and metal film resistors puddle. I worked on a power amp which a few resistors were puddled on the circuit board. In a slow start circuit I designed (audio amp) uses a metal oxide resistor in series with the line. I left out secondary protection. It's the turn-on fuse, but it also limits the charging current on 40,000 uf of capacitance. I made a crude comparator using series connected optoisolators that shorts out the resistor when the caps have charged to > 2/3 of the max voltage, During the charging time, the speakers are disconnected and so is the audio. When the resistor shorts out, the audio "ramps" up. Turn off is also quick, the audio inputs get disconnected first (the opto is faster) and then the speakers via a relay. That little resistor saved my butt. I accidentally reversed the NPN and PNP transistors in the output and the ONLY problem was that metal oxide resistor.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top