Coder Social home page Coder Social logo

ak-homberger / satellite-dish-positioner Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 7.0 5.01 MB

An automatical satellite dish positioner with ESP8266 D1 Mini, compass and MPU.

License: GNU General Public License v3.0

OpenSCAD 69.22% C++ 17.63% C 13.15%
wemos esp8266 satellite dish positioner

satellite-dish-positioner's Introduction

Satellite Dish Positioner

This is an automatical satellite dish positioner with an ESP8266 D1 Mini, a compass and an MPU. It controls the satellite dish direction with a Diseqc rotor (azimut) and a linear actuator (elevation). It uses an gyroscope device for elevation and a compass device for azimut control.

SatPositioner

The purpose of this device is to support me on the boat with the positioning of the satellite dish from the cabin. But it is also usable for campers and mobile homes.

Hardware

The rotor is a standard Diseqc dish motor for less than 50 Euro. But for this project we use the motor upside down to move the dish in horizontal ballance. We have to remove the cranked dish connection tube from the motor. But keep the bolt and the nut. We need them to connect the upper and lower 3D-printed joint parts.

The ESP8266 (in D1 Mini) controls the Diseqc motor with 22 kHz tone signals as defined in the Diseqc specification (see bus_spec.pdf, section 5 and also positioner_appli_notice.pdf). The ESP8266 generates the signal which has to be modulated on the coax signal line of the motor. I found the necessary circuit and signal generator code on GitHub:(https://github.com/acrerd/Arduino-Diseqc-solar-tracker). Many thanks for the helpful support. That saved me a lot of time. For simplification, I only used the right part of the circuit starting with the 100 Ohm resistor. The risistor is directly connected to port D5 on the D1 Mini. This is sufficient to generate a signal that the Diseqc motor is recognising.

22KhZ-Signal

The delay values in the Arduino code ( functions write0() and write1() ) had to be adjusted for the faster ESP8266. The delay with 21 microseconds works perfectly to generate a 22 kHz signal.

The motor gets the 12 Volt power via the coax connection. Be careful with the coax connector when the device is powerd. A shortcut between core and shield would instantly destroy the inductor coil (it can only handle about 300 mA).

The motor is able to move from -75 to +75 degrees with an accuracy of 1/16 degree. That is more than sufficient for positioning the azimut. You just have to position the sat finder in a general south facing direction. Thats all.

The elevation is controlled with a standard small linear actuator which is available for less than 30 Euro. I use here an actuator with 50 mm length. But 25 mm should work also.

In addition to the 22 kHz logic, only four other items are required:

  • Step-down-converter 12V to 5V: D24V10F5
  • Compass: GY-271 from AzDelivery (install QMC5883LCompass library in Arduino)
  • 6 axis gyroscope: GY-521 from AzDelivery (install TinyMPU6050 library in Arduino):
  • Motor driver: Adafruit DRV8871 DC Motor Driver

Be careful with the GY-271 from other sources. Some devices are using a HMC5883L compass instead of a QMC5883L. We need the QMC5883L for this project.

The compass and the gyroscope are connected to the I2C bus of the D1 Mini (using D1=SCL and D2=SDA). The compass is inside the box on the pcb. The gyroscope is connected with a short 4-wire cable and placed on the back of the satellite dish.

The motor driver is using ports D0 and D6. The 22 kHz signal is generated on port D5.

Circuit

Schematic

PCB

Schematics and PCB layout is in KiCAD folder.

Software

The positioner is controlled with a web interface. The ssid and password for WLAN has to be set in the code.

The device is pre-configured for Astra 19.2 and my home location. Please change this for your location and satellite. You can use one of the free calculators to get the angles for your location and desired setellite (e.g. https://www.satlex.us/en/azel_calc.html). Use "Azimut angle" and "Elevation angle".

The true north azimut angle needs to be corrected (Az_Offset) to match the magnetic north of the compass (sailors should know how to calculate) and to correct a possible placing error on the pcb.

The elevation angle must be corrected (El_Offset) with a dish specific value. For my dish this is -18 degrees between dish beam angle and angle of gyroscope mount. The offset has to be calculated only once and defined in the program.

//Enter your SSID and PASSWORD
const char* ssid = "ssid";
const char* password = "passwod";

float Astra_Az = 164, Astra_El = 30.19, El_Offset=-18, Az_Offset=-10.0;   // Astra 19.2 position and dish specific offsets

WebInterface

With the web interface you can control the positioner. You can do fine tuning for azimut/elevation and switch automatic control between Off, On and R-Off.

R-Off means automatic control for azimut is switched off. Elevation remains on. This is a kind of "night" mode because the Diseqc motor is a bit noisy when constantly re-positioning. The "-Step/Step+" buttons are changing the rotor for 1/8 degree. Which should be sufficient for the desired purpose. It is possible to change it also to 1/16 degree.

Values for Azimut, Elevation, Offsets and Motor Speed can be changed with a "Settings" web page. Changed values are stored in flash memory (EEPROM) of ESP8266. With "Motor Speed" you can define the speed of the linear actuator. The value should be about 700 and defines the Pulse Width Modulation for the actuator. If the dish begins to "swing" you can adjust the value to avoid this.

Settings.

To improve the precision of the compass, it is necessary to calibrate the device before using it. To do the calibration, load and run the calibration sketch from the QMC5883L compass library.

During the calibration process the device have to be moved in all possible directions (see library example). It is probably a good idea to do the calibration before placing the pcb on the dish.

The shown six values have to be set in this line:

compass.setCalibration(-1598, 1511, -2365, 872, -1417, 1440);   // Do a calibration for the compass and put your values here!!!

For the MPU there is also an calibration function available. See library for details. But due to the fact that the elevation offset has to be set anyway, it is not necessary to do the calibration for the device, to get the individual offsets.

The following line in the code:

experimental::ESP8266WiFiGratuitous::stationKeepAliveSetIntervalMs(5000);

is part of the internal ESP8266WiFi library. It solves a WLAN connection problem for my router by sending ARP packets every 5 seconds to keep the WLAN connection stable.

If you don't need this, simply comment out the line.

3D Prints

The connection between the sat dish and the rotor as well as the other parts are designed with OpenSCAD. The files are stored in the SCAD folder.

You can either use the .scad files with OpenSCAD or you can directly print the .stl files stored here.

Connection

Back

The GY-521 gyroscope is placed on the back of the dish in a hoizonal position. The compass is on the pcb facing to south direction. For other directions do a correction in the code with "#define Az_PCB_Correction 90". I had to add 90 degrees to get south direction, 180°.

Gyroscope

The connection between the dish and the Diseqc motor has to be very stable. I used 0.2 mm accuracy and 70% fillrate for PLA. Use of ABS is also an option.

Bottom

Bottom2

Top

Parts

  • Sat dish: Link
  • Diseqc motor: Link or Link
  • Linear Actuator (25 or 50 mm): Link
  • D1 Mini: AzDelivery (e.g. on Amazon) Link
  • GY-271 compass: AzDelivery (e.g. on Amazon) Link or Link
  • GY-521 gyroscope: AzDelivery (e.g. on Amazon) Link
  • D24V10F5 Link
  • Adafruit DRV8871: Link
  • Resistor 51 Ohm Link
  • Resistor 100 Ohm Link
  • Inductor 1 mH - BOU RLB0914-102K Link
  • Capacitor 56 nF - RND 150MKT563K2E Link or alternative MKP-X2 56N2 Link
  • Capacitor 3,3 µF - TON 3,3/63 Link
  • Connector 2-pin (*2) Link
  • Connector 4-pin Link
  • DC Jack Link

Updates

  • Version 1.1 - 19.05.2021: Improved 22 kHz signal generation (Issue #5).
  • Version 1.0 - 09.02.2021: Added pcb mount correction value. Release version 1.0
  • Version 0.6 - 05.02.2021: Added settings page and storage of settings in flash memory.
  • Version 0.5 - 07.11.2020: Corrected error in azimut calculation (boundary check 0-360).
  • Version 0.4 - 06.11.2020: Changed PCB layout to version 1.1. Larger terminal strips (5.08 mm).
  • Version 0.4 - 28.10.2020: Added permanent azimut offset.
  • Version 0.3 - 26.10.2020: Separated elevation and elevation offset to work with true elevation angles from calculators.
  • Version 0.2 - 26.10.2020: Initial version.

satellite-dish-positioner's People

Contributors

ak-homberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

satellite-dish-positioner's Issues

AzimutOffset

Im Artikel der Make von 2/2021 steht auf Seite 58 "Die Abweichung für den Kompasswird dann bei AzimutOffser eingetragen". Das hört sich ganz einfach an, ich habe es aber nicht hinbekommen. Habe den AzimutOffset auf 0 gesetzt, habe die Automatik eingeschaltet, gewartet bis sich die Schüssel ausgerichtet hat, dann die Automatik mit R-Off ausgeschaltet und mit SETP+ bzw. -STEP die Schüssel korrekt ausgerichtet. Jetzt wird mir bei Rotor ein Wert angezeigt. Wird dieser einfach als AzimutOffset eingetragen und wenn ja mit welchem Vorzeichen?

Feature request: Add support for GPS module for automatic calculation of sat positioning data from latitude & longitude

Awesome project! I have started to build a dish myself. While looking through my electronics parts box I stumbled upon an old GPS module. To take automation further ahead I would like to suggest adding support for GPS modules. Modules supporting 3.3V TTL level and NMEA protocol (9600bps serial connection if I remember correctly) are readily available at ebay or amazon for around 20€ . With the latitude and longitude determined via GPS it should be possible to calculate the required positioning data (i.e. azimuth and elevation) for the satellite of your choice without having to enter these data manually any more. I could try to find a way to implement such a function myself. But first I need to finish my built with the current version.

code for access point

Hi,
could you please also upload a changed version of your sketch to work as an access point?
I've tried on my own with code samples I've found on several websites but can't get it working. I'm no programmer ;)
This would be very nice of you.
Thanks in advance!

Motoren bewegen sich nicht

Hallo,

ich habe die Platine nachgebaut und bin gerade bei der Inbetriebnahme.

Die beiden Sensorboards sind noch nicht angeschlossen.

Wenn ich im Webinterface auf AutoOFF schalte und die Schieber bewege reagieren die Motoren nicht.

Ich habe auch schon das Signal vom Rotor angeschaut, die Frequenz ist 27khz anstatt 22khz.

Was mache ich falsch?

Viele Grüße
Matthias

Not working :(

Hi,
I've ordered five PCBs at JLCPCB and soldered one of them with the parts.
But almost nothing is working. Automatic mode does nothing.
Tried to rotate the dish by pressing the buttons in the web interface and then the dish is moving in small steps - okay.
But the motor for elevation is not moving when pressing the up and down buttons.
Azimut and Elevation both showing "0.0°" - maybe there is no data from the sensors?
Because I ordered five pieces of every part (except the voltage regulator) I was able to build the whole circuit on a breadboard. But this also doesn't work (same result as before).
I've absolutely no idea what could be wrong. I changed SDA and SCL cables, but it keeps the same result.
In your circuit sheet there is a bridge between GND and AD0 on the gyroscope. Is that correct? I've tried it, but there is still no function.
Maybe I've made an obvious mistake, but I don't know, what it could be.
Thank you for your help.

Use stepper motors instead of Diseqc motors

I have a fully automatic satellite dish, unfortunately with water damage and the electronics are defective.
Now I want to use your solution. Unfortunately I have a stepper motor for each level.
For the elevation I will be able to convert the sketch for a stepper motor. But with the azimuth drive, a lot is done in the Diseqc motor module. I'm not quite sure about that yet.
Is there any further information?
Or do you have any tips for me?
Thanks !!

GY-271

Hallo Andreas,

ich habe bereits bei zwei verschiedenen Lieferanten den GY-271 bestellt, leider ist darauf immer der HMC5883L Chip verbaut, auch bei AZ-Delivery. Nach Rückfrage bei AZ-Delivery wurde mir mitgeteilt , dass sie nur noch den auf Lager haben. Könntest du evtl. den Code so anpassen, dass auch der HMC5883L Chip funktioniert?

Viele Grüße
Matthias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.