Gen7 Board 1.4.1

From RepRap
Revision as of 23:44, 29 November 2012 by Traumflug (talk | contribs) (Hooking up a Fan)
Jump to: navigation, search
Gen7 Board History   --   Gen7 Board is part of Generation 7 Electronics

This supersedes Gen7 Board 1.3.1 and Gen7 Board 1.4. On how to upgrade from v1.3.1 to v1.4, see Upgrading from v1.3.1 to v1.4. On how to upgrade from v1.4 to v1.4.1, see Gen7 Board v1.4.

Crystal Clear action run.png
Generation 7 Electronics Board

Release status: working

Gen7 Board 1.4.1.jpeg
Description
Generation 7 Electronics
License
Author
Contributors
Based-on
[[]]
Categories
CAD Models
External Link
(none)


How to get it

PCBs

Preview of the layout.
Isolation milled PCB.
Etched PCB.

Get Gen7 Board PCBs from Traumflug.

As Gen7 is designed to be manufactured on a RepRap, you can make PCBs yourself, of course. How to do this on a RepRap or a general milling machine is described on the Gen7 main page. You'll find links to release documents, Gerbers, PDFs and such on the main Gen7 page, too.

Yet another way is to purchase from one of the many houses specialized in manufacturing prototype PCBs. Gen7 is single sided, so this won't cost a fortune. If you want to sell excess copies, ask Traumflug for a commercial license.

Components

Get Gen7 Components Kits and Gen7 Connectors Kits from Traumflug.

If you want to assemble the collection yourself, see the Parts Lists section.

Parts Lists

To assemble or verify these lists, open the layout with gEDA/PCB and export a "BOM". This will give you a list of all required components.

Special considerations:

  • The Pololu Stepper Drivers want two single rows of 8 pin female connectors soldered into the board, so get these.
  • The Pololu Stepper Drivers come with their male headers, so there's no need to purchase them separately.
  • Don't forget enough (8-9) jumpers for the jumper headers.
  • Resistors with 0.25 W are on the safe side, even if the footprint name reads "0.125".
  • The Pololus can be operated with up to 35 V, so you may want like-rated electrolytic capacitors.
  • You may want to add the cable side of the connectors, their crimp pins and some wire.

Electronic Components

This list is ordered to match the order of assembly.

Name Count Designations Vendors Remarks
0.6 mm Wire 50 cm Völkner Digi-Key Mouser for the wire bridges on single sided PCBs
Resistor 10 Ohms 2 R11, R12 Reichelt RS
Resistor 560 Ohms 2 R14, R22 Reichelt Völkner Farnell RS Digi-Key Mouser
Resistor 1 kOhms 6 R2, R6, R8, R10, R16, R18 Reichelt Völkner Farnell RS Digi-Key Mouser
Resistor 4.7 kOhms 2 RT1, RT2 Reichelt Völkner Farnell RS Digi-Key Mouser
Resistor 10 kOhms 1 R30 Reichelt Völkner Farnell RS Digi-Key Mouser
Diode 1N4004 2 D1, D2 Reichelt Völkner Farnell Digi-Key Mouser
Coil 100 uH 1 L1 Reichelt Völkner Farnell Digi-Key Mouser
Crystal 16 MHz or 20 MHz 1 U6 Reichelt Völkner Farnell Digi-Key Mouser
Reset Switch 1 RESET Reichelt Völkner Farnell RS Digi-Key Mouser
Ceramic Capacitor 0.1 uF 12 C5, C8, C9, C10, C11, C12, C13, C14, C16, C17, C18, C19 Reichelt Völkner Farnell RS Digi-Key Mouser
LED 3 mm Green 3 LED2, LED5, +5V Reichelt Völkner Farnell Digi-Key Mouser
LED 3 mm Yellow 1 Standby Reichelt Völkner Farnell Digi-key Mouser
Ceramic Capacitor 22 pF 2 C3, C4 Reichelt Völkner Farnell RS Digi-Key Mouser
Electrolytic Capacitor 10 uF 2 CT1, CT2 Reichelt Völkner Farnell Digi-key Mouser
Electrolytic Capacitor 100 uF 4 C1, C2, C6, C7 Reichelt Völkner Farnell Digi-Key Mouser
Jumper Header 2 Pin Pairs 4 pair J2/J3, J5/J6, J8/J9, J11/J12 Reichelt RS Digi-Key Mouser cut them into appropriate pieces
Jumper Header 2 Pin 2 J13, J14 Reichelt Völkner RS Digi-Key Mouser cut them into appropriate pieces
Jumper for the two above 9 Reichelt RS Digi-Key Mouser
ICSP Header 1 CONN6 Reichelt RS Digi-Key Mouser alternatively, assemble this out of the remainings of the Jumper 2 Pin Headers
Pololu Header 8 or 4 U2, U3, U4, U5 Reichelt Völkner Digi-Key Mouser cut them to appropriate length if needed, you want 8x 8 pins
Socket for the ATmega 1 U1 Reichelt Völkner Farnell Digi-Key Mouser
ATmega 1284P-PU 1 Reichelt RS Mouser
Alternative: ATmega 644-20PU (or 644P-20PU) 1 Reichelt Farnell Digi-Key Mouser
MOSFET IRFZ 44N 1 Q1 Reichelt Völkner Farnell RS Digi-Key Mouser
MOSFET IRLB 8743 1 Q2 RS Mouser

Connectors

