Pure Sine Wave Inverter

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Pure Sine Wave Inverter

Post by Derrihj »

Hi friends is there anyone here that has an idea of how to make pure sine wave inverter in flowcode 8 things of sine table I totally have no idea how to start and end please share anyone with an idea on how to code pure sine wave oscillator

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: Pure Sine Wave Inverter

Post by STibor »

Hello,

Component: Frequency Generator (DSP)
Basic Sine Wave Generator:https://www.matrixtsl.com/wiki/index.ph ... ator_(DSP)

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Thanks STibor but i need a live example for slow learners.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Pure Sine Wave Inverter

Post by Steve001 »

Hi Derrihj

Have you tried a google search "microchip inverter reference design"

https://www.google.com/search?q=microch ... e&ie=UTF-8

they are quite well documented and contain lots of information

Steve
Success always occurs in private and failure in full view.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Guys how to obtain a sine table of 32 values in flowcode? Please help really need help on this and how to implement SPWM inverter.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pure Sine Wave Inverter

Post by Benj »

Hello,

Hopefully this should help. Currently the scaling is for a 16-bit signed int and will go between -32767 and 32767. If you need to change this to an unsigned value then I can provide an example for this too.
SineGen.fcfx
(11 KiB) Downloaded 577 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Thanks Benj but is this possible for you to provide this as a full complete spwm dc- ac inverter project with feed back say by having different sets of sine table with each having may be 32 values for different duty percentage values may be starting at lower duty of may be 65 percent when the inverter is first switched on then goes on increasing duty until the desired output is achieved say may be 220vac ,230vac or 240vac? we want to see how this is done in flowcode completly because we want to shift to flowcode since its easy to use than others.We want this to have 4 siginals ,that is 2 high and 2 low siginals to be fed to two IR2110 driver ICs.I dont know exactly how to bring out this clearly but i guess you get what am trying to say.THanks sir.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pure Sine Wave Inverter

Post by Benj »

Hello,

It's probably easier if you generate one sine wave at full scale and then use say the DSP scale component to allow you to dynamically scale the wave. You could maybe use the DSP control component to provide PID type feedback processing for the scaler.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Thanks Benj but Guys, i totally don't know how to do this which is why am requesting for a complete project if that is possible then discus where i get lost from which i think is the best way to learn especially for slow learners like me thanks guys.

DCW
Posts: 64
Joined: Mon Sep 28, 2015 8:19 pm
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Pure Sine Wave Inverter

Post by DCW »

Hello there... well now I believe that flowcode 8... has a facility whereby you can type in C-code ... and then it will.. 'create' flowchart (flowcode code) symbols...!!

So now if you go look on the internet.. and look for a brilliant indian fellow called - Tahmid - he has a brilliant working model, of a SINE wave inverter, that will not be too difficult to get around.

I studied it at length, and it seems very do-able... So buddy.. go check him out... Tahmid did it real nicely..

Ask Benj - to help you.. with procedure for creating flowcode - from C-code..

I sure it will work..

regards .. DCW ...

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Thanks DCW yes i know that guy Tahmid i my self been using him for some time and he has been so helpful in my smp inverter research and about flowcode i think it cant translate all the C code directly into flow-chat maybe Benj can come in and help us out. My only worry is how do we get Benj visit Tahmid page look at the sine wave project there and translate it into flow code

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Can someone help code this in Flowcode? http://tahmidmc.blogspot.com/2012/10/ge ... in_10.html

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Hi nice people how are you, hope all is well. Ok guys this is what i have been looking for most of the time, and that is a DC- AC pure sine wave inverter code with Feedback, I have attached the Arduino code in a text format if anyone can help turn this code into flowchart that will be really great coz i've had allot of trouble knowing how this is done with a practical example. I will also provide a link were to download a software for the Sine Table (Smart Sine) for generating the required sine table Values.
Attachments
SineWave Inverter With FB.txt
(3.4 KiB) Downloaded 228 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Here is the link to download Smart sine software: https://drive.google.com/file/d/0B4SoPF ... sp=sharing

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Another very useful information about Implementation of Sine Wave Table is found on the link below, but you will have to open each page in a different web page to be able to zoom in and read the words well coz they are small. http://tahmidmc.blogspot.com/2011/01/ge ... e.html?m=1

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Here is the Schematic
Attachments
Schematic.PDF
(23.94 KiB) Downloaded 253 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pure Sine Wave Inverter

