Автора пока нетВзять себе
- Лицензия
- CC BY-SA 4.0По материалам www.appropedia.org
- Языки
- English
This Appropedia how-to covers running the Franklin software on the CNC Router Parts 3-D printer, or any compatible machine: the electrical system, setting up Franklin on a BeagleBone Green, and troubleshooting.

The CNC Router Parts 3-D printer. Photo: Handychandra7 on Appropedia, CC BY-SA 3.0.
The electrical system
The CNC machine the printer is built on already had its motors, inductive sensors, stop switches, stepper drivers, sensor interface board and motor interface board. What was added is a BeagleBone Green, a main interface board, a fan, a hot end and a thermistor.

The printer's electronic system. Handychandra7 on Appropedia, CC BY-SA 3.0.
Hot end. A Volcano hot end was chosen for its bigger heating element, which transfers heat better with a bigger nozzle and layer height. It comes with the fan, heater cartridge and thermistor cartridge. The fan and the 40 W heater cartridge need a power supply of at least 4 A at 12 V, and the thermistor is a Semitec 104GT2.
Stepper drivers. According to CNC Router Parts, the drivers are like a commercial drive the page links to, but rated for 50 V and 4.2 A. Franklin's timing settings must be adjusted to the driver's timing requirements, and the input needs extra current for the optocoupler inside. Set every driver to 2000 pulses per revolution. The Z axis takes the maximum current, 4.2 A, and the extruder is fine at the lowest, 1 A. For X and Y the page gives a figure that does not match its own "half of that", so it is left out here.
Sensor interface board. Its two slide switches, SW1 and SW2, must be ON to enable the inductive sensor outputs.
Main interface board. This custom board carries an ATmega1284p running on a 16 MHz crystal, a logic level shifter between the ATmega's 5 V logic and the BeagleBone's 3.3 V logic, a logic buffer that supplies the current the stepper drivers need, and two power transistors that drive the hot end and the fan. Other open-source 3-D printer electronics can be used if they meet the same requirements and the microcontroller is an ATmega328p, 1280, 1284p or 2560; the easiest is an Arduino board connected to the BeagleBone by USB.
Three headers connect the board to the rest: P1 to the BeagleBone Green (through the BeagleBone's header P9; do not reverse the connection), P2 to the motor interface board and P3 to the sensor interface board. All sensors are active low, except the emergency switch, which can be either, depending on whether it stops on press or on release.
| P2 pin | ATmega pin | Carries |
|---|---|---|
| 1 | PD2/D10 | Z1 step |
| 2 | PD3/D11 | Z1 and Z2 direction |
| 3 | PD4/D12 | X1 step |
| 5 | PD5/D13 | X1 direction |
| 6 | PD6/D14 | Z3 and Z4 direction |
| 7 | PD7/D15 | Y step |
| 9 | PC0/D16 | Y direction |
| 11 | PC1/D17 | Extruder step |
| 13 | PC2/D18 | Extruder direction |
| 15 | PC3/D19 | X2 step |
| 17 | PC4/D20 | X2 direction |
| 19 | PC5/D21 | Z2 step |
| 21 | PC6/D22 | Z3 step |
| 23 | PC7/D23 | Z4 step |
On P2, the even pins from 10 to 24 are ground and pin 26 is 5 V; the original also names each signal's motor interface board terminal.
| P3 pin | ATmega pin | Carries |
|---|---|---|
| 3 | PB3/D3 | X1 min |
| 4 | PB4/D4 | Soft emergency stop |
| 5 | PB2/D2 | Z3 max |
| 7 | PB1/D1 | Y min |
| 11 | PA0/D24 | Z1 max |
| 13 | PA1/D25 | X2 min |
| 15 | PA2/D26 | Z2 max |
| 17 | PA3/D27 | Z4 max |
P3 has ground on the even pins from 10 to 24 and 5 V on pin 26. Beyond power and ground, P1 carries RESET and three other signals to the BeagleBone's header P9. On the terminal block, the thermistor goes on ADC1 (PA7/D31, its other lead to ground), the heater cartridge's negative lead on HOTEND/FAN1 (PA4/D28) and the fan's negative lead on HOTEND/FAN2 (PA5/D29), with both positive leads on 12 V.
Setting up Franklin on the BeagleBone Green
- Flash the image. Download the Franklin image from the Franklin project page, write it to a microSD card with a tool such as Etcher, put the card in the BeagleBone and power it on. The LEDs flash in a wave pattern; when all of them go off, remove the power and the card.
- Connect over USB. Connect the BeagleBone to the computer with a micro-USB cable and open an SSH connection to 192.168.7.2 (for example with PuTTY) as the user debian, with the image's default password, which the original gives.
- Get it online for a while. Connect the BeagleBone to the computer with an Ethernet cable and, on Windows, share the Wi-Fi connection with the Ethernet one. On the BeagleBone, change "iface eth0 inet static" to "iface eth0 inet dhcp" in /etc/network/interfaces, then run "sudo ifdown eth0" and "sudo ifup eth0" until a message says "bound to" an address.
- Change the timings. Franklin's default timings are for the Athena printer and must be changed for this printer's stepper drivers. In /etc/apt/sources.list, comment out every line containing 192.168.8.2, run "sudo apt-get update", clone the Franklin source from github.com/mtu-most/franklin and install the build packages listed on the original page. Then make these edits:
- In firmware/arch-avr.h, add the line "#define STEPS_DELAY 60" before "#ifdef FAST_ISR", change "#define TIME_PER_ISR 75" to 180, change "#if 1" to "#if 0", and change "ldi 18, 40" to "ldi 18, 0x3c".
- In server/cdriver/space.cpp, change "int max = 0x7e << 7;" to "int max = 0x1e << 7;".
- In server/driver.py, change "dist = 1000" to "dist = 3000".
With the BeagleBone still online, run "make" in the franklin folder (if an error occurs, try "git stash"), then, as root, "dpkg --install /tmp/*.deb".
- Go offline again. Change eth0 back to static, remove the internet sharing in Windows, and shut the BeagleBone down with "sudo poweroff".
- Set the fuse bits (custom main interface board only). The ATmega1284p must have its fuse bits flashed first so that it uses the on-board 16 MHz crystal and has JTAG disabled; skip this with another Arduino board. Connect the main interface board to the BeagleBone and supply 5 V to it through the terminal block. Over SSH, as root, go to franklin/server/bb, run "make setpin", then "./setpin 30 0x37" and "./setpin 31 0x37". Use avrdude (programmer bbbmelziO4, part atmega1284p, configuration file /usr/lib/franklin/bb/avrdude.conf) to write the high fuse 0xd9 and then the low fuse 0xe7. Finish with "./setpin 30 0x2e" and "./setpin 31 0xe", and remove power from the board.
- First run. Wire the system as in the diagram, turn it on and connect the BeagleBone to the computer by Ethernet. Open http://192.168.76.2:8000/admin in a browser and tick "Show setup". If the microcontroller has not been flashed yet, pick /dev/ttyS4 and "Melzi from BeagleBone (atmega1284p, bridgeboard v2)" (for another Arduino board, the right board and serial port) and press upload; if it fails, check the connection between the BeagleBone and the microcontroller. Cycle the power to the microcontroller, then import the configuration file on the setup page, after changing its extension to .ini.
Before anything else, check each motor's direction (it can be reversed, depending on the wiring) and that the inductive limit switches work, so the machine does not crash into its sensors; the easiest test is to move X, Y and Z a little through the box in the interface.
Troubleshooting
| Problem | What to check |
|---|---|
| A motor does not move | The soft and hard emergency switches' positions. A small sound from the motors means the driver is active and connected even when the motor is still (at least for the CRP5042); with none, the driver may be disabled or unpowered, and its enable pin must be driven low (ENA+ and ENA- both low). |
| An inductive sensor does not work | Its LED should be on when metal is in front of it; if not, check for 12 V at the sensor interface board and that SW1 and SW2 are on. The output is active low, so "inverted" must be checked in Franklin. |
| Another main interface board is used | It must be able to drive the optocoupler inside the stepper driver. Convert between 5 V and 3.3 V logic where needed. The Franklin firmware's clock must be 16 MHz or timing problems follow. |
| The printer is not detected | Wait a while; if it is still missing, cycle the power to the main interface board, and if that fails, reflash the microcontroller. |
| Movement is inaccurate | The driver must be at 2000 pulses per revolution with enough current for each axis, and the steps per mm in Franklin must be correct. |
| Layers shift at random heights | Try Cura 15.04.6 with the start and end G-code from Appropedia's Athena Software page; it was tested with that version. |
| Extrusion problems | The filament must sit directly above the extruder. Common causes: filament stuck on the spool, friction with a Bowden tube or another object that keeps the extruder from pulling it, a fan that does not cool the hot end so the filament sticks, and the drive gear grinding it. |
Sources
- Appropedia contributors, Using Franklin on a CNC Router Parts 3-D printer, Appropedia, licensed under CC BY-SA 4.0; the photograph and the diagram by Handychandra7 on Appropedia, each under CC BY-SA 3.0; changed here: condensed and reorganized, with the pin tables shortened and the references and configuration file left out; rewritten in hubnx's own words.
Комментарии

Читать дальше
Ещё на тему «Природа»
