Shapeoko in the science classroom - advice/expertise needed

Talk about all things CNC
dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Shapeoko in the science classroom - advice/expertise needed

Post by dointhangs » Wed Jun 27, 2012 4:38 am

Friends its been great to read your intelligent contributions and discussions. So I bought the shapeoko to cut out some battery cases for a little hobby project. I figured I would slowly learn some cnc methods and have some fun with that. Yes that will be great. However now that the shapeoko is here and assembled I would like to use it for a more pressing much more interesting project. For various reasons I will have good time during the next 3 weeks to work on this, otherwise it might have to wait until next summer!
I would like to use the shapeoko as an autosampler in a junior high general science classroom. For example lets say the students have an array/rack of test tubes with different experimental conditions they would like to check the pH of over the course of a 18 hour period. Perhaps checking each sample tube once an hour or so, alternating between each. Also understand I can use a pH probe hooked up to an arduino and can log the data. Yes there may be some sensor calibration issues for long term experiments but I can work with that…
The shapeoko can place the probe precisely into the tube I would like of course but I am at the moment a little short on knowledge of how I will go about programming this! I will be trying to learn what I can about gcode. Of course I want to introduce a delay into the system, for the shapeoko to wait for a proper reading to be made or for the next desired time point.
Is this possible?
If there is any advice you can give me on exactly how this will work am very interested in that. What programs would you use if you were presented with this challenge? Very happy to have a little phone call or anything as well. Of course we’ll have the kids set the experimental conditions up - the look on their faces as they come in the next day looking for the shapeoko autosampler results will be priceless! THANKS -Frank
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

potatotron
Posts: 135
Joined: Sun Apr 29, 2012 12:47 am
Location: Southern California
Contact:

Re: Shapeoko in the science classroom - advice/expertise nee

Post by potatotron » Wed Jun 27, 2012 6:10 am

I don't know much about pH sensors work. Would you need to clean the sensor between each tube reading?

Physically you should be able to do this with a pH sensor attached to the Z axis MakerSlide in place of the Dremel. If the pH sensor is smallish, like a pen, you might be able to get by with putting it between two insertion nuts in the front grooves, then connecting the bolts with something like a zip tie, velcro, or wire. I'm experimenting with something like this for a vacuum head right now; I can post a picture if you want.

You might be able to do all with a single Arduino. Instead of running GBRL you could write your own code with the AccelStepper library controlling the steppers. This might even simplify the whole project because then you could easily program the whole sequence, something like

for (i=0; i<NUMBER_OF_TIMES_TO_SAMPLE; i++) {

for (y=0; y<number_of_test_tube_racks; y++) {
StepperY.moveTo(Y_START_OFFSET + DISTANCE_BETWEEN_RACKS * y);
while (StepperY.run());

for (x=0; x<number_of_test_tubes_in_each_rack; x++) {
StepperX.moveTo(X_START_OFFSET + DISTANCE_BETWEEN_TUBES * x);
while (StepperX.run());

StepperZ.moveTo(INSERTION_DEPTH);
DelayForReadingStabilization();
ReadPHSensor();
SendPHSensorToHost(); // or log to an SD card, etc.
StepperZ.moveTo(TOP);

}
}

DelayBetweenSampleReadings();

}

I hope this helps.

edwardrford
Posts: 1250
Joined: Mon Apr 09, 2012 5:40 pm
Location: Dixon, IL
Contact:

Re: Shapeoko in the science classroom - advice/expertise nee

Post by edwardrford » Wed Jun 27, 2012 1:46 pm

This is exactly what I was thinking potatotron. skip grbl and the complexity of writing gcode. Especially with the delays required.

The AccelStepper library would be a good choice because of the acceleration/deceleration features. However the standard Arduino Stepper LIbrary might be sufficient as well.

-Edward
Shapeoko 1 #0 - a couple of upgrades.
Shapeoko 2 #0 - a couple of upgrades.
Shapeoko 3 #2 - Stock

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: Shapeoko in the science classroom - advice/expertise nee

Post by dointhangs » Wed Jun 27, 2012 1:53 pm

This is helpful potatotron, yes lets move away from grbl for this project! I think I will try to get ahold of some big easy stepper drivers and look into this library while they are on the way here.
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

