Skip to content

Week 15

Week 15 started with some new parts arriving. I was now able to press/melt the insert in the plastic parts (M5 and M6).

Also the air vent arrived and fit perfectly.

Inserts

Because the JST connectors also had arrived, I was able to solder some of them to the PCB and start wiring the M12 connector and the GPS module.

Here is the GPS module mounted to the top of the housing.

GPS

Serial communication

Because the UPDI connection, that is used for programming, doesn't support serial monitor, I wanted to use the UART options of the AVR128DB for debugging. According to the pinout there are several pins that can be used for serial connection and the documentation isn't understandable to me, how exactly it works or has to be set up.

Here is one example of a code and terminal output I tried.

Even though the settings (9600_8N1) correspond to each other - I only get strange symbols and no readable message.

Serial rubbish

I tried several ports, different settings and even SoftwareSerial, but nothing produced any meaningful result.

This troubleshooting consumed many hours without any progress and woke very unpleasant memories from machine week...

I contact my instructor and we met and tried to troubleshoot. We found out, that the logic analyzer does read the signal correctly, both on hardware and software serial ports using the standard settings of (9600_8N1).

However, we couldn't find out what is causing all devices and serial terminals we tried to not read the message correctly. We could rule out the USB-Serial adaptor, serial-cable, computer and software.

This needs further investigation at a later point...

======================

The day after my instructor had solved the issue. It seems to be related to different voltage levels and he found an USB to Serial Adaptor Cable (TTL232R-5V) that could be used to read the message.

The reason for this trouble was a lack of understanding what different serial communication protocols are available and how they work.

RS-232 => I always thought of this as THE serial communication standard and expected the "Serial" of the microcontroller to use this protocol. That turned out to be wrong. RS-232 is a protocol that uses both positive and negative voltage with respect to a common ground in the range of +3 V to +15 V and - 3 V to - 15 V, where logic low is positive and logic high is negative.

TTL => Stands for transistor-transistor-logic. Uses +5 V for logic high and 0 V for logic low. This is what a microcontroller running at 5 V will output, when using the Serial commands.

LTTL => Same as TTL but running on 3,3 V logic high level.

Serial voltage level

Testing and programming

Now, as the serial communication seemed to work, I started writing some test program for the GPS module.

Here is the setup of the housing, with Serial TTL and power connected through the M12 connector and GPS module trying to connect.

Temporary setup

Assembly

By the end of this week I got some more parts. Now the interesting part starts.

I also printed some components for the testing of drive (motor mount, pulley and circular gear).

Parts

Here the timing belt drive is assembled and looking solid.

Timing belt drive

The harmonic drive gear looks good as well, but I made a mistake on the number of teeth in the circular gear and need to add one, because it isn't symetric.

Harmonic drive fit

Note

When unsing the large bearings (61621) they fit where well into the housing / bore, which I dimensioned exactly to 130,0 mm in Fusion, which results in a real dimension of 129,9 mm.

However, the circular gear test piece that was designed to fit in the 105 mm bore of the bearing (and was designed with 105,0 mm diameter) had a real diameter of 104,5 mm so the fit was too loose. I'll have to compensate for that in the final version.