1 (edited by Necromant 2013-07-28 09:54:48)

Topic: [WiP] Electronics overhaul (Updated to part 4)

Okay, this will be a several-part mod. I will post details each weekend as I progress.
With the stock solidoodle I didn't like a few things, so here is my plan:

  • Get rid of wireporn behind it. I'm too lazy to unpack up my nice 8 atm. air compressor each time I need to clean it.

  • Pop in a nice&fast minipc for network-friendly printing.

  • Remove filament holder. It takes tup too much space

  • Hook a 450W ATX PSU, instead of stock one. Delivers more current, has a nice green wire to turn off&on from an AVR, develivers 5V standby voltage.

  • PROFIT

Part one.
I have reorganised the electronics a little bit, added a USB hub (1.1 actually, but so far 12Mbits of bandwidth should be sufficient for both the printer and the webcam.)
I hacked the hub a little bit, so that I can inject 5v via a JST cable, and have a shorter cable to sanguinololu and a shorter USB cord
This will deliver 5v power for both the minipc and sanguinololu. Lucky me, the minipc have all 5v rails wired directly to

As the brains I picked a nice 40-buck minipc based off allwinner a10 armed with debian wheezy armhf. Raspberry is far to big, ugly and slow for that. This one just boots, hooks to my wlan network, and all I have to do is type "http://solidoodle/" in my browser. For the UI I'm using octoprint.
I ripped all the mali and gfx stuff from kernel, so that it will not eat up any ram and I will have a solid 1GiB of SDRAM for my stuff.
I also posted some info on these cs102 variation of those, with instructions how to add a serial terminal here: http://ncrmnt.org/wp/2013/05/27/cs102-i … ng-a-uart/

The results look somewhat like this

Next part will be hooking a heavily modded ATX power supply and printing a full cover for electronics. Since motor drivers tend to heat up, a10 can get also quite hot under load, I plan to install a fan with a dust filter in the cover.

P.S. Does anyone need bootable SD card images for allwinner a10 minipc? Please note, that these may be tricky, since some of those need AXP209 driver enabled in the kernel to work properly, others lack the axp209 PMIC and may not boot. They may also have different wireless chips, some need some linux kernel hackery to work, so these may not suit for all.


Part two: ATX adventures
PLEASE NOTE: THIS PART MESSES WITH THE GUTS OF A PART THAT DEALS WITH MAINS VOLTAGE, THAT CAN BE LETHAL FOR SOME PEOPLE. IF YOU DON'T HAVE THE SKILL - DO NOT DO THAT. EVER. I TAKE NO RESPONSIBILITY IF YOU SCREW UP.
Oh, and make sure you do not drink any alcohol before that. Drinking and messing with mains voltage has never been a good idea, but alcohol also lowers body resistance, so you'll have a worse shock.

The following shit may also void solidoodle warranty. 

Enough of scary stuff. Since image upload on PunBB just freaks me out, you can follow all the pictures of this hack right in here

ATX looks like the PSU of choice here, since it has all the goodies:

  • A dedicated pin to turn it on/off

  • A voltage status pin

  • stdby voltage

  • Can deliver a lot of current

  • Cheap

So, I looked around and picked a 500W PSU I had around. Despite an ATX PSU has a LOT of wires, there are only 5 voltage rails there. Mine had a nice chart with curent rating:
28A @ +3.3v
38A @ +5.0v
20A @ +12v
0.8A @ -12v
2A +5v standby

-5v is dead and buried long ago and removed from the spec.  We don't need that anyway.
As you can see from the table above, this is a LOT of current. Enough to power 2 solidoodles with that 12V rails at the same time.  However the stock ATX wires didn't look like they could handle that much current. Or may be they could, but I didn't want to experiment. Therefore I cracked the ATX supply open, removed all the GND, 12v, 5v and 3.3v wires and replaced them with extra thick 4 mm^2 wires that connect to the screw terminals.
That may be a little bit of an overkill, but I only had 1.2 mm^2 and 4mm^2 wires, so I picked the bigger ones.
(Spec recommends using 4mm^2 - 6mm^2 wires when routing mains voltage into a house. Just for you to know that this was indeed an overkill. AWG18 looks like the sane choice here).
2 Soldering irons (a usual smt rework and a powerful 60W), hot air gun, and a hot glue gun are required here.

The procesure is simple:
Note the voltages.
First, gently remove all the stock ATX wires, by heating the side the board with hot air.
You will only want to keep Green (/PS_ON), Grey (PWR_OK), Blue (-12V), Purple (+5VSB). These can hadle the current. We'll need them later.
There's also a brown wire connected to 3.3v. This is the sense wire, that allows the PSU to compensate the voltage drops on the wires. A good idea is to solder a 100 Ohm variable resistor so that we can adjust it whenever we need it. I did that and hot-glued it the case.

Then, drill the board so that 4mm wires would fit.
Fit in new wires, use a powerful soldering iron (60W or more) to solder them.
Use hot glue to fix them in place, so that they won't break away, when you assemble the whole thing.

Since the solder blobs may be rather big, it's a good idea to lift the PCB a little bit with brass M3 standoffs. Covering the bottom of the board with urethane is also a good idea. Just give it 2-3 layers and give the time to dry. It stinks, but gets the job done.

Finally, drill the metal case of the power supply, where you want to fit some screw terminals with 2.55mm  drill bit and tap M3 threads. We can save a little bit on nuts this way.
Next, cover this part of the PSU with capton. It will serve as an insulation and provide a little protection against accidental shorts. 
Now, assemble the whole thing, check it for shorts. Tripple check it for shorts. Quadruple check it for shorts. Then test it. If you don't get smoke and sparks, and multimeter shows realistic voltages - you're good to go.

Next we'll need to connect it to solidoodle. Follow sanguinololu pinout, and connect the 12V voltages. +5 V standby voltage in my case powers the sanguinololu and the CS102 minipc. I'd rather NOT use raspberry pi, since it's huge, ugly and really slow. 1Ghz Cortex-a8 gives a very fast&snappy web-ui.

Next, we need to control the PSU from sangunololu. I used the ISP header MISO, and SCK for that, although you can use any GPIO pins for that. Since /PS_ON is routed directly to a base of the transistor, nothing more required. Just hook this and PWR_OK directly to the pins.

Part Three
Firmware hacking.

This is rather simple. The curent git has Makefile broken yet again, now missing hysteresis.cpp from sources.
I quickly added P0/1/2 commands so that I can disable the PSU with P0, enable by P1 and check PWR_OK status with P2
Rather hacky, but still.
The patch is attached to this post.
Mind, that it also reorganises the steppers a little bit, since I had to swap some of these for the wires to fit in new placement.

Part Four
Web UI.

For WeUI I picked Octoprint. It needs a few hacks to work properly with solidoodle.
First, manual baud is broked for 250000, and AUTO connects at 38400 (?) according to the log. The way out of it here is to increase the timeout.

Next, I wanted PSU on/off buttons right on the WebUI. Easily done.

Next, Octoprint had separate buttons for HOME X/Y and HOME Z. I wanted another button that just sends out G28 and add some more distances to the bar.

Patches:
0001-Add-buttons-for-PSU-hacks.patch
0002-Increase-timeout-so-that-solidoodle-would-work.patch
0003-Rework-control-panel.patch


Screenshot of the modded UI below.
http://www.soliforum.com/misc.php?action=pun_attachment&item=2797&download=0

That's it for this weekend. To be continued.
TODO:
* Stock on ABS
* Print back cover
* Print PSU top cover
* See if Octoprint's API is of any good and write an android app. Managing from phone via web-ui is not really comfortable.
* Rework fan control and an a custom fan control board.
* Firmware update via bootloader broken after octoprint exit. See if this can be fixed.

Post's attachments

0001-Add-hacks-to-control-PSU.patch 2.98 kb, 3 downloads since 2013-07-28 

IMG_20130721_210517.jpg
IMG_20130721_210517.jpg 3.34 mb, 1 downloads since 2013-07-22 

IMG_20130721_215054.jpg
IMG_20130721_215054.jpg 3.27 mb, file has never been downloaded. 

octopatches.tgz 1.43 kb, file has never been downloaded. 

snapshot1.png 131.13 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

2

Re: [WiP] Electronics overhaul (Updated to part 4)

How did it all go?

I'm possibly going to go the mk802 way as well. Sick of having to leave my laptop at the printer for hours. Raspberry pi is too underpowered and has bad power design for what I want. Might go for an all winner a31, but that's probably overkill

3

Re: [WiP] Electronics overhaul (Updated to part 4)

cameron20020 wrote:

How did it all go?

I'm possibly going to go the mk802 way as well. Sick of having to leave my laptop at the printer for hours. Raspberry pi is too underpowered and has bad power design for what I want. Might go for an all winner a31, but that's probably overkill

So far so good, CS102 boots fine, detects all the stuff. I'm still missing power, since I removed the stock adapter. I'm currently messing with ATX power supply. It can deliver a lot of amps of current, but the wires look too thin to handle some 10 amps (which the stock adapter is rated), and there are too many of them. So the next weekend I'm going to grab a bunch of good thick wires, t-plugs and completely rewire the power circuit, ditching the molex for good.
I want to hook CS102 to ATX stdby voltage, so that I can switch 12 Volts whanever I need them with yet another gcode command. I'm still lacking decent docks how much current to expect from ATX 5v stdby voltage, so if it doesn't work well, some other hackery will be required.

4

Re: [WiP] Electronics overhaul (Updated to part 4)

The standby works well with a microcontroler

5

Re: [WiP] Electronics overhaul (Updated to part 4)

WWC wrote:

The standby works well with a microcontroler

It's tricky. allwinner a10 need MUCH more, than a sanguinololu. Usually something about 500mA, but I want to make sure it gets some solid 1 Amp at the very minimum.

6

Re: [WiP] Electronics overhaul (Updated to part 4)

Necromant wrote:
WWC wrote:

The standby works well with a microcontroler

It's tricky. allwinner a10 need MUCH more, than a sanguinololu. Usually something about 500mA, but I want to make sure it gets some solid 1 Amp at the very minimum.

If you shut down the graphics drivers and run in 2D mode only, it will drop to about 300ma and also run far cooler.

Just run a headless Linux variant without video acceleration support...

7 (edited by Necromant 2013-07-26 16:49:20)

Re: [WiP] Electronics overhaul (Updated to part 4)

adrian wrote:
Necromant wrote:
WWC wrote:

The standby works well with a microcontroler

It's tricky. allwinner a10 need MUCH more, than a sanguinololu. Usually something about 500mA, but I want to make sure it gets some solid 1 Amp at the very minimum.

If you shut down the graphics drivers and run in 2D mode only, it will drop to about 300ma and also run far cooler.

Just run a headless Linux variant without video acceleration support...

Yes, I'm talking about a complete headless system, nuking all related to graphics out of the kernel, to free up RAM is the first thing I do.
Anyway, cracking the ATX open and inspecting the circuitry showed up that these things deliver 2Amps @ 5V in stdby, that looks more than enough.
Looks like the doc, that stated that it should be around 50mA was kind of outdated.

8

Re: [WiP] Electronics overhaul (Updated to part 4)

Top post updated to part 4

9 (edited by FatalDischarge 2013-08-12 05:13:31)

Re: [WiP] Electronics overhaul (Updated to part 4)

How did you get power on / off added to the interface? Is it in config.yaml? That only works with a modified PSU though. Right?
I just ordered this: http://cgi.ebay.com/ws/eBayISAPI.dll?Vi … OC:US:3160
Would you happen to know how to make this happen?

10

Re: [WiP] Electronics overhaul (Updated to part 4)

FatalDischarge wrote:

How did you get power on / off added to the interface? Is it in config.yaml? That only works with a modified PSU though. Right?
I just ordered this: http://cgi.ebay.com/ws/eBayISAPI.dll?Vi … OC:US:3160
Would you happen to know how to make this happen?

I now know that it could be added to config.yaml, but at that time I just hacked the HTML templates somewhere in the octoptint tree.
It only works if you connect the green&grey (/PWR_ON & PS_OK) to sanguinololu.