📄 homemade satellite dish positioner.html
字号:
table.docinfo { margin: 2em 4em }table.docutils { margin-top: 0.5em ; margin-bottom: 0.5em }table.footnote { border-left: solid 1px black; margin-left: 1px }table.docutils td, table.docutils th,table.docinfo td, table.docinfo th { padding-left: 0.5em ; padding-right: 0.5em ; vertical-align: top }table.docutils th.field-name, table.docinfo th.docinfo-name { font-weight: bold ; text-align: left ; white-space: nowrap ; padding-left: 0 }h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { font-size: 100% }ul.auto-toc { list-style-type: none }</style></head><body><div class="document" id="homemade-satellite-dish-positioner"><h1 class="title">Homemade Satellite Dish Positioner</h1><blockquote><img alt="dish.jpg" src="Homemade%20Satellite%20Dish%20Positioner_files/dish.jpg"></blockquote><div class="section"><h1><a id="introduction" name="introduction">Introduction</a></h1><p>Most motorised dish systems consist of an actuator arm containing a motorand a simple position-sensing mechanism with a reed-relay. As the motorrotates the relay opens and closes. By counting the number of pulses fromone extreme one is able to establish the position of the dish.</p><p>Normally positioners consist of a pulse-counting circuit, and then someinterfacing logic for the PC. My aim with this project was to let aPC do the pulse counting, however use of any multi-tasking operating systemrisks missing some of the pulses. There are two solutions:</p><blockquote><ol class="arabic simple"><li>Use interrupts, and write a kernel module to process them.</li><li>Use Real-time extensions to Linux.</li></ol></blockquote><p>The first option requires a Schmidt trigger for debouncing, and being apurist I decided that if I had a hard real-time task I could do thedebouncing programmatically, so could lose an extra component. This pushedme to spend a surprisingly long time trying to figure out what the heckreal-time linux was, and how I could use it. Surprisingly, the amount ofcode needed was quite modest.</p></div><div class="section"><h1><a id="software-requirements" name="software-requirements">Software Requirements</a></h1><ul class="simple"><li>Linux. This should work with any distribution, but Slackware withkernel 2.6.14.2 was used for development.</li><li>RTAI. Realtime Application Interface. I've used version 3.3.Available from <a class="reference" href="http://www.rtai.org/">http://www.rtai.org</a></li></ul></div><div class="section"><h1><a id="hardware-requirements" name="hardware-requirements">Hardware Requirements</a></h1><ul class="simple"><li>PC with serial port. 386 or higher will do.</li><li>ACME Actuator. The controlling interface should be four wires. Twoof them connect to the motor, the other two across a reed relay that opensand closes as the positioner extends or retracts. Some actuators have6 wires: I have no idea how you interface to these.</li><li>A 12v power supply. I'm using an ATX supply from an expired PC.AT PSUs usually go for a few quid on ebay. You could use the PSUrails from the controlling PC, but that might be risky as the actuatordraws 2.5amps, it's an inductive load and it's not constant.</li><li>A 2-channel relay control board. You could make your own, or buy oneoff Ebay as I did (cost was about 5 pounds).</li><li>Some electronic components (as detailed in the circuit diagrams below).All of them are available from Farnell (<a class="reference" href="http://www.farnell.co.uk/">http://www.farnell.co.uk</a>).</li><li>Some patience.</li></ul></div><div class="section"><h1><a id="preparing-the-pc-system" name="preparing-the-pc-system">Preparing the PC system</a></h1><ul><li><p class="first">Install your favourite Linux Distribution (Slackware 10.2 was mine).</p></li><li><p class="first">Update the kernel to 2.6.15.7 (latest supported by rtai):</p><pre class="literal-block">tar xvf linux-2.6.15.7.tar.bz2rm linuxln -s linux-2.6.15.7 linux</pre></li><li><p class="first">Get RTAI. I used version 3.3. On the RTAI page you'll see a lot ofstuff you don't understand. Don't worry. Go and get the tarball andunpack it, because installation is quite simple.</p></li><li><p class="first">Apply the RTAI HAL patch to the kernel source. You'll find it in oneof the subfolders:</p><pre class="literal-block">cd /usr/src/linuxpatch -p1 < /usr/src/rtai-3.3/base/arch/i386/patches/hal<version>patch</pre><p>For <version> substitute the closest match to your kernel, but becareful because the minor-minor version (2.6.15.XXX) can be differentbut not the minor version (2.6.XXX.5), or it probably won't work.</p></li><li><p class="first">Compile and install the new kernel (reboot)</p></li><li><p class="first">Compile and install RTAI</p></li><li><p class="first">Load the RTAI modules if they're not already:</p><pre class="literal-block">/sbin/insmod /usr/realtime/modules/rtai_hal.ko/sbin/insmod /usr/realtime/modules/rtai_lxrt.ko/sbin/insmod /usr/realtime/modules/rtai_usi.ko/sbin/insmod /usr/realtime/modules/rtai_fifos.ko</pre><p>In my case 'lsmod' gives:</p><pre class="literal-block">Module Size Used byrtai_fifos 26540 0rtai_usi 992 0rtai_lxrt 76344 1 rtai_fifosrtai_hal 24248 2 rtai_fifos,rtai_lxrt</pre></li></ul><p>That's it!</p></div><div class="section"><h1><a id="actuator-power-supply" name="actuator-power-supply">Actuator Power Supply</a></h1><p>I found quite a good link on converting an ATX PSU for use outside acomputer <a class="footnote-reference" href="#id2" id="id1" name="id1">[1]</a>I followed this to get myself 12 volts for driving the positioner motor.Because my relay control board was 6 volts, I went between the 5v and 12v railsto get 7v for the board (close enough to 6v). Switching PSUs don't likethis kind of abuse at the best of times, but without any load mine gavedistinctly poor regulation on 12v, so I introduced some load for the 5v railin the form of a 1watt 80 ohm resistor, and then all was well.</p></div><div class="section"><h1><a id="pulse-counting-circuit" name="pulse-counting-circuit">Pulse counting circuit</a></h1><p>The reed relay connections are wired directly to DSR and TX of the serialport:</p><pre class="literal-block">| Serial O +12v| port || D1 || DTR O---------:>|-----\| R1| O------/\/\/\/\/-----.| RTS O---------:>|-----/ || D2 || DSR O---------------------------------------O------O| To Reed Relay| TX O----------------------------------------------O</pre><p>TX is normally at -12v when not sending data. When DTR or RTS arebrought high, current flows through R1. This results in DSR beingpulled high (+12v). When the reed relay is shorted, however, TXasserts -12v on the DSR line. So long as either DTR or RTS are highthere is power for the pulse counting circuit, and DSR reflects thestate of the reed relay. DTR and RTS supply the control signals forthe motor, and since the motor has only three states (driving East,driving West or stopped), we can make the logic so one of these linesis always high.</p></div><div class="section"><h1><a id="motor-control-circuit" name="motor-control-circuit">Motor Control Circuit</a></h1><p>The motor is driven by two relays in an arrangement like this:</p><pre class="literal-block">| +12v -----O motor .O-------- +12v| terminals /| O------O O-------O| /| 0v -----O' O-------- 0v| RELAY1 RELAY2</pre><p>(In this example state the motor would be on). The relay drivingcircuit gets superimposed on top of the pulse counting one,it's just easier to show them in separate diagrams:</p><pre class="literal-block">| D3 (OPTO) R2| DTR O-------|<:-----------\/\/\/\-----------.| || D4 (OPTO) R3 || RTS O-------|<:-----------\/\/\/\-----------O----O +12v</pre><p>D3 and D4 are the diode inputs of the opto isolators. If DTR is broughtlow current will flow through D3, causing the output of the isolatorto change state. This switches one of the driver relays on, and themotor will be powered. When the dish has moved to the correct positionDTR is brought high again and the motor stops. When the dish needs tobe moved back in the other direction RTS is brought low and the secondrelay channel is activated moving the dish in the other direction.</p><p>Since the DTR and RTS between them power the +12v point, the actuatorshould strictly be 'halted' before being reversed to avoid spuriouspulses on DSR. In practise this has not been needed.</p><p>R2 and R3 must be chosen so as to limit the current flowing throughthe diodes to 20mA, but in any case the serial port can provide only10mA or so. For sensitive devices like the 6N138 3mA is plenty, soI've used 10K resistors.</p><p>Any diodes will do for D1 and D2 (apart from zeners). R1 shouldprevent more than 2-3mA from flowing when the reed relay closes, (10Kor higher should do) or the +12v may drop and insufficient power beavailable for motor control.</p><p>A 6N138 was used for isolation but other darlington devices might besuitable (current draw of the sensing device should be no more than 3mA).The 6N138 output pins directly drive the relay module inputs.</p><p>Here's what it looks like put together:</p><table class="docutils" border="1"><colgroup><col width="54%"><col width="46%"></colgroup><tbody valign="top"><tr><td><img alt="circuit.jpg" class="first last" src="Homemade%20Satellite%20Dish%20Positioner_files/circuit.jpg"></td><td><img alt="all.jpg" class="first last" src="Homemade%20Satellite%20Dish%20Positioner_files/all.jpg"></td></tr></tbody></table></div><div class="section"><h1><a id="the-software" name="the-software">The Software</a></h1><p>By observing the speed at which pulses were produced from the actuator, adebounce timing period of 50mS was chosen. This is the period at whichDSR gets sampled. All the position sensing software has to do is countthe state transitions of DSR. The software is split into two parts:</p><blockquote><ul class="simple"><li>A Daemon program written in C, running with realtime priveledges tohandle counting the pulses and setting the motor control inputs.</li><li>A Python program issuing commands to the Daemon.</li></ul></blockquote><p>All the sources can be found <a class="reference" href="http://www.biffer.talktalk.net/positioner/src">here</a>. You will need to change<a class="reference" href="http://www.biffer.talktalk.net/positioner/src/act.c">act.c</a> (the daemon) if you want to use a serial portother than COM1.</p><table class="docutils footnote" id="id2" frame="void" rules="none"><colgroup><col class="label"><col></colgroup><tbody valign="top"><tr><td class="label"><a class="fn-backref" href="#id1" name="id2">[1]</a></td><td><a class="reference" href="http://wiki.ehow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply">http://wiki.ehow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply</a></td></tr></tbody></table><p>Copyright (c) <a class="reference" href="mailto:bifferos@yahoo.co.uk">bifferos@yahoo.co.uk</a> Feb 2006</p><p>LICENSE: You are free to do what you like with this code so long as youretain the copyright notice in derived works, either in the source code(in the case of source distributions) or in the documentation (in the caseof binary distributions).</p></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -