Birth of the 32bit RS232 spectrum analyser

It is time to revisit the RS232 spectrum analyser. Below is an image of some prototyping on a breadboard followed by a soldered working version including an SMA connection. The problem with the previous spectrum analyser was mainly in the computation of the frequency set registers which involved large 9 digit values, a hard feat for an 8-bit microcontroller. This time around a 32-bit microcontroller, the PIC32MX220B032 will be used. This will allow for a maximum clock frequency of 50MHz leaving the radios internal frequency settling time as the only limiting factor to the spectrum analyzer sweep time. The proposed specification for this spectrum analyzer is as follows:

  • Bandwidth 260MHz – 960MHz (Realistically about 150MHz according to the input filter of the RFM22B model used)
  • 2ms per sample
  • Sweep and Discrete measurement modes
  • Calibration mode (Calibrates the device with the help of a sweeping signal generator)
  • Wireless trace measurement (Two devices needed, one as a base station)
  • SD card for onboard storage and buffering
  • Connectivity – FTDI cable and rasberrypi GPIO connector header
  • Form factor: 1 square inch

    Breadboard prototyping of the 32bit spectrum analyser

    Breadboard prototyping of the 32bit spectrum analyser

Quadcopter First Successful Loiter…

After the vibration issues were sorted out it was time to test the loiter and auto modes. A video of the first successful loiter test can be seen below. The APM 1.0 seems to hold its position reasonably well given that there was a slight breeze that day. The quad-copter was also instructed to land in loiter mode. The video was taken behind our engineering building at Stellenbosch University. We have also tested the auto mission, takeoff and landing successfully.

The new motor mounts were made by Johan Frank from Malmesbury on his own CNC machine with simple number-plate plastic. These new motor mounts are much less brittle and therefore much stronger than the original perspex parts.

Maiden Flight….

After the quadcopter was fully assembled including ESC’s, accelerometers and radio calibrated it was ready for its maiden flight. This flight was carried out at the back of our Engineering building, Stellenbosch, on an insufficient piece of grass. A short video from the flight can be watched below.

After some time flying the altitude hold function was tested which seemed to work. However, when testing the second time and switching it off, the throttle was in a lower than hover position, causing the quad to come down hard. This caused three perspex motor mounts to be snapped off. Luckily this exposed some weaknesses in the frame. The motor mounts will now be manufactured from a slightly less brittle plastic. Ignoring human error (first ever flight) the quadcopter flew excellent the first time.

Bad Vibrations…

After a number of flights in stabilize mode with a very stable vehicle, it was decided to test the rest of the flight modes. Our goal was to build this into a measurement platform which necessitates the use of the auto modes. Therefore, we went to an open test field near Stellenbosch where we switched the quadcopter to loiter mode. The latter action caused the quadcopter to ascend at full throttle with no sign of stopping. After landing and trying again the same thing happened.

After this slightly unsuccessful test, I learned that in the newer APM firmware versions vibration can be an issue and can cause the observed behaviour. I decided to start eliminating all the vibration I could find. Starting with the motors I measured the vibration with an app called “vibration on my iPhone”. Spinning each motor independently while strapping the phone onto the motor arm I could monitor the intensity of the vibration and start balancing the motors in the same manner as the video I found below.

After some experimentation, I realized that the motors without any nut and spinner were perfectly balanced, however, as soon as the spinners are added it would put the motor extremely off balance. As a result, I balanced each spinner with a piece of tape, much like they balanced the motors in the video. This meant I now had 4 non- vibrating motors. At this stage, I did not have a prop balancer and had to hope my cheap colourful gem-fan propellers were reasonably balanced.

To actually test if there were any relative improvement I enabled the IMU data logging onboard the APM. I downloaded the log after each change to relatively measure what performance difference the modification had.

It can be seen in the comparison that there was initially also some experimentation with different APM mountings such as being screwed down, double-sided tape, moon gel pads and lastly, the configuration that is still being used, dampening pads below the entire electronics platform. Remember that these modifications were done before balancing the spinners, note that it almost seems as if the vibration got worse with the different platforms except the moon gel. It should also be stated that with the new dampening pads the whole layout of the vehicle was changed. A motor which was slightly damaged in the previous crash was also replaced with more negative results. However, balancing the prop spinners and propellers showed a slight decrease in vibrations as seen in the graph below. Something weird was noticed when balancing the gemfan propellers, it seemed that they would be heavier on one side of the hub. It was here that I decided to invest in more expensive APC propellers which as you can see made a huge difference and finally enabled loiter and the auto modes to work flawlessly.

