Code Monkey home page Code Monkey logo

hyp2mat's Introduction

hyp2mat

hyp2mat is a utility which converts HyperLynx and QucsStudio pcb files to matlab for electromagnetic simulation, or to PDF for printing.

hyp2mat is distributed with openEMS, a free open-source electromagnetic field solver.

Installation

hyp2mat can be installed from pre-compiled binaries, or compiled from source:

  • Windows binaries
  • To install from source see the file INSTALL for compilation instructions

Tutorial

How to simulate a printed circuit board in openEMS using HyperLynx files

See also

hyp2mat is command-line only. For graphical, menu-driven Hyperlynx import see

  • pcb-rnd, a printed circuit board editor which reads and writes Hyperlynx files.
  • FreeCAD-PCB, for import into FreeCAD.

hyp2mat's People

Contributors

koendv avatar sibbi77 avatar thliebig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyp2mat's Issues

Error when attempting to run tutorial

Hello,

I have am trying to run the basic tutorial file from your software and I am running into an error when readui tries to read 'tmp\port_ut1'. It seems this file is never created from the code. Not sure if this is a universal issue or may be specific to my machine/setup.
I am running Matlab R2019b on Windows 10, and the specific error messages are shown below.

Best,
nn

command: "C:\Program Files\MATLAB\openEMS\hyp2mat\matlab..\hyp2mat.exe" --verbose --output-format csxcad --output pcb.m "msl.HYP"
board size:
x = 0.00 : 20.00 mm
y = 0.00 : 20.00 mm
z = 0.00 : 1.84 mm
layers:
signal 35.56 um eps_r 1.00 'Top'
dielectric 0.32 mm eps_r 4.80 'DL01'
signal 35.56 um eps_r 4.80 'Bottom'
dielectric 1.52 mm eps_r 4.80 'DL02'
Estimated simulation runtime: 6500 timesteps
invoking AppCSXCAD, exit to continue script...
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Error using load
Unable to read file 'tmp\port_ut1'. No such file or directory.

Error in ReadUI (line 64)
tmp = load( fullfile(path,filenames{n}) );

Error in calcLumpedPort (line 76)
U = ReadUI( port.U_filename, SimDir, f, UI_args{:} );

Error in calcPort (line 71)
port = calcLumpedPort( port, SimDir, f, varargin{:});

Error in calcPort (line 57)
port{n}=calcPort(port{n}, SimDir, f, varargin{:});

Error in tutorial_hyp2mat (line 109)
port = calcPort( port, Sim_Path, f, 'RefImpedance', 50);

Blind vias not handled

I tried to import a bigger PCB with hyp2mat into MATLAB.
This PCB contained blind vias on a six layer layout.
But after import, all vias are shown as vias from top to bottom.

For import I used these commands:

physical_constants;
f_max = 20e9;
pcbfile = 'Pcb.hyp';
CSX = InitCSX();
CSX = ImportHyperLynx(CSX, pcbfile);
FDTD = InitFDTD();
FDTD = SetGaussExcite(FDTD, f_max/2, f_max/2);
Sim_Path = 'tmp';
Sim_CSX = 'pcbcsx.xml';
WriteOpenEMS([Sim_Path '/' Sim_CSX], FDTD, CSX);
CSXGeomPlot([Sim_Path '/' Sim_CSX]);

I haven't found a documentation for the .hyp filetype, so I'm not sure how such blind vias are encoded in .hyp (I assume that they are supported. I assume that the "P" parameter from via line encodes this information.
(VIA X=2.421259 Y=4.192912 P=58)
(VIA X=2.577045 Y=5.495947 P=62)
(VIA X=2.588856 Y=5.464688 P=49)
Do you known more about this?

HyperLynx Stackup - Metal copper thickness added to dielectric

Hallo!

When importing a HyperLynx file with hyp2mat, the copper thicknesses of signal layers get added to the dielectric thicknesses. But when a PCB is manufactured the thickness of the dielectric is not touched by this value.
So a more natural hyp2mat import should deliver the original thickness of the dielectrics.

Example:
Use ViaExample from https://github.com/Xargas/hyp2matViaExample, import via hyp2mat and view the generated pcb.m file (or view the value in the CSX structure).
For the first dielectric it generates a box:

CSX = AddBox(CSX, 'Dielectric_DE_GND2', 100, [ 0.04102, 0.09106, 0], [ 0.07709, 0.11163, 0.00028956]  );

where the height 0.00028956m is not the 0.254mm specified in the HyperLynx file, but 0.00028956m = 0.254mm+0.03556mm (dielectric plus copper).
Is this addition done because of a special reason?

Further, the copper layers only get imported as zero-thickness polygons. I did not find a commandline argument for this, but maybe it's inofficial.
Is it possible to import the copper with the thickness of the stackup?

So in overall with these questions: I think at the current import state, the simulated PCB results are always going to be to some degree different to the manufactured PCB.
How do you see this?

BR,
Markus

Is "hyp2mat" simulation tested on Octave?

Hi,

I have tried fullfilling all the recommendation on web to simulate "hyp2mat" tutorial.
However, I am not able to proceed with the following command

CSX = ImportHyperLynx(CSX, 'msl.HYP');
error: 'ImportHyperLynx' undefined near line 1 column 7

I am using Octave 4.2.1 with openEMS 64 bit Windows. pls help

Thanks

Eagle Hyp2mat Polygons not filled

Hello Koen,

thanks for the work on hyp2mat and the extraction of layout-data from eagle.
It works well for me (hyperlynx6.3 from cadsoft) on the hairpin-filter example. Using the complete file set as well as strting with the brd and sch data from eagle and producing the hyp-file myself.

However, it does not work with an only design (microstrip lambda/2-edge-couple filter, much like hairpin).
Issues are:

  • Error meaasage "Polygons not filled, run ratsnest". This meassage does not go away, no matter how often you click "OK". Eagle needs to be stopped via task-mananger.
  • However, Polygons are filled (ratsnest is run). Testpoints are exactly the same as yours in hairpin.

Any suggestions? I can via mail provide the brd and sch eagle files (mail: info (at) ibdrigo.com).

EDIT: Main problem is solved, this was due to my Eagle-Board-layout. The infinite loop "Polygon not filled" is not solved.

Thanks

gerald

scan.ll:26:19: fatal error: parse.h: No such file or directory

hyp2mat fails to compile on Kubuntu 14.04 (64bit) with:

scan.ll:26:19: fatal error: parse.h: No such file or directory

My guess is that it is due to GNU Bison 3.0.2 generating a parse.hh instead of parse.h file.

I managed to compile successfully after applying this patch:

diff --git a/lib/Makefile.am b/lib/Makefile.am
index a5fe575..a52dc12 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -54,12 +54,12 @@ libhyp2mat_la_SOURCES=\
   pdf.h \
   scan.ll

-EXTRA_DIST=clipper.txt parse.h
+EXTRA_DIST=clipper.txt parse.hh

-BUILT_SOURCES=parse.cc parse.h scan.cc
+BUILT_SOURCES=parse.cc parse.hh scan.cc

-parse.h: parse.cc
+parse.hh: parse.cc

-CLEANFILES=parse.cc parse.h scan.cc
+CLEANFILES=parse.cc parse.hh scan.cc

 #not truncated
diff --git a/lib/scan.ll b/lib/scan.ll
index 3e07902..9bcf821 100644
--- a/lib/scan.ll
+++ b/lib/scan.ll
@@ -23,7 +23,7 @@

 %{
 #include <stdlib.h>
-#include "parse.h"
+#include "parse.hh"
 #include "parser.h"

 /* copy a string between quotes */

System info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:        14.04
Codename:       trusty
$ dpkg -l g++ libtool make bison flex gengetopt help2man groff ps2pdf
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                          Version                             Architecture                        Description
+++-=============================================================-===================================-===================================-================================================================================================================================
ii  bison                                                         2:3.0.2.dfsg-2                      amd64                               YACC-compatible parser generator
ii  flex                                                          2.5.35-10.1ubuntu2                  amd64                               A fast lexical analyzer generator.
ii  g++                                                           4:4.8.2-1ubuntu6                    amd64                               GNU C++ compiler
ii  gengetopt                                                     2.22.6-2                            amd64                               skeleton main.c generator
ii  groff                                                         1.22.2-5                            amd64                               GNU troff text-formatting system
ii  help2man                                                      1.44.1                              amd64                               Automatic manpage generator
ii  libtool                                                       2.4.2-1.7ubuntu1                    amd64                               Generic library support script
ii  make                                                          3.81-8.2ubuntu3                     amd64                               An utility for Directing compilation.
dpkg-query: no packages found matching ps2pdf

cf also: http://openems.de/forum/viewtopic.php?f=2&t=242

hyperlynx.ulp.patch is missing

The INSTALL file refers to a patch:

  1. If you use CADSoft Eagle, patch eagle/ulp/hyperlynx.ulp with hyperlynx.ulp.patch

This file is not included.
By the way: which Eagle version is needed for the patch?

Sebastian

Problems with hyperlynx.ulp polygon export and Octave 5.2.0

I'm trying to use EAGLE 9.5.0, hyperlynx-NEW.ulp, Octave 5.2.0, and OpenEMS to layout and simulate PCB antennas. But I'm having trouble even running the hyp2mat tutorial. No version of hyperlynx.ulp that I can find will properly export the tutorial layout. Here's a list of things I've tried and the results.

Case 0: Directly use msl.HYP file provided in the hyp2mat tutorial
This works fine. A nice clean mesh is created, the FDTD timestep is 2.51662e-013 and the OpenEMS simulation completes in about 1 minute.
case0_mesh

Case 1: Create a fresh msl.HYP file from msl.brd using hyperlynx-NEW.ulp or Export -> Hyperlynx
The 0-width polygons (i.e. polygon objects with an edge width of 0) in msl.brd cause a failure in hyperlynx-NEW.ulp. The ULP takes ~5 minutes to run and the produced HYP file is enormous at 463 MB. OpenEMS fails to import this huge HYP file with the following message:

command: "c:/openEMS/hyp2mat/matlab..\hyp2mat.exe" --verbose --output-format csxcad --output pcb.m
"msl.HYP"
error: error executing "c:/openEMS/hyp2mat/matlab..\hyp2mat.exe" --verbose --output-format csxcad --
output pcb.m "msl.HYP"
error: called from
ImportHyperLynx at line 190 column 5
tutorial_hyp2mat at line 34 column 5

Case 2: Change the polygon edge width to 0.1 mm and export with hyperlynx-NEW.ulp or Export -> Hyperlynx
From openEMS.de wiki:

polygon edges are always drawn with width 0 (zero).

If I change the polygon edge with to 0.1 mm or any other value, hyperlynx-NEW.ulp runs quickly and produces a normal-size HYP file (20 kB). But the non-0 width polygons cause DetectEdges.m to create extremely fine mesh cells at the polygon edge. The tiny cells lead to a small FDTD timestep (1.33064e-014 s) and therefore the simulation never finishes.
case2_mesh

Case 3: Use 0-width polygons with an old hyperlynx.ulp version from EAGLE 5.11
I tried a very old version of hyperlynx.ulp from EAGLE 5.11. The ULP is dated 17.08.2005. This version of the ULP quickly exports the layout with 0-width polygons to a small HYP file (5 kB). But now the Hyperlynx import fails with the following message:

command: "c:/openEMS/hyp2mat/matlab..\hyp2mat.exe" --verbose --output-format csxcad --output pcb.m
"msl.HYP"
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
warning: padstack without metal:
board size:
x = 0.00 : 20.00 mm
y = 0.00 : 20.00 mm
z = 0.00 : 1.50 mm
layers:
signal 23.84 um eps_r 1.00 'Top'
dielectric 0.75 mm eps_r 4.80 'DL01'
signal 23.84 um eps_r 4.80 'Route2'
dielectric 0.75 mm eps_r 4.80 'DL02'
signal 23.84 um eps_r 1.00 'Bottom'
Valid ports:
error: port not found: C1.1
error: called from
GetHyperLynxPort at line 73 column 5
tutorial_hyp2mat at line 37 column 40

Bottom line is, nothing I've tried works. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.