Go to file
zisi 02bc01638a Update max speed and home delay due to #19
Signed-off-by: zisi <agzisim@gmail.com>
2018-10-08 16:20:13 +03:00
dc_motor_controller Add doxygen configuration and update source files 2018-07-25 18:51:12 +03:00
libraries Resolve issue with AZ EL command 2018-10-08 15:58:38 +03:00
stepper_motor_controller Update max speed and home delay due to #19 2018-10-08 16:20:13 +03:00
.gitignore Add html doxy files 2018-08-27 16:03:09 +03:00
.gitlab-ci.yml Change the name 2018-08-27 16:40:03 +03:00
CONTRIBUTING.md Update files after gitlab migration 2017-09-19 11:52:47 +03:00
LICENSE New repo for firmware files 2017-07-28 20:29:04 +03:00
README.md Add port pins for ISP programmer 2018-10-08 16:01:06 +03:00
satnogs-rotator-firmware.doxyfile Add doxygen configuration and update source files 2018-07-25 18:51:12 +03:00

README.md

SatNOGS Rotator Firmware

Firmware SatNOGS Rotator Controller.

Repository includes all source files for the SatNOGS rotator controller Firmware.

Electronics can be found on satnogs-rotator-controller

Instructions

In order to use this code, you need to install

You need to choose the version of the Firmware you will be utilizing based on your controller and rotator setup. Namely we have two different versions (one for DC motors and one for Stepper motors).

Steps
  • Download arduino IDE (tested with 1.8.5)
  • Add these lines in /arduino-1.8.5/hardware/arduino/avr/boards.txt
##############################################################
satnogs.name=SatNOGS
satnogs.upload.tool=avrdude
satnogs.upload.protocol=buspirate
satnogs.upload.maximum_size=32256
satnogs.upload.maximum_data_size=2048
satnogs.upload.speed=115200

satnogs.bootloader.tool=avrdude
satnogs.bootloader.low_fuses=0xFF
satnogs.bootloader.high_fuses=0xDE
satnogs.bootloader.extended_fuses=0xFD
satnogs.bootloader.unlock_bits=0x3F
satnogs.bootloader.lock_bits=0x0F
satnogs.bootloader.file=optiboot/optiboot_atmega328.hex

satnogs.build.mcu=atmega328p
satnogs.build.f_cpu=16000000L
satnogs.build.board=AVR_SATNOGS
satnogs.build.core=arduino
satnogs.build.variant=eightanaloginputs
##############################################################
ARDUINO_DIR  Directory where Arduino is installed
ARDMK_DIR  Directory where you have copied the makefile
AVR_TOOLS_DIR  Directory where avr tools are installed
USER_LIB_PATH  Directory where arduino libraries are installed
AVRDUDE  Directory where avrdude are installed
AVRDUDE_ARD_BAUDRATE  Serial Baudrate (uncomment to use 57600 for FTDI)
include  Directory where Arduino.mk are installed
  • Build the code
make
  • Upload using ISP

    • Connect arduino or buspirate for ISP programming

      1. Pin 13 (SCK) to Pin 13 - PB5 of arduino pro mini, ISP connector
      2. Pin 12 (MISO) to Pin 12 - PB4 of arduino pro mini, ISP connector
      3. Pin 11 (MOSI) to Pin 11 of arduino pro mini, ISP connector
      4. Pin 10 (RESET) to Pin RST of arduino pro mini, ISP connector
      5. 5+ (Vcc) to Pin VCC of arduino pro mini, ISP connector
      6. Gnd (Gnd) to Pin GND of arduino pro mini, ISP connector
  • BusPirate

satnogs.upload.protocol=buspirate (in board.txt)
ISP_PROG = buspirate (in Makefile)
make ispload
satnogs.upload.protocol=arduino (in board.txt)
ISP_PROG = arduino (in Makefile)
make ispload
  • Upload using FDTI, but is necessary to uninstall arduino pro-mini from board

Connect FTDI

satnogs.upload.protocol=arduino (in board.txt)
make upload
  • Burn optiboot

Only with ISP programming

* Arduino as ISP
* BusPirate as ISP
make burn_bootloader

Easycomm implemantation

  • AZ, Azimuth, number - 1 decimal place [deg]
  • EL, Elevation, number - 1 decimal place [deg]
  • SA, Stop azimuth moving
  • SE, Stop elevation moving
  • RESET, Move to home position
  • PARK, Move to park position
  • IP, Read an input, number
    • Temperature = 0
    • SW1 = 1
    • SW2 = 2
    • Encoder1 = 3
    • Encoder2 = 4
    • Load of M1/AZ = 5
    • Load of M2/EL = 6
    • Speed of M1/AZ (DPS) = 7
    • Speed of M2/EL (DPS) = 8
  • VE, Request Version
  • GS, Get status register, number
    • idle = 1
    • moving = 2
    • pointing = 4
    • error = 8
  • GE, Get error register, number
    • no_error = 1
    • sensor_error = 2
    • homing_error = 4
    • motor_error = 8
    • over_temperature = 12
    • wdt_error = 16
  • VL, Velocity Left ,number [mdeg/s]
  • VR, Velocity Right, number [mdeg/s]
  • VU, Velocity Up, number [mdeg/s]
  • VD, Velocity Down, number [mdeg/s]
  • CR, Read config, register [0-x]
    • Gain P for M1/AZ = 1
    • Gain I for M1/AZ = 2
    • Gain D for M1/AZ = 3
    • Gain P for M2/EL = 4
    • Gain I for M2/EL = 5
    • Gain D for M2/EL = 6
    • Azimuth park position = 7
    • Elevation park position = 8
    • Control mode (position = 0, speed = 1) = 9
  • CW, Write config, register [0-x]
    • Gain P for M1/AZ = 1
    • Gain I for M1/AZ = 2
    • Gain D for M1/AZ = 3
    • Gain P for M2/EL = 4
    • Gain I for M2/EL = 5
    • Gain D for M2/EL = 6
    • Azimuth park position = 7
    • Elevation park position = 8
    • This reg is set from Vx commands control mode (position = 0, speed = 1) = 9
  • RB, custom command to reboot controller

Controller Configurations

  • Stepper Motor
    • Endstops
    • Encoders, optional
    • UART or R485 (For both options the firmware is the same)
  • DC Motor
    • Endstops
    • Encoders
    • UART or RS485 (For both options the firmware is the same)

Pins Configuration

M1IN1 10, Step or PWM1
M1IN2 9, Direction or PWM2
M1SF  7, Status flag
M1FB  A1, Load measurment

M2IN1 11, Step or PWM1
M2IN2 3, Direction or PWM2
M2SF  6, Status flag
M2FB  A0, Load measurment

MOTOR_EN 8, Enable/Disable motors

SW1 5, Endstop for axis 1
SW2 4, Endstop for axis 2

RS485_DIR 2, RS485 Half Duplex direction pin

SDA_PIN 3, Data I2C pin
SCL_PIN 4, Clock I2C pin

PIN12 12, Digital output pin
PIN13 13, Digital output pin
A2    A2, Analog input pin
A3    A3, Analog input pin

Testing with hamlib - rotctl or with Serial Monitor

Connect the PC with contreller via UART to USB or RS485 to USB by using the right converter (as described in rotator controller BOM). For both options must be soldered the suitable components as descrided in rotator controller wiki page.

Use commands of rotctl:

rotctl -m 204 -s 19200 -r /dev/ttyUSB1 -vvvvv

Replace the /dev/ttyUSB1 with the device which is connected to PC.

Use commands of easycomm 3:

Send directly commands of easycomm 3 as described in Easycomm implemantation section.

Contribute

The main repository lives on Gitlab and all Merge Request should happen there.

License

Libre Space Foundation

Licensed under the GPLv3