Sunday, December 23, 2012
Printrbot LC mod log
1:
The first modification that I did was to place little pieces of silicone fuel line as washers under the printbed to allow it to be leveled. This tubing is the type used for R/C models to connect the fuel tank to the engine (which I had laying around). The tubing can squish down a bit so you can vary the height of each corner of the platform. This seems to work OK, however I still cannot get the bed perfectly level.
2:
I noticed that the heated printbed takes forever to reach 90C and will almost never reach 100+. It is a bit cool in my apartment, so that might be part of it, but I also think this might be a sub optimal design for the printbed. So to try to make it a tad more efficient I placed a layer of aluminized mylar film under the wooden platform. Maybe this will conserve a bit of the heat. Ideally this would be directly under the heated plate, however I did not feel like taking it off, so we shall see how this works.
3:
I decided that mod 1 was not working well enough for me, so I switched to using springs instead. I was originally thinking of making these however I have springs laying around so that was a simpler solution. Essentially it accomplishes the same thing. I was able to get the printbed very level which greatly enhanced the quality of the print so far.
Saturday, December 15, 2012
Printer is printing
Most of my problems have been with extrusion which unfortunately can have numerous causes. One of the biggest issues I had was actually that the idler itself was not freely moving. The ball bearing was actually rubbing up against a piece of the wood extruder frame, and causing a ton of resistance. I did not look at this until well after playing around a ton with the idler tension. This lead to lots of frustration and cleaning of the hobbed bolt.
Because I draw I happen to have kneaded erasers laying around, whereas my Xacto knives were in my garage leading me to try using one to clear out the plastic from the hobbed bolt. I discovered that this is a very good way to get them cleaned out very quickly. For those who are not familiar with a kneaded eraser they are designed to pull up charcoal but not destroy themselves like a plastic eraser. They can be shaped very easily. What i did was roll mine into a rounded cone and just dab the hobbed bolt with the tip. Spin and repeat. The advantage here over the Xacto knife is that it doesn't leave a bunch of little bits of plastic all over the place. Also you are not destroying a blade by rubbing it on a piece of metal.
With the issues of the idler being stuck and the bolt being clogged solved, I was able to get a very beautiful print of Mr Jaws. During that print the second nut on the hobbed bolt came off, and apparently when I put it back on I tightened stuff up a bit too much. This lead to a ton of frustration since it seemed like the extruder was clogged even though I could manually feed filament through the print head. So it is critical that this not be too tight.
Additionally I would say that it is critical to apply locktight to both of the nuts on the Printrbot Wooden Extruder kit. On a longer print of a 40 mm cube for calibration the inside nut actually tightened up sufficiently to cause extrusion issues again. Luckily I was able to identify this and correct it, however it leads me to think that locktight or a single nylock nut should be involved in the situation to prevent this.
Wednesday, December 12, 2012
Starting in 3D printing.
The first issue that I did run into however when getting everything configured is the wiring of the motors. The big thing to realize is that the printer does not use the standard Cartesian coordinate layout. Instead it seems as though the Y and Z coordinates are reversed, such that the Y coordinate instead of the Z coordinate controls the location of the printbed. Consequently the Y coordinate controls the height of the extruder above the printbed.
The symptoms that lead to this realization was that it was impossible to get the bridge assembly to rise very far above the printbed. This is because those motors must turn more for a given distance with the leadscrews. So if you are experiencing the same issue, go ahead and switch Y and Z motors and endstop connections.
Another issue that I am dealing with is with filament not feeding well into the extruder. I am noticing that I am unable to get a good 5mm test extrusion; the last little bit will not flow and the motor will meet lots of resistance. I believe that there are two issues going on leading to this. First, I think that the temp. might be a bit low, so I brought the extrusion temp from 200 to 210 in the _Filament_ section of the control software. Additionally I think that the idler is too tight, squishing the filament and causing the hobbed bolt to grind away material and become clogged. So I have cleaned that out and loosened the bolts for the idler. Hopefully this will lead to a good extrusion.
In addition to getting this going on the physical side I have been playing around with some of the digital side of the equation as well. I have been using Autodesks 123D Design program to learn the basics of 3D design and CAD. One good place to start is to try out some of the simple examples on the inhale3d site related to designing electronics enclosures. Additionally I have been looking into being able to generate STL files from Processing. So watch for a modification of the Menger Sponge class for a version that can generate an STL file for printing in the coming week.
Thursday, November 22, 2012
Fractal adventures: Menger Sponge
To start I am taking an approach where I build up the geometry of the sponge in an unoptimized way using the "box" primitive. The locations of each cube element will be stored as a PVector in an ArrayList which we will then be able to iterate through when we render. To update the sponge I will iterate through the arraylist, and for each element determine the location for the 20 elements it will be replaced with.
So here is the Sponge class where all of this will happen:
class Sponge{ //This is a naive implementation of a Menger sponge, using a collection of //cubes to build up the geometry. float size; PVector center; ArrayList<PVector&rt; elements; int MAXLEVEL = 3; int level; Sponge(float size, PVector center){ this.size = size; this.center = center; elements = new ArrayList(); elements.add(center); level = 0; } void divide(){ if (level<MAXLEVEL){ level++; ArrayList<PVector&rt; newElements = new ArrayList(); float newSize = size/3; for(PVector e:elements){ for(int x=-1; x<2; x++){ for(int y=-1; y<2; y++){ for(int z=-1; z<2; z++){ if(!((x==0&&y==0&&z==0)|| (x==-1&&y==0&&z==0)|| (x==0&&y==0&&z==-1)|| (x==0&&y==0&&z==1)|| (x==0&&y==-1&&z==0)|| (x==0&&y==1&&z==0)|| (x==1&&y==0&&z==0))){ newElements.add( new PVector(e.x+x*newSize,e.y+y*newSize,e.z+z*newSize)); } } } } } elements = newElements; size = newSize; } } void draw(){ for(PVector e:elements){ pushMatrix(); noStroke(); fill(64,85,133); translate(e.x, e.y, e.z); box(size); popMatrix(); } } }This class is fairly simple, with only two methods, one divides the sponge so we get the next level of fractal, and the other renders the sponge. In the divide method a new arraylist is created where the locations of all of the new cubes will go. This is then populated by iterating through the current locations, and then for each of those iterating through the possible x, y, and z coordinates where we are subdividing the cube into a 3x3x3 set of cubes. Then the coordinates are checked against the locations we wish to exclude (center cube, and center of each face) and if appropriate add the location to the new arraylist.
One might notice that there is a check in the subdivide class for the maximum level for the sponge. The reason for this is that this is a very inefficient implementation to render. The division is not too bad, however rendering becomes a nightmare since we render 20^level different boxes. A natural optimization of this would be to not render the faces that are hidden from view; where two cubes are next to each other.
Saturday, November 10, 2012
OpenNI on Windows 8
- Uninstall openni, nite, and the kinect driver.
- Windows key + R to open the run prompt
- shutdown.exe /r /o /f /t 00
- select troubleshoot
- select advanced
- select windows startup and then restart
- enter the option for Disable Driver Signature
- reinstall openni, nite, and the kinect driver
It seems as though this is required each time that you wish to install an unsigned driver. I was initially thinking that this disabled it as a general setting however this does not seem to be the case since last night I had to do this again for the virtual serial driver needed for my 3D printer.
Thoughts on polyglot programming and learning.
I have been working a lot with Processing lately to learn about the Kinect. It strikes me how wonderful this language is for learning any graphics related programming. It is important in my view that when learning something it is important to both make rapid progress as well as not be lost in details that are only incidentally related. While I could be doing the same thing in C++ or Java, I think it would slow me down from learning the concepts that are critical to the 3d rendering as well as the Kinect itself. The universal concepts behind what I am doing will be easier to see, and thus I can translate them later to these other platforms.
In this sense I feel that polyglot not only should encompass the use of various languages to tackle problems, but also to extend our ability to rapidly assimilate information. The tools exist to help us both produce better code as well as learn more. We should remember that these languages are creative tools, and sometimes we are best off with the simple tools so we can get closer to what we are actually trying to do.
Friday, October 26, 2012
CUDA notes 1
To get up to speed quickly I am reading through "CUDA Application Design and Development". One thing that is not covered in the first chapter that I am very interested in is how to time the execution of a kernel. I did find some info on stack overflow about the cudaEvent object. Here is a simple example:
#include <iostream>
using namespace std;
#include <thrust/reduce.h>
#include <thrust/sequence.h>
#include <thrust/device_vector.h>
#include <thrust host_vector.h>
int main(){
const int N=50000;
float elapsedTime=0.0;
cudaEvent_t start, stop;
cudaEventCreate(&start);
cudaEventCreate(&stop);
cudaEventRecord(start, 0) ;//start event timer running
thrust::device_vector<int> a(N);
thrust::sequence(a.begin(), a.end(), 0);
int sumA=thrust::reduce(a.begin(), a.end(), 0);
cudaEventRecord(stop, 0);
cudaEventSynchronize(stop);//remember kernels run asynchronously
cudaEventElapsedTime(&elapsedTime, start, stop);
int sumCheck=0;
for (int i=0; i<N; i++)sumCheck+=i;
cudaEventElapsedTime(&elapseTime, start, stop);
if (sumCheck==sumA)cout<<"Test Succeeded in "<<elapseTime<<" milliseconds!"<<endl;
else cout<<"Test FAILED"<<endl;
cudaEventDestroy(start);
cudaEventDestroy(stop);
return(0);
}
Saturday, October 20, 2012
Making Thing See, pt. 1
I have recently been reading the book Making Things See which is a tour of Kinect programming using the Processing language. I have played around a little bit with processing in the past, for some artistic type programming and also because I do a lot of programming in a similar project, Arduino.
Processing itself is a language that runs on the JVM, with a subset that can run in the browser using Processing.js. It is a pretty minimalist language which makes it easy to 'sketch' programs out, which is what they actually refer to the code as. I find it very nice to work in as like Arduino you have two main pieces, a setup method and in this case a draw method which can be though of as being like a game loop (arduino has loop instead of draw). This seems like a very convenient language for doing simple visual based code, and even complex openGL code is possible with it. Because of the simple and clear syntax I think the author has made a fine choice in languages for exploring the Kinect as this is going to be a very visual journey.
The first few projects introduce the basics of the Kinect, from how to install the libraries/drivers needed for later projects as well as the physical hardware and the underlying principles behind it. The first few coding projects will feel very simple for those with significant development backgrounds, especially the initial in depth explanations of the listings. However, I still find it very exciting to get such cool results interfacing with the Kinect so easily.
So far I have gotten up to project 7. This is the first project where I feel any truly experienced developer will want to rewrite the code significantly. The author uses a procedural style, which makes it very easy to follow and focus on the Kinect/computer vision concepts. However There is a significant amount of duplicate code here, and I found an object made short order of cleaning it up significantly.
Wednesday, October 3, 2012
GPGPU thougths
Saturday, September 29, 2012
dpi
Friday, September 28, 2012
First presentation
Saturday, September 22, 2012
impress.js quick take
Web based presentation
Window managers
Thursday, September 20, 2012
New netbook...kind of
Tuesday, September 18, 2012
Hello everyone
So I decided that I need to get a bit more organized, and my other blog was too scattered with different things. So I am creating this one to focus just on software with maybe a light smattering of hardware as well. Hopefully I can get around to blogging more, and really using this as a personal note taking space. Hopefully some of you will find this helpful as well, or at least interesting.
Yesterday I picked up a bluetooth keyboard to use with my Xoom, specifically to see how things go using this as a dev environment. No, not coding directly on the tablet, but instead using various cloud services or network devices to do my coding on. This way I am not tied to the physical device I am coding on, no setting up an environment, and I can always take it with me. There are some inherent limitations here however. Obviously I can't play around with the physical computing or NUI stuff this way. For those projects I will be tied to a real computer. Also, I will not be able to use any ol' tool or language that I want. So hacking a bunch of Go or Processing is probably out for this, so again I will have to drop down to a real system for that. However, where I think this might prove useful is for doing more web server programming, as well as light experimentation/playing.
So what are my options:
There are two ways I could really go with this. One is to ssh into a box someplace on the cloud (rackspace/linode/AWS) set up my tools (tmux, vim, emacs) and just go to town. This seems like a reasonable choice for a good number of things, especially when I need actual control over the libraries (numpy, twisted). This has the disadvantages mentioned above. Also, there is the setup time to get all the vim plugins just right, and install a vcs and get that all set to go. Not a huge deal, but not a two second process either.
The other option is a browser based IDE. This is kind of interesting, and worth exploring. The one I am playing around with is Cloud 9 (www.c9.io). They have a free account level, as well as a reasonably priced premium level should I ever need to go that way. There is some good integration with Github and Bitbucket, which is great. Also they have some tooling for collaborative tooling, deployment to cloudfoundary, and the such. This makes it very attractive for server development, since I can just do stuff and push it out. So, over the next few weeks I will likely be learning some node.js and doing everything in the cloud. Lets see how this goes.