十二 19

今天,終於有了時間,去了一趟傳說中的杭州圖書館,在短短的半天時間里,感受到了爽快的生產過程。(PS:上面家一段文字,是我用Ibus的拼音的繁体模式打的,看起亚繁体非常的不錯,但是,实在是本人的拼音输入速度实在是不敢恭維,还是切换回五笔输入吧。) 个人感觉目前的优点有这么几个:

  1. 停车免费
    可能因为刚开不久的原因,地下停车场的入口并没有完全的开放,对于我这种第一次过去的人来说,还是绕了几个来回才找到一个可以进的入口。同时,也可能是因为这个入口开放的问题,边上的路边有一个临时设置的停车位,当然也是免费的,问了几个周边的地管环境监察的阿姨,说不用罚款的。:)
  2. 网络丰富,既有无线的WIFI,也有地下的网线接口
    一进入图书馆,就报告收到无线信号,但是似乎信号不是很稳定。事实证明确实是如此的,在二楼自修室使用过程中,信号不是非常的好。后来发现,边上一个在玩QQ的人似乎是用网线连接的,哈哈,还好随身带了个根网线,于是播上,就有了非常不错的速度,没有测过。
  3. 环境尚可(如果大部分在自修室的人可以自觉的安静的话)
    自修室,个人觉得是一个非常不错的环境,在今天上午的三个小时中,效率非常的高。一个好的环境,对于做事情来说,还是非常重要的。
  4. 办证方便
    如果是有杭州市民卡的,可以带第二代身份证很容易的免费办理。如果今天没有带,也没有关系,给押金100块,就可以办理了,下次带上市民卡,就可以退这100块押金。
  5. 书籍还算是丰富
    说还算丰富,可能因为我只是去了一趟二楼的借阅的缘故吧,搜索了一下机器人的资料,发现主流的一些资料,还是有的,但是几乎没有一些外文的资料,对于这一块领域的信息,还是比较信服国外原版的资料,对于国内的很多信息出版物,大都是翻译,要么是抄来的一些编著性书籍,对于这种书,兴趣不是很大。

总的来说,这第一次的杭州图书馆之行,还是非常令我满意的,高效率了完成了要做的事情.以前,自己经常会去一些咖啡厅坐坐,享用着他们的无线,来做一些事情,现在看来,有一个更好的选择了,杭州图书馆。

最后,上图上真相,自修室照片一张。对面书架上的书,是个人捐的书籍,随意取用,但是一点,用完后,请放回原处。
hts

Tags: ,,,,,,,,,,
十一 30

首先,今天是郁闷的一天,在机场等待了近四个半小时后,得到消息,因为沈阳大雾的问题,今天的航班取消了。这四个小时是比较难过的四个小时,《明朝哪些事儿之五》看完了,得出了一个结论,斗争的结果都是可悲的,大明王朝几百年,少有几个可以善终的官员。当然,这和个今天的主题没有关系,但是因为电脑是看完这部历史剧后拿出来了,照例要来提一下。

杭州机场的chinanet信号非常好,而且边上又有一个电信的VIP候机室,居然没有中国移动的比较奇怪(更新:移动的VIP候机室换到13那边去了),中国联通的就在电信的边上,也有WIFI的信号,但是,相对于电信与CMCC而言,联通的信号实在的是太低了,这在机场也表现的很正常。自然而然的,直接使用了ChinaNet的信号,非常不错。
不久前,曾经写过一篇《机场chinanet电信无线可用家用宽带登录》,chinanet可以使用家用宽带帐号登录,但是现在我已经不用了,也没有电信的帐号。
似乎没有办法的时候,打开浏览器,发现居然可以上的,突然就想到TX同学介绍过的GappProxy,对了,还有bones的机场免费用GAppProxy上过网,似乎就是如此。于是就在.cn中直接搜索GappProxy,当然打开链接的时候,打不开了,因为我没有登录嘛。但是,不是可以上么,哈哈,对了,用网页快照,果然不出所料,正常的上去了。找到了链接,同时也在快照的帮助下直接下载了GappProxy for windows XP,哈哈,速度超快,然后自然的,运行gui.exe,改了firefox的proxy,哈哈,正常可以上网了。

Tags: ,,,,,,,,
23

     如果有朋友和我一样经常各地来回的跑,而且又如同我一般没有网络便是没有生活的话,或许可以参考一些我的个人网络解决方案。不过,如果您有更好的方案,不仿分享一下,因为对于我来说,没有网络的日子,是不行的。当然,也有不少朋友问过我,看你蛮是喜欢玩计算机的啊,那你玩什么游戏呢?不好意思,我答案一般会让人无话可说,因为我不玩游戏。那上网一般会做什么呢?交友,玩游戏,论坛,还是其他什么?或是什么second life之类的,下载,etc…对于游戏,我是基本上的免疫的,那对我没有任何的吸引力,这种虚拟的不真实的东西,纯粹是空虚的人需要的。一般上网使用网络的话信息的获取和朋友的交流,是我的主要部分。所以, reader一直是我使用的信息获取的方法,如碰到有好的,我都会直接订阅的方式来阅读,这方面了很不多。好了,言归正转。目前我主要使用的网络解决方案有两种:

1. treo 680手机上网

    浙江移动在这方面的资费还是不错的,目前我是使用了20块包月使用200M流量的套餐,基本上用来收一下邮件及看一些信息,速度方面在开通了EDGE的地方还是不错的。

2.各地无线方案

    因为手机本身不带WIFI,所以这个方案就必须要用我的计算机了,现在已经迷上了使用界面非常友好的个人定制版的,compiz界面,dock特效,高效的处理过程,对于windows,只有在必须用的时候,出现。之前有同事同我提到在机场的无线中可以使用chinanet中国电信宽带的帐号来登录无线,之前天津测试了一下,浙江的帐号似乎不能使用。有可能是需要开通类似于漫游的功能,此不得知。今天,在杭州是可以测试成功的。各位可以不仿不试.

目前,就此两种方案比较不错的,如果3G到来了,将会更好,速度是一种快感。当你使用了杭州的镜像来安装软件时,那种1000k/s的速度,会让你疯狂。哈哈

 

Tags: ,,,,,,,,,
10

ChRoMicro - Cheap Robotic Microhelicopter HOWTO

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.

Revision History
Revision 1. 2005-06-02 PB
First public release.
Revision 2005-05-27 PB
Document created.

1. Introduction

RCmodel helicopter prices have reached a point where all sorts ofchallenging (i.e. crash-prone) projects become affordable.This document explains how to build a 300 g, 3D-capable helicopter withembedded Linux and Bluetooth datalink for less than 500 EUR.

Asa proof of concept, we provide software which allows the helicopter tobe remotely controlled over Bluetooth with a PC joystick. Future workwill focus on the integration of sensors (IMU, altitude, magneticcompas, GPS, camera) and flight control software (either third-party ordedicated).

2. Off-the-shelf Components

2.1. Helicopter platform

Anumber of inexpensive microhelicopters are now available to RC modelhobbyists: Ikarus Piccolo, MS Hornet, Carboon, Dragonfly, Hummingbird,Tiny, Aerohawk. These are essentially scaled-down versions of regularmodel helicopters, made possible by advances in battery technology.Some models have a rotor head with fixed collective pitch (FP), whileothers have both cyclic and collective pitch (CP). Most have adedicated tail motor rather than a variable-pitch tail rotor.

Arecent radical innovation is the "ProxFlyer" self-stabilizingdeformable rotor design. Unfortunately, current commercialimplementations are too small to be used as robotic platforms. Besides,stability is obtained by sacrificing maneuverability.

For this project we use a commercial ARF microelicopter kit containing:

  • A pre-assembled helicopter with collective-pitch rotor, two brushed motors and three miniature servos

  • An electronics package with BEC, 6-channel RC receiver, yaw gyro, and motor drivers

  • A 41 MHz 6-channel RC transmitter with hardwired CCPM mixing

  • A 11.1 V, 850 mAh lithium-polymer battery

  • A battery charger.

The aircraft weighs 270 g and can lift at least 50 g of payload.

Theelectronics package is a "black box" which connects all componentstogether. This is in contrast with larger model helicopters, where theconnections between the receiver, gyro, BEC and motor drivers areexposed and documented. Integrating all these components reduces size,weight and cost, but makes modifications harder.

Fortunately,in some commercial microhelicopters, the "black box" can be tinkeredwith fairly easily. It actually consists of two boards connectedback-to-back with a 2×3-pin connector (see Figure 1):

  • A generic RC receiver board with seven 3-pin PWM servo outputs.

  • A power/gyro board with BEC, gyro, failsafe, and motor controllers.

Figure 1. Contents of the integrated controller in a typical commercial microhelicopter kit.

Contents of the integrated controller in a typical commercial microhelicopter kit.

Table 1 lists the PWM outputs, two of which are routed internally between the two boards.

Table 1. RC receiver PWM outputs.

Channel Usage
1 Right servo
2 Front servo
3 Main motor (internally connected to the power/gyro board)
4 Tail rotor (internally connected to the power/gyro board)
5 Unused
6 Left servo
B Unused (12 ms sync pulses)

Any similar helicopter can be used. The main requirements are:

  • The controller board must use PWM signals. Generating PCM signals would require more , especially if proprietary encodings are involved.

  • The controller board must expose the multiplexed PWM signal between the FM radio receiver and the demultiplexer (see Section 3.2), or at least the PWM inputs to the motor drivers.

  • The helicopter must be strong enough to lift at least 30 g of payload.

  • The battery must be able to supply 200mA of additional current.

2.2. Embedded computer

We use a Gumstix single-board computer with the following features:

  • 200 MHz XScale PXA255 processor (ARM)

  • 4 MiB flash with factory-installed Linux-2.6.10 and utilities

  • 64 MiB SDRAM

  • General-purpose I/O pins

  • I/O daughterboard with 2.54 mm pads

  • I2C bus

  • Bluetooth module and antenna

  • Comprehensive software development environment

Some features are not used:

  • Hardware PWM generator: Intended for driving the brightness and contrast of a LCD display. We need more than two channels.

  • USB client interface: Intended for ARM-based PDAs. usbnet is useful for logging into the Gumstix, but we can use Bluetooth instead.

2.3. Other equipment

  • Linux computer with USB and Bluetooth

  • Xbox-compatible controller

  • 12 V, 5 A regulated power supply

  • 10 Mhz analog oscilloscope (recommended)

3. Hardware

3.1. Voltage regulator mod

The power/gyro board has two +5 V voltage regulators labelled CX1117-5. and mounted in parallel. Idle current is 50 mA.

Sincethis +5 V rail is exposed on each servo connector (including the unusedones), the Gumstix can be conveniently powered from it. In order toaccomodate the extra current (100-200 mA total), it might be necessaryto replace the two voltage regulators with a larger, externally-mounted7805.

3.2. PWM injection mod

In order control the helicopter, we modify the RC receiver board so that the Gumstix can inject its own PWM signal into the PWM demultiplexer.

Why not get rid of the receiver board entirely and generate five PWM signals with the Gumstix ? The proposed approach has several advantages:

  • No need to build a custom PCB.

  • Only three wires between the Gumstix and the helicopter (GND, +5 V, multiplexed PWM).

  • The PWM demultiplexer adds one layer of electrical isolation between the Gumstix and the power electronics.

Figure 2 shows details of a typical RC receiver board and the modification. Simply cut the correct PCB trace(s) and connect both ends to a 2-pin connector outside of the plastic enclosure. Chronograms should help locate the signals.

Figure 2. RC receiver board details and modifications (in red).

RC receiver board details and modifications (in red).

The original functionality can be restored by disconnecting the Gumstix and inserting a jumper.

3.3. Xbox controller mod

Xbox controllers are widely available, cheap, and have well-defined functionality (unlike PC joysticks). They can be connected to a PC by replacing the proprietary connector with a USB plug.

Alternatively, any USB joystick (a.k.a. joypad or gamepad) with two dual-axis analog sticks can be used. In this case the mixer configuration file must be adjusted to match the layout of the axes (see Section 4.3).

4. Software

Source code is available from http://perso.wanadoo.fr/pascal.brisset/chromicro/dist/chromicro-1.0.tgz.

4.1. MPWM: Multi-channel PWM generator

pxa_mpwm.ko is a timer-based multi-channel PWM signal generator for the PXA255, implemented as a loadable kernel module for linux-2.6.10gum.

It can be configured to a generate a single multi-channel PWM signal and/or multiple single-channel PWM signals on GPIO pins. GPIO pins, channels and timings are configured with module parameters as illustrated in Table 2.

Table 2. MPWM configuration examples.

Application Module parameters
One output signal with 6 multiplexed PWM channels modprobe pxa_mpwm gpio=61 nchans=6 tmin=500 tmax=1500 tpause=500 tsync=12000
Same with single-channel servo outputs except CH5 modprobe pxa_mpwm gpio=61 nchans=6 servo=58,59,60,62,-1,63 tmin=500 tmax=1500 tpause=500 tsync=12000
Single-channel servo outputs only modprobe pxa_mpwm nchans=6 servo=58,59,60,62,-1,63 tmin=500 tmax=1500 tpause=500 tsync=12000