Post by Benj »

Hello,

Have you looked at the DSP wave generator component, it might do just what you need in terms of generating sine wave look up table values and allowing you to step through the waves at different rates.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Pure Sine Wave Inverter

Post by mnf »

Hi,

Not sure if this got sorted - or even if this will be useful...
However - the current project I'm working on needs a wave generator - not necessarily sine, however my code was easily modified to do this.

I'm using a discrete DAC (a MCP4725) - and (hopefully will be) feeding the output into an opamp to generate a -V .. +V wave.

So the code is very simple - you can use the MCP component in FC (v9 at least) - or do as I did and roll your own (partly because I want to save the DAC state to it's EEPROM - and because it's a good way of finding out how the bits play together..) Here using 256 values lookup data - though this is easy to change - 512 values gave a 16.7Hz wave.
LabNation_Screenshot24.png
LabNation_Screenshot24.png (314.67 KiB) Viewed 21177 times
And using a 32 value lookup table:
LabNation_Screenshot25.png
LabNation_Screenshot25.png (282.79 KiB) Viewed 21172 times
and the code:
dac sine wave.fcfx
(13.41 KiB) Downloaded 193 times
Note - this test on an Arduino with i2c running at 400kHz. A faster MCU could run i2c at 1MHz - so should be possible to generate 50 or 60Hz signal using this technique....

Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Pure Sine Wave Inverter

Post by mnf »

Just realised, at daft o'clock in the morning, that the code above will only work on v9 Flowcode I use an array initialised in the variable definition. It would be easy to modify to use a look up component. It also doesn't use any components and will work on the free version of v9. If needed I can do a v8 version...

Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Hi guys, how is the new year treating you? guys i will continue to post sinewave codes until I get someone so kind with love to teach slow learners like me. Guys, now here is an Arduino pure SineWave code that works please anyone good at this help turn this code to a well-commented flowcode flowchart please help. What am looking for is a complete direct translation from this Arduino code to Flowcode, please someone out there kindly share your knowledge and make me really happy in this new year, Thanks allot let me also show its circuit diagram below But please for Flowcode use PIC18F442 because that is the chip i have to test this.
Attachments
Arduino Pure SineWave.txt
(3.4 KiB) Downloaded 154 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Here is the circuit diagram in PDF.
Attachments
Schematic.PDF
(23.94 KiB) Downloaded 172 times

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Pure Sine Wave Inverter

Post by mnf »

The code can be converted to Flowcode - with the proviso that a fair amount will remain as C (all the register assignments such as TCCR1A = ... for example)

However - I think it will eventually crash (in C or FC) - the function Inverter is recursive (it calls itself in two places with no return) and so it will eventually overflow the stack and crash. Each time the input on pin12 is 'clicked' the stack will get deeper...


Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

Thanks mnf for your quick response to my call for help.So what you are trying to say this can't work out in flowcode 😭😢 we can't get pure sine wave code in flowcode!! am really confused save me.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Pure Sine Wave Inverter

Post by mnf »

Hi, no, it could work - just that I think the C code has a bug in it. So as the joke goes - how do you get to... Well I wouldn't start from here.

I'll have a play over the weekend and set it I can get a version working...

Some compilers would optimise tail-recursion to a jump but i don't think they would cope here (and some would give a warning or an error)

Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Pure Sine Wave Inverter

Post by Derrihj »

[I'll have a play over the weekend and set it I can get a version working...]
Wawo!! That is really cool am waiting for that as I really want to see how it's done in flowcode to get pure sine wave PWM output thanks in advance.

Post Reply