Name Count Designations Vendors Remarks
Molex KK100 2 Pin Header 2 TEMP_EXT, TEMP_BED Reichelt RS DigiKey Mouser
Cable Connector for the above 2 Reichelt RS DigiKey Mouser
Crimp Contact for the above 4 Reichelt RS DigiKey Mouser
Molex KK100 3 Pin Header 3 X_MIN, Y_MIN, Z_MIN Reichelt RS DigiKey Mouser Reichelt are tested to be fully compatible with Molex
Cable Connector for the above 3 Reichelt RS DigiKey Mouser
Crimp Contact for the above 9 Reichelt RS DigiKey Mouser same as for TEMP_EXT, TEMP_BED above
Molex KK100 4 Pin Header 4 X_MOT, Y_MOT, Z_MOT, E_MOT Reichelt RS Mouser
Cable Connector for the above 4 Reichelt RS Mouser
Crimp Contact for the above 16 Reichelt RS DigiKey Mouser
Molex KK100 6 Pin Header 1 SERIAL RS DigiKey Mouser alternatively, use the same as for Jumper 2 Pin
Optional: Cable Header for the above 1 RS DigiKey Mouser only needed if you intend to solder your own USB-to-TTL cable
Optional: Crimp Contact for the above 6 RS DigiKey Mouser only needed if you intend to solder your own USB-to-TTL cable
Heater Header Molex 26-48-1045 (2 Pin) 2 HEATER_EXT, HEATER_BED RS DigiKey Mouser
Cable Connector for the above 2 RS DigiKey Mouser
Crimp Contact for the above 4 RS DigiKey Mouser
Alternative to Heater Header: 2 Pin Screw Terminal 2 HEATER_EXT, HEATER_BED Reichelt DigiKey Mouser
Disk Power Header 2 CONN2, CONN3 Reichelt RS DigiKey Mouser also see DIY 4 pin molex connector
ATX24 Power Connector 1 CONN1 RS DigiKey Mouser Molex Mini-Fit 44206-0007. Also known as VAL-U-LOK (20 or 24 Pins).
Heatsink for the Pololus 4 Reichelt Völkner RS
Heatsink Glue 1 Reichelt Völkner For the Pololu's heatsinks, cut in appropriate pieces. Loctite(-like) screw locking glue works well, too.

Miscellaneous

Generation 7 Electronics uses a TTL header for serial communications to the host. As many modern PCs lack a serial port, these need an appropriate USB to TTL cable:

USB to TTL Cable DigiKey Mouser Adafruit Industries MAKE Store MakerBot Industries Watterott

An alternative to the USB to TTL cable is the same electronics in form of a small breakout board:

USB to TTL Breakout Board Watterott Sparkfun
Cable for the above Watterott

Another alternative is the E'go USB-TTL adapter, see instructions and limitations below.

Last not least, you need four stepper drivers, of course:

Pololu stepper driver boards Pololu stepper driver boards
Open Source Alternative StepStick

Assembly Instructions

  • To find out which components to put where, have the layout on your PC screen available.
  • PCBs fabricated with Voronoi paths need more heat, so raise your soldering iron's temperature by about 20 deg Celsius.
  • Start with the flattest parts, usually wire bridges or resistors. This way, components won't fall out when you lay the PCB on it's front for soldering. Then continue with parts of raising height, connectors are usually among the last ones.
  • The parts lists are sorted with that in mind, simply start at the top and assemble towards the bottom.
  • To ease soldering jumper headers and similar components, put a small drop of cyanacrylate glue onto the component side before inserting them. As the PCB is single-sided, this won't hurt the solder point.
  • The coil 100 uH looks just like a resistor. It's a bit thicker and comes with rings brown-black-brown.
  • As 8 pin headers for the Pololus are expensive, many kits come with lower cost 10 pin headers. Cut 2 pins off of each.
  • While soldering a pair of these headers, insert a Pololu to ensure good alignment.

Caution: Don't solder MOSFETs or insert the ATmega until after the Power Supply Checks.

Assembly in Pictures

Click on the pictures to view them larger.

As you can see, neither the MOSFETs nor the ATmega are inserted yet. We'll come back to that later.

Also, there are two rows of holes above and below the ATmega which are left empty. These are for the extension board header. Soldering this header makes only sense if you want to connect an extension board, so do this as part of the extension board assembly.

Setup

These steps show how to get from a soldered mainboard to a working one.

Possible Power Sources

Generation 7 Electronics has two options to satisfy you machine's power needs.

Gen7 v1.4 Power Options.jpeg

Option 1

This is the recommended one. Take your PC power supply, plug in the ATX24, as well as both Disk Power connectors and be done. This will supply the electronics with everything needed, no modification of the supply required.

One point to take care of is, PC PSUs have two or three strings with several Disk Power connectors on each string. Each of the strings can supply about 10 Ampéres only, so make sure you plug in only one connector of each string into Gen7's headers if you use a heated bed or some other high-current device.

In this scenario, the ATmega can run and talk to the host with the PSU turned "off" (in Standby mode). So, don't be surprised if you start working with your Mendel and the PSU is still quiet. Each G-code command requiring more juice will turn the PSU on, and some time after the last command off again.

Note: the ATX24 header is backwards compatible to the older ATX20 connector, so if you have a PSU with an ATX20 connector, plug in that. There's only one position where it fits (without pushing very hard) and there is no drawback in using an older supply:

Gen7 ATX20 in ATX24.jpeg

Option 2

This is for people with a non-PC power supply. Make connectors feeding 5 V to the upper Disk Power header, as well as 12 V into both of them. The ATX24 is left empty.

No standby feature here, ATmega, Pololus, motors and heaters are supplied all the time.

Power Source Selection

After choosing an option for the power supply, you have to tell the board where to get 5 V from.

Gen7 v1.4 Power Selection.jpeg

In the lower right corner of the board you see two jumper headers.

  • ATX20/ATX24: recommended for option 1.
  • Disk Power: recommended for option 2.

You may jumper one, and only one of them.

Power Supply Checks

With the 5 V selection jumper and all power connectors inserted, you can take a few measurements to make sure your brand new ATmega won't blow up when inserted.

Gen7 v1.4 Power Checks.jpeg
  • Red: power supply inserted according to any option. In case of an Option 1, PSU not yet activated.
  • Blue: as above, with PSU activated or power supply according to Option 2.

Note: in the picture, no 5 V selection jumper is inserted, but you need the right one here.

Checks:

  1. No smoke? Great.
  2. The yellow LED in the lower right corner is lighted? Even better.
  3. If you've chosen Option 1, short the wire bridge with the top right pin of the ATmega socket like the dashed green line in the picture. This should activate the power supply.
  4. At the same time, the green LED in the lower right corner should go on as well.
  5. If you have a voltage meter, measure the voltages shown in the picture. Dots mean wire bridges, arrows mean pins.
  6. Also, check each of the pins of the ATmega socket, none of them should have more than 0.5 volts, except those marked to have 5 V. On the ATmega socket, this is pin 9, 10, 21, 30, 39 and 40 (counter-clockwise, starting at the lower left).
  7. Check the pins in the lower row of the Pololus. Neither of the unmarked ones should exceed 0.5 volts as well.

With everything within the limits, you can pretty safely assume to not blow up the expensive parts when inserting them.

Insert Semiconductors

Now, with some safety tests done, it's a good time to insert semiconductors.

Gen7 v1.4.1 Semiconductors.jpeg
  • Disconnect the power supply entirely.
  • Both MOSFETs have the same housing, still they're different types. Make sure the one marked IRFZ 44N is closer to the Pololu headers, the one marked IRLB 8743 goes closer to the board's border.
  • Solder both MOSFETs with the flat side towards the center of the board into their place. Use sufficient solder, as high currents are flowing here.
  • Insert the ATmega into it's socket. Like every integrated circuit with such a housing, there's a groove on one of the ends of the black box. This groove shows towards the MOSFET side of the board, the non-grooved end is close to the ATX24 header. Done right, you can read the text on the housing from the ATX24 header side correctly.

Prepare your Arduino IDE

  • Download and unpack or install the Arduino IDE. You need v1.0 or later. If you insist on v0023 or earlier for some reason, see Gen7 v1.3.1 instructions, but the avrdude coming with these earlier versions can't write to an ATmega1284P.
  • Download and unpack the Gen7 Arduino IDE Support 2.0 package.
  • Find the folder Gen7 in this package and move it into the hardware folder inside the Arduino package. There are also install instructions inside the Gen7 Arduino IDE Support package.
  • Fire up your Arduino IDE.
  • Under Menu -> Tools -> Board, select your variant of Gen7 board from the six new entries. They differ in processor type and clock speed.
  • Under Menu -> Tools -> Serial Port, select the correct serial/com port.

Note: for Linux/Unix users, if you install using your package manager it may be difficult to find your arduino/hardware folder, and even after you find it you might not be able to copy into it. Just make a "hardware" folder in the "sketchbook" folder of your home directory and put the Gen7 support folder in there. The "sketchbook" folder appears when you run the IDE the first time.

Bootloader

If you bought your ATmega with one of the Gen7 kits, the bootloader should have already been uploaded. Any other bootloader, like the one used for the Sanguino, RAMPS, Sanguinololu or whatever is also fine.

If you bought an factory fresh ATmega, e.g. from a general electronics supplier, the ATmega will be without bootloader. To solve this, see the Bootloader Upload section below.

If you're in doubt, just continue with the setup. A missing bootloader will result in a timeout error when attempting to upload a firmware.

Serial Connection

It's recommended to either use a USB to TTL cable or USB to TTL breakout board. Custom solutions and different converters are possible, see #Customisations & Others.

Here's how you connect them, GND is always the pin to the left:

Gen7 Serial Connection With USB2TTL Breakout Board.jpeg Gen7 Serial Connection With USB2TTL Cable.jpeg

Simply plug the connector in, connect USB to your PC and a new serial port should show up in your PC's operating system.

Your First Firmware Upload

After all this assembling, and with this complex firmware thing ahead, whouldn't it be a good idea to upload some test firmware to test wether basic things work? Of course!

You can find such a test firmware in Gen7's Github repository.

Note: ATmegas coming with kits from Traumflug or paoparts.com have this test already uploaded, so you can see your ATmega is working, even before connecting the serial line. It doesn't hurt to upload SetupTest a second time, though, just to get used to the firmware upload process.

Here we go:

  1. Download that file SetupText.pde. If it opens in the browser window, do a "Save as...".
  2. Prepare your Gen7 by inserting power plugs, the serial converter, the USB plug of that converter and so on.
  3. Start your Arduino IDE.
  4. With the IDE, open SetupTest.pde. You'll be asked if you want to create a folder of the same name, click "Yes".
  5. Make sure the right serial port and the right type of board is still selected in the Test menu.
  6. Hit the "Upload" button (the second from the right).

After a second or two, you should see something like

Binary sketch size: 2142 bytes (of a 63488 byte maximum)

in the black text field, and after another second of blinking on the serial connector, it should say "Done uploading." right above that text field.

Gen7 v1.3 SetupTest.png

Now you can safely assume uploading a firmware works. The test firmware has a few more features:

  1. If you open the IDE's serial monitor and listen at 9600 baud, you can read what the ATmega is doing. If you can read clear text, the serial line is working.
  2. Three or four seconds after the upload, the power supply should spring to life, blink the LED of HEATER1 a few times and turn the PSU off again. To see the LED blinking, 12V for the heaters has to be connected.
  3. The same happens after each hit of the Reset button on the board, independently from the IDE or the serial connection.

Troubleshooting Firmware Upload

Some USB-TTL adapters (the recommended ones do) don't trigger the auto-reset. Typical symptoms are messages like:

avrdude: stk500v2_ReceiveMessage(): timeout

This doesn't stop you from having fun, it's more an inconvenience. You have to reset manually for each upload:

  • Click the "Verify" button in Arduino IDE's toolbar to get an idea how long it takes until the "Binary sketch size"-message appears.
  • The trick is now to press and release the reset button on the board just before this message appears. After a reset, the bootloader waits 3 seconds for an incoming firmware upload and the Arduino IDE attempts the upload just after showing this message. You get the idea.
  • On failed attempts, Arduino IDE usually can't stop the avrdude process. On Linux, type a killall avrdude in a terminal to help out.

Other troubleshooting:

  • Sometimes, the driver of the USB-TTL adapter simply messes up. If nothing works as expected, it's a good idea to unplug the adapter from the PC and insert it again after a few seconds. Unplugging the USB side from the PC is different from unplugging the serial side from the Gen7.

Microstepping

Last not least, you probably want to set up microstepping to something other than the default. The default is halfstepping. Smaller microsteps make the motors run smoother, but also raise the computing load for the ATmega. The smallest steps possible are 1/16 microstepping.

Feel free to select different settings for each of the motors, e.g. 1/8 microstepping for threaded rod axes (Z) and 1/16 microstepping for belt driven axes (X, Y).

Selecting microstepping is done with the jumpers in front of each of the Pololus, they refer to MS2 and MS3. Allegro documents also know about MS1, which is hard wired to High in Gen7. Plugging a jumper sets High, while leaving the header free sets Low. Here's a detail picture of a Gen7, with MS2 set to High, MS3 set to Low:

Gen7 Microstepping Jumpers.jpeg

The following table shows what you get with each combination:

MS2 MS3 Microstep Resolution
Open Open Half step
Open Plugged Not allowed!
Plugged Open Eighth step
Plugged Plugged Sixteenth step

You can change microstepping at any time, even while a motor is running. This will obviously change the resolution so only useful while setting up to see how the drivers and motors work together.

Firmware

In principle, you can run any of the ATmega compatible RepRap Firmwares on this board. Adjust the I/O pin layout, adjust compile time options for no secondary board/no RS485 and proceed. Just like Gen2, RAMPS, Sanguinololu or similar electronics.

There's also no Gen7-specific choice for the slicer or the G-code sending application. Use what you prefer or what owners of other electronics use.

Teacup Firmware

Teacup's Simple Installation instructions show nicely how to do this. Some tweaks are required for Gen7:

  • Have your Arduino IDE prepared for Gen7, as explained above.
  • Download the Gen7 branch instead of the standard download.
  • Use the config.gen7-v1.4.h and ThermistorTable.double.h you find there. - eg, duplicate config.gen7-v1.4.h file then rename to config.h

With config.h left untouched, at least something should move. This is fine for first tests, but not sufficient to have everything right for your machine. Edit your config.h further to match your machine and your setup. Config.h has a lot of comments inside the file, helping on the details. For example, STEPS_PER_MM_X should be set according to your choice of microstepping.

Reprap software is in constant flux, so try to use recent software both for host software and slicing, or you may run into compatibility problems. For example, the original reprap host software may not report the temperature correctly (if at all). Using Pronterface for host software solved this problem for one user. Using Slic3r rather than Skeinforge solved another problem where the Teacup firmware would be stuck forever 'waiting for target temp'.

Repetier Firmware

Tested on 644 @ 20Mhz. See this post for sample config and pins files. Should be integrated into the default firmware soon.

Here is the github download page, and documentation is on the github wiki

The pin layout has changed between v1.3.1 and v1.4, so you have to adjust this. For hints, see section Other Configurations.

FiveD Firmware

Earlier versions of Gen7 had a working configuration for FiveD. As the pin layout has changed since then, you have to adjust this. For hints, see section Other Configurations.

Sprinter, Marlin

It took really long until Sprinter and Marlin started to be compatible with non-16-MHz electronics. As of this writing, Marlin as well as Sprinter Experimental should generally work.

The pin layout has changed between v1.3.1 and v1.4, so you have to adjust this. For hints, see section Other Configurations.

Other Configurations

The following should help to configure other firmwares.

Pinout

                 +--------\/--------+                   