User-mode programs drive the PWM generator through a device interface. See Table 3. PWM generation begins when a program opens the device and sets values for all channels. GPIO pins are reverted to a logical 1 when the program closes the device.

Table 3. MPWM devices.

Device Usage
/dev/mpwm0 PWM signal #1 (all channels written at once)
/dev/mpwm0- Channel #1 of PWM signal #1
/dev/mpwm0-1 Channel #2 of PWM signal #1
/dev/mpwm0-2 Channel #3 of PWM signal #1
/dev/mpwm0-3 Channel #4 of PWM signal #1
/dev/mpwm0-4 Channel #5 of PWM signal #1
/dev/mpwm0-5 Channel #6 of PWM signal #1

MPWM uses OSMR1 (OS Match Register 1), which is normally available on the Gumstix. (OSMR0 is used by the Linux system timer and OSMR3 is used by the watchdog.)

The PXA255 timer period is 270 ns, which provides 11 bits of resolution for a typical PWM signal with 1 ms range. Although MPWM uses a high-priority PXA255 FIQ rather than a regular IRQ, jitter can be as high as several microseconds. This is still good enough for flying a helicopter. See also Section 9.2.

4.2. Bluetooth RC receiver emulator

bluerc_rxis a user-mode program designed to run on the Gumstix. It receives RCdata as UDP packets over a Bluetooth BNEP connection and forwards themto the PWM generator.

The program will terminate if it does notreceive any UDP packet during a configurable interval. This willdisable the PWM outputs and (hopefully) cause the power/gyro board toshutdown the motors.

Usage: bluerc_rx [-p ] [-t ] [-c ]

Example: bluerc_rx -p 9000 -t 2000 -c /dev/mpwm0

4.3. Bluetooth RC transmitter emulator

bluerc_txis a user-mode program designed to run on a Linux host with a Bluetoothdongle and a USB joystick. It reads the positions of the analog sticksand triggers, mixes them linearly into 6 RC channels, and sends thechannel values to the helicopter as 6-byte UDP packets over a BluetoothBNEP link.

Usage: bluerc_tx [-c ] [-r ] [-m ] [-d ] [-p ]

Example: bluerc_tx -c /dev/js0 -r 50 -m xpad_ccpm120_mode2.mix -d 192.168.10.1 -p 9000

The mapping from joystick axes to RC channels is defined by a matrix in the configuration file. Figure 3 shows the default setup.

Procedure 1. Trimming

  1. Bring the sticks to the desired "neutral" setting.

  2. Depress the "back" button.

  3. Allow the sticks to return to their central position.

  4. Release the "back" button.

Figure 3. Mixer configuration xpad_ccpm120_mode2.mix.

Mixer configuration xpad_ccpm120_mode2.mix.

Figure 4. Coefficients for 120° CCPM mixing.

Coefficients for 120° CCPM mixing.

5. System integration

Figure 5. Helicopter + ARM + Linux.

Helicopter + ARM + Linux.

Figure 6 and Table 4 show the connection with the Gumstix daughterboard.

Figure 6. Rear view with connector on I/O daughterboard.

Rear view with connector on I/O daughterboard.

Table 4. Gumstix daughterboard I/O pin assignments.

Pin Signal Usage
10 NACRESET (disconnected) +5 V CC in
16 GND GND
18 GPIO61 6-channel PWM out

6. Operation

6.1. Bluetooth remote control

In this scenario (Figure 7) we simply emulate a regular remote control. There are no sensors on the helicopter, no complex embedded software, and no feedback from the helicopter to the ground station.

Figure 7. Bluetooth remote control overview.

Bluetooth remote control overview.

For a quick start, try make tx and make rx in the src directory.

Procedure 2. Startup

  1. Start bluerc_tx on the PC.

  2. Connect the battery. The GPIO pin will be pulled high while the Gumstix is booting.

  3. Setup networking over Bluetooth (BNEP). This can be automated with pand.

  4. Load pxa_mpwm.ko on the Gumstix. The GPIO pin will be configured for output, but kept at logical 1.

  5. Start bluerc_rx on the Gumstix. PWM will be generated as soon as UDP packets are received.

