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.
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 likeapt
)
Additionaly, you will have to build a Bias Tee circuit and connect it to the jack out of your computer/RaspberryPi.
-
Connect the Bias Tee circuit to the jack audio output of your machine and to the coaxial cable of the Sattelite Positioner.
-
Run the script by executing the following command in your terminal:
python angle_diseqc.py
-
Enter the desired angle when prompted.
-
The script will generate a wave file named
binary_wave.wav
and play it using theplay
command.
"The DiSEqC system is a communication bus between satellite receivers and
satellite peripheral equipment".
It works by sending both the
Starting from the smallest element of digital information, data-bit signalling "uses base-band timings of
-
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 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.
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.
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.
Figure: Implemented Bias Tee Circuit. This circuit allows a control signal to be offset by a DC Voltage, in this case 12V
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
- MIBismuth
- 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