Progress Report for Hengyi Lin

Week 2:

Date: September 1, 2017
Total hours: 10
Description of design efforts:


My work this week and last week was mainly getting familiar with the STM32F4 discovery board. I learned how to use STM CubeMX and Keil MicroVision to program the STM32F4 discovery board from my teammate and the team leader, Chia-Hua. When I first got familiarized with all the operations of STM CubeMX and Keil MicroVision, I started programming the microcontroller and explored the system clock configuration, the GPIO pins, the timers, the PWM peripherals and the interrupts.


During the programming process, I faced a lot of problems such as not being able to find the library, not being able to open the debugger and failing to load certain files. After several trials by myself and cooperating with Chia-Hua, I managed to resolve all of those problems and achieved the expected results.


My goal next week is to explore the PWM output again to generate a PWM output waveform and display it on the oscilloscope. This is a very crucial part before putting the vibration motor into testing.


Week 3:

Date: September 8, 2017
Total hours: 10
Description of design efforts:


Originally my work this week was to create a simulated haptic waveform using the PWM outputs of the STM32F4, but I tested the linear actuator first. Unfortunately, the testing did not go very well since the handle on the actuator only slided in one direction but did not slide reversely.

Linear_Actuator_1


In order not to slow down the project process, I tested the the normal micro servo motor on Arduino first. I'm currently looking up the servo library and finding a way of attaching the servo motor to the STM32F4 microcontroller.

Servo_Motor_1


Meanwhile, I learned the technique of soldering a row of small pins from Joe, the lab engineer. Using flux and the knife-shape soldering pen, I don't need to solder the pins one by one carefully and this is very useful to me in the future.


Besides looking into the motors, I also analyzed each component of the whole device and considered the requirements and tolerances of them so that our group will have a better idea of the voltage we'll be using and the overall power consumption. After careful considerations, we decided that we should need two voltage sources, one for the linear actuators and the other for the rest of the components. Also, we figured out that the vibration motors need a haptic drive to connect to the microcontroller instead of direct connection.


Here is the diagram showing the connectivities among all components. A more detailed analysis is shown in the electrical overview document being submitted next week.

Electrical_Overview_Diagram_1


My goal next week is to investigate more about the vibration motors and to debug the inablity of the reverse sliding of the linear actuators. Meanwhile, I will still need to figure out the way to program the servo motors in STM32F4 microcontroller. In addition, before proceeding to the vibration motors, I need to test the haptic drive and that will be my mission next week as well.

Week 4:

Date: September 15, 2017
Total hours: 10
Description of design efforts:


This week I focused on debugging the linear actuators that was unable to slide in the reverse direction in the last week. I guess the reason was the wrong connection of the ground and the signal wire. Therefore I coded a simple servo motor program on Arduino using an SG90 servo motor and then switched back to the linear actuator. It worked successfully but some values of the angle parameter in the servo motor exceed the range of the linear actuator and hence I shrunk the range of the "angle" values to ensure the handle slid within range.

Linear_Actuator_Testing_1
Linear_Actuator_Testing_2


In addition to the testing and debugging of the linear actuator, I also tested the DRV2605 haptic driver and the LRA vibration motor to figure out the closest feeling of collision and friction after Chia-Hua finished the initializations and configurations of the DRV2605 haptic drive. At first we didn't know the exact register to be modified to alter the waveform pattern and therefore we decided to look up the datasheet and the open-source code example. While reading through the datasheet, we found an effect library with 123 different vibration patterns. Using that library, we tested out the vibration that is the closest to the feeling of collsion.

Effect_Library_1
Effect_Library_2


The effect library can be found here.


As Chia-Hua suggested that we send haptic commands through the serial monitor to the Arduino, we wrote different functions corresponding to different effect values that simulate various feelings. I simulated three different collisions: strong collision, mild collision and weak collision.

Vibration_Motor_1
Vibration_Motor_2


Meanwhile, as a backup plan, I also tested the MPU6050 acclerometer + gyroscope.

MPU6050_testing


Besides the lab testing work, I continued working on the electrical overview after having created the overall diagram last week. I looked up the datasheets of different components and calculated the power dissipation of each component. This is the list of parameters of each component as well as the power consumptions.

parameter_list


I will continue working on the simulation of friction and shear force in the next week.

Week 5:

Date: September 22, 2017
Total hours: 7
Description of design efforts:


This week, as my other teammates are designing our main PCB board, I helped ordering more necessary accesories online so that we are able to do more testing and prototyping before submitting our final PCB sketch to the manufacturer.

Components_Table


As for the friction and shear force simulation mentioned in the last week, due to the inablity of simulating a proper feeling for the linear actuator, a mechanical structure involving a servo motor and a rope and spring is adopted.


Here is the preliminary structure on which all four members agreed.

servo_with_rope


Therefore, I downloaded Google SketchUp and created some simple 3-D objects to prepare for future development of the preliminary structure. During the creation of the objects, I familiarized myself with the basic operations of SketchUp such as orbit, zoom and pan. I got used to the operation of creating simple shapes of some specifications and turning that 2-D object into 3-D using various tools. Here is one arbitrary object I created.

