advertisement

2017年4月10日

How to choose right PWM frequency

The PWM switching frequency has to be much higher than what would affect the load (the device that uses the power), which is to say that the resultant waveform perceived by the load must be as smooth as possible. The rate (or frequency) at which the power supply must switch can vary greatly depending on load and application, for example
Switching has to be done several times a minute in an electric stove; 120 Hz in a lamp dimmer; between a few kilohertz (kHz), to tens of kHz for a motor drive; and well into the tens or hundreds of kHz in audio amplifiers and computer power supplies.


For a question like this, you will probably get as many answers as there are people interested in answering. Here is my answer: It depends.
Here are some of the limiting factors, first the lower limits:
  • Persistence of vision:
    • Different people are differently sensitive to flicker in a light source. Some would notice flicker even at 100 Hertz, others perhaps not even at as low as 10 Hz.
    • Motion of light source relative to the eye makes flicker more discernible, scaling up with speed of the motion.
    • Human vision sensitivity at low intensity of light - both ambient and source intensity. At very low intensity, the eye is much more sensitive to any change in intensity. So an LED operated at low duty cycle / low current and in a dark environment would require a higher minimum PWM frequency.
Now the upper limits:
  • LED turn-on characteristics: An LED cannot be toggled at arbitrarily high frequency, once the pulse duration approaches the turn-on time, the LED never really turns on fully, hence linearity of PWM control is lost to begin with, and at higher frequency / shorter pulses, eventually the LED just stays dim or off.
  • PWM provider capabilities: Your microcontroller would have its own maximum PWM rate, which sets a hard limit.
  • Switching losses: Any switching system, MOSFET based, BJT based, or other, suffers switching losses of power as switching rate increases. At one point this become significant both in terms of heating of switching device, and efficiency of illumination.
Thus, depending on these parameters, and any others affecting your specific requirement, the correct answer could be anywhere in the 50 Hz to few dozen KHz range.

motor frequency 可以測試不同頻率下輸出電流來決定

Ref:

2016年12月21日

Docker 安裝在 Windows 快速建置Linux Debian 環境

Host(PC)端安裝先前條件:

  1. Windows 7 64-bit OS 或 Windows 8 / Windows8.1
  2. Virtualization (虛擬化)已開啟
*如果你的作業系統是 Windows 10 請不要參照底下步驟
請參考這裡


OS作業系統請自行確認。

Virtualization 確認方式如下

Windows 8 / Windows8.1:
開啟工作管理員點選 CPU 如下圖

2016年12月11日

Compiler Wpasupplicant Source Code

# apt-get install openssl-dev libssl-dev libnl-3-dev libnl-genl-3-dev pkg-config

Then open the .config file:
vi .config
and uncomment the line:
CONFIG_LIBNL32=y
# make

https://w1.fi/wpa_supplicant/

2016年5月28日

Linux fglrx-driver 不支援 ATI AMD 顯示卡 移除方式

# aticonfig: no supported adapters detected

# cat /var/log/Xorg.0.log

$ sudo sh /usr/share/ati/fglrx-uninstall.sh
$ sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx
$ sudo apt-get remove --purge xserver-xorg-video-ati xserver-xorg-video-radeon 
$ sudo apt-get install xserver-xorg-video-ati 
$ sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core 
$ sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
# ln -s /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1  /usr/lib/libGL.so.1


$ glxinfo
name of display: :0 
Error: couldn't find RGB GLX visual or fbconfig

#reboot
# apt-get install --reinstall xorg


http://ubuntuforums.org/showthread.php?t=952666
https://packages.debian.org/jessie/libglu1-mesa
http://wiki.cchtml.com/index.php/Debian#Removing_Catalyst.2Ffglrx

2016年4月14日

Linux 安裝Qt


下載Qt網址
http://download.qt.io/official_releases/qt/

我下載的是
http://download.qt.io/official_releases/qt/5.4/5.4.1/qt-opensource-linux-x64-android-5.4.1.run

安裝需要套件
編譯需要的一些套件            build-essential(dep:gcc, g++, make等)
Debugger                          gdb
GLX development files       libgl1-mesa-dev
# apt-get install build-essential libgl1-mesa-dev gdb

進入下載目錄
# cd /home/clementyan/Downloads/

更改檔案權限,增加可執行的權限
# chmod +x qt-opensource-linux-x64-android-5.4.1.run

執行安裝程式
# ./qt-opensource-linux-x64-android-5.4.1.run

新增qtcreator連結檔,連結到/opt/Qt5.4.1/Tools/QtCreator/bin/qtcreator
# cd /usr/local/bin/
# ln -s /opt/Qt5.4.1/Tools/QtCreator/bin/qtcreator qtcreator

一般使用者執行qt IDE
$ qtcreator

檢查compiler和gdb是否有抓到


特殊符號 英文對照表

Ref: http://www.lookuptables.com/

https://www.freeformatter.com/html-entities.html

CharacterEntity NameEntity NumberDescription
  Space
!!Exclamation mark
""Quotation mark
##Number sign
$$Dollar sign
%%Percent sign
&&&Ampersand
''Apostrophe
((Opening/Left Parenthesis
))Closing/Right Parenthesis
**Asterisk
++Plus sign
,,Comma
--Hyphen
..Period
//Slash
00Digit 0
11Digit 1
22Digit 2
33Digit 3
44Digit 4
55Digit 5
66Digit 6
77Digit 7
88Digit 8
99Digit 9
::Colon
;&#59;Semicolon
<&lt;&#60;Less-than
=&#61;Equals sign
>&gt;&#62;Greater than
?&#63;Question mark
@&#64;At sign
A&#65;Uppercase A
B&#66;Uppercase B
C&#67;Uppercase C
D&#68;Uppercase D
E&#69;Uppercase E
F&#70;Uppercase F
G&#71;Uppercase G
H&#72;Uppercase H
I&#73;Uppercase I
J&#74;Uppercase J
K&#75;Uppercase K
L&#76;Uppercase L
M&#77;Uppercase M
N&#78;Uppercase N
O&#79;Uppercase O
P&#80;Uppercase P
Q&#81;Uppercase Q
R&#82;Uppercase R
S&#83;Uppercase S
T&#84;Uppercase T
U&#85;Uppercase U
V&#86;Uppercase V
W&#87;Uppercase W
X&#88;Uppercase X
Y&#89;Uppercase Y
Z&#90;Uppercase Z
[&#91;Opening/Left square bracket
\&#92;Backslash
]&#93;Closing/Right square bracket
^&#94;Caret
_&#95;Underscore
`&#96;Grave accent
a&#97;Lowercase a
b&#98;Lowercase b
c&#99;Lowercase c
d&#100;Lowercase d
e&#101;Lowercase e
f&#102;Lowercase f
g&#103;Lowercase g
h&#104;Lowercase h
i&#105;Lowercase i
j&#106;Lowercase j
k&#107;Lowercase k
l&#108;Lowercase l
m&#109;Lowercase m
n&#110;Lowercase n
o&#111;Lowercase o
p&#112;Lowercase p
q&#113;Lowercase q
r&#114;Lowercase r
s&#115;Lowercase s
t&#116;Lowercase t
u&#117;Lowercase u
v&#118;Lowercase v
w&#119;Lowercase w
x&#120;Lowercase x
y&#121;Lowercase y
z&#122;Lowercase z
{&#123;Opening/Left curly brace
|&#124;Vertical bar
}&#125;Closing/Right curly brace
~&#126;Tilde