Discussion: why CD4046 pulse train generation with gating can´t work with pll

Gunther Rattay

Discussion: why CD4046 pulse train generation with gating can´t work with pll
« on August 19th, 2014, 03:48 AM »Last edited on August 19th, 2014, 02:36 PM
In 2010 I open sourced a stan meyer pulse generator circuit made by discrete well known digital components like NE555, CD4046 etc.

using the phase lock loop feature of the 4046 always needs a feedback information from the transformer or LC component of the application.

http://en.wikipedia.org/wiki/Phase-locked_loop

all worked well those days as long as there was continuous pulsing because then the feedback information needed from the application also was ongoing.

but as soon as the circuit started gating mode during the gating time there was no more feedback information for the 4046 and the 4046 started to change it´s frequency during gating. when gating ended and pulsing restarted the frequency was no longer in the ballpark of resonant action and it took some time until the application was regulated back into resonant action. so the system was out of resonance for most of the time :(

Maybe one is planning to operate without gating? For Stan Meyer application that seems to be pointless because some of the action takes place after pulsing excitement ends into gating.


maybe if one were using a block of  thousands of pulses until gating that erratic behaviour should be not that bad as if you only used 5 or 15 pulses at a time between gating.


so it perfectly showed that this discrete hardware solution was no way to go and I decided to use a microcontroller to overcome that fundamental issue of 4046.

of course there were workarounds I took such as using larger capacitors to smoothen the bit banging behaviour of the 4046 operation but then the whole regulation became far too stagnant ... that all didn´t work.

http://open-source-energy.org/?topic=1097.msg14611#msg14611

so the discrete circuit solution was a real dead end ..


knowing that in 2010 I redesigned the complete pulse generator design and went the way Stan Meyer himself described in one of his newsletters,

I left the "country road" and entered "interstate" by choosing a powerful µC chip and a sophisticated software design. the Parallax Propeller!


now it´s a smooth and easy cruizing using pll and gating :)

all it needs is a microcontroller and a single opamp and i´m done. the pcb is not really needed - just for comfort ;)


So the system family today shows up with 2 different characterstics:

"PGen pulse generator" with additional hardware for customization
or
availabe thru Amazon as "PGen pulse wizard" with or without the sole µC chip.

for commercial information please follow the link:
http://open-source-energy.org/?topic=1836.msg25094#msg25094



what are your thoughts and ideas about that?







Webmug

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #1, on August 19th, 2014, 04:56 AM »
Quote from Gunther Rattay on August 19th, 2014, 03:48 AM
In 2010 I open sourced a stan meyer pulse generator circuit made by discrete well known digital components like NE555, CD4046 etc.

using the phase lock loop feature of the 4046 always needs a feedback information from the transformer or LC component of the application.

http://en.wikipedia.org/wiki/Phase-locked_loop

all worked well those days as long as there was continuous pulsing because then the feedback information needed from the application also was ongoing.

but as soon as the circuit started gating mode during the gating time there was no more feedback information for the 4046 and the 4046 started to change it´s frequency during gating. when gating ended and pulsing restarted the frequency was no longer in the ballpark of resonant action and it took some time until the application was regulated back into resonant action. so the system was out of resonance for most of the time :(

Maybe one is planning to operate without gating? For Stan Meyer application that seems to be pointless because some of the action takes place after pulsing excitement ends into gating.


maybe if one were using a block of  thousands of pulses until gating that erratic behaviour should be not that bad as if you only used 5 or 15 pulses at a time between gating.


so it perfectly showed that this discrete hardware solution was no way to go and I decided to use a microcontroller to overcome that fundamental issue of 4046.

of course there were workarounds I took such as using larger capacitors to smoothen the bit banging behaviour of the 4046 operation but then the whole regulation became far too stagnant ... that all didn´t work.


so the discrete circuit solution was a real dead end ..


knowing that in 2010 I redesigned the complete pulse generator design and went the way Stan Meyer himself described in one of his newsletters,

I left the "country road" and entered "interstate" by choosing a powerful µC chip and a sophisticated software design. the Parallax Propeller!


now it´s a smooth and easy cruizing using pll and gating :)

