Sunday, May 24, 2009

Bringing up Baby: (a new-to-me) Cortex-M3 board

First sign of life from my Cortex-M3 processor board

24 May 2009

After some struggles with stupid errors, I finally got a sign of life from my little Cortex M3 (a fairly new ARM processor) board (ET-STAMP-STM32, purchased from futurlec.com)   
FYI, here's where I ordered the board from:

http://www.futurlec.com/ET-STM32_Stamp.shtml
US$ 24.90 (+shipping)  

So, it's around the same price as an Arduino, but much more CPU firepower. memory and better I/O (including 16 channels of 12-bit AtoD and two ch of DtoA – real D2A, not just PWM {which it also has plenty of.})   This is why several reprappers are working with this chip.  (NXP says they'll have a similar chip out, the LCP17xx "real soon now," but I haven't seen it orderable andywhere.)

The futurlec folks don't get parts to you nearly as fast as digikey (took a couple weeks), but their prices are good, and they had this goodie in stock when I ordered it (and Sparkfun was out of their Cortex boards; though they've now got some in.)






This board's .pdf manual (English translation from Thai), isn't perfectly clear, but is OK after some study. Certainly better than my (nonexistent) Thai, so I shouldn't complain.

They don't include (or describe) how to set up a compiler toolchain, but that info seems to be available online. I followed the steps outlined in:

http://wiki.fosstronics.com/arm_cortex-m3/stm32/minimal-c-program

except that I downloaded the code to my board using UART1 on the board, and the two boot lines to invoke the serial downloader.

See also, “A Free Toolchain for ST-ARM uC” online (as of 5/2009) at:

http://www.binaryconstruct.com/index.php?option=com_weblinks&view=category&id=44&Itemid=72

and

http://www.danielecaltabiano.com/wwm/ST-ARM_toolchain/files/ST-ARM_toolchain_1.2.pdf


First problem:

I ,finally> found that my first jury-rigged +5 supply (tapped off of an Arduino clone) was misbehaving (slight overvoltage, strange --- looks like a solder joint came loose on the regulator), so I rigged up a separate 7805 and a wall wart, ditto a 3.3 v regulator for the STM32.

(We're in the middle of a remodeling project, and I'm working on a folding table in my bedroom, instead of my usual electronic-ing benches in the basement – that's all torn up/boxed up during construction. And my bench supply is hiding in some box. (Mistake!)


Problem 2:  Needs true RS232 levels (not TTL levels)

My best guess is that Desktop PCs, that still have a serial port, are the norm where this board is built (Thailand.)  As a result, it expects true RS232 levels, and comes with a DB9 cable.   As a result, I ended up creating a four-step Rube Goldberg interface to get it to talks to my (serial-portless) laptop:

  • My Laptop (USB port)  

  • FTDI USB to serial cable (at 5V TTL levels)

  • MAX233 on my protoboard (5V ttl to RS232 level transceiver)

  • On-the-board RS232 to 3.3V ttl level translator (can't read the P/N, suspect MAX3232)

  • STM32's UART1

I wish the designers of this module had put in a jumper between their level translator and the processor pins. (I have another FTDI based device that can be switched to do either 3.3 V or 5 V TTL levels, the USB BUB board from http://moderndevice.com/connect.shtml -- BTW, this costs less than a FTDI cable, and IMHO more versatile, e.g. the voltage level jumper-ability.) Since board is surface mount, I was leery of attempting surgery, so I protoboarded the above hack to get it talking.

There are two hardware items that need to be set correctly for the CPU to respond to the STM Flash Loader:

  • The boot0 pushbutton must be depressed (not crystal clear in the manual.)  

  • The jumper to the right of the pushbutton should be on the outermost two pins (position marked ISP.)

With that, I now get signs of life (target is readable!), when I push the reset switch, WOOT:




 Look at all that memory -- half a meg of flash, and 64K of ram.  Not too shabby!


Getting a blink program running:


I adapted the (great) example from

http://wiki.fosstronics.com/arm_cortex-m3/stm32/minimal-c-program

The main difference is that that example assumes the use of JTAG, which my board lacks.  (And I don't have a JTAG probe yet, either.)

Following those instructions, I downloaded the latest GCC toolchain for the Cortex, from http://www.codesourcery.com/sgpp/lite/arm/portal/release830

I selected current (2009q1 release) as of this writing, IA32 Windows Installer.

I also grabbed new download of cygwin (linux like env. for windows), from: http://www.cygwin.com/ 
and set that up

I was able to use the example .c and linker-script files verbatim (always helpful when trying something new), and jumpered/protoboarded an LED/resistor onto portB/pin9.

The example was especially helpful to me, because it gave exact “what to type to Cygwin's bash shell” lines, complete with all the options needed to compile, link, convert to a plain binary file to download to the STM32 chip.  The end result was a plain binary file (in may case blink_flash.bin), which is just what the serial bootloader wants.





One thing that wasn't quite clear to me was whether to leave my code .org'ed at 0x000000, or relocate it to 0x8000000. The STM documentation isn't crystal clear on how the FLASH is addressed in the various boot modes. I think it's addressable as either address when the boot1/boot0 are both set to zero (but I won't swear to that.)

In any case, the .bin file downloaded without error: 

----

For this little board, the magic configuration info is the following:

Leave the boot1 jumper in the ISP position always.

The boot0 switch (to the left of the boot1 jumper: should be:

  • Depressed during code dowload (which lights the green LED)

  • Out to execute the code from FLASH (green light off)

Once the code has been downloaded (using STM's flash loader demonstrator {v 1.1}), pop the boot0 switch out, and either press the reset button, or power cycle the board.


A blinking LED! 
It doesn't take that much to make me happy.

Now, on to studying the myriad I/O configuration registers.....

I'd take a photo of my messy (but working!) protoboard, but my camera seems to be hiding. 
But it is blinking.

More later (and fingers crossed that I can find the camera amid all our remodelling chaos),

Larry




Sunday, April 26, 2009

Impressions of the Cupcake CNC, 26 April 2009

Greetings all,

I (unexpectedly) got to see a cupcake CNC fabber yesterday at the Microsoft Startup Labs near MIT.  This was part of  
(I had prior commitments yesterday, but some luck with logistics, and that enabled me to catch 
the last 90 minutes of this event.) Following are my impressions of this device, 
please forgive the choppy grammar/stream of consciousness style.  
It's warm enough here that I'm functioning at only a low level, 
and thinking of crawling into my glass of cold soda to cool off....  
(I'm also apparently having a disagreement with this editor about where/if lines are wrapped.
It's sure not wrapping in any way I like/understand.... Grrrr)

They (Bre P. and Zach H.) were printing ABS, but they say it prints HDPE and PLA as well.

Small size
form factor roughly that of the original "tombstone" MacIntosh computers, 
for those old enough to remember those. Maybe a bit smaller.

The outer structure is built from thin (6 mm or 1/4" inch) plywood, cut via laser.  
Attachment used a combination of tabs/slots and threaded 
fasteners. The box structure, even with large cutouts in the faces, 
gives a nice sturdy structure, since the walls resist shear/racking.

Some of the smaller structural pieces were 1/8" plywood. (I think it cuts faster via laser, and it cheap.)

Some pieces (exp. the portion that moved up/down) are made of laser-cut, clear acrylic.  
This is nice, because one can see the inner working of the extruder 
(e.g. see how fast the filament is being consumed.)

The cupcake uses metric threaded fasteners, rods and bearings.  
(I was anticipating use of imperial sizes from designers in the US.)

The power supply is housed in the base of the unit (below the build bed), and the electronics are all mounted 
onto the device, mainly on the outer back wall. So, it's a single "brick" 
and was pretty easy for them to break down and pack it up. I presume that setup was similarly quick, 
but I didn't see that.

[IMHO, calling this CNC is a slight misnomer, because CNC usually implies conventional machining, 
at least to me. But I suppose they can't use FDM (R), due to the trademark on that term, 
from what I understand from past traffic on the reprap forums. This is a nit/pet peeve]

X and Y used belt drives. Z used a combination of belts driving threaded rods.  
The extruder used a gear motor for the pinch-wheel design.

Fast motions, ballpark of 40 mm/sec, maybe even faster. Similarly fast accelerations; 
it really whipped through printing the raft for the polyhedron.

Smooth motion, using dual rods (and some sort of plastic bushings) as slideways, 
along with some (obligatory) skate bearings. The size 17 steppers didn't seem to be taxed, 
and the gen-3 (surface-mount) stepper driver chips
were warm to the touch, but not hot.

Fine (0.5 mm or under?) extrusion -- made finer by moving (the nozzle) faster than the melt came out, 
stretching it and thus reducing the diameter of the melted plastic being extruded.

I watched it print a little polyhedron (with a waffle pattern internally to reduce plastic volume 
and speed the printing. The print quality was quite good (though I haven't seen many printed objects 
to compare with.)

The build volume is small (100 mm cube AFAIK);  IMHO, this might be better with one longer horizontal axis, as is usually done for machine tools such as mills or lathes.  Apparently the cupcake's build volume 
is constrained by the size pieces they can cut on the CNC laser cutter they have.

It has survived the "tender" attentions of the TSA, and they proudly showed me the TSA inspection certificate.  
[IMHO, this may have been an unwise tempting of fate, since they had a return trip ahead of them.  
Maybe they drove and the TSA document was from a prior trip.]

Walk-away operation. The machine worked well enough (and they were apparently confident enough) to walk away from it 
while it printed out the polyhedron. It printed the the part out with no user intervention, 
except setting the nozzle-bed height at the start of the print.  
The coil of ABS was lying on the coffee table beside it, slowly being drawn up and into the pinch-wheel extruder.

They used skeinforge to slice .stl representations of objects, and replicatorG to drive the machine. 
I don't know what version of the Gcode firmware they were using, but it seemed to behave well.

Printed parts
I saw gears, a pulley, an airfoil section, and a pair of tweezers, printed previously.  
Apparently, they had forgotten to bring tweezers (to remove the first blobby bit of extrudate) from the build bed, 
when the extruder was warming up, so they printed themselves a pair, thus avoiding further singed fingers 
-- quite handy. got to take the tweezers home; thanks guys!
(Why are they called a pair? They're actually less of a pair than a pair of scissors....)  
The gears meshed pretty well (not as good as hobbed metal gears, but not too bad, either.)
I don't know how well they hold up in use.

The view from the Microsoft Startups Lab, on the 11th floor of a building on the bank of the Charles river is 
*gorgeous* -- especially watching the sailboats and rowing sculls out on the river!  
Again thanks to the MS folks for making this venue available for the makerrevolution event!  

There were a number of other exhibits and activities, but I got their late, 
and focused my attention on the cupcake.  
My apologies to the people who brought lots of other cool projects.  
I wish I'd been able to get there earlier to check those out.

Zach, Bre or anybody else who was there, please free to comment/correct on what I've written.

Seeing this small, simple machine working, and working well has me re-thinking my repStrap game plan.  
There is something to be said for modest goals (printing small parts, without self-replication), 
as opposed to a more ambitious machine -- one that's not yet finished 
(translation: my much of sub-assemblies down in the basement, that can't yet print anything.)  
I'll have to sleep on this, and decide whether to change course on Cerberus, 
or perhaps divert and build a pre-cerberus machine as a first step.


-- Larry

Sunday, January 4, 2009

Hot Stuff! First Extrusion with New Extruder Design.

It's very late, but I have to put *something* up, because I just extruded my first plastic!

Not only that, I did so using a new design for my extruder's "hot zone." The design uses an Aluminum heater barrel, with inside-out nozzle inserts (made of brass.) The melted-plastic zone is under an inch long. The stem is stainless steel, with a reduced cross section just above the (threaded) junction of Al/Stainless, to confine the heat to the hot zone.



Above: Exploded view of the key parts of my extruder's "hot zone." The melt zone is deliberately kept short, and the heat is confined by the stainless steel stem, and its reduced cross section, just upstream of where it mates with the Aluminum barrel. The coarse threads on the barrel are to accept the nichrome wire.





Above: Here is the hot-zone assembly, after adding the nichrome and coating it with my DIY ceramic glue. It's not as clean looking as I'd like, but it seems OK mechanically and electrically. Aesthetics will have to wait for awhile....


But here's the real news (drum roll please.....):



Above: First extrusion with my new extruder design.
I fed the ABS welding rod by hand, and controlled the temperature (open loop) by varying the PWM duty cycle, while monitoring the thermistor resistance with a DVM (to the left of the extruder.) The temperature is approx. 200 deg. C. Note that the barrel is not yet insulated, except by the thin coating of ceramic glue.





Above: With some ceramic-fiber blanket to insulate the heater barrel, I can get to higher temperatures, and extrude HDPE. Based on the thermistor's resistance (visible via the DMM), the temperature here was ~245 deg. C. The PWM was set to 150; so the duty cycle was 150/255 or ~59%






Above: A (very, perhaps too) candid photo of my "highly organized" electronics workbench in my basement. I could clean it up, but I'd rather work on my repstrap!
The alert viewer may discern the beginnings of Cerberus' horizontal mechanism (left-hand side of the photo), based on a compound (X, Y) table, fitted with two stepper motors. More about that later.

That's all for now. I may add more photos and details later.
Next step should be closed-loop temperature control, based on the thermistor reading.

Sunday, December 28, 2008

High Temperature (Ceramic) Materials for Thermoplastic Extruders

A common goal among reprappers is to find better high-temperature materials for use in the "hot zone" of the thermoplastic extruder, especially one to electrically insulate nichrome wire. Between the nichrome and the heater barrel, we want a material that:
  • can take high heats without degrading (well above the nozzle temperature),
  • is electrically insulating,
  • and is thermally conductive.
[I'm not having any luck embedding pictures yet, so for now, please see the photosI've uploaded into a public picassa album. Any advise on how to get blogger and picassa to work together (as documented) would be much appreciated. IMHO, I'm following the instructions, but I don't see any images other than my personal head shot :-(
]


This is a somewhat tricky task, since most good conductors of heat are also good conductors of electricity. Between the heater coil and the environment, we want a material that insulates both thermally and electrically. For a thermal break, we want something that's a thermal insulator, and whose electrical properties may not matter. For now, I'm focusing on electrically insulating materials, for the nichrome (and thermistor leads, too.)

The materials used so far either don't last as well as desired (JB-Weld, BBQ paint)
cannot really take the temperatures involved (Kapton tape, silicones, epoxies)
or are expensive (per use, or per minimum purchase.)

I found (another) promising material, except that it's expensive,
omega's "CC-High Temp Cement"
$18 for a small (3 oz.) kit.
Expensive, but at least (as separate ingredients) it would have a longer shelf life.
Can we do better -- or at least cheaper?

However, in the online manual
both the ingredients and the proportions are given:
  • Zirconium Silicate (4 parts by weight)
  • Sodium Silicate Solution (1 part by weight.)
SS is alkaline, but not esp, harmful (used to be used to preserve eggs -- see wikipedia entry
ZS is probably not good for people, but the powder I have doesn't become easily airborne (slightly clumpy.)

Note: other reprappers (Viktor) have previously experimented with sodium silicate, but a good (e.g. thermally conductive) filler (that doesn't cause the SS to harden instantly) wasn't known (to us, at least.) Similarly, we didn't know where to get these chemicals inexpensively.

Armed with search engines, and determined to save money for repstrap components and tools, I did some digging, and found that these chemicals were available from chemical supply houses, but were still relatively expensive (likely for purity levels that don't benefit us much.) Eventually, I found a source for these (ceramic) compounds that was (in hind sight) fairly obvious --for ceramics, try a clay/ceramics/glaze supplier!
I found a number of online sources in the US, but one had particularly helpful information about their ingredients, but continentalclay (in Minneapolis, MN) seemed good(helpful info on their ingredients/uses online.) They had not only the sodium silicate, but three kinds of zirconium silicate powder. I asked them which one was the finest particles, and they answered promptly that it was "Superpax" I ordered a pint of SS and a pound of superpax:

They had other items that seemed useful, a ceramic fiber blanket that can take temperatures found in ceramics kilns (and metal-casting for sculpture, 2300 deg. F.) -- far above any extruder I'm contemplating, near term. They also (I realized after my order) sell alumina, which some other reprapper was looking for as a high-temp cement component. (they have two types, hydrated and not; the latter is more expensive.)

I've done some experimenting by mixing up small batches (5 -- 10 ml) and seeing how well it bonds to materials of interest: brass, aluminum, stainless steel, glass and ceramic fibers. Similarly, I've tried heating it up to see how it holds up.

With the exception of some (apparently insufficiently cleaned) aluminum, this cement adheres quite well to the materials I've tried. It can also be made stronger (and less brittle) by mixing in either glass or ceramic fibers (though this makes it more viscse/dough-like, instead of a thin, glue-like coating.) Metal surfaces need to be very clean and adhesion is better if the surface is roughened (either threading {and extreme case} or just abraded with some sandpaper -- similar to prepping a surface for strain gauges.)

An interesting property of sodium silicate is that it is intumescent-- it swells up when heated -- for this reason it is used in some fireproofing applications. From what I can tell, it swells up more when it is:
  • Heated suddenly to high heats (from room temperatures)
  • Is applied in a thick layer
  • Has not been previously cured with slow heat.
I've had better luck minimizing the swelling by gradually heating it up. My working hypothesis (since it becomes porus) is that the swelling is from water being driven out of the silicates, turning into steam bubbles trapped in the still soft silicates. When slowly heat cured, it seems to swell less, probably due to the water being able to escape better during a gradual heating profile.

A main interest I have is to eliminate the "flying lead" connections between the nichrome and the copper. Those make me nervous, because I cannot help but think that the contact resistance will probably increase with time (and thus dissipate more heat at the junction), causing more oxidation, thus more resistance, more heat..... resulting in variable extruder performance.

I looked into insulated standoffs, but was put off by the cost and bulkiness. Using this ceramic cement, I can make insulated standoffs out of (cut-of) screws or short pieces of threaded rod.


(My trials/tribulations brazing nichrome I'll leave for another post. Actually, it's *way* later than I thought. More later.)

Saturday, December 20, 2008

Cerberus, a RepStrap machine: a start at documenting my thoughts and efforts

Greetings all,

This is the beginning of my 'blogged "build journal" of my efforts to build a RepStrap machine.
(Please bear with me; this is my first blog; I'm learning as I go.)

What is a RepStrap? A RepStrap is a machine to bootstrap into RepRap capability. A RepRap is a Replicating Rapid Prototyping machine -- a "three-dimensional-printer," particularly one that can print many of its own parts, and whose design is open-sourced. The RepRap project was started by Adrian Bowyer, in the Mechanical Engineering Dept. of Bath University, UK.
For background details, see the reprap website.

Why build a RepStrap and/or RepRap machine?
  • For the fun,
  • For the technical challenge (motivation to learn new things),
  • To justify buying a bunch of tools I've always wanted, anyway!

What is/will be different about Cerberus vs. other already-extant RepStrap machines?
  • Cerberus is *my* RepStrap, built the way I want it (or as close as my skills, time, tools and budget permit.)

  • Cerberus will be capabile of both additive fabrication and "conventional" subtractive machining. Note: several other repStraps do this, notably nophead's HydraRaptor
    and Forrest Higgs' Tommelise (among others), so this notion isn't new here.

  • Cerberus' design is not constrained to be buildable with simple tools as is the Darwin RepRap, or the McWire-based mechanism often used for RepStrapping. (I'm explicitly going for performance/versatility rather than ease of development/adoption.)


Why name it Cerberus?
  • Cerberus is the name of the three-headed dog that guarded entry into to land of the dead in Greco-Roman mythology. My RepStrap will (eventually) have multiple tool "heads" one for additive fabrication, another for subtractive fabrication (milling), and a third for measuring/probing (~CMM) So that's three, and nophead already used Hydra in the name of his machine. Iff I get to the point of adding a forth head, I may have to rename it. (I considered using the name Janus, a two-headed Greco-Roman deity, but upon investigating, I decided that I liked Cerberus better. Proteus (also from mythology) was also a candidate, for awhile. (Proteus was also the name of the submarine that was miniaturized in the movie _Fantastic Voyage_, one of my childhood favorites. But since this machine won't really change form or size, the name isn't that good a fit. )
Brief outline of Cerberus' design:

The Cartesian(X, Y, Z) mechanism

  • I've based the horizontal (X, Y) degrees of freedom on a "compound table" (AKA XY table, or mill/drill table) from Shars Similar devices are available from other vendors (e.g. Grizzly, Enco, or Palmgren also smaller ones.) Mine is an import from PRC, and the typical caveats re quality apply, though (after dissasembly, cleanup, re-assembly, and adjustments), I think it'll do what I need, and it's good bang/$.
  • After dis-assembly/cleaning, but before re-assembling it, I lapped the linear bearing surfaces (slideways, AKA ways) of the table. There is (to put it mildly) considerable controversy on whether this is a good idea, or a terrible one. "Purists" argue that the proper way to improve ways is by scraping them in (and using a reference surface and prussian blue to find the high spots to scrape.) I agree that (all things being equal, this is the most accurate method.) However, my goal was not mainly to improve geometric accuracy, but to reduce the friction, and thus reduce the torque my actuators (stepper motors) would require to move the table. I compromise was to lap the ways as carefully as I could, using a machinst's (6") parallel to hold the carbide paper flat (at least for local, 6" regions being lapped.) I used a light oil with the carbide and inspected carefully for any carbide grains embedded in the cast iron. (Some advocate using less agressive, non-embedding abrasives; I wasn't patient enough to wait for a mail order; I had the #400 carbide in hand.)
  • I made mounting brackets (out of some scrap Aluminum) to support the stepper motors and couple them to the Acme screws. These may need some iteration; the stepper motors can drive both X and Y, but only to ~50% of the motors' no-load speed. The residual backlash is also not perfect, but may do for now. If I re-design these, I will incorporate better thrust bearings, instead of the solid bushings I made with scrap brass and stainless I had handy.

  • For the vertcal DOF, I was planning to use a smaller linear stage (5" travel) I have in my junk box. Now that I have the XY table, I'm starting to think I should get something a bit sturdier, and maybe with a bit more travel. Stay tuned.
Additive toolhead (thermoplastic extruder)

TBD

Subtractive Toolhead

I bought a rotozip (model RZ20) to use as my tool spindle. This has some features I wanted:
  • Variable speed (though only ~factor of two, 15 -- 30,000 rpm.)
  • A three-jaw chuck instead of collets, this permits use of tools with a range of shank diameters, e.g. drill bits.
  • A removable handle -- I hope to either clone the latches, or cannibalize the handle to make a mount for it.

Measurement Toolhead

Actuators:

Real-time controller

Structural Framework