Showing posts with label jgro. Show all posts
Showing posts with label jgro. Show all posts

Monday, May 21, 2012

New TinyG for Android app demo

I worked out a few kinks in the app so that it's more robust in the face of bad data, and published a new demo up on youtube.  This demo walks through all of the current features, including connecting through both the USB and network services and looking at the system configuration.



As I mentioned in an earlier post, I'm working on adding additional support for tablet-sized displays and file upload.  In the meantime however, you can go over to my github page to pull down the latest source, and you can get the main app from Google Play.

Friday, April 27, 2012

Android CNC App

I got the whole toolchain working today!  Android app to tgFX, to TinyG, to JGRO CNC.  See the video for a sense of how it currently works.  I hope to have the configuration settings exposed to the UI tonight, so that you don't have to edit the code to change the link to the server.

While the current version relies on tgFX to talk to the hardware (TinyG), that isn't strictly necessary.  I put together a simple serial to network java program which will serve a similar purpose.  I may put that up on github soon too.

Once I get the basics working fairly well, I'll move on to phase 2, which is using my ICS tablet to talk directly to the TinyG vis host USB support.  That will be very nice, and will get me to my main goal - use of the CNC system without a PC being required.

The write code is fairly pedestrian, but the read code from the network took a little work to sort out.  I'm using an AsyncTask to do the blocking reads, and after each line it parses the JSON and updates the necessary state info. 
private class ListenerTask extends AsyncTask {

  @Override
  protected Void doInBackground(InputStream... params) {
    byte[] buffer = new byte[1024];
    InputStream is = params[0];
    int b;
    int idx=0;
    try {
      while (!isCancelled()) {
        if ((b = is.read()) == -1) {
          break;
        }
      buffer[idx++] = (byte) b;
      if (b == '\n') {
        publishProgress(new String(buffer,0,idx));
        idx = 0;
      }
    }
   } catch (IOException e) {
     Log.e(TAG, "listener read: " + e.getMessage());
   }
   return null;
  }

  @Override
  protected void onProgressUpdate(String... values) {
    if (values.length > 0) {
      Log.i(TAG, "onProgressUpdate: " + values[0].length() + " bytes received.");
      if (machine.processJSON(values[0])) {
        ((TextView)findViewById(R.id.xloc)).setText(Double.toString(machine.getX()));
        ((TextView)findViewById(R.id.yloc)).setText(Double.toString(machine.getY()));
        ((TextView)findViewById(R.id.zloc)).setText(Double.toString(machine.getZ()));
      }
    }
  }

  @Override
  protected void onCancelled() {
    Log.i(TAG, "ListenerTask cancelled");
    mConnect.setVisibility(View.VISIBLE);
  }
}

Saturday, March 3, 2012

First test of CNC plotter

Pretty exciting today, since I was able to get the system functioning for the first time.  Since I haven't decided what kind of cutting head I want to use, and I haven't finished all of the alignment steps, I wanted to start with a simple 2d plotter test.  I mocked up a simple pen holder, and put a handy whiteboard grid I had on the bed to use as a worksurface.

I decided to use Inkscape, and to treat the plotter head as an engraver.  Inkscape has a nice extension called Gcodetools that will allow you to export paths to G-code.  I used the text function to type a few simple words in, broke them down into paths, and exported the file.  I used the serial terminal I had on my Ubuntu test system to send the file to the TinyG board.  After a couple of issues tweaking the feed rates, homing the pen, and inverting the X axis, I was able to get a pretty nice first result!





 I still have several small tweaks to do to the system, including tramming, getting the bed support attached to the bed, routing the hold down channels, and bolting/screwing the base to the sides.  Right now I'm just using a couple of pipe clamps to hold everything in alignment as I tweaked various things.  I'm pretty surprised about the amount of parallelism I have even without tramming - the pen didn't really drift much.


I also don't seem to have any issues with backlash or overheating, at least for now.  I rewired all of the steppers to be in parallel mode, which theoretically draws 2.8A, over the 2.5A the tinyG drivers can support.  I should be able to manage that using the current pots on the board however, and even in my current configuration I see the benefit.  I'm looking to get another power supply from Jameco, which I think will also allow me to run at higher seek rates - right now I'm running about 225 mm/min max.

Before I move on, I'm going to play with this setup for a bit.  I believe I can take a photo, run some edge detection, then have Inkscpae build me a vector path to plot the image.

Thursday, March 1, 2012

JGRO CNC Progress

The first unit I got from Synthetos was defective in some way - we couldn't figure out why.  They were very gracious about sending me a replacement.  The new unit is working well in my test config.

I'm about 90% complete with my JGRO-based CNC router.  I have the entire gantry setup done, the motors and leadscrews for the Z and X axes are complete, and the ends of the Y axis are built, etc.  I needed to take a break for a bit to rearrange my shop so I had room for the completed unit, and I took the time to build a table for it to sit on.  It's the details that take all the time!


So tonight I'm going to get the rough alignment of the Y axis going.  My initial assessment indicates that there might be something wrong with my guides on the gantry, since there seems to be a significant gap on part of the bearing assembly.  I took the time to level the table, and then used that to ensure that the Y axis pipes were level and fairly close to alignment, and since I have a fairly big gap I have to assume it's a goof somewhere else.


Another thing I learned while working on this is that since I subbed out a lot of the MDF for birch plywood, that small fractional dimension difference is starting to matter in a few critical areas.  3/4" MDF is just that.  3/4" plywood is typically 1/32" or so thinner.  In the case of the gantry width, the design has you stack 6 pieces together (bearing block, gantry side, corner block for each side), and so that small difference starts to add up.  I suspect I'll want to redrill the Y axis pipe guide holes so that I have more alignment space.


I've been taking pictures here and there, but I haven't been particularly good about uploading them, since at the moment I think this blog is mostly a diary for myself.  Here are a couple of older shots as I was putting together the alignment blocks and bearing assemblies.  You can see I was using layout fluid and taking advantage of the fact I have some decent layout and metalworking tools.




I still need to figure out what kind of router I'm going to start with and build an appropriate mount.  I think for my initial testing and tramming I'm going to build a pen mount, making this an extremely overdesigned plotter.

Sunday, February 12, 2012

CNC Build Status

I've got all of the parts cut, and I'm in the process of building it from the Z axis out.  Z axis is done with the exception of the lead screw, which I'm waiting on the motors to complete.  I've got most of the carriage for the X axis complete as well, but need to do some final assembly.  The X axis gantry is next.  Pictures soon, really.

CNC Router 2

I think I mentioned in the last post that I'm building off of the JGRO CNC design.  For my initial try, I'm replacing the alignment blocks with aluminum.  I'm also looking at potentially replacing the lead screws, but that will likely wait until I've assembled things and tinkered with the design a bit more.

The biggest changes are related to the electronics and software.  I just got a Tiny G and I'm waiting on some NEMA 23 motors from http://buildyourcnc.com/.  I'm planning to drive these from an old PC power supply I've got - I may need to get a second one depending on the overall power requirements.  Right now I'm looking at different CAM and CAD systems that will work well with GRBL.

Monday, January 30, 2012

CNC Router

Another project I'm thinking about is building a CNC router.  There are several designs out there already, but they seem to either fall into the "you don't have any tools or skills" or the "you have a lot of money to spend" categories.  Since I'm in neither, I'm looking around at some of the more popular designs and am going to design something that fits my budget and skills.  I'm going to be using this blog to track some of my build notes while I'm sketching things out.

One thing that gives me a big edge is that I already have a fairly well equipped wood and metalworking shop.  This gives me the ability to fabricate with metal, and most designs seem to shy away from that.  Many of the low-end designs use a lot of MDF as well.  I'm not against MDF, but the idea of tapping threads in it and using it without significant structural support bothers me.

So where am I?  Eventually, I think I'd like to be able to build a system that will work for plastic extrusion like RepRap, but for now I'm looking wood routing systems.  I have the capability to mill metal right now (manually), and so I wanted to focus on something that would actually expand my shop capabilities.  I don't need a huge bed, but something around 2' x 4' would be helpful.  Ideally, I'd like to be able to use the finished product to help me build musical instruments, including things like banjo pots, necks, etc.

I may end up discarding this idea, but at the moment I want this system to be able to support my full size Porter Cable router.  It's not huge, but it's fairly heavy, and so the gantry and related stuff will need to be beefy.  This will likely increase the motor torque requirements as well.  If this fails, I'll look at smaller routers, like this Bosch.

At the moment, I following in many footsteps and using the "JGro" design as a reference for the key components of a CNC design and looking at what components I can improve piecemeal.  The first major change is that I'm building out of primarily birch plywood and not MDF, and using screws and glue to do most of the joins.  The other change is that I'm looking to make the alignment blocks for the pipes made out of aluminum.

I'm just now starting to get the initial components purchased, cut, and assembled, and I expect I'll have some progress to report in the next couple of weeks.  I plan to get all of the mechanical stuff done first, before I look at electronics.  Particularly with a full size router, I need to make sure I understand the loads involved before I size the motors, motor drivers, etc.

I'll try to get some pictures up here as I make some progress, because what's a blog without pictures?