Thursday, November 1, 2012

More Electronics

I still have exams, hence I'm still avoiding long periods of time on the structural side of things.

Since the last post I've had a look into ARM programming as I didn't understand how they were programmed (physically as in the connection type and protocol). I found out that in general they are programmed with JTAG using a 10pin IDC connector but can use a 20 pin connector for debugging. This was different from what I was expecting as I thought there would be far fewer pins like the smaller chips have that tend to have 4-6 pins (though I have only just got into the world of microcontrollers). While doing research I found a nice website that explained how to do the programming and downloading/flashing with open source tools. Basically uses standard GCC tools along with a tool called OpenOCD which is the flasher and debugger.

In terms of the actual chips, I found a number of manufacturers. I only really want microcontroller style chips (ie without graphics and related) so I excluded chips from the likes of Samsung that are more geared towards smart phones and tablets. So the manufacturers I'm considering are Atmel, STM (STMicroelectronics) and Qualcomm. I'm leaning towards STM as they seem to have good range and value. I've just checked the OpenOCD and found a page that says which programmers it supports, here. I think I will go for the ST-LINK/V2 as it is cheap ($28.40) though does only work with STM chips. The other option I think is the Segger J-Link which is more expensive at $67.62 but should support multiple manufacturers.

For communication between the controllers, I had previously said that I2C would be what I would use and on the slave controllers could use binary switches to choose an address. Since then I decided I would take off the switches to make the boards smaller, combining with using an ATTiny rather than an ATMega for an even smaller footprint. In the last week I have also decided I will move away from I2C due to speed and complexity in coding. Instead I will use SPI, which although needs slave select lines, the use of a multiplexer can be used to ease the number of pins needed on the master controller. SPI brings the advantages that its faster and is less prone to errors. Some good information about the two can be found on stackexchange.

Next I have ordered and received the stepper motors. This is good as I can now get the weight for force calculations and I can start designing the circuit for controlling them. The only other large weight for slides are the ball screws which I will purchase after I've design the surrounding structure and the stepper driver circuits. I might also need to include gearing of some sort on the z slides as the gravitational force may try and turn the ball screws and the holding torque might not hold this. I'll have to wait till I design it to see what happens.
The stepper motors

Talking about the stepper motors, I've decided to go with a dedicated stepper motor controller chip. This is because, the cost of these chips are far cheaper than all the parts to make one the equivalent controller are combined. There are two chips I've looked into and these are the L293 and the A3982. The L293 has a DIP packet so is easier to prototype with but is more a general motor controller and so it needs four or five pins for control. The A3982 chip is SMD SOIC thus is hard to prototype with but is specifically designed to control bipolar stepper motors. I'm going to get one of each chip and have a practise with both to see what is the best fit but I think the A3982 will be the go. To overcome the SMD SOIC problem, I'm going to buy some breakout boards for prototyping. I'm going to buy my boards from Little Bird Electronics as are based in Australia so hence shipped here and were cheap. I had previously found places in Singapore and the UK but they didn't ship here and were too expensive retrospectively. I can then, at a later stage, go to a specialised PCB that the chip can mount directly onto, ie the slave controller board.

For soldering the SMD to the breakout boards and PCBs, I'm going to use the hotplate method that is described here and in the links contained in that link. This is easy and cheap plus I can reuse the hotplate for other workshop activities and experiments. I'm also thinking of investing in a tank etcher as from my research they have better accuracy thus meaning thinner tracks can be made. We have a tray for doing PCBs at home though so this is a purchase that I think will have to wait till I have surplus money again.

Going back to the slides once again, well the z slide in particular, I'm thinking I'll simply connect the two motors together onto the one driver. This is because otherwise the slide could potentially become uneven and so not be accurate. The other options are to drive from just one side and hope there is not enough of a moment to cause inaccuracy, (probably in conjunction with tight tolerances on the slides/guides themselves). The third option is to drive the slide from the middle. I decided that these other methods were not as practical or accurate due to forces and my original idea of having each on a separate controller was also less accurate due to each controller being communicated with separately and thus causing a timing delay.

To finish off with I have some smaller ideas for neatness, usability and ease of use. Firstly I think the wiring for the controllers back to the master controller should be put inside plastic tubing. This is good for mounting and looks neat. The next idea is to put and optical sensor above each extruder to check if there is plastic/filament available. An idea for heating is to put an apex or some other type of shaping at the top of the casing to funnel the heat to a specific spot to then fan off as this would help with temperature evenness rather some parts being affected more than others. Finally two feature that I can implement after I've got the printer mostly working. The first one of these is to set up the GUI so a pre-made object can be split to have different colours. I think I would somehow manage this by using an overlay technique which then gets analysed to get which parts want different colours and can then modify the code sent to the printer. The last and final idea I had is purely for awesomeness. This is simply a camera attached with streaming ability via the network. This means you could watch work being created without having to be next too it, or record something being made or check progress when not on location.