Skip to content

Week 13 - Mid term review

This week I started by researching different components I need for the final project.

First I made a new project plan and task list:

Week 13:

  • Decide on components and order parts (motors, bearing, encoder, timing belts, pulleys, bearings, special bolts, bearing balls, motor drivers)
  • Test GPS-Module
  • Initial 3D design

Week 14:

  • [] Detailed design of harmonic drive and bearings
  • [] Enclosure design and cable routing
  • [] PCB design

Week 15:

  • [] Testing motors and drives
  • [] PCB production
  • [] Shading arm design finalization

Week 16:

  • [] Improving drives
  • [] Cutting steel plates if needed
  • [] Fabrication of enclosure, base and arm

Week 17:

  • [] Programming
  • [] Testing and debugging

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.

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 motor, 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.

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