WEEK 16 - Machine Design

Machine Building :: Mechanical Design

::Week16::


Assignment: make a machine, including the end effector
build the passive parts and operate it manually
document the group project and your individual contribution

::Pictures of the assembly and cutting should come shortly.. hopefully::

Marc-Olivier and Raphael



It's time to open those boxes we received a couple of weeks ago and use that laser cutter! The provided files were too large for our laser cutter so we had to use the plans designed for smaller laser cutters... which wasn't as easy to use as we tought it'd be... after a good hour of trial and error, resizing some parts, cutting and testing the file was finally good, the carrier was too high... When we placed it in the in the axis, both the rods and motor shaft couldn't get in there without being stuck at a 10degree angle.. but now it's all right!

Lots of tape! As we like it!

Raphael


With the axis assembled, it was time to connect those Gestalt Nodes. FabNetModule, milled and populated using the same settings as usual!

I wasn't smart enough to use Bas' design so I had to stupidly mess with rewiring my ribbon cable so the fabnet module could communicate with the gestalt nodes... This added an hour to the process but it worked... didn't fry any nodes! :)

I then seperated the nodes and fixed them to each axis using double sided tape.

I cloned the pyGestalt repo on my linux computer, everything worked as planned out of the box without having to identify the usb port the device was on. "python singlenode.py" moved the first node in the chain. I liked the sound of the stepper at that point. Many hours of assembly to finally get something moving without any issues. Being carefull not to hotplug the boards, this has been routine since I started messing with stepper motor drivers for 3D printers.. but shortly after this, things started to behave strangely. Couldn't communicate with the boards anymore.

"X axis: Could not reach virtual node"
"X axis: Could not reach virtual node"
"X axis: Could not reach virtual node"
"X axis: Could not reach virtual node"
"X axis: Could not reach virtual node"...

It seems those '.vmp' files held some information that prevented my boards to be used properly, I switched boards every now and then, experimenting at home without the axises using a set of nodes and using the other ones when I was at the lab. Eventually figured out that I could simply delete de persistence file and they would be regenerated the first time the script is launched, asking me to identify each axis by pressing the button on the nodes. But now that I'm keeping my axis/nodes configuration as it is, I see that those vmp files are pretty cool. Having figured that out I could then experiment with the "xy_plotter.py" script.


# Some random moves to test with moves = [[10,10],[20,20],[10,10],[0,0]] # Move! for move in moves: stages.move(move, 0) status = stages.xAxisNode.spinStatusRequest() # This checks to see if the move is done. while status['stepsRemaining'] > 0: time.sleep(0.001) status = stages.xAxisNode.spinStatusRequest()
Mostly these lines. Where all the motion is taking place. Obviously the coordinates are stored in the "moves" list. I've messed around with python a couple of years ago... but it wouldn't just come back to me.
for chars in chars: print chars That doesn't really make sense to me anymore... for(int x=0;x<10;x++) { print(x); } So instead of coding everything in python, I decided to code a small text file reader that would parse x,y coordinates stored in it.
A simple routine:
  • load file
  • read
  • move axises to appropriate coordinates
    That way I could use Processing to generate complex txt files with as many coordinates as I want. Here's what I added to the xy_ploter.py script to make it work with my .txt files.
    text_file = open("test.txt", "r") //this opens the file lines = text_file.readline() //this stores each lines in a string list for lines in text_file: //for loop going through every line in the list chars=lines.split(',') //seperate coordinates that are seperated by comas and store them in the chars list move=[chars[0],chars[1]] //send the first and second char to the 'move' list stages.move(move, 0) //inject the x,y coordinates stored in the 'move' list in the 'move' function //from here everything is the same as the exemple status = stages.xAxisNode.spinStatusRequest() # This checks to see if the move is done. while status['stepsRemaining'] > 0: time.sleep(0.001) status = stages.xAxisNode.spinStatusRequest()

    here's the full Python code


    With my txt file reading script I could then move to processing to experiment with different motion. I opted for a basic plotter adding a peice of cardboard to hold a pen down against a peice of paper. Really really basic... but I had a lot of fun drawing some Lissajous Curves. Adding small sin wave to bigger ones to create ripples and all.



    Here's the Processing code:


    PrintWriter tet; //use printer to send print commande straight to a .txt file void setup(){ tet=createWriter("test.txt"); //call it test.txt } void draw(){ // Send some numbers to the txt file, here I messed around sine waves tet.println(""); for(float x=0;x<360;x+=1){ tet.println( (sin(radians(x)*100)*(60)) +","+ (cos(radians(x)*2)*(60)) ); } tet.println("0,0"); //Bring machine back to origin tet.flush(); //send anything left in the buffer in the txt file as processing is not writing in real time, this make sure you get everything before closing tet.close(); //Close the txt file exit(); //Exit program } Here's a video of it in action: