Gen7 Board 1.4.1/zh cn

From RepRap
Revision as of 03:55, 22 August 2012 by Unioasis (talk | contribs)
Jump to: navigation, search


Gen7 Board History   --   Gen7 Board is part of Generation 7 Electronics

译者备注:此文本正在处于翻译当中。有任何不便敬请见谅。This document is under translation. I'm sorry for any inconvenience.

本文用于替代Gen7 Board 1.3.1Gen7 Board 1.4。关于如何从v1.3.1升级到v.4,请参阅 从v1.3.1升级到v1.4。关于如何从v1.4升级到v1.4.1,请参阅 Gen7 Board v1.4

注意:本页面很多图片依然使用带有巨大散热片的Gen7 v1.4版本。这些图片将被最终替换掉。在图片替换前,请忽略这些散热片:-)

Crystal Clear action run.png
Generation 7 Electronics Board

Release status: working

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


如何获取

PCB

布局预览
蚀刻好的PCB板

您可以从Traumflug获取Gen7 PCB板。

Gen7用于RepRap项目的加工,您自然可以自己制作PCB板。关于如何在RepRap或者其他通用铣床上制作,已经在 Gen7主页中描述。您也可以在 Gen7主页上找到发布文档,Gerbers文件,PDF文件等。

另一个途径是从PCB原型制作商处购买打样。Gen7是单层板,制作起来花费不大。如果您想卖出多余的板子,请向Traumflug申请商业许可。

元件

您可以从Traumflug获取Gen7元件套装以及Gen7连接件套装。

如果您希望自己组装,请参考#原件列表一节。

原件列表

要组装或者验证此列表,可用gEDA/PCB打开布局(layout),并且导出物料清单“BOM”。这可以给您列出全部需要的元件。

规格考虑:

  • Pololu步进电机驱动器(The Pololu Stepper Drivers)需要两个单行八针阴头连接座焊在主板上。
  • Pololu步进电机驱动器带有阳头接口,因此不需要单独购买。
  • 别忘记准备充足的跳线帽(8-9个)。
  • 即使脚印(footprint)标称了“0.125”,电阻器也需要0.25瓦的安全功率。
  • Pololu工作电压最大到35伏,因此电解电容也需要相应的电压(译者注:至少)。
  • 您可能还需要连接件的一些电缆,插头和压线。

电子元件

下列列表是按照组装顺序排序的。

名称 数量 标识 供货商 备注
0.6毫米导线 50厘米 Völkner Digi-Key Mouser 用于单面PCB板飞线用
电阻 10欧 2 R11, R12 Reichelt RS
电阻 560欧 2 R14, R22 Reichelt Völkner Farnell RS Digi-Key Mouser
电阻 1K欧 6 R2, R6, R8, R10, R16, R18 Reichelt Völkner Farnell RS Digi-Key Mouser
电阻 4.7K欧 2 RT1, RT2 Reichelt Völkner Farnell RS Digi-Key Mouser
电阻 10K欧 1 R30 Reichelt Völkner Farnell RS Digi-Key Mouser
二极管 1N4004 2 D1, D2 Reichelt Völkner Farnell Digi-Key Mouser
电感(Coil) 100 uH 1 L1 Reichelt Völkner Farnell Digi-Key Mouser
晶振 16 MHz 或者 20 MHz 1 U6 Reichelt Völkner Farnell Digi-Key Mouser
复位按钮 1 RESET Reichelt Völkner Farnell Digi-Key Mouser
陶瓷电容 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毫米绿色 3 LED2, LED5, +5V Reichelt Völkner Farnell Digi-Key Mouser
LED 3毫米黄色 1 Standby Reichelt Völkner Farnell Digi-key Mouser
陶瓷电容 22 pF 2 C3, C4 Reichelt Völkner Farnell RS Digi-Key Mouser
电解电容 10 uF 2 CT1, CT2 Reichelt Völkner Farnell Digi-key Mouser
电解电容 100 uF 4 C1, C2, C6, C7 Reichelt Völkner Farnell Digi-Key Mouser
跳线座双针一排 4 对 J2/J3, J5/J6, J8/J9, J11/J12 Reichelt RS Digi-Key Mouser 裁切到合适长度
跳线座单针一排 2 J13, J14 Reichelt Völkner RS Digi-Key Mouser 裁切到合适长度
为上述跳线座准备的跳线帽 9 Reichelt RS Digi-Key Mouser
ICSP插头 1 CONN6 Reichelt RS Digi-Key Mouser alternatively, assemble this out of the remainings of the Jumper 2 Pin Headers
Pololu插头 8或4 U2, U3, U4, U5 Reichelt Völkner Digi-Key Mouser 如果可以将它们裁切到合适的长度。你需要 8 x 8 针的
ATmega插座 1 U1 Reichelt Völkner Farnell Digi-Key Mouser
ATmega 1284P-PU 1 Reichelt RS Mouser
替代:ATmega 644-20PU(或者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

连接件

名称 数量 标识 供货商 备注
Molex KK100 2针插座 2 TEMP_EXT, TEMP_BED Reichelt RS DigiKey Mouser
为上述准备的电缆连接头 2 Reichelt RS DigiKey Mouser
为上述准备的压接接触件(Crimp Contact) 4 Reichelt RS DigiKey Mouser
Molex KK100 3针插座 3 X_MIN, Y_MIN, Z_MIN Reichelt RS DigiKey Mouser Reichelt已经被验证可以与Molex完全兼容
为上述准备的电缆接头 3 Reichelt RS DigiKey Mouser
为上述准备的压接接触件 9 Reichelt RS DigiKey Mouser same as for TEMP_EXT, TEMP_BED above
Molex KK100 4针插座 4 X_MOT, Y_MOT, Z_MOT, E_MOT Reichelt RS
为上述准备的电缆接头 4 Reichelt RS
为上述准备的压接接触件 16 Reichelt RS DigiKey Mouser
Molex KK100 6针插座 1 SERIAL RS DigiKey Mouser 可用此替换用作2针跳线座
可选:为上述准备的电缆接头 1 RS DigiKey Mouser 只有您打算焊一个自己的USB-TTL电缆才需要
可选:为上述准备的压接接触件 6 RS DigiKey Mouser 只有您打算焊一个自己的USB-TTL电缆才需要
加热器插座 Molex 26-48-1045(2针) 2 HEATER_EXT, HEATER_BED RS DigiKey Mouser
为上述准备的电缆接头 2 RS DigiKey Mouser
为上述准备的压接接触件 4 RS DigiKey Mouser
加热器插座替换元件:2针螺丝接线端 2 HEATER_EXT, HEATER_BED Reichelt DigiKey Mouser
磁盘电源插座 2 CONN2, CONN3 Reichelt RS DigiKey Mouser 请参阅DIY 4 pin molex connector
ATX24电源插座 1 CONN1 RS DigiKey Mouser Molex Mini-Fit 44206-0007. Also known as VAL-U-LOK (20 or 24 Pins).
Pololu用散热器 4 Reichelt Völkner RS
散热器胶(Heatsink Glue) 1 Reichelt Völkner 为Pololu散热。将其切成合适的大小。Loctite(之类的)螺旋形胶也很好用。

其它杂项

Generation 7 Electronics 使用TTL串行与主机通信。由于很多现代PC机缺乏串行通讯口,可能需要一个合适的USB-TTL电缆:

USB-TTL电缆 DigiKey Mouser Adafruit Industries MAKE Store MakerBot Industries Watterott

USB-TTL线缆的替代方案是使用具有相同电路的一小块电路板:

USB-TTL电路板 Watterott Sparkfun
为上述准备的线缆 Watterott

另一个替代方案是:E'go USB-TTL适配器, 参见下面的说明和限制

最后,当然你需要四个步进驱动:

Pololu stepper driver boards Pololu stepper driver boards
开源替代品 StepStick

组装指导

  • 为了确定各元件的安放位置,将布局图放到PC屏幕上。
  • PCB的焊接使用泰森多边形法路径(Voronoi paths),需要温度更高。因此将你的电烙铁温度调高20摄氏度。
  • 从最平坦的元件开始。通常是飞线或者电阻器。这样当你用PCB板正面位置放置焊接的时候元件不至于被碰落。然后再焊接更高的元件。通常接插件最后焊接。
  • 元件列表正是按照这个顺序排列的。您可以按照此顺序依次组装(焊接)。
  • 为了能够更容易的焊接跳线接头,可以在插入元件前涂一点万能胶(cyanacrylate glue,译者注:氰基丙烯酸酯可能有毒,请注意防护。)。由于PCB板是单面的,胶水不会伤害到焊接点。
  • 100uH 电感(coil)看上去就像一个电阻,只是比电阻粗一点,带有综-黑-综的色环。
  • 由于8针的Pololu插座比较贵,不少套装会选择价格更低的10针插座,然后切掉两个针脚。
  • 当焊接这些插座的时候,插入一个Pololu来确保对齐。

小心:仅有在 电源检查后才可以焊接MOSFET管或插入ATmega芯片。

组装图示

点击图片来看放大图。

正如您所看到的,MOSFET管和ATmega并没有安装。我们稍候会继续。

另外,在ATmega上下有两行空孔。这是为扩展插座准备的。只有你打算焊接扩展板的时候才需要。我们将把此项工作放到组装扩展板里。

设置

这些步骤展示了怎样让焊接好的主板工作。

可能的电源选项

Generation 7 Electronics 有两个选项来满足机器的电源需求。

Gen7 v1.4 Power Options.jpeg

选项1

这是推荐选项。用一个PC电源,插入ATX24接口和两个磁盘电源接口,完成。这种方案可以满足全部电气需要。不需要任何改动。

需要注意的一点是PC电源有两个或三组电缆,每个上有几个磁盘电源插头。每组电缆只能够支持大概10安培的电流。所以确定每组电缆您只使用一个插头以确保有足够高的电流支持(针对加热床或者其他高电流设备)。

在这种情况下,ATmega可以在电源“关闭”状态(待机模式)下与主机通讯。因此请不要奇怪在你的Mendel开始工作的时候电源依然没什么动静。机器会根据G-code指令自动开关电源。

注意: ATX24 插座向后兼容ATX20插头。因此如果您的电源在使用ATX20插头,请插入合适的位置上(不要用蛮力。译者注:会有四针空着)。旧规格电源完全可以正常应用在本设备上:

Gen7 ATX20 in ATX24.jpeg

选项2

本选项是为了没有标准PC电源的人。做一个插头,接入磁盘电源插座。插座上方为5伏直流,下方为12伏直流(其他为接地),ATX24插座留空。

该选项下没有待机功能。ATmega、Pololu、电机和加热头会始终供电。

电源选择

选择电源选择后,你要告诉主板从哪里获取5伏。

Gen7 v1.4 Power Selection.jpeg

在主板的右下角可以看到两个跳线。

  • ATX20/ATX24: 建议选项1。
  • Disk Power: 建议选项2。

可以且仅可以选择其中的一个选项。

电源检查

在5伏选择和所有电源接头都连接好后,您可以测试一下以确保主板不会烧掉ATmega。

Gen7 v1.4 Power Checks.jpeg
  • 红色:无论任何选项下,电源已经接入时。在选项1的情况下,电源尚未激活。
  • 蓝色:同上,电源已激活,或者在选项2的情况下。

注意:图片中没有插入5伏选择跳线。但是你必须选择一个。

检查步骤:

  1. 没有冒烟?很好:)
  2. 右下角的黄色LED被点亮?非常好。
  3. 如果您选择了选项1,按图示中绿色标记所示,短接ATmega插座右上角针脚和旁边的跳线,电源应该被激活。
  4. 同时,右下角的绿色LED应该也被点亮。
  5. 如果你有电压表,可以按照图示测量一下电压。点代表飞线,箭头代表针脚。
  6. 检查ATmega插座每个针脚的电压。除了几个标记了5伏的管脚外,其他都应当不超过0.5伏。5伏管脚包括9、10、21、30、39和40(逆时针,从左下角开始数)。
  7. 检查靠下一行的Pololu的管脚。他们都不应当超过0.5伏。

如果一切都在限制范围内,你可以非常确信那些贵重元件接入后不会被烧掉。

插入半导体器件

安全测试通过后,现在可以插入半导体器件了。

Gen7 v1.3 Semiconductors.jpeg

(图示中依然包含散热器。v1.4.1不再需要)

  • 完全断开电源。
  • 两个MOSFET管外形一样,但是它们类型不同。请确定标记了 IRFZ 44N 的更接近 Pololu 插座,标记了 IRLB 8743 的更接近主板边缘。
  • 焊接时MOSFET管平坦一面朝主板中心。由于工作时会有大电流通过,一定要上足焊锡。
  • 将ATmega插入插座。跟其他相同封装的集成电路一样,在元件的一端有一个凹槽。这个凹槽要朝向MOSFET管,另一端朝向ATX24电源插座。正确插入后,您可以从ATX24一侧看到(ATmega元件上)正印的文字(型号标识)。

准备您的Arduino IDE

  • 下载并解压/安装Arduino IDE。您需要v1.0或者更新的版本。如果您坚持使用v0023或者早期版本,参见 Gen7 v1.3.1 instructions,但是与早期版本一起的avrdude无法将程序写入ATmega1284P。
  • 下载并解压 Gen7 Arduino IDE Support 2.0 package
  • 在包里找到文件夹 Gen7 并挪动到 Arduino包中的 hardware 目录下。在Gen7 Arduino IDE Support包中有安装说明供参考。
  • 启动您的Arduino IDE。
  • 在菜单 -> Tools -> Board,从六个新条目中选择您的Gen7主板。他们在处理器类型和时钟频率上有区别。
  • 在菜单 -> Tools -> Serial Port,选择正确的串口/com端口。

注意:对于Linux/Unix用户,如果您使用package manager安装,可能要找到arduino/hardward文件夹会比较困难,甚至找到后拷贝文件进去也会有问题。您可以从您的用户主目录中找到 "sketchbook" 文件夹,在其中建立文件夹 "hardware",然后将Gen7 support文件夹放入其中。文件夹 "sketchbook" 会在您第一次运行IDE时创建。

Bootloader

如果您的ATmega是跟Gen7套装一起的,那么bootloader应该已经上传好了。其他的bootloader,诸如 SanguinoRAMPSSanguinololu或者其他什么都可以。

如果您是从厂家买到的全新的ATmega(例如您从一个元件供应商处买到的),ATmega应该不会带有bootloader。解决此问题,请参阅下面的 Bootloader上传章节

如果您不确定,可以继续设置。没有bootloader会导致上传固件时超时错误。

串行通讯连接

推荐使用USB-TTL电缆或者USB-TTL电路板。其他定制化的不同的转换器也可以。请参见#定制化和其他

下面是如何连接他们。GND地线总是左面的针脚:

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

将接头插入,将USB接入您的PC机上。您PC机的操作系统就会出现一个新的串行通讯口。

您的第一个固件上传

组装完毕后,在处理复杂的固件前,最好先上传一个测试用固件,来测试基本功能是否工作。

您可以找到Gen7的Github库中的测试固件

注意:与Traumflug或者paoparts.com提供的套件一同的ATmega已经上传了测试固件。因此您可以看到你的ATmega甚至没有连接串行线之前就已经工作了。再次上传测试固件不会有任何问题,您可以按照固件上传步骤重新上传。

下面是步骤:

  1. 下载 SetupText.pde 文件。如果它已经在浏览器窗口中打开,请用“另存为...”保存成文件。
  2. 将您的Gen7接上电源,插入串行通讯转换器,将USB端插入计算机等等。
  3. 启动您的Arduino IDE。
  4. 在IDE中,打开 SetupTest.pde。您会看到是否创建同名文件夹的提问,请点击“Yes”。
  5. 确认在Test菜单上选择了正确的串行通讯端口,正确的主板类型。
  6. 点击“Upload"按钮开始上传(从右数第二个按钮)。

几秒钟后,您将会在一个黑色的文本区域内看到一些提示类似于:

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

然后串行连接线闪动几秒钟。然后提示”Done uploading."之类的信息。

Gen7 v1.3 SetupTest.png

现在您可以确信上传固件可以工作。下面测试更多功能:

  1. 如果您打开IDE的串口监视器,按照9600波特率监视,您将会读到ATmega正在做什么。如果你能清晰看到文本,证明串行线工作正常。
  2. 在上传完毕的3、4秒后,电源会突然开始工作,在闪动加热头HEATER1的LED灯几次后,电源会再次关闭。要看到LED闪烁,12伏电源必须是连接好了的。
  3. 在按下Reset按钮后上述反应均会出现,与IDE或者串口无关。

固件上传的故障排除

一些USB-TTL适配器(推荐的就有)无法激发自动复位。典型症状是发出类似这样的消息:

avrdude: stk500v2_ReceiveMessage(): timeout

这个并不碍事,只是有些不便。您可能需要在上传完毕后手动复位:

  • 在Arduino IDE的工具栏上点击"Verify"按钮。这样可以知道在"Binary sketch size"消息出现前需要多长时间。
  • 关键点是在该消息出现前如何去按下和放开复位按钮。在一个复位后,bootloader将等待3秒钟用于固件上传。Arduino IDE在此消息出现后立刻开尝试始上传固件。
  • 在尝试失败后,Arduino IDE通常无法停止avrdude的进程。在Linux下,终端中输入 killall avrdude 来帮助结束进程。

其他故障排除:

  • 有的时候只是USB-TTL适配器跑飞了。这时候可以简单的把适配器拔掉等几秒钟,然后重新插入PC机。从PC机一侧拔掉跟从Gen7串口一侧拔掉是完全不同的。

微步进(调整)

您可能还希望在缺省值外设置其他的微步进方式(microstepping)。缺省是半步。微步进越小马达运行起来越平稳,但是会增加ATmega的计算负荷。这里可能的最小微步进为1/16微步。

您尽可随意为每一个马达设置微步进。例如,Z方向1/8微步,X,Y方向设置1/16微步。

您可以在每一个Pololu前面的跳线上设置微步进值。请参考MS2和MS3。快速文档(allegro documents)也叫做MS1,并在Gen7板上已经直接焊接为High(跳线)。插入跳线帽为High,不查任何东西为Low。下面是Gen7主板的细节图,图示中为MS2设置为High,MS3设置为Low:

Gen7 Microstepping Jumpers.jpeg

下面的表格告诉你每种组合的含义:

MS2 MS3 微步进分辨率
开路 开路 半步(half step)
开路 短接 不允许!
短接 开路 1/8微步(Eighth step)
短接 短接 1/16微步(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.

固件

In principle, you can run any of the ATmega compatible RepRap 固件s 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 固件

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.

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 固件 would be stuck forever 'waiting for target temp'.

Repetier 固件

Tested on 644 @ 20Mhz. See this post for sample config and pins files. Should be integrated into the default 固件 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 固件

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.

其它配置

下面的信息可以帮助您配置其它固件。

引脚分配

                 +--------\/--------+                   
INT8 (D 0) PB0  1|> Xmin  Temp_Bed {|40 PINA0 (AI 8 / D31)   (PINA0 for analog, PA0 for digital)
INT1 (D 1) PB1  2|> Ymin  Temp_Ext {|39 PINA1 (AI 1 / D30)   (PINA1 for analog, PA1 for digital)
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  
                 +------------------+                   
功能 ATmega 名称 Teacup FiveD 固件中的方向
X 步进 PA2 DIO29 29 数字输出
X 方向 PA3 DIO28 28 数字输出
X Min PB0 DIO0 0 数字输入
Y 步进 PA4 DIO27 27 数字输出
Y 方向 PA5 DIO26 26 数字输出
Y Min PB1 DIO1 1 数字输入
Z 步进 PC7 DIO23 23 数字输出
Z 方向 PC6 DIO22 22 数字输出
Z Min PB2 DIO2 2 数字输入
挤出步进 PC3 DIO19 19 数字输出
挤出方向 PC2 DIO18 18 数字输出
电源使能 PD7 DIO15 15 漏极开路输出, active low
电机使能 PA6 DIO25 25 数字输出
加热器 1 PB4 DIO4 4 数字输出
加热器 2 PB3 DIO3 3 数字输出
温度 1 PA0 PINA0 0 模拟输入
温度 2 PA1 PINA1 1 模拟输入

版本变化,从v1.3:

  • 最大行程终点被取消。
  • 最小行程终点现在为 PB0 / PB1 / PB2。
  • 步进电机顺序反转(由原来的E Z Y X 变为 X Y Z E)。
  • All pins on the analog port one to the left (pin number - 1).

本次提交的 Teacup 固件易可帮助升级其他固件。

连接设备

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

光电终点检测

Start with this, as it's simple and some 固件s depend on a working endstop to move the 步进电机. 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 固件.
  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 光电终点检测

If your 固件 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 固件 is at fault, typically due to a misconfigured pin mapping in config.h/configure.h/configuration.h.

步进电机

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 固件 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 步进电机

注意: 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 固件, 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 固件'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 固件 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. 步进电机 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.

热敏电阻

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

注意: Make sure there is no electrical connection between 热敏电阻 and heater wires. Heaters typically run at 12 V, even when turned off, which would blow the ATmega input pin. Usually, neither wire of the 热敏电阻 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 of both 热敏电阻 connector you use you use for what, as long as it matches your 固件 configuration. The circuitry for both 热敏电阻s 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 bei either swapping the pin mapping, or by swapping the connectors.

To test the 热敏电阻, 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

注意: 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 热敏电阻

  • If the temperature readout is zero, you likely have configured the wrong pin in your 固件 or a broken 热敏电阻 wiring.
  • Unplug the 热敏电阻 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 热敏电阻 wiring results in a very high temperature readout, like 800 °C.

Heaters

This one is simple, too. The heater is a 电阻 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.

注意: 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 热敏电阻, the 固件 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.

注意: 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 or even melting the connector.

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 固件s 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 固件 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 Ω 电阻 right next to the MOSFET. The higher the PWM value, the closer the (average) signal should be to 5 V.

定制化和其他

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.

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 固件 - 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.

使用E'go USB-TTL适配器

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 固件.

Suppliers of this adapter

Bootloader上传

注意: 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 boot loader 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.

注意: 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.

注意: 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.
  • Switch on your power supply, at least one of the power source indicators 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
./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