2012年10月23日 星期二

Dipole/Monopole 雙極單極天線的一些特性

天線要能有效率的 radiate, 最好有 common mode signal oscillation, 因為對應的 ground 在無限遠處。  Differential signal oscillation to the first order 會互相抵消,效率會比 common mode signal oscillation 差。  因為 charge 永遠是電中性,只有 differential charge oscillation (如dipole oscillation), 不會有 common mode charge oscillation.   Current 則可以有 differential current oscillation (如 small loop) 以及 common mode current oscillation.   

Very short dipole antenna 只有 differential charge/voltage oscillation,和 small loop antenna 只有 differential current oscillation 恰好是對偶性 (duality),兩者的效率都很差。如 Table 1.

image

Table 1: Short dipole antenna and small loop antenna. (Dl = l/4 for half wavelength antenna)

Dipole antenna 利用 dipole 長度增加而產生 common mode current radiation, 如下圖 2.  Dipole antenna 最大效率的 common mode radiation 是在長度為 l/2。

長度再更長反而 current 會互相抵消,效率並不會增加。但 radiation pattern 會更集中在一些角度,又稱之為"開花" ,實務上並不常使用。理想的 dipole antenna 是 l/2, 即半波長雙極天線,遠場如下,比 short dipole antenna 公式算出略高,主要是 current distribution 為 sine instead of triangular。或者更常見的,用 l/4 的 monopole 加上 ground plane mirror. 

fields from a half-wave dipole antenna

Table 2: Half wavelength dipole antenna.

幾個需要注意的點:

1. monopole 必需是垂直於 ground plane, 而非水平。水平反而會讓 common mode current 變為 differential current, 而抵消 radiation, 變成 small loop antenna.  這也是 RFID 或 Etag 必需要遠離大片金屬的原因,因為 RFID 或 Etag 都是水平貼於表面。

2. 電路產生的 EMI 多半為 common mode noise, 很容易 couple 到 dipole antenna.  最好的解決方法是在 noise source 上做 common mode choke 或 shielding. 

3. Dipole antenna 的 differential feed is easy to understand, but how coax feed? or single-ended signal feed?

 

 

chart!

 

 

如何縮短天線大小

Dipole/monopole 雖然簡單有效,實務上常常遇到的問題是如何縮小天線的尺寸,可以 fit 到機構內。特別對於 sub 1GHz 的 mobile 或 portable 應用 (UHF, GSM-900MHz, ISM-900MHz, LTE-700MHz), 如果有一或兩根突出的天線,不但不美觀,也不安全。如果能 embed 到機構中,更符合美觀和 MIMO 的應用。常用縮短天線的方法:

1. Use monopole instead of dipole: 50% length reduction, refere the previous article for the trade-off between dipole and monopole antenna.

2. Use Meander line structure:   The meander-line antenna (MLA) can be in a l/2 dipole or l/4 ground plane format.  The idea is to fold the conductors back and forth to make the overall antenna shorter, which is shown in the following figure.  It is a smaller area, but the radiation resistance, efficiency and bandwidth decease.  The parameters of meander shape will affect the antenna performance parameter.  More details about MLA is in the next section.

image            image

 

Meander Line Antenna (MLA)

Meander line antenna is one type of the micro strip antenna. The meander line antenna was proposed by Rashed and Tai for reduce the resonant length. Meandering the patch increases the path over which the surface current flows and that eventually results in lowering of the resonant frequency than the straight wire antenna of same dimensions.

The electrical small antenna defines as the largest dimension of the antenna is no more than one-tenth of a wavelength [5]. Meander antenna is electrically small antenna .The design of meander line antenna is a set of horizontal and vertical lines. Combination of horizontal and vertical lines forms turns. Number of turns increases efficiency increases. In case of meander line if meander spacing is increase resonant frequency decreases. At the same meander separation increase resonant frequency decreases [6]. A meander antenna is an extension of the basic folded antenna and frequencies much lower than resonances of a single element antenna of equal length.
Radiation efficiency of meander line antenna is good as compare to conventional half and quarter wavelength antennas. Antenna size reduction factor β depends primarily on the number of meander elements per wavelength and spacing of element widths of the rectangular loops [7].

image

 

 

 

Meander line structure to shorten the size; but trade with efficiency

Live antenna vs. dead antenna

 

Injection power = Ohmic loss + non-radiation mode + radiating mode

where is the power of non-radiating mode?  loss again?

why long wavelength has better power in Friss formula

 

How to deal with Antenna?  Any simplified Maxwell equation?

Meander line antenna (MLA) equivalent circuit.

2012年8月17日 星期五

如何增進工程師效率–Revision Control With Git

