Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/AntennaTracker/AntennaTracker.txt
Views: 1798
AntennaTracker12Mike McCauley32014-03-0545This is the ardupilot AntennaTracker67This software, combined with appropriate hardware, can be used to cause a8high-gain antenna to track a mavlink equipped air or ground vehicle in real9time, providing higher quality radio links over longer distances than a10stationary or omnidirectional antenna.1112AntennaTracker can be a stationary installation on the ground or can be13mobile, mounted on a vehicle, and moving at the same time as the vehicle it is14tracking, such as on a pursuit vehicle, etc.1516Antenna Tracker Hardware1718The software works with:1920- Alt-Azimuth mounted antenna tracker, equipped with 2 servos: one for Azimuth21(also called bearing or yaw) -180 to 180 degrees and one for Altitude (also22called elevation, or pitch) -90 degrees (straight down) to 90 degrees23(straight up). I used an Eagle Tree Antenna Pan-Tilt.2425- Ardupilot compatible processor such as26-- Flymaple27-- others tested?28and with a radio or wired link to a source of mavlink messages with the29tracked vehicle's position data.3031A suitable power supply is also needed, possibly battery powered. In the case32of Flymaple, the onboard 5V regulator is not able to drive large servos33without causing large amounts of electrical noise in the processor, so you34would probably need an external 5V regulated supply3536Theory of Operation3738AntennaTracker receives real-time GPS position reports from the vehicle being39tracked (in the form of GLOBAL_POSITION_INT messages sent by mavlink radio40connection or possibly by hardwired serial connection). AntennaTracker also41knows its own current position. Based on these 2 sets of coordinates, it42calculates the magnetic bearing and elevation to the vehicle. It then moves43the tracker servos until the antenna (and the AntennaTracker processor) are44aligned with the desired bearing and elevation. At this stage, the antenna is45pointed straight at the tracked vehicle. As the vehicle (and possibly the46antenna mount itself) move around, the servos are continually moved to track47the vehicle.4849AntennaTracker currently only supports closed loop feedback to position the50antenna. This requires that the AntennaTracker processor (including51accelerometers and compass) be mounted on the moving part of the antenna52tracker hardware. The servos are moved until the yaw and pitch of the processor53(and therefore of the antenna itself) matches the bearing and elevation to the54tracked vehicle.5556How does AntennaTracker know where it is on the earth?5758- If the tracker is equipped with a GPS and it has had a good 3D fix, the most59recent good GPS fix is used.6061- If the tracker is equipped with a GPS and it has lost its fix, the most62recent good GPS fix is used.6364- If there is no good GPS fix since startup (either because there is no GPS65equipped or because the GPS has not yet got a fix), the most recently set HOME66location is used.6768- If no HOME location has ever been set in the tracker, 0.0 Latitude, 0.069Longitude, 0 Altitude are used (which is probably not very helpful)7071How does AntennaTracker get GLOBAL_POSITION_INT messages from the tracked72vehicle?7374mavproxy, when it runs the tracker module, intercepts all GLOBAL_POSITION_INT75messages received from its master vehicle, and sends them to the tracker. It76knows how to connect to the tracker with the set port and set baudrate77commands, for example to connect by a USB-Serial radio, such as the 3DR Radio78on port /dev/ttyUSB0:7980(after starting mavproxy)81module load tracker82tracker set port /dev/ttyUSB083tracker set baudrate 5760084tracker start8586Mounting8788The AntennaTracker processor must be mounted on the moving (ie the rotating,89tilting) part of the antenna tracker hardware. Just how you do this will90depend on your exact hardware, but if the processor is mounted in anything91other than the default orientation (ie with the processor default 'forward'92direction pointing in the direction the antenna points, you will have to93configure AHRS_ORIENTATION in the AntennaTracker configuration to suit your94mechanical mounting arrangements.9596In my case, I used a Flymaple with AHRS_ORIENTATION set to 1 (Yaw45). The97Flymaple was mounted on the antenna tracker with component side up and the98green pin headers horizontal and perpendicular to the antenna beam (See99pictures???).100101Configuration102103It is vitally important that your AntennaTracker be properly configured for the104mounting, servos and other hardware in your tracker. Unless you do this IT105WILL PROBABLY NOT WORK AS EXPECTED. CAUTION: It might even oscillate or flap106around. It might even damage itself.107108AntennaTracker (like other ardupilot software such as ArduPlane, ArduRover109etc) has configuration values that control and tailor its operation, and which110are stored in EEPROM on the processor. The configuration is restored from111EEPROM every time the processor starts.112113You can use MissionPlanner, mavproxy or apm_planner or other mavlink compatible114software to check and change the configuration of your AntennaTracker.115116You will almost certainly have to change the following configuration items to117suit, and possibly others besides:118119AHRS_ORIENTATION120RC1_MIN121RC1_MAX122RC1_REV123RC2_MIN124RC2_MAX125RC2_REV126PITCH2SRV_P127PITCH2SRV_I128PITCH2SRV_D129YAW2SRV_P130YAW2SRV_I131YAW2SRV_D132133(more info here about how to find the right values when the setup commands are134available)135136You can find the complete set of configuration items I used for my Flymaple137tracker mounted on an Eagle Tree tracker WHERE?????138139Compass Calibration140141AntennaTracker uses its internal magnetic compass to determine where North is142and therefore where to point for each bearing to the target vehicle. (On other143ardupilot vehicles, the yaw is also calibrated by the current GPS track. This144is not possible for AntennaTracker, so the compass is the only possible source145for absolute bearing)146147The compass magnetometer is exquisitely sensitive to nearby magnetic fields from148wires, metal fittings, servos, radios etc. Therefore is it VITALLY ESSENTIAL that you149calibrate the compass. Further, it must be calibrated outdoors, while installed150in situ in the tracker, with all other equipment installed, fastened down and151ready to operate.152153Failure to calibrate correctly will result in the tracker pointing in the154wrong direction, or the azimuth/yaw and elevation/pitch drifting.155156Use Mission Planner to calibrate the tracker:157- Assemble the completed tracker, complete and ready to operate.158- Power up the tracker159- Connect to it with Mission Planner160- On Mission Planner->INITIAL SETUP->Compass, click on Live Calibration161- click on OK162- rotate the complete antenna tracker assembly around, in 3 dimensions, making sure to163rotate the tracker to every possible orientation in the 1 minute you have164available. DON'T just move the yaw and pitch motors around. You will probably have to165pick the whole thing up.166- At the end of the minute, Mission Planner will update AntennaTrackers compass offsets.167168Leveling169170Since AntennaTracker uses its internal accelerometers (amongst other things)171to determine the current elevation/pitch of the antenna, it is also important172to 'level' the AntennaTracker before use so the accelerometers are173calibrated. Failure to do this will result in the antenna constantly pointing174a bit high or a bit low compared to the tracked vehicle.175176You can do this by connecting to the AntennaTracker with mavproxy and issuing177these commands:178179disarm180- manually move the antenna so the antenna is level and pointing at 0 degrees elevation181i.e. at the horizon182level183- wait a minute without disturbing the antenna position184arm throttle185- this rearms the servos, allowing the antenna to move186187Operation188189<more here>190191After powering up AntennaTracker, it may take up to 1 minute while it192automatically calibrates the compass before it points in the expected193direction. Moving the tracker around will speed up this process.194195How to set the HOME location196197If your AntennaTracker is not equipped with a GPS, you can still use it to198track vehicles. First you will have to tell AntennaTracker where it is on the199ground by setting its HOME position.200201Connect to AntennaTracker with mavproxy202203module load map204- the map will appear.205- Zoom and drag the map until you can see the location where206your AntennaTracker is located207- Click the mouse on the location of the antenna208wp sethome209210AntennaTracker will now remember this as its HOME location whenever it is211started.212213Simulating an antenna tracker214-----------------------------215216To run a full antenna tracker simulation with a simulated APM:Plane as217the vehicle, cd to the ArduPlane directory and run this:218219../Tools/autotest/sim_arduplane.sh -T --aircraft test220221The -T flag tells sim_arduplane.sh to start an antenna tracker222simulator and also start a virtual antenna tracker in a window.223224To start the antenna tracker running run "tracker start" in the225mavproxy window.226227To then connect to your antenna tracker with mavproxy you would run:228229mavproxy.py --master tcp:127.0.0.1:5770230231then you can configure it as needed.232233234