圖一 PythonOCC的繪圖介面
mechanical engineering stuff, automation stuff, measurement stuff, and many other things. Just like a warehouse.
2018年3月19日 星期一
PythonOCC 使用心得
pythonOCC是個非常好用的工具,它就是把OpenCasCade包成python的library,基本上商用CAD/CAM軟體做得到的事情,它都能做到,加上它把QT也一起整合起來,因此使用和開發上是個很方便的工具,尤其是特殊客製化的功能上.
雷射追蹤儀(LASER TRACKER)簡介之二
由於雷射追蹤儀是移動式座標量測儀器,因此該儀器非常容易受到外在環境影響,所以在使用前都需做場檢查(Field Check).場檢查是為了確保環境的變因在量測可接受範圍內,通常要做的項目有: 溫度監測 場地穩定度檢查 雷射追蹤儀角度檢查 ADM/IFM檢查,一套完整的檢查搞下來大約1~2小時,是個耗時費工的檢查儀器.
2017年12月22日 星期五
Laser Tracker (ver. English)
Introduction
Laser Tracker is a kind of PCMM (Portable Coordinate Measuring Machine), for large size object measurement survey.
The applicable object could be like:
Airplane
or :
Submarine

or:
Windmill blades

So it is not hard to image how far this instrument can measure. Generally speaking, the maximum measuring distance of laser tracker is 50-80m.
The accuracy level of laser tracker is about 0.025mm at 5 meter long, 0.075-0.090mm at 80m. Take daily life object to make comparison, 0.075-0.090mm is about the diameter of a hair.
The appearance of this kind of instrument is as following shown:
Laser Tracker is a kind of PCMM (Portable Coordinate Measuring Machine), for large size object measurement survey.
The applicable object could be like:
Airplane
or :
Submarine

or:
Windmill blades

So it is not hard to image how far this instrument can measure. Generally speaking, the maximum measuring distance of laser tracker is 50-80m.
The accuracy level of laser tracker is about 0.025mm at 5 meter long, 0.075-0.090mm at 80m. Take daily life object to make comparison, 0.075-0.090mm is about the diameter of a hair.
The appearance of this kind of instrument is as following shown:
Faro Laser Tracker
Leica Laser Tracker
API Laser Tracker
The principle of this instrument is to put one retroreflector on the object to be measured.

