Matik.Org

Moon Pointer Part Three - Hardware

So far, I haven’t talked much about the hardware, and I tried to make due with whatever I had at hand:

Here is a Fritzing sketch: Fritzing schema for MoonPointer

Here’s how I set things up. I’m sure it can be done way way better - I encourage experimentation. Please report improvements in the comments.

  1. Hot glued AZ servo on illy can filled with ballast (I use clock weight for added irony, but you can use sand etc).
  2. Hot glued Meccano strut on on AZ servo horn.
  3. Hot glued ALT servo at end of AZ strut
  4. Hot glued another Meccano strut on ALT servo horn.
  5. taped counterweight (spent aa batteries) on AZ strut. Taped another old battery pack on strut over the AZ servo for additional weighting and dampening.
  6. Placed ESP32, GPS, TM1638 on breadboard
  7. Added horrible cabling (for now). Make sure especially the cables for servo are not too short but also not long enough to get tangled.
  8. Tape ancy pointer cutr from paper to end of ALT strut.
  9. Optional: add Neopixel to end of pointer.

If any of this is unclear, leave a comment.

One word of advice: test and calibrate the hardware before testing the software. I didn’t, and had multiple competing bugs in the angle calculation.

In order to be sure the servos did what I wanted them to do, I wrote a short script to show state on the tm1638 module, and use the keys to change angles. Super easy and helpful! Here’s how to use it:

% ampy -p /dev/tty.SLAB_USBtoUART put servo_callibration.py
% screen /dev/tty.SLAB_USBtoUART 115200
(may have to press CTRL-C)
>>> import servo_calibration

You should see the servos switching to angle 0, then you can use the switches to change them. BTW, you can leave screen by pressing [CTRL-A] [CTRL-\] and confirming with ‘y’.

I also added a script to print output of the servo to the console.

% ampy -p /dev/tty.SLAB_USBtoUART put servo_callibrationgps_test.py
% screen /dev/tty.SLAB_USBtoUART 115200
(may have to press CTRL-C)
>>> import gps_test

If the GPS is properly wired, you should see SOME updates. THe module might take a while getting a fix (minutes or more), and eventually it will update time and location.

Observation:

  1. the servos tend to oscillate a bit (even more than a bit). In order to balance out the weights on the AZ servo arm, I added a counter weight on the end opposite to the one with the glued on ALT servo. Upon changes to the angle the servo can oscillate a few degrees for 10s of seconds before settling down. I have as of yet no good solution. Maybe I just need to add some rubber mounting for the counterweight, or add a larger weight immediately on the servo.

  2. When crossing quarter spheres, either AZ or ALT angles will change 180 degrees instantly. This can jerk the pointer violently around. It would be better to run servo angle changes in an async routine and do them slower (limiting jerk is I think the technical term to use). Not a big problem moving a paper pointer around, but if I try to install an antenna instead, I could be causing problems.

  3. Cabling came loose at least a couple of times. For a permanent installation need to think about how to properly install cables. My method of positioning means I don’t need a slip ring, but something to keep in mind for later.

In the next chapter, we’ll talk about the code to determine moon positions.

Written on July 20, 2020