MoCoMakers / SolarTracking

1 stars 0 forks source link

[idea] GPS and compass #1

Open yoursunny opened 5 years ago

yoursunny commented 5 years ago

I saw this list on on wiki:

Zeroing the device to true North, based on Magnetic North, Longitude and Latitude. Creating a list of Azimuth points for a time series between a start time, and end time, by a given interval (seconds?) Correct the Azimuth to a device specific angle (the Arduino tracks what angle it’s currently at, after zeroing it) Pipe updated angle and movement commands to the Arduino over the relevant period of time Android to Raspberry Pi Bluetooth connection to share Longitude, Latitude, and time

It seems very complicated!

I'm proposing a simpler architecture. On hardware side,

  1. The turntable control unit has a GPS receiver. It measures location (including altitude) and time.
  2. The turntable has a magnetic sensor (e.g. HMC5883 or LSM303). It is mounted beneath the rotating plate, and measures the orientation in relation to the magnetic north. A "slip ring" is needed to connect this sensor to the control unit.
  3. The control unit could be Raspberry Pi or ESP32.
  4. There's still an Arduino Uno controlling the motor, but ideally the motor can be directly controlled by Raspberry Pi or ESP32.

On software side, the workflow is:

  1. Initialize GPS and wait for initial location and time measurement.
  2. Compute the magnetic declination of the location DEC using World Magnetic Model (WMM).
  3. Transmit a "Z" command to the Uno, putting it to "stopped" state. It does not matter what position is zero.
  4. Read a time measurement from GPS.
  5. Read a magnetic heading measurement H from magnetic sensor. After adjusting with magnetic declination, it indicates that the turntable is pointing to H-DEC from true north.
  6. Compute the solar azimuth angle A. In order to point to the sun, the turntable must be rotated clockwise for D=A-(H-DEC).
  7. Transmit a "B" command with argument D, turning the turntable for D degrees.
  8. Wait for command completion acknowledgement ("-").
  9. Go to step 4.

Design rationale:

Cost estimation of the control unit and sensors:

Regarding ESP32 vs Raspberry Pi (or other single board computer):