Cerealbot/Hardware

From Makers Local 256
Jump to: navigation, search

External Stepper Drivers

I want my printrbot to use Trinamic 2130s, but the Printrboard F4 that I use has integrated drivers... What do?

Option 1: Go buy a board with TMC2100/TMC2130 drivers. ✗ (I tried this, it didn't work out great.)

Option 2: hack it. ✓

The Plan

Grab some RAMPS compatible stepper drivers and wire them into unused pins on the Printrboard's expansion header. Plug the stepper cable into this external driver. Then update Printrbot's fork of Marlin to use the different pins.

Should be easy enough.

Wiring

Wiring it all up is pretty straightforward. Printrbot provides a pinout of the board, and it lists the Expansion header (EXP2). When looking at the EXP2 rectangle on the diagram, it can be confusing to match the pin numbers up with the physical board. They line up as if you printed out the picture and laid it down on top of the headers sticking up out of the printrboard. So 5V and GND are opposite each other, and both of them are on the far side of the header from the PCB's silkscreen "EXP2".

As a test, I wired in an A4988 driver because it was what I had on hand.

Printrbot-ext-driver-2.jpg

Here the driver's 12V is wired to an external power supply, the 5V-GND is wired to the EXP header pins we just located. STEP on the driver is wired to EXP2 pin 5, which is PD4. DIR on the driver is wired to the EXP2 pin 6, which is PD5.

Exp-2 pinout: http://www.printrbottalk.com/forum/viewtopic.php?f=22&t=5277#p34504

Stepper driver wiring: http://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-arduino/

Proof this is possible: http://www.instructables.com/id/Build-a-Dual-Extruder-for-3D-Printing/?ALLSTEPS

tmc2100 guide: https://ultimaker.com/en/community/11571-step-by-step-installation-of-silentstepstick-drivers-on-umo?page=1

Hackaday rundown: http://hackaday.com/2016/09/30/3d-printering-trinamic-tmc2130-stepper-motor-drivers-shifting-the-gears/

Marlin

Modifying Marlin is a maddening march into masochistic mayhem. The firmware has multiple levels of pin abstraction, and it's a huge headache to unravel.

Grab a copy of marlin and follow along!

First, what do we need to modify in order to change which pins drive the X motor? The answer is some macros in the project's pins.h, around line 1500. It's a good idea to note here that the Printrboard rev F4 has the motherboard ID of 84. Here in the pins.h file we can see that some macros are defined which set the stepper enable, step, and dir pins to some numbers. Neat! It looks like Marlin is undoing the abstraction that Arduino core has implemented to arbitrate the pins available on different arduino boards. So let's go look at the printrboard pinout, and a Teensy++ 2.0 pinout... And nothing matches up..?

Weird. There's no mapping at all between the Teensy that our printrboard is based on, the printrboard's own pinsout, and these damn numbers that are being set as pins in the project source code... Ok, enough keeping you in suspense, the mapping can be figured out by browsing the source code. Look at the source code first, we're inspecting line 45 in fastio.h of the marlin project. Here the macro _WRITE (and by proxy WRITE) is defined. This macro is what gets called in stepper.c with the stepper pin definitions, and we can see that it uses ## to create an amalgamation which corresponds to macros defined at the bottom of fastio.h.

Now we know how the chain of operations leads from pins.h to stepper.c to fastio.h, and we're ready to get some outside help. That page details the mapping as a spreadsheet, and makes figuring out how to change pins easy. If I want to change the X-STEP pin to Pin D4 (exp2 pin 5) then I just look for it in the core_pins.h column of that sheet, and then travel over to the fastio.h column to find that PD4 maps to DIO28_PIN, so we replace the X_STEP_PIN macro in pins.h with 28.

Wash, rinse, repeat for all pins needed.

Link to the pin mapping spreadsheet: http://slamdanz.com/at90usb1286_Marlin_PinMapping.html

Link to just the google doc: https://docs.google.com/spreadsheets/d/1vN9_Nk9VCfHQNZ327idsAJzSZ2SCIxssGr6UzDkQAeI

fpos_t error

Newer versions of arduino IDE throw this error because the compiler already has fpos_t defined somewhere (probably avr-libc). Just rename the struct in your project.

Highlight fpos_t, click 'search...' in the menu bar, click the 'all project tabs' checkbox, replace with fpos_t2 or something, click 'replace all'.

Done.

http://forums.reprap.org/read.php?146,691608

Sporadic Movement

Oh no, the new stepper drivers aren't working right! What do?

Well, make sure that no sneaky LCD settings have crept into Configuration.h and are trying to write to the expansion pins that you're now using for the drivers.

Flashing firmware

Jump the bootloader header (next to the Atmel chip on the printrboard), click the reset button on the corner of the board. 'lsusb' should now show a bootloader.

While the board is in bootloader mode, run the following:

sudo dfu-programmer at90usb1286 erase
sudo dfu-programmer at90usb1286 flash /tmp/arduino_build_260381/Marlin.ino.hex

Then unhook the boot jumper and reset the board again.

Filament Detector

https://www.sparkfun.com/products/13013 - I want to use a "Microswitch"

http://www.thingiverse.com/thing:285504 - A good starting point for a printable shell

Lite Arm

I'm using plans from Thingiverse.

Vacuum Gripper

http://creativemachines.cornell.edu/jamming_gripper

https://www.sparkfun.com/products/10398

Parts

Quiet Steppers

Apparently, quiet stepper motors are on their way to the 3d printing market... In a few months/years. In the mean time, lowering the current delivered to a stepper motor is the approved way to combat "print tune headaches"

Cerealbot's current motor currents (as percents):

  • X - 30
  • Y - 30
  • Z - 30
  • E - 50

Building a HGBP

If you want to use the Cerealbot scripts to automate printing, you first have to configure your printer's hardware to match. Luckily, its both pretty cheap and pretty easy.

Materials:

Make a technology sandwich with hotbed + steel sheet + glass plate all together and mount it on your existing build platform. Then wire in the inductive sensor as your Z-limit switch to your printer and confirm that your firmware can make use of it (this can totally be the most tricky/difficult part of the entire project).

Once you've got that up and running, head over to Cerealbot/rpi and get the software set up!

HBP Design Notes

Heated Build Platform:

Wire sockets 2-3: 5.6 Ohm

Wire sockets 1-2 & 1-3: 2.8 Ohm

1-2 and 1-3 are in parallel, so their equivalent resistance is actually 1.4 Ohm.

V=IR -> I=V/R

24V @ 2.8 Ohm: I=8.6A, P=206W

24V @ 5.6 Ohm: I=4.3A, P=103W

24V @ 1.4 Ohm: I=17A, P=408W

12V @ 2.8 Ohm: I=4.3A, P=51W

12V @ 5.6 Ohm: I=2.2A, P=26W

12V @ 1.4 Ohm: I=8.6A, P=103W

My 24V PSU is rated to 14A. The 12V PSU is rated to 30A. I'm currently using the 408W connection, and haven't blown up the PSU... yet.

Dimensions:

PCB: 1.65mm by 200x200mm

Glass: 3.2mm by 200x200mm

Aluminum: 3.5mm by ~230x~165mm

Method Brainstorming

Thermal Expansion

GlassPlate.png

Implemented. Currently in use.

The Borosilicate glass used in the hotbed has a different thermal expansion factor than PLA. Because of this, repeated heating and cooling of the build platform will break the adhesion of the PLA to the glass plate. Then the printer's tool head can supply enough force to push the part off of the build platform.







Pop-Bar

Pop bar concept.png

Previously implemented. No longer in use.

The pop-bar is a system which minimizes effort to ensure release of a part from the print bed. The idea is to have something mounted on/in the build plate which would leverage the part just enough to make it fall free, then sweep it off with the print head.

I built two prototypes of this system; while they were promising, the skill required to mill the pop-bar flush with the print bed was pretty high and bugs in implementation lead to printer self-harm.




Pivot-Plate

The initial concept for a pivot plate

Hypothetical.

The pivot-plate is a simplified design compared to the pop-bar, but raises some difficult design and construction questions.

The system works on a very basic principle: flexing the build plate will detach a part. Since the build plate is aluminum (for the z-sensor) and not feasible to flex, the plate will be divided in two and hinged, so that it will pivot to force the part off. I hope to design such that a standard servo can be used, otherwise a worm drive and stepper motor system will be investigated.

The design also needs to consider the heating plate mounted below, which means that the heater needs to be modified or the bed can only lift upwards.

Hardware Additions/Modifications

Arduino Pinout

AVR Pin Arduino Pin Function
18 D12 LED Sensor +
17 D11 LED Sensor -
x D3 All fans
x A0 Yellow, Humidity
x A1 White, Temperature

Bucket Water Sensor

Analog value with tap water:

  • Dry - 1023
  • One drop of water - 493
  • Damp - 700
  • Submerged - 220

Current

  • 24V hotbed
  • arduino
    • fan
    • servo

Future

In rough descending order.

  • Killswitch, both remote and local
  • Detect use of emg stop button in arduino
  • Pop-bar and channel
    • servo structure
    • Removal arm. Can also double as print surface cleaner?
  • New GT2 belt mount for print bed
  • Just melt failed prints from the printhead? Then clean with silicon sponge?
  • Use accelerometer to detect grinding gears/belts?
  • larger print surface to maximize hotplate use
    • Longer steel rods
    • more GT2 belt
  • Print a GT2 belt clip? Zipties suck
  • Better webcamera setup
    • different embedded computer?
  • Filament absence sensor
    • Just look for the circuit completion when the extruder rollers connect?
  • Birdsnest detection
  • Print adhesion detection
  • General failure detection
  • Detect belt slipping?
    • Use linear encoders? I mean, they really ought to be standard on a 3d printer.
  • Heater dead-mans switch
    • Ping the webpage?
    • snoop on gcode over serial?

X-Y Axis Upgrade: