Skip to content

Week 13 - Mid term review

This week I started by making a new project plan and researching different components I need for the final project.

Project plan

Project Plan

Encoder

I wasn't sure what the best option would be for the encoder. There are absolute encoders, that use diametric magnets and have a 14 bit resolution, with a stated accuray of 0,2°. I think, I'll give them a try.

Therefor I ordered some A5048B encoders. The difference between the A and B version is that the A version communicates via SPI, but the B version uses I2C. I2C requires fewer wires and I have worked with it before, that's why I went for the B version.

Motor

To keep things simple I decided to go for a stepper motor of NEMA 17 size. There are many types to choose from with different specifications. I ended up selecting a rather powerful, but yet compact motor.

Here are the most important specifications:

  • Step angle 1,8°
  • Rated current 1,5 A
  • Holding torque 0,4 Nm

Datasheet

Timing belt

I researched on belts for a harmonic drive, as I don't want to trust on 3D printed plastic for the strain wave gear. Also I think my gear might profit from another stage to further increase the torque and slow down the rotation.

My best guess was to go for a first stage from a 16T sprocket on the stepper motor to a 147T pulley on the harmonic drive input.

\[i_1 = 147/16 = 9,1875\]

I'll use a GT2 belt with 6 mm width and 356 mm length for it, to get a decent engagement angle and axes distance.

The second stage will be the harmonic drive itself. I found a 15 mm wide HTD3M timing belt with a length of 291 mm (pitch 3 mm = 97 teeth). Assuming that the circular gear will have two more teeth then the flex gear, the ratio calculates as follows:

\[i_2 = T_f/(T_c-T_f) = 97/(99-97) = 48,5\]

Together both gears will result in a total ratio of \(i=445,59375\).

GPS-Module

I had a cheap GPS module breakout board (NEO 6M) at home, that I tested. I used the XIAO ESP32-C3 and this tutorial to get started. However, I had to adopt the code a bit to get it running on the XIAO board.

Here is the code that worked for me:

/*********
  Rui Santos & Sara Santos - Random Nerd Tutorials
  Complete instructions at https://RandomNerdTutorials.com/esp32-neo-6m-gps-module-arduino/
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/

#define GPS_BAUD 9600

// Create an instance of the HardwareSerial class for default Serial (Pin 6 and 7)
HardwareSerial gpsSerial(0);

void setup(){
  // Serial Monitor
  Serial.begin(115200);

  // Start Serial 2 with the defined RX and TX pins and a baud rate of 9600
  gpsSerial.begin(GPS_BAUD, SERIAL_8N1, -1, -1);
  Serial.println("Serial 2 started at 9600 baud rate");
}

void loop(){
  while (gpsSerial.available() > 0){
    // get the byte data from the GPS
    char gpsData = gpsSerial.read();
    Serial.print(gpsData);
  }
  delay(1000);
  Serial.println("-------------------------------");
}

Then I hang the the GPS out of the window and waited for a long time.

GPS module with antenna

Note

I think Iceland isn't in a good position for GPS satellites, but this module uses only GPS - no other GNSS satellites, so that might be the reason, why it took over one hour to finally aquire a position.

Here is the terminal output of the message in the NMEA format.

NMEA message

I also checked the next example, which includes the TinyGPSplus library to decode the message and make it easier to work with it.

The adopted code looks like this:

/*********
  Rui Santos & Sara Santos - Random Nerd Tutorials
  Complete instructions at https://RandomNerdTutorials.com/esp32-neo-6m-gps-module-arduino/
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/

#include <TinyGPS++.h>

#define GPS_BAUD 9600

// The TinyGPS++ object
TinyGPSPlus gps;

// Create an instance of the HardwareSerial class for default Serial (Pin 6,7)
HardwareSerial gpsSerial(0);

void setup() {
  // Serial Monitor
  Serial.begin(115200);

  // Start Serial 2 with the defined RX and TX pins and a baud rate of 9600
  gpsSerial.begin(GPS_BAUD, SERIAL_8N1, -1, -1);
  Serial.println("Serial 2 started at 9600 baud rate");
}

void loop() {
  // This sketch displays information every time a new sentence is correctly encoded.
  unsigned long start = millis();

  while (millis() - start < 1000) {
    while (gpsSerial.available() > 0) {
      gps.encode(gpsSerial.read());
    }
    if (gps.location.isUpdated()) {
      Serial.print("LAT: ");
      Serial.println(gps.location.lat(), 6);
      Serial.print("LONG: "); 
      Serial.println(gps.location.lng(), 6);
      Serial.print("SPEED (km/h) = "); 
      Serial.println(gps.speed.kmph()); 
      Serial.print("ALT (min)= "); 
      Serial.println(gps.altitude.meters());
      Serial.print("HDOP = "); 
      Serial.println(gps.hdop.value() / 100.0); 
      Serial.print("Satellites = "); 
      Serial.println(gps.satellites.value()); 
      Serial.print("Time in UTC: ");
      Serial.println(String(gps.date.year()) + "/" + String(gps.date.month()) + "/" + String(gps.date.day()) + "," + String(gps.time.hour()) + ":" + String(gps.time.minute()) + ":" + String(gps.time.second()));
      Serial.println("");
    }
  }
}

And here is the easy readable data output in the Serial Monitor:

GPS data

Note

The HDOP value is an indicator for the accuracy of the position. A value > 1 indicates rather low accuracy. That is however not strange, because the antenna was blocked by the building one side and blocked up to around 15° by the surrounding mountains.

This looks all very promising and I will continue with this module and use it for my final project, but maybe with an external antenna.

Shading sphere

Because I had some time, but my brain was tired, I went for an easy task and drew the shading ball, that would fit on a 12 mm rod.

The diameter is derived from the model of a commercial sun tracker, with a distance from the sphere to the sensor of 700 mm.

Then I 3D printed the sphere and here it is:

Sphere

3D design

I spent quite some time on the long weekend to catch up with the final project.

The main focus was on the 3D model. Here is the 3D viewer of the status by the end of week 13.

The approach I choose was to make almost all parts fully 3D-printable from PETG on a Pruse CoreONE (250 x 220 x 270). This allows for rapid prototyping and easy reproduction. I selected standard bearings and belts and tried to place all components into a splithousing, so both motors, encoders and PCB will be inside the same housing and assembly should be relatively easy. The two halves of the housing, as well as a maintenance lid, are sealed with standard o-rings and I incorporated a breather plug to allow air expansion and moisture do be vented. All bolts are made from stainless steel A4-70.

In some places I used heat inserts for plastic.

The most challenging part of the machine will be the harmonic drive. For that reason, I can print the both the upper and the lower half of the housing first. These parts take also the longest time to print. Then, when the parts for the harmonic drive arrive, I can print them and iterate if needed within a relatively short time range.

Here is a section view of the machine.

Section View

Kinematics

After doing some review of the deisgn, I spotted, that the movement of the sphere might be less then ideal. The commercial sun trackers often feature a parallel-motion linkage, to keep the sphere in an equal distance from the sensor.

I went back to the sketchboard to update my design.

In this sketch I determined the length of the different links, to be able to reach from 0° to 90° azimuth, utilizing the carbon rods I had available.

Linkage

On the next picture I finished the design of the linkage. Next I'm going to print some test pieces, to see how much play is in the joints.

Linkage designed