edwardrford
Posts: 1250
Joined: Mon Apr 09, 2012 5:40 pm
Location: Dixon, IL
Contact:

Re: Shapeoko in the science classroom - advice/expertise nee

Post by edwardrford » Wed Jun 27, 2012 1:58 pm

You can use your current driver shield. No need to get any additional hardware.
Shapeoko 1 #0 - a couple of upgrades.
Shapeoko 2 #0 - a couple of upgrades.
Shapeoko 3 #2 - Stock

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: Shapeoko in the science classroom - advice/expertise nee

Post by dointhangs » Wed Jun 27, 2012 2:55 pm

Yes I just realized that - pulled up the user guide on the buildlog shield! Thanks and will update.
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

alpha
Posts: 174
Joined: Thu Apr 12, 2012 2:49 pm

Re: Shapeoko in the science classroom - advice/expertise nee

Post by alpha » Wed Jun 27, 2012 4:21 pm

If you plan on using a PC to log the data I would write a simple script that generates and sends gcode over the serial port. I think this would be very easy, all you have to do is home the ShapeOko and send the absolute coordinates the machine where the samples are.
This should go to via simple commands like this:
x20
y20
z-10
This is as easy as print hello world...

I think any (script) language would work, do you know Python?

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: Shapeoko in the science classroom - advice/expertise nee

Post by dointhangs » Wed Jun 27, 2012 9:32 pm

I have a colleague who I believe is familiar with python so I will get a look at this method too - could be nice to keep it in gcode like that. He returns next week. Thanks everyone for the great directions for me to start exploring.
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

alpha
Posts: 174
Joined: Thu Apr 12, 2012 2:49 pm

Re: Shapeoko in the science classroom - advice/expertise nee

Post by alpha » Thu Jun 28, 2012 12:52 pm

http://www.shapeoko.com/forum/viewtopic.php?f=24&t=396

potatotron created a pick and palace machine using a perl script to move the ShapeOko... maybe he can share his scrip with you?

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: Shapeoko in the science classroom - advice/expertise nee

Post by dointhangs » Mon Jul 09, 2012 2:34 am

OK I dont move as fast as the pick and place guys - and I am not just talking about feed rates. Inspiring work guys, great progress. So yes I have an autosampler solution going based on just messing with gcode, video:
http://www.youtube.com/watch?v=8aicZxmd ... e=youtu.be
But I am not quite where I will be someday. My only "big" programming breakthrough was to insert a P after the dwell "G4" command, as in "G4 P0.2" for a 0.2 second dwell time. G4 seems to work for 1800seconds (30min) but I had a funny thing happen for 3600 seconds, will keep testing...
Part of the reason it took me awhile was that I definitely explored using the stepper/accelstepper libraries. I plugged the buildlog shield / pololu drivers on top of a non-grbl arduino, all the pins lining up nicely of course, but most/all commands to steppers resulted in erratic moves. There was another thread where a couple of good folks reported similar problems? Are we concerned about this or has there been progress in this? I also tried to get python going and that will happen, I have my best people working on it. This solution will be fine for awhile.
So the big rush I was mentioning in the opening post is that I am working for only a couple of more weeks with a local science teacher on some classroom projects. We can of course still do plenty after he leaves too. But now is the time to get the best ideas while he is still working intensely, later he will just be implementing things, not starting anything new. He is very busy actually working on some great arduino sensor labs and some cool stuff that I can share but as for budget cnc contribution to k-12 science we absolutely hope to have the autosampler and then run a usb camera. He makes a trebuchet with the kids every year so we will absolutely mill something for that too.
But if you happen to have any other interesting ideas on this let me know.
OK other notes is that I have taken to running the z axis motor mount nuts loose. If I tighten them it forces the threaded rod into a big wobble through the delrin nut and staggers the motor badly. You could say I am a z-axis power user with this project. seems to be working but I want to research the delrin nut a bit more, if it gets hot would it slightly melt and do some binding to the threads? I would consider going to teflon or something. But I dont think thats the main problem, I think its just this little coupler not being a straight shot down?
I can only run 10 of my 50mL falcon tubes but if I have a lowered bed I could get around that.
My next goal is to someday have a pipette attachment to pipette fluids from one tube to another. I will be looking out for how you guys have been driving the little pick and place vacuum pumps.
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

Post Reply