all it needs is a microcontroller and a single opamp and i´m done. the pcb is not really needed - just for comfort ;)


So the system family today shows up with 2 different characterstics:

"PGen pulse generator" with additional hardware for customization
or
availabe thru Amazon as "PGen pulse wizard" with or without the sole µC chip.

for commercial information please follow the link:
http://open-source-energy.org/?topic=1836.msg25094#msg25094



what are your thoughts and ideas about that?
Yes, I also didn't manage to get the PLL working in the GATE time (PULSE off). The PLL (scanning circuit) wasn't fast enough to tune in! Always (reboots) the PLL so resonance was lost again and again...

When the GATE kicked in there are no PULSES to trigger the PLL on (PLL off pin). Maybe there is something missing (or I did not understand) to just hold it on the resonance frequency kinda memory for a longer time when GATE is active?

I really like the Propeller chip. Can it generate PULSE and GATE (frequency and duty-cycle) using one Cog??? I need eight PWM's with gate? I read one Cog is used for UART/EEPROM for boot-up? so max. 7 PWM's with GATE, maybe?
Do you program the propeller in C language IDE?

~webmug


Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #2, on August 19th, 2014, 05:21 AM »Last edited on August 19th, 2014, 09:14 AM
@webmug

the only way to trick the 4046 at gating is increasing the storage capacitor. the reason for that issue is that the frequency generator is realized by a bit banging mechanism that charges a capacitor and that capacitor voltage represents the actual voltage level for the voltage controlled oscillator. increasing that capacitor will reduce the frequency deviation but only for short gating periods. if gating gets longer the frequency will drive away again and then the time until phase lock is reached again will increase due to the larger capacitor. so you don´t overcome the problem  but shift it somewhere else ... (that´s normal in human civilization to do so but not too good for laboratory applications ;))

so there is nothing missing and you have a correct understanding ... it´s just something nobody can overcome with those digital plls 4046. 4046 pll has been built for standard phase detection and that works without gating ... 4046 has no internal storage information about last resonant frequency, it´s all outside in the bitbanged capacitor ...


after the bootup procedure in cog0 is finished that code gets overloaded by the initial cog0 spin interpreter. so there are no wasted ressources for bootup in user specific operation.

yes, each cog generates pulses and gating by itself. you can define the exact number of pulses for a pulse segment and no pulse will be truncated at all.  but there is more ... you can concatenate up to 8 pulse segments for a pulse train and each sequence can be pulse or gating - it´s all handled in a single cog. all segments are concatenated without any time delay at transition.

one cog is for application control, one for communication, one for pll observation (if in PLL mode) and calculation, one for floating point calculation, 4 are available for pulse generation.

future version will integrate a daisy chain feature combining n propeller chips so that you can extend channels in steps of 4 using a single user interface. at the moment 8 channels can be realized by using 2 separate windows clients and 2 usb connections. each one connecting to a Propeller µC.

I don´t use the C-IDE because i started long before it was available. the programming is 80% assembler and 20% spin. and of course lots of programming for the windows frontend.

Webmug

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #3, on August 19th, 2014, 07:11 AM »
@gunther,
I wonder how Meyer used the PLL? :D

Amazing stuff!!! :cool:

If I get myself two Propeller mini boards can your firmware/GUI be used? It has less pins (19) instead of (32) but the Cogs can use all the pins you want, right?

For PLL your extension board is needed I guess? PropStick? So what do i need for propeller mini to use PLL option?

~webmug

Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #4, on August 19th, 2014, 07:31 AM »Last edited on August 19th, 2014, 07:32 AM
@webmug

yes, you are correct. by setting a parameter in an ini-file you can set the first port number down to >= P2. think about how you want to connect the propeller mini to your computer. if you want to use usb instead of 3.3V logic you have to order 1 usb converter for each controller. then the prop-stick might be a better fit. however, if you want to use optocouplers between pc and each controller board so that the controllers might float in a high voltage environment a uC without integrated usb and an extra usb interface is a better choice.

for the pll it´s only a single opamp for all 3 channels, some diodes, some zener and a few resistors ... nothing complicated. i can send you the circuit diagram and you can apply it on a breadboard.

so no, you don´t need the pcb.

Webmug

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #5, on August 19th, 2014, 08:25 AM »
Quote from Gunther Rattay on August 19th, 2014, 07:31 AM
@webmug

yes, you are correct. by setting a parameter in an ini-file you can set the first port number down to >= P2. think about how you want to connect the propeller mini to your computer. if you want to use usb instead of 3.3V logic you have to order 1 usb converter for each controller. then the prop-stick might be a better fit. however, if you want to use optocouplers between pc and each controller board so that the controllers might float in a high voltage environment a uC without integrated usb and an extra usb interface is a better choice.

for the pll it´s only a single opamp for all 3 channels, some diodes, some zener and a few resistors ... nothing complicated. i can send you the circuit diagram and you can apply it on a breadboard.

so no, you don´t need the pcb.
I couldn't find a supplier (reasonable price) in the Netherlands for a PropStick USB.

For the connection to a PC via USB the Prop Plug could be an option.
Using a separate power supply for the Propeller Mini or use the 5V from the Prop Plug? The regulator need 6-12V but the prop is powered at 3.3V only, so I think 5V (max. 500mA) should be enough from the USB Prop Plug.

Well, a pll circuit diagram is very handy! :D
I do think the op-amp circuit is somewhat different as Meyers pickup-circuit :)

~webmug

Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #6, on August 19th, 2014, 08:49 AM »Last edited on August 19th, 2014, 08:54 AM
@webmug

you can order from Elektronikladen Germany or PTL Munich. They order them from Parallax and they deliver more products than listed in the internet.

http://elmicro.com/catalog/mcu/propeller/
http://www.ptl-elektronik.de/

you can also order it from Parallax.

the Prop-Plug generates it´s power supply from the USB connection but there is no way to use it for the propeller. so you have to use a separate power supply for the µC.

the circuit diagram is most similar to the one Stan used but implementing a faster OpAmp than aged uA741 ...



Webmug

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #7, on August 19th, 2014, 12:29 PM »
@gunther,

Thinking out loud: isn't it useful to scrap the usb FTDI if you daisy chain n propeller chips, only use one USB Propeller board. So the Propeller mini boards connect as UART (TX,RX) to other Propeller mini boards? :cool:

If I use a Prop Plug and power the Propeller mini with separate power supply wouldn't the signals be messed up as I unplug the USB or Prop Plug and need some extra circuit or buffer chip between the TX and RX lines from the FTDI?

Don't know if it works but soldering a wire to the LED +5V from the USB could provide power to the regulators.
Do you know a Prop Plug replacement with power supply that can program the uC? Or still does it need a DIY solution? It want a RST signal?

Thanks!!

~webmug


Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #8, on August 19th, 2014, 12:49 PM »Last edited on August 19th, 2014, 12:51 PM
@Webmug

Indeed it makes sense to use only one usb featured controller. my release planning directs to one prop-stick usb as master controller and dedicated simple DIP40 controllers ($8 p.p.) without own eeprom sharing the clock count of master controller. slaves are booted one after the other and then work absolutely sychroneous to the master.

signals would not be messed but due to a bug in the ftdi disconnecting the usb at an open connection could cause an abnormal reset to the controller.

you can try to harvest the power supply voltage from the prop-plug. you have to check the ftdi datasheet for that and calculate 80 mA for the controller. the RST signal is needed for programming and for bootstrap loading at system start. there is another adapter available but amost idential. other adapter solutions I don´t know.

Webmug

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #9, on August 19th, 2014, 01:16 PM »
Quote from Gunther Rattay on August 19th, 2014, 12:49 PM
@Webmug