Revision control (RC, 版本控制) 有沒有用或是否重要,要吃過苦頭才知道。當你修改一些設計犯了錯想要回頭,或是要做一些 optimization 的實驗。如果有好的 revision control, 就像有一幅地圖,可以清楚而且有效率的 navigate 如何前進或後退。

有時和工程師談到 revision control, 得到的反應是用不到或是真的需要學一個新的 tool 嗎?  其實他們有一套私有的 revision control, 例如 copy 到不同的 file 或 directory,  用日期或 v1, v2..  來做版本控制。私有的問題是 (i) 簡單但容易有人為的錯誤;(ii) 很難和別人 share 和溝通。多半是單幹戶的方法。

雖然已經有許多的 revision control tool, 我發現 git 是最適合我 (as a designer) 時 revision control.  原因是:linux built-in revision control tool (事實上 linux 本身也是用 git 做 revision control);  可以簡單到單幹戶都可以自己取代私有的 revision control ; 但也非常適合一個 team project 的 revision control.

 

Git 三招走江湖

image

Git 的操作參考上圖。比起其他的 RC tool, 除了一樣的 working directory 和 repository 外,多了一個 staging area.

第一招:Create First Revision

Only 3 command

  • git init
  • git add .
  • git commit –m “init version”

Before start, first setup

  • .gitconfig in your root directory
  • .gitignore in your project directory

 

第二招:Check-in New/Modified Files/Directories

Add new files

  • git add <file/.>    -->  from working area to staging area
  • git commit –m “check-in message”   -->  from staging to repository

Modified files

Method 1: same as above

Method 2:

  • git commit –am “check-in message”  --> from working area to staging area and repository

git ci -am 不包括 new files

git add or git commit –m  only apply to 本目錄及其下所有子目錄

Always use “git status” to check

 

第三招:Checkout Repository

回復原狀 (repository to staging area and working area)

  • git checkout -- .

Staged, but not commit

  • git reset <file>   -->  staging area to working area

