Skip to content

Simple python script to send commands to a DiSEqC Motor via audio output. This was designed to control a Sattelite Positioner with a Raspberry Pi.

License

Notifications You must be signed in to change notification settings

MIBismuth/diseqc-audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diseqc-audio

Simple python script to send commands to a DiSEqC Motor via audio output. This was designed to control a Sattelite Positioner with a Raspberry Pi.

Prerequisites

Before running the script, make sure you have the following installed:

  • Python 3
  • wave module (usually included in Python standard library)
  • subprocess module (usually included in Python standard library)
  • play command-line tool for playing audio files (you can install it using a package manager like apt)

Additionaly, you will have to build a Bias Tee circuit and connect it to the jack out of your computer/RaspberryPi.

Usage

  1. Connect the Bias Tee circuit to the jack audio output of your machine and to the coaxial cable of the Sattelite Positioner.

  2. Run the script by executing the following command in your terminal:

    python angle_diseqc.py
  3. Enter the desired angle when prompted.

  4. The script will generate a wave file named binary_wave.wav and play it using the play command.

DiSEqC Protocol

"The DiSEqC system is a communication bus between satellite receivers and satellite peripheral equipment". It works by sending both the $12\pm1V$ DC, to power the motor and all the electronics, as well as a $22 kHz (\pm 20 \% )$ control signal, which should be $650 \pm 250 mV$ peak-peak, on the same coaxial cable. Firstly, we need to understand how to construct the actual message that needs to be delivered.

Data-Bit Signalling

Starting from the smallest element of digital information, data-bit signalling "uses base-band timings of $(500\pm100)\mu s$ for a one-third bit PWK (Pulse Width Keying) coded signal period on a nominal $22 kHz (\pm 20\%)$ carrier". This means that:

  • Bit 0 - $(1.0\pm0.2)ms$ tone, nominally 22 cycles, followed by $(0.5\pm0.1)ms$ of silence

  • Bit 1 - $(0.5\pm0.1)ms$ tone, nominally 11 cycles, followed by $(1.0\pm0.2)ms$ of silence

DiSEqC Modulation Scheme

Message Data Format

DiSEqC messages consist of one or more bytes, with each bit as defined in the previous section, and each byte followed by an odd parity bit . The commands from the master are structured as follows:

Framing P Address P Command P Data P

Basic DiSEqC command structure

To move the positioner to a given angle, the command we want to send is:

E1 P 31 P 6E P E/D XX.X P

Command move to position (hex)XX.X

Looking at what each of those blocks represent:

  • P - Odd Parity Bit;

  • E1 - Framing signalling Command from Master, No reply required, Repeated transmission;

  • 31 - Address of Polar/Azimuth Positioner;

  • 6E - Command Drive Motor to Angular Position;

  • E/D XX.X - E denotes "east of 0" and D "west of 0", while XX.X is the target angle, in hexadecimal.

Audio Signal

In order to generate the control signal, the Raspberry Pi’s built-in audio driver and 3.5mm jack output were used. This might seem like an unconventional decision, but it is actually a solid solution. Audio drivers are generally rated to generate signals with a frequency range of 20-20kHz, the human hearing range, the upper limit of which is our target. Also, the peak-peak voltage outputted is within our desired specifications, as we’ll see further.

This python script receives the hexadecimal string with the instructions and parses it into binary. Next, this bit-data is fed into a function that generates a wav file, using python’s wave module. This is accomplished by sampling a 20kHz sine wave at 198kHz sampling rate, for the right durations and appending it to our Wave_write object. Finally, the wav file is saved and a macro is invoked to play it and transmit the control data.

Figure: Transmitted Control Signal. The data-bit structure is evident in the left figure. The figure on the right shows that the signal has the correct frequency.

Looking at the output signal, the bit-data structure is clearly identifiable (1110111 on this example). Furthermore, upon closer examination of the carrier signal, three notable observations come to light:

  • It is $512mV$ peak-peak, which indeed is within our desired range;

  • It is $19.86kHz$, which is also within our desired range and 0.7% deviated from the expected $20kHz$;

  • It’s arithmetic mean is $1.41mV$, which, given the sinusoidal nature of the signal, results in a near-zero voltage centering.

Bias Tee

As mentioned previously, DiSEqC runs both the 12V DC and the control signal on the same coaxial cable. In order to set this DC bias, a bias tee circuit was employed.

Bias Tee Circuit

Figure: Implemented Bias Tee Circuit. This circuit allows a control signal to be offset by a DC Voltage, in this case 12V

Section of the Signal (All 0 Bits) Close Up of The Signal

Figure: Transmitted Control Signal After Implementing BiasTee. Now the fundamental characteristics of the signal stay the same, but offset by 12V.

Inspecting the signal on, it looks identical to the one on, the only difference being the $12V$ DC offset (the mean is now $12.1V$ instead of $1.41mV$), just as intended.

Authors

  • MIBismuth

References

DiSEqC™ Specification

  • Title: Digital Satellite Equipment Control (DiSEqC™) - Bus Functional Specification (V4.2)
  • Author: European Telecommunications Satellite Organization
  • Year: 1998
  • How Published: PDF document
  • URL: DiSEqC™ Specification

About

Simple python script to send commands to a DiSEqC Motor via audio output. This was designed to control a Sattelite Positioner with a Raspberry Pi.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages