FFT calculation In PL

Antworten
abacom
Site Admin
Beiträge: 3917
Registriert: Dienstag 23. September 2008, 10:54
Kontaktdaten:

FFT calculation In PL

Beitrag von abacom » Montag 13. Oktober 2008, 13:30

p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 16.10.2007 18:55 Titel: FFT calculation In PL

--------------------------------------------------------------------------------

Hello PL user group:

I would like to know if anybody has done FFT calculation on aquired data
in PL,I log 4096 data points then by sending a command from PL to the Microcontroller ,
the microcontroller send the data points to PL ,once the data is in PL ,
I would like to calculate the FFT on the data and then diplay the curve .
any Ideas or help would be greatly appreciated.
Best regards
Peter.
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

Nach oben


compander



Anmeldungsdatum: 12.07.2006
Beiträge: 115
Wohnort: Markt Schwaben
Verfasst am: 16.10.2007 21:35 Titel: Wunsch

--------------------------------------------------------------------------------

Hallo Abacom. Hallo Freunde.

Ist es künftig möglich, dass Beiträge (also Fragen u. Antworten) im Forum auch in der allgemein hier üblichen Sprache (also Übersetzung(en)) veröffentlicht werden?
Damit hätten, denke ich, wirklich Alle etwas davon.

Vielen Dank, und Gruß vom C mpander.

Nach oben


hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 06:22 Titel:

--------------------------------------------------------------------------------

In my case I'm recording all data to a file in PL and using Excel (VisualBasic) to prepare/show graphs afterwards.
You can use the 'execute' element in PL to directly start this Excel sheet with the VBA code.

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 06:42 Titel:

--------------------------------------------------------------------------------

Hallo Abacom. Hallo Freunde.

