Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 28
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
11/29 Sonic (58)
11/29 kamelryttarn (46)
11/30 arnsfelt (45)
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 :: Computer Science
« Previous topic | Next topic »   

DRSSTC Interrupter, PIC based

1 2 3 
Move Thread LAN_403
EDY19
Sun May 28 2006, 07:56PM Print
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
Im continuing this thread from the other, since its more related to computers now. Im looking to create a interrupter with a PIC running at 20MHz that acts as an interrupter. It will also have a 16x2 LCD display with a HD44780 controller, which displays on time, off time, as well as frequency. There will be two knobs or something (still can't figure out quite how to do this, maybe buttons are better?...) that control the frequency and the on time. I think buttons might be better for the on times and frequency because that will keep all the information digital, instead of using analog to digital converters and potentiometers etc. I was going to use rotary encoders (they would send out a certain number of pulses per rotation) to increase the freq. and on time, however, they cannot tell when they are being turned backward (to my knowledge).
Any suggestions are appreciated on the project including programming or other!
Back to top
JimG
Sun May 28 2006, 08:47PM
JimG Registered Member #52 Joined: Thu Feb 09 2006, 04:22AM
Location: Austin TX
Posts: 57
This is a pic uC interrupter that I built last year that uses an LCD read-out for the settings.

1148848015 52 FT10309 Interrupter


Using a rotary encoder is a good idea since using buttons makes it slow to change settings. Most encoders have two outputs that alternate in a different order based on the direction that it is turning so it shouldn't be a problem. One of the nice things about using a uC controlled interrupter is that it is easy to reprogram to change the limits on the settings or do different tricks like changing the on time during a single burst.

One of the the problems that I had with it was that it would reset randomly, mostly after a few ground strikes, so I made it use an optical output and trigger my coils through a fiber optic cable. I'm sure it was due to improper shielding, but I was a bit too lazy to try and track down what was going on.
Back to top
EDY19
Mon May 29 2006, 02:17AM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
Do you still have the code for that? That is EXACTLY what I am trying to build! If you don't want to give it out, suggestions are greatly appreciated because I havn't ever even built a project with a uC. If you have the code, could you post it or PM me with it if you will? Thanks! Also, what does the BC and BD stand for on the display? Are those push buttons on your board for the timing controls?

Found this data as well on rotary encoders:
Link2

(Taken from that site, picture on site helps a lot)

This square wave is basically a representation of a sine wave, 90 degrees out of phase. It is easy to interface, if you take OUT 1 and define it as your direction. If OUT 1 is high when a pulse starts on OUT 2, then the rotary encoder is going clockwise. If OUT 1 is low when a pulse starts on OUT 2, then the encoder is going counter-clockwise.
Back to top
JimG
Mon May 29 2006, 04:47AM
JimG Registered Member #52 Joined: Thu Feb 09 2006, 04:22AM
Location: Austin TX
Posts: 57
I've attached the code that I wrote. The code was never meant to be public so there are almost no comments in it and there are a number of costants that should have been defined, but it should be enough to get you started. The circuit that I built used a 16F628 using the internal timer and the LCD data is sent through a 74HC164 shift register because I wasn't sure ate the time how many ports I was going to use. If I get some time I will try to post a new version with better comments.

As far as the rotary control is concerned the ones that I have used have a tactile feedback for each state change so using the method of using one line to check for the change and the other for direction feels weird when it takes four clicks to do a value change. The best way is to watch to see if either changes and compare the current state to the previous state to get the direction. I will try to dig up some sample code that I wrote to handle this.



]1148877746_52_FT10309_interruptor.zip[/file]
Back to top
Steve Conner
Mon May 29 2006, 01:45PM
Steve Conner Registered Member #30 Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
Cool! JimG's design looks way better than the one I did.

I built several instruments controlled by rotary encoders in my day job. The way I do it is to raise an interrupt any time either encoder line changes state (using the PIC's PORTB Interrupt On Change feature) and have the ISR compare the current state to the previous one.

To do this, I just take the state of the lines "now" as the two LSBs, and the previous state as the next two higher order bits, to form a 4-bit state vector. Then I do a computed goto on that 4-bit number. So depending on both the current and the previous state, the program jumps to a routine that adds one to the encoder position register, or a routine that subtracts one, or a routine that does nothing. For convenience, I also have the first two of those routines set a flag to tell the main program that someone moved the control knob.

You can buy encoders that output two state changes per click of the knob, but that's cheating. tongue
Back to top
JimG
Mon May 29 2006, 03:06PM
JimG Registered Member #52 Joined: Thu Feb 09 2006, 04:22AM
Location: Austin TX
Posts: 57
I don't think my solution was that elegant, Steve, but now I want to see if I still have a rotary encoder in one of my part boxes and try out that trick.
Back to top
HV Enthusiast
Mon May 29 2006, 03:16PM
HV Enthusiast Registered Member #15 Joined: Thu Feb 02 2006, 01:11PM
Location:
Posts: 3068
A good set-up to use would be a rotary encoder with an integrated pushbutton. This is how we do our commercial modulators (interruptors as you call them) Each push of the encoder button can be used to cycle through various set-up values and the encoder itself can be used to vary the values.

Our standard parameters we use in our interruptors are:

1. PRF (10-10kHz)
2. Duty Cycle (0-50%)
3. Pulsewidth (0-10ms)
4. Priority Select (constant Pulsewidth, constant DutyCycle, constant PRF)
5. Burst Mode (On/Off)
6. Burst Interval (ms)
7. Burst Count (1-100)
8. Single Shot (On/Off)
9. Soft Start (On/Off)
10. Soft Start Mode (Duty, Pulsewidth)
11. Soft Start Interval (0-10s)

The soft start function we are presently experimenting with for auto break-out (no break-out point required). We found by ramping up the duty cycle, we can initiate break-out (without using a break-out point) and without causing the the bridge to blow-up due to enormous peak currents in the primary. Still has bugs, but we are working them out.

Also, we may be offering this PIC (already programmed) of this interruptor for sale on the website in the very near future. It basically interfaces with a 16x2 LCD, rotary encoder with integrated pushbutton, and additional pushbutton.

Dan
Back to top
EDY19
Mon May 29 2006, 11:16PM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
Wow Dan, that sounds pretty impressive, and might be worth a try If I can't get mine working someday. I think It will be a long shot to get it working, but if it does, it will be really cool. I think mine will be much cimpler though, Single shot mode, and oscillator with on time and frequency knobs and possibly off time, as well as some sort of selection of which needs to be the priority, constant on time, constant frequency, constant off time. Very clever indeed though, Dan! Let us know when you get them on the site, any ideas on cost for just the chip? Or a kit would be nice with the rotary encoders and the PCB... smile What frequency do you run the PIC at, and what type is it?
Back to top
HV Enthusiast
Tue May 30 2006, 02:06AM
HV Enthusiast Registered Member #15 Joined: Thu Feb 02 2006, 01:11PM
Location:
Posts: 3068
I used a PIC16C66x controller and a crystal oscillator for 20Mhz. The final version will likely be a smaller controller (the PIC16C66x has quite a bit of I/O which was just used because i had a emulator board handy for this guy) especially considering i can run the LCD in 4-bit mode instead of the 8-bit mode i'm using now.
Back to top
Wolfram
Tue May 30 2006, 04:39AM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
JimG, what are the limitations of your controller (min. on-time, how big steps the on-time can be adjusted in, max. on-time, max. BPS)?


Back to top
1 2 3 

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.