Module 4: What are Radio Waves
Radio waves are a type of electromagnetic radiation with wavelengths in the electromagnetic spectrum longer than infrared light.
Radio waves have frequencies as high as 300 gigahertz (GHz) to as low as 30 hertz (Hz).
Radio waves are generated artificially by transmitters and received by radio receivers, using antennas.
Radio waves are very widely used in modern technology for fixed and mobile radio communication, broadcasting, radar and radio navigation systems, communications satellites, wireless computer networks and many other applications.
https://en.wikipedia.org/wiki/Radio_wave#Biological_and_environmental_effects
Modulation
In electronics and telecommunications
In electronics and telecommunications, modulation is the process of varying one or more properties of a periodic waveform, called the carrier signal, with a separate signal called the modulation signal that typically contains information to be transmitted.
For example, the modulation signal might be an audio signal representing sound from a microphone, a video signal representing moving images from a video camera, or a digital signal representing a sequence of binary digits, a bitstream from a computer.
The carrier is higher in frequency than the modulation signal. The purpose of modulation is to impress the information on the carrier wave, which is used to carry the information to another location
https://en.wikipedia.org/wiki/Modulation
Digital modulation techniques
Amplitude Shift Keying (ASK):
- change amplitude with each symbol
- frequency constant
- -low bandwidth requirements
- -very susceptible to interference
Frequency Shift Keying (FSK):
- change frequency with each symbol
- -needs larger bandwidth
Phase Shift Keying (PSK):
- Change phase with each symbol
- -More complex
- -robust against interference

Regulation of radio waves
electromagnetic waves To prevent interference between different users, the artificial generation and use of radio waves is strictly regulated by law, coordinated by an international body called the International Telecommunications Union (ITU).
Which defines radio waves as “electromagnetic waves of frequencies arbitrarily lower than 3 000 GHz, propagated in space without artificial guide”.
The radio spectrum is divided into a number of radio bands on the basis of frequency, allocated to different uses.
https://en.wikipedia.org/wiki/Radio_wave#Biological_and_environmental_effects
United States Frequency Allocations
The Radio Spectrum
ITU Civil UAV Monitoring – PDF Review
www.itu.int
https://www.itu.int/en/ITU-D/Regional-Presence/AsiaPacific/Documents/Events/2018/SMWE-China/Presentations/Day3-1000-1100-Civil%20UAV%20monitoring%20techniques-JiWeilin.pdf
Offline Detection
No Perfect method

Offline Control: Radio suppression
More popular

UAV Frequency Bands
Sat Nav Frequency Bands
Signal Analysis - DJI MAVIC

Signal Analysis - Futaba 433MHz

Arduino PWM - Pulse Width Modulation
https://www.arduino.cc/en/tutorial/PWM The Fading example demonstrates the use of analog output (PWM) to fade an LED. It is available in the File→Sketchbook→Examples→Analog menu of the Arduino software.
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means.
Digital control is used to create a square wave, a signal switched between on and off.

Use of analog output (PWM) to fade an LED
In this graphic, the green lines represent a regular time period.
This duration or period is the inverse of the PWM frequency. In other words, with Arduino’s PWM frequency at about 500Hz, the green lines would measure 2 milliseconds each.
A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on), and analogWrite(127) is a 50% duty cycle (on half the time) for example.

RC radio control protocols explained:
PWM, PPM, PCM, SBUS, IBUS DSMX, DSM2 https://www.dronetrest.com/t/rc-radio-control-protocols-explained-pwm-ppm-pcm-sbus-ibus-dsmx-dsm2/1357
If we want to hack drones, then we need understand how they speak and details of the types of protocols drone receivers could use to talk to the flight controller.
PWM - Pulse Width Modulation PWM has been around for a long time in the radio control hobby and is the protocol that your ESC’s and servos talk to each other on.
The analogue signal takes the form of a pulse, and the length of the pulse represents a specific value, with 1000 being minimum, and 2000 being the maximum value.
PPM - Pulse Position Modulation
PPM is also an analogue signal, but instead of using a separate wire for each channel, PPM stacks each signal one after another to send them all along the same wire.
This makes wiring your R/C Receiver to your autopilot much easier! Other variations of PPM include CPPM, and PPMsum which are slight variations introduced by specific manufacturers.
PCM - Pulse Code Modulation
SBUS - Serial Bus (S.BUS) + IBUS (flysky)
PCM - Pulse Code Modulation
PCM uses the same idea as PPM, but it is a digital signal which improves its robustness to interference and errors as special functions such as parity bits can be included with the signal to ensure it is correct.
Despite this, PCM has not yet taken off as PPM receivers are still much more popular, probably due to the greater availability and lower cost.
SBUS - Serial Bus (S.BUS)
SBUS, as the name suggests is a serial communication protocol. This was introduced by Futaba, but is commonly used by many FrSky products too. In addition to being a digital signal, the main advantage of Sbus is that it can support up to 18 channels using just one signal cable! XBR
IBUS (flysky)
Similar to, SBUS, IBUS is a new digital serial protocol developed by flysky and will be used on many of their new products going forward (such as FlySky FS-i6X)

DSM2 and DSMX - Digital System Multiplexer
DSM was created by Spektrum, with the main feature of DMS2 is that its very robust against noise and interference. This is also a digital protocol.
However when it comes to connecting with your flight controller you need to ensure it support DSM. However most modern flight controllers may already support Spektrum.
DSMX is the new and improved version of DSM2 which improved the reliability.

MAVLink (Micro Air Vehicle Link) Protocol
A protocol for communicating with small unmanned vehicle. It is designed as a header-only message marshaling library.
MAVLink was first released early 2009 by Lorenz Meier under LGPL license.
- MAVLink is a serial protocol most commonly used to send data and commands between vehicles and ground stations.
- The protocol defines a large set of messages which can be found in common.xml and ardupilot.xml
- MAVLink messages can be sent over almost any serial connection and does not depend upon the underlying technology (wifi, 900mhz radio, etc)
The messages are not guaranteed to be delivered which means ground stations or companion computers must often check the state of the vehicle to determine if a command has been executed. https://mavlink.io/
MAVLink and PX4 History
https://auterion.com/company/the-history-of-pixhawk/
The birth of Pixhawk and the open source plan
2009: After working day and night for nine months, the new team won the European Micro Air Vehicle competition in the indoor autonomy category in 2009, with a custom-designed flight controller and flight control code written from scratch, but using open source drivers and frameworks for the infrastructure. The team’s name was Pixhawk, and because they wanted to develop autonomy and computer vision for everybody, they released their software as open source.
Pixhawk software soon began to be adopted. Communication protocol MAVLink was picked up by the open source community and used in other autopilot projects such as AutoQuad and Ardupilot. User interface software QGroundControl came next, but it would take years and two new developers to lead on system architecture before it reached its position in the industry today.
Collaboration helped create a full drone stack
The team partnered with manufacturer 3D Robotics to build and distribute the hardware, and collaborated with ArduPilot to help them run their flight stack on Pixhawk’s PX4 middleware, so users had more choice. The hardware design remained open source and is still hosted on Github.
PX4 is born
2011: The flight control software and the autopilot electronics took longer to perfect. Struggling with architecture that wasn’t right and wouldn’t scale, Lorenz and his team came up with a radical solution. In 2011, they scrapped the software and hardware built in the previous three years and made a complete rebuild from scratch, which solved the issues. The fourth rewrite of the PX flight control software (shorthand for Pixhawk) fina delivered the quality Lorenz wanted, and PX4 was born. Two years later, the firs stable release was unveiled. In parallel, the team developed the first and second generation hardware (Flight Management Unit version 2: FMUv2), called Pixhaw in honor of the student team who began the journey.
MAVLink Message Format

MAVLink 2
https://mavlink.io/en/guide/mavlink_2.html MAVLink 2 is a backward-compatible update to the MAVLink protocol that has been designed to bring more flexibility and security to MAVLink communication. MAVLink 2 bindings have been developed for C, C++11 and Python (see Supported Languages).
The key new features of MAVLink 2 are:
- 24 bit message ID - Allows over 16 million unique message definitions in a dialect (MAVLink 1 was limited to 256)
- Packet signing - Authenticate that messages were sent by trusted systems.
- Message extensions - Add new fields to existing MAVLink message definitions without breaking binary compatibility for receivers that have not updated.
- Empty-byte payload truncation - Empty (zero-filled) bytes at the end of the serialized payload are removed before sending (All bytes were sent in MAVLink 1, regardless of content).
- Compatibility Flags/Incompatibility Flags - Allow for backwards compatible evolution of the protocol by indicating frames that must be handled in a special/non-standard way. (packets with compatibility flags can still be handled in the standard way, while packets with incompatibility flags must be dropped if the flag is not supported).

