Saturday, October 27, 2012

LED Brightness PWM

Here's a simple circuit and code to control the brightness of a LED using PWM on an ATMEGA88A. I had to go searching to find information about PWM and it all seemed to be for other models which had things set out in different ways. The main difference here being in most AVR chips it seems that each timer has its own control register whereas the chip I am using has two registers that share the timer attributes but are named as if they are for the separate compare units.

Firstly I highly recommend this tutorial on simply getting a LED to flash. It uses a different pin for the LED so is a slightly different circuit but not by much. I personally only used the electrical schematic and the code from the tutorial as I'm using a AVRISP MKII programmer and know basic electronics already.

So for my very small tutorial (not really a tutorial), I'm going to assume the reader can read an electrical schematic and knows how get the code from what you type to the chip. I'm also going to not really explain the code much as I tried to comment as much as I could. The reason for not explaining what I did so much is because there are heaps of tutorials out there for PWM on AVR chips. I only wanted to put this one out because I couldn't find simple code (rather than masses of subroutines) to control PWM using the 8bit timer0 on the ATMEGA88.

Without any further ado here's a video of how the LED should flash after the project.
So that is hopefully what it will look like after we are done. So the first thing to do is to wire the circuit up. Here's the schematic:
R1 is a pull up resistor to make sure the reset pin (which is labelled as pin PC6) is kept at logic one when not being programmed. I tried adding a 10uF capacitor connected to ground on the reset pin but the programmer was unable to connect, so I haven't added one in.  C1 is a smoothing capacitor just to help if there is any spikes in the supply voltage. R2 makes sure that there is enough current going through the LED to give enough brightness without pulling too much current from the microcontroller. The connector named ISP-CONNECT, is where the MKII attaches.

Finally the code is as follows.

/*
 * Name: ATMEGA88A - Breathing LED using PWM on timer0
 * Description: This sets a LED on portD.6 to glow in a
 *    pattern similar to breathing, like the Mac sleep LED does
 */

#include <avr/io.h>
#include <math.h>                   // Allows the use of pi and e in Equations
#include <avr/interrupt.h>

unsigned int count = 0;             // our variable to determine where in wave we are

int main()
{
    DDRD = (1 << DDD6);             // Set PD6 as an output
    OCR0A = 0;                      // clear OC0A (0% duty)
    OCR0B = 0;                      // clear OC0B for good practice
    TCNT0 = 0;                      // clear timer0 register
    TIFR0 = 0;                      // clear timer0 all interrupts if any
    TIMSK0 = (1 << OCIE0A);         // enable interrupt for OC0A
    TCCR0A = (0<<WGM01)|(1<<WGM00);    // timer0 to phase corrected PWM
    TCCR0B = (1<<CS00);             // timer0 to use clock with no prescale
    TCCR0A ^= (1 << COM0A1);        // Clear 0C0A on compare match (turn timer on)
    sei();                          // Enables global interrupts
    while(1);                       // Never ending loop
}

