作者: Offer 時間: 2014-9-6 14:46 標題: Arduino Mega 2560 + RAMPS1.4 + Marlin Firmware
本帖最後由 Offer 於 2014-9-6 14:53 編輯
以下是介紹使用Arduino Mega 2560 + RAMPS 1.4時一些設定及注意事項, 希望在本年內完成!
Marlin 支援的控制板有很多, 但此文我會用Arduino Mega 2560 + RAMPS1.4介紹一下
作者: Offer 時間: 2014-9-6 14:46
本帖最後由 Offer 於 2014-9-8 20:39 編輯
Marlin 是一套 3D printer firmware它是結合 sprinter 與 grbl 的功能亦是DIY 3D printer 主流的firmware之一
Arduino Mega 2560
http://arduino.cc/en/Main/arduinoBoardMega2560
RAMPS 1.4
http://reprap.org/wiki/RAMPS_1.4
LCD & SD Card Shield with Panel
http://reprap.org/wiki/RepRapDiscount_Smart_Controller
Marlin
http://reprap.org/wiki/Marlin
Arduino IDE Version 1.05
http://arduino.cc/en/Main/Software
作者: Offer 時間: 2014-9-6 14:47
本帖最後由 Offer 於 2015-2-10 23:00 編輯
先安裝Arduino IDE
Arduino IDE Version 1.05
http://arduino.cc/en/Main/Software
首先用 Arduino IDE 開啟 Marlin 的 project
打開Arduino IDE, 選Com port
選Board
Open Project
選Marlin.pde 或Marlin.ino
下載Marlin源碼你會見這些file
Marlin firmware (我是用2 Jun 2013 Version 1.0.0 beta 1 )
https://github.com/ErikZalm/Marlin/tags
- cardreader.cpp
- cardreader.h
- Configuration.h
- ConfigurationStore.cpp
- ConfigurationStore.h
- Configuration_adv.h
- COPYING
- createTemperatureLookupMarlin.py
- create_speed_lookuptable.py
- DOGMbitmaps.h
- dogm_font_data_marlin.h
- dogm_lcd_implementation.h
- fastio.h
- language.h
- LCD Menu Tree.pdf
- LiquidCrystalRus.cpp
- LiquidCrystalRus.h
- Makefile
- Marlin.h
- Marlin.pde
- MarlinSerial.cpp
- MarlinSerial.h
- Marlin_main.cpp
- Menu Plans.xlsx
- motion_control.cpp
- motion_control.h
- pins.h
- planner.cpp
- planner.h
- Sd2Card.cpp
- Sd2Card.h
- Sd2PinMap.h
- SdBaseFile.cpp
- SdBaseFile.h
- SdFatConfig.h
- SdFatStructs.h
- SdFatUtil.cpp
- SdFatUtil.h
- SdFile.cpp
- SdFile.h
- SdInfo.h
- SdVolume.cpp
- SdVolume.h
- Servo.cpp
- Servo.h
- speed_lookuptable.h
- stepper.cpp
- stepper.h
- temperature.cpp
- temperature.h
- thermistortables.h
- ultralcd.cpp
- ultralcd.h
- ultralcd_implementation_hitachi_HD44780.h
- watchdog.cpp
- watchdog.h
https://www.hkepc.com/forum/attachment.php?aid=1714662&k=fcab37c4884a9ed420788a8862a1b724&t=1781833951&sid=tboq5Slpc

https://www.hkepc.com/forum/attachment.php?aid=1714663&k=8cfa825ee48081f549d6b910931adb56&t=1781833951&sid=tboq5Slpc

https://www.hkepc.com/forum/attachment.php?aid=1714664&k=00230b70fc645a5a90f5f1b843191a4e&t=1781833951&sid=tboq5Slpc

https://www.hkepc.com/forum/attachment.php?aid=1714665&k=22e3fd24974070c99469e9967aafee44&t=1781833951&sid=tboq5Slpc

作者: Offer 時間: 2014-9-6 14:47
本帖最後由 Offer 於 2014-9-7 20:50 編輯
Marlin架構
main lib
Configuration lib
plan motion lib
LCD lib
SD lib
Serial lib
Stepper lib
Temperature lib
https://www.hkepc.com/forum/attachment.php?aid=1714999&k=3fef1558e0d491e04345ec5dadc5b20b&t=1781833951&sid=tboq5Slpc

作者: Offer 時間: 2014-9-6 14:47
本帖最後由 Offer 於 2015-1-21 20:17 編輯
在Configuration.h內,要依控制板的型號設定對應 MOTHERBOARD 的參數
- // SERIAL_PORT selects which serial port should be used for communication with the host.
- // This allows the connection of wireless adapters (for instance) to non-default port pins.
- // Serial port 0 is still used by the Arduino bootloader regardless of this setting.
- #define SERIAL_PORT 0
- // This determines the communication speed of the printer
- #define BAUDRATE 250000
- //#define BAUDRATE 115200
- //// The following define selects which electronics board you have. Please choose the one that matches your setup
- // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
- // 11 = Gen7 v1.1, v1.2 = 11
- // 12 = Gen7 v1.3
- // 13 = Gen7 v1.4
- // 3 = MEGA/RAMPS up to 1.2 = 3
- // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Bed, Fan)
- // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
- // 4 = Duemilanove w/ ATMega328P pin assignment
- // 5 = Gen6
- // 51 = Gen6 deluxe
- // 6 = Sanguinololu < 1.2
- // 62 = Sanguinololu 1.2 and above
- // 63 = Melzi
- // 64 = STB V1.1
- // 7 = Ultimaker
- // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
- // 8 = Teensylu
- // 80 = Rumba
- // 81 = Printrboard (AT90USB1286)
- // 82 = Brainwave (AT90USB646)
- // 9 = Gen3+
- // 70 = Megatronics
- // 701= Megatronics v2.0
- // 702= Minitronics v1.0
- // 90 = Alpha OMCA board
- // 91 = Final OMCA board
- // 301 = Rambo
- #ifndef MOTHERBOARD
- #define MOTHERBOARD 7
- #endif
- #ifndef MOTHERBOARD
- #define MOTHERBOARD 34
- #endif
- //#define ULTRA_LCD //general lcd support, also 16x2
- //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
- //#define SDSUPPORT // Enable SD Card Support in Hardware Console
- //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
- //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
- //#define ULTIPANEL //the ultipanel as on thingiverse
- // The RepRapDiscount Smart Controller (white PCB)
- // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
- //#define REPRAP_DISCOUNT_SMART_CONTROLLER
- // The GADGETS3D G3D LCD/SD Controller (blue PCB)
- // http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
- //#define G3D_PANEL
- // The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
- // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
- //
- // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
- //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
- // The RepRapWorld REPRAPWORLD_KEYPAD v1.1
- // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
- //#define REPRAPWORLD_KEYPAD
- //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
- // The RepRapDiscount Smart Controller (white PCB)
- // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
- //===========================================================================
- //=============================Thermal Settings ============================
- //===========================================================================
- //
- //--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
- //
- //// Temperature sensor settings:
- // -2 is thermocouple with MAX6675 (only for sensor 0)
- // -1 is thermocouple with AD595
- // 0 is not used
- // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
- // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
- // 3 is mendel-parts thermistor (4.7k pullup)
- // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
- // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan) (4.7k pullup)
- // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
- // 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
- // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
- // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
- // 10 is 100k RS thermistor 198-961 (4.7k pullup)
- //
- // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
- // (but gives greater accuracy and more stable PID)
- // 51 is 100k thermistor - EPCOS (1k pullup)
- // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
- // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan) (1k pullup)
- #define TEMP_SENSOR_0 -1
- #define TEMP_SENSOR_1 0
- #define TEMP_SENSOR_2 0
- #define TEMP_SENSOR_BED 0
- #define TEMP_SENSOR_0 10
- #define TEMP_SENSOR_1 0
- #define TEMP_SENSOR_2 0
- #define TEMP_SENSOR_BED 10
- // Languages
- // 1 English
- // 2 Polish
- // 3 French (awaiting translation!)
- // 4 German
- // 5 Spanish
- // 6 Russian
- // 7 Italian
- // 8 Portuguese
- // 9 Finnish
- #ifndef LANGUAGE_CHOICE
- #define LANGUAGE_CHOICE 1 // Pick your language from the list above
- #endif
- // The minimal temperature defines the temperature below which the heater will not be enabled It is used
- // to check that the wiring to the thermistor is not broken.
- // Otherwise this would lead to the heater being powered on all the time.
- #define HEATER_0_MINTEMP 5
- #define HEATER_1_MINTEMP 5
- #define HEATER_2_MINTEMP 5
- #define BED_MINTEMP 5
- // When temperature exceeds max temp, your heater will be switched off.
- // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
- // You should use MINTEMP for thermistor short/failure protection.
- #define HEATER_0_MAXTEMP 275
- #define HEATER_1_MAXTEMP 275
- #define HEATER_2_MAXTEMP 275
- #define BED_MAXTEMP 150
- //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
- //can be software-disabled for whatever purposes by
- #define PREVENT_DANGEROUS_EXTRUDE
- //if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
- #define PREVENT_LENGTHY_EXTRUDE
- #define EXTRUDE_MINTEMP 170
- #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
- // Travel limits after homing
- #define X_MAX_POS 205
- #define X_MIN_POS 0
- #define Y_MAX_POS 205
- #define Y_MIN_POS 0
- #define Z_MAX_POS 200
- #define Z_MIN_POS 0
#define BTN_EN2 31
- #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
- #define BEEPER 37
- #define BTN_EN1 33
- #define BTN_EN2 31
- #define BTN_ENC 35
作者: Offer 時間: 2014-9-6 14:47
佔位用
請暫勿回覆
12345
作者: Offer 時間: 2014-9-6 14:47
佔位用
請暫勿回覆
1234
作者: Offer 時間: 2014-9-6 14:47
佔位用
請暫勿回覆
123
作者: Offer 時間: 2014-9-6 14:47
佔位用
請暫勿回覆
12
作者: Offer 時間: 2014-9-6 14:47
佔位用
請暫勿回覆
1
作者: Offer 時間: 2014-9-6 14:48
佔位用
請暫勿回覆
1234567890
作者: Offer 時間: 2014-9-6 14:49
佔位用
請暫勿回覆
123456789
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
12345678
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
1234567
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
123456
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
12345
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
1234
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
123
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
12
作者: Offer 時間: 2014-9-6 14:50
佔位用
請暫勿回覆
1
作者: Offer 時間: 2014-9-6 15:45
此線可以回覆及一起討論吧
作者: hktvro 時間: 2014-9-7 05:24
好帖 ! 如果有高人教 改裝 ramps1.4 比 arduino due 用就更加 very good !
作者: Offer 時間: 2014-9-7 23:19
3D printer 2560已夠用何須粒咁猛嘅MCU?仲有佢的IO是3.3V所以有好多地方也要留意
作者: Offer 時間: 2014-9-8 21:41
updated
http://www.hkepc.com/forum/redir ... 48&pid=32337021
作者: shaqiu 時間: 2014-9-9 11:05
回覆 23# Offer
其实改动不是特别的大, ramps 本身就是一个转接板, 如果从5v 转到3.3v。
电机驱动4988 电平兼容3.3v,无需要改, endstop 用机械开关的话5v 于3.3v没区别,不用改。 温度检测如果用热电阻也无需改动。sd卡本身就是3.3v电平,也无需改动, 可能要改的是:
1. 3几个功率输入的mos开关管, 管脚直接驱动5v 或者3.3v的导通压降有比较大差别, 这个通过选择低导通压降器件,不直接驱动热床的话,其实也无所谓。
2. LCD, 可能是5v电平接口, 要么做电平转换, 要么选择支撑3.3v 逻辑的lcd即可。
换句话说,如果选择合适的器件, ramps只要更改电源部分的少数引脚就可以直接用到due上, 只是现在的reprap discount lcd是为5v电平设计的, 不能直接用而已。
作者: shaqiu 時間: 2014-9-9 11:09
回覆 25# shaqiu
用due类的理由挺多的, 首先是delta类的机器用 2560 计算实属勉强。 其实marlin等固件受到计算能力限制,很多想法无法实现。 有人在marlin的git主页上询问marlin 为何没有due版本的问题, 作者说,把marlin移植到due上面对他来说只是“ a few hours work” 但是他觉得marlin的结构不理想,如果在due上做,应当充分利用计算资源重新设计运动控制的部分。
作者: Offer 時間: 2014-9-9 18:34
完全同意,你對電子相當熟識,移植上是硬件的3.3 v比較麻煩又用不到常用的LCD模組。另一點要注意的是NTC的測溫表要整個從新測量及建立一次因為ADC的數值全變了
作者: Offer 時間: 2014-9-10 23:30
仲有一點,MCU的能力大左快左對於一些對時序要求高的元件及動作也可能要修改一下
作者: Offer 時間: 2014-9-19 04:02
半夜起身又去睇下code繼續寫埋呢個post
作者: idleman 時間: 2014-9-19 23:44
留個名先,支持支持
作者: lawhun0083 時間: 2014-9-22 14:04
請問個噴頭測温可以轉用熱電偶嗎?
作者: shaqiu 時間: 2014-9-22 15:14
热电偶信号太弱, 要额外放大电路, 自己加放大电路转接就可以用
作者: Offer 時間: 2015-1-6 20:53
updated http://www.hkepc.com/forum/redir ... 48&pid=32337021
作者: ghost2377 時間: 2015-1-7 00:21
其實已經有支援中文的LCD
http://item.taobao.com/item.htm? ... amp;_u=720gd2h2d8d8
和教學
http://www.makerlab.me/guides/9
衹是比較蠢,不懂怎用
作者: Offer 時間: 2015-1-7 07:40
繁體中文https://github.com/MakerLabMe/Marlin/tree/add_traditional_chinese
12864我也用過,不過顯示更新速度會比2004慢很多
作者: idleman 時間: 2015-1-7 08:50
建議師兄 起紅色字加埋行數咁易睇D
作者: Offer 時間: 2015-1-7 10:45
行數會變的,應該用Ctrl+F
作者: idleman 時間: 2015-1-7 12:34
我指你個POST 顯示D行數
作者: prof2034 時間: 2015-1-7 13:50
好似有樣幾緊要嘅嘢無講,就係下載回來嘅Marlin係有幾個唔同嘅Configuration.h比你用. 要簡自己機型的. 例如Kossel用嘅同普通xyz機會有分別.
-delta
-makibox
-SCARA
-tvrrug
作者: fred2088 時間: 2015-1-7 14:19
回覆 39# prof2034
在 Github 有太多 Marlin 版本了, 有的有 G31 ... 有的有中文, 有的有 UUID ...
作者: jackieleehome 時間: 2015-1-7 14:40
回覆 40# fred2088
In Github you can track back to the org source's the most update version.
作者: Offer 時間: 2015-1-7 18:12
好明顯我是刻意不指定那機型,FW變化太快!過兩個月後已經變化很多
作者: fred2088 時間: 2015-1-9 14:27
回覆 41# jackieleehome
想要 有 G31, 中文, 及 UUID ...
作者: esjvpc 時間: 2015-4-7 18:26
電源後. lcd有時出亂碼
點解救?
https://www.hkepc.com/forum/attachment.php?aid=1779831&k=1d7bd03d95988ed8cbc331c29c3e56b1&t=1781833951&sid=tboq5Slpc

作者: Offer 時間: 2015-4-7 18:38
本帖最後由 Offer 於 2015-4-7 18:42 編輯
排線受干擾,隻手不要拿住LCD,排線不要太長,排缐插得吾好,排缐鬆,PCB虛焊,試下再load過FW
作者: esjvpc 時間: 2015-4-7 21:05
回覆 45# Offer
原來係測溫線個杜邦插接觸不良, 再駁過就冇事啦
請問有冇現成FIRMARE可以SEND比我?
作者: Offer 時間: 2015-4-7 22:12
咪一早已經比左你
作者: esjvpc 時間: 2015-4-8 15:06
回覆 47# Offer
SORRY, 眼殘, 睇漏左, 今晚即裝
謝謝
作者: ea11-R 時間: 2015-5-11 09:56
其實個firmware仲要跟住改定係唔冼改直用得?我跟住改後見郁10mm菜單下只見X同Y......無Z的.......但1mm同其他就有......用埋LCD可以較暗D嗎?衣家光到好難睇到D字
作者: dtom 時間: 2015-5-11 10:11
firmware set 死係咁, Z 只係 1mm, 0.1mm 先有
LCD 光暗有得較, 你搵下LCD上面有個圓形既VR, 用細一字批(眼鏡果類)可以轉下黎改光暗
作者: ivanli88 時間: 2016-11-16 17:27
請問MEGA 2056 點樣可以改雙系統? Marlin 1.0.2 + GRBL 0.9
作者: necbbc 時間: 2017-5-8 08:27
剛剛學習Marlin 自己修改完。 使用G28 到了EndStop後為何不停定,又會反方向轉一圈。
已找和試多個設定,還是沒找到。請指點!謝謝
作者: hon2013 時間: 2017-5-8 13:37
回覆 52# necbbc
in "Configuration_adv.h" find:
X_HOME_RETRACT_MM (marlin 1.0)
or
X_HOME_BUMP_MM (marlin 1.1)
作者: necbbc 時間: 2017-5-8 14:33
本帖最後由 necbbc 於 2017-5-8 14:40 編輯
回覆 53# hon2013
謝謝! 已成功。(之前我只在Configuration.h內找!)
作者: maxlawwk 時間: 2017-7-29 02:21
多謝分享. 個post已經幾年了, 仍然好有用. 我而家用Reprap 1.4+, 希望跟住都玩得到. 想問一問, 如果雙擠頭, 仲想有可控速風扇, 係唔係要額外加MOSFET relay去power supply 12v, 再由板上某啲pin控掣? 有冇firmware例子可以睇睇?
作者: Offer 時間: 2017-7-29 07:44
MOSFET有三個可以用,如果冇heat bed雙頭是夠用的
作者: maxlawwk 時間: 2017-7-29 11:03
回覆 56# Offer
對, 忘了還有heatbed, 那麼雙擠頭+heatbed+一個可控風扇的外加MOSFET在marlin的設定大慨怎樣做?
作者: hon2013 時間: 2017-7-29 14:36
http://www.instructables.com/id/ ... ps14-RRD-Fan-Exten/
作者: maxlawwk 時間: 2017-7-30 11:02
神級回應, 拜伏!
我個3D printer係淘返來自砌, 用3DYMY Ramps1.4+板, 賣家就好厲害話個GPL firmware有知識產權唔肯俾source code我. 想問下有冇方法可以知道個heatbed/hotend thermistor係用咩ID?
作者: ghost2377 時間: 2017-7-31 00:19
不開源就有呢個(好)處,有事無人幫到你,只有求開發者
作者: alancck 時間: 2017-7-31 08:28
冇辦法啦,同胞鍾意吸收人地啲知識,但又怕畀其他人搶走啲開源資料
,所以攪埋晒啲維權,注冊保護,真係"又要威,又要戴頭盔",老實講,如果賣家話啲資料有乜乜版權,不如成張控制卡換咗佢,反正又唔係貴,而且佢本身嗰構造都係"參考"外國,根本冇乜"自主研發"可言,買過張主控,當佢啲野係零,部件,自已重新砌過重開心啦...作者: fred2088 時間: 2017-7-31 09:17
回復 59 #maxlawwk
自己換了它們, marlin 有支援十多種sensor, 一般用 NTK 100K, , 幾元左右。。。
via HKEPC Reader for Android
作者: hon2013 時間: 2017-7-31 18:44
神級回應, 拜伏!
我個3D printer係淘返來自砌, 用3DYMY Ramps1.4+板, 賣家就好厲害話個GPL firmware有知識 ...
maxlawwk 發表於 2017-7-30 11:02
神乜鬼吖,只係咁啱用過
一般國產大路用#1,但有啲人賣機喜歡改野,更加有啲人唔知自己賣緊乜thermistor。所以冇人答到你!
要安全可以考慮下買set Ramps玩,現有塊板做backup
作者: fred2088 時間: 2017-7-31 21:19
回覆 62# fred2088
我們正找 MKS 改第二代板 ...