Indeed it makes sense to use only one usb featured controller. my release planning directs to one prop-stick usb as master controller and dedicated simple DIP40 controllers ($8 p.p.) without own eeprom sharing the clock count of master controller. slaves are booted one after the other and then work absolutely sychroneous to the master.

signals would not be messed but due to a bug in the ftdi disconnecting the usb at an open connection could cause an abnormal reset to the controller.

you can try to harvest the power supply voltage from the prop-plug. you have to check the ftdi datasheet for that and calculate 80 mA for the controller. the RST signal is needed for programming and for bootstrap loading at system start. there is another adapter available but amost idential. other adapter solutions I don´t know.
Awesome stuff!! :thumbsup2:
Sync a couple of propeller chips to one master clock :D But do you have enough space to store programs or can you load Cog routines on the fly with one host prop? Interesting... I guess you would load with UART communication from the host into the 'slave' props?

About the windows p-gen application, does it also do calculations needed for the PLL or is the uC doing all the work?

I have to think about this for a while, it's new for me...spin language etc. :cool:

Thanks for the info!!!

~webmug

Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #10, on August 19th, 2014, 01:29 PM »
@webmug

each uC has 32 KB of ram storage. at startup each controller loads it´s code on the fly while the others stay dormant in reset mode. of course they can be reloaded during operation but that takes 50 ms or more. programs are loaded from the windows frontend or from a dedicated micro-sd.

all calculations are done by the prop. some calculations are also done by the windows client but only for display and observation purpose.

in fact the controller can work completely without the windows client but then some sophisticated command strings must be sent to the controller by hand or another application.

history:

controller software was developed for stand alone application using a dumb tty terminal for operation control.

as a next step for convenience the windows client took over that part.

in the meantime the windows client has become much more verstatile (ini-file, phase shift lock operation) but the controller module is able to operate stand alone.








Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #13, on August 20th, 2014, 09:15 AM »Last edited on August 21st, 2014, 12:47 AM
Quote from nav on August 20th, 2014, 08:30 AM
The PLL ... should be monitoring current changes within the resonant LC circuit and then the PLL controls the gating.
there are many ways control loops can realize a regulation.

phase shift dependency that the pll regulates goes for resonance effects.

the reason why phase shift seems to be relevant for Stan Meyer tech is that he used it in his circuits so that seems to be an important regulation. knowing that temperature changes and air pressure changes influence the electric parameters of the cell the pulse generator should support that.


the relation you described according to current dependencies can also be regulated by a control loop.
then it´s no longer a phase lock loop but another control loop. but before one can realize that loop you have to define the exact current dependency because during oscillation the current permanently changes. be aware that each control loop needs a specific interface to get the electrical values needed for the regulation.

so what do you want to take as input value for the loop: peak current, average current, current integral over time and why and how exactly do you want the gating to be adjusted?

my suggestion is to observe the running application and then define the regulation exactly as it shall take place.
in a 2nd step it can be programmed into the pulse generator.

Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #14, on August 21st, 2014, 12:41 AM »Last edited on August 21st, 2014, 12:43 AM
Quote from nav on August 20th, 2014, 08:30 AM
The PLL shouldn't be monitoring the gated output
the PLL is controlling the pulse frequency generated withstanding the feedback signal distortion impact caused by the gating. so frequency is adjusting to dynamic changes in the LC circuit guaranteeing a defined phase shift of for example 90 degree. of course you can specify other phase angles like 70 deg or 120 deg.

