Tuesday, December 25, 2012

Drawers

I have too much stuff in my office. Or, perhaps my office is too small and serves too many functions. The solution to either seems to be better storage and drawers are just an excellent use of space. I built my large wrap around desk/table almost 10 years ago but it relies on shelves above it for storage and I was tired of boxes of unorganized stuff under it. It was time to build some drawers. Then there was the impending trip to Chicago for a week to pack up my father for a long distance move which provided the perfect excuse to ignore upcoming responsibilities and embark on a large wood working project.

I did look for pre-made or pre-fab solutions, but they were all either very expensive or very awful. The way the supports for my desk work means that the drawer either has to be shallow to avoid some middle supports or it has to be short to avoid the same. So my drawers would have to have a lower part that was deep and then an upper part to sit on top of that which was shallower to clear the supports. It would consist of 2 cases, a large one with 3' wide by 2' deep drawers that would come up to within 6" or so of the desk surface where it would have otherwise hit the middle supports under the desk. And then a smaller cabinet that is the same width, but only 14" deep to clear that same support.

Given the impending time crunch I originally started out thinking I would half-ass it quickly. This led me to build the cabinets from half in plywood, which was OK, but also led me to decide to skip any fancy jointery on the corners which I regretted later. Since the top of the cabinets will never be visible I opted for butt joints with the sides coming up flush to the top since they would be visible. The plywood edge of the sides would never be visible on the top or bottom so it wouldn't matter. Except that now after I made something nice I will always know it's there.


The smaller cabinet would have 2 smaller drawers. This is just sanded plywood after a coat of mahogany gel stain. I decided to do a fancy face for it with some Lyptus wood that I had bought a long time ago and have been just letting slowly warp in the garage. A little plaining brought it back to spec
for this. I was really surprised how beautiful the lyptus was with a coat of nothing more than linseed oil!

Something I forgot was that you can't build a drawer that is almost the same height as your case. You have to be able to tip the drawer in in order to get the wheels of the drawer slide in. So if you're using that type of drawer slide you need to make them short enough to get in. I fixed this in the larger case drawers by building shorter drawers but there are also more expensive drawer slides that dont require you to do this, but I was using what I already had. These drawers are now in permanently and cannot be removed...


If I had known the Lyptus was that pretty I'd probably have used it for something before now ;) It matches the stained cabinet very well. The rest of the face frame was fairly straight forward and I attached it to the cabinet with biscuits.

I pre-stained everything before putting it on since the cabinets were getting a totally different finish than the face frame. Lyptus is a hard wood, but works very nice. It sands up and finishes beautifully but the grain will raise like crazy if you get it wet. Since I had pre-finished it I just cleaned up any glue squeeze out with dry towels since I wasn't concerned about the glue keeping the oil from soaking in.

The larger cabinet was more work, but again I didn't do any fancy jointery on the corners. I did route some dados into the sides to hold supports between each drawer front and back which make it very steady and strong. Originally I had wanted to do a full piece in each spot, but that would have required a 3rd sheet of plywood and it would have weighed a ton. It's heavy enough the way it is so I just ran 4 inch strips front and back to attach the face frame to and for strength.


here's the left side of the face frame being clamped into position. The biscuits did a good job of keeping it from being pulled out of alignment but I probably still should have put every other clamp on the outside of the cabinet rather than all pulling from the same side. Though it worked fine the potential was there to glue it on crooked. You can see the biscuits for the horizontal pieces there already cut into the crossmembers.



The horizontal ones I just clamped with blue painters tape and it worked very well.  I've already put the drawer fronts on the smaller cabinet here. I left a generous quarter inch difference in the left/right/top/bottom dimensions for those to make it easier to align. I probably could have done it with less of a gap if I had started out being more careful for the size of the cabinets.


And mounted the drawers! Some adjustment and they all worked fine with enough clearance to get them in and out. Again half inch sanded plywood boxes with a quarter inch luan plywood bottom. Nothing fancy and no fancy jointery here either. I did screw the joints though and use an 1/8th roundover bit on the top of them all the way around.