Relative vibration comparison

Relative vibration comparison

Motors and final assembly…

After a long break moving to another city, I restarted my efforts on the quadcopter build. This time adding the motors and finalising the construction to the point of a maiden flight. Some changes to the previous thought process were incorporated: channelling the high current ESC wires through the aluminium tubes. The latter meant disassembling the whole quadcopter.

The motors are 800kV tiger motors which will each, in turn, need to drive a 10×4.5inch prop. The motors can be seen mounted on the edges of the quadcopter with their cabling running through the aluminium tube into the centre plate cavity. Next, the power distribution board was fastened on top of the centre plate with the help of plastic screws. This allowed the ESC’s to be installed connecting all four motors allowing some initial testing. To test the motors, the battery and PWM lines were connected to the distribution board and receiver module respectively. After confirming all four motors are spinning their directions could be set as illustrated in the APM wiki. The connections for the power distribution board can be seen below. The ESC PWM wires will need to be shortened, in the current configuration they will cause horrific RF pickup loops.

ESC’s and PDB mounted

With power and PWM connections to the motors now established the remaining electronics can be added to the build. The APM, telemetry radio and receiver are all now mounted on a platform and connected. This platform is part of the frame and will fit right above the distribution board. The electronics platform can be seen below.

img_1469

Assembled electronics platform

After the electronics platform has been fitted, the shell containing the GPS and the landing gear was attached. Before mounting the props the ESC’s needed to be calibrated, which on stock settings were remarkably different from one another. Due to some physical restrictions, the quad is currently configured in a plus orientation which might be changed in the future. The quadcopter with its props can be seen below next to its 9x FrSky remote.

img_1546

Full Multicopter Build

 

 

 

Assembly of Power, Sensors, and Communication…

Before being able to do some wireless tests, the sensors and telemetry radio need to be powered. In this first phase of assembly, the power distribution board, IMU board along with the telemetry was mounted on the frame. Thereafter a single electronic speed controller was connected to power the IMU board and radio. As of now, the quadcopter is fully wireless and self-powered.

assphase1

Motorless self powered quadcopter

 

Graphical User Interface v1…

Here are some screenshots of the spectrum analyser graphical user interface. Please note that the levels shown have not yet been tested with proper equipment. Proper tests and calibration will be done in the next hardware iteration.

Spectrum profile of a car remote

Spectrum profile of a car remote

Spectrum profile of a FSK 12.5kHz Trunking Control Channel

Spectrum profile of an FSK 12.5kHz Trunking Control Channel

The Compass…

Another sensor needed during navigation and control was added to the IMU board. This sensor, a magnetometer, is responsible for measuring the orientation using the earth`s magnetic field. In a plane setup, the current heading can be easily determined by making use of consecutive GPS measurements.  On the other hand, a quadcopter does not need to stay moving all the time and therefore needs a sensor that is able to measure its heading while hovering.

The compass is mounted to an I2C channel on the top of the IMU board. Seen as a small extra daughter board. Running the mission planner command line interface some data was gathered to prove that the compass is functioning correctly.

Command Line Interface magnetometer test data

Command Line Interface magnetometer test data

GPS Take 2…

A new GPS arrived today, all the way from 3DRobtics, as a replacement for my previously dead on arrival GPS unit. This time around the GPS worked as soon as it was plugged in and even started acquiring satellites from indoors.

RS232 Spectrum Analyser

This project came from the idea that I needed a simple, light spectrum analyzer which could be easily interfaced to embedded applications. This design was a proof of concept which made use of an RFM22B radio module and a PIC16F690. A simple GUI was also constructed for initial testing purposes. Photos of the prototype can be seen below. Source code for the proof of concept can be found downloaded here:

Visual C# Project

MPLab Project

Pic kit 2 Logic Analyzer tool output for a SPI command to the RFM22B

Pic kit 2 Logic Analyzer tool output for a SPI command to the RFM22B

The next post will contain some screen shots of the GUI in action.