Random_Model


My job next week is the research on more complicated SketchUp creations and the combined mechanical structure of both the servo and the rope and spring.

Week 6:

Date: September 29, 2017
Total hours: 8
Description of design efforts:


Since the small PCB of the ADXL accelerometer has arrived this week, all four members of our group decided to work on the soldering and the testing of the small PCB first. We worked with the lab engineer Joe to solder the raw chip of the ADXL345 accelerometer onto the PCB. We learned about the appropriate position and amount of flux and solder when soldering raw chips of 14-terminal LGA packaging. After the raw chip connection, I was responsible for the header pin assembling using a knife-shaped soldering gun and flux and its connectivity testing using the ohmmeter.

PCB_Soldering


Besides the ADXL345 PCB, I also worked with Chia-Hua and Lingke on designing the main PCB board layout using Eagle. As I only helped to check if the routing on the layout corresponds to the schematic, I'm going to learn how to use Eagle to create a layout of the PCB during the weekend.


However, when we were discussing about the routing of the main PCB board, we found that STM32F4 microcontroller has a lot of pins. Therefore, as a backup plan, I decided to test a microcontroller with fewer I/O pins. I picked STM32F1 microcontroller and implemented the simple program of flashing LED as I did for STM32F4. I also learned how to program the microcontroller an external ST-Link.

STM32F1_Flashing_LED_Code

ST_Link_with_F1


Meanwhile, the IDE software we are currently using might trigger some problems regarding the equipment recognition. Inspired by the instructor, I decide to test the microcontroller using Eclipse in the next week.

Week 7:

Date: October 6, 2017
Total hours: 8
Description of design efforts:

As mentioned in the last week's report, I tested the flash LED program on Eclipse on my own personal computer, but unfortunately, due to the incomplete library and software installation of the corresponding Eclipse-based software, the debugger encoutered compilation problem during the debugging. Here shows the Eclipse interface of the program.

Eclispe-code

Meanwhile, I found that the previously tested vibration motors were very weak and the feeling of this vibration cannot simulate the real feeling of the collision of swords. Therefore, I wondered if the vibration motor can be connected without the haptic driver. The screenshots of key segments in the code are shown below. The purpose of using the haptic driver is offering multiple vibration patterns by only altering one register value, but in our project, we can simply change the value of the PWM register because the only virtual feeling simulated by the vibration motors is the collision of swords.

Motor-without-driver
Motor-code-1
Motor-code-2
Motor-code-3

Besides testing the backup programming IDE and improving the haptic experience, I also helped Lingke and Chia-Hua to verify the connectivity of the main PCB. Continuing from what I learned last week about the basic operation of moving the parts around, I learned the method of creating a layer and the way to revert that if anything has been done wrongly. I also learned that the PCB should have one layer of GND and one layer of input voltage so that debugging the missing capacitor or resistor would become more convenient.


For the next assignment I'll design the rough draft of the main joystick of the virtual sword with Chia-Hua since we know the approximate size of the main PCB board.

Week 9:

Date: October 20, 2017
Total hours: 13
Description of design efforts:

Last week was the midterm presentation week, but when the week ended, I started to work on the 3-D model designing with Chia-Hua. According to our PCB designer Lingke, the size of the board is approximately 64mm by 62mm. Therefore, we drew the top surface of the handle box as 90mm by 70mm with an open "window" in which the PCB board can fit. We took careful considerations and measurements to ensure the followings:

  • Each electrical component fits in the internal space of the handle
  • Each component of the handle is connectable with another
  • Each component of the handle is 3-D printable with no errors

While he was drawing the handle components, I helped him to measure the dimensions of individual electrical components and to consider the appropriate deviation. Here are some photos of the handle prototype:

Model-view-1
Model-view-2

Meanwhile, we found that the sliding handle of the servo mechanical structure may be too short to connect with the external handle. Hence, we decided to resimulate the sliding contact handle with the same dimension except that the length is 2cm longer.

Handle-view-1

While designing the models, I did some research about 3-D printing. I learned how to export the 3-D model files to STL files and some common materials for 3-D printers such as ABS or PLA. However, the only material the lab has is PLA with 1.75mm diameter and the 3-D printers in WALC only accept materials with 3mm diameter. As Joe told us that the new 3mm materials will be arriving next Monday, we'll start printing our models in the next week using the lab materials since printing parts of our model consumes more materials than the lab limitation. I also consulted one of my friends who has been so familiar with 3-D printing on knowledge on 3-D printing such as basic requirements. She recommended me Print Studio AutoDesk to check if the finalized STL file has errors.


Next week I will learn more about the error checking process using Print Studio AutoDesk and also print out the first version of our components.

Week 10:

Date: October 27, 2017
Total hours: 18
Description of design efforts:

This week I mainly focused on 3-D printing and the finalizing process.


As mentioned in the last week's report, I learned how to use Print Studio AutoDesk to check if the model to be 3-D printed has geometry errors. I also learned how to optimize the model's printing position to minimize the use of supports. I 3-D printed the improved sliding contact handle and the model looked pretty good. We replaced the original shorter version of the sliding handle with this new one and the result turns out that the mechanical structure still works perfectly.

Print-Studio-Display
New-Handle

Also, because of the material shortage of the 3mm PLA, we were not able to 3-D print our haptic controller model until the start of this week. Our team sent the STL files to the 3-D printing lab in WALC on Tuesday and the model is now being printed. These components are checked with no errors and 3-D printable.

Model-With-No-Errors

Besides preparing the final 3-D printing process, all of us were finlalizing the PCB product. While Lingke and Yutao were responsible for soldering decoupling capacitors, resistors and header pins onto the PCB board, Chia-Hua and I implemented the final version of the microcontroller code to ensure that all desired functionalities worked and they satisfied the requirements. We also double checked the PCB diagram so that the pinouts on the CubeMX match those on the PCB board.

Pinouts

After the code finalization and the soldering, all four of us connected one LED to one of the output pins to test if the whole board was functional. However, the ST-Link debugger turned off immediately as I turned on the debugging option. Also according to the datasheet, the measured value of Vcap (0.6 V) does not match the actual value on the datasheet (1.26 V). We spent the whole afternoons of Monday through Wednesday debugging the PCB board, including checking the connectivities using the microscope and verifying the schematic and layout. Then Chia-Hua compared the chip with the STM discovery board and found out that our micro chip was soldered on the flipped direction. Therefore, Yutao quickly removed the old chip and soldered a new chip onto the board and this time, Vcap equals the correct value on the datasheet (1.26 V). The ST-Link debugger successfully burned the code into the microcontroller and the flashing LED program worked as expected.

PCB-Board
Working-LED

Continuing our testing, we programmed the finalized code to the microcontroller and the accelerometer, servo and the vibration motor worked. The Bluetooth connection was also working smoothly.

Full-Program-Testing

For the next week, we will begin assembling all the mechanical components of the handle once the 3-D printing job is done.

Week 11:

Date: November 3, 2017
Total hours: 23
Description of design efforts:

This week, we were working on the final stage of the project.


We received the remaining part of our 3-D printing model and we started assembling all components immediately.

3-D-Printing-Components

We decided to use screws to connect different seperated parts, but it turned out that the holes we drilled had some dislocation from the mounting holes of the mechanical structure. In addition, although our handle looks very big from the outside, the internal space is very limited because the mechanical structure of the servo motor takes up most of its space and therefore stablizing the structure using screws was not that easy. We finally came up with an idea of stablizing it with loop and hook fasteners. The locations of the fasteners are very easy to be adjusted if we place them at a wrong place and the hook side and the loop side of the fasteners form very solid structures.


For the PCB box at the top, we seperated it into two halves for more convenience and less support consumption during 3-D printing. We stuck these two "half boxes" together using a heat glue gun. After placing every component into the hand-held handle box and connecting it with the PCB box, we found that some of the wires were too long to fit into the whole design, but this problem was resolved after a series of cut-and-solder operation. We double checked the wire connections of each pin and solidified the whole structure as well as the PCB board placed on top of the box.

PCB-Top-View
PCB-Bottom-View
Half-Completed-Handle-1
Half-Completed-Handle-2
Half-Completed-Handle-3

Before reconnecting the handheld box and the PCB box, we need to drill holes on the top of the PCB box to align with the mounting holes of the PCB. We used the drilling machine to drill four holes at all corners and successfully mounted and stablized the PCB on the top of the whole design.

Stablize-PCB

Besides working on the model finalization, we also optimized the commands for the haptic feedbacks and increase the vibration motor intensity. We combined different handle slide and the motor vibration commands so that both feedbacks can be provided to the user. In addition, instead of simply sliding the handle upwards and downwards, Chia-Hua came up with a new idea: the handle stays in the middle at the beginning. It slides back to the middle at 0.2 seconds after it moves downwards or upwards. This pattern makes more sense because when swinging the sword in Kendo sport, the player will not hold the sword very tightly in order to reach the farthest distance and therefore a friction in the reversed direction is common because the sword moves back and forth in a small distance in the player's hand. Meanwhile, after the installation of the vibration motors, we couldn't feel the vibration force because the sliding friction noise covered the weak vibration. Thus, we increase the PWM duty cycle by 7 times.

Optimized-Haptics-Code

After all those optimizations and the assembling, we have our product completed and we can do the demonstration this week. Here are some pictures of the completed product from various angles.

Completed-Product-1
Completed-Product-2
Completed-Product-3
Completed-Product-4

Week 12:

Date: November 10, 2017
Total hours: N/A
Description of design efforts: DONE

Week 13:

Date: November 17, 2017
Total hours: N/A
Description of design efforts: DONE

Week 14:

Date: November 24, 2017
Total hours: N/A
Description of design efforts: DONE

Week 15:

Date: December 1, 2017
Total hours: N/A
Description of design efforts: DONE

Week 16:

Date: December 8, 2017
Total hours: N/A
Description of design efforts: DONE