Here just test fitting the pieces for the drawer fronts to get the size exactly right before giving them a coat of linseed oil.  I almost wished it didn't need any hardware at all it's so pretty. Mounting the drawer faces I also didn't do anything fancy. I drilled holes into the front of the drawers that were much larger than the screw I would use to attach the drawer front. And then drilled a smaller hole into the same place on the back of the drawer front taking into account the extra 8th of an inch overhang on each side. A little thinking here and I got it almost exactly right. The larger hole in the drawer and a washer on the screw made adjusting them if not easy, at least possible.


And then finally as finished. Haven't put the backs on in this picture yet, but I absolutely love how it turned out. A weeks projects working just a couple of hours a day and now I have it sitting next to me in the office making me happy and allowing me to have a little actual surface space to work on again! Every so often a woodworking project is necessary to keep the brain alive no matter how much other work is being expected of you ;)

If I ever make another one I would do a couple of things differently. Some rabbit joints on the cabinets would make it stronger and just make me happier. They wouldn't have added but an hour to the overall project time either. I somehow did the face frame different on the top small cabinet vs the bottom. On the top one I did the horizontal pieces coming all the way across and the bottom one it's the verticals that run straight through. They should both be done the same way. I really wanted to get every inch of space out of the thing so I designed it without any kind of foot or bottom. I should have given up 2" and put some feet on it just to raise the bottom drawer up out of the carpet. None of these things detracts from how happy I am with it but live and learn for the next project!

Monday, November 5, 2012

batch moving iCal events from one calendar to another with AppleScript

What with all the iOS devices and the cloud and all I thought I would finally sort out the mess which is our iCal calendars around here and put them all on the cloud so that everyone could have read/write access and everything would be shiny and new and wonderful. That took a little more work than it should have, iCal is currently my least favorite of all Apple's software. Searching on the internet though I see I'm not the only one who has had these problems so I document my solution for anyone who might benefit from it.

I had the calendars hosed on just a webDav directory on my own server but this did not allow read/write access for all family members subscribed. I wanted to move them to my iCloud account and then resubscribe everyone (well, technically my wife is the only other member of everyone ;) my first thought was to just export them through iCal to my disk as .ics files and then re-import them into new calendars created on iCloud.

This did not work. I got the following modal error message which had to be dismissed for EVERY SINGLE event in the file before I could get back to normal.


Access to "some event" in "the new calendar name" in account "name of my account" is not permitted. The server responded: "403" to operation CalDAVWriteEntityQueuableOperation.

This is not particularly helpful and the buttons are not really very apple like or helpful either. After signing out and back in again and recreating my iCloud account I was able to get ONE calendar to import without errors, and then they returned.  Thats an old event, so I thought perhaps it was just complaining that events too far in the past weren't allowed to be imported. So I created manually a small ICS file to test with that only had future events in it, but that failed too.

I resorted to applescript. The dictionary has both a duplicate and a move command one or the other should be able to copy or move the events in the calendars I wanted to change. I can change the events from one to the other one at a time by just changing the "calendar" in the popup for the event. That worked fine, so it was allowing me to add things to the calendar, it just didn't like importing it. Or, as it turned out the duplicate or move command. Both of those tries resulted in the same error and total failure. Finally I resorted to the make new event command which requires a bit more work because I had to create the record of all the old properties one bit at a time. And since it will happily return "no value" or "undefined" for properties that aren't set for that event, but it will not accept those as properties for a new event you have to check to make sure each property exists before adding it to the new record. I did not attempt to preserver attendees or other event properties not in the list below so I dont know how to do that. But with this script you can move all the events from one calendar to another without errors from iCal even where an import fails. I suspect it may have something to do with including the unique ID in the export file. Possibly you cannot specify the UID of a new event, or possibly it really means unique, and not just unique within each individual calendar and that is what is causing the error. I left the UID out of the script below but I did not test with trying to include it.

It is not fast, it takes some time for each event to be created, so be patient.


tell application "Calendar"
--Script to move events from one iCal calendar to another
--James Sentman james@sentman.com 11/4/2012
--
--  I found myself unable to import ical calendars that I had exported from another
--  server. I would get an error from the iCal server for each and every event.
--  I have no idea why, it may be just duplicate UID's or something.
--  The "duplicate" command and the "move" command both of which I tried
--  failed with the same error, but I was able to create a new one with the 
--  info gotten from the old calendar. But that wasn't so easy either as not
--  all events have all information and it would not except "no value" answers
--  so I had to add the if exists portion to build the record for the new event.
--  I did not attempt to move things like attendees or other elements of the event
--  just the data you see below.
--
--  INSTRUCTIONS: change the name of these next 2 variables. MyOldCal is
--  the calendar you want to move events FROM and MyNewCal is the name of the
--  calendar that they will be newly created in.
set MyOldCal to calendar "SCDS"
set MyNewCal to calendar "SCDS iCloud"
-- find out how many events we have to create
-- for some reason I would get an error when it reached "count"
-- which generally means that while the count tells you how many records
-- referencing them by index begins at 0 instead of 1, so start at 0
-- and subtract one.
set EventCount to (count of events in MyOldCal) - 1
repeat with i from 0 to EventCount
--get a reference to the old event in the old calendar
set WorkEvent to event i of MyOldCal
--since the work record with the info is appended instead
--of created fresh each time in one step it is necessary to clear 
--it out each time through the loop.
set WorkRecord to {}
--checking if the various properties exist or not 
--stops an error later if one property was undefined
--it will happily return no value for one of them without
--an error, but it will not then accept that in the make
--statement below. So we only add them to the record
--if they are actually there.
if exists description of WorkEvent then
set TheDescription to description of WorkEvent
set WorkRecord to WorkRecord & {description:TheDescription}
end if
if exists start date of WorkEvent then
set TheStartDate to start date of WorkEvent
set WorkRecord to WorkRecord & {start date:TheStartDate}
end if
if exists end date of WorkEvent then
set TheEndDate to end date of WorkEvent
set WorkRecord to WorkRecord & {end date:TheEndDate}
end if
if exists allday event of WorkEvent then
set TheAllDay to allday event of WorkEvent
set WorkRecord to WorkRecord & {allday event:TheAllDay}
end if
if exists recurrence of WorkEvent then
set TheRecurrence to recurrence of WorkEvent
set WorkRecord to WorkRecord & {recurrence:TheRecurrence}
end if
if exists sequence of WorkEvent then
set TheSequence to sequence of WorkEvent
set WorkRecord to WorkRecord & {sequence:TheSequence}
end if
if exists stamp date of WorkEvent then
set TheStampDate to stamp date of WorkEvent
set WorkRecord to WorkRecord & {stamp date:TheStampDate}
end if
if exists excluded dates of WorkEvent then
set TheExcludedDates to excluded dates of WorkEvent
set WorkRecord to WorkRecord & {excluded dates:TheExcludedDates}
end if
if exists status of WorkEvent then
set TheStatus to status of WorkEvent
set WorkRecord to WorkRecord & {status:TheStatus}
end if
if exists summary of WorkEvent then
set TheSummary to summary of WorkEvent
set WorkRecord to WorkRecord & {summary:TheSummary}
end if
if exists location of WorkEvent then
set TheLocation to location of WorkEvent
set WorkRecord to WorkRecord & {location:TheLocation}
end if
--you can try copying the UID also
--but it occurred to me that this may be the whole problem
--as a UID should be unique, and it would not be so
--if you had tried to create an event and specifying it at the time
--so I commented this out and iCal will happily make a new UID for the 
--new event as it should.
--if exists uid of WorkEvent then
-- set TheUID to uid of WorkEvent
-- copy {uid:TheUID} to the end of WorkRecord
--end if
if exists url of WorkEvent then
set TheURL to url of WorkEvent
set WorkRecord to WorkRecord & {url:TheURL}
end if
--and lastly actually make the new event with the old data.
make new event at MyNewCal with properties WorkRecord
end repeat
return EventCount & " events moved"
end tell

Or you can download the script as a script editor file: icalmover.zip

Let me know if thats of any help to anyone, thanks.

Sunday, September 23, 2012

Makerbot Acceleration Settings

The other day Makerbot announced the Replicator 2, obsoleting my wonderful replicator model. My initial buyers remorse at no longer owning the most current model quickly faded as I realized that it had a better case but was not much different otherwise. They do advertise getting a .1mm slice resolution with it though and others have posted getting that with the original replicator. I'd never tried going that fine but I think I have a better understanding of some of the internal settings now that I have sorted it out.

I've been rather frustrated with it lately, my prints have had too many gaps and globs and been quite messy. It turns out this was a function of the "acceleration" in the 5.5 firmware update. Acceleration doesn't mean actually going faster, it means that over the course of a fraction of a second the steppers were accelerated up to or down to the new speed rather than slamming from 0 to full speed and back again in a single step. The problem is that the extruder steppers are controlled this way too. Here's an example printed of the "MakerBolt" thing that comes with the new slicing software as an example. I sliced it in replicatorG rather than the new "makerware" as I couldn't get that to work properly yet. The settings for slicing were the non-accelerated speed with 0 shells and 100% infill. The one on the left was printed with the onboard preferences of acceleration turned on and set to their shipping defaults.


You can clearly see the print quality is lousy. Lots of drop outs. The one on the right was printed with the onboard acceleration turned totally off and it's a ting of beauty. The quality of my prints really did take a hit with the 5.5 firmware update that added acceleration! The 2 bolts above were printed from the exact same GCode, the only change was turning off the onboard acceleration in the replicator.

The problem is that you cannot print fast without the acceleration turned on, the steppers can't change speed that quickly and will skip steps and ruin the prints. I have read elsewhere that changing all the acceleration settings to 1000 mm/s/s in the left hand column fixed others problems, it did not fix this for me. It was better but still had dropouts. The defaults have 3000 mm/s/s as the acceleration for the "a" and "b" channels which I believe are the 2 extruders, this was much higher than the default acceleration for the movement steppers. It makes sense for the extruders to stop later and start faster than the movement ones to get the plastic flowing, but these numbers caused gaps at startup and blobs at stop (or possibly vice verse it's hard to tell) the numbers I finally settled on were this:


1000 mm/s/s for the axis steppers and 1250 mm/s/s for the extruder motors. This resulted in a print that was 95% as good when printed at the default slow speed as the completely unaccelerated model, and probably 85% as good when printed at full "accelerated" speed. The accuracy of the print at high speed isn't as good, but there were no dropouts or globs of plastic left behind. The bolt doesn't move as freely at high speed as low, so for technical pieces I'll be printing with the slicer speed turned down, but for less critically sized pieces I can now print accelerated with acceleration on and get very nice prints, even at .1mm resolution. Have a look again at that right hand bolt in the picture above, it's a thing of beauty!

(watch out for semantic confusion between the onboard Acceleration which just controls how quickly the steppers come up to the new speed and the slicing accelerated defaults which control how quickly they move overall as they print the model. It's quite possible to have one turned on but not the other)


Monday, September 3, 2012

crank powered airplane to crank powered flashlight

Ben has been throughly enjoying his "Kid Galaxy Dyna Flyer Air Streak" airplane. It runs an amazingly long time on just a few moments of cranking up the launcher thing.

Unfortunately being made of foam it's lifetime was limited and we finally busted the little wires that run through the middle of the prop. Rather than just toss it we had to take it apart to scavange for reusable parts. I knew it had to be a super capacitor in there and indeed it was. 2.7 volt 7 farad. The motor we salavaged for some future project, but the charger and capacitor we kept together and added a multi-chip warm white power LED that I got off ebay a long time ago. I was using these for outdoor lighting long time ago but they didn't really last in that application, or I was overpowering them, so I had a bunch in the toolbox. There is a tiny board in there that shuts off the motor till it leaves the launcher, but we didn't use that, just soldered directly to the capacitor. The voltage is close enough that I didn't bother with a resistor or anything.





The charger is really quite powerful, about 7 seconds of cranking will run the LED at decent flashlight level for about a minute and a half with many more minutes at diminishing candle and then "find me" levels.


And of course you can shoot it across the room too as it's still on the sled that used to launch the airplane.



I haven't played with any of this new generation of super capacitors before, but they are certainly going to be useful! You couldn't use a battery in this kind of thing, it wouldn't work at all. I see now that there are a bunch of different versions of this toy, they aren't expensive and it was definitely fun. I'm not sure how we managed not to lose it into a pond or up on a roof or tree while we had it, and when it does inevitably crash and burn like all toy airplanes must, you can salvage the really cool super cap out of the inside!

Saturday, July 28, 2012

the double secret to making a bootable Mountain Lion install disk

FINALLY figured this out by reading the excellent tidbits article. Theoretically all you have to do is restore the disk image that comes in the download from apple to a disk partition big enough to hold it. This has worked in the past, but something about the mountain lion 10.8 image breaks this. You get low level unfixable disk errors.

But if you mount the image to the finder first and then restore the mounted image rather than the .dmg file it works! Given the number of machines around here and the fact that should a disk fail I'd really like to be able to restore from a bootable disk this is quite useful.

Tuesday, July 3, 2012

Our First Week with Makerbot


We’ve completed our first week with a Makerbot replicator in the house! It’s mostly been a big hit, the kids are designing their own models and we’re actually getting good prints of things. I have learned a bunch of stuff though that might be useful to know if you’re thinking of getting one of these things.

1) It doesn’t stink nearly as bad as I had feared. I was ready to have to build a hood and a fume extractor for the thing but while you can tell there is hot plastic in the room it’s temperature controlled enough that the plastics do not outgas or burn. The vapor pressure of the molten plastic at these temps is much higher than the air pressure, and the temp is well below where they start to decompose into nasty things so I dont think these require ventilation unless you’re doing something frightening like switching between ABS and polycarbonate and not properly clearing out the extruder first.

2) The MK8 extruder has what I think is a flaw. It will work great for a while and then eventually, and regularly it will just stop extruding. The shaft of the stepper motor that drives the feed wheel has a flat section along it that the setscrew in the feed wheel can be tightened against. The problem is the setscrew is so close to the body of the stepper motor that it does not actually engage this notch. The flat section of the axel doesn’t go close enough to the motor to catch it. So it’s just tightened against the round part of the shaft at the base. This works, but the thermal stresses of the wheel will eventually cause it to come loose and just spin. So you can either regularly take it apart and tighten the wheel (the design is excellent here, it’s very easy to get apart and service to this point) or you can use a dremel and a cutting wheel to extend the flat section of the shaft another mm which is all thats necessary. There are all kinds of problems with doing this potentially, so unless you’re comfortable with your demel you might not want to attempt it. I would also cover the body of the motor and especially the root of the shaft in blue tape to keep little metal bits from getting inside. Once you do this fix though your extruder will work perfectly.

3) you cannot completely level the build platform when it’s cool. Even the newly designed one will still move a bit when it’s hot leading to problems with printing. After running the platform leveling script you will have adjust it again when it’s hot. watch the first layer of one of the calibration prints print and adjust as it’s printing. This is potentially dangerous with your hands inside the thing and it will be hot, but it’s necessary to get good prints.

4) when your stepstruder is skipping DO NOT PUSH down on the filament! You will crash the heads into the platform and ruin one or both of your nozzles and score a line into the build surface. I am awaiting the MK8 .4mm nozzle to come back into stock so I can replace the left one which I ruined. If your plastic extrudes during the load process and looks app uneven or shoots to one side you’ve either got a clogged nozzle or you’ve fmirkled the end of it against the build platform. Be gentle with the end of these, they look like brass and can be easily messed up.

5) You can’t get large prints to stick to the platform. Everything pulls away for me, regardless of build platform temperature, raft, no raft or whatever. The way to solve this problem people have discovered is to pour some acetone into a jar and put in a bunch of your ABS scraps. Then when it has dissolved spread it with a qtip on the kapton tape of the build platform. This works wonders really, dont waste too much time thinking you dont need this before you try it, it makes everything work better to have the thing you’re printing properly stuck to the build platform. It doesn’t take much, just make the tape look all messy but not gloppy.