Procedure 3. Shutdown

  • Either disconnect the battery, stop bluerc_rx, or stop bluerc_tx.All alternatives should be equally safe. Note that with the original FMremote control, it is mandatory to disconnect the receiver or batterybefore stopping the transmitter.

7. Disclaimer

Use these instructions and the related software at your own risk.

This is experimental software with none of the failsafe features one could expect in a commercial product.

Remote-controlledaircrafts are not toys. They are usually operated by properly-trainedand insured hobbyists on dedicated airfields.

Due to their mechanical complexity and moving parts, helicopters are among the most dangerous aircrafts.

Robotic aircrafts tend to wander in unpredictable ways.

Software dumps core; hardware just crashes.

Lithium-polymer batteries are known to burst in flames when damaged.

Bluetooth radio range is 10 m. This is not appropriate for outdoor flight.

8. Related open-source projects

rcpilot - http://rcpilot.sourceforge.net/

Autopilot - http://autopilot.sourceforge.net/

Paparazzi - http://www.nongnu.org/paparazzi/ (Note: I am *NOT* related to pascal.brisset (at) enac (dot) fr).

9. Roadmap

9.1. Weight reduction

  • Remove the Gumstix daughterboard. Connect directly to the 60-pin Hirose connector.

  • Remove the RC receiver board. Generate 5 PWM signals.

9.2. PWM generator accuracy

Goal: Reduce the jitter of the timer-based PWM generator.

Lock the FIQ handler in the I/D cache ?

9.3. Sensors

  • Inertial measurement unit. 6 DOF, I2C interface.

  • Video camera

  • Magnetometer. I2C interface.

  • Pressure (altitude, airspeed). I2C interface.

  • Camera.

9.4. Bluetooth QoS

Goal: Reduce datalink latency.

Use a more appropriate protocol than BNEP.

9.5. WiFi datalink

Goal: Improve range.

9.6. Bluetooth-enabled controller

Goal: Get rid of the computer.

Thanks to the next generation of videogame consoles, cheap Bluetooth joysticks should be available in 2006.

9.7. Flight control software

  • Assisted flight: stable hover, 3D

  • Waypoints

  • Takeoff and landing

  • Autonomous navigation, image processing

References

[pxa255_dev] Intel PXA255 Processor. Developer’s manual.

[pxa255_user] Intel XScale Microarchitecture for the PXA255 Processor. User’s Manual.

[pxa255_elec] Intel PXA255 Processor. Electrical, Mechanical, and Thermal Specification.

Glossary

Almost Ready to Fly (ARF)

Refers to a model aircraft which is sold pre-assembled.

Battery-Elimination Circuit (BEC)

A DC-DC voltage converter (linear regulator or switching converter) which is used to power a RC receiver and servos from the same battery as the motors. Output is typically 4.8V or 5V.

Bluetooth Network Encapsulation Protocol (BNEP)

Provides an ethernet-like interface (e.g. bnep0) at each end of a Bluetooth connection.

Collective pitch (CP)

Refersto a helicopter rotor design with variable collective pitch. Thrust iscontrolled by varying either the collective pitch or the speed of themain motor.

See Also Fixed pitch.

Cyclic-Collective Pitch Mixing (CCPM)
Fixed pitch (FP)

Refersto a helicopter rotor design with cyclic pitch, but fixed collectivepitch. Thurst is controlled by varying the speed of the main motor.This causes more inertia than a "CP" helicopter. Besides, "FP"helicopters cannot fly inverted.

See Also Collective pitch.

General-Purpose I/O (GPIO)

The PXA255 has 85 general-purpose pins which can be independently configured for input or output, or connected to integrated peripheral functions (e.g. serial ports and LCD).

Global Positioning System (GPS)
Inertial Measurement Unit (IMU)

Accelerometers (translation) and gyros (rotation)

Lithium-Polymer (LiPo)
Mode 1 / Mode 2 ()

Alternative layouts for axes on a RC helicopter transmitter.

Printed Circuit Board (PCB)
Pulse Code Modulation (PCM)

A generic term for digital transmission.

Pulse Position Modulation (PPM)

An improper term for PWM, in RC terminology

Pulse Width Modulation (PWM)

A modulation which encodes an analog signal into variable-length digital pulses.

Unmanned Aerial Vehicle (UAV)

Not necessarily autonomous.


Tags: ,,,,,,,,,,,,