Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Satellite Antenna Rotator Controller

This Node-RED flow implements a complete satellite antenna rotator controller system designed to run on a Raspberry Pi. It provides manual control, automatic tracking, position sensing, calibration, safety timeouts, and integration with external tracking software via standard protocols.

Overview

The system controls a dual-axis (azimuth and elevation) antenna rotator using Raspberry Pi GPIO pins. Position feedback is provided by analog potentiometers connected through an ADS1115 ADC. The controller supports both manual operation via a web dashboard and automatic tracking based on target coordinates.

Key features:

  • Manual directional control with stop functions
  • Real-time position display with gauges
  • Calibration for accurate angle measurement
  • Automatic tracking with tolerance checking
  • Safety timeouts to prevent mechanical damage
  • Integration with Hamlib/rotctld and GS-232 protocols
  • Email/SMS alerts for timeout events

Hardware Requirements

  • Raspberry Pi (any model with GPIO)
  • ADS1115 ADC module (for position feedback)
  • Dual-axis antenna rotator with:
    • DC motors or stepper motors
    • Potentiometers for position feedback
  • Optional: Serial/USB connection to external rotator controller

GPIO Pin Mapping

Azimuth Control:
- Pin 19: Right rotation
- Pin 6:  Left rotation

Elevation Control:
- Pin 21: Up rotation
- Pin 5:  Down rotation

Software Dependencies

  • Node-RED
  • node-red-contrib-rpi-gpio (for GPIO control)
  • node-red-contrib-iiot2k-ads1115 (for ADC reading)
  • node-red-contrib-ui (for dashboard)
  • node-red-contrib-hourglass (for timing)
  • node-red-node-email (for alerts)

Flow Structure

The flow is organized into several functional sections:

1. Manual Control Interface

UI Components:

  • Direction buttons: Left, Right, Up, Down
  • Stop buttons: Stop Azimuth, Stop Elevation, Stop All
  • Sliders for setting target positions

Logic:

  • Each direction button sends a "1" to the appropriate GPIO pin
  • Mutual exclusion logic ensures opposite directions are automatically turned off
  • "Stop All" immediately halts all movement and disables tracking
  • UI text displays current movement status ("Moving Right", "Stopped", etc.)

2. Position Sensing and Display

Hardware Interface:

  • ADS1115 ADC reads analog voltages from potentiometers
  • Continuous sampling every 300ms

Conversion Logic:

  • Raw voltage → Calibrated angle using linear interpolation
  • Azimuth: 0-360° based on MinAz/MaxAz calibration
  • Elevation: 0-90° based on MinEl/MaxEl calibration

Display:

  • Compass gauge for azimuth
  • Linear gauge for elevation
  • Text displays for current and target positions

3. Calibration System

Calibration Process:

  1. Position rotator at mechanical minimum
  2. Press "Set min Az/El" button
  3. Position at maximum
  4. Press "Set max Az/El" button

Persistence:

  • Calibration values stored in flow context variables
  • Automatically saved to configuration files:
    • /home/pi/MinAz.cfg
    • /home/pi/MaxAz.cfg
    • /home/pi/MinEl.cfg
    • /home/pi/MaxEl.cfg

Startup:

  • Reads calibration files on initialization
  • Debug nodes show loaded values

4. Automatic Tracking

Configuration:

  • Sliders set target Azimuth (0-360°) and Elevation (0-90°)
  • Minimum move distance threshold (default: 4°)
  • Auto-tracking enable/disable toggle

Tracking Logic:

  • Runs every second via inject nodes
  • Calculates angular difference between current and target positions
  • If difference > threshold, initiates movement in correct direction
  • Continues until within tolerance
  • Automatically stops when target reached

Special Functions:

  • "Park" button sets target to Az=180°, El=0°
  • Auto-tracking disabled on timeout events

5. External Protocol Integration

Hamlib/rotctld Emulation (TCP Port 4533):

  • Accepts standard rotctl commands:
    • P <az> <el> - Set position
    • p - Get current position
    • M <az> <el> - Move to position
    • S - Stop movement
    • q - Quit (triggers park)
  • Returns positions in rotctl format
  • Enable/disable via UI switch

GS-232 Serial Protocol:

  • Listens on /dev/ttyS0 at 9600 baud
  • Accepts W commands with azimuth/elevation
  • Responds to C commands with current position
  • Compatible with Yaesu/GS-232 controllers

6. Safety and Timeout Protection

Rotation Time Monitoring:

  • Azimuth timer: Stops if rotation >70 seconds
  • Elevation timer: Stops if rotation >40 seconds
  • Uses "hourglass" nodes for precise timing

Timeout Actions:

  • Automatic stop of all movement
  • Disable auto-tracking
  • Send email and SMS alerts
  • UI toast notification
  • Status display updates

Alert Configuration:

  • Email: (removed)
  • SMS: (removed)
  • Messages sent only once per timeout event

7. Status Monitoring

Dashboard Displays:

  • Current Azimuth (compass gauge)
  • Current Elevation (linear gauge)
  • Target positions (text)
  • Movement direction indicators
  • Rotation timers (Azimuth and Elevation)
  • Auto-tracking status
  • Rotator power status (derived from sensor voltage)
  • Tracking status (from external commands)

Debugging:

  • Multiple debug nodes throughout the flow
  • Can be enabled/disabled as needed
  • Shows intermediate values and command parsing

Installation

  1. Hardware Setup:

    • Connect rotator motors to GPIO pins as specified
    • Connect potentiometers to ADS1115 ADC
    • Connect ADS1115 to Raspberry Pi I2C
  2. Software Setup:

    # Install Node-RED on Raspberry Pi
    bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
    
    # Start Node-RED
    node-red-start
    
    # Import this flow
    # In Node-RED UI: Menu → Import → Paste JSON
  3. Configuration:

    • Ensure /dev/ttyS0 is available for serial communication
    • Configure email credentials in email nodes
    • Calibrate the system before first use

Usage

Manual Operation

  1. Use direction buttons to move the antenna
  2. Monitor position gauges in real-time
  3. Use "Stop" buttons to halt movement

Automatic Tracking

  1. Enable "Allow Tracking" switch
  2. Set target positions using sliders
  3. System will automatically move to targets
  4. Use "Park" to return to home position

Calibration

  1. Position at minimum limit, press "Set min"
  2. Position at maximum limit, press "Set max"
  3. Repeat for both azimuth and elevation

Safety Features

  • Timeout Protection: Automatic stop after prolonged rotation
  • Mutual Exclusion: Prevents simultaneous opposite directions
  • Power Monitoring: Detects if rotator is powered off
  • Alert System: Email/SMS notifications for issues
  • Auto-Reset: Auto-tracking re-enabled every 10 minutes

Troubleshooting

  • No Movement: Check GPIO wiring and pin assignments
  • Inaccurate Position: Recalibrate the system
  • Timeout Alerts: Verify rotation limits are reasonable
  • Communication Issues: Check serial port permissions and baud rate
  • Dashboard Not Loading: Ensure Node-RED is running and port 1880 is accessible

License

MIT License - feel free to use and modify for your satellite tracking needs.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages