During the period 1904 to1947, the vacuum tube was the electronic device of interest and development. In 1904, the vacuum-tube diode was introduced by J. A. Fleming. Shortly thereafter, in 1906, Lee De Forest added a third element, called the control grid, to the vacuum diode, resulting in the first amplifier, the triode. In the following years, radio and television provided great stimulation to the tube industry. Production rose from about 1 million tubes in 1922 to about 100 million in 1937. In the early 1930s the four- element tetrode and the five-element pentode gained prominence in the electron-tube industry. In the years to follow, the industry became one of primary importance, and rapid advances were made in design, manufacturing techniques, high-power and high-frequency applications, and miniaturization.

三极管的发明,和工业界的需求有密切联系。radio and television provided great stimulation to the tube industry. 看现在的AI需求,对于新计算机体系结构也会有新的需求,比如memory system的演进,可能会有比较革命性的变革,比如pim。

On December 23, 1947, however, the electronics industry was to experience the advent of a completely new direction of interest and development. It was on the afternoon of this day that Dr. S. William Shockley, Walter H. Brattain, and John Bardeen demonstrated the amplifying action of the first transistor at the Bell Telephone Laboratories. The original transistor (a point-contact transistor) is shown in Fig. 2. The advantages of this three-terminal solid-state device over the tube were immediately obvious: It was smaller and lightweight; it had no heater requirement or heater loss; it had a rugged construction; it was more efficient since less power was absorbed by the device itself; it was instantly available for use, requiring no warm-up period; and lower operating voltages were possible. Note that this chapter is our first discussion of devices with three or more terminals. You will find that all amplifiers (devices that increase the voltage, current, or power level) have at least three terminals, with one controlling the flow or potential between the other two.

The first transistor

为什么这些创新都是来自美国,Bell实验室,中国到现在为止,始终没有这样原创性的工作,抄永远是跟在别人屁股后面的。这个原型满足了一些基本特性需求:

  • smaller and lightweight
  • it had no heater requirement or heater loss
  • it had a rugged construction
  • it was more efficient since less power was absorbed by the device itself
  • it was instantly available for use, requiring no warm-up period;
  • and lower operating voltages were possible

在研发过程中,应该是有这些目标牵引进行设计探索的。所以从底层原理出发,解决工业界比较强烈的需求,可以做出一些原创性的事情。

The circuit consists of a resistor in series with the voltage source connected to the inverting input of the OpAmp. The non-inverting input of the OpAmp is short circuited to ground(common). A resistor is connected to the output and provides a negative feedback path to the inverting input terminal.

inverting opamp and Since is connected to the common or ground terminal, Node 1 is said to be a virtual ground due to the virtual short circuit between the inverting and non-inverting terminals (which is grounded) as defined by the voltage constraints, The node voltage method of analysis is applied at node 1, By appling Equation , obtained from the virtual short circuit, and the constraint on the current as defined in Equation, Equation is simplified to Solving for the voltage gain, , Notice that the voltage gain is dependent only on the ratio of the resistors external to the OpAmp, and . The amplifier increases the amplitude of the input signal by this ratio. The negative sign in the voltage gain indicates an inversion in the signal.

The output voltage is also constrained by the supply voltages and , Using Equation , the maximum resistor ratio for a given input voltage is

实验

根据下图,计算增益和。如果,输出是多少?多大的输入电压幅值,会造成amplifier饱和?

inverting opamp example

Solution:

The output voltage is independent of the load resistor, , because of the low output resistance of the OpAmp. Therefore, the gain of amplifier is Using KCL at node a, The currents and are and Solving for yields, For and input voltage signal of 由于我使用的是模块,具体参考双电源供电

要计算amplifier的linear region,输入幅值需要小于,

一些实验结果

总体效果

big picture

输入

黄色为输入,左下角一个格子为1v,而蓝色一个格子为5v。

liner op region

输入为2v左右导致输出饱和

发现输出的顶部已经不再是正弦波。和理论计算比较一致。

saturation

运算放大器需要类似的双电源供电。由于只有一个单通道的直流电压源,所以需要做一个双电源供电模块。

diff voltage

所需要的元件:

  1. 单通道电压源
  2. LM324N
  3. 47K电阻两个
  4. 1电容一个100电容两个
实现

参考文章:

https://blog.csdn.net/qq_41836400/article/details/98345011

修改include/apue.h

include/apue.h增加

1
#include <sys/sysmacros.h>

修改stdio/buf.c

打开apue.3e/stdio/buf.c,搜索_LP64,大致在(文件的89~93行),将其删除

1
2
3
4
5
#ifdef _LP64
#define _flag __pad[4]
#define _ptr __pad[1]
#define _base __pad[2]
#endif

is_unbuffered, is_linebufferedbuffer_size替换如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
int
is_unbuffered(FILE *fp)
{
return(fp->_flags & _IONBF);
}

int
is_linebuffered(FILE *fp)
{
return(fp->_flags & _IOLBF);
}

int
buffer_size(FILE *fp)
{
#ifdef _LP64
return(fp->_IO_buf_end - fp->_IO_buf_base);
#else
return(BUFSIZ); /* just a guess */
#endif
}

#else

#error unknown stdio implementation!

#endif

copy头文件和库

1
2
sudo cp ./include/apue.h /usr/include/
sudo cp ./lib/libapue.a /usr/lib/

oh-my-tmux

1
2
3
4
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .

add lines at the end of ~/.tmux.conf.local

1
2
3
4
5
6
7
8
9
10
11
12
13
	# force Vi mode
# really you should export VISUAL or EDITOR environment variable, see manual
set -g status-keys vi
set -g mode-keys vi

# replace C-b by C-a instead of using both prefixes
set -gu prefix2
unbind C-a
unbind C-b
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
set -g prefix M-o
bind M-o send-prefix

install zsh and oh-my-zsh

add 185.199.108.133 raw.githubusercontent.com t o/etc/hosts

1
2
3
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
chsh -s $(which zsh)

install nodejs

install nvm

1
2
3
4
5
6
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.zshrc
nvm list-remote
nvm install v20.8.0
node -v

npm源

1
npm config set registry https://registry.npmmirror.com

install hexo and pandoc

1
2
npm install -g hexo-cli
sudo apt install pandoc

install hexo-theme-next

1
2
cd blog
npm install hexo-theme-next

theme-next patch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/_config.yml b/_config.yml
index 5059e2e..e4daac4 100644
--- a/_config.yml
+++ b/_config.yml
@@ -40,8 +40,8 @@ custom_file_path:
# ---------------------------------------------------------------

favicon:
- small: /images/favicon-16x16-next.png
- medium: /images/favicon-32x32-next.png
+ small: /images/favicon-16x16.png
+ medium: /images/favicon-32x32.png
apple_touch_icon: /images/apple-touch-icon-next.png
safari_pinned_tab: /images/logo.svg
#android_manifest: /images/manifest.json
@@ -164,9 +164,9 @@ sidebar:
# Sidebar Avatar
avatar:
# Replace the default image and set the url here.
- url: #/images/avatar.gif
+ url: /images/maru.jpeg
# If true, the avatar will be dispalyed in circle.
- rounded: false
+ rounded: true
# If true, the avatar will be rotated with the cursor.
rotated: false

@@ -501,7 +501,7 @@ math:

# hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
mathjax:
- enable: false
+ enable: true
# See: https://mhchem.github.io/MathJax-mhchem/
mhchem: false

@@ -712,7 +712,7 @@ firestore:
# Show Views / Visitors of the website / page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi
busuanzi_count:
- enable: false
+ enable: true
total_visitors: true
total_visitors_icon: user
total_views: true
@@ -812,9 +812,11 @@ pdf:

# Mermaid tag
mermaid:
- enable: false
+ enable: true
# Available themes: default | dark | forest | neutral
- theme: forest
+ theme:
+ light: default
+ dark: dark


# ---------------------------------------------------------------
@@ -894,6 +896,7 @@ vendors:
# MathJax
# mathjax: //cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
mathjax:
+ enable: true

# KaTeX
# katex: //cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css
diff --git a/layout/_partials/footer.swig b/layout/_partials/footer.swig
index f60ea9b..dc5f8e9 100644
--- a/layout/_partials/footer.swig
+++ b/layout/_partials/footer.swig
@@ -42,6 +42,12 @@
{%- endif %}
</div>

+<div class=BbeiAn-info">
+ {{ __('<E6><B5><99>ICP<E5><A4><87>') }} -
+ <a href="http://www.miitbeian.gov.cn/">20003462<E5><8F><B7></a>
+ </a>
+</div>
+
{%- if theme.footer.powered %}
<div class="powered-by">
{%- set next_site = 'https://theme-next.org' %}

下载emacs 29.1

  • gi t clone的方式,需要autogen一下

install dependencies

树莓派源

cat /etc/apt/sources.list

1
2
deb http://mirrors.aliyun.com/raspbian/raspbian/ bullseye  main non-free contrib rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ bullseye main non-free contrib rpi

安装emacs依赖

1
sudo apt install libxpm-dev libgif-dev libgnutls28-dev libgtk-3-dev libjpeg-dev libtiff-dev libncurses-dev libgccjit-10-dev

编译

1
2
3
./configure --with-native-compilation
make -j
sudo make install

树莓派小电台

参考炬峰的视频,来搞个电台玩玩。

r pi t x

1
2
3
4
5
6
7
8
git clone https://github.com/F5OEO/rpitx
cd rpitx
./install.sh

sudo reboot

cd rpitx
./easytest.sh # FmRds

windows安装SDR软件

  • 淘宝买一个软件无线电R820T2+RTL2832U
  • 下载地址

树莓派设置

audio输入输出设置

  • Audio Inputs - USB Audio Device
  • Audio Outputs - Analog

验证输入输出

1
arecord -f cd - | aplay -V sterio -

修改testfmrds.sh脚本

1
sudo arecord -f cd -D plughw:2,0 -c 2 - | sudo ./pifmrds -freq "$1" -audio -

修改/boot/config.txt

1
2
# Enable audio (loads snd_bcm2835)
dtparam=audio=off

测试

1
./testfmrds.sh 434

rplidar

build on the pi and dev machine

1
2
3
4
5
6
cd ~/code/dep_ws/src
git clone https://github.com/Slamtec/sllidar_ros2.git
cd ..
colcon build --symlink-install
source install/setup.bash
ros2 launch sllidar_ros2 view_sllidar_launch.py

for normal rplidar

1
sudo apt install ros-foxy-rplidar-ros

enable image

flowchart
    A[Driver Node] ---> B["/image_raw
    sensor_msgs/Image"] ---> C[Algorithms & Stuff]
    E["/image_raw/compressed
    sensor_msgs/CompressedImage"]
    B <-- image_transport_library/nodes --> E

install dependencies

on the dev machine

1
2
sudo apt-get install ros-foxy-v4l2-camera
sudo apt install ros-foxy-rqt-image-view

on the pi, add start_x=1 to /boot/firmware/config.txt

1
2
3
4
5
6
7
8
9
sudo apt install libtheora-dev libogg-dev v4l-utils
cd ~/code/dev_dep/src
git clone -b foxy https://gitlab.com/boldhearts/ros2_v4l2_camera.git
git clone https://github.com/ros-perception/image_transport_plugins.git -b foxy-devel
git clone https://github.com/ros-perception/image_common.git -b foxy
git clone https://github.com/ros-perception/vision_opencv.git -b foxy
git clone https://github.com/ros-drivers/usb_cam.git -b ros2
cd ..
colcon build --symlink-install

Launch the camera

1
2
3
cd ~/code/dev_ws
source install/setup.bash
ros2 launch articubot_one camera.launch.py

on the dev machine

1
2
3
4
cd ~/code/dev_ws
source install/setup.bash
rviz2 -d src/articubot_one/config/main.rviz
ros2 run rqt_image_view rqt_image_view

ros2 flow

stateDiagram-v2
    Command_Velocity --> Diff_Dirve_Controller
    state ros2_control {
        Diff_Dirve_Controller --> Hardware_interface: Req. Motor Velocities Velocity Cmd Interfaces
        Controller_Manager
        Hardware_interface --> Joint_State_Broadcaster: Encoder position state
    }
    Hardware_interface --> Car
    Joint_State_Broadcaster --> /joint_states
    /joint_states --> Off_to_robot_state_publisher

install packages

install ros2 controll

要注意的是如果ubuntu20.04都是源码编译ros,需要跳过这一步,因为会失败。总之我是通过源码编译的,因为树莓派在20.04系统64位的暂时没法烧录成功。

1
sudo apt install ros-foxy-ros2-control ros-foxy-ros2-controllers ros-foxy-xacro

需要从这里开始源码编译。

1
2
3
4
5
6
7
8
9
git clone https://github.com/ros/angles.git -b foxy-devel
git clone -b ros2 https://github.com/ros-drivers/ackermann_msgs.git
git clone https://github.com/ros-controls/control_toolbox.git -b foxy
git clone https://github.com/ros-controls/realtime_tools.git -b foxy-devel
git clone https://github.com/ros-controls/control_msgs.git -b foxy-devel
git clone https://github.com/ros-controls/ros2_controllers.git -b foxy
git clone https://github.com/ros-controls/ros2_control.git -b foxy
git clone https://github.com/ros/xacro.git
git checkout 2.0.7

~/.bashrc

1
2
source ~/ros2_foxy/ros2-linux/setup.bash
source /opt/ros/foxy/setup.bash

install joystick test

1
2
3
sudo apt install ros-foxy-joy joystick jstest-gtk evtest
evtest
jstest-gtk

install libserial

1
sudo apt install libserial-dev

joystick flow

stateDiagram-v2
    [*] --> Linux_Joystick_Driver
    Linux_Joystick_Driver --> Joy_Node
    Joy_Node --> /Joy
    /Joy --> /Other_Nodes
    /Other_Nodes --> /whatever
    /Joy --> e.g.teleop_twist_joy
    e.g.teleop_twist_joy --> /cmd_vel

ros2 joy

1
2
3
ros2 run joy joy_enumerate_devices
ros2 run joy joy_node
ros2 topic echo /joy

dev_ws

1
2
3
4
5
6
7
8
9
10
11
mkdir ~/code/dev_ws
mkdir src && cd src
git clone https://github.com/joshnewans/joy_tester
git clone https://github.com/joshnewans/diffdrive_arduino
git clone https://github.com/joshnewans/articubot_one
git checkout 174b3f31
git clone https://github.com/joshnewans/serial
git clone https://github.com/joshnewans/teleop_twist_joy
colcon build --symlink-install
source install/setup.bash
ros2 run joy_tester test_joy

config/my_controllers.yaml

1
2
wheel_separation: 0.177
wheel_radius: 0.042

description/ros2_control.xacro

1
<param name="enc_counts_per_rev">1321</param>
0%