立命館大学 大学院 講義資料
(C) by T.IZUMI @ Ritsumeikan U, Sep 2016 - 無断複製・再配布を禁ず
Acknowledgements:
the base design is presented by Kaitlyn Franz and
the base kit is provided by Digilent Inc.
|
車輪を勢いよく回しているときに、急に逆回転に切り替えるとモーター駆動回路が焼き切れるので、そのような操作/制御はできるだけ避けること。 運動エネルギーが電気エネルギーになって逆流するため。 タイヤを浮かしていても焼き切れる場合があるので注意。 |
linaro@linaro-ubuntu-desktop:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 7.4G 0 disk
tqmmcblk0p1 179:1 0 1G 0 part /mnt/ZYBO_BOOT
mqmmcblk0p2 179:2 0 6.4G 0 part /
mtdblock0 31:0 0 5M 0 disk
mtdblock1 31:1 0 128K 0 disk
mtdblock2 31:2 0 10.5M 0 disk
mtdblock3 31:3 0 384K 0 disk
linaro@linaro-ubuntu-desktop:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 6495992 1685168 4457800 28% /
devtmpfs 239044 4 239040 1% /dev
none 51108 592 50516 2% /run
none 5120 0 5120 0% /run/lock
none 255540 8 255532 1% /run/shm
/dev/mmcblk0p1 1046516 6876 1039640 1% /mnt/ZYBO_BOOT
linaro@linaro-ubuntu-desktop:~$ mount
/dev/root on / type ext4 (rw)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/mmcblk0p1 on /mnt/ZYBO_BOOT type vfat (rw)
|
linaro@linaro-ubuntu-desktop:~$ lsusb
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 007: ID 056e:7016 Elecom Co., Ltd ←カメラ
Bus 001 Device 008: ID 0461:4d01 Primax Electronics, Ltd Comfort Keyboard
Bus 001 Device 009: ID 04bb:0947 I-O Data Device, Inc. WN-G150U Wireless LAN Adapter ←WiFiアダプタ
Bus 001 Device 010: ID 1c4f:0027 SiGma Micro
linaro@linaro-ubuntu-desktop:~$ lsusb -t
1-1.1:1.2: No such file or directory
1-1.1:1.3: No such file or directory
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 1: Dev 7, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
|__ Port 1: Dev 7, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
|__ Port 1: Dev 7, If 2, Class=audio, Driver=, 480M
|__ Port 1: Dev 7, If 3, Class=audio, Driver=, 480M
|__ Port 2: Dev 8, If 0, Class=HID, Driver=usbhid, 1.5M
|__ Port 3: Dev 9, If 0, Class=vend., Driver=rt2800usb, 480M
|__ Port 4: Dev 10, If 0, Class=HID, Driver=usbhid, 1.5M
|__ Port 4: Dev 10, If 1, Class=HID, Driver=usbhid, 1.5M
|
linaro@linaro-ubuntu-desktop:~$ iwconfig
wlan0 IEEE 802.11bgn ESSID:"izumilab"
Mode:Managed Frequency:2.432 GHz Access Point: 12:34:56:78:9a:bc
Bit Rate=1 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=35/70 Signal level=-75 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:49 Missed beacon:0
lo no wireless extensions.
eth0 no wireless extensions.
linaro@linaro-ubuntu-desktop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 12:34:56:78:9a:bc
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2704 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:143913 (143.9 KB) TX bytes:17153 (17.1 KB)
Interrupt:147 Base address:0xb000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 12:34:56:78:9a:bc
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4789 errors:0 dropped:0 overruns:0 frame:0
TX packets:600 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:792668 (792.6 KB) TX bytes:74996 (74.9 KB)
|
linaro@linaro-ubuntu-desktop:~$ sudo /home/linaro/zybot/testio.sh
demo action for leds,btns,sws
push btns and toggle sws while leds light
mem[41200000] <= 00000000
mem[41210000] => 00000000
mem[41220000] => 0000000f
:
(中略)
この間にLEDがデモパタンで点滅する。
この間にBTNを押すと41210000の値が変わる。
この間にSWを変更すると41220000の値が変わる。
:
demo action for motors and servos
mem[43c40004] <= 00004e20
mem[43c40010] <= 00004e20
mem[43c40000] <= 00000301
mem[43c30000] <= 0001d4c0
mem[43c30004] <= 0001d4c0
:
(中略)
この間にモータとサーボがデモパタンで動作する。
:
|
root@linaro-ubuntu-desktop:~# /home/linaro/zybot/testio.sh
LED, モータ, サーボの動作を確認する。
|
linaro@linaro-ubuntu-desktop:~$
izumi@cygwin ~$ rm ~/.ssh/known_hosts ←必要に応じて
izumi@cygwin ~$ ssh linaro@192.168.1.100
The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
ECDSA key fingerprint is SHA256:abcdefghijklmn.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.100' (ECDSA) to the list of known hosts.
linaro@192.168.1.100's password: linaro ←見えない
Welcome to Linaro 12.09 (GNU/Linux 4.0.0-xilinx-g986ffc6-dirty armv7l)
* Documentation: https://wiki.linaro.org/
New release '14.04.5 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Sun Sep 25 14:50:25 2016 from cygwin.local
linaro@linaro-ubuntu-desktop:~$ sudo /home/linaro/zybot/testio.sh
LED, モータ, サーボの動作を確認する。
|
izumi@cygwin ~$ cd /cygdrive/c/Users/izumi/Desktop/zybotr_client/
izumi@cygwin /cygdrive/c/Users/izumi/Desktop/zybotr_client$ ls
Makefile winclient.c
izumi@cygwin /cygdrive/c/Users/izumi/Desktop/zybotr_client$ make
gcc -o winclient.exe -O -Wall -g winclient.c -mwindows -lws2_32 -lmswsock -ladvapi32 -lwinmm
izumi@cygwin /cygdrive/c/Users/izumi/Desktop/zybotr_client$ ls
Makefile winclient.c winclient.exe
|
izumi@cygwin /cygdrive/c/Users/izumi/Desktop/zybotr_client$ ./winclient.exe 192.168.1.100
usage: ./winclient [server addr]
Control for Keyboard
q,Q,x,X ... quit
f,F ... run forward
b,B ... run backward
l,L ... turn left
r,R ... turn right
s,S ... down/up camera
t,T ... left/right camera
j,J ... use Joypad
Control for Jeypad
sticks ... run/turn
1,2,3,4 ... move camera
5 ... use Keyboard
6 ... quit
Controlled by JoyPad0
Center Values of (X,Y,Z,R)=(00007fff,00007fff,00007fff,00007fff)
.
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
ctrl 0000 pwm 0000 0000 syn 0 0 srv 0249f0 0249f0 led 0
:
(以下略)
|
| 過放電に注意!   全てのバッテリを完全充電してから使用すること。 充電状態の異なる電池を組み合わせて使用すると、 先に無くなった電池が他の電池により過放電され、異常発熱や液漏れを起こす。 |