Monday, January 30, 2017

Cube3 BOM

I keep needing to look up the part #s of the different chips on the Cube3 controller board, and I figured it was about time to just make a bill-of-materials sheet for easier reference. (Now if only I could remember how to make a proper table in this thing...)


CPU:
   PIC32MX695F512L - Microchip

Oscillator:
    8 MHz

Wifi module:
    MRF24WG0MA - Microchip - SPI interface

Bluetooth module:
     VDBTLE24 - Viper Design - SPI interface

     Components:

  • BTLE radio - NRF8001 - Nordic Semiconductor - https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF8001
  • USB bridge - PIC24FJ32GB002-I/ML - Microchip - http://www.microchip.com/wwwproducts/en/PIC24FJ32GB002

Motor Drivers:
    TI DRV8811

Motor Driver DAC:
    U16 - MCP4728UN - Quad 12b i2c DAC - internal VREF 2.048V - http://www.microchip.com/wwwproducts/en/en541737

MOSFETs:
    ST VN5050AJ - single channel high side driver with analog current sense

LCD Module:
    RX024C-1 - Shenzhen Rogin Electronics
    320x240 - 2.4" - TFT - 262K colors (65k in SPI mode) - 4-wire resistive touchscreen

     Components:

  • LCD Controller - SPFD5408B - https://www.crystalfontz.com/controllers/Orise%20Tech/SPFD5408B

Serial SRAM:
    U20 - 23K256 - 256Kbit (32KB) SPI SRAM - Microchip - http://www.microchip.com/wwwproducts/en/23K256

Fans:
    Extruder carriage - Sunon 12V 0.58W
    Nozzles (2x) - Sunon 5V 0.5W
    Motor blowers (2x) - Sunon MagLev MF50151VX-B000-A99 - 12V 2.04W

Stepper Motors:
    Extruders - Minebea 17PM-K374BN02CN (also 01CN)
    Axes - Minebea 17PM-K374BN02CN

Linear Rails:
    THK SRS9X

Extruder connector board: 
    U1 - AAHA - SOT23 (?) - 3.3V in, ? out
    U2 - GDX6 - SOT23 (?) - 12V in, 10V out
    U3 - 852 - SOT3 (?) - 12V in, 3.3V out
   
Extruders:
    Heater resistors - 15 Ohm
    Thermistors - 200k (?)
    Heater cutoff switch - Cantherm F20A

Filament Cartridge EEPROM:
    DS28E01-100 - Maxim - 1Kb Protected 1-Wire EEPROM
with SHA-1 Engine
    (very similar to DS2431, but with SHA-1)

Sunday, January 29, 2017

DRV8825: nHOME, part 2

Continuing on with the nHOME investigation, I discovered that there is no pin on the carrier board that the nHOME pin can be broken out to easily.
I thought I could replace the nFAULT pin with it, but it ends up that pin is connected directly to the logic supply (5V) on most host boards (RAMPS, etc.) I next looked at the nSLEEP pin, but for some insane reason this pin is pulled down internally, so it *must* be pulled up externally, or your motor driver board will never turn on. At this point I gave up on bringing nHOME out to a pin on the carrier board... it would be mostly for physical security anyway, since it will need to be wired to a logic pin somewhere else on the board. So, blue wiring it is!

I tried some new stuff during the hookup: I've had an unused Arduino CNC shield for a while, and I figured that would be the easiest way to test a carrier board. It uses the standard Uno pin naming, and breaks out the pins from the carrier sockets to male headers, which is perfect if you want to sample those lines with an o-scope while a carrier board is plugged in.
I also found an interesting new stepper driver library (it's called StepperDriver) that can track the microstepping for you, and lets you move the motor by degrees instead of just steps. (I used neither of those features for this round of testing, but I might use them in the next one.)

Test setup
I made an Arduino sketch that steps 200 times in the forward direction, pausing for 500ms between each step. After 200 steps, it pauses for 1s and then repeats in the other direction. I pulled the nHOME pin up to Vcc via a 10k resistor. I hooked a scope probe to the step and nHOME pins. The microstepping was set to 1/1, or one full step per pulse.

Expected result
If I read the DRV8825 datasheet correctly, the nHOME pin should assert once per revolution at 45°. Being a standard 1.8°/step motor, 200 steps should be one full rotation. I expected to hit it once in the fwd direction, and a second time in reverse.

Actual result
My, was I surprised! The nHOME pin didn't just assert once per rev, but actually it was pulled down once for every four steps! The delay between pulses was too long; capturing a full rotation made my scope's screen refresh take forever. But I have no reason to think I wasn't getting normal behavior on that end (I measured stepping frequency at 1.25Hz). If this nHOME behavior is not due to an error on my part, that means not only is the assert count not 1/360°, but it's actually 1/7.2°, or 50 pulses per rev.
I bought these drivers off eBay, I believe, and I've always been curious if they were genuine TI parts. It's likely they are knock-offs and this nHOME behavior is either

an error, or due to a mis-translation of the datasheet (like the famous bug in nrf24 clones). I actually think it may be more useful this way, as I was thinking I'd need to physically align the steppers so that 45° would be near where the endstop hit. Hopefully a bit more investigation will determine if it's truly the driver or some error in my setup.




Next steps
I want to re-run what I just did, minus the delay between steps. I should be able to capture all the pulses for a full rotation more easily, at the same time eliminating the delay() function as a culprit for any timing weirdness.
I'd also like to try out larger microstepping values. If I understand the datasheet correctly (and I'm 0/1 so far), the nHOME pulses are related to the physical position of the stepper, which would mean it will assert at the same spots, regardless of how many steps it took to get there. My guess is changing the microstepping to 1/2 will make the nHOME assert once every 8 step pulses.

Time for more science!

Sunday, January 22, 2017

TI DRV8825: There's no place like nHOME

I was comparing TI's DRV8825 and DRV8811 stepper motor drivers when I found a "hidden" feature I hadn't noticed before. Both drivers have an "nHOME" pin that goes active only when the stepper motor is at a specific angle (45°). I immediately thought of several uses for this pin.
The simplest application of the nHOME pin is as a check for your 3d printer's steps/mm settings. Calibrating that setting is critical for producing dimensionally accurate prints, but there's always a bit of guesswork involved. Most cal guides include a complicated function that multiplies step angle by microsteps, # of teeth, gear size, etc. I prefer to skip all that and just print 20mm calibration cubes and adjust the steps/mm with the error. Neither method is very precise, since there are many other factors involved in the final output, like filament diameter and flow rate. But I've found that if you calibrate the extruder motor first, and don't change filament between measurements, my method can result in less than 1% error (when you use a measurement tool with less than 1% error, of course). Regardless of which method you use, the motor parameter is always a constant. A stepper with a standard 1.8° step angle has 200 steps/revolution. It's set in stone. But when you enable microstepping, does a revolution still equal 200*mstep factor? If something is wrong with your driver setup, and your motor is skipping steps, you won't see it until you start printing, at which time there will be a bunch of other possible causes. (If it sounds like I am familiar with this problem, it's because I am. Intimately.)
Being able to verify how many step pulses equal a full revolution of the motor would be a very simple and handy tool in our toolboxes.
The other, and most interesting, application is for closed-loop motor feedback. With no additional components at all, the nHOME pin could be used to verify the motor hasn't skipped steps during printing. It wouldn't be very precise, since you would only be able to check it once per full revolution, but it's still better than no check at all.
Where this really starts to get interesting is when you couple the nHOME pin with an encoder. The most useful (and expensive) encoders report "absolute" positions, meaning they give you the exact position at any time, even at power-up. The cheapest encoders only report "relative" position. Relative encoders tell you how many pulses the motor has moved forwards or backwards. If you stop counting pulses, or power down the system, you don't know where the motor is, and you need to home the motor to get a "zero" position to start from. (This is how most 3d printers work, today, minus the encoder. The system counts how many step pulses it sends to the motor in each direction, so it knows where the motor "should" be, as long as it didn't skip any steps). I've also seen "hybrid" encoders that combine a relative one with a simple two-state detector. You can use the simple detector to give some context to the relative pulses; I've seen kinds that pulse once per revolution, and other types that are on for half the rev and off for the other half. The nHOME pin functions just like the former, meaning you could always correlate the physical position of the motor with the relative pulses. You could even use it to automatically calibrate the encoder, since a relative one still requires a "pulses per distance" number to be useful. (If you're repurposing encoders from other sources, you may not know that exact value.) Counting encoder pulses that occur between two nHOME toggles means you know exactly how many pulses occur for one full rev of the motor! Throw in a move to the endstop to get a zero postion and you'd be able to know the exact position of the motor carriage, (along with the exact angle) at any time! Good stuff!
Unfortunately the nHOME pin isn't broken out to a header on Pololu (or clone) DRV8825 boards, but there are several that nobody ever uses. I'll do some research and see if one of those pins can be swapped out for nHOME.

Saturday, January 7, 2017

Filthy Treasures: Kindle 2

I scored this Kindle 2 for $10 from Value Village before the holidays! I've wanted to do a project with an e-ink screen for a while, but not enough to go out and buy one just to hack. This one works great, other than the battery not holding a charge (to be expected with something so old). I intend to use it tethered, so that's not a deal-breaker. The physical keyboard is actually preferrable for my intended use, (a portable serial terminal, if you were wondering).
While checking it out I even found a feature I've been wanting forever: text-to-speech! This model will actually read your ebooks to you! I've had a Kindle  Paperwhite for a few years, and I'm not sure newer models even have this feature.
I love a great thrift store score!

Saturday, October 8, 2016

Cube3 teardown - Electronics

Here are some pics of the LCD and controller boards in the Cube3 during my initial teardown. (I found it strange that I couldn't find any detail of what the MCU and motor drivers were for this guy while I was researching it online.)

To get to the controller board and LCD, you must remove the outer shell of the printer. I simply followed the teardown steps from the OpenBuilds forum thread.

Cube3 with outer plastic shell removed.

To get the front shell off, you have to disconnect the cable to the LCD first.


The LCD and button board are attached to the front plastic shell. To remove the board, unscrew the 4 small Phillips-heads (and don't lose the button, it's not connected to anything!)


It looks like a 3" LCD from a cell phone, with a 4-wire resistive touch screen. A company called "Lincoln Technology Solutions" made the module.  


There's a 16-pin QFN part on the module that is probably the controller for the backlight. I assume the interface to the LCD itself is SPI, considering the small number of wires. 


The main controller board has 5 motor controller chips on it. One for each axis and extruder. 


The motor controllers are TI's DRV8811. The 8811 seems to be the little brother of the much more common DRV8825. It supports a peak current of 1.9A and 1/8th microstepping, compared to the DRV8825's 2.5A peak current, 1/32nd microstepping. (I've read that the DRV8825 really shines at 24V, which would explain why this system runs at that voltage instead of the more standard 12V.)


The biggest surprise of this teardown was the make/model of the controller micro. Instead of running on the prolific AVR architecture, which powers almost all hobbyist 3D printers at this point, or an ARM Cortex M3 or M4, which are the up-and-coming contenders, the Cube3 is powered by a Microchip PIC32! That's definitely a shock. The PIC32MX695F512L is an 80MHz MIPS M4K micro with 512K of flash and 128K of SRAM. The peripheral set, other than USB host, is about equivalent to an AVR/ low-end ARM: 16-channel 1 MS/s 10-bit ADC, 5x 16-bit timers/PWM, 8-channel DMA, 2x comparators. The kicker is it's priced around $10/each (in single quantities)... which is what an AVR MEGA2560 costs, and is probably double that of an ARM. (The M3 in the Monoprice Mini is less than $1 per.)


The wifi module is also made by Microchip. (I didn't look this one up because it's not exciting.)


There's also a Bluetooth Low-Energy module on the controller board. I haven't used the mobile phone app for the Cube3, but that's probably what this is for.



3D Systems Cube3 - Post Index

I'll be doing a series of posts about 3D Systems' Cube3 printer. I've been posting a lot of info in a Facebook group, but the post is getting long, and not easy to navigate. So I'll be re-posting that stuff here, along with all my new investigation. Since I already have a large backlog, I will probably post things out of order. This post will act as the "table of contents" for all the posts, so it will be easier to find what you are interested in.

01 - Cube3 Intro and Resources
02 - Cube3 Filament Cartridge Intro
03 - Cube3 Print Bed and Quality
04 - Cube3 Filament Cart Teardown
## - Cube3 Teardown


## - Cube3 Filament Cart EEPROM Reading

Saturday, July 23, 2016

SMD Capacitors in Bulk

I'm planning on adding a SATA connection to my Pogoplug Mobile, possibly promoting it from "thing in a box that I've already hacked and become bored with" to NAS box I would use daily.
(I'll be using this thread as my guide, although it's a bit sparse.)

The only thing in my way is a little SMD soldering, which is more of an attraction than anything else at this point. Unfortunately the mod requires adding some 0402 components, which is not a size I have on-hand. But take heart! It just so happens I am in the middle of assembling an order to Digi-Key. (I usually order from Mouser, but Digi-Key has a larger selection, and it just so happens this time aroudn I need some stuff Mouser doesn't carry.)

If you're never ordered from an electronic component retailer before, they normally offer large price cuts the more you buy. Often they won't even sell you less than an arbitrary minimum number. (If you look up a part on findchips, the lowest price is almost always at Verical, the "clearance aisle" of Arrow, but you have to buy several dozen to get that price.) This is the reason why we need services like Tindie and Kickstarter, as everything in the electronics industry operates this way, making it prohibitively expensive to make only a couple of anything.

I'm well aware of how this all works, but when I went to hunt down some 0402 caps and resistors this morning, I found the bulk pricing on them very odd.

Their price for a single 0402 10nF cap is 10 cents. Seems a bit excessive, but you always get gouged for small quantities, and they are X7R (low variation over temperature) and a name brand. I only need maybe 5 caps, but I've learned that the smaller a component is, the more spares you should buy. So I should probably buy around 10, then. The bulk price when buying 10 or more drops to 1 cent each. So let me get this straight, buying 10 of these caps is exactly the same price as buying just 1. How is that possible?

I looked at the next tier up; when buying 25 or more, the price drops to 7/10 of a cent each, making buying the minimum for that tier a total of 18 cents, which would be less than the price of 2 single caps. The next tier up is 100 caps for less than 5/10 of a cent each, with the minimum purchase a grand total of 47 cents.

So I could buy just the 5 caps I need for 50 cents, or I could buy 100 caps for 3 cents less.
Makes perfect sense!


Sunday, March 6, 2016

Dirt-cheap filament dryer.

I've been killing myself trying to figure out an easy way to dry out my PETG filament. (My big printer is in the garage, and the filament absorbs the moisture in the air so quickly that it's almost unusable if left out overnight!) I stumbled on the plans for this dryer on the Taulman site, otherwise I probably wouldn't have trusted that it works.
I'm using a 40W halogen globe, and it stays consistently between 100-105°F. There's room for two spools, and after a good 8 hours in there, my PETG is usable again!
(And it's much easier to build than a toaster oven/SSR/PID controller setup).

Thursday, October 8, 2015

Printrbot Simple Metal Upgrades

Cinderella is almost ready for the ball!
After months and months spent trying to get consistent results with ABS, I've finally started having repeatable successes. So, of course I go out and buy a full set of upgrades so I can start the calibration process all over again!

I recently bought one of those official Raspberry Pi 7" touchscreen LCDs, and I was pretty disappointed that I couldn't just print the case model that MCM made available. (That and one of the models from a recent "mostly" 3d-printable printer design was too big for my X envelope by 10mm!) So, of course when I saw the new Simple Metal upgrades in the printrbot shop, I jumped on them. (Treat yoself!)
She's now decked out with the Z and X upgrades, making her build envelope 250x150x250mm, (up from the stock 150mm3). I bought the matching new heatbed, as well, because the one I have is tuned perfectly and I want to just transplant it onto a new printer.
I also bought the new Ubis 13 hotend, because I've been wanting to print nylon, and it needs more than 240C, which is supposedly the limit of the original Ubis. Of course I had to buy a full set of spare tips to go with it, which cost as much as the stupid hoUbis itself!
To round it off, I bought a new Printrboard (rev F5) because I popped the stupid cooling fan Mosfet on mine. I should be able to fix it, but I'm not going to attempt SMD rework on a mission-critical component. It's not a huge deal, but a lot of the success I've been having with ABS is due to quickly cooling the upper layers, and the busted fan control requires me to wait around for the first couple layers to print before manually plugging in the fan. Which is annoying for 150mm2,  but will probably become excruciating for 150x250mm.
Anyway, the assembly was straight-forward. I put the original together from a kit, and added the heatbed upgrade, as well, so by now I'm quite familiar with this Disney princess.

Maybe I'll write some "first impression" posts on each upgrade, independently.

Saturday, July 12, 2014

Reusing Dead Tech

Another thing I am obsessed with (there are lots of these things, I hope you are prepared) is the concept of obsolete technology. It's such an interesting idea, because it is purely a cultural construction. Technology never becomes useless on its own; either we decide the use is no longer important, or something else comes along that we decide is more useful. (Of course we rarely think about the cost of adopting new technology, but that could be an entirely different post).

Whenever I think about this topic, I am reminded of my father, and his desire to write a novel. We had recently acquired a shiny new Macintosh, (this was probably 1991, or thereabouts) with all its amazing pointing and clicking and beige-ness. My dad told me how he wanted to write a book, and, of course, I showed him the new word processor on the Mac. I was astounded when he told me he wanted to dust off our old Apple IIe and use it, instead. How could someone possibly prefer the clacking, the cursor, and the monochrome to 4-bit color and a mouse?

Until that point I suppose I had never thought about the usefulness of obsolete technology. That Apple IIe had not ceased to flawlessly perform the functions it was designed for. We had simply decided to make different tools. Whether or not those tools were actually better...  is debatable.  But maybe I'll bring that up in another post.

To bring this back to relevance:
I love to go to second hand stores and look at the piles of technology we have decided has become obsolete. In almost every case the technology itself is simply astounding. At the time it was created, each piece was the absolute pinnacle of our advancement as a species. Yet only a few years had to pass before there was something better, faster, cheaper, or more appealing.

An example I have been studying recently are optical mice. There was a wave of posts in DIY blogs over the last year, and I was astounded after reading them. Every optical mouse contains a chip that is effectively a super-fast, low-resolution camera. It determines which direction it is moving by taking thousands of snapshots per second of the surface below it. It then sends those images to a DSP (digital signal processor), which compares each frame to determine the direction and magnitude vectors.

It boggles the mind to think that the technology that performs this function, so advanced that it can be used to accurately track a drone's flight, (which in the 1960s probably took a room of electronics to perform), has been miniaturized and integrated and streamlined and is so common place and unremarkable that I can buy one for $2 at Goodwill.

It is also a great excuse to buy a bunch of them and take them apart.

The Journey is not the Goal. The Goal is the Goal.

(I originally planned to put the text of this post under Introductions, but it seemed to take on a life of its own, so I gave it a separate page).

I am obsessed with the idea of simplifying the man/machine interface, to the point of making complex machines into 'appliances'. Did anyone ever teach you how to use a microwave? A CD player? Those complex machines have such a simple interface that interacting with them requires almost no thought whatsoever. At that point the machine itself disappears and what remains is the action itself. You are not using the CD player, you are listening to music. You are not manipulating the settings on the microwave, you are cooking food.

Any interface design that requires the user to focus on the interface instead of the desired result is poorly engineered. I work with engineers every day, and they all have this idea that more is better. "What if you want to change the settings?" This is the type of person that focuses on the interface and implementation so much they lose sight of the purpose of the machine.

My goal is not to have infinite control of the microwave. I'm hungry and it's time to eat.

Introductions

I figured that before I just start posting things, I should probably introduce myself.

My name is Kris, and I've been taking things apart since I was 8 years old. (Only recently have I begun to be any good at actually putting them back together, though).

I live in Seattle, WA, USA, and I've worked as a software/firmware test engineer since 2000.
You could say breaking things is my job.

I have always been fascinated by electronics. When I was small, before I knew what resistors and capacitors were, I would take apart broken (and sometimes working, much to my parent's chagrin) gadgets and stare for hours at the tiny, magical cities built on the boards. This sense of wonder has never left me; almost every day I learn something new. But it seems like the more I learn, the number of amazing things out there to learn does not get smaller, only bigger.