Goals to accomplish for the week of 10/31/19-11/06/19:
- Verify code works and travels the appropriate distance and speed
- Configure code with MATLAB??
Progress for the week of 10/31/19-11/06/19:
Troubleshooted code with Professor Leineweber/addressed issues with my misunderstanding of concepts particularly in relation to calculations/conversions for input, motor, and program parameters
Results of conversions and calculations can be found under forward/backward calculations: https://docs.google.com/spreadsheets/d/1sg0LK4XL-QSUAAPrCIgS7ezz7kZ2D-F2YC9tgsCq91E/edit?usp=sharing
Input Parameters: user-defined parameters that define the relationship of other parameters (Motor parameters, conversions, etc.). It’s basically the independent variable of the code.
Travel Distance (D): how far the user wants the motor to travel (can be in mm, in, cm, etc)
For my experimental purposes I’m currently using cm. Will eventually move to mm
Travel Speed (S): user determines how fast he/she wants to attain the selected distance (In the calculations, it’s measured in cm/s)
- How many cm do you want the motor to travel over x number of seconds
- E.g. 5 cm/ 5 s
- Note: High speeds leads to less torque
- I need to find an optimal that is fast enough for my purposes, but not too fast that it significantly decreases the motor’s torque
- Frequency of load cell and motor cell can also affect the speed
- Motor Parameters: segment of the code that defines what variables need to be established to define the motor’s function. These values are constant.
- Step Resolution (R): how many steps does the motor need to perform for it to complete one revolution
- This value is equal to 800 steps/rev
- Lead Screw Pitch (P): the distance between threads
- This value is equal to 0.8 cm/rev
- Conversions: calculations conducted to ensure everything is in the appropriate units that the program (Arduino IDE) can interpret and also into necessary values that need to be inputted into the code to define the motor/load cell’s function.
- Steps traveled(N): Motor interprets distances in steps. This value is attained by multiplying the travel distance (d) by the step resolution ® and then dividing that value by the lead screw pitch (P)
- N=(D*R)/P
- Step Rate (A):how many steps the motor must perform over a set number of seconds. This value is attained by multiplying the speed (S) by the step resolution ® and then dividing that value by the lead screw pitch (P).
- A=(S*R)/P
- Test duration (time): defines how long it will take for the motor to travel a specified distance (D) at defined speed(S). This value is calculated by dividing steps traveled (N) by step rate (A).
- time=N/A
- Program Parameters: user defined parameters needed to serve as blocking and for easy manipulation of the code. It’s also to define how often signals from the load cell and motor are sent to Arduino’s serial port. Load cell frequencies should be more frequent than the motor.
- Step Delay (™): used to block the motor’s function; after the motor completes one step, the code will stop the motor’s function for x ms based off of this value. This value is calculated by taking the inverse of the step rate (A).
- 1/A
- Load Cell frequency (Flc): user defines how often he/shwants load cell signals to be sent.
- Load Cell Delay (Tlc): delay period of the load cell. similar to step delay except for the load cell; used to block the load cell’s function; after the load cell has completed its intended function, the program will stop the load cell’s function for x ms based off of this value. This value can be calculated by taking the inverse of load cell frequency (Flc)
- Samples per step (M):defines how many load cells samples should be sent to the serial port in relation to a certain number of steps. This value is calculated by dividing step delay (™) by load cell delay (tlc)
- M=Tm/Tlc
I initially tested the system using these values for U,D,N, ™,TLC and M respectively: 13.3 RPM, 1cm, 1000 steps, 5 ms, 10ms, and 0.5. But, I found that this rate was too slow
- Although, I did not find the proper optimal speed for the motor (yet), I wanted to check if my Arduino code worked appropriately with a MATLAB code that my peer developed for the manual tensile testing system last year (See code here:). To do this, I placed 4 rubber bands in tension on the tensile testing system to see what would happen.
Figure 1: Experimental Test Setup to see if the MATLAB and Arduino codes can be used together. This setup has the motor and load cell connected to two separate boards. The mounting block on the tensile tester is placed at 0 cm on the "ruler" and four rubber bands are placed in the system.
Figure 2: Zoomed in experimental set-up of the MATLAB/Arduino Test. From this image, it can be seen that the tensile tester's mounting block is placed "zeroed" out prior to the test to observe what distance the tester will travel. This image also shows how four rubber bands are used for this experiment. These rubber bands are not placed in tension yet.
- To test this I initially put everything into one circuit and on one Arduino Uno board, but for some reason when I tried to use the MATLAB and Arduino codes together I got this error message on the Arduino side: “COM9 restricted
- As a result, I ended up connecting the motor and the load cell on two different Arduino Boards/ computers and tried to see if I would get any results (See Figure 1)
- My experimental tests can be seen in the videos below:
- Video 1 initially shows my experimental setup of the test (showing how everything is connected) and how the MATLAB/ Arduino Interface looked. The stepper motor was set to 13.3 RPM, 1000 steps(1 cm), TLC=10ms, and TM=5 ms. As you can see the stepper did move 1 cm, it moved at a slow rate, and the rubber bands were slowly being stretched.
- Video 2 shows the same experimental test and set up, however the 4 rubber bands were already stretched out by 3 cm.
- My experimental tests weren’t a complete failure, it just highlighted some issues that I need to address and figure out moving forward.
- Goals for next week:
- Tested out more speeds to see which was the fastest at defined frequencies.
- Perform tests to observe different relationships between high or low M
- Higher M= ™>TLC
- Lower M=™< Tlc
- Show graphs here(insert picture here)
- Calculated experimental speeds and frequencies can be seen under Speed/Frequency Conversions under this spreadsheet link:https://docs.google.com/spreadsheets/d/1sg0LK4XL-QSUAAPrCIgS7ezz7kZ2D-F2YC9tgsCq91E/edit?usp=sharing
- Verify that it works and that it meets the appropriate time and defined parameters
- Figure out/troubleshoot what is going on with the Arduino/Matlab interface, specifically the COM9 error
No comments:
Post a Comment