Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 16
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
One birthday today, congrats!
Vaxian (17)


Next birthdays
05/21 Dalus (34)
05/21 Kizmo (37)
05/22 Skynet (32)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: High Voltage
« Previous topic | Next topic »   

Microcontroller Timed Flyback

Move Thread LAN_403
Art
Mon Mar 14 2016, 08:39AM
Art Registered Member #57369 Joined: Fri Sept 18 2015, 01:24PM
Location:
Posts: 66
Any canned pause function would have to take into account the time it takes to call and return from the pause function,
but whatever library you’re using should do that.

You didn’t post code, so I can’t see it.

If I were you I’d scrap that, or at least include it in the snippet above, right below main:

If you’re doing something like this:
while(1) {
pause (duration);
turn pin on;
pause (duration);
turn pin off
}

you’re in for trouble more and more the higher the frequency for the time that it takes to jump back to the top of the while loop.
It will always break your 50% duty cycle, just a matter of how much.

Post code!! :D
Back to top
Art
Mon Mar 14 2016, 03:17PM
Art Registered Member #57369 Joined: Fri Sept 18 2015, 01:24PM
Location:
Posts: 66
In that Swift for propeller, something like this should sweep frequency to make sure you are in the supply transformer pass band,
The byte should wrap back from zero to 255. Yuk to use as the finished timing code.

byte duration = 255;

int main() {
high(pin);
high(pin);
pause(duration);
low(pin);
duration—;
pause(duration);
}
Back to top
Patrick
Wed Mar 16 2016, 06:43AM
Patrick Registered Member #2431 Joined: Tue Oct 13 2009, 09:47PM
Location: Chico, CA. USA
Posts: 5639
ive switched the main power back to a primary of 75 volts. I replaced the weak transistor with a 1000v 13 amp mosfet. ill be coding a solution, and posting that here tomorrow.
Back to top
woodchuck
Wed Mar 16 2016, 09:26PM
woodchuck Registered Member #39190 Joined: Sat Oct 26 2013, 09:15AM
Location: Boise National Forest
Posts: 65
FWIW, I use microcontrollers regularly to generate gate drive signals for IGBTs and MOSFETs. But I always do the coding in assembly language. If you chose to use some HLL, be sure to check the signal with an oscilloscope before going live, to be sure you're getting what you want.

The Propeller is perfect for this application but I strongly recommend PASM over C or SPIN.

Also, Optocouplers are slow. Use a scope to make sure what they're doing, too.
Back to top
Patrick
Thu Mar 17 2016, 05:36AM
Patrick Registered Member #2431 Joined: Tue Oct 13 2009, 09:47PM
Location: Chico, CA. USA
Posts: 5639
this seems to be working:

int microsec = CLKFREQ/1000000; // divide the clock rate by a million to get ticks per microsecond
int highClocks = microsec * 10; // highClocks will be 10 microseconds, or 800 clocks at 80mhz
int lowClocks = microsec * 90;

DIRA |= (1<<15); // set pin 15 as an output by enabling bit 15 in the DIRA register

while( true ) // loop forever
{
OUTA |= (1<<15); // Enable bit 15 in the output register (same as high(15), but faster)
waitcnt( CNT + highClocks ); // add highClocks to the current clock, wait for the clock to reach that value

OUTA &= ~(1<<15); // Clear bit 15 in the output register (same as low(15) but faster)
waitcnt( CNT + lowClocks ); // add lowClocks to the current clock, wait for the clock to reach that value
}

Woodchuck, ive been using my oscilloscope religiously, but the propeller is hard to use.



1458193380 2431 FT1630 Spark


50 uS high and 500 uS low is super powerful.

it seems to spark at 0.85 inches, and arc furiously at 0.6 inches. it looks like 50-60 kV, which I think is to high. I'm going to put a 50kV 30 Mohm resistor across the flyback tomorrow, if the voltage stays as high as I think it will, then this flyback will put out 85 watts or more real power.
Back to top
Erlend^SE
Thu Mar 17 2016, 06:07PM
Erlend^SE Registered Member #1565 Joined: Wed Jun 25 2008, 09:08PM
Location: Norway
Posts: 159
Best would be to meassure output voltage and cut down on time at higher voltage.

That's how I will do my microcontroller hv supply (also in my case the h-bridge should clamp the voltage).

Another option is a secondary winding + diode that will conduct returning energy to supply if voltage goes too high.
Back to top
Patrick
Fri Mar 18 2016, 04:17AM
Patrick Registered Member #2431 Joined: Tue Oct 13 2009, 09:47PM
Location: Chico, CA. USA
Posts: 5639
should I keep the ground from the attached to the primary side? or let the secondary stay totally isolated. I'm not having any luck measuring the output.
Back to top

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.