Tuesday, July 25, 2017

Spartan Superway 2017 Summer - Week 8

July 17 - July 21

This week was spent assembling the second bogie and connect the second DC motor and stepper motor to the relays and Arduino. I noticed some wires didn't have good connections on H-bridge circuit, and I had to fix them by checking how the connections were supposed to work through the Arduino. For example, 8 wires from 8 pins on the arduino didn't match up to the appropriate relay inputs. I had to shift the outputs from the ULN 2803A Darlington Transistor Array to match the inputs on the relay board.

Also during this week, I constructed a circuit to regulate voltage taken from the batter/wayside power into 5V for the Arduino (Figure 2). I used R1 = 470 Ohms and R2 = 1.5k Ohms.

This is my last week and my last day is Tuesday, July 25, 2017. Monday and Tuesday will be spent continuing debugging the assembled bogie with steering and propulsion/braking system.


Figure 1. SainSmart Relays H-bridge (From Google Images)

Figure 2. From LM317 Datasheet

Monday, July 17, 2017

Spartan Superway 2017 Summer - Week 7

July 10 - July 14

This week, I spent most of the time reviewing the code to make sure it works properly. I didn't start designing a 3D printed case because another intern was assigned to do it. On friday, we started to assemble the bogie and test the code on the already assembled bogie. However, we ran into a couple of problems during testing.

When we ran the code without turning on the AC/DC converter, the code ran as expected. When we plugged in the AC/DC converter, the hall effect sensor triggered the interrupt when there wasn't a magnet present. We suspect it was due to interference coming from the relay, converter, bad wires, or the motors. It created a lot of frustration, and took us all day to try and figure out what was wrong. At the end of the day, we cleaned up the shop and made it tidy for the Automotive Open on Monday.

Next week, we will finish assembling the bogies and try to test them on the track. Hopefully we can also fix the hall effect sensor problem as soon as possible.

Saturday, July 8, 2017

Spartan Superway 2017 Summer - Week 6

July 5 - July 7

This week, I finished soldering the hall effect sensor circuit to a small protoboard which will be easily attached to the body of the bogie using double sided tape. Then I started planning out how to get power from the LCD shield of the Arduino to power the low pass filters of the eight switches, the hall effect sensor, and the 9 degrees of freedom (DOF) accelerometer-gyrocsope. The accelerometer-gyrscope sensor will be used for correcting the tilt of the bogie on sloped tracks.

At first, just attaching two more wires from the 5V and GND pins to the LCD shield caused a cold joint and the shield didn't turn on. Then I decided to attach wires from the switch-protoboard to the hall effect sensor, and it worked better. Next, I'll attach wires from the 3.3V pin of the Arduino-LCD shield to power the accelerometer-gyroscope. 

Also, I learned how to use the accelerometer-gyroscope by using the analog pins to read the signals the accelerometer sends in the X, Y, and Z axis. From these signals, I found an equation online to convert the raw data into degrees of how far the sensor is tilting. Afterwards, I used the new values in conditional if statements to show the instructions to be executed at certain angles. At certain ranges of degrees, the Arduino will turn on specific LEDs to represent the instructions. What we expect the Arduino to do is that it will continuously read the sensor. Then, if the Arduino reads a change in degrees or if the degrees isn't nearly zero, it will turn on the DC motor of the tilting mechanism until the sensor says zero again. 

Next week, the team should be building a test rig to demonstrate the tilting system and debugging the code to make sure it works correctly.