Client Software: SVG and Units

Click here to download:
mystery_cut.pdf (376 KB)
(download)

Hey all, had an exciting break wading through more gross Java libraries. This time instead of DXF, SVG. There are a lot of reasons to go with SVG, but I think the biggest is that we have a bit better defined file-format. Still, I (Colin) have the issue that you can make all kinds of wonderful, non point coordinate shapes with SVG. Take this for example:

<g
     transform="translate(0,-62.362)"
     id="layer1">
    <rect
       width="197.14285"
       height="171.42857"
       ry="85.714287"
       x="71.428574"
       y="104.28571"
       transform="translate(0,62.362)"
       id="rect2812"
       style="opacity:0.8;color:#000000;fill:none;stroke:#980101;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
  </g>

That is a rectangle with rounded corners. We have to support the corner rounding and SVG still manages to sneak in transformation matrices.

Anyway, what this all means is that I'm still using libraries because we don't have time (or the insanity) to implement an SVG interpreter that would work. And why should we, there are plenty of great ones out there. I chose one called Batik, a Java library, under an Apache license.

Java
Well, the DXF -> SVG converter is in java. So we already need java. I like java. I needed an SVG library, Batik seemed pretty good and also was in Java.

I plan to communicate with the PIC using Java, too. Steve Zhangs group does this and it seems to work fine. There is a Java wrapper for LibUsb.

Lost in Translation
Okay, so still work to be done on interpreting. I'm trying to figure out units. DXF does units really strangely because its mainly for human-read drawings and humans would use a graphical scale printed along with the drawing. DXF kinda doesn't have units (but it also kinda does). Something similar is happening with SVG. SVG has some units, but it also allows relative units (IE, my drawing is 100% x 50%), in which case we don't know how large the user wants their cut object to be. I'm going to look through things a bit more, and if I don't get anywhere, we'll do everything in relative units and then ask for a scale or part dimension before actually cutting.

A Puzzle
I can now generate lists of coordinates like the following from SVG and DXF files. I'm mimicking the PIC instruction set Xy and Hyeon Taek came up with (at least, if I remember it correctly).

MT = "move to" -- these are entry points to a cut
LT = "line to" -- these are lines between absolute coordinates

Quesion: Xy and Hyeon Taek, we want relative steps, not absolute coordinates, right? Relative coordinates, scaling, and entry points are next on my chopping block

Anyone want to figure out what this instruction set cuts?
Hint: there's a twist

MT 0.01967497169971466, 0.3572882115840912
LT 0.022997645661234856, 0.3516520857810974
LT 0.02663806453347206, 0.34666678309440613
LT 0.030552467331290245, 0.3423894941806793
LT 0.0346980020403862, 0.33887743949890137
LT 0.039031147956848145, 0.33618777990341187
LT 0.04350868985056877, 0.3343777358531952
LT 0.04808733984827995, 0.3335045278072357
LT 0.052723854780197144, 0.33362528681755066
LT 0.05737502500414848, 0.33479732275009155

Download the full set if you're into cooridates!

The Patient Survives Open Heart Surgery (one X-Y module complete)

It has been a long couple days of machining but it is a finally here: a complete X-Y module. 

Img_7927

Warning, objects are closer (AND LARGER) than they appear on your monitor :P

Travis and I spent these first few days of Thanksgiving Break covered in cutting fluid. In Travis' case, these days extend back, oh, say 2 weeks. And I cannot forget the parts Jacob left us with prior to his departure. Or the times Xy has squatted on a lathe to secure our use of the machine.

Somethings first, such as steps, lost teeth, legal bar trips, and salaried jobs, you celebrate. The first time you break a tap is not one of those, especially when it is embedded in a piece that is complete done bar those threads! Luckily Travis came to the rescue and milled and surgically removed the tap with careful mill passes. Now one of the end parts has a lovely tooth out of it:
Alumenectory

Travis should be glad to know that if engineering doesn't work out, his steady hand may do him well in performing black-market organ transplants.

Happy Thanksgiving all. Our CNC machine may soon be able to carve turkeys!

Design Review 2

Well folks, that time has rolled around again. Yup, 2 weeks have passed since design review 1 and we're back for another round.

Slide1

We're to the point in the project that without some stupid humor like our comparison with American automakers, we would be significantly less happy with the project.

Slide2

The mechanical team has had a really rough week. More design variations than I can count. Then we find out our base design choices are no good. For example, all designs include heavy use of sheet metal, then we find out Olin doesn't have the equipment and we don't have the expertise to machine our parts. More Design revisions.

But the good news is that we have 90% of the left Y module complete! Go hardcore machining (and Travis living in the machine shop)!

Slide3

Slide4

Look ma, no sheet metal! Instead of having a single unit, we will have two mirror-image modules.

Slide5

Electrical and software are coming right along. Things seem to work as far as we can test them. MOSFETs are still being evil, but we have bigger fish to fry.

Slide6

Master PIC is on the left. It controls two slaves on right. We choose to speak to one slave or the other by pulling their "chip select" line high (wires running along the top).

Slide7

Add in a few H-bridges and we're in business. We utilize the dual-h-bridge packaging and hook both slave PICs (left) to a single H-bridge DIP. Bottom right is the motor / encoder connector (which we hate for having a non-standard connector!).

Slide8

We're still having problems with MOSFETs. Seems it should be simple, but we we construct this circuit, things start on fire.

Slide9

And if we construct this circuit, things are better, but still blazing.

Slide10

And with two resistors, thats an even higher resistance load strapped onto the FET, but still the FET is dissipating all the heat :-(
Slide11

One solution is to have a HUGE dummy load before the hot wire. MOSFET no longer burns, but we dissipate lots of heat through the dummy load that we would prefer to dissipate through the hot wire.

Brad says I've been reading the gate voltage v. drain-source resistance incorrectly. Indeed, looking again, we were barely trigging the FET and the drain-source resistance was huge. Guess we won't have to use a big dummy load. Instead, we'll probably trigger the FET with a square wave, perhaps from a PIC, perhaps from a 555 chip.

Slide12

The first is a problem we had and are deathly afraid will happen again. Hey, at least we're open about our problems.

Slide13

Missed one: poor engineering humor may garner us failing grads from profs Brad and Siddhartan.

Gears are Coming

I received an email from SDP-SI!  Our gears are predicted to get here on 11/10!  Feel free to stalk them at http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=1Z1505570374701841.

 

-Travis

 

Dear Mr./Ms. Travis Schuh,

Your order # C0911S0450 was shipped on 11/09/2009 via UPS Ground.
Your tracking number is 1Z1505570374701841

The content of your order is as follows.

Part Number                     Quantity        Unit Price      Extension
------------------------------------------------------------------------
A 1C29MY05028                   1               $21.34/EA       $21.34
A 1C29MY05060                   1               $40.33/EA       $40.33
------------------------------------------------------------------------

                               Subtotal:                       $61.67
                               Shipping:                       $7.51
                               Handling:                       $3.95
                               Sales Tax ( NY State Only ):    $0.00
                               Purchase Total:                 $73.13

---------------------------------------------------------------------
*Note:  Freight amounts were determined using standard published list rate
---------------------------------------------------------------------

The shipping address you provided for your order is:

       Travis Schuh
       Franklin W. Olin College of Engineering
       1000 Olin Way, MB245
       Needham, MA 02492
       United States

Cupcake Froster Motivation, and DXF Hacking

Foam CNC being a pain in the neck? Need some more crazy manufacturing projects we could have done for PoE? Sure! I (Colin) found a computerized cupcake froster!
3345315014_5f41180235.jpg

Okay, never mind, foam CNC is much cooler!

The Serious Stuff
I am deep in the depths of DXF hacking. Right now I'm looking through a Java DXF library called YCad. Things are sticky, to say the least. I love trying to understand pre-generic-typed java libraries. But even more I looooove trying to understand multi-threaded pre-generic-typed java libraries!!! >:-\

Oh, and stuff like this is definitely a good sign!
Ie4

Yup, IE 4 (my favorite browser of all time, don't know about yours).

Other Options
Since I've had enough trouble with YCad, I've looked for alternate means. One would be to convert to SVG first. Other blue foam cutters take SVG as input (we might even be able to use their software :p).

http://sourceforge.net/projects/dxf-svg-convert/ shows a tiny bit of promise. It is partly an inkscape plugin.

Okay, maybe dxf-svg-convert won't do. The author doesn't know how to make zips (one on the site is corrupt), and he missed all kinds of standard includes in his .cpp files, so it wouldn't compile. But working through it, now works. But the program produces some interesting results. Generally seems to work, until it does stuff like:

Buffover

Yes, that is segfault's deathly cousin, the buffer-overflow!

Advantages of converting DXF to SVG is that.
1) It might be easier to support SVG
2) We could probably do SVG in python (not necessarily an advantage)
3) Other CNC Foam hackers code may be available
4) We suddenly support both DXF and SVG!!!

 

I think we should give give SVG conversion a good consideration!

Meetings = more concerns and infinite CAD

(Thursday, 5 Nov 09) Travis and I (Colin) met with Dave and Bruce (Olin Machine Shop managers) to get feedback on the mechanical designs. Poor Travis and Jacob will have no end to CADing :-( . Dave didn't like our use of sheet metal, a deceptively easy looking medium. There was very little Dave and Bruce didn't have concerns about:

  • Wood isn't rigid, the base should
  • The bracing on the cantilevers will be tricky
  • A foundation is a foundation. Without a rigid foundation you're project will be difficult
  • Motor synchronization is difficult
  • Sheet metal is hard to work with (AKA, our plans = impossible)
  • Drawer sliders imprecise


There is a bit of a mismatch between our values.
Dave and Bruce Characterization: precision machine manufacture, operation, training, and maintenance
Team Blue Foam Poe Characterization: cheap college students

The $300 dollar limit is going to restrict us for sure.

But the consoled us with the fact that you build the best you can and "fix it in software." In fact you always "fix it in software." And in the end the project is limited by the software people. Thanks, my software people (me) will be delighted.

Travis and Jacob have now probably spend half there waking hours CADing.


Motor Speed Control
In other news motor speed control is taken care of, according to Xy. There was some issue before with using PWM and the hbridges, but now our motors are scaling happily. This means we don't have to build another voltage controller, good news!

Design Review 1

Design review time. We kicked arse. Here is the summary version


Slide2

We want to cut foam. We want to cut it quickly. User unfamilar with us, our software, and our machine should be able to take their 2D DXF file and with minimal instruction cut foam in 15min. The should be able to do it over USB. Ohh, USB, sexy.

Slide3

They system as a whole. DXF interpretation is done with Java. Our GUI (also Java) communicates with a "master" PIC over USB. The "master" doles out instructions to one or more "slave" PICs, each with a different motor axis to control. Fine control is possible because we have quadrature encoders and nice motors (thanks Travis!). The two PICs interact in small "instructions" to stay roughly synchronized. Rotary motion from the motors travels down ACME threaded rods and is converted to translational motion, our x and y axes. The wire itself is temperature controlled through a simple MOSFET variable voltage supply.

Slide4

The foam and the wire can move! I piece of foam is placed into the clamps in this model. The carriage under the foam moves back and fourth while the wire moves up and down.

Slide5

Or we have another design in which only the wire moves. (Note, this is only have the machine, a mirror image of this "leg" would connect to the other end of the wire.

Slide6

We need to scale our motors, y'all. We're buying gear stock and building a gearbox. Awesome and cost-effective!

Slide7

PICs control motors with H-bridges and PWM. Quadrature encoders let us know where we are and which way we're going. If we need, we can do PID control, but we can avoid PID tuning (you know, and PICs don't have floating point number... fun!).

Slide8

The PICs communicate over SPI with a back and fourth request-verification model. The SPI module has plexing built in so if we want to use more than two "slaves" or a "slave" and and EEPROM module, we can.

Slide9

Brad said he would help with the speed control

Slide10

Mechanical things can go wrong, too. Here are the things we anticipate. I think we should add "slow to manufacture" as another challenge.

Cutting Blue Foam

Today had an adventure cutting blue foam. Looked in the stockroom for nichrome wire but came up empty handed.

20 Gauge Magnet Wire
Someone online used 20 gauge magnet wire to cut foam. I followed suit but discovered that the resistance of the wire (18.75") was only 0.2 Ω. That would suck tons of current before anything heats up.

Foundry has a commerical cutting device (the Hot Wire Foam Factory) which operates on DC power. I probed the connector and their wire has 2 Ω resistance. Hooking that to the power supply.

Limited at 5.3 V -- Draws 2.75 A.Cuts well, no where close to 1" / second . Heat dissipation issues. Smokes foam residue.

Limited at 4 V -- Draws 2.1 A. Highest voltage possible w/o smoking. Cuts very poorly (effectively non-functional. 

Wire length: 11"

Using Magnet Wire at All
Looks like we need to use 40 gauge magnet wire to get up to 1 Ω / ft. We want 2 Ω / ft at least, so that is a no go.

Foam
Managed to get some size able sheets from Ben Linder
3' x 3' x 2" sheet - 2 quantity
3' x 4" x 4" column - 1 quantity

Ben orders from Sterling Building supply. There website has no kind of price list. The design faculty place bulk orders and Sterling brings that in on a truck. I think it might be outrageous in shipping to order just one $18 sheet from them.

But there is another option. Thought they don't have 4" thick foam, Home Depot has 2' x 8' x 2" TG R-10 F250 insulation sheathing. AKA, "the pink stuff." Ben is looking to get some more "pink stuff" and is willing to trade for some of his 4" blue.

Motor and Encoder Specs

Travis managed to get us some really fancy motors that were donated to his FIRST team by a robot surgery company (Intuitive?). 6 are on their way and we are assured they are "very nice" 

Motor Specifications

Stall Torque: 0.042658134126 N M

Stall Current: 1.06 A

No Load speed: 2200 RPM

 

Encoder Specifications

4000 interrupts/rev at 2200 rpm

That's about 100,000 interrupts/sec


We leave Xy and Hyeon Taek to figure out what kind of motor controllers to buy. And we reserve the right to hot wire cut them if they motors and controllers arrive and are incompatible.

Just kidding!