- Set HX711 pins to digitalread configuration, to collect the raw data and try to see if that fixes the issue of slow performance of the code
- Verify that motor travels to the appropriate distance under the appropriate time duration.
Code for the week can be seen through this link under 11/20:
Results:
- Tested out the digitalRead configuration by removing the scale.get_units() function and replacing it with digitalRead(DOUT) and digitalRead(CLK)
- DOUT in this case is the digital output pin of the HX711
- CLK is the serial input for the HX711
- Based off of the HX711's datasheet, CLK and DOUT are used for data retrieval, input selection, gain selection, and power down function
- However, when the code runs, the only value that is displayed in Arduino's serial port is just 1.
- This is wrong because even when I apply more or less force to the device, the serial port still reads 1.
- Then troubleshooted and researched the HX711's functionality and Arduino syntax
- Used a different HX711 to see if maybe that's the problem, but it's not because it gives the same output
- Found out that since DOUT and CLK is placed on a digital pin, it will only give values of 0 or 1 (OFF/ON) on the Arduino's serial port.
- I also thought maybe I have to calibrate the system by moving it at different distances, but it wouldn't help the problem because I'm getting 1s not matter what I do.
- Tried putting DOUT and CLK on analog pins, but I only viewed values of 0 on Arduino's serial port. So, I've come to the conclusion that there's something in the HX711 arduino library that I'm missing out on.
- I started researching the HX711's functionality and the HX711 Arduino library to try to find out what I'm missing in my code that, the function scale.get_units() refers to. My objective with doing this is to see if I can hard code whatever its referencing and see if it improves the code's performance.
- Found out that the way the HX711 works is that data retrieval only begins for the HX711 when DOUT is set to LOW
- When DOUT is set to LOW, 25-27 pulses are sent to the CLK pin and data is shifted to the DOUT pin.
- So, with this information I could try setting the digital pin to LOW and see what happens? But, if nothing happens at that point, the load cell might not be receiving enough current and i have to change the gain????
- MatLAB also has a built in arduino add-on for the HX711, so maybe I could try that too???????
- Other than my troubleshooting activities, I also performed verification testing to see if the motor moves the device the appropriate distance during the correct calculated time. My efforts can be seen here:
- https://docs.google.com/spreadsheets/d/1Qps9yNjCzT_4Mehc4KnrKgyOdZEeMLO36xrFZnCQQz8/edit?usp=sharing
- This table shows what input parameters, predictions, and output parameters I specified:
- INPUTS:
- Distance I want it to travel in cm
- How many cm do I want the motor to travel across a certain number of seconds (Speed)
- 1 cm over 4 s= 0.25 cm/s
- 5 cm over 30 s = 0.1666666667 cm/s
- Load Cell Frequency
- How often do I want load cell samples to be sent to the serial port
- Compared 10 load cell samples sent vs 100 load cell samples sent
- PREDICTIONS:
- Time(s)
- Calculated by dividing the specified distance by the defined speed
- Verifies between different distances chosen
- OUTPUTS:
- Actual time it takes for the code to be performed for each distance
- PERCENT ERROR CALCULATIONS:
- Comparison to see how much the predicted and measured values deviate from one another.
- Percent Error Equation: abs(measured value-actual value)/ actual value *100
- Measured value in this case: Predicted Time or Specified Distance
- Actual Time: actual time it takes the code to be performed or actual distance traveled
CONCLUSIONS:
- Need to find out best way to integrate HX711 into the system without slowing down the code's performance and provide interpretable values for the users :((((
- Percent Error calculations from verification testing shows that the code can accurately perform or travel the appropriate distance. However, there is a significant difference between the actual and measured time values. This difference may be attributed to the delays defined in the code? But, this might not be the case and it just might be the time it takes for the code to perform because I removed the delay lines in my code and it functions the same.
GOALS FOR NEXT WEEK:
- Figure out the best way to integrate the HX711 into the system help
RELEVANT LITERATURE THAT HELPED ME THIS WEEK:
http://image.dfrobot.com/image/data/SEN0160/hx711_english.pdf
https://drive.google.com/drive/u/1/folders/1n60yP_wW-bhL4Cr68UYc9ab6dijqGEEq
https://github.com/bogde/HX711/blob/master/README.md