Difference between revisions of "S16: Dan"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Testing & Technical Challenges)
(Testing & Technical Challenges)
Line 318: Line 318:
  
 
=== Testing ===
 
=== Testing ===
 +
 +
Once the system was setup we attached the tube with luers because outputting liquid was easier with it as opposed to a needle. We found it easier to connect the SJ One board to one computer and another computer attached to the phone application since separate people worked on each component. The two people made adjustments by communicating what they wanted and reworked the software flow process to better the system.
  
 
== Conclusion ==
 
== Conclusion ==

Revision as of 01:11, 22 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
    • Software block diagrams
    • Hardware block diagrams
    • Ordering all parts other than 3D printer ones
    • Parts list
    • Real-time task programming
    • Buttons on Phone app
    • Video for the demonstration
  • Anson Jiang
    • Bluetooth Phone Application Designer
    • Communications Manager
    • Writing on the social Ledge page
    • Ordering 3D parts
    • Debugging
      • Phone Application
  • Danny Luong
    • Software Process Coordinator
    • Real-time task programming
    • Writing on the social Ledge page
    • Debugging
      • Real-time tasks
      • Phone Application

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) (4/17) It was much more challenging to order the 3D parts than expected. Most of the initial parts have been ordered.
(5/4) We ordered parts like hex bolt, bearing, and a coupling to make our design more complete.
2 4/8 4/15 Create Block Diagram, Flow Charts, Pseudo Code, Schematic Completed(5/20) (4/15)The initial schematic is completed, but the flow charts and pseudo code have been delayed because of parts.
Bluetooth programming was moved forward. We are not sure what else to add in terms of flow charts.
(5/20) We decided to make an in-depth software block diagram for showing the entire process of communication.
3 4/16 4/22 Build syringe pump and work on stepper motor programming Completed (4/21) (4/12) Parts are getting delivered and they all will arrive by the 26th of April.
They have arrived and we built it. The next portion is setting up the stepper motor with the system.
We have found at this point we need additional parts.
(5/4) We have realized we are missing a needed and hex bolt bearing have ordered it.
(5/13) We decided on trying to attach a hose to the end of the syringe and bought the parts for it.
4 4/23 4/31 Work on bluetooth communication between SJ one board and Android device Completed (4/30) (4/23) Bluetooth module was easy to purchase. We moved forward with writing the Android application.
(5/2) We are have written an elementary design to start testing out the process.
(5/10) We decided on two methods of software design, one with automatic reversal of the syringe and
the other with user enabled direction reversal.
5 5/1 5/8 Work on Android device control for syringe pump Completed (4/30) (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 Completed (5/10) We have pushed out liquid from the syringe into a cup for testing. We have counted the number of steps it
takes to empty a syringe. We have counting the number of steps for filling a syringe.
(5/20) We made adjustments to make the project more presentable.

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 HC06-Datasheet $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
15 Female Luer Connecting the syringe to a plastic tube. 1 $10.99
16 Male Luer Connecting the plastic tube to a needle. 1 $10.99
17 Syringe Needle Needle for outputting liquid. 10 $6.99
18 Hack Saw Cutting metal rod. 1 $15.99

Design & Implementation

The design section goes over hardware, software design, and implementation.

Hardware Design

Here we have a schematic of the connections we have with the SJ one board and the stepper motor driver and blue tooth module. The stepper motor is already drawn in. Most of the connections on the stepper motor driver are built onto the driver board.

System Design Version 4.png

Hardware Interface

Here is a detailed list of all of the hardware connections made between the SJ One Board, stepper motor driver, and stepper motor.

Stepper Motor Driver

  • GND is connected to a female plug
  • Vcc is connected to a female plug

Stepper motor wires connected to stepper motor driver

  • A+
  • A-
  • B+
  • B-

Bluetooth Connection HC 06 Module with SJ One Board

  • Pin 0.0 was used as an UART TX pin.
  • Pin 0.1 was used as an UART RX pin.

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 procedure that allows the motor to do one step (if ms1,ms2,ms3 are LOW) on a LOW to HIGH transition.
  • Pin 2.5 was used as an input and output GPIO pin for the stepper motor driver's direction that allows for the motor to go in the forward direction when HIGH and the backward direction when LOW.

Software Design

CmpE146 Dan FlowChartDiagram1.png

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

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.

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.

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 advice 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.

Technical Challenges

Ordering parts and keeping track of what is being order

Getting 3D printed parts on time was hard since most places needed atleast a week for production and shipping. We needed to focus on other aspects of our project while waiting for it. There are so many parts in our project that you are bound to forget to order something or order a wrong part. It is crucial to to start ordering parts as early as possible in our opinion because we didn't realize we were missing components until we started building. There were two separate times in the project when we had to order more parts. In addition, the parts were expensive and doing some shopping could potentially help reduce the cost.

Part Compatibility

The metal rod we ordered was 1 meter long and a 300-330 millimeter portion need to be cut for the system, so we went to a store to buy a hack saw. Cutting the metal rod took ages and the cut didn't come out as smooth as we had hoped. We would suggest finding a store that would do the cutting for you. The metal rod also had a tight fit with the hex bolt on the second 3D printed part. At first the hex bolt took a few attempts to break and the smoothness of the rotation can effect output measurements.The couple holding the shaft of the stepper motor and metal rod wasn't tight enough. We had to force it to clamp down on the metal rod to make it spin.

Soldering Issues

The pins needed to be soldered to the stepper motor driver for the power and SJ one board connections. Soldering the wires directly to the holes of the board caused problems because the wires became unstable and loose often. Soldering the wires was only required for the power supply and stepper motor connections to the stepper motor driver. As a result of the wires become loose, the stepper motor wires needed to be cut shorter every time they need to be re-soldered.

Troubleshooting

Sometimes the SJ one board 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. The UART communication caused us a few issues because of the translation between character and integers because UART requires byte transfers.

Accuracy

Stepper motors have no feedback loop and are known for being less precise so we sometimes have trouble getting the output as accurate as we want it.Making sure you have an accurate relational number between steps and milliliters is crucial for getting an accurate output no matter how much you are trying to output. Since there is no feedback loop in stepper motors we are not constantly tracking the position the syringe is currently in and as a result we have to set a static starting position at start up every time or find a method of back tracking what has been done.

Testing

Once the system was setup we attached the tube with luers because outputting liquid was easier with it as opposed to a needle. We found it easier to connect the SJ One board to one computer and another computer attached to the phone application since separate people worked on each component. The two people made adjustments by communicating what they wanted and reworked the software flow process to better the system.

Conclusion

Conclude your project here. You can recap your testing and problems.

Project Video

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

Learning Outcomes

1. Knowledge of stepper motors and stepper motor driver.
2. Bluetooth communication.
3. Android application development with bluetooth.
4. Interfacing hardware and software.
5. Experience using uart
6. Experience using queues
7. Powering SJ one board and stepper motor driver using power supply.

Project Source Code

References

Acknowledgement

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

References Used

NEMA 17 Stepper Motor Datasheet

http://www.pbclinear.com/Download/DataSheet/Stepper-Motor-Support-Document.pdf


A4988 Stepper Motor Driver Datasheet

https://cdn.sparkfun.com/datasheets/Robotics/A4988-Datasheet.pdf


Stepper Motor Driver Schematic

https://cdn.sparkfun.com/datasheets/Robotics/BigEasyDriver_v16.pdf


HC-06 Bluetooth Module Datasheet

ftp://imall.iteadstudio.com/Modules/IM120723010/DS_IM120723010.pdf

Appendix

You can list the references you used.