Die übliche Sprache auf dem Weltmarkt ist meiner Meinung nach Englisch
und da die Abacom Weltweit verkauft schreibe ich und eigentlich alle andern in englischer Sprache.
Wenn das Forum tatsächlich nur in Deutsch anzuwenden ist besteht auch
nur für Deutschsprechende die Möglichkeit sich hier zu informieren?????
Das Forum könnte in Englisch von viel mehr Leute benutzt werden und mehr Info`s könnten ausgetauscht werden.
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 06:59 Titel:

--------------------------------------------------------------------------------

Hello hrd.
Thank you very much for the info ,certainly this is an option,
However I would like to have it in a real time application as I need to detect a certain frequency component in 3 pressure signals ,
as back ground information this is a Turbocharger testbench to meausre the compressor maps and turbine wheel maps of development purposes
of Turbo chargers and the actual surge line (when the turbo can not deliver constant air flow) can only be seen when a fast sampling is done on the presure signals and the FFT taken out this shows the actual swinging or turbulance in front of the compressor wheel.
I need to see this FFT in PL in real time when the Test bench is running ?
as the action that needs to take place if the charger is in the surge limit must be execute as fast as possible to prevent damage to the compressor wheel and charger you can imagine the forces on the wheel if the charger is doing 200 000 RPM and goes into surge.
Best Regards
Peter
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

Nach oben


hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 07:17 Titel:

--------------------------------------------------------------------------------

I understand but if you realy want to do that in real time then you have to ask abacom to enhance PL (version 5?). Of course there are math function where you can implement fft but you have to store previous data as well (ram). Then you will have read out the ram and doing fft again but I don't know what do afterwards to display the new graph.

In my suggested way it's nearly real time - as soon as you activate the execute element it runs the vba code and in a second you will see the graph based on fft. Maybe you can start this execute element every second automatically and a new graph pops up every second or it extends by new data from last second.

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 07:27 Titel:

--------------------------------------------------------------------------------

Hello hrd.
I was just now thinking your way would really work in a way that is usefull. I can write an application in VB which will extrude the FFT ,and
by sending the aquired data to Pl and then execute the VB application,
Thank you very much for your help I think I will try this in the next week or so ,will report back on this
Best Regards
Peter
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

Nach oben


hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 08:16 Titel:

--------------------------------------------------------------------------------

p.erasmus hat Folgendes geschrieben:
...I can write an application in VB which will extrude the FFT ,and
by sending the aquired data to Pl and then execute the VB application...


I thought recording your measurements to a file within PL and then reading them by Excel using VBA (read, do fft, show graph).

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 08:20 Titel:

--------------------------------------------------------------------------------

Hrd
This is what I understood aswell
sending the data to PL record in a file and then execute VB extract and display the FFT graph.
My wording was a bit confusing in the previous post.
Thank you hrd it is clear what I need to do now .
you helped me a great deal.
Best Regards.
Peter
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

Nach oben


hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 08:56 Titel:

--------------------------------------------------------------------------------

p.s. What ADC hardware are you using?

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 09:12 Titel:

--------------------------------------------------------------------------------

hrd

I am using a dsp microcontroller from Microchip dsPIC30F where I do 5 AD conversions on the Pressure signals simultaneously ,at 100Khz sampling frequency,then I send the data to PL over the com functions in Pl but I am actually using the microcontroller SPI PORT to a USB controller that sends the data as usb data and then I have a virtual com driver that converts the usb to Rs 232 for PL this give me a data tranfer rate of up to 1Mbit/sec this is done to have speed in the communications
the USB controller is a PIC18F2550 .

thus dsPIC over SPI to USB controller USB to PC and in Profilab comreceive string blocks are used
Virtual windows Driver is from MICROCHIP the combination works well and fast.

Hope i am expressing myself corectly and understandable.

I just look at the C libs for the Microcontroller there are FFT libs available
possibly I can aquire the data in the controller do the FFT extraction in the Microcontroller and then just send the vector data to PL and display in a X/Y graph ,I am not totally sure which will bet the best method at the moment,

Best Regards
Peter
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

Nach oben


hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 09:27 Titel:

--------------------------------------------------------------------------------

Interesting - what is the resolution of these 5 channels sampling with 100 kHz?

If you can fft in microcontroller I would do that there because then you can display the result directly in a PL graph.

Nach oben


Mike D



Anmeldungsdatum: 03.07.2006
Beiträge: 236

Verfasst am: 17.10.2007 11:09 Titel:

--------------------------------------------------------------------------------

PL and EXEL can also excange data via DDE, but I think not with 100kHz?

What about putting the FFT stuff in a DLL?

Mike

Nach oben


hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 12:00 Titel:

--------------------------------------------------------------------------------

Mike, how would you fill data in Excel with DDE for a statistical calculation in Excel where you have to address a range of cells.

DLL could be a solution but this DLL has to store previous values as well to do statistical calculation and this DLL has to present the graph as well because you can't feed & show a PL graph in this manner.

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 13:02 Titel:

--------------------------------------------------------------------------------

Hello hrd

Thank you for the discussion I really appreciate it,
The reslution of the dsPIC is a 12bit A/D converter and with good anti ailiasing filters the converted value will be +/- 1 bit
the reslution is the approx 2^n-1 = 2^12-1 for a 5volt signal or referance it will be 5/2048 = 2.4mVolt
The dsPIC AD converter is a Highspeed converter and capable of sampling rates up to 500K and being a dsp it can sample the channels all at the same time and place into the 16 level deep FIFO register.

Mike thank you for your responce
writing DLL s I have now knowledge about it I can only work with data over SPI ,Uart and such pheripherals,
_________________
P.Erasmus
Automotive Engineering
http://www.wenko.ch
Switzerland

-------------------------------------------------------------------------------------

hrd



Anmeldungsdatum: 18.10.2006
Beiträge: 123

Verfasst am: 17.10.2007 13:27 Titel:

--------------------------------------------------------------------------------

I was in the same situation a year ago. I was going to measure railway tracks. Because the sensing was not very fast (ultrasonic for cograil) I could base on Labjack U3 which could be directly by PL with 100 Hz. Maybe if we find faster sensors we will go in your direction.

On the other hand I have to present these data in a graphical manner later on. For that we are reading the data from the file written by PL and prepare/present them by using VBA in Excel.

Nach oben


p.erasmus



Anmeldungsdatum: 15.01.2007
Beiträge: 85

Verfasst am: 17.10.2007 14:10 Titel:

--------------------------------------------------------------------------------

Hello hrd
one other solution possibly is that you can write the data to file and then
read it into matlab for presentation and graphical use ,however this is only possible if you can or the application can tolerate diplay of data on a later stage but with me at the moment is that i need to control a plant on the outcome of the processed data the data dtermines the action taken by the plant,
Yes it is possible to do the FFT extraction n the Microconttroller however
I always prefer that the PC application do the large calculation part of an application for the reason that Microcontrollers are not computational machines and always needs more cycles and time to calculate than a PC system .
but if I do not have another choice I then have to do it in the Microcontroller, obviously this is not the only task for the controller it needs to control other systems and tasks also in the application ,

We always used Labview which has all these FFT and mathematical,statistical functions included but it became so expensive
that we are currently looking for cost saving solutions ,I think that PL is a very nice piece of software but there are limitations and I would like to see PL version which adress these sortcomeings and I understand that it will cost more which will also not be a problem ,if it has more functions and blocks for real time data aqusition and controll ,

Best Regards
Peter
ABACOM support

Antworten

Zurück zu „Messtechnik“