This is a huge print, and lifted a huge amount off the platform while printing. This can cause the model to just be off a bit which may not be a big deal depending on what you’re printing, or it may cause the print heads to bump into the model and knock it completely loose. 


6) PLA is beautiful, you will want to print with this. Print test cubes with it and find the lowest temperature where it properly extrudes and print at that temp. You can change this temp in the gcode manually, there are instructions on the makerbot site for lowering this temp, it’s not hard. Each roll of PLA I’ve gotten (though I’ve purchased some from other sources like amazon and ebay) has a different ideal build temp. Otherwise it will sag, but if you get the temp right you’ll be able to print anything you can print in ABS with it perfectly.


This red PLA printed at ABS temp you can see that it makes little bridges as it’s so liquid it keeps flowing it also sagged horribly over the top of the cube. Printed at 175 this PLA prints very good.

This orange PLA printed at 190 and it’s perfect, no bridging or extra flowing and it easily spanned the top of this empty box with no internal support without any noticeable sagging at all. This was before I discovered the secret of the ABS glue for the build platform though and had it heated up to 110C to make the cubes stick. You can see that this caused the bases to bulge out a little. With the plastic dissolved in acetone and placed on the platform you can use a much lower build platform temp and keep that from happening too.



7) make sure during the load process you get all the ABS out. Bits can come  out as you start your print, and if you’re printing at a lower temp than the ABS is fully liquid at (I’ve got a roll of red PLA that is mostly amorphous and not crystalin and it can be printed as low as 170 to get it to stop sagging, my makerbot rolls of pla print good at 180 and I’ve got a roll of orange that is so crystaline that it can print without sagging at 220 same as ABS, experiment) then the abs will clog the extruder. It may be necessary to start a calibration print at ABS temp to get all the ABS out before you can switch back and forth without difficulty.

9) keep an eye on your spools. The filament can get wrapped around the spindle and hang up, or it can even have been put onto the spool tangled in the first place. The roll of black my makerbot came was so helplessly tangled that i had to unroll half of it and roll it back up.

10) the first layer will look nasty, dont stop it each time the first layer has a glop or doesn’t look even. It will get itself sorted out and a few layers later it will look great.

11) tinkercad to start with! If you’ve not done 3D design, or you want your kids to get started quickly use this. It’s not for complex things, but for starting out and doing some simple things this is absolutely fantastic. I’ve even used it for some duelstrusion builds.

12) Really this thing is awesome, and I’m starting to be able to design and print actual useful things that I bought it for (you know, other than just making sure the kids had a heads up into the new age of design for things, my children will be employable or self employable ;)



Ben designed that pumpkin ALMOST all by himself on the tinkercad site and he’s just 7.

Tuesday, June 12, 2012

RFID for XTension

It’s remarkably easy to setup an RFID access control system with XTension even though the parts dont always come with a fancy plastic case and a DB9 plug.


Sunday, June 10, 2012

Wiznet Configurator for Mac v2

Update 12/21/2020: The home of the Wiznet Configurator for Mac has moved to the Mac Home Automation site. There is a new version hosted there which is fully notarized for Catalina and newer as well as having native code for Apple Silicon.



Another upate to the Wiznet configurator app. Discovered another enumeration bug in the remote host screen TCP and UDP were reversed so of course if you selected the correct one for use with XTension, TCP, it would then refuse to accept any connections. Which is rather frustrating.

This version also adds the ability to save and restore configurations to disk.

previous entries with more information here and before that here. XTension is my day job and is Home Automation and Security software for the Macintosh.

new download links:
  Wiznet Configurator MacOS Universal
  Wiznet Configurator Linux

Saturday, May 19, 2012

Tivo Expander Drive Internals

Everybody wants more space in their DVR right? And if you have TiVO you can purchase one of the ludicrously overpriced hard drives with the custom partitioning scheme called a “tivo expander” that western digital sells to pair with the drive in the TiVO. When I first decided to do this I was appalled that they should cost so much more than the cheapest drive from WD that I could find. They can’t be any different can they? It didn’t seem like online at the time people were having very good luck creating one for themselves with a regular disk and it turns out the plug on the TiVO is not a standard SATA plug but something slightly different, or at least the plastics are keyed differently meaning you can’t plug in the same cable you got with that el-cheapo drive.

So I gave in and bought one. It ran happily for years and then died. It’s been in the bottom of a drawer with dozens of other dead or now unneeded pieces of kit that I’ve been unable to part with. Recently I’ve been cleaning out my flotsam but rather than throwing them out I’ve been pulling them apart and hanging the boards up on my bathroom wall as a kind of geek wallpaper. So I tore into this drive to get the board out and the platters to hang up on the wall and was surprised to see that it actually is considerably overbuilt compared to other disk drives I’ve torn apart. The first thing that clued me in was the thickness of the platters themselves. They are twice as thick as a non-TiVO platter from WD.


when I picked it up I knew I should be taking a picture of this for posterity. Here it is compared to a disk from a more recent WD disk that failed:

By caliper measurement it’s actually twice as thick at 1.75mm!

the other WD platter at .82mm

and the TiVO expander at 1.75mm.

Additionally there were these odd spacers between each platter, just machined pieces of aluminum:



What purpose they could serve I don’t know but I’ve never seen them in any other drive I’ve torn open, though I’m far from an expert on disk drives.

So it seems to me that these drives are actually built to a higher spec than the cheaper drives we get for most other things. I dont know if that helps, this one still didn’t last as long as it should have, but it does explain why they are more expensive, it’s not just a branding issue with TiVO.

Wednesday, May 2, 2012

Metering The Smart Meter: part, the 4th

I’ve made some significant progress in measuring those pulses from the smart meter that I talked about in previous blog entries. The IR remote receiver was a total fail in reliably receiving them as they weren’t modulated that way, or in any way to make their reception reliable or easy to manage. It’s just on/off once for each watt hour used.

So i built a new sensor to velcro over the LED on the meter. This one has just a phototransistor and some resisters, the values of which I failed to record and cannot remember. So i’ll have to sort that back out again before I can make more of them. I did some math to decide what they should be but have cleaned up the lab since then and the notes are gone... Need a notebook rather than scratch paper I think.

I’ll post the software when it’s all working. The problem with a phototransistor is that you have to measure the output on an analog pin. You can’t just get a nice pulse of digital on/off. So that means sampling in a loop and comparing the values. Though that phototransistor is in a black casing which reduces it’s sensitivity to regular light it still changes it’s values significantly when the sun is shining on the meter.

This makes it difficult to just pick 2 readings and call one the ON threshold and the other the OFF threshold for the LED. What I finally did was to save each loops reading into a buffer of an arbitrary size calculated that even for the lowest power use it will always contain samples from on and off. Then I walk that array and take the min/max of the values. Finally I create an ON threshold at a quarter of that difference above the min, and the OFF at a quarter below the max.  These numbers adjust during the day as the light levels change and make sure that it can always tell the difference between an on and an off.

I still get the rare oddball pulse. It’s so reliable in it’s timing that it’s either real coming from the meter or that is the shortest time frame that can be calculated with the arduino that I’m using. I’ve added code to ignore a pulse if the calculated power usage is more than 150 amps. It is possible that this might actually ignore a real peak power usage starting up a large AC unit with a hard start kit on it or something like that, but thats probably an unlikely occurrence that wont change the overall calculations that much.

Once doing that I am now reporting to XTension a value for the last reporting period, at least 5 seconds between reports, the number of pulses counted for a more accurate overall usage than adding the calculated values together and lastly the average power usage for the period and the peak usage for the period. All together making a very nice graph inside XTension.



thats just the AC cycling on and off the other morning. Interesting the compressor profile there where it uses a lot of power initially (though no big startup spike) which drops off and then as it comes up to full operating pressure returns almost to the starting load. Does it every time too.


This one is me cooking dinner the other day and you can see the electric stove elements cycling on and off and the spikes they generated when they first turned on. The graphing software needs some help there calculating the x axis lines ;) Dont know why that is so bad looking, but I never tested it with such a wide range of values.

This reports up to XTension through the serial port of an xBee, the next project will be to get it working with the wifi version of the xBee which I just received a couple of from Digi and will start messing around with shortly. Adding support for those and the traditional xbee radios to XTension really opens up a lot of possibilities. Here’s the Wifi one:



Monday, April 23, 2012

Steampunk Photo Cube Lamp

A little over a year ago a friend of mine saw This Instructable for the “Architectonic Photo Cube” and I offered to build it for her if she ordered the pictures printed to glass. That was not long after we had moved and what with life in general the pictures sat here for a year before I got around to putting them together. I decided to use brass fittings rather than the standard zinc plated and build a nice oak/brass base for the lamp. Since she had waited so long I spent some extra effort on the switch putting in a little knife switch to control the lamp and since it had a second position that would have been boring as just “still off” I put a Candle Flicker LED on the second position so that the lamp can be operated in either lamp mode, or candle mode.


Assembling the photo plates I did pretty much according to the instructable. They look really nice in brass. The corner braces that I got in brass were larger 2” than the ones called for in the instructable so my angle brackers are closer together in the middle a bit, but it wasn’t a problem and looks just as good.






The springs are completely decorative and serve no purpose other than decoration. I was thinking I’d have to wind some copper coils to make them look good against the brass, but I just bought a couple of packs of assorted springs at HD and they were enough to fit. I might have gotten shorter screws than these too as the whole thing is rather more spiky than it technically needs to be but it’s still a stylistic approach.

The base is cut from a piece of 3/4 oak with oak molding around the bottom piece and the top piece has a small routed ogee at the top. The bottom has a cutout under the top part to fit the electronics.


This is a 7 watt Phillips LEd bulb, but we ultimately went with a 3 watt one to just illuminate the photos without trying to actually cast light, it was a better look. The 10mm candle flicker LED is also visible in this picture as well as the brass shelf brackets that I used to hold the top in place. Since the angle brackets I used were 2” ones the tab from those brackets fits perfectly between the nuts on the bottom 2 screws and do an excellent job of holding it to the base but still allowing you to easily lift it off to turn around to show the other pictures.


The corners I used these brass corner brackets that are also just available at HD, they are supposed to go on the top of a box, but I thought they looked cool on the bottom of this where they sort of overhang the curve of the molding. Underneath them is just a regular stick on plastic non-slip foot thing to raise it up enough for the cord to get out.


The control system required some extra parts to make the knife switch safe, obviously you can’t put the 120v for the light through the knife switch. That black box there is a little 6v power supply that I just soldered to the power plug directly. That is that runs to the knife switch and powers the candle flicker LED. When the switch is in the other position it turns on a Solid State Relay that isolates the knife switch from the mains power needed for the LED bulb. I considered building a custom LED array to light it all from low voltage, but this offers more options for lighting and was actually much simpler.  The 6v power supply there is just slightly too tall to fit glued in there with a cover over the entire assembly so I made a cutout for it. I could have dremeled or notched the bottom of the plate to cover it completely but I had made enough sawdust at this point and needed to finish the product ;) There are no exposed high voltage wires inside there even if little fingers should turn the lamp over and poke around.



See how well the brass shelf supports fit between the angle bracket screws. Measuring for where to drill the holes was tricky as the offset of the shelf supports was 3/8” and my table saw has come out of alignment a bit so that piece wasn’t quite square and the routed profile meant getting a measurement to the actual edge was a pain. But it’s close enough to centered that it looks fine unless you attack it with a ruler.


The cord completes the steampunk/vintage feel of the thing. Ordered a spool of absolutely beautiful fabric woven wire from Sundial Wire.


In the dark my camera made it look more like a steampunk nuclear reactor ;)
.code { background:#f5f8fa; background-repeat:no-repeat; border: solid #5C7B90; border-width: 1px 1px 1px 20px; color: #000000; font: 13px 'Courier New', Courier, monospace; line-height: 16px; margin: 10px 0 10px 10px; max-height: 200px; min-height: 16px; overflow: auto; padding: 28px 10px 10px; width: 90%; } .code:hover { background-repeat:no-repeat; }