要撤消 Commit, 但維持 working directory

  • git reset --soft HEAD~1  -->repository to staging area

 

    2012年8月2日 星期四

    Group Theory–我的經驗

    前前後後花了後次時間自習 group theory,  每次都像是新的開始,之前學的統統忘了。前一兩次是 algebra approach, 從 definition (group/ring/field), more definitions (abelian, subgroup, normal subgroup, coset, conjugate, homophism, autohomophism, direct product, …), and theory (Lagrange, Sylow, Galois, …).  學的迷迷糊糊,因為從來用不到,最後統統忘掉。

    再來是從 permutation 著手,搭配 Rubik cube, puzzle-15, etc. game 方面的應用,依然不得要領。

    比較起來, linear algebra 雖然也很抽象, 但因為比較常用 (eigenvalue, eigenfucntion),倒不致於完全忘光。

    最近從 geometry symmetry 著手,開始比較有一些感覺。如 cyclic group, dihedral group, symmetry group.  不過也止於一些 geometry 的對稱群,沒有更深的領悟。無法和之前 algebra approach 的一堆 definition 和 theory link 在一起。

    這次看了 Carter 的 visual group theory 的 video, 非常有感覺。Carter 用 Cayley diagram visualize symmetry,同時用 Cayley diagram 來解釋 group product, normal subgroup, quotient group.  One picture more than a thousand words!    http://web.bentley.edu/empl/c/ncarter/vgt/index.html   另外YouTube 和 Google book 都有相關的資料。

     

    Cayley Graph

    Group theory visualization 的根本是 Cayley graph (or Cayley diagram).  Cayley diagram 包含兩個部份:node 表示 group element.  Arrow 表示 group generator 的作用。

    數學上的定義請參考:http://en.wikipedia.org/wiki/Cayley_graph

    我們的重點是如何用 Cayley graph  直覺式的看穿 group 的結構和理解 group theory 中的 definition 和 theory。

    以下的一個例子是一個簡單的化學分子,有三個 branch。它的對應 Cayley graph 如右。Generator 是一個 120 度順時針旋轉,每一次的操作都保持原來的形狀。在 group theory 中這是一個 cyclic group with order 3, or C3 group。

    image     image                         

     

    常見的對稱 Group 以及 Cayley Graph

    Cyclic Group, Cn : 看圖就可以理解這是旋轉對稱所對應的 group 和 Cayley graph.

     

    imageimage

     

    Dihedral Group, Dn : 下圖是正三角型所有的對稱操作,也稱為 D3 group。 Dn group (正 n 邊型/regular polygon) 包含了旋轉對稱+鏡像對稱,比起單純的 cyclic group 多了鏡像對稱。因此 Dn group Cayley graph 中的 node 多了一倍。Dn group 有兩種 generators, 對應旋轉對稱和鏡像對稱。兩種 geneator 的 arrows, 分別用 greenblue arrows 來表示。鏡像對稱是正->負-> 正->負.. 因此 arrow 是雙向的,圖中就省略了雙向箭頭。

    image

    Dn group 的 Caley graph 如下。光看 Cayley graph 就知道 Dn group 是 non-abelian group, why?

    image

     

    Abelian Group :  Abelian group 的特點是所有的 group element 符合 commutating rule, ab = ba.  Non-abelian group 在 quantum physics 扮演了關鍵的角色,例如 Yang-Mills theory.  

    從 Cayley graph 可以容易的判斷是否為 Abelian group.  我們可以証明 group element commutes 等同於 group generator commute.  如果只有一個 generator, 如 cyclic group, 一定是 Abelian group.  兩個 generator 以上,可以用下圖來判別。如果所有不同顏色的 arrow 交換都指到同一個 node, 是 Abelian group.  只要有任何 arrow 交換指到不同的 node, 則是 non-abelian group.   所以上述的 dihedral group 是 non-abelian group. 

    image 

     

    除了 cyclic group 以外,下列各圖都是 Abelian group

    image image  image image 

    相反的,以下都是 non-abelian group.

            

    由圖就可以看出來,Abelian group 都是 grid 的結構。所有的 arrows 都是垂直或水平 (除了端點的 arrow 要繞回另一端外)。Non-abelian group 的 arrow 則非直角或相互交錯。.

     

    Symmetric Group and Alternating Group,  Sn or  An 

    Dihedral group 表徵兩維平面的正多邊型的對稱。對於三維空間的正多面體 ( 如正三角錐,cube, etc.  i.e. regular polyhedron),顯然有更多的對稱操作。它們對應的對稱 group 為 symmetric group 和 alternating group.

    image

    Symmetric group, Sn : 包含 n! permutation (S3:6, S4:24, S5:120, …).  S3 = D3

    Alternating group, An : 包含 n!/2 even permulation (A4:12, A5:60, …)

    Tetrahedron: 有兩種對稱操作? (都是面旋轉120度?)。12 個 node, 是 A4 group

    image

    Cube: 有旋轉對稱和鏡像對稱。24 (8x3) node, 是 S4 group

    image

    Octahedron : 有旋轉對稱和鏡像對稱。24 (4x6) node, 是 S4 group

    image

    Dodecahedron : 60 node, 是 A5 group

    image

     

    Icosahedron :  60 node, 是 A5 group

    image

     

    除了上述五種正多面體以外,不存在更多的正多面體,這是古希臘人就已經知道的事。意即不存在 S5 (含) 以上正多面體的對稱群。這和 5 次方程式(含)以上無根式解有密切的關係,Galois 就是有此洞見而創建了 group theory。S5 (含) 以上的 symmetric group 也稱為 non-solvable symmetry group. 

    2012年5月25日 星期五

    How to Use CPAN to Install Perl Module and Script

    CPAN stands for “Comprehensive Perl Archive Network”.   It provides many useful perl modules.

    Method 1: manually install

    (i) Download the tarball from CPAN

    (ii) tar zxvf tarball

    (iii) cd decompressed directory, then ‘perl Makefile.PL’.  It there is dependency error, go to step (i)

    (iv) ‘make’, then ‘make test’, then ‘make install’.

    Pro: Method 1 works both for install module (WWW::Extractor) and script (e.g. xls2csv)

    Con: Method 1 is time consumping to deal with dependency error!!

     

     

    Method 2: auto install Module

    (i) type “cpan”,  set urllist by “o conf init urllist –> http://cpan.develooper.com/

    (ii) install CPAN to install the updated cpan.   then “reload cpan”

    (ii) perl –MCPAN –e ‘install module’   e.g. perl –MCPAN –e ‘install WWW::Extractor’

    Pro: Method 2 solve the dependency issues by cpan automatically!!

    Con: Method 2 only works with module,  NOT work with script, e.g. “xls2csv”!

    Need to do perl –MCPAN –e ‘install K/KE/KEN/xls2csv-1.06.tar.gz’

    Excel to CSV

    CSV’s advantages are: (i) popular ascii format for data computing, processing, and plotting; (ii) built-in or plug-in support support from Gnuplot, Perl, Ruby, Python, and Matlab. 

    CSV’s disadvantage is poor readable format, and not good for interactive processing.  On the contrary, Excel file format (xls) makes up this disadvantage. 

    To take advantage of both CSV and Excel, we can use Excel (xls) as the user interface; and back-end processing uses CSV.  Therefore, we need a tool to convert xls to csv and vice versa.

    CPAN provides both csv2xls and xls2csv. 

    Go to CPAN and download xls2csv-xx.tar.gz

    uncompressed it, and cd to the directory.

    Do ‘perl Makefile.PL’,  then ‘make’, then ‘make test’, then ‘make install’

    How to solve the dependency problem?  See next article for details.

    What’s the advantage of CPAN xls2csv?  compared with other xls2csv (e.g. catdoc)? 

    A. Better support for unicode (Chinese);  B. Better support for multiple worksheet

    2012年1月18日 星期三

    如何增進工程師效率–comma separated values (CSV)

    CSV is a very convenient file format for data computing, processing, plotting, etc.

    It can be imported or exported to/from excel. 

    Ruby has a strong built-in support for CSV. 

    Prior to Ruby 1.8.6, the built-in csv library in Ruby is csv, not very good nor efficient.

    Fastcsv replace old csv after Ruby 1.8.7.  I recommend to use fastercsv with Ruby for csv processing.

    For 1.8.6 to run fastercsv.  Either use rubygem to install: do “sudo gem install fastercsv”.

    It does not work for me.   I download the gem from Rubyforge, then do sudo gem install fastercsv.

    When use fastercsv, do “require ‘rubygems’,  then require ‘fastercsv’.

    fastercsv has three different classes (format): csv, table, row

    2012年1月1日 星期日

    Emacs Mode for Engineering

    Emacs and Vi are probably the most popular general purpose editor for Unix, Linux, etc.

    Richard Stallman visited Stanford AI lab and was inspired by the “E” editor.  He returned MIT and refined the original TECO editor.  The E-"MACS”  represents  Editing MACroS.  Vi was written by Bill Joy in 1976.  It stands for VIsual mode of a line editor and was released as part of first BSD Unix in 1978.  

    本文 focus 在 emacs 的 mode 設定。主要包含下列應用:

    Programming and scripting language

    C/C++/Java : .c/.cpp/.java – supported by default

    Perl, Ruby, Python, Tcl:  .pl/.rb/.py/.tcl  – except for Ruby, others are supported by default

    Matlab: .m

    Linux Tool and shell script (linux only)

    Makefile – supported by default

    tcsh/csh/bash : .cshrc/.tcshrc/.bashrc – supported by default

    CAD

    Verilog: .v

    Skill (Cadence Lisp): .il/.ocn/.cdf

    Spice and spectre netlist: .cdl/.sp/.cir/.ckt

     

    Linux Emacs Setting

    1. In Linux, default emacs mode setting is put in /usr/share/emacs/site-lisp/ directory.  For example, python-mode.elc is stored in it.   -> Need a supersuer account to do this! Easier to use step 2.

    2. User local mode setting is in ~/.emacs.d/ directory.  Therefore, I download matlab.el from MathWork; ruby mode, verilog-mode.el, skillMode.el, and spice-mode.el.  -> Put mode files here!!!

    3. ~/.emacs specifies mode files to be loaded.  It needs to be modified to support these modes.   The key commands in .emacs are:

    (autoload 'matlab-mode "matlab" "Enter Matlab mode." t)
    (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist))

    autoload requests to load the “matlab.el” file from load-path.   auto-mode-alist applies matlab-mode setting to files endding with “.m”.

    Windows Emacs Setting

    1. General emacs setting: windows does not support emacs by default.  I need to download the emacs package from internet.  I installed emacs in c:\emacs\emacs-23.1\.

    2. The default emacs mode setting is put in c:\emacs\emacs-23.1\site-lisp\.  -> Put mode files here!!!

    3. The user local mode setting is in $HOME\.emacs.d\ directory.  I set environment (user) variable HOME as c:\emacs\.  The setting is in computer->advanced setting->environment variable->USER->HOME.  -> Don’t put mode files in this directory since it cannot find in the load-path.  Maybe need to specify the full path of load-path.

    4. The initial file (similar to .emacs, cannot start with . in Windows) is put in $HOME\.emacs.d\init.el in Emacs 22 or later. 

    2. Desktop UI setting: to make sure mouse right key can bring up emacs

     

    Where to get mode file

    Python-mode.el:   https://launchpad.net/python-mode

    Ruby-mode.el: svn co http://svn.ruby-lang.org/repos/ruby/trunk/misc ruby-mode

    Matlab.el: http://sourceforge.net/projects/matlab-emacs/

    Verilog-mode.el: http://www.veripool.org/wiki/verilog-mode

    SkillMode.el: TBA

    Spice-mode.el:  http://spice-mode.4t.com/

    追蹤者