by LB5ZH (Geir Inge) and Andreas G.
HAM radio has a lot to offer, and one of the more exotic items is communication via amateur satellites. AMSAT is a worldwide group of amateur radio operators that design, build and operate non-commercial amateur radio satellites. These are launched as secondary payloads on commercial space missions, and as of now there have been 108 such satellites launched to orbit. Some of these are garage made satellites with software made by volunteer effort and as of now there exists even a geo-stationary satellite. The first satellite were launched back in 1961, barely four years after the launch of Russia´s first Sputnik. These satellites carry the name OSCAR, for “Orbiting Satellite Carrying Amateur Radio”. AMSAT maintains a list of active satellites which can be used for two-way communication.
Most of these satellites are low-powered following a Low Earth Orbit meaning that communication equipment should track the orbit as it passes through the sky in just minutes. It is possible to track the most powerful of these satellites with a handheld antenna pointing in the correct direction, but for best results a multi-element yagi antenna mounted on a computer controlled rotator that tracks the orbit of the satellite is required.
This is part of a student project at TRINT, where one of the students aim to design and build an automatic satellite tracker for two-way radio communication using cheap and available hardware. He has put forward the following criteria:
- Portable. It must be possible to relocate the antenna anywhere without requirements of realignment of any kind. It must be able to use the GPS position and magnetic north automatically. Being portable means mounted on a tripod, and all parts should be easy to split into portable items.
- Automatic. It should be a set and forget solution. With the use of a GPS, Gyro and magnetic compass the software should be able to calculate the position of satellites. A two-axis rotator with motors should then automatically track the orbiting satellite, providing a fully autonomous experience.
- Cheap. No commercial rotators will be considered. This project is a DIY project with parts ordered from eBay, Amazon, AliXpress et.al.
The radio transceiver itself, antenna and computer is considered out of scope. To do all this, the student will have to learn and handle the various aspects of building a micro-controlled device with movable axises, such as:
- Mechanical engineering. Putting together all the parts and make sure the gears, bearings and all the moving parts are working correctly.
- 3D CAD design. Most of the parts are printed on a 3D printer and many of these parts are custom made for this project.
- Basic micro-controller knowledge. What is a digital signal vs an analog. How to control circuits such as the stepper motor controllers. What is the difference of GPIO, I²C and serial connections. Pulling a port HIGH or LOW – what does it mean?
- Basic electrical knowledge. DC-DC converters. Pulling a GPIO LOW by using resistors.
- Using breadboards for prototyping of electrical circuits.
- Understanding the various sensors. GPS position and accelerometer values. Compass heading and the difference of magnetic vs geographic north.
- Soldering skills. These controllers need headers, and they all need to be mounted on a PCB.
- PCB design. We end up creating our own PCB. Know the difference of the different layers of a PCB. Silkscreen vs copper layer and so on.
- Software coding. These controllers need a firmware to tell them what to do.
- Basic knowledge of satellite orbits. Where to find orbital data.
- Basic knowledge of operating a radio to communicate with the satellites. Up and downlink frequencies. How to activate the satellite.
Such a project requires a lot of research and consideration into the design of every part. The following is a list of considerations
- What type of rotator
- What motors (servo, stepper or DC)
- What type of controller for the motors
- Interface to PC
- What kind of commercial antenna
- What type of radio. Two-way or SDR
- What type of software to calculate the orbit and interface the rotator
- Which parts can be 3D printed and what has to be ordered
With some research we found that there already exists several designs for such automatic rotators in the ham radio community.
Clear Sky Institute, Elwood Downey design
Back in 2016 Elwood Downey, WBØOEW, published an article in ClearSkyInstitute with his two-axis autonomous tracker. His design uses two servo motors controlled by an Adafruit Feather HUZZAH (ESP8266). The article mention the previous Arduino Mega as the controller but it has later been updated with the more powerful ESP8266. This ESP has the advantage of built-in bluetooth and WiFi chipsets for computer control making the overall design simpler.
The ingenious with his design is the fully autonomous control of the servo motors. By using a Adafruit 746, a 66 channel GPS sensor breakout, together with the Adafruit 9-DOF absolute orientation breakout, he is able to know the exact position and the orientation of the antenna for a fully automatic computer controlled operation. There is no manual alignment of any kind!
Unfortunately this design has several flaws. First of all, it is not waterproof. Being in this part of the world we need a waterproof design. Neither can it handle big antennas as it will be wobbly. And last, although 2016 is not that old, none of the servo motors used in his design are available. There are of course updated models of the servos available, but being RC type servos these are very expensive. There is also no design for how to put this all together, which is left up to the builder. The accuracy of the rotator is within +/- 2.5° of the orbit.
SatNOGS is an Open Source global network of satellite ground-stations. By using open technologies the project design full ground stations that are globally connected. This enables multiple observers to utilize multiple ground stations around the globe to monitor and download data using autonomous amateur built stations. The data gathered is publicly available through the projects website. The main purpose is to receive telemetry data from Low Earth Orbit satellites using SDR radios free for everyone to use. SatNOGS is part of Libre Space Foundation and has even been used by European Space Agency to gain initial status observations of a CubeSat after launch.
One of the projects of SatNOGS is to build a complete rotator using either stepper or DC motors. The design is made from scratch and utilize 3D printed parts throughout the whole design. It is constantly evolving and version 3.1 is currently in development. Version 3.x is a major redesign over version 2 and version 3.1 aims to be more compact and more accurate than version 3.0. Properly built the accuracy is within +/- 0.5° of the orbit. The rotator is waterproof and can handle big antennas. By using simple stepper motors and 3D printed support the design is relatively cheap.
The SatNOGS design assume that the antenna is stationary mounted, where it has been properly aligned manually. There is no GPS, and no gyro to keep it horizontal, as well as no compass to tell the direction that it is pointing. The controller is custom designed and you will ned to have the PCB printed somewhere and solder on all the components. The Arduino is still the core processor of this design, but will be mounted on the PCB.
The SatNOGS rotator has several advantages, such as
- Cheap, using 3D printed parts and simple motors
We chose to go with stepper motors due to simple design and predictability in software with small discrete steps. If we manage to make use of the Adafruit Motor FeatherWing we can avoid designing our own PCB as everything will be stacked.
As for controller, we will go with both the SatNOGS controller and the design by Elwood Downey. Our primary goal was to be portable and autonomous so we will start with the Elwood design, meaning that we will have to adopt his software to be using stepper motors instead of servos. In addition, the SatNOGS rotator must be enhanced with additional GPS and 9-DOF sensors. Later on, we will add the SatNOGS controller to be able to be part of the global network of open satellite ground stations.
The advantage of using satellites as communication relays is that they are within line of sight of the radio. As such, there is no need for huge antennas, but at the same time they transmit with really low power so it is an advantage to use a narrow beam antenna such as a multi-element yagi. Due to the requirements of a portable ground-station we cannot use a fixed antenna. The antenna elements must be able to be split apart and put in a transportation bag.
Telemetry from satellites usually use high frequencies up into several GHz. On the other hand, communicating through them using them as repeaters are usually performed using amateur radio frequencies in the VHF and UHF band. We want to start using them as communication relays but will most likely add antennas for telemetry reception such as weather images.
We found the Arrow Antenna to be a good performing multi-element yagi and at the same time be portable with transportation bags. Due to our location at 69° north the decision ended on the 14 element Alaskan 146/437-14 antenna.
Ordering the parts
We used PLA 1.75 filament to print most of the parts from the SatNOGS design. We followed the BOM from SatNOGS, with additional Adafruit parts from the Elwood controller design. We ordered the parts according to this list:
- All aluminium parts, screws and nuts from Motedis in Germany. The aluminium frame is ordered pre-cut.
- All Adafruit/Arduino parts from either Tinkerly/ParadiseTronic in Germany, DigitalImpuls, DigiKey or Elfa Distrelec.
- Stepper motors, pulleys and drive belts from GRoboTronics in Greece. They also have a good selection of Arduino.
- Ball bearings, RS Online
- Microswitches, Lemona Electronics in Lithuania (which we ended up not using)
- M3 DIN 914 headless screws from Accu in the UK. They have a good selection of screws, nuts and other hardware.
- All our custom PCB´s manufactured by Elecrow, China.
Building the electronics
We decided to add a 20×4 LCD screen with an I²C controller circuit to make it easier to debug the project. We can for instance print the IP of the built-in web-server as well as the status of the various sensors, GPS and so on. In the field, without a PC connected to the micro-controller such a display will make it all easier to operate.
Adafruit has a full ecosystem of small electronic controllers, and their new feather ecosystem makes it especially easy to create small micro-controller based projects. Pinouts for the various components:
- Adafruit Huzzah ESP8266 baseboard feather
- Adafruit Huzzah32 – ESP32 baseboard feather
- Adafruit Motor FeatherWing
- Adafruit Ultimate GPS
- Adafruit BNO055 Absolute Orientation Sensor
- HW-613/MP2315 mini DC-DC step-down module
Testing the ESP8266 controller
The software is based on the work by Elwood Downey, WBØOEW. We are adding our own code to control the stepper motors as well as status updates on the additional LCD display. Putting it all together using the breadboard for the first time did give us the opportunity to test the software and the various components.
Be aware though, that the software linked to on Clear Sky Institute by Elwood Downey is actually the Arduino Uno based code. Further down, somewhat hidden, but still on that page you will find the code for the ESP8266. The code is good quality and with comments that made it easy to adapt to our needs. It did compile without errors even with the latest versions of the various libraries.
Problems with the design…
Up until this point the software and electronics design from Elwood Downey has been working fine. His design used servo motors that would be impossible to use together with the SatNOGS rotator. We therefor initially decided to use the Adafruit Feather Motorwing motor controller as it is a stacking module to the micro controller which would simplify wiring a lot. However, our first problem came when connecting the stepper motors to this controller. We instantly blew one of the controllers (as seen in the lower parts on this picture), and testing it even further just showed that this motor controller was primarily designed for DC motors and not stepper motors. The steppers did move, but with irregular movements and with a lot of noise. We decided to go back to the drawing board.
Updated electronics components
The controller of choice for stepper motors seems to be the Pololu Allegro A4988 stepper motor driver carrier or the updated and pin compatible Pololu Texas Instruments DRV8825 for high current motors. In our Proof-of-Concept breadboard setup we tested with the A4988 but the final design will use the DRV8825.
Changing to either of these motor controllers imposed another problem with the initial design. These controllers are controlled with GPIO pins where even the microstepping resolution require the use of several GPIO pins. Studying the details and pinouts of the A4988 reveals that we need more GPIO pins than the Huzzah ESP8266 micro-controller have available. This means that we need to abandon the ESP8266 and go with the updated and new Adafruit Huzzah32 – ESP32 micro-controller that offers a lot more GPIO pins. This in turn requires some rewriting of the initial software designed for the ESP8266. Especially regarding the switch from a software based serial pin on the ESP8266 to a proper hardware IO UART on the ESP32 for the GPS NMEA feed from the Adafruit 746 GPS.
Putting this all together requires a lot of wiring which were unnecessary with our initial design. By stacking the micro-controller and using the Adafruit Motor Featherwing we would have avoided most external wiring. As seen on our PoC breadboard setup the number of wires in our new design indicate that we should consider designing our own Printed Circuit Board (PCB) where we can solder these components to get a tidy setup.
Putting together the rotator
All the printed parts must be put together within the aluminum frame with the aluminum tube as the center piece. Following the guidelines in the SatNOGS project page this should be a fairly simple task. Our first hurdle were that the diameter of the aluminum tube were a few micrometers to wide, even though we used the correct part number when ordering it. We could of course print most parts a little bit wider, but we still needed to fit the metal ball bearings. Due to this problem the solution was to use a plastic tube from Biltema. It fitted nicely but will give us other problems due to the soft nature of the tube. We will need to design new parts to make the tube a little stiffer where we mount the antenna and to the base towards the tripod.
Another problem were that some of the printed parts were a little bit too big. The components were so tight when put together that rotating the tubes were impossible. The solution were to cut a few millimeters on the design of some of the pieces and then reprint those. With the modification the tubes rotated as intended. All the moving parts were greased with silicon grease.
Designing new parts
Due to the soft nature of the plastic tube we need to reinforce the tube with printed parts to make it stiffer.
One of the parts must be able to connect the tube with a regular photo tripod in such a way that the whole rotator is stable and don´t rotate at the joint with the tripod. The tripod has a reversible head making the center pole stick upwards. All we need is to make the rotator tube fit on top of that. To do this we used the free version of Autodesk Fusion 360 CAD software to create the 3D design for the piece that we could print on our 3D printer. The Fusion 360 CAD software is not terribly difficult to learn, but spending some time watching instruction videos on YouTube can save you hours of troubleshooting.
The next piece is for the antenna mount. It must be sturdy enough and keep the antenna from moving around the tube based on its own weight. We cut out a small piece of the tube to make a holding point for the antenna mount. The mount must also have space for the gyro and magnetic compass so that we know where the antenna is pointing. There must also be holes for wiring and this whole piece must handle rain without destroying the electronics. This piece was so difficult to design that we felt like experts in Fusion 360 when we finally were finished.
Controller software / firmware
The idea was to use the software made by Elwood Downey, WBØOEW, as-is and without much modifications. As it turned out, a lot of the code had to change. His code were very good and easy to read, which made my work adapting it much easier. First and foremost, we chose to use stepper motors instead of servos. We also added an LCD and we changed the microcontroller to the ESP32. So hardware is very different but we still could make use of his satellite trajectory calculations and the general layout of the code-base. His software provides a brilliant web-interface to configure which satellite to track. Extremely user-friendly.
In the end, we changed the following:
- Ditched his Gimbal class and developed a completely new stepper engine class that controls the stepper motors using two A4988 control circuits.
- Added an LCD class and updated the code all over the place to make status updates on the LCD.
- Updated codebase to work with the ESP32. Only minor changes needed.
- Changed the GPS serial interface from software to hardware driven
- Rewrote the whole EEPROM code to make use of the newer library API. Makes it easier to store persistent configuration between reboots.
- Rewrote the BNO055 9DOF sensor code to make use of the newer library API. A lot easier to interface the sensor, as well as new calibration routines.
- Updated the world magnetic model to adjust the magnetic north towards a more correct geographical north.
As soon as the software is completely finished and without known bugs we will put it out on Github. As it is, the code changes every day as we encounter problems with the hardware. Currently the BNO-055 sensor is giving us headaches as it behaves erratic when calibrated. We might add a separate sensor for magnetic north (azimuth) and use the current BNO-055 for elevation reading. It goes almost without saying, but the stepper engines must be powerless when reading the magnetic north. Otherwise, you will have a big electronic magnet sitting right next to the compass.
We did eventually try with another BNO-055 sensor (as we ended up destroying our first one), from another vendor. Another vendor, another problems. It turns out that even though it is a BNO-055, the physical size were different, the pinout were different, and the axis were different. The compass is better though, and calibrates easily. So the code needs adapting for whatever brand of BNO-055 you are using.
On the same note, we updated the MCU with a newer Huzzah32 – ESP32. Same MCU, but still different. Our first ESP32 were based on the Espressif ESP32-WROOM-32 module, while our latest edition were based on the Espressif ESP32-WROOM-32E. We did not anticipate any difference, but in reality the latest edition were not even able to make the motors turn with the same software running on them. The timing of steps were much more “picky” on the latest ‘E’ edition.
We ended up designing our own Printed Circuit Board. We just had too many wires on our breadboard to continue with such a setup. We chose to use KiCad EDA for the design of the schematics and the PCB itself. We used the latest nightly build of Kicad as it gave us the options we wanted to use. One advantage is that KiCad had all the components in our design in its library. A lot easier to design the PCB with all the footprints already in place.
In the schematics we added two more sensor inputs (in case we want to use for instance a separate compass later), as well as an additional switch input (because we had the port available on the microcontroller). This switch input can be used for a button or whatever we find useful. Also, pinouts for the RESET of the microcontroller, as well as the possibility to turn off power in the DC-DC converter were added. This is the final design:
We had to take great care to create a PCB with only two copper layers. We also wanted the physical dimension to be small enough to fit within the rotator itself. This is our first ever PCB design, but in the end we managed to change the pinout assignments so that we did not have any lines crossing. When we finally sorted out all the different layers of a typical PCB it was quite easy to route the traces and write silkscreen information. We found KiCad to be a perfect tool for this task.
First test run
Even though we have not yet received our PCB we did want to try out the rotator outside and possibly perform a QSO. What we really wanted to test was the performance of the compass in an outside environment. It turned out to be a disaster as the compass were all over the place. We never managed to settle on true north, even though we did countless calibrations. The elevation looks good though. We decided to go back to the idea of using a separate compass, by using a separate BNO 055 in COMPASS mode instead of 9DOF mode. With our initial indoor tests this seems to do the trick.
Pullup on the SDA/SCL lines?
As of this writing, we have the PCB on order, so it is a little late to figure this out. We did encounter strange readings on the I²C bus. It was unreliable when several sensors were connected to the same bus. We might need to add external pullup resistors in the 2k4 to 3k3 range. However, the BNO055 has internal 10k pullups so in theory they should work without the external pullups. The current problem is that we have the PCB over a meter away from the sensors, meaning that we are stretching the limits of the I²C bus length specifications. Apparently this should be at most 1 m, and then you need lower external pullups due to the high internal resistance of the cable (the total resistance will be so high that the line is not pulled reliably HIGH).
The PCB will be mounted internally in the rotator so in practice there is no need for additional lower value resistors to pull the line HIGH. However, it should be noted that for good practice these resistors should be added. We will add them to the next version of the PCB. Neither of us are electrical engineers so this is a bit of a learning experience for us.
The PCB and the final assembly of all electronics
Elecrow manufactured our PCB in record time and we received this wonderful little PCB with place for all our components. No more struggling with the breadboard prototyping, and all the mis-wiring (resulting in some destroyed components). We did not add a fuse on the PCB itself, so please make sure you add a fuse holder on the power supply wires.
With the PCB all our I²C bus problems went away, as all wiring became extremely short. We decided to mount the PCB on top of the rotator by adding another layer of aluminium frames. That way we got plenty of room for the PCB, and we also 3D printed a cover to put over it. We also mounted the LCD on the side, which we find perfect for all that immediate status information.
Never ending story of the magnetic compass
The magnetic compass has caused us the most problems throughout the project. We have tried three different circuits, the BNO-055 (two different brands) and the LSM303DLHC. Endless configurations in software, debugging code and hardware, different placements of the components and whatever else we tried; the compass was erratic at best. The BNO-055 was far better than the LSM303 but that does not help when it wanders around all over the place. No matter how much we calibrated, calculated, taking the average, and whatever else we could think of – the compass was unreliable.
Of course, the stepper motors has to be turned off before reading the compass, and that was easy to control with the Reset line on the A4988. With the power to the motors you have two giant electronic magnets sitting next to your compass, and it will have a fixed direction towards them. Luckily, turning the power off for a few milliseconds was enough for the compass to release its fix on the motors. But still, there is enough magnetic metallic pieces within the rotator to confuse the compass. We tried all possible places within the frame without luck.
We ended up putting the compass within a 3D printed enclosure within an aluminium tube around 30cm above the rotator. We do not even use metallic screws to fasten the compass. With only 3D printed parts and the aluminium tube, mounted this high, the compass was finally reliable. It can now track with a perfect fix on the satellites, without any prior alignment towards north. It is truly portable!
That means that we use two separate BNO-055 9DOF sensors. One mounted on the antenna mount to sense the elevation of the antenna. And the other high above the rotator to measure the azimuth heading. And it just so happens that the BNO-055 can be configured with two different I²C addresses. Perfect!
Another advantage with this setup is that it is easy to field calibrate the compass. Just lift the tube off the electronics cover (where it is mounted) and rotate it in 8-figures. There is no need to move any other part of the setup to gain a perfect calibration.
With all the electronics and compass problems sorted out we finally have a usable rotator that tracks satellites. The software has been cleaned up somewhat, but there are still things that can be improved on that part. As seen in the previous video it was somewhat “wobbly”, and we improved that by using smaller steps on the stepper motors whenever we are closer than 1 degree to the satellite.
We will now focus on the actual downloading of telemetry data and hopefully perform some voice QSO´s via satellite.
Software tools used throughout the project
- Autodesk Fusion 360 (free version) for the design of 3D models
- Ultimaker CURA for preparing and slicing the 3D models for printing
- KiCad EDA for designing the electrical circuits and PCB
- Arduino IDE for the firmware programming
- SDR# by AirSpy for receiving radio signals (Using RTL-SDR R820T2)