Posts

Showing posts with the label hardware

Fix for Cura's Ender 3 gcode

A child of mine finally asked for a 3d printer.  I knew that if I tried to push it, no kid would be interested, so I didn't.  But finally, one of them asked for one.  We ordered the Creality Ender 3 that night from their website and some filament from Amazon.  It all arrived a couple days later and we enjoyed the process of assembling it and then finally printing the gcode files that were on the SD card that came with the printer.  Including those was a really nice touch.  Once we got the bed close enough to the nozzle it all worked great. After the initial success we found some models on thingiverse, sliced them with Cura , and then saw the printer do something like this (not my video) over and over.  Too much filament in the wrong place, no filament in the wrong place.  It was a strange and bewildering start-up sequence to watch.  I searched the internet for advice and didn't find much.  I finally just opened up the gcode file that C...

Quick Thoughts on Creating Coding Standards

Introduction No team says, "write your code however the heck you want." Unless you are coding alone, it generally helps to have an agreed upon coding standard. Agreeing upon a coding standard, however, can be a painful process full of heated arguments and hurt feelings. This morning I thought it might be useful to first categorize coding standard items before starting the arguments. My hope is that once we categorize coding standard items we can use better decision criteria for each category of items and cut down on arguing. Below are the categories I came up with really quickly with descriptions, examples, and decision criteria for each category. Feedback is welcome in the comments. Categories of Things in Coding Standards Language Specific Pitfalls Characteristics​ not subjective, easy to recognize pattern well recognized in the industry as dangerous people have war stories and about these with associated scars to prove it Examples no multiple dec...

Is Verilog's Non-determinism Really a Problem?

A series of blog posts by Jan Decaluwe criticize Verilog for being "non-deterministic" and therefore fundamentally broken. This one has a code example that illustrates the fact. During a lively Twitter conversation about it I fleshed out the example and put it on EDA Playground so we could all view it and, even better, run it with all the simulators that EDA Playground provides and see what actually happens. Click here to see and run the example code yourself. If you run the example you'll see that it behaves the same for all the simulators available on EDA Playground, except one. Jan explains that they are all compliant with the Verilog specification because the specification allows for either behavior. Jan expertly explains in this post how that can be. Despite these clear examples and explanations I'm left with the feeling of, why should I care? Apparently a lot of other users of the Verilog language have the same feeling as me. I tried to see Jan's ...

Don't Use Brasso On Your Blackberry

My phone is an old blackberry curve that I found used on craigslist. I’m cheap. It was in decent shape, but there was one scratch on the screen that kept bothering me. The internet said I might be able to polish it out with brasso metal polish . It wasn’t too expensive, so I ordered some and gave it a try. After polishing until my hand was cramped, the one scratch had become lost amongst a million new scratches. My eyes watered as I tried to focus on the screen through the damaged plastic. Dismayed, but still hopeful, I rested a bit and then polished some more, thinking that sometimes things have to get worse before they get better. Well, I’m still wondering if better was just around the corner, because I finally gave up. In disappointment I went back to the internet to try and find a better answer. Namely, a new plastic screen. It took me a while to figure it out, but the correct search term is blackberry curve housing . Only $15, perfectly clear plasti...

Our New Home Phone: Ooma

Since my family and I just moved to a new state for this new job, we took the opportunity to look at different options for home phone. Some friends had switched to ooma and liked it, and after a little research, we decided to go with ooma too, specifically the ooma telo . We got it at best buy on sale for about $225, and that's all you pay. Apparently we'll eventually have to start paying about $11 a year for some sort of telecom tax. Other than that, nothing. You might be able to find the telo for cheaper on ebay or something too, I didn't look into that too much. I connect my cable modem directly to the telo, and then the telo to my router, and then my computers to my router. You plug your normal land-line phone into telo too, and then it works like it always has. With everything going through the telo, it does QOS to make sure your voice traffic always has enough bandwidth, and it can do port forwarding so web and ssh requests still get to my linux machine. It...

Flexlm, let me count the ways

Trivial to defeat for the dishonest, a complete hassle and waste of time for the honest, who are we, in the EDA industry, kidding with flexlm licensing? As customers we buy this incredibly sophisticated and powerful (and expensive!) simulation and synthesis software, and then it fails to run at times because of this fragile, buggy license software wrapper around it. Why do we put up with it? And vendors, you treat your enterprise customers, who shell out tens if not hundreds of thousands of dollars for your software, as if you don't trust them? You force them to set up, troubleshoot, and babysit these finicky and frail license servers, just so they can run the software they've already paid you (a lot!) for? Why?

New Job, New Focus

I have a new job! I am now a verification engineer at a relatively new hardware company in Utah. I worked on digital design and verification stuff back during internships in college and then for the first few years that I worked full-time. Then about five years ago I switched over to embedded software. It's fun to be back in the hardware design world. Better verification and system modelling was a hot topic five years ago, and it looks like a lot of progress has been made in the intervening years. It's really cool to see. Another big win with the new job is, no more windoze! ASIC designers know a good development environment runs on Linux ;-) I mostly use this blog to write down helpful reminders for myself, and as a start, here's my first verilog tip. Code browsing with ctags works for verilog too! I used find to get a list of all our verilog files and put that in a file called, file-list.txt. Then I generated tags like so: ctags -e --verbose --language-for...

Little Things

Things that never fail to fill me with childlike giddiness: When code that I wrote talks over a network. When multi-threaded code that I wrote shows evidence of actually doing two or more things in parallel. When my code makes an LED blink. When my code makes a motor move. These are not new things to me, but each time I do them with a new piece of hardware or as part of a new project it fills me with such wonder and joy, and once it’s done it’s still fun to run the code over and over and watch it happen again and again. It takes a long time for the satisfied feeling to wear off. It’s even more amazing if it’s more than one of those in combination (multi-threaded blinking of many LEDs, over a network, while moving a motor!). I haven’t confessed this to anyone before, but lately I’ve seen engineers more seasoned than I show the same excitement that I feel in these same scenarios, and I believe that I am not alone. It’...

Extreme

Pretty soon, all programming will be web programming. And I thought I was making extreme statements to make a point in my last two blog entries! I wonder if Mr. Atwood understands how much programming goes into all the hardware devices that surround him? That code isn’t written in Ruby or Javascript. As for my extreme statements about how readily software is changed, I leaned pretty heavily towards one idea. I’m not usually one to have an strong opinion out to an extreme. Engineering is all about trade-offs and holding to extreme ideals doesn’t seem to fit with good engineering. I discussed the Averse To Change essay with some friends and read the comments from all of my readers (thanks you two!). One thing that came up was the idea of using the right tool for the right problem as a bigger reason to use software, not just because it’s easy to change. But what is it that makes software the right tool? I’d say it’s the right tool for ...

Simple Software Cost Measurement

This was written at the same time as Averse to Change . I’ve been jealous of mechanical or electrical engineers who can point at the direct material cost of their design, that concrete dollar amount, and say, that’s how much it costs. They gloat about redesigns that result in the same functionality but with a reduction in direct material cost. They rarely even have to talk about the cost in engineering time that it took to get to that cost reduction. Once I realized what the true value of software was, I realized that we too could use a simple measure like DM cost: lines of code. Not like the horribly misguided productivity measurements of old where more lines of code was better. When you realize that the ability to quickly make changes is priority number one, you see that less lines of code is better. I like this because it’s a lot like DM cost, where it’s easy to count and less is more, and even just a little less is usually worth the effort. In the ...

Averse to Change

This was written about a year ago and left unpublished because it talked about people I was working with. I like the people in the examples, despite my disagreements about they way they work, and I didn't want to hurt anyone's feelings, so I left it hidden on my hard drive. After a conversation a couple days ago at my new job about the apparent recent death of software engineering , I was reminded of this essay that I had written. I think it needs to see the light of day, so hopefully with the passing of time since the examples took place nobody will get upset. There are certainly no hard feelings on my side because I am far from perfect myself. OK, on to the essay. Software (and the engineering that goes into crafting it) is a very misunderstood thing, especially at hardware focused shops. It is misunderstood by management, but that’s old news. I’m afraid it’s misunderstood by many of the engineers, even software engineers, as well. This leads to a lot of un...

Bike Headlight

Image
It gets dark early up here in winter, so I've got a little more to say about flashlights. About a year ago my wife and I sold my old Nissan Altima and I used the proceeds (and then some) to buy a nice bicycle for commuting to work. At this time of year, when I first got the bike, it's just getting bright enough when I come home from work that I didn't need much of a headlight, so I thought I was all set up with the cheap headlight from Fred Meyer. As winter came this year I quickly learned just how dark it gets by 5 PM up here in the northwest. I needed a better headlight. Being the cost-conscious engineer that I am, I did my due diligence researching and looking around before I decided on a solution. There was no way I wanted to pay upwards of a hundred dollars for a headlight. For a while I thought about making my own headlight , but then I found a website that talked all about using flashlights as bicycle headlights ( UPDATE : safer for work link, with more idea...

Ode to the Compaq 8510w

I got a sweet new laptop at work. It's a Compaq 8510w . The Core 2 Duo T7500 is fast, 3 GB of RAM is luxurious, and the 1900x1200, 15.4 inch widescreen LCD is pretty. I installed Ubuntu 8.10 and it sleeps (suspends to RAM) and wakes up like no other Linux box I've ever had, which is very, very nice (though the XO has started doing that with the latest update extremely well too). I installed the corporate image of windoze XP under VirtualBox. With the processor's virtualization extensions it runs pretty snappily. I can watch the corporate propaganda WMV movies, use Lookout for calendaring, and access the internal IE-only "web" apps just fine. I went with VirtualBox instead of kvm this time, kind of just to see what the differences where. I had to set up bridge networking because the corporate image didn't like not having a corporate IP address. I hear the newest version of VirtualBox doesn't need this, but here is the script I run to set up bridged...

End of the Flashlight Story

Image
Sorry it's been so long. I did play with my flashlight some more. I did exactly what I said I was thinking about doing at the end of that last entry, cutting traces and soldering on new wires, but since the wire I used was so thick there was no way it was going to fit back inside the case. I gave myself credit for fixing it anyway. Not long after I read about edge-lit holiday cards . They looked so cool in the pictures I had to try it. My wife scratched her best wintery scene on some acrylic that I paid waaaay too much for at Michael's and I taped together the light source, using one of the LEDs from my flashlight (yep, I broke it again). I think the acrylic from Michael's was too thick and hard to scratch, and looking at the original instructions again, I'm seeing that they used much smaller pieces too. Ours didn't light up nearly as well. It was fun though. Here's how it turned out: I know, not too impressive of a lighting job. The photography...

A Flashlight Schematic

Image
Well, I took the broken flashlight to work. I have colleagues there who are genius electrical engineers and one in particular, Sam, had a fun time with this challenge. I explained to him the situation and handed him the circuit board. He peered closely at the board, rotating it round and round as he traced all the connections. As he did so he made notes on my whiteboard and after a few minutes he had deciphered the full schematic of the circuit and it's intended operation. We then hooked up a bench power supply and took some measurements (with a much nicer multimeter than I have at home). We measured 2.45 mA of current flowing when 6V is connected and the lights are off. At 220 mA hours of battery life: 220/2.45 = 89.79 hours 89.79 hours / 24 hours/day = 3.74 days Which totally correlates with my experimental data. Here's the schematic for your viewing pleasure (click to make it bigger): You can see some measurements we took and a curve for the diodes. Yes, ...

A Flashlight Story

Image
Back in May of this year, in preparation for a campout, I bought a nice looking LED headband flashlight at Walmart. It's a Garrity light and it ran me about $13. I used it on the campout and fell in love. It was incredibly light-weight and I soon forgot it was on my head, yet it was plenty bright (click these images for larger versions). After the campout it sat in a drawer for a few days before I had occasion to use it again. When I pulled it out of said drawer and pushed the button to turn it on, nothing happened. Saddened, I figured it must have been bumped and turned on while in the drawer or maybe one of my boys had found it and left it on. I bought new batteries and used it while performing some bicycle maintenance in my dimly lit garage late one night. I put it away high on a shelf away from any bumps or curious hands afterwords. A few days later, the batteries were dead again. I've gotta return this defective thing to Walmart, I thought to myself, but n...

Bad Vibrations

Image
Having seen Bristlebot , I thought I knew exactly what I was looking for as I carefully disassembled my Samsung SGH-C417 phone. You see, it had accidentally gone for a ride in the washing machine and after quickly removing the battery, and then patiently letting it dry for a few days, it still wouldn't stop vibrating. Everything else worked fine, so I figured I'd open it up, find the little motor that looks like the one powering the Bristlebot, cut the wires to it, and then I'd still have a working cell phone. Here are some pics of what I saw once I opened it up: Can you see the little DC motor? I couldn't either, and as I fought with stubborn little screws and plastic tabs to uncover more of its innards, I became more frustrated with this little phone. I could still power it up and feel it vibrating the whole time, but I could not pinpoint where it was coming from. I definitely could not see a spinning motor anywhere. After a while, the last part to look un...

Memristor

“Electronic theorists have been using the wrong pair of variables all these years—voltage and charge. The missing part of electronic theory was that the fundamental pair of variables is flux and charge,” said Chua. “The situation is analogous to what is called “Aristotle’s Law of Motion, which was wrong, because he said that force must be proportional to velocity. That misled people for 2000 years until Newton came along and pointed out that Aristotle was using the wrong variables. Newton said that force is proportional to acceleration—the change in velocity. This is exactly the situation with electronic circuit theory today. All electronic textbooks have been teaching using the wrong variables—voltage and charge—explaining away inaccuracies as anomalies. What they should have been teaching is the relationship between changes in voltage, or flux, and charge.” No wonder those analog circuits classes always left me a litt...