Difference between revisions of "S16: Dan"

From Embedded Systems Learning Academy
Jump to: navigation, search
(My Issue #3)
(My Issue #4)
Line 280: Line 280:
  
 
=== My Issue #4 ===
 
=== My Issue #4 ===
troubleshooting?
+
 
 +
Troubleshooting
 +
 
 +
Sometimes the SJ one baord doesn't power up properly or the stepper motor connections aren't working causing us to have to reset the system. <br>
 +
Stepper motors are inherently inaccurate because they don't have a feedback loop and our program needed to be adjusted a number of times because of it. <br>
  
 
== Conclusion ==
 
== Conclusion ==

Revision as of 20:27, 18 May 2016

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Project Title

Abstract

The project will use an Android application to determine how much liquid a syringe pump outputs. The application will communicate with a Bluetooth module attached to the SJSU One board which will control the stepper motor driver to determine how many steps the stepper motor will take on the syringe pump.

Objectives & Introduction

Show list of your objectives. This section includes the high level details of your project. You can write about the various sensors or peripherals you used to get your project completed.

Team Members & Responsibilities

  • Nicholas Foulk
  • Anson Jiang
  • Danny Luong

Schedule

Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.

Week# Start Date End Date Tasks Status Result
1 4/7 4/9 Order Parts Completed (4/20) It was much more challenging to order the 3D parts than expected.
2 4/8 4/15 Create Block Diagram, Flow Charts, Pseudo Code, Schematic In Progress The schematic is completed, but the flow charts and pseudo code have been delayed because of parts. Bluetooth programming was moved forward.
3 4/16 4/22 Build syringe pump and work on stepper motor programming Completed Parts are getting delivered and they all will arrive by the 26th of April.
4 4/23 4/31 Work on bluetooth communication between SJ one board and Android device Completed (4/30) Bluetooth module was easy to purchase. We moved forward with writing the Android application.
5 5/1 5/8 Work on Android device control for syringe pump In Progress (5/1)We have a list of options for users to decide how many steps they want to take with the stepper motor, but we have no correlation with an amount of liquid dispersed yet.
6 5/9 5/16 Test syringe pump for accuracy and Android device control Not Completed Not Completed

Parts List & Cost

Give a simple list of the cost of your project broken down by components. Do not write long stories here.

Part No. Name Description No. of Items Link to Datasheet Price
1 HC-06 Bluetooth Module Used for android app communication with the SJSU One Board 1 TBA $19.99
2 Stepper motor driver Interfacing between SJSUOne Board and Stepper Motor 1 A4988-Datasheet $22.45
3 Stepper motor 1 NEMA-17-Datasheet $14.11
4 Syringe Used for sucking and ejecting liquid in a thin stream 1 $7.99
5 T-Slotted Extrusion Part of the syringe holder for dispensing the proper amount of liquid 1
6 Linear Motion Shaft 8mm Shaft, 330m in length, steel 1
7 Linear Bearings Used for CNC applications, LM8UU 1 $10.59
8 Rigid Coupling User on the shaft of the stepper motor for turning the metal rod. 1 $21.45
9 DC output power supply For powering the SJ one board and stepper motor driver without the use of a USB connection. 1 $15.94
10 Inline switch For turning the circuit on and off without unplugging the power supply. 1 $4.00
11 3D printed part #1 Syringe Mount Holding the top side of the syringe 1 Varies
12 3D printed part #2 Rod Barrel Holding the bottom side of the syringe 1 Varies
13 3D printed part #3 Rod plunger Holding the rods in between the syringe and stepper motor 1 Varies
14 3D printed part #4 Stepper motor mount Mounting the stepper motor at level with the rods to the push the syringe. 1 Varies

Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

Cmpe146 DAN System Design Version3.png

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.


The stepper motor driver board communicates with the stepper motor driver using two pairs of wires which represent each coil on the motor. The stepper motor steps when the stepper motor driver manipulates the current through the pair of coils to cause a rotation.

Pin 0.0 was used as an UART TX pin and Pin 0.1 was used as an UART RX pin to be connected to the Bluetooth module to enable Bluetooth communications between the SJSUOne board and the Android application.

Six SJSUOne pins were used for controlling the stepper motor driver,not including power and ground pins.
Pin 2.0 was used as an output GPIO pin for the stepper motor driver's enable pin that allows for motor control when LOW.
Pin 2.1 was used as an output GPIO pin for the stepper motor driver's ms1 pin that allows for the configuration of full,half,quarter,eighth,sixteenth steps of the motor.
Pin 2.2 was used as an output GPIO pin for the stepper motor driver's ms2 pin that allows for the configuration of full,half,quarter,eighth,sixteenth steps of the motor.
Pin 2.3 was used as an output GPIO pin for the stepper motor driver's ms3 pin that allows for the configuration of full,half,quarter,eighth,sixteenth steps of the motor.
Pin 2.4 was used as an output GPIO pin for the stepper motor driver's step pin that allows the motor to do one step (if ms1,ms2,ms3 are LOW) on a LOW to HIGH transition on this pin.
Pin 2.5 was used as an input and output GPIO pin for the stepper motor driver's direction pin that allows for the motor to go in a forward direction when HIGH and a backward direction when LOW.

Software Design

/* move this to implementation
Overall for our software design we have three main components.

The first component is the Android application. The purpose of this component is to be able to accept user input of 0 to 30mL (max amount of liquid per our syringe) rounded to the nearest .5mL (how accurate our product will be) and the application will convert that into the appropriate number of letters to be sent through Bluetooth UART to the board to receive and decode. To protocol to send the amount to the SJSUBoard was sending a byte 'a' to signal the start of data stream. Then the appropriate letters were sent ('b'=.05mL, 'c'=.1mL, 'd'=.5mL, 'e'=1mL, 'f'=5mL, 'g' =10mL) until the exact amount was sent through Bluetooth to the board and a byte 'z' was sent to signal the end of the data stream. After the data is done being sent, the application will disable input until the stepper motor task sends a byte to signal that the process is complete to allow for another execution.

The second component is the Bluetooth receiver task. The purpose of this component is to wait for a message from the Android application and handle the data stream. It will discard all bytes sent until a start byte of 'a' is sent and it will enter a loop to add up the letters to form the total amount of liquid represented in the application. It will discard all other bytes that are not part of the decoding key and will exit the loop once a done byte of 'z' is sent. The program will then multiply the amount of mL of the syringe to the determined constant for steps per mL and send the result into a queue.

The last component is the Stepper Motor task. This task will block waiting forever until data from the Bluetooth receiver task is put into the queue. The stepper motor task will take step data from the queue and create a low to high transition on the step pin voltage # of steps amount of times to push the syringe to dispense liquid to the appropriate amount. The task will then be looped until the user presses the on-board switch to reset the motor to its original position after giving time for the user to do what they need to with the syringe output. After the button is pressed, the task will reverse the direction the motor to return it to its original state in preparation for the next use. A byte is sent through uart to signal the application that the task is complete and unlock the app to allow for a new input.

  • /

Implementation

This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.


Android Application design will consist of finding a bluetooth device screen and then allows user to enter amount of liquid to dispense

SJSUOne Board will have a bluetooth task that will wait for bluetooth message, process it and send to stepper task

Stepper task will take message from que and process the exact amount of steps to output the specified liquid from syringe.

/* Hardware implementation here

  • /

The first component is the Android application. The purpose of this component is to be able to accept user input of 0 to 30mL (max amount of liquid per our syringe) rounded to the nearest .5mL (how accurate our product will be) and the application will convert that into the appropriate number of letters to be sent through Bluetooth UART to the board to receive and decode. To protocol to send the amount to the SJSUBoard was sending a byte 'a' to signal the start of data stream. Then the appropriate letters were sent ('b'=.05mL, 'c'=.1mL, 'd'=.5mL, 'e'=1mL, 'f'=5mL, 'g' =10mL) until the exact amount was sent through Bluetooth to the board and a byte 'z' was sent to signal the end of the data stream. After the data is done being sent, the application will disable input until the stepper motor task sends a byte to signal that the process is complete to allow for another execution.

The second component is the Bluetooth receiver task. The purpose of this component is to wait for a message from the Android application and handle the data stream. It will discard all bytes sent until a start byte of 'a' is sent and it will enter a loop to add up the letters to form the total amount of liquid represented in the application. It will discard all other bytes that are not part of the decoding key and will exit the loop once a done byte of 'z' is sent. The program will then multiply the amount of mL of the syringe to the determined constant for steps per mL and send the result into a queue.

The last component is the Stepper Motor task. This task will block waiting forever until data from the Bluetooth receiver task is put into the queue. The stepper motor task will take step data from the queue and create a low to high transition on the step pin voltage # of steps amount of times to push the syringe to dispense liquid to the appropriate amount. The task will then be looped until the user presses the on-board switch to reset the motor to its original position after giving time for the user to do what they need to with the syringe output. After the button is pressed, the task will reverse the direction the motor to return it to its original state in preparation for the next use. A byte is sent through uart to signal the application that the task is complete and unlock the app to allow for a new input.

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

My Issue #1

Discuss the issue and resolution. A major issue was to get 3d printed parts on time as it hindered our hardware implementation until they arrived.
The parts were expensive and needed to be order ahead of time to start making actual progress.

My Issue #2

Part Compatibility

The metal rod we ordered was 1 meter long and a 300-330 millimeter portion need to be cut for the system.
The metal rod had a tight fit with the hex bolt for pushing the syringe.
The couple holding the shaft of the stepper motor and the metal rod wasn't tight enough. We had to force it to clamp down on the metal rod to make it spin.

My Issue #3

Soldering Issues

Pins needed to be soldered to the stepper motor driver for the power and SJ one board connections.
The wires for powering the stepper motor driver with a 5 volt wall power supply and stepper motor connections were soldered to the board themselves instead of pins and it they became loose and unstable often.
The stepper motor wires needed to be cut shorter every time they need to be resoldered.

My Issue #4

Troubleshooting

Sometimes the SJ one baord doesn't power up properly or the stepper motor connections aren't working causing us to have to reset the system.
Stepper motors are inherently inaccurate because they don't have a feedback loop and our program needed to be adjusted a number of times because of it.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

//todo 1. knowledge of stepper motors and stepper motor driver
2. using bluetooth communication
3. android application development with bluetooth
4. interfacing hardware and software
5. gain experience using uart

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.