INT8 (D 0) PB0  1|> Xmin  Temp_Bed {|40 PA0 (AI 8 / D31)
INT1 (D 1) PB1  2|> Ymin  Temp_Ext {|39 PA1 (AI 1 / D30)
INT2 (D 2) PB2  3|> Zmin     Xstep >|38 PA2 (AI 2 / D29)
 PWM (D 3) PB3  4|< Heat_Bed Xdir  >|37 PA3 (AI 3 / D28)
 PWM (D 4) PB4  5|< Heat_Ext Ystep >|36 PA4 (AI 4 / D27)
MOSI (D 5) PB5  6|           Ydir  >|35 PA5 (AI 5 / D26)
MIS0 (D 6) PB6  7|           MotEn >|34 PA6 (AI 6 / D25)
 SCK (D 7) PB7  8|                  |33 PA7 (AI 7 / D24)
           RST  9|                  |32 AREF            
           VCC 10|                  |31 GND            
           GND 11|                  |30 AVCC            
         XTAL2 12|           Zstep >|29 PC7 (D 23)      
         XTAL1 13|           Zdir  >|28 PC6 (D 22)      
RX0 (D 8)  PD0 14|                  |27 PC5 (D 21) TDI  
TX0 (D 9)  PD1 15|                  |26 PC4 (D 20) TDO  
RX1 (D 10) PD2 16|           Estep >|25 PC3 (D 19) TMS  
TX1 (D 11) PD3 17|           Edir  >|24 PC2 (D 18) TCK  
PWM (D 12) PD4 18|                  |23 PC1 (D 17) SDA  
PWM (D 13) PD5 19|                  |22 PC0 (D 16) SCL  
PWM (D 14) PD6 20|           PwrEn >|21 PD7 (D 15) PWM  
                 +------------------+                   
Function ATmega Name Teacup FiveD Direction in firmware
X Step PA2 DIO29 29 Digital Output
X Direction PA3 DIO28 28 Digital Output
X Min PB0 DIO0 0 Digital Input
Y Step PA4 DIO27 27 Digital Output
Y Direction PA5 DIO26 26 Digital Output
Y Min PB1 DIO1 1 Digital Input
Z Step PC7 DIO23 23 Digital Output
Z Direction PC6 DIO22 22 Digital Output
Z Min PB2 DIO2 2 Digital Input
Extruder Step PC3 DIO19 19 Digital Output
Extruder Direction PC2 DIO18 18 Digital Output
Power Enable PD7 DIO15 15 Open Drain Output, active low
Motors Enable PA6 DIO25 25 Digital Output
Heater 1 PB4 DIO4 4 Digital Output
Heater 2 PB3 DIO3 3 Digital Output
Temp 1 PA0 AIO0 0 Analog Input
Temp 2 PA1 AIO1 1 Analog Input

Changes from v1.3:

  • Max endstops are gone.
  • Min endstops are now PB0 / PB1 / PB2.
  • Order of steppers is inverted (X Y Z E instead of E Z Y X).
  • All pins on the analog port one to the left (pin number - 1).

This commit to Teacup Firmware should also help for upgrading other firmwares.

Connecting Devices

At this point, you should have the firmware uploading process in place. To simplify the descriptions here, usage of the Teacup firmware is assumed.

Opto Endstops

Start with this, as it's simple and some firmwares depend on a working endstop to move the stepper motors. Gen7 accepts all endstops delivering a 5 V signal, not only Gen7 Endstops, as long as you get the wiring right.

  1. Make a 3-wire cable, long enough to reach from the Gen7 board to the X endstop place and solder a connector onto one end.
  2. Plug this into the Gen7 at the X endstop connector. This is the 3-pin connector closest to the MOSFETs.
  3. Connect to your Teacup and send a M200. This will turn on your power supply and tell the current status of the endstops.
  4. While the power supply is running, use a voltage meter to find the 5 V wire. Measure against GND, the center wire.
  5. The third wire is the signal.
  6. Make the other connector according to the requirements of your endstop.
  7. Plug both connectors in and test the endstop by sending M200 repeatedly while interrupting the light barrier with a piece of cardboard or not.
  8. If M200 reports "1" while there is no cardboard in the barrier, you have to invert the endstop signal. In Teacup, this is done by toggling the comment in the line containing X_INVERT_MIN in config.h. After each change, you have to re-upload the firmware.
  9. You're done for the X endstop, repeat for Y and Z.
Gen7 v1.4 Endstop Connection.jpeg

The picture shows a Gen7 Endstop connected to a Gen7 Board. Holding the endstop this way, the left pin is the signal, the center pin is GND and the right pin is 5 V on both connectors. The screw driver is there for fixing the picture arrangement, only.

Troubleshooting Opto Endstops

If your firmware doesn't report what you expect, you can measure the signal with a voltage meter. If the power supply is turned on, the signal pin on the connector as well as the corresponding ATmega pin should change between 0 V and 5 V if you put something into the light barrier or not. If this is the case, your firmware is at fault, typically due to a misconfigured pin mapping in config.h/configure.h/configuration.h.

Stepper Motors

Stepper Wiring

description forthcoming

Adjusting the Pololus/StepSticks

The Sanguinololu wiki page has a nice writeup on how to adjust stepper drivers by measuring voltages.

Here's another way:

  1. Work on only one axis at a time.
  2. Make sure the axis can be moved by hand easily with motors powered off. No kind of current helps if your axis blocks mechanically.
  3. Turn the trimpot full counter-clockwise.
  4. Turn the trimpot clockwise 1/8 turn.
  5. Send commands to your firmware to make this motor move. Slow speeds (G1 F50) first, then faster.
  6. If the motor just beeps, but shows no movement, or if you get missing steps, turn the trimpot clockwise another 1/8 turn. Things should get better.
  7. When you've reached a position where everything moves without step losses, you can turn another 1/8 clockwise as safety margin.
  8. That's it, repeat for each of the other axes.

Troubleshooting Stepper Motors

Note: before disconnecting a motor or a stepper driver, always power off at least the 12 V power supply. On a Gen7 powered via the ATX20/24 connector and running Teacup firmware, this is done by pressing the reset button.

  • If something doesn't work on one axis, but works fine on another, change motors or stepper drivers with a working axis and try again. This helps finding defective parts. All axes are electronically the same, so you can swap stuff to your heart's content.
  • If a motor moves in one direction only, either the endstop part of your firmware's configuration doesn't match hardware or the DIR pin doesn't get a signal. The DIR pin is the rightmost in the lower row of the stepper driver header and can be measured with a voltage meter. It should change between 0 V and 5 V when changing direction.
  • If a stepper moves the wrong direction, you can change the direction by swapping both pins of one motor coil in the connector. For example, ABCD becomes ABDC. Another way is to invert the direction in your firmware configuration, of course. Both methods work equally well.
  • If there is no sign of movement at all, check wether the ENABLE pin goes low when attempting a movement. 0 V = steppers enabled, 5 V = steppers disabled. It's the leftmost pin in the lower row of the stepper driver header.
  • If a motor starts to move, but has repeated dropouts, each of which lasts about half a second, the stepper driver chip apparently overheats and runs into it's thermal protection. Add a heatsink, attach a fan or reduce motor current, depending on your situation.
  • If your stepper drivers and/or motors warm up while there is no movement ongoing: that's normal. Stepper motors suck the most energy while powered up, but at stillstand.

Extruder, Heated Bed

An extruder and a heated bed are pretty much the same from the electronics point of view. Both have a temperature sensor as well as a heating element, which are -- in the electronics view -- independent from each other. So please read on in the following two sections.

Thermistor

This one is simple, too. The thermistor has only two wires and it doesn't matter which way you connect them. As of Gen7 v1.4 the thermistor runs on standby power, so you can see the current temperature at any time.

Note: Make sure there is no electrical connection between thermistor and heater wires. Heaters typically run at 12 V, and remain at that potential even when turned off, which would blow the ATmega input pin. Usually, neither wire of the thermistor nor one of the heater wires are connected to the metal housing of an extruder, so you have double safety.

It doesn't matter which thermistor connector you use for what, as long as it matches your firmware configuration. The circuitry for both thermistors is the same, just the label in the PCB layout and the ATmega pin is different. So, if your extruder temperature is reported as bed temperature, you can solve this by either swapping the pin mapping in your firmware configuration, or by swapping the connectors physically.

To test the thermistor, connect it. Then send M105 repeatedly while warming up the thing with your fingers. Likely it isn't exactly accurate at room temperature, but it should react to the warming.

Gen7 v1.4 Thermistor Connection.jpeg

Note: In the picture it might look like both wires of the thermistor touch each other. Be assured, they don't. :-)

The white thermistor wire insulation shown in the picture is PTFE tape plumbers use for sealing threaded hose connections. It's very thin. Insulate each wire seperately, then both together. If you can find shrink tube thin enough to fit between those two wires or you've bought a hotend which already came with an insulated thermistor, that's fine as well.

Note: Gen7 can do quite accurate temperature measurements, if you make your own temperature table. On how to do this and on why this might be not neccessary, see the long comment in Teacup's ThermistorTable.double.h.

Troubleshooting the Thermistor

  • If the temperature readout is zero, you likely have configured the wrong pin in your firmware or a broken thermistor wiring.
  • Unplug the thermistor and measure it's resistance at the connector. At room temperature, it should have it's nominal value (10 kΩ / 100 kΩ / 200 kΩ).
  • A short in the thermistor wiring results in a very high temperature readout, like 800 °C.

Heaters

This one is simple, too. The heater is a resistor without polarity, so connect both wires to the two connector pins. To get it working, you also have to have the corresponding MOSFET soldered in.

Note: If you start heating for the first time, make sure the corresponding temperature readout raises, too. In case you map your heater to the wrong thermistor, the firmware won't notice the temperature raise and won't stop heating when the desired temperature is reached, eventually leading to destruction. To stop a run-away heater, press the reset button.

Note: Especially heated beds run with a lot of current, so make sure your connectors are clean. Dirt here means a poor electrical connection, heating up, eventually melting the connector. Even in dry rooms, contacts can oxidize. Battery terminal grease was used successfully to prevent and even revert oxidisation.

Testing the heater:

  • Send M104 S50 to command the extruder heater to reach 50 °C.
  • Watch the corresponding MOSFET's LED lighting up. It's brightness gives a hint to the current PWM value used.
  • Send M105 repeatedly to watch the temperature raising.
  • As the temperature reaches about 50 °C, the LED should go darker and the temperature raise should stop.
  • Send M104 S0 to stop the heater. The LED should go dim or off, the extruder should cool down.
  • Do the same for the heated bed, if you have one. Heated bed temperature is set with M140.
Gen7 v1.4 Heater Connection.jpeg

Troubleshooting a Heater

  • Does your temperature readout work, i.e. does it initially read something like room temperature instead of some unreasonable value? Most firmwares have a protection built in to heat only if they have reasonable confidence temperature measurement is working.
  • Can you measure 12 V on the lower connector pin when the power supply is turned on? If not, the lower Molex 4-pin connector delivers no juice on the 12 V rail.
  • Does the LED light up, at least dimly? If not, the MOSFET is either blown, gets no signal from the ATmega or there is no 12 V supply.
  • An entirely disconnected signal pin, i.e. due to a firmware misconfiguration, usually results in a dimly lighted LED, too. MOSFETs are sensitive enough to turn on partly by picking up random electromagnetic noise.
  • The signal can be measured with a voltage meter on the 10 Ω resistor right next to the MOSFET. The higher the PWM value, the closer the (average) signal should be to 5 V.

Customisations & Others

This part describes possible modifcations for advanced users only.

Non-12-V-Voltages

While it's very practical to use 12 volts as they come out of the power supply, Gen7 is prepared for other voltages, too. Even better, you can supply different voltages for motors and heaters.

Possible usages:

  • 12 V for the heaters, 24  for the motors. This will still allow to use standard Reprap heating elements for the extruder and heated bed, while the motors can now run faster. Motor supply voltage is only limited by the Pololus and can go up to 35 volts.
  • 12 V for the motors, 5 V for the heaters. This whould wear your power supply more evenly.
  • 12 V for the motors, 3.3 V for something like EDM or inductive heated nozzles. Remember, the IRFZ44N can switch pretty fast, and the ATmega has frequency/PWM generators on board.
  • ...

On where to supply what, see the picture above. Simply rewire the disk power connectors to your needs and make sure all power sources contact at least one GND pin, to give them a common ground.

The 5 volts on the upper disk power connector is not needed if you use the ATX20/24 connector, but don't supply there a different voltage, or a voltage from a different power supply, either.

Hooking up a Fan

Using a SevenSwitch, you can connect a fan/blower, too. Either by connecting it to two of the extension board pins (one for signal, one for GND), or by fetching these two pins from the ICSP header. Paoparts did the latter and documented it here (french with pictures and code snippets): Ventilateur pour l’extrudeur, commandé par la GEN7 avec Teacup.

On how to define fans and other devices in Teacup firmware, see there.

Serial Connection

If you want a custom solution, you can create one, of course. Just connecting an RS-232 port to the serial connector won't work, however, even if you ignored the different voltage levels. ATmega's serial signal is inverted (Logical 0 = 5V, Logical 1 = 0V). Here's the serial connector's pinout:

Gen7 Serial Pinout.png

 

1 2 3 4 5 6
GND CTS (set to GND) (+5 Volts) RxD TxD Reset

RxD is ATmega's pin 14 (data to the chip); TxD is ATmega's pin 15 (data from the chip).

Pin 3 has 5 V on most USB-TTL adapters, but is unconnected on the board. Feeding in 5 V here would conflict with the (slightly different) 5 V from the ATX power supply.

Pin 6 is usually connected to the serial line's RTS. This triggers a reset each time you start a connection to the ATmega and is very convenient when uploading firmware - no pressing of the reset button needed, then. Arduinos have this hardwired. If you keep pin 6 free, press the reset button each time your IDE (avrdude) attempts an upload.

Using an E'go USB-TTL adapter

This converter is cheap, uses the Silicon Labs CP2102 chip and basically works:

E'go USB-TTL Converter on Gen7.jpeg

 

Gen7 GND (Pin 1) +5 Volts (Pin 3) RxD (Pin 4) TxD (Pin 5)
USB-TTL adapter GND (Pin 5) +5 Volts (Pin 6) TxD (Pin 3) RxD (Pin 4)

Important here is to not connect both Reset pins.

What you can't get is auto-reset. So you have to press the reset button when uploading a firmware, shortly before the 'Binary sketch size is...' message appears.

Note: for advanced hackers it's possible to add auto reset functionality to any adapter using this chipset by connecting the DTR "pin" of the chip itself directly to the RST pin on the adapter.

Suppliers of this adapter

Bootloader Upload

Note: this section only applies if you have a blank, factory fresh ATmega on your board. Friendly Gen7 vendors will do these steps for you before shipping, so you don't need a programmer.

This section describes how to program the bootloader using a programmer. These programmers usually cost some $20 to $30. An even cheaper option is to build a bit banging parallel port adapter. Another alternative is to use an Arduino or other prepared AVR board as a programmer.

Note: This process can be done on a partially populated board. Only the power, ocillator, reset and programming connections need to be ready.

How to proceed:

  • Disconnect all connectors, including the power supply.
  • Insert the ATmega644 into its socket. Make sure you orient it correctly, the small notch on the package is inserted at the heater connector side of the PCB, and the part markings can be read when viewed from the ATX20 connector side.
  • Connect your programmer. Verify it is plugged in correctly.
  • Plug in the PC side of the programmer.
  • Re-connect one power supply, do not turn it on yet.

Note: The pins used for the programmer are shared and can conflict with an extension board, so if you have one, unplug it while using the programmer or be sure there is no conflict.

Now you should see something like this - the red LED indicates the Board is still without power:

Gen7 Programmer Setup.jpeg

Programming the bootloader using the command line

  • Have your Arduino IDE prepared for Gen7, as explained above or find the bootloader .hex files inside the Gen7 Arduino IDE Support 2.0 (click on "view raw") package directly.
  • Switch on your power supply, at least the yellow LED should illuminate.
  • Open a terminal and change directory into Arduino IDE's folder. All required tools are there, even if you haven't installed them system-wide.
Linux

The following sequence was done on Linux and should apply similarly on other OSs.

cd hardware/tools  # this is where you find the tools inside the Arduino IDE directory
./avrdude -C ./avrdude.conf -c ?  # find your programmer, e.g. "avrispv2"

### For the ATmega644:
# write fuses
./avrdude -C ./avrdude.conf -c <your programmer> -p atmega644 -P /dev/ttyACM0 \
    -B 5 -U lfuse:w:0xF7:m -U hfuse:w:0xDC:m -U efuse:w:0xFC:m
# upload bootloader
./avrdude -C ./avrdude.conf -c <your programmer> -p atmega644 -P /dev/ttyACM0 \
    -B 1 -U flash:w:../Gen7/bootloaders/Gen7/bootloader-<your variant>.hex
# lock the bootloader
# this gives an expected "verification error 0xcf != 0x0f"
./avrdude -C ./avrdude.conf -c <your programmer> -p atmega644 -P /dev/ttyACM0 \
    -B 1 -U lock:w:0xCF:m

### For the ATmega644P:
# like above, but swap "-p atmega644" with "-p atmega644p"

### For the ATmega1284P:
# like above, but swap "-p atmega644" with "-p atmega1284p"

### For an USB programmer:
# like above, but swap "-P /dev/ttyACM0" with "-P usb" 


Watch your programmer blinking for a few seconds and you're done. Note that if you're using an Arduino board as a programmer, you may need to add the flag "-b 19200" for it to work correctly.

Windows

On Windows, you'll have to find out which COM port your board is connected to. Or simply try COM1 ... COM8 until it works. Similarly to the above, the commands on Windows are:

cd hardware\tools\avr\bin
avrdude -C ..\..\etc\avrdude.conf -c ?  # find your programmer, e.g. "avrispv2"

### For the ATmega644:
# write fuses
avrdude -C ..\..\etc\avrdude.conf -c <your programmer> -p atmega644 -P COM1 \
   -B 5 -U lfuse:w:0xF7:m -U hfuse:w:0xDC:m -U efuse:w:0xFC:m
# upload bootloader
avrdude -C ..\..\etc\avrdude.conf -c <your programmer> -p atmega644 -P COM1 \
    -B 1 -U flash:w:..\..\..\Gen7\bootloaders\Gen7\bootloader-<your variant>.hex
# lock the bootloader
# this gives an expected "verification error 0xcf != 0x0f"
avrdude -C ..\..\etc\avrdude.conf -c <your programmer> -p atmega644 -P COM1 \
    -B 1 -U lock:w:0xCF:m 

### For the ATmega644P:
# like above, but swap "-p atmega644" with "-p atmega644p"

### For the ATmega1284P:
# like above, but swap "-p atmega644" with "-p atmega1284p"

Watch your programmer blinking for a few seconds and you're done.

Programming the bootloader using the Arduino IDE

Many programmers don't use the USB protocol directly, but an internal USB-TTL converter. So far there was no luck uploading the bootloader with these from Arduino IDE's graphical user interface.

Debugging hint: Arduino obviously doesn't attempt to use the "-B 5" flag when writing fuses onto a factory fresh chip. This is needed if the programmer was set to a higher speed earlier, as an ATmega running at 1 MHz (factory default) can't keep up with 115200 baud.

Arduino IDE and a USBtinyISP
  • Disconnect all connectors, including the power supply.
  • Remove jumper No.3 from the USBtinyISP programmer.
  • Plug in the USB cable to the USBtinyISP.
  • Plug the 6 pin cable from the USBtinyISP into your Gen 7 Electronics. Again, watch out for insertion of the plug the right way.
  • Re-connect the power supply and turn on.
  • Start up Arduino IDE.
  • Select the correct ATmega chip you are using in the Tools->Board menu.
  • Do not select a COM/Serial port.
  • Select Tools->Burn Bootloader->w/USBtinyISP

The USBtinyISP red LED should light up. It will take a minute or two to program the chip When it is done, the IDE will tell you it has completed and the red LED will turn off.

Specials

One user had a power supply delivering just 4.5 volts in standby. That's tight, because at 4.3 V the brown-out detector jumps in and resets the board.

To deal with this, you can change the extended fuse from 0xFC to 0xFD. This sets the brown-out detector's trigger level lower, to 2.7 V. While the ATmega will run out of specification for short periods of time, then, this is obviously better than random brownout resets or no brown-out detector at all.

References

./avrdude -C ./avrdude.conf -c <your programmer> -p atmega644p -P /dev/ttyACM0 -n -v

Fortified Heater Traces

Gen7Board 1.4 soldered traces.jpg

There is evidence that adding solder to a PCB trace can lower its resistance by as much as half and increase its electrical and thermal conductance. Both are beneficial in the areas on the board where the highest current flows. Since there is no solder mask in the isolation milled version of this board, it is relatively easy to add additional solder to the 12 volt and ground traces that serve the extruder nozzle and optional heated build platform (HBP).

There are disadvantages to adding large amounts of solder.

First, this cannot be done easily without a powerful soldering station with 50 watts or more. A disposable 15 watt soldering pencil would take an extremely long time to melt this much solder, if it could at all. The wide voronoi traces radiate the heat outwards rapidly making a powerful heat source more than a luxury.

Second, lingering heat on components is a bad practice, especially at the high temperatures required by RoHS lead-free solders. The bulk of the solder addition process should be done in the absence of the LEDs, resistors, diodes, MOSFETs and plastic header connectors. Once the solder is added up to--yet not over--the holes drilled for those components, they can be carefully added. Here again, a low powered heat source may have all of its energy dissipated before it can bring the junction up to temperature. (note the MOSFETs have not yet been added to the board pictured here)

The advantages are a cooler board, a cooler MOSFET and heater pins, and faster nozzle and HBP warm-ups. Yes, solder isn’t free, but if it can increase the reliability and performance of the heater section of your board then it’s probably better on the traces then on a spool in the workbench drawer.