OK, i've read what you both are saying but I fail to recognise the importance. You can look at this in two ways, the first is that you create a resonant LC circuit between an inductor and a cap. That circuit because of the varying dielectric constant of the water fuel cell may well need a phase lock loop to vary the frequency to keep it resonant but I don't think that is what Stan does.
I think it is the second option of using gating to stop dielectric breakdown within the LC circuit and the phase lock isn't varying the main frequency of the LC circuit itself but varying the gate width.
So the main frequency of the LC circuit in a tap water dielectric layer is constant and never changes at any point but because the capacitor voltage is heading toward infinity it will reach dielectric breakdown very quickly and start to ark across the water. You cannot stop that breakdown by changing the frequency of the LC circuit itself, you can only stop it by placing time intervals in the main frequency via gating and tune the cap to the workload. The workload is the number of Hydrogen atoms you attract to one cap surface and the number of Oxygen atoms you attract on the opposite cap surface. When gating is applied those atoms are released to float upward because it lets them go. So the gating does two thing:- stops breakdown and releases captive atoms. The gating itself is also a frequency just like the main LC circuit frequency but it is not related in any way to the LC circuit frequency at the same time. The phase lock loop keeps an eye on the LC circuit and when it starts to show signs of becoming a dead short situation it then acts. So the monitoring is before the final inductor and the gate is applied after the final inductor on the VIC.



Firstly though, it is important to understand what causes the voltage to set off toward infinity in the first place. This kind of behaviour is not indicative of the circuits we know and understand. It isn't until you look at bucking coils and what is happening that you start to understand voltage gradients and how they can isolate themselves from both our electronic circuits and indeed our understanding.
Cancellation voltage doesn't know whether it is on this Earth or Fullers Earth.

Once you create a voltage potential that is a seperated and isolated from its creator, that voltage will be alone in its own Universe and just like Stan's schematic below merge its point of creation with its point of annihilation in a loop. Tesla had his own way of isolation, Thane Heins has his too but they all do the same as Stan's.
In the schematic below, there are two circuits, neither one is aware that the other exists. One is in our Universe which is the one on the left with the full bridge rectifier the other is on the right with a modern version of a Tesla configuration, the voltages contained within are in their own little Universe.

Gunther Rattay

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #20, on September 18th, 2014, 12:49 PM »Last edited on September 18th, 2014, 01:01 PM
Quote from nav on August 20th, 2014, 08:30 AM
The PLL shouldn't be monitoring the gated output, it should be monitoring current changes within the resonant LC circuit and then the PLL controls the gating. What is the point in attaching a PLL circuit to an already gated frequency?
@nav - that way you can control the gating by amp flow. now it´s your turn to make it happen :-) (at 13:50 min)


https://www.youtube.com/watch?v=LKIMpeXp42c#t=834
(for a full screen display click on YouTube bottom right hand corner)


nav

Re: Discussion: why CD4046 pulse train generation with gating can´t work with pll
« Reply #22, on September 22nd, 2014, 09:54 AM »
Quote from ~Russ on September 18th, 2014, 12:57 PM
i'm starting to agree with most of what your saying nav. but more stuff  i have to learn i think...

we ( me and Alex)  have a theory also and they seem to match some how. but I'm still working on it... so i cant call it out just yet what make the best scene.

~Russ
Hi Russ, Its all a learning curve for all of us. Its not just about if it works its also about why it works and if we don't know why it works then it becomes difficult to scale it up or down or adapt it for other projects.
I now know for a fact that cancellation voltage tries to set off toward infinity and I think i've found the reason why it does so. Stan's explanation in his lecture at 14:50 on this video:

https://www.youtube.com/watch?v=iaB5ME8kFGU#
He states that the coils restrict amp flo allowing the voltage to be 90 degrees out of phase with the current allowing his cap to do work, but he doesn't go into detail about why it does so. This video shows you why it does so when I created what appeared to be a monopole magnet in a bucking coil configuration. I now know what is going on with the monopole magnet.

https://www.youtube.com/watch?v=4T2jyC6N0_g#
That cheap 2 bit vid is the most important thing I ever did.
You will notice that Stan says in his lecture that voltage will set off towards infinity IF THE EQUIPMENT WE USE WILL ALLOW IT. This statement is the biggest pit fall of all our experiments.
We have been attacking the voltage gradient from the very beginning and placing it in a finite environment where it cannot deal with the infinite gradient.
I am not going to build a HHO cell because I've got a better idea. Instead of charging a cap with the cancellation voltage which requires a tuned LC circuit with a gated system, i'm building an electromagnet like Leedskalnin did and i'm going to charge it with a voltage that is infinite.