First much thanks for anyone willing to give me some general guidance.
I am trying to make an ASTM D6862 peel test machine. I am a machinist an therefore have completed the hardware design and fabricated the physical machine. Now I am working on the programming.
I need to control a stepper motor which will drive the physical "peeling" of the test samples via a ballscrew while simultaneously reporting back the force measured by the load cell.
I have successfully controlled the stepper using the accelstepper library. I can set a "speed" and therefore run the linear motion actuator at a specified rate.
I have also successfully measured the force using a load cell amp and load cell.
What an ASTM D6862 requires is a plot of the load vs distance (I can calculate the distance using steps and pitch of the lead-screw). I figure i can derive a plot using MS excel easily so really what I need is a CSV file of the force at each step (or the force at every 50 or 100 steps).
The issue I am having is that when I serial print out the force and number of steps the stepper motor cuts out. I believe that this is because it takes too long to measure the force from the load cell amp and also print out the number of steps thus causing a delay of the actually driving of the stepper.
I now think I may need to use two micro controllers. One to drive the stepper and one to measure the force but I am unsure how I could ensure that the force being measured was in sync with the number of steps.
Any general advice is greatly appreciated!