Tracker will emit laser beam to the retroreflector, then the retorreflector will reflect the laser beam of laser tracker, tracker will calculate the distance by time deviation between sent and received beam(ADM mode: Absolute Distance Meter) and/or by wave path difference/interference between sent and received beam (IFM mode: InterFerence Meter ).
Then cooperate with azimuth and elevation encoder of tracker, the spherical coordinate of retroreflector will be defined. the spherical coordinate will be transferred to Cartesian coordinate system.
That is the principle of laser tracker.
Connect Mitsubishi Q series PLC with Ethernet by using C#
PLC setting
1. Open GX work 2 to set the protocol type and port of PLC.2. Write the setting to PLC
PC setting
1.Open VS IDE2.Select C#
3.refer Socket library
using System.Net.Sockets;
4.there are two types of protocol of PLC, TCP and UDP. Here we introduce both
5. TCP connection
5.1 Create TCP object
Socket mysocket = new Socket(SocketType.Stream, ProtocolType.Tcp);
byte[] address = { 192, 168, 3, 39 }
IPAddress addr = new IPAddress(address);
the first parameter is IPAddress object, the rear one is port number of PLC, it can be set in GX work2.
5.4 Checking
create a bool object to check the connection is successful or not.
6. UDP connection
mysocket.Connect(addr, 1001);
create a bool object to check the connection is successful or not.
bool result = mysocket.Connected;
6.1 Create UDP object
6.2 Create IP object
6.3 Connect to PLC
6.4 Checking
Socket mysocket = new Socket(SocketType.Dgram, ProtocolType.Udp);
See section 5.2
the first parameter is IPAddress object, the rear one is port number of PLC, it can be set in GX work2.
mysocket.Connect(addr, 1025);
create a bool object to check the connection is successful or not.
bool result = mysocket.Connected;
2017年3月26日 星期日
雷射追蹤儀簡介( Laser Tracker)
雷射追蹤儀通常會用來量測一般CMM量測不了的大型物件,像是列車車廂、船體、離岸風電...等等。重工業越發達的國家越容易使用到該儀器,因此該儀器在台灣並不常見。
其精度表現視廠牌不同而定,一般來說,在5公尺左右約為25um,在80公尺處約為80um,除了上述應用外,雷射追蹤儀也可用於校驗機械手臂的定位精度。
雷射追蹤儀量測的原理是利用一個反射鏡和雷射頭,當雷射頭射出雷射光,經過反射鏡平行反射雷射光,再返回雷射頭,追蹤儀便從射出和接收的時間差計算距離(ADM模式),或是用雷射光波的干涉計算距離(IFM模式)。
由於量測的物體皆為大型工件,因此溫度的變化對尺寸會有顯著影響,因此量測出來的數據會有所縮放(scaling),或是將量測的數據做最佳轉換(best-fit transformation),以便和標準溫度時的尺寸做對照,至於縮放和最佳轉換的工差,會根據不同產業的規範有所不同,這方面就不多贅述。
簡介大致是這樣。
其精度表現視廠牌不同而定,一般來說,在5公尺左右約為25um,在80公尺處約為80um,除了上述應用外,雷射追蹤儀也可用於校驗機械手臂的定位精度。
雷射追蹤儀量測的原理是利用一個反射鏡和雷射頭,當雷射頭射出雷射光,經過反射鏡平行反射雷射光,再返回雷射頭,追蹤儀便從射出和接收的時間差計算距離(ADM模式),或是用雷射光波的干涉計算距離(IFM模式)。
由於量測的物體皆為大型工件,因此溫度的變化對尺寸會有顯著影響,因此量測出來的數據會有所縮放(scaling),或是將量測的數據做最佳轉換(best-fit transformation),以便和標準溫度時的尺寸做對照,至於縮放和最佳轉換的工差,會根據不同產業的規範有所不同,這方面就不多贅述。
簡介大致是這樣。
2017年2月4日 星期六
web scraping by selenium pyhon3
For new starter as me.
Assume everyone knows how to install selenium and how to write code with python 3 and the principle of HTML. Selenium is an automated browser package, and also a chemical element(introduced below)
Selenium is a chemical element with symbol Se and atomic number 34. It is a nonmetal with properties that are intermediate between the elements above and below in the periodic table, sulfur and tellurium. It rarely occurs in its elemental state or as pure ore compounds in the Earth's crust. Selenium (Greek σελήνη selene meaning "Moon") was discovered in 1817 by Jöns Jacob Berzelius, who noted the similarity of the new element to the previously discovered tellurium (named for the Earth).(refer from wiki)
And there is a website to introduce how to write selenium with python:
http://selenium-python.readthedocs.io/
1.Before start programming, those pre-setting procedures shall be down.
1.1.install selenium:
it can be done by pip or easy_install
1.2.download web driver
it depends on what browsers you use, in my case, I use chrome, so google chrome driver is what I need.
1.2.1 download web driver
you can select the corresponding type(for windows,mac or linux...etc) driver from this site:
https://sites.google.com/a/chromium.org/chromedriver/downloads
1.2.2 unzip the downloaded file to the selected folder, which you can freely set.
2.The web scraping procedures are descript below:
2.0 import lib
..webdriver is web driver
..support.ui import Select is for drop down selection or other item selectons
..Keys is for mouse/ keyboard action, like click ,right click ,string input...etc.
2.1 Set webdriver
it is needed to inform selenium where is the web driver. Path is needed.
Then input the right type browser command.
2.2.Get URL
the driver will connect to the website
2.3 Change text
To key in the date I want:
First find the element of date item, so I check the source of the website:
The name of element is "datestart" , so let driver find element by its name,
And then clear the value of the element and refill with the value I want.
Then click the element.
Before
After
2.4 Select the item of Contract:
Select the selection attribute item from website
and print all the options in selection
Then select the first item of all options.
2017年2月1日 星期三
how to call pip on windows
For new starter as me.
pip is PyPA recommended tool for installing Python packages. so if you want install some packages, you can use this.
1. initialize command line:
2. key in "cd" command and key in the needed directory/file location. In my case , I need to initialize pip, so I redirect to pip folder.
pip is PyPA recommended tool for installing Python packages. so if you want install some packages, you can use this.
1. initialize command line:
2. key in "cd" command and key in the needed directory/file location. In my case , I need to initialize pip, so I redirect to pip folder.
3. key in or paste the folder location
4. press Enter, then the system will redirect to the folder
5. you can call any file in this folder, in my case, I just call "pip"
6. press Enter, then the pip will run. the result as figure shown below.
7. Because I need to install beautifulsuop4 to do some web crawling application, so I key in "pip install beautifulsoup4"
8. press Enter, then the install process will run as figure shown below:
9. According to the figure , the process is successful.
Appendix:
Beautiful soup website:
https://www.crummy.com/software/BeautifulSoup/bs4/doc/
訂閱:
文章 (Atom)
同軸度 Coaxiality
同軸度和同心度是兩個非常容易搞混的幾何公差. 同軸度的符號如下: 跟正位度的符號是一樣的! 有這種設定,主要是它的定義和正位度的使用方法很像,反而跟同心度沒這麼相似. 首先來個範例: 由於這個不是繪圖軟體做的,只是示意用,不合工程圖規範的部分還請包涵. 這個是...
-
正位度(TRUE POSITION) 正位度在幾何公差上的定義(作者自己的定義)是標明一個特徵(通常是圓柱狀物體或圓柱狀孔位)的位置之容許公差帶,和一般的公差表示法有所不同,一般常見的尺寸公差(圖一) 圖一 其可變動範圍長寬各為+-0.2,所以他的公差帶會是一個矩...
-
同軸度和同心度是兩個非常容易搞混的幾何公差. 同軸度的符號如下: 跟正位度的符號是一樣的! 有這種設定,主要是它的定義和正位度的使用方法很像,反而跟同心度沒這麼相似. 首先來個範例: 由於這個不是繪圖軟體做的,只是示意用,不合工程圖規範的部分還請包涵. 這個是...
-
同心度和正位度都是幾何公差的一種,同心度的定義(作者自己的定義),以參考圓的中心點為基準點,所量測圓的中心點必須落在基準點為圓心的特定直徑的範圍內。 用圖來解釋比較快: 同心度的符號如下, 由於同心度也得需要基準作為比對,因此在符號後面會註記所對應的基準特徵. 下圖是...


