/**************************************/
/**** Interupt for timer0A compare ****/
/**************************************/
/* This is used to update the duty    */
/* cycle to follow our equation. The  */
/* equation is a modified version of  */
/* exp(sin(x)).                       */
/**************************************/
ISR(TIMER0_COMPA_vect)
{
    count++;                        // update where we are in the wave
    OCR0A = (255+255/exp(2))*exp(sin(2*M_PI*count/8192)-1)-255/exp(2);
                                    // set the new duty cycle


Electronics update

I've realised I can't do much more on the structural side of the printer until I start properly designing it in inventor which takes far more time than I'm willing to use for procrastination. So in the mean time all posts will be electrical based.

So, I've managed to get my ATmega88A chip up and running. I managed to get the programmer (AVRISP2 MKII) working with the Mac, by changing drivers. The original drivers weren't picking up the device. I found the method for the fix the problem at http://cooperlees.com/blog/?p=414. I used the osx-pl2303 driver as it had more entries to change than the standard prolific driver (I tried adding an entry to both but failed both times so had to edit a previous one). In hindsight I probably should have used the official or some other driver as the osx-pl2303 drivers use a weird naming convention for the file system sockets. It also doesn't support OSX 10.7 or 10.8 for future use. I didn't use USBProber as the article said and simply used the values from system profiler above which I then converted to decimal (with the help of Google, I was being lazy). With this I thought great, I should be able to program now from the mac using CrossPack (avr-gcc, avr-dude etc), unfortunately no such luck. I haven't had a lightbulb moment since fixing the driver issue so I've resorted to programming mainly on XCode and then copying the files to AVR Studio on Windows to download and debug. To actually set up the connection to the chip, I had to create an adaptor that went from the 3x2 connector on the MKII to a spread out version that would fit into the bread board. Sorry about the colours of the different pictures being bad but I couldn't be bothered using a proper camera and my phone wasn't picking up great colours with the incandescent room light (flash and the desk fluorescent over exposed the pictures). The adaptor is made using header pins and variboard. So to not short between the two sides of the connector, a knife was used to cut the track. I also used a knife to cut and break the variboard, but looking back I should have used a band saw (though most people won't have one of these).
 
The breadboard programming adaptor
That is all I have done so far with the setting up the programming, I'm going to write another post after this about controlling the brightness of a LED using PWM. I've realised this morning that PWM might not be as useful as I had hoped for this project as its continuous, and instead might be controlling the steppers purely with on and off signals to the pins. PWM could be used for the pump or the extruders as they won't need to be as accurately driven.

In other news, I can't use the Freeflex heated tubing I was hoping to use as they only supply to OEMs in large quantities. This means I'll have to make my own heated tubing or abandon the idea altogether and hope it doesn't harden in the tube. I don't want to use a syringe as that would mean not being able to do large chocolate items. I had a look into header fittings (for connecting the slave controllers to the master) and found out on the molex site that they should be able to cope with 2-3A depending on the wire sizes (here and here). This means I should be able to simply use header connections to connect the motors and slave controllers to the main electronics. I also was thinking last night that I might include a global interrupt wire that can be pulled high or low (not sure yet) when there is an error. This would cause everything to stop and remember where it was up to while the master controller checked with each component for errors. The reason for this is that if something goes wrong, say one motor out of two in the Z slide stops working, the controller can stop everything and correct or signal to the user so something else doesn't break or become damaged.

That's all for this post. I'll write another quick post about setting up the ATmega88A to control a LED brightness. The reason for keeping these separate is so its easier to search and if someone just wants to know about that and not the rest of the 3D printer stuff they aren't given unnecessary information.

Wednesday, October 24, 2012

Heating and Plastics

Since the last post I've had a look into types of plastics and ways of heating and determining the temperature. My endevours to find how to heat the extruder came back with some great answers. I first had a look at how the RepRap worked and found they used a thermistor to heat the filament and from what I can determine they either don't monitor the temperature after setting it or they do this through the same thermistor (example). This thermistor tended to be quite large and powerful. I had a look at these on wikipedia and it said they could normally only go up to around 130˚ Celsius. This I was intrigued at how the RepRap got them to cope with the 230+ temperature but I kept looking. I eventually found resistance themometers but once checking the price found they were a tad too expensive (starting from $10 a piece). I kept looking and decided to look on element14 (Farnell) and found there were in fact thermistors that could cope with 300 degrees so I'll stick with that I reckon. So that thermistor will be used for measuring temperature and then I'll use another component to heat the extruder. I have two ways currently of doing this, using the same method as RepRap using a thermistor or using nichrome resistance wire which is cheap and the same stuff that toasters use. This would allow it to be placed inside the hot end if I wanted and would be far neater compared to a resistor that sticks out. Its also very easy to get hold of (for example in Australia you can get it from Jaycar). For setting the temperature of the elements, I will have to use PWM or similar. "Or similar" because PWM tends to be in kilohertz where as for heating elements it seems to be a number of seconds before you switch states. Before I forget the reason I want a separate temperature sensor is because I would prefer accuracy, specially for measuring chocolate temperatures where only a few degrees can change the state/phase of the chocolate. The two plastics below (ABS and PLA) have quite large ranges of temperatures it  seems being 225-250 and 190-230 respectively.

So the two plastics I was checking out are ABS and PLA. ABS is the type of plastic that is used for LEGO! and PLA can be used for disposable tableware for example. There's two sources I used which are this forum topic and this video. The video starts of kind of weirdly as I think its actually a skype call. Its between someone who is interested in 3D printers and the maker or something of one of the 3D printer companies. From these two sources I decided I would most likely start off with PLA as it has no fumes and then once I have PLA working nicely I'll start using ABS but move the printer from inside to the workshop/shed. Just for reference for me, the cheapest place I could find in Australia for ABS and PLA filaments was ozreprap.com.

I don't know how I found this but another source of plastic which would be a great idea is old plastic bottles and food containers. I found out from a kickstarter project that these can easily be melted and then formed into plastic filaments. Pretty cool idea and would save lots of money. You could also get different colours such as green and blue from sprite bottles. I was also wondering if it was possible to put powder die in and colour the plastic too which could potentially make coloured see through plastic of lots of different colours, could even make swirls of colours. I wouldn't start designing anything until after I've made the printer though.

Other things I've thought of are that I can use a gear style pump for moving chocolate around and a heated tube for moving it round. The heated tube could either be bought or made with nichrome resistance wire coiled round it. I'm not sure which of these is cheaper or most effective (and safe). Another item which I forgot to add above was that one of the wiki pages on RepRap said that for faster printing, the hot end should be longer.

One last thing that's electrical based is that I think I will put two hex switches (switches with 16 positions, outputted in binary, ie 4 pins) that can be used to set the I2C addresses of the slave controllers without reprogramming, so I can quick change them if they break. I'll also have a jumper on the slave control boards so I can swap the default directions.

Think thats everything, I really had to push myself to make this post as I've been too tired in the evenings after study and in the mornings I'm most ready and roaring to go and study. I have been giving myself the nights to relax so that is why I have had time to research though.

Sunday, October 21, 2012

Update on yesterday's design change

Overnight I was thinking on how to improve on the design of yesterday (my mind seems to wander onto this project a lot!) and thought the second idea was pretty good. I decided that with the duel supports for the head/extruder I wouldn't need to move the bed up and down. So I moved the Z slide control/ball screws onto the Y slide. At the same time I was thinking about the placements of the motors and realised that I have to put the X slide motor on top so the ball screw and motor don't get in the way of objects below. This then meant that the Y slide motor and ball screw could go on the underneath of the Y slide which would be very neat. The Z motor and ball screw in the picture is shown only one one side but I would put it on both sides I just couldn't be bothered drawing it on both. The 'M's in the picture are motors and the 'H' is the head or the the mount for the extruder.

I'm quite happy with design and I think as long as the join there the X slide connects to the Y slide is strong enough it will be a great design that is much more space saving than the other design. I think I will order some stepper motors this coming week so I gauge the weight then I can do some calculations on the strength of the joint after my exams (that really will be after exams as that will take some time to do not just thinking). I'm still going to try and use aluminium for the structure as its lightweight (no one really wants a 10-30KG object on their desk!)

In other news I've got my ATmega chips and programmer (mkII). I'll post some stuff about it soon. I've got it all working under windows on my laptop (I was strangely happy when I got a LED flashing) but haven't managed to get the mkII to come up as a device on OSX and thus can't do much on OSX itself, so I'll keep trying to work that out.

Saturday, October 20, 2012

Radically different designs

This week, out of the blue a mate of mine posted some 3d printers from kickstarter on my Facebook page.  They were of different designs but all had two things in common, which was that they all had the work move in one plane and all only had one support for the z plane. I had, as I've previously stated thought this was a bad idea due to forces (moments really). I have though now come round to the idea considering my last post. With my last post, I basically had double the bed size in both the x and y planes due to boarders and structural components. This meant that there was lots of wasted space, which these other designs don't have as much of due to the z plane only having one side of the bed where its connected to the base. So I've designed the following two designs with this in mind. The first one is simpler but has a very large moment (as stated on the diagram) which cause cause inaccuracies or failure. The second design takes a bit more care of this by using two bars for the z plane slide. It also as its drawn has the bed moving up and down as well as the head moving. This is because I drew the bed moving first as I was planning for that drawing but then as I drew the head and the top of the frame unconsciously drew the head moving in this plane as well and I couldn't be bothered fixing it. I'll analysis the two designs soon but probably not until after my exams now. This also means I'll stop working on designs in inventor until I decide on what I actually think will be good and sleek. Thankfully every thing I have done so far can be applied to these two designs too.

First design

Second design

Wednesday, October 17, 2012

Bed dimentions and structural design

I have some more ideas to post. So firstly but very simply, I'm going to try to avoid gears. This is because gears introduce slop to the drives and thus looses accuracy. There aren't many places I can use them any way but places like the Z-slide where I could potentially use one motor for the control and use gears to move the other corners would not be very accurate to 3 stepper motors and a rod for the other corner. The next thing is that as well as ball screws, I will most likely use a bunch of bearings to make other joints more fluid in movement (ie lower the friction). I've started looking at materials for the frames and I think I will try and source channels, angels etc (not the profile for the main supports/legs though) from Ullrich. I can get these where I live easily and are obviously made out of aluminium. I started last night on designs in inventor but I stopped once I realised I hadn't made my choices on the exact measurements of the frame. I'll post the design from inventor in the next post but for now I'm still deciding on sizes. Here's a picture of the bed, without the x and y slides showing on top.

This shows the dimensions which I'm unable to decide on and some of the features of the frame. I can't decide because I would prefer a 450mm square bed but this would make the outside edge (A) of the frame around 750mm which is very large (assuming C is 50mm). If I make the bed only 310mm square then dimension A is 600mm. Ways of making the excess space smaller is either by radically changing the design which I don't want to do, mount the motors in the outside edges, though this has other problems or try and reduce C as much as possible. I'll make my decision up asap.

On the electronics side again, I've decided I'm not going to use the stepper motors mentioned previously as these use too much current for what I desire so I'm going to change to these 12V @ 0.33A, 1.8 degree steppers motors. These are cheaper, have a much larger standing torque (not that I need that) and are at a more standard (well popular) voltage. Though that means a worse precision, I can use half stepping or use better ball screws to make up.

One last thing is I realised this morning that the extruder could potentially have a few motors attached but only one would be needed to work at once. This made me realise that I can use a multiplexer to choose which motor I want to activate and control. The reason for this is that it allows the duplication of the PWM channels to be used for all the motors attached and uses less pins on the chip all up.

That's it for now, hopefully by next post I'll have I2C working on my ATmega88 (parts turned up today). From there I'll order some stepper motors and try and build a driver for those.

Sunday, October 14, 2012

ATmega series microcontroller for 3D printer

I'm going to start investing some money into this project. I went scouring the web to understand how the ATmega series worked, how to program them and if said programming could be done with open source software like GCC. This post shows the steps I took though I didn't actually do them in this order as I sort of stumbled round trying to work out what to do.

I choose the ATmega series of Atmel chips because it seems very popular - it has lots of people using them for a very large range of projects and my mate uses them so I could get help if I needed. The first step was to find what all the different numbers at the end of the ATmega name meant. I found out that this is mostly to do with memory, such as they have 8k, 16k, 32k, 64k and 128k flash. The numbers and letters after those were for features such as numbers of channels for ADC (analog to digital converter), PWM (pulse width modulation) and DAC (digital to analog Converter) for example. I also had a look at other AVR chips that were SMD based and found the AT90PWM2B model that has 9 channels for PWM which would be great for doing some of the slave controllers. SMD for the production model would be great as although not use to reuse, it reduces the size of the PCB phenomenally. The 9 PWM channels would be great for the extruder and Z slide controller due to the number of steppers (each requiring two PWM channels). There was also AT90PWM3B which had 11 PWM channels.

I next went looking for a programmer. My TI LaunchPad MSP430, had a development board that I used to program so I thought this was the easiest thing to use. I had a look round and I couldn't find anything similar, all I could find was very feature rich (but useless features for my case) development boards and they tended to be very expensive. I decided there must be an easier way to program, so contacted my friend and he referred to me the AVAVRISP2 or mkII. This allows programming by a six pin header connected to the chip. This was very different to the MSP-EXP430G2 board I had used previously.

I next looked at programming tools. The AVR software is free for windows so I will install that under windows but most of my time is spent in Mac OS and occasionally in linux. This meant I had to find another solution which came in the form of avr-gcc, avr-libc and avrdude. These are all open source and based on the equivalent for linux except for avrdude which is the downloader that is specially designed for AVR chips which encompass the ATmega chips.

After this I was feeling quite enthused and went looking for some advanced designed people had used and found that people had managed to get SD cards and network (with IPv6) to work. Once such project is the ethersex project. This has all sorts of functionality including SD cards, IPv6, screen controller and an HTTP server which would be a great was of sending data to the printer.

So some time this week I'll order some ATmega88A-PU chips, the AVAVRISP2, another breadboard (I have one but its my dad's) and I'll get some header strip so I can interface the AVAVRISP2 to the breadboard. My first project on the chip will be to get the LCD display working and then I'll move on to stepper motor controllers (where I'll use this stepper motor which I referenced in a previous post). Hopefully should all be much easier than the cheaper but very much worse quality MSP430 I have. That is all I have to say on the electronics for now, I have some ideas for the mechanical and structural side of things but that can wait for another post.

Saturday, October 13, 2012

Extruders, heaters and more

Another day another post. So I was waiting to ask someone a question at uni today so last night and today I've done a heap of research, which I've put into sections (sort of) to try and make sense.

So firstly, in the last post I was talking about whether to use slave controllers. Well I realised today on the bus, that the slave controller idea would also be far better for the extruder controller. This is because it would be far easier to upgrade that with more pins for more functions such as multiple extenders, sensors and fans compared to constantly upgrading the master controller. It also as I think I mentioned last time could do errors and monitoring to stop annoyances such as this (which as is stated at the end of the page, was caused by poor quality filament). Talking of which I found a blog for an electrical engineer in the UK who has been playing round with a MendelMax also so I got some ideas of there. The site is http://richrap.blogspot.com/. Staying with controllers, I've decided I'll go for the ATMega micro controllers for the slave controllers. They seem to work well, my mate has one and loves it, and my current MSP430 chips are annoying me to death. I've been trying to fix a problem (even directly used their sample code and wouldn't work) with one for over two weeks and still isn't working. So I've decided to give up on the MSP430 side of things for now, I'm sure other chips in the family work but the two I'm using from the G2XXX family are rubbish. I decided I also wouldn't use a PIC as it didn't support GCC which is what I would prefer to use for development as it is available on multiple platforms (I use Mac OS X, Windows 7 and XP and multiple variants of Linux).

Now for some heating. I decided early on I would prefer a sort of climate control, as in a heater to keep the ambient temperature constant and then fans to extract heat when necessary. The bed and extruder would be within an enclosure to keep the temperature constant also by reducing convection. So looking into it I found that the best type of base heater is a PCB type, basically small wires on a PCB with excess current being pushed through so it heats up. This is elegant but can be expensive if the boards are professionally made. (Reference: http://reprap.org/wiki/Heated_Bed). I think this is the best option still and can be made to have etched warnings on the other side of the PCB. The RepRap has a 300x300mm PCB heater but this is really a tad on the small size for what I would like. I also think that a glass top would be the best for the base of the work area so to spread the heat more evenly. In this post it is recommended that a mirror could be used instead as it had better evenness in the heat. A page on the UltiMaker site said that sheet metal was better than glass at evenness by a magnitude of 27 times. This is relative to pure glass though and since mirrors have a thin metallic layer, I think the mirror would work better as sheet metal has sticking problems, gets scratched and hence has to be replaced every so often. The same site also mentioned how ventilation and fans can cause localised cooling on the head bed and some of the effects. I think I would incorporate two fans one for blowing air in and the other air out. This though is just thoughts and I haven't analysed the best practises here as this is more of a feature than something that is required to print.

Moving onto items of a building nature, I think the electronics should be placed underneath the heating bed. There would obviously need to be insulation between the bed and the electronics so to not cool the electronics but I think its the best place for it. I initially had thought to make one of the walls contain all the electronics but have since decided that it would be nice if all four sides were clear with perspects or glass (perspects might melt I realised so might have to be glass). All the joints for holding things together should also be aluminium in this design as firstly I don't have a 3D printer to print plastic parts and secondly its still lightweight, cheapish and looks great.

Now something a tad more interesting and very central to the printer, the extruder or jet as I might occasionally call it. Firstly there are lots of designs and the background on simple extruder's on the RepRap site here. I will use this basic design for the plastic side of the extrusion. Qu-Bd came up with a simple idea for making the filament stay in the middle of the gearing that pushes it through so to make sure it won't mass a beat. This is done, quite simply by having the middle of the gear curved. As I've said before I want to be able to have multiple extenders so to I can get different colours during a build. So tonight I had a look round at different systems for stopping fluids. I had envisioned a pneumatic system that sort of sucked up the fluid if it needed to stop quickly but I soon realised this was complex and maybe not even practical. I kept looking round and eventually realised that in essence it was just a valve I needed. So I found three types of valves that might be useful, diaphragm, pinch and knife. The first two are two complex and expensive to use so a simple and fast moving knife valve should do the trick. The design I'll use will be slightly different from a conventional knife valve though as it needs to be able to fast move. This shouldn't be a problem though as the area that the valve will be acting on will be quite small. Just for reference on one way of mounting a three way extruder, (though this one does not use valves to stop drips) here is one from the blog I have referenced prior.

Now here is something exciting, the chocolate extruder! Firstly this extruder will have to be separate from the plastics one above due to cleanliness and safety. This means that the carriage that holds the extenders will be made for quick changes. I've decided that I'll use a separate device to get the chocolate into the correct state. This can be controlled by the master controller but has to be separate as to keep aesthetics as well as weight considerations on the structure. Due to this I've realised I should be able to pump the molten chocolate through a heated tube similar to this Freeflex Heated Tubeing straight to the jet to print. This is lightweight and means it easier to keep a constant supply of chocolate on the go for large models. With chocolate, I've found out that there is different phases or types of chocolate and that one of these is particularly favourable. This is due to the higher strength, higher melting point and crunch of the phase. This means that chocolate should be heated up to approximately 40 degrees, given time to cool then heated to between 27.3 and 33.8 so phase IV will melt but phase V (the desired phase) won't then its ready to be printed. If there are impurities such as milk in the chocolate the temperature range decreases.

So with all that in mind, I think after exams I will buy an ATmega development board, get it working with my LCD I2C screen (I2C is the thing that just won't work on my MSP430) and then buy a stepper motor and make a driver up for it. Then if that goes well I can start designing more of the electronics. On the structural side, I need to work out how rigid everything needs to be and start formalising my designs by constructing them in inventor rather than my mind.


Thursday, October 11, 2012

More structual ideas and some basic electronics


So I've been too busy with uni (my damn uni exam are in three weeks), so have felt guilty about starting to design things in inventor so tonight decided to jot down a slightly more detailed designed compared to the previous sketch.
Yesterday I also asked one of the lab techs at uni about an issue I had previously stated about controlling the steppers with a slave controller or not. He said that he had done both previously and said that it really depends on the grunt of the master controller, as it should be doing error management on top of just the control. So with that in mind I think I'll use slave controllers to manage the steppers. Talking of which another conundrum I've come up with is how to operate the Z plane. I've decided telescoping is too complex and would also be more flimsy compared to moving the entire frame. This has made me think how many steppers to use for the Z direction. If I have two it means that at any point in time one of the other two plane could be on an angle which would be bad. I'm thinking I will probably just use two motors and make the frame more rigid by how its mounted onto the pylons in the corners, maybe having a second join on the Z slide round the back of the pylons, though this would make it slightly harder to mount a case. This is also a problem as the weight from the XY steppers will mean there is more force in certain places compared to others. The stepper motors are only around $20AUD so maybe its better having three Z steppers as it might be cheaper all up. Another issue I had raised previously was the weight of the ball screws. I've decided these aren't a problem as they won't weigh much relatively and other materials will most likely deteriorate quicker.

One last thing was that I had a quick look at development boards for the electronics today on element14 (Farnell) and I'm thinking either the Texas Instruments: TMDXDOCKH52C1 - H52C1 Concerto Experimenter Kit or FreeScale Semiconductor: FRDM-KL25Z - FreeScale Freedom Board. Most of the others they had on offer were much more like a computer on a board rather than basic development boards. I think I'll start off with one of these and get a feel for how they work and then if needs be design my own board. I haven't looked into the slave controllers but I'm thinking of using either TI MSP430s, Atmel ATmegas or a Microchip PIC. The TI MSP430s I have at the moment seem to not work as well as they are made out to, even when simply copying example code so I will most likely use one of the other two.

Tuesday, October 9, 2012

Printer Design ideas

As I said before I've now installed inventor and so ready to start making proper designs. Unfortunately uni work has to come first so that has taken priority. In the mean time I'll write a short post on the the printer that is giving me the most ideas as well as ideas I have conjured up.
The printer I have most respect (and is DIY) is the RepRap MendelMax. One of the features of this model is that it has an aluminium frame. I think this is a great idea as it is strong, light and aesthetically appealing. I've done a very quick look on the net and found a maker in Australia that makes these aluminium profiles (Maytec). These would be great and have the advantage of being able to use the slots in the profiles as guides for the axis as long as they are accurate. Talking of accuracy, two other thoughts came to mind. One was a higher accuracy stepper motor such as this Nema 17 - 58 oz.in, which has twice the accuracy of the stepper on the MendelMax. The second thought was to use a ball screw to position the printer jet as is accurate and could also move faster than traditional threads due to the lower friction. The only problem with this is they seem to only be made of steel and are hence quite heavy. I tried to find one made out of aluminium but couldn't find one.

A further functionality is the addition of perspects or similar to be used as an enclosure as done in the commercial models. This helps with the printing as it keep the model while being built at much more of a constant temperature (assuming there is also a base heater) which allows the product to cool down as a single unit rather than cooling down in phases/layers and thus could cause cracks and deformations.

A final idea for this post which I haven't decided on yet is the possibility to have each stepper motor controlled by its own microcontroller. One of the reasons for this is practicalities due to the cables that come with the motors being short and thus being hard to route all the way back to the master controller for the printer. It would also mean its cheaper to fix/replace due to the individual boards being replaced and not the entire controller. The down side of this is the latency of the master controller deciding what needs to happen but then rather than telling the motor directly it sends the commands to the slave controller, ie it adds another step into the scheme of things. So I haven't decided the best way to do this yet but I'll keep thinking about the pros and cons of each. I'll also have a look at the MendelMax and see how its done for that but I think its controlled directly.

Monday, October 8, 2012

3D Printed Optics

Here's an interesting application for 3D printing I came across today. It requires a high resolution to print but otherwise would be quite doable.


Sunday, October 7, 2012

3D printer embedded OS

As I can't download Autodesk Inventor until tomorrow due to the 8GB download, (it was wiped from my comp when I upgraded from Windows XP to 7 recently) and so can't start designing yet, I decided to have a quick look at embedded operating systems. I would preferably like to run the controller on an ARM chip as they are readily available, have a big community and thus have a large amount of documentation available. I also wanted 32bit so to get a large enough number to easily manipulate numbers for positioning etc. Other requirements I wanted were the ability to use network (as mentioned in the previous post), for the cost of a development board for this to be not too expensive and preferably not too much wasted memory (ie preferably a small footprint). I'm also a fan of open source software and hack-ability so once again, didn't want to go the commercial/proprietary route.

There's lots of different avenues to go down. I had a good look into Contiki, which would just about do everything I wanted but there were two problems, it didn't support 32bit operating systems and also the network stack didn't support IPv6 so wouldn't be future proof. I then scoured google and wikipedia for lists of embedded operating systems and found μClinux and freeRTOS. These both looked promising but the former was actually just the kernel and would have to be made into an operating system to work and freeRTOS unfortunately didn't come with a network stack. I kept looking round and found Tiny Core Linux, this looked great and did everything desired, even was able to be compressed down to 8MB but then I found out it would only work on x86. This might be able to be ported over to ARM but I thought I would keep looking for the time being. I kept looking and then somehow got reminded about ArchLinux ARM which I had found out about a while ago (I run Arch on some of my linux boxes at home). This although larger at 125MB or so, it had everything else, had instructions for different types of popular ARM boards and would mean I wouldn't have to relearn libraries for programming. The other option from all of this is to build an operating system from scratch. I would love to do this but the time constraints and effort I want to put into the project don't allow such a massive undertaking.

So out of this comes 3 options, I can go the easy route and go for ArchLinux ARM on one of the boards its supports, I can try and work out how you can make an operating system and then use μClinux as the kernel or I can fully port Tiny Core Linux over to ARM. ArchLinux is the easiest and due to memory and other components being so cheap the most likely to go for but Tiny Core Linux would be more efficient, less of a foot print and if I was to ever do a proper embedded controller would be cheaper to mass produce.

What I use in the final product is still ages away, if I even make it that far, so its not too important for now but as I didn't feel like doing uni work tonight and didn't have Inventor installed, it was well worth the look around to see what was available. I think I'll be going for ArchLinux though as it will take far less time to setup.

3D printer ideas

So my first proper post. I'm thinking of designing a 3D printer. I love the idea that something can be designed on computer in CAD and then be made into a fully working construction. This recently happened when I designed a circuit for a crane driver (speed, sensing, direction etc) and in the time of a few weeks, went from no idea on how to do parts of electrical design, to designing it in CAD (I used KiCAD for anyone wondering), threw ideas around with a friend doing the same unit, to having the design I had made in CAD being printed on a physical board I could hold and being able to solder components onto it. I haven't tested it you so still to get the gratification from that. But I digress (always wanted to say that!), so I want to make a 3D printer as is a great idea, I'm into robotics and doing Mechatronics engineering, so a 3D printer would be great to make parts for robotics to test ideas.

I've been playing round with the idea for the last year or so but previously haven't had time or the skill to put into designing one or understanding how the open source ones on the internet work. I have now and I've decided I would like to make my own for a number of reasons. These are, the price - the price of even the low cost designs are still quite expensive, and if I was to buy a kit or a commercial design this would end up being a lump sum. It would also be hard to fix if something went wrong as most of the parts seem to come as kits. The designs - the open source designs are all great and I'll most likely take some ideas from these but the engineering drawings seem to have been lost and so there are only templates or digital files for making the parts. This annoys me as engineering diagrams are obviously how someone in the know would make these so you should be able to easily find them but alas I can't (they might be hidden somewhere I guess). Same goes for the electrical side of things, I can find the board to buy to get it to work but there isn't a schematic or PCB diagram so to make your own. This would be quite likely far cheaper than buying the parts built up and would be easier to customise the circuit to different actuators (motors) at different power ratings, sensors for better determining where something is in the field to control mechanisms, where I would get it to run directly via USB or SD card but would love to improve this so to be able have it networked so can be elsewhere in the building and print to it or have multiple computers print to it and create a queue of projects to be made. Another feature I couldn't see on the open source models (I didn't check the commercial models as way over my budget) was the ability to have multiple jets, this would allow colour change on the fly for instance or different materials, such as plastics in two and different coloured chocolate in another two. My last feature I want but couldn't find was a large work field, most of the 3D printers I could find had a small workspace, normally less than a foot cubed (30cm^3) and if I'm going to do large robotics stuff, it would be much better if I could make it at least a foot and a half (half a meter) cubed, possibly even bigger as I have a project in mind which would be quite tall (I'll get to that in a second). So all up I think designing my own would be a good learning experience and challenge as well as improving upon designs. I'll try to post all my designs up on here too.

Just remembered a couple more things sorry. The first one being that the open source designs all seem to be in triangle shapes, which I don't understand, yes that might be strong but your only moving round a nozzle so a cubed shape would give more freedom and address the next issue. This is that these triangle shapes mean that the work is moved in one of the planes rather than the nozzle, this basically means the equipment has to be double the size of the work area in one direction which to me seems a waste of space. The other thing I remembered was that on none of the designs does the nozzle change angle, I'm not sure how useful this would be but I would have thought you could make slightly better designs, or at least add things to previous designs.

So that project I had in mind, well its a large item made out of coloured chocolate (not just white, brown and black but maybe yellow for instance). I would say more but it I want it to be a surprise at the end of the project for someone so I can't say anything more unfortunately.

Update: here's a picture of some ideas I scribbled down: