tag:blogger.com,1999:blog-148887852024-03-13T15:04:28.982+00:00Stuff, things and junkNickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.comBlogger90125tag:blogger.com,1999:blog-14888785.post-722973637920346322010-05-03T19:09:00.003+01:002010-05-03T19:12:17.211+01:00The blog has moved!I've decided to migrate from Blogspot.com and Blogger to <a href="http://www.wordpress.org/">Wordpress</a> on my main web page at http://www.brokentoaster.com/<br /><br />You can find the new blog at <a href="http://www.brokentoaster.com/blog/">http://www.brokentoaster.com/blog/</a><br /><br />The RSS feed is at <a href="feed://www.brokentoaster.com/blog/?feed=rss2">feed://www.brokentoaster.com/blog/?feed=rss2</a><br /><br />Apologies for any inconvenience this may cause.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-16968043250600771932010-04-24T12:49:00.003+01:002010-04-24T12:50:49.451+01:00Back in the UKJust got back to the UK after a volcano related extension to my holiday in NZ. I've also fixed the EAGLE files link for the Arduino MP3 player shield mentioned in t<a href="http://stuffthingsandjunk.blogspot.com/2010/02/arduino-mp3-rev-b-v00.html">his earlier blog post</a>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-69307958966339445112010-03-30T19:50:00.003+01:002010-03-31T16:55:10.622+01:00reprap first print! - video<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/m7bduDes_Ks&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/m7bduDes_Ks&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" ></embed></object>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-63508781306304541402010-03-27T19:47:00.002+00:002010-03-27T21:07:49.465+00:00Reprap first print!<a href="http://www.flickr.com/photos/nicklott/4467749394/" title="Mendel lives by Brokentoaster, on Flickr"><img src="http://farm3.static.flickr.com/2622/4467749394_b320d28230_m.jpg" width="240" height="177" alt="Mendel lives" /></a><a href="http://www.flickr.com/photos/nicklott/4466974157/" title="Reprap Steper motor driver by Brokentoaster, on Flickr"><img src="http://farm3.static.flickr.com/2486/4466974157_75eab33ecf_m.jpg" width="240" height="180" alt="Reprap Steper motor driver" /></a><br /><br />After four months of soldering and mucking about with screws and metal things I finally have a working 3D printer. <br /><br />This was built using <a href="http://makerbot.com">Makerbot</a> electronics and aluminium versions of the printed parts. I will publish the drawings of the machined parts as soon as I have 1) tidied them up, 2) fixed the mistakes I put on them and 3) confirmed the design actually works. I made a few changes from the designs released in November in order to make them machine-able, but for the most part they are true to the original designs and taken from the STEP files or the STL files converted back into CAD files.<br /><br />I've deliberately mounted the electronics in an open fashion on standoffs on an aluminium base plate to facilitate testing as I plan to improve and refine the design. I'd like to improve the electronics, PCB design and location of boards with an eye towards EMC and proper shielding, but for moment they are open to allow scope and multimeter access. I hope to tidy up all the cables into tidy looms and things a bit once I'm happier with the performance and reliability. I had an opto-interrupter board fail on me which resulted in a couple of crashes so I've temporarily replaced them with some very cheap push buttons. Probably a short circuit on the veroboard versions I built up, that'll teach me for being too cheap to pay $1 for a decent PCB.<br /><br /><a href="http://www.flickr.com/photos/nicklott/4467753016/" title="Repraped Lego brick by Brokentoaster, on Flickr"><img src="http://farm5.static.flickr.com/4008/4467753016_4f925bfb7b_m.jpg" width="180" height="240" alt="Repraped Lego brick" /></a> <a href="http://www.flickr.com/photos/nicklott/4467754960/" title="gear, brick and gear by Brokentoaster, on Flickr"><img src="http://farm5.static.flickr.com/4017/4467754960_c7dce6aaf4_m.jpg" width="240" height="160" alt="gear, brick and gear" /></a><br /><br />I am reasonably happy with these prints as a first attempt. I think I really need to tweak the settings and the operation of the extruder to get things working better. (The part designs are from <a href="http://www.thingiverse.com/thing:1336">Thingiverse parametric spur gears</a>, <a href="http://www.thingiverse.com/thing:591">Thingiverse parametric Lego block</a>)<br /><br />I'm quite glad to notice the latest version of host software is functioning on OS X, it saves me having to boot up windows every time I want to print. I say functioning and not working as it doesn't quite fit all the controls on the screen nicely and does odd things every now and then. But it is better than it was a couple of months ago and so it is looking good for the future.<br /><br />Sadly I'm off home to NZ for a few weeks so wont get a decent chance to to get it all going properly till the end of the month. On the other hand the software may have moved forward another step by then as well and I might even take the time to read the instructions.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com1tag:blogger.com,1999:blog-14888785.post-61309143489309160202010-02-15T22:31:00.005+00:002010-02-15T23:17:34.866+00:00Arduino MP3 Rev B v0.0<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.brokentoaster.com/images/ardmp3reva.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand; height: 150px;" src="http://www.brokentoaster.com/images/ardmp3reva.jpg" border="0" alt="" /></a><br /><br />Last week I managed to have some luck with my Arduino MP3 shield. The big hold up was caused by not having enough power from the FT232RL chip to supply the decoder and the memory card at the same time (50mA max d-oh). I also had a software issue, I had not altered the code to deal with the 16Mhz clock speed of the arduino from the 8Mhz I was using on the ButterflyMP3 project. The SPI clock was running at 8Mhz where it needed to be slower than 6MHz (to comply with the VS1011E datasheet). Once I had that sorted everything just popped into place and started working reliably. <br /><br />I apologise in advance for the poor integration of the library examples. I have simply and quite roughly ported the minimal parts of my buterflymp3 project over to the arduino and this hardware. The examples will test reading FAT16 file system on the MMC/SD card, test the VS1011E decoder chip, and play the first mp3 file found on the memory card. I hope to get these tidied up later but have not had any time to do so lately.<br /><br />The PCB has not actually been tested yet so I'd hold off building a million of these until after a successful test. There is unlikely to be much wrong with it though as I have simply added a voltage regulator and re routed a couple of signals to fix my earlier mistakes. ( I'd forgotten that I/O lines 0 and 1 are used by the uart on the arduino)<br /><br /> I have embedded the BOM below. ( The bom is <a href="http://spreadsheets.google.com/pub?key=tFEBvN-LjONcA9UQbGKo7sw&output=html">here</a> if you don't see it below)<br /><iframe width='500' height='300' frameborder='0' src='http://spreadsheets.google.com/pub?key=tFEBvN-LjONcA9UQbGKo7sw&output=html&widget=true'></iframe><br /><br />Here are all the files so far. These are all released under a Creative Commons 2.5 license .<br /><br /><a href="http://brokentoaster.com/arduinomp3/files/arduinoMP3_eagle.zip">EAGLE files are here</a><br /><br /><a href="http://brokentoaster.com/arduinomp3/files/arduinoMP3_gerbers.zip">GERBER files are here</a><br /><br /><a href="http://brokentoaster.com/arduinomp3/files/arduinoMP3_library.zip">Arduino Library files are here</a><br /><br /><a href="http://brokentoaster.com/arduinomp3/files/arduinoMP3_schem.pdf">PDF of the schematic is here</a><br /><br />To use the library simply put the "mp3" folder from the zip file inside the "libraries" folder in your arduino folder (create one if it doesn't exist). Restart Arduino 018 or later and you should have "mp3" entries in the menus under examples and import libraries.<br /><br />The BOM references a 2.8V LDO voltage regulator but the schematic shows a 3.3V. Either will work fine but the 2.8 will give you slightly lower power usage.<br /><br />If you are interested in PCBs or kits, drop me a line at <i><b>buy_pcbs@brokentoaster.com</b></i> <br />As always any comments, suggestions or ideas are welcome.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com4tag:blogger.com,1999:blog-14888785.post-62147825547710298372010-01-20T17:51:00.006+00:002010-01-20T18:44:42.041+00:00Reprap extruder heater<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/mendel/extruder-heater.jpg"><img style="display:block; margin:0px auto 10px; text-align:right;cursor:pointer; cursor:hand; height: 150px;" src="http://brokentoaster.com/mendel/extruder-heater_TN.JPG" border="0" alt="" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/mendel/extruder-heater-closeup.jpg"><img style="display:block; margin:0px auto 10px; text-align:left;cursor:pointer; cursor:hand;height: 150px;" src="http://brokentoaster.com/mendel/extruder-heater-closeup_TN.JPG" border="0" alt="" /></a><br /><br />My cheap polymide tape arrived from Hong-Kong yesterday so I was able to get the heater built on the extruder for the reprap. No problems with the construction of the heater itself, although after running some tests I discovered the thermistor I had chosen is only rated to 155 degreees Celcius. I obviously wasn't looking very hard when I ordered it or perhaps it was just the fact that it was one tenth the cost of a more suitable device that convinced me to buy it. I should have a new thermistor in this week and replace this one.<br /><br />Before going too far with my heater I wanted to test the system and check that the temperature measured was accurate. I ran three sets of tests. Using the <a href="http://www.brokentoaster.com/butterflylogger/">Butterfly Logger</a> with some DS18B20's and a SHT71 I logged the temperature of the barrel at the edge of the extruder (see close up above). The SHT-71 was used to monitor the extruder temperature with the DS18B20's monitoring ambient. The first test was logged at 10 second intervals with the later two logged each second. <br /><br /><b>TEST 1</b><br />The first test was a 0.2 deg C/s ramp from near ambient up to 75 deg C and then a step change to 100 deg C and then passive cooling. This is shown in the plot below. The period of 10 seconds seemed too slow to give me a good idea of the stability so n the following tests it was decreased to 1 second. This did show rough correlation between the set temperatures and the measured temperatures although not really as accurate as I had hoped.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/mendel/heatertest1.txt.png"><img style="display:block; margin:0px auto 10px; text-align:right;cursor:pointer; cursor:hand; width: 400px;" src="http://brokentoaster.com/mendel/heatertest1.txt.png" border="0" alt="" /></a><br /><br /><b>TEST 2</b><br />This test was a controlled ramp of 0.2 deg C/s from near ambient up to 100 deg C. After holding at 100 deg C the system is passively cooled to 50 deg C. The system holds at 50 deg C momentarily before being given a step change to 100 deg C, after which the system is allowed to cool to ambient.<br /> The better time resolution allows the system stability to be better assessed. The system looks reasonably stable at the 100 deg hold mark. Here it is cycling around 5 deg around the set point. The 'stable' temperature is slowly rising which I attribute to the thermal mass of the barrel and thermal barrier warming up. It is not 100 deg C as it is not measuring at the same point where the control thermistor is measuring. Looking at this initially lead me to check the characteristics of the thermistor I was using and is what lead me to discover that it was only rated at 155 deg C. In checking the data sheet I also noticed a diference in the Beta value fromt he look up table used in the extruder firmware. I recalculated the look up table accordingly and repeated the tests in test 3.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/mendel/heatertest2.txt.png"><img style="display:block; margin:0px auto 10px; text-align:right;cursor:pointer; cursor:hand; width: 400px;" src="http://brokentoaster.com/mendel/heatertest2.txt.png" border="0" alt="" /></a><br /><br /><br /><b>TEST 3</b><br />This was a repeat of the previous tests with the new lookup table ( Beta = 4400). This seemed to give a ramp rate twice of what was programmed (0.45 deg C/s compared to 0.2 deg C/s). The temperatures seemed hotter which is expected given the change in thermistor table for the control firmware. <br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/mendel/heatertest3.txt.png"><img style="display:block; margin:0px auto 10px; text-align:right;cursor:pointer; cursor:hand; width: 400px;" src="http://brokentoaster.com/mendel/heatertest3.txt.png" border="0" alt="" /></a><br /><br />The next test will of course be to see how the system performs when loaded i.e. extruding some plastic.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-86132490671969716202010-01-17T21:02:00.007+00:002010-02-23T18:11:33.896+00:00Reprap Electronics build<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/mendel/elec_test.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;height: 150px;" src="http://brokentoaster.com/mendel/elec_test.jpg" border="0" alt="" /></a><br /><br />I ran out of time this weekend to get anything done on the MP3 shield or the MLMC projects. I did however manage to find time to solder up the electronics for my reprap I'm building. After a couple of hitches I also got the firmware on and up and running.I had to download the latest from SVN else I got a clash between the stepper-motor drivers and the servo motor drivers in the firmware for the extruder.<br /><br />I built the mother board to use a standard PC power connector even though I'm building a reprap. It just seemed silly to power this PCB via USB and then rig the power-supply to power all the other boards. I temporarily used the USB 5V to power the PCB via a pin on the JTAG connector during programming the firmware. Before the firmware on the mother board was programmed the PC PSU wouldn't fire up so I needed a temporary power supply.<br /><br />I managed to test the extruder board with some test software I found at <a href="http://objects.reprap.org/wiki/Microcontroller_Firmware_Hints#Driving_Steppers_with_the_Extruder_Controller_V2.2_.28Arduino_inside....29">http://objects.reprap.org/wiki/Microcontroller_Firmware_Hints#Driving_Steppers_with_the_Extruder_Controller_V2.2_.28Arduino_inside....29</a>. But I haven't managed to get it working through the mendel firmware via the host software yet. The thermistor was working so I know the RS485 link is functioning properly. Probably just a configuration.h option I've over looked.<br /><br />It took a couple of hours to get the three boards all soldered up and tested. I'll post more when I have more done. I'll probably be focusing on the mechanical side of building the Cartesian robot for now so not much electronics left to do, although I still have the firmware to sort through...<br /><br /><i>[EDIT] It turns out that I had overlooked the I2C connection between the motherboard and the extruder board. I should really have read the instruction.</i>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-9999788242703429952010-01-05T20:12:00.006+00:002010-01-05T22:42:24.320+00:00New PCBs in from BatchPCB<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.brokentoaster.com/images/ardmp3reva.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand; height: 150px;" src="http://www.brokentoaster.com/images/ardmp3reva.jpg" border="0" alt="" /></a><br />My order of PCBs from BatchPCB arrived the week before Christmas so plenty of soldering and things to keep me busy over the holiday. I've also been distracted of late with building a <a href="http://www.reprap.org">reprap</a>, although I've not got much further than amassing a number of PCBs, components and motors, watch this space for details as the build progresses.<br /><br />My Batch PCB contained a new version of the Arduino MP3 board with provision for running from the 5V Duemilanove Arduino and a number of MLMC boards so I can string them together for testing. Unfortunately the ArduinoMP3 PCB had a couple of design errors, which is typical when your working on a design off and on over a course of months. The design will probably be released soon, but the libraries and demo code are also proving slightly more difficult.<br /><br /><b>Some changes to Hardware.</b><br />The basic design of the board is the same, VS1011 and SD card shared on the SPI bus with a 5 way Joystick on some digital lines.<br /><br />I forgot about the TX/RX lines being shared with digital 0 and 1 on the arduino so I've had to re-route signals using those pins to the previously unused analog/general IO pins. <br /><br />A couple of changes related to running the circuits on a 5V / 3V3 system. My Butterfly MP3 system that I based this on was powered from a single supply rail of 2.8V. The FTDI USB chip on the arduino was originally used to provide a 3V3 supply to the shield. I thought the 50 mA stated in the data sheet would be enough as my butterfly mp3 system only used about 50mA including processor and display. Unfortunately the is a large current draw when an SD Card is inserted causing the FTDI chip to reset and breaking connection with the PC. Although not a big problem I decided to add an LP2981 LDO regulator to supply a 100mA for the card and MP3 player circuits. If you don't want to use this then you can not fit the parts and easily bypass with a jumper wire.<br /><br /><b>C++ing the libraries</b><br />I was hoping to use the existing libraries for the Arduino and SD cards to access the MMC/SD Cards and provide demo code to show using the shield. For an as yet unknown reason the existing libraries from Adafruit wave shield do not work. In order to test my hardware I have converted my MMC and FAT libraries from the ButterflyMP3 project to C++ for use with the Arduino system. I few teething problems and issues as I remember how C++ works and I now have a working SD Card system. Output from my current software is shown below<br /><br />I'd like to use the already available libraries as they offer FAT32 and extended features over my bare bones implementation - so not quite ready to publish any finished code just yet. <br /><br />Next step is adding the support for the VS1011. Again not quite as smooth as I'd hopped but moving along with the help of the old <em>intronix logic port</em>. Currently the VS1011 is not setting up correctly. Occasionally it plays OK but mostly nothing or a very slow version of a song, indicating to me the clock registers are not being set correctly. <br /><br />I think another weekend or so of work and I'll be there but if you'd like a copy of the current PCBs or Arduino files then just drop me an email or leave a comment.<br /><br /><br /><br /><b>Current Demo Software Terminal Output</b><br /><pre><br />TEST<br />0<br />MMC_RESET returned 0<br />MMC_SEND_STATUS returned 0<br />MMC_SEND_CID returned 0<br />0: FE 02 54 4D 53 44 30 31 47 28 9A CF 7B 33 00 7A ..TMSD01G(...3.z<br />1: 83 08 8E FF FF FF FF FF FF FF FF FF FF FF FF FF ................<br />MMC_SEND_CSD returned 0<br />0: FE 00 2D 00 32 5B 59 83 D6 7E FB FF 80 16 40 00 ..-.2[Y.......@.<br />1: FB 5E C9 FF FF FF FF FF FF FF FF FF FF FF FF FF .^..............<br />MMC_Capacity returned 1037952<br />MMC_Name returned 0 SD01G(<br />MMC_Read returned 0<br />MMC First Sector: <br />0: FA 33 C0 8E D0 BC 00 7C 8B F4 50 07 50 1F FB FC .3........P.P...<br />1: BF 00 06 B9 00 01 F2 A5 EA 1D 06 00 00 BE BE 07 ................<br />2: B3 04 80 3C 80 74 0E 80 3C 00 75 1C 83 C6 10 FE ...<.t..<.u.....<br />3: CB 75 EF CD 18 8B 14 8B 4C 02 8B EE 83 C6 10 FE .u......L.......<br />4: CB 74 1A 80 3C 00 74 F4 BE 8B 06 AC 3C 00 74 0B .t..<.t.....<.t.<br />5: 56 BB 07 00 B4 0E CD 10 5E EB F0 EB FE BF 05 00 V.......^.......<br />6: BB 00 7C B8 01 02 57 CD 13 5F 73 0C 33 C0 CD 13 ......W.._s.3...<br />7: 4F 75 ED BE A3 06 EB D3 BE C2 06 BF FE 7D 81 3D Ou.............=<br />8: 55 AA 75 C7 8B F5 EA 00 7C 00 00 49 6E 76 61 6C U.u........Inval<br />9: 69 64 20 70 61 72 74 69 74 69 6F 6E 20 74 61 62 id partition tab<br />A: 6C 65 00 45 72 72 6F 72 20 6C 6F 61 64 69 6E 67 le.Error loading<br />B: 20 6F 70 65 72 61 74 69 6E 67 20 73 79 73 74 65 operating syste<br />C: 6D 00 4D 69 73 73 69 6E 67 20 6F 70 65 72 61 74 m.Missing operat<br />D: 69 6E 67 20 73 79 73 74 65 6D 00 00 00 00 00 00 ing system......<br />E: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />F: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />11: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />12: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />13: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />14: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />15: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />16: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />17: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />18: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />19: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />1A: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />1B: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 ................<br />1C: 37 00 06 03 C3 E6 F3 00 00 00 0D B3 1E 00 00 00 7...............<br />1D: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />1E: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />1F: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA ..............U.<br />0<br />SECTORS PER CLUSTOR 20<br />BYTES PERSECTOR 0200<br />FAT Init returned:0<br />SECTORS PER CLUSTOR 20<br />BYTES PERSECTOR 0200<br />FAT boot Sector info<br />FAT begins at sector 244<br />Clusters begin at sector 768<br />Sectors per cluster = 32<br />Root dir starts at sector 736<br />THESTR~1.MP3 00045 037A00 2E0F<br />THESTR~2.MP3 00124 03400 2E1A<br />THESTR~3.MP3 001F5 025C00 2E24<br />THESTR~4.MP3 0028C 030400 2E2E<br />TWINSE~1.MP3 0034D 051B249 2E39<br />THEWHI~1.MP3 00494 03867AF 2E45<br />THESTR~5.MP3 0057B 02FE00 2E51<br />THESTR~6.MP3 0063B 032B00 2E5C<br />THESTR~7.MP3 0079 034D00 2E68<br />BEASTI~1.MP3 007DD 02EC9A4 2E74<br />BEASTI~2.MP3 00899 02E93C3 2E80<br />BEASTI~3.MP3 00954 01F172F 2E8B<br />THESTR~8.MP3 009D1 03A300 2E95<br />THESTR~9.MP3 00ABA 02DC00 2E9F<br />THEST~10.MP3 00B71 02F00 2EA9<br />THEST~11.MP3 00C2D 026900 2EB4<br />05-ILE~1.MP3 00CC8 02E8C16 2EBD<br />BEASTI~4.MP3 00D83 03EF2C9 2EC8<br /><br />Files: 18<br />1A<br />DONE<br /></PRE>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-18474879426187806962009-12-06T20:33:00.003+00:002009-12-06T21:45:28.987+00:00STL to IGS (IGES) ConversionI've been trying to get my models from Sketchup into a decent file format for use with different analysis engines and for producing drawings for machining.<br /><br />After a week of playing about with different options I have managed to get from Sketchup files to IGES files.<br />I used BRL-CAD to convert from .stl to its native format and then exported as an .igs from there.<br />Below is a copy of the script i used to convert a whole directory of files.<br /><br /><code><br />#!/bin/bash<br /># Convert an STL file to IGES format using BRL CAD<br /><br />for file in *.stl<br />do<br /># Add the -b option or binary format stl files (aoi,solid edge etc)<br /># stl-g -b ${file} ${file}.g<br /><br /># Use ascii format for exports from sketchup<br /> stl-g ${file} ${file}.g<br />done<br /><br />for file in *.g<br />do<br /> mkdir ${file}.d<br /> g-iges -m -o ${file}.d ${file} all<br /> cp ${file}.d/*.igs ${file}.igs<br /> rm -rf ${file}.d<br />done<br /></code><br /><br />I did run into an issue or two along the way. When initially export as iges with the command <em>g-iges -o file.igs file.g all</em> the file produced caused every program I tried to load it with to crash with the exception of BRL-CAD which loaded it just fine. I found that when I used the <em>-m</em> option and export all regions to a directory of iges files the files worked. The STL files produced by the STL output plug-in for sketchup produces STL files in the ASCII format some programs may produce files in binary format, in which case you will need to add the <em>-b</em> option to the <em>stl-g</em> command. I had to use this when converting the STL files from the reprap project to iges files.<br /><br />Why IGES files? Because I couldnt get STEP files. While STL files are widely supported they are mesh files that describe surfaces only. Most professional mechanical CAD packages use constructive solid geometry (CSG) techniques and don't like mesh files so much. That's not to say I couldn't load STL files into these packages but the loaded part was less useful when imported from STL as compared to IGES. An IGES file allows me to measure and convert to a solid object or more easily produce drawings for a machinist to work with.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com8tag:blogger.com,1999:blog-14888785.post-77478347028088239082009-11-22T18:04:00.004+00:002009-11-22T18:14:30.356+00:00Complete 3D Model of Butterfly MP3<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_electronics.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_electronics.png" border="0" alt="" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_assembly.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_assembly.png" border="0" alt="" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_Case.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;;" src="http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_Case.png" border="0" alt="" /></a><br /><br />I hope to use this data to do some stress analysis of the case design using CAE Linux and look at geting the case built using SLA or SLS techniques.<br /><br />The Sketchup model is at http://www.brokentoaster.com/butterflymp3/photos/ButterflyMP3_and_Cases.skpNickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-5945364283887295382009-11-14T14:47:00.002+00:002009-11-14T15:01:47.850+00:003D Model AVR ButterflyI've been playing with Google SketchUp for a while as a free tool for doing electronics enclosure design (ie. MP3 Player cases). It seems quite capable although not really targeted at designs in the mm range. I think I will use a larger scale like 10:1 or 100:1 next time to see if that makes things easier.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brokentoaster.com/Butterfly.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://brokentoaster.com/Butterfly.png" border="0" alt="" /></a><br /><br />Here is my first attempt at an AVR Butterfly model for use in case designs on the data logger and MP3 player. You can download in skp and stl format. To export SketchUp files as STL I have used the plugin from http://www.guitar-list.com/download-software/convert-sketchup-skp-files-dxf-or-stl<br /><br /><a href="http://Brokentoaster.com/Butterfly.stl">Stereo Lithography (STL)</a><br /><a href="http://Brokentoaster.com/Butterfly.skp">SketchUp (SKP)</a><br /><a href="http://Brokentoaster.com/Butterfly.png">Image (PNG)</a>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-84563794239816766042009-11-14T13:58:00.004+00:002009-11-14T14:36:07.586+00:00Battery Capacity Logger MkIIA minor update to my battery logger script to tidy up the format of the log file and to make a slightly nicer (maintainable) script file.<br /><code><br />#!/bin/sh<br /># batterylogger.sh : Log the battery capacity to a file<br />#<br />filename=/var/log/batterycapacity.log<br />date=`date`<br />capacity=`system_profiler SPPowerDataType |grep "charge capacity"`<br />count=`system_profiler SPPowerDataType |grep "Cycle count"`<br />echo ${date} ${capacity} ${count} >> ${filename}<br /></code><br />This gives a log file output like the following <br /><blockquote>Sat 14 Nov 2009 13:45:06 GMT Full charge capacity (mAh): 4740 Cycle count: 163</blockquote><br />To create the log file in a sensible place like <code>/var/log/</code> I did the following:<br /><code><br />sudo touch /var/log/batterycapacity.log<br />sudo chmod 666 /var/log/batterycapacity.log<br /></code><br />I've also switched to using periodic instead of cron as I can't seem to get cron to work reliably. To make it work with periodic I simply place my <code>batterylogger.sh</code> script in the directory <code>/etc/periodic/daily/</code><br /><br />NOTE: I've had a couple of issues lately with pasting from the web into a script file and finding i get the following error:<br /><code>No such file or directory#!/bin/sh</code><br /><br />I've found that this problem is due to binary characters in my text file. I think they are UTF-8 encoded characters that have slipped in from cutting and pasting. To solve this problem I use the command <code>vim -b <i>script</i></code>. This will load up the file in binary mode so I can see what funny characters have found their way into my file. After deleting the offending character or characters the script functions as expected.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-57951312055255804002009-11-11T21:05:00.003+00:002009-11-11T21:52:17.465+00:00Battery Capacity LoggerI just replaced the battery in the 2005 ibook G4 today, great to return to the days of 4 hours of use. I decided I'd like to monitor the life of the battery and so wrote a quick cron job script to log the battery capacity every day. I also have installed this on my main laptop which still gives me 3 hours after 18 months of use.<div><br /></div><div>Write the script.</div><div><div></div><blockquote><div><span class="Apple-style-span" style="font-family:'courier new', serif;">#!/bin/sh</span></div><div><span class="Apple-style-span" style="font-family:'courier new', serif;"># batterylogger.sh : Log battery capacity to a file</span></div><div><span class="Apple-style-span" style="font-family:'courier new', serif;">#</span></div><div><span class="Apple-style-span" style="font-family:'courier new';">date >> ~/batteryCapacityLog.log</span></div><div><span class="Apple-style-span" style="font-family:'courier new';">system_profiler SPPowerDataType | grep "charge capacity" >> ~/batteryCapacityLog.log</span></div><div><span class="Apple-style-span" style="font-family:'courier new', serif;"><br /></span></div><div></div></blockquote><div>Make it executable and put somewhere sensible. </div><div></div><blockquote><div><span class="Apple-style-span" style="font-family:'courier new';">chmod 755 batterylogger.sh</span></div><div><span class="Apple-style-span" style="font-family:'courier new';">cp batterylogger.sh /usr/local/bin/</span></div><div></div></blockquote><div><br /></div><div>Make sure it is activated daily by adding the following line in crontab using <i>crontab -e </i>which will make it run at 5:10am every day. This time is chosen to not clash with other actions executing should my laptop be awake at 5am and also to ensure it run each morning when I wake the laptop up.</div><div><br /></div><div><div><span class="Apple-style-span" style="font-family:'courier new';"></span><blockquote><span class="Apple-style-span" style="font-family:'courier new';">10<span class="Apple-style-span" style="white-space: pre;"> <span class="Apple-tab-span" style="white-space:pre"> </span></span></span><span class="Apple-style-span" style="font-family:'courier new';">5</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:'courier new';"> </span></span><span class="Apple-style-span" style="font-family:'courier new';">*</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:'courier new';"> </span></span><span class="Apple-style-span" style="font-family:'courier new';">*</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:'courier new';"> </span></span><span class="Apple-style-span" style="font-family:'courier new';">*</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:'courier new';"> </span></span><span class="Apple-style-span" style="font-family:'courier new';">/usr/local/bin/batterylogger.sh</span></blockquote><span class="Apple-style-span" style="font-family:'courier new';"></span></div><div><br /></div><div>The format looks like the following:</div><div><br /></div><div><div><span class="Apple-style-span" style="font-family:'courier new';"></span></div><blockquote><div><span class="Apple-style-span" style="font-family:'courier new';">Wed Nov 11 20:03:26 GMT 2009</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> Full charge capacity (mAh): 4859</span></div></blockquote><div><span class="Apple-style-span" style="font-family:'courier new';"></span></div><div> I may improve the format in the future and add some nice "gnuplot" plots but this gives me the info I want right now. For the record, the outgoing battery was showing a capacity of around 350mAh. This translates to roughly 10-15 mins of use. OS X 10.5.8</div><div><br /></div></div></div></div>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-571507643198189572009-10-04T18:42:00.004+01:002009-10-04T19:49:51.719+01:00The MLMC website is up.I've just put a new website up for the MLMC project. No new information over what has been mentioned in the previous blog post, but it is a start. With the initial page up I hope it will encourage me to publish information sooner rather than later. Of course I still need to find time to do some actual work on the project. Next week perhaps.... You can find the site at <a href="http://brokentoaster.com/mlmc/">http://brokentoaster.com/mlmc/</a><div><br /></div>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-60099148469689643942009-09-18T14:25:00.009+01:002009-09-18T15:28:12.957+01:00Modular LED Matrix Controller (MLMC)<span class="Apple-style-span" style=" white-space: pre-wrap; font-family:'Lucida Grande';"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPA9s3CNI/AAAAAAAAAB8/G3UZsv3P7q8/s1600-h/IMG_9908.JPG"><span class="Apple-style-span" style="font-size: small;"><img style=" margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPA9s3CNI/AAAAAAAAAB8/G3UZsv3P7q8/s400/IMG_9908.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5349378072878975186" /></span></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPBGWmRhI/AAAAAAAAACE/jX6bmmcACOE/s1600-h/IMG_9910.JPG"><span class="Apple-style-span" style="font-size: small;"><img style=" margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPBGWmRhI/AAAAAAAAACE/jX6bmmcACOE/s400/IMG_9910.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5349378075201521170" /></span></a><span class="Apple-style-span" style="font-size: small;"> </span></span><div><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style=" white-space: pre-wrap;font-size:medium;"><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><b><span class="Apple-style-span" style="font-size: small;">What is it?</span></b></div><div><span class="Apple-style-span" style="font-size: small;">The MLMC is a smart daisy chain-able LED matrix module.</span></div><div><span class="Apple-style-span" style="font-size: small;">I call it smart because a display of these can be extended without changing either the firmware on the module controller or the firmware on the display controller. Each individual module will take care of refreshing its display. When new data is sent old data is passed along the chain to the next module. This makes building an arbitrary length scrolling display very simple to implement.</span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">The LED matrix is on a separate PCB so it is simple to adapt to other LED matrices without chaining the controller PCB/firmware. This means that if you were producing a number of different sized displays you could use the same controller PCB. For example for one made from a 16 by 16 LED matrices or a large one made from custom PCBs using 16 by 16 individual 10mm LEDs.</span></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><b><span class="Apple-style-span" style="font-size: small;">Why?</span></b></div><div><span class="Apple-style-span" style="font-size: small;">I liked all of the many LED matrix projects seen on the web and in Circuit Cellar magazine. To enlarge or adapt these displays would mean a redesign of firmware and hardware.</span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">I had a small number of dense 16 by 16 matrices sitting about from my times bargain hunting in Akihabara. These are unused by any of the projects I have seen on the web and in magazines. These matrices have a strange footprint, the pin layout is a cross formation rather than two parallel rows of pins which is more commonly seen). This means work is needed to adapt existing projects to work.</span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">If I built a system purely around the LED matrices I have then very few people could use the resulting design. I would also not be able to reuse the design once my limited supply of these matrices was consumed. By separating out the control hardware from the display hardware I am able to make a much more flexible and enduring design.</span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">I've always been a fan of the 2 Line LCD displays which are common in many projects. These have a standard well known interface so it is trivial to add one to a project. I want to bring that ease of implementation to scrolling LED matrix displays as I have many projects that could all benefit from a large display.</span></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><b><span class="Apple-style-span" style="font-size: small;">What has been done so far?</span></b></div><div><span class="Apple-style-span" style="font-size: small;">A prototype 2 Layer PCB has been manufactured by Batch PCB. </span></div><div><span class="Apple-style-span" style="font-size: small;">Some basic screen display firmware has been written.</span></div><div><span class="Apple-style-span" style="font-size: small;">A system tested with 1 Bit per pixel, 16 bit columns of the display are clocked in and displayed while last word in buffer is clocked out. </span></div><div><span class="Apple-style-span" style="font-size: small;">Preliminary PWM brightness control has been tested but not on a pixel per pixel basis.</span></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><b><span class="Apple-style-span" style="font-size: small;">What needs to be done?</span></b></div><div><i><span class="Apple-style-span" style="font-size: small;"><br /></span></i></div><div><b><span class="Apple-style-span" style="font-weight: normal; font-style: italic; "><span class="Apple-style-span" style="font-size: small;">Hardware</span></span></b></div><div><ul><li><span class="Apple-style-span" style="font-size: small;">Move resistors ( LED module pcb)</span></li><li><span class="Apple-style-span" style="font-size: small;">Add decoupling caps (control module pcb)</span></li><li><span class="Apple-style-span" style="font-size: small;">Add local voltage regs (control module pcb)</span></li><li><span class="Apple-style-span" style="font-size: small;">Build more modules for testing of chaining</span></li><li><span class="Apple-style-span" style="font-size: small;">Build different LED Modules</span></li></ul></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><i><span class="Apple-style-span" style="font-size: small;">Firmware</span></i></div><div><ul><li><span class="Apple-style-span" style="font-size: small;">Extend from on/off pixels to brightness value</span></li><li><span class="Apple-style-span" style="font-size: small;">ISR response needs improving</span></li></ul></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><i><span class="Apple-style-span" style="font-size: small;">Software Library/Examples</span></i></div><div><ul><li><span class="Apple-style-span" style="font-size: small;">Arduino software is only a basic testing routine.</span></li></ul></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><b><span class="Apple-style-span" style="font-size: small;">What will be done?</span></b></div><div><span class="Apple-style-span" style="font-size: small;">To call this project finished these are the things I hope to have done.</span></div><div><ul><li><span class="Apple-style-span" style="font-size: small;">Release all firmware under a Creative commons License.</span></li><li><span class="Apple-style-span" style="font-size: small;">Release all pcb files under a Creative commons License.</span></li><li><span class="Apple-style-span" style="font-size: small;">Release protocols /data sheets under a Creative commons License.</span></li><li><span class="Apple-style-span" style="font-size: small;">Release an Arduino library to talk to a string of these under a Creative commons License.</span></li></ul></div><div><span class="Apple-style-span" style="font-size: small;"> </span></div><div><b><span class="Apple-style-span" style="font-size: small;">How Long will it take?</span></b></div><div><span class="Apple-style-span" style="font-size: small;">It will probably never be completed. So I hope to publish unfinished work when it is suitably unfinished whenever I remember.</span></div></span></span></div>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-75768091605597671932009-08-05T19:01:00.003+01:002009-08-05T22:09:16.302+01:00USB Scroll WheelI have been having a play with a rotary encoder this week and decided to turn it into a USB scroll wheel. I was using <a href="http://uk.farnell.com/vishay-spectrol/601-1045/sensor-smart-pot/dp/3282661"> a very nice encoder </a> but any standard potentiometer without the stop or a cheaper encoder would also work.<br /><br />The whole experience turned out be much easier than I originally thought. To get a standalone USB device up and running took very little effort at all.<br /><br /><b>HARDWARE</b><br />I took one of my <a href="http://stuffthingsandjunk.blogspot.com/2009/06/attiny45-usb-key.html">ATtiny45 USB-Key</a> PCBs and hacked on a voltage divider (two 330k resistors) and some wires to my encoder (+5v, GND, Signal). The purpose of the voltage divider is to keep the sensor output (or ADC input) below the 2.56 vRef being used on the chip and also below the 3.6V being used as Vcc on the PCB.<div><br /><div>No pictures or videos yet as it is just a ball of wires.<div><br /><div><b>FIRMWARE</b><br />The firmware is based on the <a href="http://www.obdev.at/products/vusb/easylogger.html">Easy logger project from Objective Development</a>. I changed the USB HID report descriptor to reflect a mouse rather than a keyboard. I then added a bit of code to analyse the ADC reading and calculate the rotational velocity of the wheel.</div><div><br />The device is only active once you push the button. This is to stop everything going crazy when I plug in a half finished device during development. The device can be switched off again by another press of the button for the same reason.<br /></div><div><br /></div><div>I got pretty bored reading all the USB HID documentation so rather than figuring it all out properly, I just snooped in on my normal mouse, read the HID report descriptor and adapted the relevant parts used for it's scroll wheel. The software I used to snoop was "USB Prober" which is in my Utilities folder (Mac OS X 10.5). This might be a standard issue tool or I may have installed it as part of the developer tools. A screen-shot of grabbing this information is shown <a href="http://brokentoaster.com/usb-dial/usbprober.png">here</a>. I don't know where or how to find out this info on windows but I'd look at Jan Axelson's site <a href="http://www.lvr.com/development_tools.htm">here</a> as a good place to start.</div><div><br /></div><div><b>PROBLEMS / STATUS</b></div><div>Even though I've altered <span class="Apple-style-span" style=" color: rgb(104, 56, 33); font-family:Monaco, fantasy;">USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH </span><span class="Apple-style-span" style="font-family:Georgia, -webkit-fantasy;">in the code it doesn't seemed to have effected the report descriptor on the computer. More than likely I've missed something somewhere but that is what you get for a quick hack.</span></div><div><span class="Apple-style-span" style="font-family:Georgia, -webkit-fantasy;"><br /></span></div><div><span class="Apple-style-span" style="font-family:Georgia, -webkit-fantasy;"><span class="Apple-style-span" style=" ;font-family:Georgia, fantasy;">The source code to main.c is at <a href="http://brokentoaster.com/usb-dial/main.c.html">http://brokentoaster.com/usb-dial/main.c.html </a>. I also made a couple of minor changes to the usbconfig.h file which is at <a href="http://brokentoaster.com/usb-dial/usbconfig.h.html">http://brokentoaster.com/usb-dial/usbconfig.h.html</a>. </span></span></div><div><span class="Apple-style-span" style="font-family:Georgia, -webkit-fantasy;"><br /></span></div><div><span class="Apple-style-span" style="font-family:Georgia, -webkit-fantasy;"> It doesn't work that well but it does work. Most importantly it proves to me that I can now take any sensor I like and turn it into a computer interface device of some description... perhaps even do something usefull ... one day ... maybe. <span class="Apple-style-span" style="font-family:Georgia, fantasy;">If I ever get some presentable hardware together I'll update with a picture or two.</span></span></div></div></div></div>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-76038627214402614642009-07-11T19:37:00.005+01:002009-07-23T13:18:17.064+01:00Quickcoms 2 : Pocket Term<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_zYnUjlpmq30/Sj1ncbtOc5I/AAAAAAAAACU/hRaEjuaqE28/s1600-h/IMG_6977+copy.JPG"><img style=" margin:0px 10px 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_zYnUjlpmq30/Sj1ncbtOc5I/AAAAAAAAACU/hRaEjuaqE28/s400/IMG_6977+copy.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5349545670557463442" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_zYnUjlpmq30/Sj1ncVkr5oI/AAAAAAAAACM/5uivvuU_KDg/s1600-h/IMG_6991+copy.JPG"><img style=" margin:0px 10px 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_zYnUjlpmq30/Sj1ncVkr5oI/AAAAAAAAACM/5uivvuU_KDg/s400/IMG_6991+copy.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5349545668911031938" /></a><br /><br />I started this project in 2006 while I was living in Japan with an idea to enter it in the <a href="http://www.circuitcellar.com/avr2006/index.htm">2006 AVR competition</a>. Some things went astray with the hardware design so I dumped it in order to do <a href="http://www.circuitcellar.com/avr2006/winners/DE/DE.htm">five other more viable entries</a>. The concept for the project was to take my <a href="http://brokentoaster.com/quickcoms/">Quickcoms</a> Renasas design from 2005 and develop it further from the prototype. I mostly wanted to add keyboard support so it could act as stand alone terminal in addition to just decoding serial data. I also wanted it to be the size of a deck of cards and support a LiION battery. I wanted to enlarge the LCD to get closer to 80x40 chars on screen. Include support for a couple of LCDs on the PCBs to allow for a black and white low power version.<br /><br /><span style="font-weight:bold;">What went wrong ( other than trying to put the moon on a stick) ?</span><br /><br /><ul><li>I made an assumption about the keyboard from the AVR application note that I would not have to send any data to the keyboard. Most AT keyboards will work without you sending any data back towards them so long as you don't wish to change the status LEDs. I bought a neat little keyboard to go with project from one of the many electronics dens around Akihabara. I wanted something small and light to throw in a toolkit without taking up all the room. <a href="http://stuffthingsandjunk.blogspot.com/2007/08/ps2-keyboard-startup.html">Unfortunately this keyboard used an obscure chipset which follows an old protocol which purposely sends a malformed packet and waits for you to send an error response.</a> With no scope or Logic analyser at the time this was a pretty big nail in this projects coffin. Although it only required a couple of small changes to the PCB and some voltage dropping resistors to configure the ATMega16 to transmit I managed to procrastinate this for two years.</li></ul><ul><li>I managed to blow up the back-lighting on the LCD display. Took me a while to get around to ordering a replacement. </li></ul><ul><li>I didn't provide a decent positive and negative supply rail for the op amps. I tried to rely on the comms transceiver chip to provide this. Unfortunately it was supplying 1 quad opamp and several multiplexes it and seemed to fall over completely. In my prototype I simply used a MAX232ACP with onboard capacitors to provide my circuits with the rails. I had assumed the new transceiver chip would be able to do the same.</li></ul><br /><br /><span style="font-weight:bold;">Where is it at now?</span><br /><br />Well after sorting out the keyboard issue and replacing the LCD I have a small screen that will echo characters from the PS2 keyboard and from PC via a USB serial port. What needs to happen next is sorting out a positive and negative voltage rail to support the multiplexers and opamps. Once that is done I can start porting the code from the original system over to the AVR.<div> After that is complete I can add the extra features such as logging to the screen, save and replay sessions, and saved macros.<br /><br /><span style="font-weight:bold;">And then What?</span><br /><br />After that there is the case (already partially designed) and publishing documentation of the project for the website.<br /></div>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-63535063409383192012009-06-30T23:43:00.003+01:002009-07-01T21:18:50.148+01:00MP3 Rev F GERBER Files now availableJust a quick note to say that The GERBER files are now available on server. I have also tidyed up the CVS for PCB files and moved the old Protel files. I've also update the release names for the hardware to match the PCB Revisions.<br /><br />This should make it easier for those of you out their that just want to build the standard design without custom modifications.<br />The downloads can be found at https://sourceforge.net/projects/butterflymp3/files/Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-25047518699150509962009-06-22T19:22:00.003+01:002009-07-11T19:48:25.833+01:00ATTiny45 USB Key<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPA6W7oOI/AAAAAAAAAB0/XWvYxvMIHBs/s1600-h/IMG_9907.JPG"><img style="display:block; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPA6W7oOI/AAAAAAAAAB0/XWvYxvMIHBs/s400/IMG_9907.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5349378071981695202" /></a><br /><span style="font-weight:bold;">USB Key. </span><br />These are simply ATTiny45 based USB devices based on the V-USB circuits and drivers developed at <a href="http://www.obdev.at/products/vusb/index.html">Ob-Dev</a>. I haven't decided what to do with these yet but the many ideas include a prank keyboard dongles like the <a href="http://macetech.com/blog/node/46">capslocker</a> or a keyboard to continually hit F1 or Delete to ensure the bios comes up.<br /><br />My original idea was to have it generate and remember random passwords so you don't need to type in your 63 char password for the wireless router every time someone comes to visit , simply plug in the dongle and it will type it for you. There are other non keyboard ideas as well such as a simple data logger that converts voltage, temperature, (insert random digital sensor here) to a comport that responds to commands or simply pushes data at a specified rate.<br /><br />I see Sparkfun have done a nice version of this PCB with some similar ideas. Theres is called <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9147">AVR Stick</a>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com0tag:blogger.com,1999:blog-14888785.post-19020228097727877242009-06-22T19:20:00.002+01:002009-06-28T18:24:15.400+01:00MP3 Shield for Arduino<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_zYnUjlpmq30/SjzPAmL1lII/AAAAAAAAABs/Df_kCBEhYnk/s1600-h/IMG_9905.JPG"><img style="display:block; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://2.bp.blogspot.com/_zYnUjlpmq30/SjzPAmL1lII/AAAAAAAAABs/Df_kCBEhYnk/s400/IMG_9905.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5349378066566452354" /></a><br /><span style="font-weight:bold;">MP3 Shield for Ardiuno</span>. Still needs a couple of fixes to the PCB ( I forgot that the arduino was running at 5V not 3V). Might add some voltage dropping resistors as the cheap solution (£0.10) or add an 74HC245 to do it properly so it can run with 3V arduino boards without mods (£0.34). I think I will go for resistors as this makes assembly easier and to mod for 3v operation just means removing a couple. No firmware as of yet so my next job(after fixing the hardware ) will be porting the vs1001 libs from the butterflymp3 project over to arduino. Haven't decided weather to use my own MMC and FAT routines or just grab the ones from <a href="http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=94">adafruit's wave shield </a>. The board has a 3.5mm headphone socket, SD/MMC slot, VS1011 decoder and a 5 way joystick. Perfect for mucking about with MP3s and Arduino.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com4tag:blogger.com,1999:blog-14888785.post-60584659426938378682009-06-20T12:53:00.017+01:002009-06-22T21:47:58.865+01:00Whats on my bench at the moment....<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPAeRRu9I/AAAAAAAAABk/mokd4PxJmoE/s1600-h/IMG_9904.JPG"><img style="display:block; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_zYnUjlpmq30/SjzPAeRRu9I/AAAAAAAAABk/mokd4PxJmoE/s400/IMG_9904.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5349378064441785298" /></a><br /><br />Its been rather quiet (blogwise) for me lately, so I thought I'd update with what I've been working on lately. The following is a rough outline of the stuff I've been working on and probably why I feel like I never get anything done.<br /><ul><br /><li> General purpose usb key for experimenting with USB drivers firmware and the rest.<br /><li> MP3 shield for <a href="http://arduino.cc">Arduino</a>. Basically an Arduino version of the ButterflyMP3 project.<br /><li> Daisy chained LED matrix controller. A flexible and extendable display made up of modules that can make any length display you want without changing the firmware. <br /><li> Quickcoms 2: Pocket Term. A follow up to my <a href="http://www.circuitcellar.com/magazine/198toc.htm">Circuit Cellar article</a> and <a href="http://www.circuitcellar.com/renesas2005m16c/winners/DE/1765.htm">competition project</a>. Current quickcoms info is <a href="http://brokentoaster.com/quickcoms/">here</a>.<br /><li> ButterflyMP3 VS1053 hardware revision.This newer chip decodes :<blockquote> Ogg Vorbis; MPEG 1 & 2 audio layer III (CBR +VBR +ABR); layers I & II optional; MPEG4 / 2 AAC-LC(+PNS), HE-AAC v2 (Level 3) (SBR + PS); WMA 4.0/4.1/7/8/9 all profiles (5-384 kbps); WAV (PCM + IMA ADPCM); General MIDI 1 / SP-MIDI format 0 files </blockquote><br /><li> ButterflyMP3 firmware updates<ul><br /> <li> Add a simple LED based display. One LED lights up to indicate the track playing. Currently limited to 21 LEDs.<br /> <li> A simple Matrix keypad for music store "listening post" style operation. multiplexed on LED lines. Currently limited to 21 buttons. One button will trigger a track to be played.<br /> <li> Scrolling LED Matrix support. This is for my LED matrix project above if I ever finish it.</ul><br /><li> Butterfly Logger firmware updates <ul><br /> <li> support GPS logging<br /> <li> support wireless sensors</ul><br /><li> The Glitch. A small device that goes inline with low voltage DC wall wart and switches it off and then on again once a day. (I bought a cheap router that needs a hard reset every so often.) <br /></ul><br />Plus some white LED based low power kitchen lighting, playing around with <a href="http://www.david-laserscanner.com/">3D scanning</a> and of course the online shop which I have been doing absolutly nothing on for the past couple of months.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com3tag:blogger.com,1999:blog-14888785.post-26526978203024749682009-05-29T16:27:00.003+01:002009-05-29T16:33:57.051+01:00Kicad OSX nightlies fixed again.Got my kicad builds sorted again. finally got the make command right to work with the boost library. I've updated to the latest (1.39) and everything seems to be going well.<br /><br />My nightly make script now looks like this....<br /><blockquote><br />#update from svn<br />cd /temp/kicad-sources<br />svn up <br />new_version=`svn info | grep Revision | cut -f 2 -d\ `<br />old_version=`cat /temp/install/version.txt`<br />if [ $new_version -gt $old_version ]<br />then<br /> <br /> #build it<br /> cd build/release<br /> cmake ../../ -DwxWidgets_CONFIG_EXECUTABLE="/usr/local/bin/wx-config" -DwxWidgets_ROOT_DIR="/usr/local/include/wx-2.8" -DCMAKE_INSTALL_PREFIX=/temp/install -DBoost_INCLUDE_DIR=/temp/kicad-sources -DCMAKE_OSX_ARCHITECTURES="ppc -arch i386" -DCMAKE_CXX_FLAGS="-D__ASSERTMACROS__"<br /><br /># make clean <br /> if make > /temp/kicad_errors-${new_version}.txt 2>> /temp/kicad_errors-${new_version}.txt && make install <br /> then<br /> file=kicad_osx_v${new_version}<br /> echo $new_version > /temp/install/version.txt <br /> mv /temp/kicad_errors-${new_version}.txt /temp/install/build_log.txt <br /> <br /> <br /> #bundle<br /> cd /temp/<br /> cp -rf install ${file} <br /> tar -czf ${file}.tgz ${file} <br /><br /> #upload<br /> curl -T ${file}.tgz ftp://username:password@ftp.brokentoaster.com/<br /> rm -rf ${file} <br /> <br /># cd /temp/kicad-sources/build/release/ <br /> # /Developer/usr/bin/packagemaker --doc osx-package.pmdoc --title 'Kicad' -o ${file}.mpkg <br /> # curl -T ${file}.mpkg ftp://username:password@ftp.brokentoaster.com/<br /> <br /> else<br /> curl -T /temp/kicad_errors-${new_version}.txt ftp://username:password@ftp.brokentoaster.com/<br /> fi<br /> <br /> # go to sleep <br /> open /Users/nick/Applications/SleepNow<br />else<br /> echo "Kicad is uptodate :) "<br />fi<br /><br /></blockquote>Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com19tag:blogger.com,1999:blog-14888785.post-14474847326137830862009-03-13T07:16:00.004+00:002009-03-13T07:26:39.848+00:00/dev/cu vs /dev/tty ( osx serial ports)A while ago someone told me to use /dev/cu.usbserial rather than /dev/tty.usbserial as the former did not require hardware handshaking. I was looking for this justification again as my memory had gone a little hazey on the exact reason for using cu over tty. I found the following at <a href="http://lists.berlios.de/pipermail/gpsd-dev/2005-April/001288.html"> http://lists.berlios.de/pipermail/gpsd-dev/2005-April/001288.html</a>. Thought it a good thing to know and thought I'd remember it here for next time.<br /><br /><blockquote>"The idea is to supplement software in sharing a line between incoming and outgoing calls. The callin device (typically /dev/tty*) is used for incoming traffic. Any process trying to open it blocks within the open() call as long as DCD is not asserted by hardware (i.e. as long as the modem doesn't have a carrier). During this, the callout device (typically /dev/cu* -- cu stands for "calling unit") can be freely used. Opening /dev/cu* doesn't require DCD to be asserted and<br />succeeds immediately. Once succeeded, the blocked open() on the callin device will be suspended, and cannot even complete when DCD is raised, until the cu device is closed again.<br /><br />That way, you can have a getty listening on /dev/tty*, and can still use /dev/cu* without restrictions."</blockquote><br /><br />So this is what I use when programming with AVRDude as the butterfly doesn't have any DCD/DTR lines to assert. Its just TX, RX, and GND. If you have problems on the mac using a tty serial port you should try its cu equivalent.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com2tag:blogger.com,1999:blog-14888785.post-46111080575822473362009-03-09T07:20:00.002+00:002009-03-09T07:29:18.566+00:00GEDA portfilesNow I've got kicad building again ( although rather bloated at 20Mb ) I thought I'd have a play with some other items on my todo list. I've manage to get most of the GEDA suite working on the mac and have created portfiles for mac ports to be able to install them. I haven't got gwave to work yet due to some dependances and some of the installs needed to be forced to overwrite some other files but in general they seem to work. I hope to add kicad as a port file in the near future but I will see if I can get these programs to work first.<br /><br />In doing this I noticed a few messages regarding others trying to get port files up for gEDA on the mac so I assume they will make it into the main ports tree at some time in the near future.<br /><br />To use my files you can browse them at http://www.brokentoaster.com/macports/ or download them all at http://www.brokentoaster.com/macports/ports.zip.<br /><br />First you will need to extract the files into a local directory such as <span style="font-style:italic;">/users/me/ports</span>. Then you will need to add <span style="font-style:italic;">/users/me/ports</span> to the <span style="font-style:italic;">/opt/local/etc/macports/sources.conf</span> file. The last action is to run the command portindex from your newly created ports directory to ensure the index is up to date.<br /><br />If these are of any use to you then enjoy. Good luck.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com1tag:blogger.com,1999:blog-14888785.post-46420270364708970992009-02-25T21:53:00.005+00:002009-02-25T22:18:09.524+00:00Kicad OSX nightlies fixedI finally decided to investigate why kicad had stopped building back in Decemember. I had initially thought it was to do with large changes to the source being done at that time or with my trying to get a newer build of wxMac to work with it properly.<br />I turns out I updated the Boost library and that was what was causing my builds to fail.<br /><br />Somewhere on the mac a "check" macro gets defined. Apparently this is if "DEBUG" is defined somewhere but I could not figure out where or why this was going on (see <a href="http://lists.trolltech.com/qt-interest/2007-06/msg01111.html">this</a> post. I decided to simply modify the boost files concerned to work aroaund this problem. By renaming the "check" function and its called I was able to get kicad compiling again. Sadly it does not fix the serious flaws in wxmacs graphics implimentation ie. the fact that it does not do XOR draws properly.Anyway here are the diffs I made<br /><br />fixing kicad again for th mac<br />/temp/kicad-sources/boost/ptr_container/detail/static_move_ptr.hpp:<br />line 155: check renamed to check_<br /><br />4 changes in /temp/kicad-sources/boost/detail/is_incrementable.hppcheck "check(" replaced with "check_("<br /><br /><span style="font-weight:bold;">boost/ptr_container/detail/static_move_ptr.hpp </span><br /><blockquote><br />% diff /temp/boost_1_37_0/boost/ptr_container/detail/static_move_ptr.hpp <br />/temp/kicad-sources/boost/ptr_container/detail/static_move_ptr.hpp <br /><pre><br />154c155<br />< void check(const static_move_ptr<TT, DD>& ptr)<br />---<br />> void check_(const static_move_ptr<TT, DD>& ptr)<br /></pre></blockquote><br /><br /><span style="font-weight:bold;">boost/detail/is_incrementable.hpp </span><br /><blockquote><br />% diff /temp/boost_1_37_0/boost/detail/is_incrementable.hpp <br />/temp/kicad-sources/boost/detail/is_incrementable.hpp <br /><pre><br />68c68<br />< char (& check(tag) )[2];<br />---<br />> char (& check_(tag) )[2];<br />71c71<br />< char check(T const&);<br />---<br />> char check_(T const&);<br />81c81<br />< , value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1<br />---<br />> , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1<br />92c92<br />< , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1<br />---<br />> , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1</pre></blockquote><br /><br />The error I was getting was the following<br /><blockquote><pre>In file included from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/reversible_ptr_container.hpp:22In file included from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/reversible_ptr_container.hpp:22,<br /> from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/ptr_sequence_adapter.hpp:20,<br /> from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/ptr_vector.hpp:20,<br /> from /temp/kicad-sources/kicad/include/board_item_struct.h:9,<br /> from /temp/kicad-sources/kicad/include/pcbstruct.h:10,<br /> from /temp/kicad-sources/kicad/3d-viewer/3d_viewer.h:29,<br /> from /temp/kicad-sources/kicad/3d-viewer/3d_aux.cpp:23:<br />/temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/static_move_ptr.hpp:154:50: error: macro "check" passed 2 arguments, but takes just 1<br /></pre></blockquote><br /><br />I have now updated my automagic build script to upload the error log if It doesn't compile.<br /><br />All of my builds are still found at <a href="http://www.brokentoaster.com/kicad/">http://www.brokentoaster.com/kicad/</a> and should be universal apps. If anyone has had any success with wxCocoa or other builds I'd be happy to add them to my build list.Nickhttp://www.blogger.com/profile/18246605560580979258noreply@blogger.com10