CRAMPS works, and the tips here might save you some time getting yours set up.
Why make and use a CRAMPS board?
I had some good luck at the end of 2013 using Charles Steinkuhler’s MachineKit SD images on a BeBoPr board with BeagleBoneBlack to control a Kossel delta printer to print parts for a GUS Simpson. At the time, it was developer-level software on a developer-level board with a developer-level printer, making a completely-out-there experimental 3D printer design. Bleeding-edge fun. I posted a YouTube video of it and got a few hits:
The BeBoPr is great, but it’s expensive, has limited availability, and is closed-source, so it can be a bit harder to debug stuff. Recently, Charles designed a simple, low-cost, hand-solderable board similar to the BeBoPr, but open-source. It’s like the RAMPS board used with Arduinos, but as a BeagleBone cape, and designed for 3.3v logic. Here’s mine:
These are available on Charles’ web store for a reasonable kit price of $60 or board as $10. Add a $45 BeagleBone Black and 4x Pololu-style stepper drivers(~$50) and you’re within spitting distance of a PrintrBoard in price, but with vastly more power (32 bit, 1 Ghz + 2x200MHz microcontrollers vs 16 Mhz, 8-bit, no floating point) and a much more flexible dev environment (Python, C++, shell scripting on an OS etc vs embedded C).
Cell-phone ARM processors are the future of RepRap control, especially for printer types that require coordinate transformation, like deltabots, although the software options are not currently as feature-complete or printer-specific as many Arduino-based options. Add MachineKit, which does machine path and motor control in a real-time way (so that nothing else running on the CPU can interrupt your machine’s motion) and you’ve got professional-level open-source printer control.
Anyway, enough high-level view. Presumably you’re here to set up your CRAMPS, or at least see what the setup process is, because it really is totally different than Arduino-based boards. The current docs for this combo stop at the board build, so posts like this will help fill in a documentation gap or hopefully get pulled into official documentation.
These instructions assume minimal familiarity with BeagleBone and MachineKit. I talk about stuff I used on the Mac, but of course an OS will do.
I bought mine as a kit, although you can get the boards and parts yourself, and hopefully assembled boards will be available sometime soon. There are a number of 603-size surface-mount components and some SO-size chips, but they all had enough clearance for me to to easily solder. Only purchase if you have the right tools, including a temperature-controlled soldering iron, SMT tweezers, and thin solder.
Start to finish, my build took ~3 hrs. The graphical instructions on the CRAMPS page are great, and the labeled parts bags really help out. Just watch out with the Schottky diodes; the thicker line on one side is hard to see because each part outline is so close to other parts similar outlines. Also, make sure to use the marked tee on the back of each LED to get the polarity right; I found the polarity mark hard to see through the frosted glass.
If you’re going to do larger board quantities, I’ve had good results in the past using a laser-cut mylar stencil from Pololu to apply solder paste from a tube, followed by reflowing in a toaster oven.
Load SD image
BeagleBones either run off the embedded flash or an external microSD card. If you have the latest BeagleBoneBlack, rev C, it includes a 4GB flash which is just large enough for the MachineKit image and some user data. However, mine are rev B, which is 2GB, so I had no choice but to run from a card.
More details for this part are on the main MachineKit page. Go there for the download links now.
I have a Mac, and I used the Unarchiver to extract the .xz image archive, followed by Pi Filler to write the image to the SD card, using the Mac’s internal SD slot. Unfortunately, Pi Filler gives no indication of progress, and will appear hung for about half an hour. You can check that it’s still doing stuff by going to Activity Monitor and viewing IO. You should see continuous writes of a few MB/s. Perhaps a more expensive SD card would speed this up.
Power it up
Once Pi Filler completes, transfer the microSD card. You won’t initially need any power besides the 5V barrel jack on the BBB (or the 5V in on the CRAMPS). However, to use any CRAMPS features, you’ll need a higher-voltage source. I used an ATX power supply that came with my PrintrBot Jr.
This V+ is connected to motor power, bed power, aux power, and extruder power. Yes, that means in addition to something like a Molex connector with raw wires, you also need 3 wires to connect up V+ and 3 wires for GND, all at the screw terminal blocks.
If you have an HDMI display/TV and a USB keyboard and mouse, you can use the BBB as a stand-alone computer. I’d prefer to have my BBB be more like an embedded web server, so I usually log in via SSH, using an Thunderbolt Ethernet dongle and CAT5 cable.
The MachineKit image runs Avahi, which removes the need to run a DHCP server for the BeagleBone to communicate with any other machine. The hostname is ‘beaglebone’, and by default Avahi uses the hostname.local convention. So after the board has booted (~1 min), you should be able to SSH into it via Ethernet:
Username and password are both ‘machinekit’.
This is a full Linux PC – you can run commands like ‘df’ to see how much free space is available, or really anything.
Optional: Connect Via Serial
Other connection methods include USB, which I haven’t tried lately, or the onboard serial 6-pin serial connector, when coupled with a USB-serial dongle. I have one of these dongles, from Adafruit IIRC, and it’s useful to see the boot process if things go wrong. On the Mac, I use screen as a serial terminal. Find where your serial port comes up:
Then connect via ‘screen’:
screen /dev/tty.usbserial-FTG9MZFU 115200
You should be able to hit enter to see a prompt, and after resetting, should see the boot process. Note that you won’t be able to run graphical MachineKit this way; it’s text only. Sometimes I neglect this.
Development of MachineKit moves fast, and by not having the latest MachineKit build you’ll likely come across bugs that other have solved. In my case, Charles fixed a thermistor calibration bug after the SD image was created. To update the software, the easiest way is to provide the BBB with Internet access. I use Internet Connection Sharing on the Mac, which is easy and fast.
On the Mac, go to System Preferences -> Sharing -> Internet and share the wireless connection to the Ethernet dongle. When you reboot, the eth0 interface on the BBB should be assigned a NATed IP via your computer, but to force it, run this command, on the BBB:
sudo dhclient eth0
This will DHCP for an IP address; if you connect your Ethernet port to a regular wired network after booting, this same command will apply, and if you reboot, the DHCP should occur automatically. Verify outgoing connectivity:
Now you should be able to update the code, as shown on the MachineKit page. Yes, the ‘make’ portion may take a long time – in my case, ~20 mins. The BBB processor is not laptop-fast, plus there’s a ton of code to build. Hopefully the MachineKit devs will get nightly builds accessible with packages that can be updated automatically via apt-get, the package manager built into Debian, to largely eliminate this delay. For now, do this to update the source build:
cd ~/machinekit-dev/src git pull make sudo make setuid
These steps should complete successfully.
OK, you’ve got the latest software; now it’s time to run this thing for real.
To have a graphical environment appear when logging in via SSH, you need to enable X forwarding with the -X option. This will enable the default MachineKit GUI, called Axis, to appear when you go to run linuxcnc (the name of the executable for MachineKit, and the project from which it forked).
ssh -X firstname.lastname@example.org
Once in, type this command:
Wait for awhile, and the list of configurations will appear. Select the ARM -> BeagleBone -> CRAMPS -> CRAMPS config.
Click the top-left button red X button to disable E-stop, then the next-leftmost orange square button to enable the machine. Then click Home All. Since the endstops are not configured, this will just reset all axis values to zero. The Active light on the CRAMPS board should light up. Time to test each part to verify soldering…
Verify axis motion
If you haven’t plugged in a motor and Pololu-style stepper driver, do so now, but always after turning motor power off first. I plugged in and tested one motor at a time, in case I made a horrible soldering error.
Click plus/minus to move the axis – it should be moving in both directions! Do this for X, Y, Z, and A (via E0). You can connect more extruders but they’re not exposed as axes via the config or GUI yet.
The easiest way is to use the shunts that come with the CRAMPS board, leaving them attached to the plastic backing. Before plugging one in, verify the disconnected endstop value.
In a terminal connected to the BBB (SSH, serial, or direct), run this command:
halcmd show signal limit-x-min
The signal should show false, like this:
halcmd show signal limit-x-min Signals: Type Value Name (linked to) bit FALSE limit-x-min <== bb_gpio.p8.in-08
Put the shunt across S and – on the X min connector and re-run the command; you should see TRUE.
Repeat for min & max for X, Y, and Z.
Verify thermistor readings
Plus a thermistor into the THERM-0. This is for E0. The value should appear in the GUI; you can also view it on the command line with:
halcmd show signal e0.temp.meas
Repeat for THERM-1 with the bed thermistor:
halcmd show signal bed.temp.meas
Mine reads ~28C at room temp.
Verify extruder and bed PID loops
Plug in the extruder heater into the E0 screw terminals. I bent some long header pins at a right angle and screwed them in to make this connection easier to swap with other boards; the heater cable uses female crimp connections. To set the temp, go to MDI tab and enter this command:
This should cause the heater temp to swiftly rise. In my case, for a heater cartridge, the PID settings need tuning; mine goes to 211, then down to 199, then up to 204, then settles back down at 200.
To shut off E0:
Repeat for the bed heater, which has bigger terminals of its own. Start it up:
Once it’s up, shut it off.
Verify low-power FET outputs
The low-power FET outputs are intended for fans and lights. I’ll definitely be using these, and having individual adjustability without having to buy another fan speed controller is nice. These signals are not exposed in the default CRAMPS config. Run these commands:
halcmd net fet5 hal_pru_generic.pwmgen.00.out.04.value halcmd net fet6 hal_pru_generic.pwmgen.00.out.05.value halcmd sets fet5 1.0 halcmd sets fet6 1.0
We could do this all in two commands but I prefer to have meaningful names for pins.
Connect up a fan or LEDs and you should be able to dim each by changing the value within the range 0.0-1.0. For example:
halcmd sets fet5 0.5
That’s it! You’ve now checked out the most everything needed for typical printer works.
Learning more, and what’s this HAL thing
‘halcmd’ – we kept seeing this. HAL is Hardware Abstraction Layer. It’s the layer within LinuxCNC that allow rewiring inputs, outputs, and processing stages together without having to recompile all the code. Halcmd is a program that runs single HAL commands at a time. The HAL init file is where all the important signals are named and exposed and any machine-specific logic goes, and in fact, when we loaded the CRAMPS config, this whole file loaded:
Getting familiar with the HAL file will be useful, so you can grab the right signal names for debug or make changes to the board config. For example, this file is where the FET5/6 signal names come from. However, it’s not the main place where you’d make machine-specific changes, like steps/mm. Those go in the CRAMPS.ini file. Take a look at the directory above this file – these are files to become aware of.
Expect a blog post to follow with more details on how to port a Marlin config and get this thing running G-code.