From fe2bd237d556439499dfdee852c1550c7a16430a Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 6 Mar 2015 23:36:56 +0100 Subject: [PATCH 001/302] Add font sources. Fonts have been created with fony.exe (http://hukka.ncn.fi/?fony) The HD44760_? fonts simulate the fonts of the character based displays. The ISO10646 fonts provide the right size of the standard fonts. Marlin_symbols contains only the the special symbols of the original marlin font. --- Marlin/scripts/Fonts/HD44780_C.fon | Bin 0 -> 4176 bytes Marlin/scripts/Fonts/HD44780_J.fon | Bin 0 -> 4176 bytes Marlin/scripts/Fonts/HD44780_W.fon | Bin 0 -> 4432 bytes Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon | Bin 0 -> 4224 bytes Marlin/scripts/Fonts/ISO10646_Kana.fon | Bin 0 -> 4208 bytes Marlin/scripts/Fonts/Marlin_symbols.fon | Bin 0 -> 784 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Marlin/scripts/Fonts/HD44780_C.fon create mode 100644 Marlin/scripts/Fonts/HD44780_J.fon create mode 100644 Marlin/scripts/Fonts/HD44780_W.fon create mode 100644 Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon create mode 100644 Marlin/scripts/Fonts/ISO10646_Kana.fon create mode 100644 Marlin/scripts/Fonts/Marlin_symbols.fon diff --git a/Marlin/scripts/Fonts/HD44780_C.fon b/Marlin/scripts/Fonts/HD44780_C.fon new file mode 100644 index 0000000000000000000000000000000000000000..00936e2541764768f6d2f027832b19dbf5e361f8 GIT binary patch literal 4176 zcmeH~e~2B`702(!xS6Cej8-Jrpw~9YA|bp=u&*J=)W$F^F&)yNAxQfY*Z5ZA?sT)U z4=FNQDT9a%BC-^bhZGr#ltn}yLCQl!7EuW$ltn}yB4r68uOc!OG5wy;%!`3S{^%e5 zt9SN&=FBH5&!SMPg* z2%HOk|DXPTphzOOo3*t?YixRQx@x0{cXdltwAt!a`I5Hh zuWq`y6wd$N_sC+n_DZQJWUDmoF2FD0H!zqs{dI5$ycM?KUbr6~f=A&AcnUrWGx#)o z9=-%i_!@i@z5~y}58@MZWa zd;<>QyYM{x7_P%F;MZ_kOJdrE@J6^3?uKo67d!~>g&p`XT!N3o96kqMgs;FAcox15 zKY(lS6ZjeY3cAe})fRX?ya~?0+u=TV04DGloQ3nS2cLw`z!zX2{u#aw{|Z;(-{42^ zA8-u+1vj#7w!!W2`*0V$14i)Y@Cf`B?7~I(JNO4!z(2x2!N0%(d<(t@{|-m+0{jww z1B36d{^1UID{R5Na6dc*kHQo16nqqB@M-uwd z(8Jr{9(X5=;bC|`JPA|y7<>vo3zy-`@KyK*9Kv_udH6A0hhM<2;q*1Ee|RI@33tOb zybB(L_reZ*7%subVGf^zFTz*g3Ooznh9AH+_zC^WPOn}NcBI2;?bqBBmHDspP>*`7 z=-c9wqzDwcmt8S3fYR0bXAs(o9L0Uy569UO0}9^EMOH` z+ZxEQ=t#nXc}omt|=^ewvoX z8%=48lz6p8Difr{Cylo}spGTJjff@H#r4$%$=z$yIvq=-PZhQewvIzXAxK;S;hd$+QDeO zICrj8K{CH}j5b=e)kcc}bUpJCSjCmqdQ2_8l=T-yiY0E*i<&NXClcdlBUmzil57Ac zR$^uyM>ZM*1v0=k$OrvK>Pto!%*0jX5nVeSvBK)F|MR~cfhxB%VyxzptVl}i3}HQM zI?{S==uByLiY8Yll4daRk|e4{Z$_nz=|!{u?f&2p^VSD@K^Co`K=q_iu{j@V!^E+z zHCb2Hp(H!u0@hzqmg{9%NN1~WCN^)|JCk$Gxly4 z^(=fO=O(*Cy)=2Ko}DYSPez- zib`tE1Ldwe%|^VI621FweRAcjr9L%hPPbd5Q@8ci<8&M9QZ%b(wdv1Z_55bVO0`mC zvIcRt>c)YjEHA4vH(fT$Cq5?k94jZ*kB8^@s<$ zbX9|5snjK2nMkruPE0$m^3->1l_(ExKcA*)<*A&wTm~zbj=#Jpj}BO|c`=BW?f=tZ zG>q5UwXRZh#5Z&;{e!6z^+#ne)AN$jsHflPa!C_Z>6fZv*R8v5sQz?AjKdVEF-sQ~ YiEeaRTd_|P&+XSMOWSC&R&{ai-yl}Q_5c6? literal 0 HcmV?d00001 diff --git a/Marlin/scripts/Fonts/HD44780_J.fon b/Marlin/scripts/Fonts/HD44780_J.fon new file mode 100644 index 0000000000000000000000000000000000000000..80527ef745b61f93848a98599cd60e1c01fa6680 GIT binary patch literal 4176 zcmeH|e~27K7RPI2+;n0LeV$0rpygeVAR)|2&@}`pHHJ}QY+~?2kh@7-#&_kF4-3J3X1{L7l% zPrrVzs@|(tRj=>d|BV}Q&aKq{*|W|a)6-gj=SLy)x~q<_b8oNy`08ULyFR{p@5JO0 zpU+G`FmvD`KXd;-j!w?pf5hK8dEddrkjm^}%Z@X~&6GY%# z^3?zP`?DemZq_}a-wF$qNLM6H&kI(%RRwDIN0+#4?Pd%~qr1YLcC8H~MeMz5=Uuz^ z?znx=>h_MUTW=U^{ry(cUuD`ox83dk(rRtK@p}FFZGPC}4nG#h4mo16UeI6X+|65j z`@qcj?9r(QHv9bO!NZgH`SIz84oprB`=0NaxQ>3!GDci)WMtH>ac)#Uf7bbmu_rEU zrZ^YQZ|{3xG5q0tOHs(yY1EyD-@zYYGHUuu;0AaNY{6}C2iy(!!GrKHd>9t+S@BEQJ2EY;YPRxj=@{tE_e^@zz5+hd>oeW1^5bl9nQn!@B{b> zJPALCU%~I8TWwLTftSK7;U;(;+zxlb4DN^Ha0+(elkhqC670h_;M?#$xCs9P{|CQ> z%kT%dl54XLu7`huo8k2^z&qex_%}EKXW(P-8Q6m_!+*km!DH}!_;2`MIDn_&ckoA; zT*Uc@8{jpt1-HQ+a5vls55mLnVOYRt;fwH9Si!g8yYNG}1V4pez^`EqSFGjy!^@zD z*TSvvCfJ61;Jxq=%;BT(Y4|*xgRj9i;X7~vegsdz&)_NeEj$B9FXsHi%i%`21&+a6 z;4XL%?7#=%EPNc6@CEn^d>zii%aG>i)|*>#aF2RhA9)Syt<3ufE&QH!YiWVKMb#ZoQ;VuOF)3gh@V# z)?^F8r;@}}Z>IEBUU?Io_qCi1TPuxnJyht~YS~Mok%b9)Iae)~xg_7Q08PrvBrggZ zRHr^ol4VJ0E9=#1YPw=MNf^-z#d3*MYd$qub19-uk8YB7q{C_SYwn54{Ks`@M*Xbm z-Qtp@2o$=PWa2~>qblpNETxiD`@>ii1rZE-vh@bi)kU$~M2}R&e#c@|>eb9*0jtS6 zrbMQ_j-;~JU+DMDhvrqYxXP222AQrb7pplWtxe6MvOv^PlIh}ZnJ&)KEs8wmPutRX zV<=;hGOw{nRfd%LtnpT6F+R&~AeLO4AAL9!CCP-AW>#BCUD$lB_Q2ek%2wA+q>N+DkM^foQR*xLTS!rmKv_E&Z5HR2 zDm5hY8)LL=MXP0t1iG&INUY=hV$7+rJbvp4` zCwBCa>!cO;NPF1nN1dt*|^9j;ZVkV4(g0+P$qG+LKa{i3d_nz7NMGm>m- z#d9E^a^cla9;ieTxxk#E+G=4cl{~1KH(f=uOLE<|Msy^EZcn$uOVZS8Hr9%LtZ;52 zSxnMFw5IXI5^)$aU0Jr9+SzSa>zOYdn2%sqU8k6roUlx%d)mpktICAB71Fuf!20S$ zx1!LS*9p(Lj0#TS1?hC|bye(Ms^aP5bxmh6$LbyW`UaTFCa&U#M%FBrmRw%)XbweL zBbgCzuGT$bMIkOuv*b8#qS8DjX&v(BCH2&XQT6*(H7}h)vcfFMX+KoJ8>u-P3r=GP z()nI6i&{Kqi0!J!C)8yMGuFRWyPfMVm_08#O&wBEIaL;>>#BH@I#s}?IH@#QZIX7( z`+l%qE?r7_x>TRE_yOsMepET1EBf5)%_`R*SWa`*HO(VQu}HuNrI`9h0VdNbz{Bde zuUb-nYZ{TA)HAcM1@*7ig^Awz}&C`j;%*&dI1&2OZETRdQmI*C3B- Ih%@KfPhW_QYXATM literal 0 HcmV?d00001 diff --git a/Marlin/scripts/Fonts/HD44780_W.fon b/Marlin/scripts/Fonts/HD44780_W.fon new file mode 100644 index 0000000000000000000000000000000000000000..e478dbb087ddb18ea673a280e54989d63c91f571 GIT binary patch literal 4432 zcmchae~29A8OPs?>1C3}blQp>Ht1^`WRVc266`eunMw>>iRq9A4MFTC#&{?3ZhA@V zA|j&|8AN0dkwrun5gCd|kRXdlIYi_Tl~608AMFK&*z=HSPJ>G@7{j) zyU+XMdEV!J_8soF!~b>@&bjq^U%24hNT1eHcxe>s-g3_TS#9KflYbjquZ9?kXoN*2{)Jaqf3J zxu?di3qORP!1M4c_#K?wXtBlcD!2{q zfYb11xDVbAd+AD8K@_t zD(7wZ0bGWk!Y|-A(CK-i`yXBbuZA6X1KbVw!VDgU$KV|7!$;wh@LBN(PY>tfBwxvs zSQmQQ%lmmRm0Ipr?FGMFbz9~0#@XAsCilE0^QLKX8xTdEZj*W`pVwZ^lv=H^CezR< z6*n=a*rz^rww^wHiqe!E7qT{a&MJ~^v-Q05`j%y@wk&J(vah~B%sVUAySSwF22)bK zYM9p5j462tO?|0(#&2w%)f8v#O(=rq2X2!PYY2{h=aR%kq?v_@yd2a^WiI7=7NDuT zjPjx&SFw+yXhpU-$*LxfrJ7m%{@_>|F93O z*aoQY7MI2=0)_6SOwQCHsfnJ=CjsYnT7Z)yD72cI{Y*>zs|B3naC~r*le0;hP7tVQ!1?`kNRa_ zx+u;ph5TuDo4+WU(blZjcG48KUeX<#J2Tnt`jL!buKCgVv^$EOMPM5#3KFQ^9-Tz$ z&edwNIcI)DjFzp?YuO@!u5Uh~FfQcO;>)SOG*v9!gjFy=#|%Wm3&%G^N$}id4VT>2y^*&S^J!*pYq-?fEJs{f^X` zc`3&558VYpcnJJzgbZkcDf%_y^`y~K1z z&fd7qJTXt{it>I@lMS-ZnvH8rm zy>7ZU9F2z~dCOH1W$t?}^>%;TT@vZ(6_nO%m0MF9r!?EsAYN1EH`p|8RjD-3Q=N*1 z>(L%e96xhcmCYp!j+m*TU<%c=_M^@90M^@9u|!*Myr#5DYYU?7%@mcl{Mqk>q$d*H z?ipLfwYQ$_Biw%$OHdX|dnc~hEPt)do$K_6?X8lp)_B{pN@_^Ji2|4 zAARVNeM6%U?e%vKJvchDcVy?7zh`K8VC1pAD=%EIyjptGZRf3h9tF-tPycnl>!c)h zWA1r93r#3W=S0=Wx%1ro47XeC&UeYe6?8^+_$qu8z6&SdNANTF6`Y3O!C&Ah z7+paA!)5SlSchxidbkPR3wOZX@KKn-=itlmby&dn;34=4JPeP)Z{UxxgmV^>|8NQP z@LISE-V7UXGrSM(geiOiJ_BEba6fzjz5+YqKUDirZ@o3=^^zpr3Y;XR9((nzPTDtPy^~WlACE7U)ogd-qCIGq zk40Bh&Do60?rxn$j^08^y*S1HM?H|5F zE9$YPcheT6HSS7zBvr5-B_<0gVCjjC2L z!D{O5S0HQcrmVc(ne4P}53Q?ay7HriCYdkKr;2ebeVdx8G9el$%Y5Oq%okQ^Wmy{H zr(>yhV=8m860f;fMS_+1q}nY{fonP%!qmCBPw zt-K{W%MMJ1_-S?(zbG2ir&+IkNtxMt^~SVqXD<7?RwQSbYy0SYsxPWJQ(zyGWdu;Y zO*&EP4i{?jIcNI@jTWuYYtbTru4Q{fVO)r*=}XDKIF^=1omDh-e6VW~KZ{^N{A5`G zyS->8k7J95vNZOD1bLjkIpk)>V4I)+@oz;S_Es;*-QYbZz>%k&`X4!ZP zpIW!RmsmCvpqIq_3e%TSt#o5e3gF!W9;b;7lq`T3bt7 VA?(If3aU6KvbxbQi~C_(-5-T#?F;|_ literal 0 HcmV?d00001 diff --git a/Marlin/scripts/Fonts/ISO10646_Kana.fon b/Marlin/scripts/Fonts/ISO10646_Kana.fon new file mode 100644 index 0000000000000000000000000000000000000000..305ca983fbb18f532b73e642248b1aff0f2f218b GIT binary patch literal 4208 zcmeH|e`pj(6vrnT<7zc*TaiP=j#k=3LO4Z2Dk57^iPj%W3|2(!MWZI7$u^1YAtH-a zS&GOZMS@5PB63J6Qba_Ggd!zK6%i>?M1qJ&E0Ri)MWpt<&+cBE7W}L9ug>0m_PcL> zyf<%VXV+}{)zlbcYUTg(r7@S}uEm3|Mkv+wZ(Xi87babweW_;k_1SHmU41s_?b+Ge zzQ^`%|9Ed#@Af{srfXYoPhZcDe*0lpcSp~seT`Em&rOG3yL`gp!$e?=^VvWBy(^J; zrr#Wvt4;$Y(s54Oa(u0s7-BYWnn}i=(m;ii+Gd(xOkrkCn6#d_V%^%dWh+~!u3W!v zexYe$(?=h)ceiWZ+gj7Qe7&7tC^Wp+BtN^zj%j6^lQC*E*70ZRjd{P(wzT(l^zZH7 z*Iy2drI=SpiV=MH&Js}-rOekXq{;y+s zpfSBZHio}F)fsJ6XP&?qj;mA46gVAPI1es_OJECZg`43H7{Gn-5IhD4;A!|3yajG4%riM8k`05Z~8_QL(}2rR>s@C^JKUV`7jAK;I01pW+vgTF(E*XRv66TSlr za1mSv*TRi(E8Gn~fg$`HegVIP75EMO7Jd(J!k^#+_yopq+-vNAI2~Fz4=#jDU<+)8 zo8b-^zkKj}I0@h7o|HBz@E^LI&a4B33H^3s?1^eLv z7{TN46g&&h!^`k0yaDgP`|vS*2F+CVKb!_#=~ z``M}M`>|a5XiI}ZepG9RhF$9o%`TV{I%> zvQlsp9cKo)7Yh2|NY7A35Dip@qd=4`YJjSO$O*zwJH@Vb9cNUOTky-V>#8jrbsTyW zyl^x^#WJ20sSU)C*yL7n+@jcUn)p@sM5X?ddB})zX_04*OO!+)p<7WZJ1a?4Q5;2) zn8d06s0_o92u8|MR~`{t9EPK5^r$dtcPWWVTBW0Cz*3~PSrX}%i=v|P;Lu=MeaN^{ zG_L4QMLMZ1iiRr#D4ClSjY9tNNxjjPz9`>HUsT0M`PNUp zMSc>WX4fN@Ko;Ng)UVO(IVu8;-c_4)R716B^lX*X5;&!(BsvVw4=4GP-f8|Er&Fe; zwK|hH)bR=}BkE2~I=hl1#-y+Mk@ZPux@)Nc}_W-F=H zY>_}yQXfvzF3G9J7qI_4Phx2)Fp6{?=*$%P(+pO~pD0aWR!hw6V^6aoyVSF!gz#8> zHHeuWon>zS<6q1`_I8`t$rs2oBF(sKi-T6Y$rcx(N_JKpIl9tv=N!N&FOaUF;YC6j zHqu%mWW%R_> zV=7-&a%elljys~wGNoNzcA|Dol=#r_O88BcjP2gku4+t2k*SxWyqi}anUbSM!q-DP zUsd8a>s$5v*9Zb5GxxMdri{GLMc>1gDI=McW-_w8Zi*z&j=V>qK3WYws7RbzvUQV} zP~Wn=aTArxWlBx~IfFx;WmV+{GFy^T{VpUaRh7$Wnv-vZHz;2m2F_G2mnn_KT0Kix zOH?kG*%;YR4!l5S66i2SCRUD7PIX2l?b0lj9_!($(&f;+NC{+`nghKj%9xTPm)Imw z{n3ndRpm?3-IS<}x+gW!Eq+mz>|*)ms1ljZQbej;*-bHfH+K9Yr<9DVDc266C+$X( z`9@9-n}pgD;X}5puis?JWICQKM>d`q9ZT9_sPm3}fd++Y^efNHT-j~Z9e*gyn9`X){09|rYNiv)c1__5& z9z*cp?}xkGK|frqNg67ue6E%nsEQYtk}7JLk;Zo-#HM7%U z3;=xBlk?UIlO*WSA?l?>8B>>Ul*I;f~06*k{Q5Nuxe9OcuEOCaD?M)wMi+lU| zP^P5TrRIs&Zk)+=jRs>hlus2fE(p=B4f5bN78J28mFie<@~|qa=#)DBC~}m$J3(Mq z6-&BU!Iq@gFfBLR7>^}lo8PHZEgzf`9j^s99LGZdfG5iN=?9hPaf`_X#*u&L@sV#VRZtFh|6+EK?!>_+64z{*+Jfs(i=* literal 0 HcmV?d00001 From b14270b029370b4f3ddebe87daf11c07f2d5899b Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 6 Mar 2015 23:48:55 +0100 Subject: [PATCH 002/302] Added font tools --- Marlin/scripts/Fonts/README.fonts | 6 ++++++ Marlin/scripts/Fonts/bdf2u8g.exe | Bin 0 -> 19968 bytes Marlin/scripts/Fonts/make_fonts.bat | 6 ++++++ 3 files changed, 12 insertions(+) create mode 100644 Marlin/scripts/Fonts/README.fonts create mode 100644 Marlin/scripts/Fonts/bdf2u8g.exe create mode 100644 Marlin/scripts/Fonts/make_fonts.bat diff --git a/Marlin/scripts/Fonts/README.fonts b/Marlin/scripts/Fonts/README.fonts new file mode 100644 index 000000000..976cdb749 --- /dev/null +++ b/Marlin/scripts/Fonts/README.fonts @@ -0,0 +1,6 @@ +The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack off experience). +In Fony export the fonts to bdf-format. Maybe another one can edit them with Fontforge. +Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to produce the .h files. +The .h files must be edited to replace '#include "u8g.h"' with '#include ' and moved to the main directory. + +Especially the Kana and Cyrillic fonts should be revised by someone who knows what he/she does. I am only a west-European with very little knowledge about this scripts. diff --git a/Marlin/scripts/Fonts/bdf2u8g.exe b/Marlin/scripts/Fonts/bdf2u8g.exe new file mode 100644 index 0000000000000000000000000000000000000000..ab4e3f96dd34f1378d0ca929f86570ad32c10f80 GIT binary patch literal 19968 zcmeHveOz4Co%i7~n2`{`2#S^@*Em$7gn%YC(O@UQL}EySNzhoLyv+bpCo^Q`PF`G+ z5C>w$D~d1Oc6Vdj3Hn*v$KATt+E`;t07G*oe}Z ze#L>L%Ga-0-{KC)t$ts#zkZY4Snu`v6uH4A`-5KD?Ul>dtdlqSoUXzdGg56rbd`g# z$|Ng$@5ykLp>3FDBu`J0E@1_L+=8@TV(l}LXCm2==tX5ow>t?%vR{AT4JvLQ<9;zF z>$Jo`Ja|N=SB4}uoM6^rf69AIVmarapM>1rbHEKyq2k)6pdw#`7a2spo?%BFtEww> z)+_abg!>MkSrL-yv9qGyLcdP9VHyxsNLHk4O++Yy&R*zhsck~*JaZucbx5g5Hz1iF zPS+3!5J*`Eg{>x}so2iydJEmUULHgE%q{>yxrqoxZeQ8j^#tXy8U`Ky@wO$PcsQNn z;d*6)A-0^ZQV@uY=%zxxto^wWSQi>y9C_+CJL~LKatF(8)NL4Y3$@Rn#YWZGP-rv_ z<;;uhOslz?vCybRYn;oNcGH!Nb(Px+!sWKi2(#NcCu>D+u~{esjwAq|2D*IYR&Cxq z#v)biTxF>`tKzLv)?)!LkQTKpGi~}oD+H?w{66yH-q1jPO`nBzZDA#kfmvBu z@|TodTJk8e;IE@UE=i$!X~`_AziE<6(zOM;RK<-(d6q&6U~K3>3{Uil;^QM*Q0RIN z9!@c6IIT9PWZYqwecv#>r z1+Lq~$OEDP*?F9sn$hux&tfqIJy*Nr3N!=?Bkuvy^*ofbu7jY2lF?jPNUCGmOVJaw zyZ-|eXox9zDS=-(6(89Err2=!w4jev@_M)NREOUWjpjfFtFklg@1b)og6bl(F9w8q zLWKMowE}z*fvxBupg&M&M}*WFY3P}quPDU;%_9+a3lUcn?bn2eyW%1)1Rb%&hF8J_f%Wvg6CE!%_Bi8g`n&yf^-{R=|?}(Wqe3722*61NY9=9T%<*HSob<6 zBLu#`dU9{~aEG1on!Sf$ujpj?gN`v;X$BqCSy^KIQU()(G)^Sv}m$Pyi3?lOr(8@J5Wz_r*V=g)|(t~$~TNzDmKUeLuHrKrV!#V`8lb5lVp(1BJ`O;nPFyVV$Qimet_`-gU=z7Mw?mW znf9l0n@65CTnbIhRW5-~50g*-1hG2)5#Y6UT?@IqkI>H>=;#*1<&D8y?GBx65y*Z- zWDmv3)`%F-4d!Uq0c!T28yTH{u7Fu}fq!G@y~z-$cL!>Jm>ry^T@GiXDcU;VMIX=6 z-T@4Z6lLwJSa;3{t*~gp&PzpU$*viCNh=CFCZl!%u8R{i#R+aFf;ob~zB5~tmhYM_ zBzz47+AWxQ(9VWlZ3hej{E%zXqHRVw$uVg{8!dh*V5+5)eXo?==&%M;P>o)MKC*kq zB(~dZ=P+*1l1M+sLh%N%UtEwGi_R#P&L7xR>Nkb)M+pd|agID`h$3)ojEi%nyK%b$N zyQtd-f#JtGCq6|uOfDLP7Xdw}#{vXI0>F)q%(f3zM<%tw0@PC&2F^8(%siOT-r2i- zTEz^UOk#FbmrEMXip7z5{PaN`6`Fe6?eK$-Nh97L2-2L;jx@Hd7`~%*hz?WnR}(c% zg|wdOn-YCGd_hLYEZrExTm(WL=QQRl(+o2Ook6wgG#E~rAc6Pl!IZRJqOnuPFw4<1 zm}18$&`VkzmLG=|J!D{u;;`X3odttK=au7h-*2}I*l3(CKaPD3^FKY@AT^r|iaZ65 zC4DY;(6n!Cg-h;?Lw zS}VH17*ey;>WT2spLE8H=k!g?RGN!$X6-0Y% zG8W?D~$c405!s2`*{QH%Q1RHxx0>ieip9az*K z;PeQcsJEd$n6em6O8Q6cf#+OYXYV%j2JnR@GIoAV&E^JC6PP`*pW#WxR}!9hQ09hk zNo0|bL`5DJv!sqQBz<;yLegB4L@sbiR1lJ=c$TDrGbBA{lJqvpyo-k>K5NrEduU?D z&XwvcKC#WvrylB0y4Z~v=#?1grpB|ZwNGihYLocwB%bD8ZYULmp;SD}(8@C;O*cte zK$57Hxg;tGNmM*b(gSBmI&@hgc<-akgGajxi|%}{bfLaK2+r4KmFp*m*Upf$-6ZF6 zL(ZXL%ig|(9MO#y{T|(n+|Y47GRmO`a) zo6V+HA49v!YV{DZT($Z&WI1Z}5oFjh4IsCn00dF$~!(x@ypI zf)}nbf4TS2FFy^x9U4x;Zc3cvW@7mf#!a;Ske?1h1DQ4FQaE8KoJc6N znj`aHS4f>{iQ}9K&yFEH6NloFrw|me$d2INhpE-$W&l~Jv5)TB zkTeCI^tNd0UTxamS1;^SSB-~{(0WcUb=5@D5su%Ri7K%JT9U-p7Fpf z0K|ieMm(2`H5PubYzz)n+>;O?K$J_VKn}-6Xmnpb@*IukA^( zxwb@SaT6+N&FR6ahwgBR4(Z{u8NE7tcfAw6zB_sy=jNm%I%z?K*3^og_{xeR&0I8~ z?LB;gr8)!*L}zzLzoN~>L6Hx0dk>%0Nqhy@M1vQPHd~jByG~v6Yti`zO3_jCv|f^O zPR(>~7aCtN_Wu|xHVh5&(D_^PFr(wJ1WjI1IfzQ6h_AsJox>PxS_d#R9B;)qgmM|) zX#27l{0Pq0J{{AM1SKS_VNaPz!;K+`H!AK~B@6n*Bt3Vkxo^ZYE~uk)!aAO!S(h^k2*! zyG$z~Wi&Bs*HMYK+#?ae5HvA7qBG3b(uiy+F-TPE1%oyLKYI!Y_7Rop`eFM)IfZQCn*-QHdH)`!SWMe`r6T67{3AcfBJiLTuP1_Vi40CZltNW``7NR1l#= zorRu}A-s5F(`9gHA8Lq)b()@Ax*|!*bSi+A2GFkY4@U@IuPHa`b z14Ffuix{I*ZfL-!&(d^(%2y0B5(weSA3@hc9fIm&4-m_MJd4dvhP?|s#{H#6{RnM* zY2g9zMTjxqX62I+KZAB5`|rSur6;swoGC^6og!{I$EnBNgiaxfb(r>ORnif=!GlF8 znsR{bG>-X$DRj)Chg8tSDO7Zz$oI%%pYadBL7lpts7I(yoln#sraE;&QQu8<>WHGg znd)@l>FmXZf(in$0f=ZOKk^93azGFjGD^F_R4z1?=bFlwpo}00ZY!^4irOb530WVR z$|p_bUzy6Un#w;%*@%<&HyGtm(nBX4J!sU&)9mPs9Ds?2K0B#2`?>PLIiag#2sdq_I!^+ug^=tm9G zB-&hoK6EEsRE^WUv}oF^scGp@f|->*T+v}ldrON0l?#a8F@`H?6mS8xbC1z-X}qxi zeYATtmA4r$N64B(6W0A70KqH!Kco^FMPSXS>>r^L9Xt1rQi-k#_Wv7|=yb6EBP!8Z zcK>gwM90kiV|ekP@?-f%>ZUIxMnX?IjfCOQj$sz$ALy3QeIIDVko^Tnwd+A-c!28; z$j2!%YUTE$q&kKXoiuP+G2S^hpT8`&H;B6m+=Qd1BFRU&_F)=qKbfJUsQCzWGJ*PQ zpww)B0l*cSPC4TVDuq+=%M}U*_T>?}(+N9<)DnK{vxuLaX4#=zoxyLJ=)wv6=QFn0 z*mUPixjGRuPVRa;Is-S>O1fszkW^>TKvlD8`0_E0z4%#YvDO6V8)?MJFM?+1_eA_= zi7uJW#rZ^n^D%Jp=B5DS=uQ2b0(B}uvYCYI_Y&0da4mk8Ppgg_zmijNwLDNJs)Y%v zJfecP=Wfj!5Nh{MCAny7gVz#CElBtvqdQ4Dsc_rlRw)U6KfxD2lRjyxu;)nFOb8>7 zsUjMp>wOy1=d<#s#C1XlMjv|x#n8Y;;}8;Ah#+B1U(O5I`Joya?pTI9F-s5SSUSXY z7>#%O@TGGYm$1t@wMv6u96=Te$o*{TeB)Rm3z+?Wc7tQmfTn8qVD2!jOsB?h!>3)3 zyI}ZO0QV`+=cA|G#%FNUWdYBn0_r(5;e>WrlXqQ%+2A6)XF`7Ye4+-tAPfh;2O6PB#n~R?#ELu@ zIp6qxJR#8NmTD#^4E0*kG6G-lNt|8S&`LJ6p(hDqOT07eCQL&DLt=EhzeSh|V8ouL z8{f-epbZV29hyj1GR1j1w=a!#(`R#-Xm}x$$>d26_Ms-aDc|4eCO9ipQrB*05(!pP z2UBM%>fuSNQk zmi#_AI)w?c`5uo(j)=BQwzXY=E#>#|fm?jPFYfI(KHc+t-@XmuzD115tm^T78y+tn z`T>_V?vrAvH#O#{Lq@w#*{UsC6FQHkUKnmDJtb0Q&7x&F}m5 zN;`<7hr0y^EYYLn;PLmS`ithk#-6Ts@q3wtm`kjef)P3Yc}A$;PPa3x8!9QEqa8^>pxbP7nDQX9*-W_)99*c` zb3^DmpvG0mNG)a?xXf2&au&fGpi%V*ri!NS$cA=)Aeq*$4~qjEZnv}f^a@Q(8%!ZA z+6td(L!$+uiRlm|!*d(V%+Gl6*TATYh`94~MrSA0W^JU}@!(&mGwM)!(Mi=;GCE!W z@6WW*ICtoMV%h{B(rM|V;}|_upJKq8~Q}f=osS# zYevU&D9}^`Zwep)Es1+QwD>{Hf?SU-I8dmrv%G*EBkQ`C3w(s$$rp$Et>Dh>Lel8c zMW^;3MN7(PNgG-+KQvI#->utxap%$C->YT#P@2(kBjOp2Wc>7blGFspfBLKK7wmo& zA6aAbUVTA=s@=aKRMIEVkOK`l+I=)NXMnG%JLCDxj-wgR{|+o~&}ZH7?{sRgQk+dp zYl-O{G}7)vByQfD+>PYLBoX1y(Ta)S1rShwM;s=oRS)8jX`VnLRy)E-6Vn{@Y{0osS zfNBe{J6C75qljPFLG}EmZZ(+($ZQ}03Ln;TQKC~#=V`@?1_>{;;YUg}R`j@kGNdHw z#F&0-?&`;S5phBwI&DtzX>?zFf)1vK$I#GOXy}~KKyE)ej|H1J8X07m)*_LPaKCah zjV~cKoXiJSnMDf&9U&vb+|)2S^eDxjyU+n-7<(p*S;5cI(6Q+KMtmb=5cM?Lp&^9D zy*2#?e*yT_Y$F6mmD#GaGh6`ERj0c62pA#X5++@MGM zwvhZX<`V*)HH@RnEHdth_8WBT=)*=Ij^!0$E$Hr!Zxy*B@)nUl zAoA~s{5g@Y7kRhH>qOoz@?4QyM4l${Op)h{+$M4+a#`e7k>`kfa!8L~7O(5S!PDOV zXMJmZF-F}BD8E9hF!j>08|>7iG&RvC{(t<#{j@Wdi;3&Y=YL-WJnn|(#>Uz}t#j+O z^NS0e9uKRn^}Cwg0mbF#e<|Rqb$gq9j1zuye(`lW%`IDM*9xjKPkkWZ3V_e)Iu|F) zbF$PtoH&DC*S1zyqvCSPjy22W{CLgnba@qbliTH=$L7ig_$>Ol^UeZooW~j(w#j+U z#6Op}(dTq~n*m8>4bG-(gNvIB8>wYcsr9(MuG)r8JeNyKWP&xe)cb2&T<+!;h28Ag z-r6E>bt^5hNsx>`Yf*eY*;DUtcFFlrcawbWqDAvk&qwd{xdJl%^-Gf*$>*oEsa}zb z<$U^k3EAWF$|bN664;+1qx|+2TqQx5xSAnmlJ=VV?8O zKPwhn-A)AB2*jW6hu&z0fIpo-aJRcv-c;|uTW)rFUH*D>P580k>M3oX*H|E**~#Sk zKqGZIC-uFn7o;-Ype1q~0ttnrz`evrL8^@Hc zsa{R6(lr}cX(`f*^{bXufwa7=V%gfW`|47;w0wE(s%0B$D;!+BzkzLKzMxXu)GA+5 zBCoEltc2yMOqQ4Xyo$Gelj{aKFF^G&U+Z>1^==(Nkos1)Qty$M$rZfY1K})?uPVOE zROg)ap2nbu!XmG#-zMKy?+Kz`Z!O8Y)+x8}_cs3C&fiYG;?!%15JojeAUKp$U)QaZ zOMO8vAEXVwZ8AOQkx4AzDKpuDKO_@&a7O+*uN8v7D(H9duz*^(OV%xR#f=1|EN?J~ zzJQK`K~W~<=aom@;!3x-(GzsKkNty~^TR14sFfTB79(wv;P`j`lH$oETF3d_K2$M5r7}z7G z8EDwz@?!>$w1#OVDAu95WUEmd(yqVOHNte@v*jp{%Li?Lo8NK=HWE?N@^Jo?C-1|8|Z* zhoxB;BeY?=f-Z}xx8CXWy8;0@uT}3;)!w_kzO7!lHQ)+5eX`%>@io>fZXY0ipWS;EGod)Bg~Hfz#X(kzy}IE&;1PPZk) zKZ?cD=oGUo-5Qe0((MiD3-PW@Uy8SMEPW|ZGExQ7z%#K}qlvaia-^nPm-VMxmQT+F zo-VR8pN++`k+ZUNnPBZmxo5y011ujf`g~3g(LIG^Gr`Vhw+uS6+X`A0IoaJQmCi_! zwxzxd-{3I2V6{{i@!X8h^|{vhBV0*?!@gni2r_!9uX27Hkj z?@8b%0Y3r!CNo}gbAnvJa?!@~ejJO@r-69vq&0E;Qs6fNe{2eVD2}JIZsv2b7=DioJ1O9yW?*sn3 zz+Y*WUz^}R2z&(ihs}7YixZH2CxD;%d@NQBKjZC}JfGWd185TXD}Ne`dCmNeJ;@=9 z)Y!l5Fz-nu$Cix0vj*J?Go9q%dgxPGIq;7FpM&e&xSr+rCGW9>Qj(`%K%xdkw`4L% z6wu%EQY^L^vG8UVbB}{&2BS|v?CrP zhOxZp7qQp}Q}8D_o?;{e|0(dlL9EQSCci7`N&qH36`*^mFBYpuIZh|t8Q0SS{Aa-5 zF$J%8cH-X){MY(pG5*QXn9GuFysZfT6!2dkKwFymH*xV?{}JG;fUlm?*0*wgY9kH! z&X;4c3lNXEeMTGo5x$t(i1g)PQmHwDt6sA{S3=)n;GMub&3LIU?(YWRp920-bKH_2 zl8E4o=3L7^iZO$=qdGO+QZcAb8^eWV)wLAm4 z4T*eBdmVE#@q5yX)`Tp3lJAqG_fk1i>F2F|uMVDf*0ci|0B!iyw#fy9-np2>yLryVBv}a{{?uvA|Dm@npzRBNZ>1o(x z@CN2~kRI!svDgE|3#t`+q~)RHTT>}2%ccj?b8k(TA;pm{uT1Snub@4_Qjm5d)q#(4 zBkpn)d?@3Lx?-=cG7kL)uk-!V5ZImp|96NVdN-htI?xJaX)P~r)QN#UpYP;1r44VL zd;J6I|LL=Ihz6qmEIlSM`hP20O|WBt6}^?9F=#122>3CiQKV0hQjbb(Hc}B%C6W{A zUZifM{YdmYi@Xo%DAF*}?~o>uF8HOy(vfnIY)A!2*CXA8RDo25^bI5@k_Sma+KIFW z=|QBwMEWk$Q%KJu9Yh*HdIRZgq?1UaNT-n)e4^*SyZvvna+k-YxXS!)#obu%S%%5=D^-49BhEqWv!t6{N@aaOarpf{KVuh3sIT%lgC18!z1Qh+ zEyExn7%?o<4^NE!tF*!kZS@|UbcBC5t%AL8}6P82g0*;io&ShPY^Kb}5_c-Co?r1=uRoTWf1w-YsrF zoM&tFdK3LmGmJH&7H}!G^{uV7%Jx=3!mO6=EBy+4l+`x65E1+*C`q+$UjzQ)HL2Ez zOGi2bIdV``J?q*x1CdGxT*zHo& zRx~a!Ka_9>(Ac`2v44;RGkZ<~GwxOUq=38GTkm1)Who$#|0o3%f8(ZB#$M+o;(Uur zxQk)zmsIi+dQ{qC7{eHi`#&MAbgW(NsJ!l4ej|+Wlm*`ZAJV44mPWr~SjC6>m#@!@ mz_oVvOtJm*D89t~4~@WOW2Gz?sj}V9EcgZ2m(TyM2>d6!D%8XP literal 0 HcmV?d00001 diff --git a/Marlin/scripts/Fonts/make_fonts.bat b/Marlin/scripts/Fonts/make_fonts.bat new file mode 100644 index 000000000..125deb2eb --- /dev/null +++ b/Marlin/scripts/Fonts/make_fonts.bat @@ -0,0 +1,6 @@ +.\bdf2u8g.exe -b 1 -e 9 Marlin_symbols.bdf Marlin_symbols dogm_font_data_Marlin_symbols.h +.\bdf2u8g.exe -b 16 -e 255 HD44780_W.bdf HD44780_W_5x7 dogm_font_data_HD44780_W.h +.\bdf2u8g.exe -b 32 -e 255 HD44780_C.bdf HD44780_C_5x7 dogm_font_data_HD44780_C.h +.\bdf2u8g.exe -b 32 -e 255 HD44780_J.bdf HD44780_J_5x7 dogm_font_data_HD44780_J.h +.\bdf2u8g.exe -b 32 -e 255 ISO10646_5_Cyrillic.bdf ISO10646_5_Cyrillic_5x7 dogm_font_data_ISO10646_5_Cyrillic.h +.\bdf2u8g.exe -b 32 -e 255 ISO10646_Kana.bdf ISO10646_Kana_5x7 dogm_font_data_ISO10646_Kana.h From 16e173e167fd758efdf973ef6542a98b9ccf15d6 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 7 Mar 2015 00:09:49 +0100 Subject: [PATCH 003/302] Added 5 new font.h files to main directory. The former place of 'dogm_font_data_6x9_marlin.h' was in 'dogm_font_data_m0arlin.h'. Deleted 'dogm_font_data_marlin.h'. --- Marlin/dogm_font_data_6x9_marlin.h | 157 +++++++++ Marlin/dogm_font_data_HD44780_C.h | 171 ++++++++++ Marlin/dogm_font_data_HD44780_J.h | 169 ++++++++++ Marlin/dogm_font_data_HD44780_W.h | 203 ++++++++++++ Marlin/dogm_font_data_ISO10646_5_Cyrillic.h | 173 ++++++++++ Marlin/dogm_font_data_ISO10646_Kana.h | 173 ++++++++++ Marlin/dogm_font_data_Marlin_symbols.h | 22 ++ Marlin/dogm_font_data_marlin.h | 337 -------------------- 8 files changed, 1068 insertions(+), 337 deletions(-) create mode 100644 Marlin/dogm_font_data_6x9_marlin.h create mode 100644 Marlin/dogm_font_data_HD44780_C.h create mode 100644 Marlin/dogm_font_data_HD44780_J.h create mode 100644 Marlin/dogm_font_data_HD44780_W.h create mode 100644 Marlin/dogm_font_data_ISO10646_5_Cyrillic.h create mode 100644 Marlin/dogm_font_data_ISO10646_Kana.h create mode 100644 Marlin/dogm_font_data_Marlin_symbols.h delete mode 100644 Marlin/dogm_font_data_marlin.h diff --git a/Marlin/dogm_font_data_6x9_marlin.h b/Marlin/dogm_font_data_6x9_marlin.h new file mode 100644 index 000000000..a3b16ecb4 --- /dev/null +++ b/Marlin/dogm_font_data_6x9_marlin.h @@ -0,0 +1,157 @@ +/* + Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1 + Copyright: Public domain font. Share and enjoy. + Capital A Height: 6, '1' Height: 6 + Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 7 len= 9 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 + Pure Font ascent = 6 descent=-2 + X Font ascent = 6 descent=-2 + Max Font ascent = 7 descent=-2 +*/ +#include +const u8g_fntpgm_uint8_t u8g_font_6x9[2300] U8G_SECTION(".progmem.u8g_font_6x9") = { + 0,6,9,0,254,6,1,137,2,254,32,255,254,7,254,6, + 254,0,0,0,6,0,7,1,6,6,6,2,0,128,128,128, + 128,0,128,3,3,3,6,1,3,160,160,160,5,7,7,6, + 0,255,80,80,248,80,248,80,80,5,9,9,6,0,254,32, + 112,168,160,112,40,168,112,32,6,8,8,6,0,255,64,168, + 72,16,32,72,84,8,5,7,7,6,0,255,96,144,144,96, + 152,144,104,1,3,3,6,2,3,128,128,128,2,7,7,6, + 2,255,64,128,128,128,128,128,64,2,7,7,6,2,255,128, + 64,64,64,64,64,128,5,5,5,6,0,0,136,80,248,80, + 136,5,5,5,6,0,0,32,32,248,32,32,2,4,4,6, + 2,254,192,64,64,128,5,1,1,6,0,2,248,2,2,2, + 6,2,0,192,192,4,6,6,6,1,0,16,16,32,64,128, + 128,4,6,6,6,1,0,96,144,144,144,144,96,3,6,6, + 6,1,0,64,192,64,64,64,224,4,6,6,6,1,0,96, + 144,16,32,64,240,4,6,6,6,1,0,240,32,96,16,16, + 224,5,6,6,6,0,0,16,48,80,144,248,16,4,6,6, + 6,1,0,240,128,224,16,16,224,4,6,6,6,1,0,96, + 128,224,144,144,96,4,6,6,6,1,0,240,16,16,32,64, + 64,4,6,6,6,1,0,96,144,96,144,144,96,4,6,6, + 6,1,0,96,144,144,112,16,96,2,5,5,6,2,0,192, + 192,0,192,192,2,7,7,6,2,254,192,192,0,192,64,64, + 128,5,5,5,6,0,0,24,96,128,96,24,5,3,3,6, + 0,1,248,0,248,5,5,5,6,0,0,192,48,8,48,192, + 4,7,7,6,1,0,96,144,16,96,64,0,64,5,6,6, + 6,0,0,112,144,168,176,128,112,5,6,6,6,0,0,32, + 80,136,248,136,136,5,6,6,6,0,0,240,136,240,136,136, + 240,4,6,6,6,1,0,96,144,128,128,144,96,4,6,6, + 6,1,0,224,144,144,144,144,224,4,6,6,6,1,0,240, + 128,224,128,128,240,4,6,6,6,1,0,240,128,224,128,128, + 128,4,6,6,6,1,0,96,144,128,176,144,96,4,6,6, + 6,1,0,144,144,240,144,144,144,3,6,6,6,1,0,224, + 64,64,64,64,224,5,6,6,6,0,0,56,16,16,16,144, + 96,4,6,6,6,1,0,144,160,192,160,144,144,4,6,6, + 6,1,0,128,128,128,128,128,240,5,6,6,6,0,0,136, + 216,168,168,136,136,4,6,6,6,1,0,144,208,176,144,144, + 144,5,6,6,6,0,0,112,136,136,136,136,112,4,6,6, + 6,1,0,224,144,144,224,128,128,4,7,7,6,1,255,96, + 144,144,208,176,96,16,4,6,6,6,1,0,224,144,144,224, + 144,144,4,6,6,6,1,0,96,144,64,32,144,96,5,6, + 6,6,0,0,248,32,32,32,32,32,4,6,6,6,1,0, + 144,144,144,144,144,96,4,6,6,6,1,0,144,144,144,240, + 96,96,5,6,6,6,0,0,136,136,168,168,216,136,5,6, + 6,6,0,0,136,80,32,32,80,136,5,6,6,6,0,0, + 136,136,80,32,32,32,4,6,6,6,1,0,240,16,32,64, + 128,240,3,6,6,6,1,0,224,128,128,128,128,224,4,6, + 6,6,1,0,128,128,64,32,16,16,3,6,6,6,1,0, + 224,32,32,32,32,224,5,3,3,6,0,3,32,80,136,5, + 1,1,6,0,254,248,2,2,2,6,2,4,128,64,4,4, + 4,6,1,0,112,144,144,112,4,6,6,6,1,0,128,128, + 224,144,144,224,4,4,4,6,1,0,112,128,128,112,4,6, + 6,6,1,0,16,16,112,144,144,112,4,4,4,6,1,0, + 96,176,192,112,4,6,6,6,1,0,32,80,64,224,64,64, + 4,6,6,6,1,254,96,144,144,112,16,96,4,6,6,6, + 1,0,128,128,224,144,144,144,3,6,6,6,1,0,64,0, + 192,64,64,224,3,8,8,6,1,254,32,0,96,32,32,32, + 160,64,4,6,6,6,1,0,128,128,160,192,160,144,3,6, + 6,6,1,0,192,64,64,64,64,224,5,4,4,6,0,0, + 208,168,168,136,4,4,4,6,1,0,224,144,144,144,4,4, + 4,6,1,0,96,144,144,96,4,6,6,6,1,254,224,144, + 144,224,128,128,4,6,6,6,1,254,112,144,144,112,16,16, + 4,4,4,6,1,0,160,208,128,128,4,4,4,6,1,0, + 112,192,48,224,4,6,6,6,1,0,64,64,224,64,80,32, + 4,4,4,6,1,0,144,144,144,112,4,4,4,6,1,0, + 144,144,96,96,5,4,4,6,0,0,136,168,168,80,4,4, + 4,6,1,0,144,96,96,144,4,6,6,6,1,254,144,144, + 144,112,144,96,4,4,4,6,1,0,240,32,64,240,3,7, + 7,6,1,0,32,64,64,128,64,64,32,1,7,7,6,2, + 255,128,128,128,128,128,128,128,3,7,7,6,1,0,128,64, + 64,32,64,64,128,4,2,2,6,1,3,80,160,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0, + 0,6,0,7,1,6,6,6,2,0,128,0,128,128,128,128, + 4,6,6,6,1,255,32,112,160,160,112,32,5,7,7,6, + 0,255,48,72,64,240,64,64,248,5,5,5,6,0,0,168, + 80,136,80,168,5,6,6,6,0,0,136,80,248,32,248,32, + 1,7,7,6,2,255,128,128,128,0,128,128,128,4,7,7, + 6,1,255,112,128,96,144,96,16,224,3,1,1,6,1,5, + 160,6,7,7,6,0,0,120,132,148,164,148,132,120,3,5, + 5,6,1,1,96,160,96,0,224,5,5,5,6,0,0,40, + 80,160,80,40,4,3,3,6,1,0,240,16,16,4,1,1, + 6,1,2,240,6,7,7,6,0,0,120,132,180,164,164,132, + 120,4,1,1,6,1,5,240,4,3,3,6,1,2,96,144, + 96,5,7,7,6,0,255,32,32,248,32,32,0,248,3,5, + 5,6,1,1,64,160,32,64,224,3,5,5,6,1,1,192, + 32,64,32,192,2,2,2,6,2,4,64,128,4,5,5,6, + 1,255,144,144,176,208,128,5,6,6,6,0,0,120,232,232, + 104,40,40,1,1,1,6,2,2,128,2,2,2,6,2,254, + 64,128,3,5,5,6,1,1,64,192,64,64,224,3,5,5, + 6,1,1,64,160,64,0,224,5,5,5,6,0,0,160,80, + 40,80,160,5,8,8,6,0,255,64,192,64,80,112,48,120, + 16,5,8,8,6,0,255,64,192,64,80,104,8,16,56,5, + 8,8,6,0,255,192,32,64,48,240,48,120,16,4,7,7, + 6,1,0,32,0,32,96,128,144,96,5,7,7,6,0,0, + 64,32,32,80,112,136,136,5,7,7,6,0,0,16,32,32, + 80,112,136,136,5,7,7,6,0,0,32,80,32,80,112,136, + 136,5,7,7,6,0,0,40,80,32,80,112,136,136,5,7, + 7,6,0,0,80,0,32,80,112,136,136,5,7,7,6,0, + 0,32,80,32,80,112,136,136,5,6,6,6,0,0,120,160, + 240,160,160,184,4,8,8,6,1,254,96,144,128,128,144,96, + 32,64,4,7,7,6,1,0,64,32,240,128,224,128,240,4, + 7,7,6,1,0,32,64,240,128,224,128,240,4,7,7,6, + 1,0,32,80,240,128,224,128,240,4,7,7,6,1,0,80, + 0,240,128,224,128,240,3,7,7,6,1,0,128,64,224,64, + 64,64,224,3,7,7,6,1,0,32,64,224,64,64,64,224, + 3,7,7,6,1,0,64,160,224,64,64,64,224,3,7,7, + 6,1,0,160,0,224,64,64,64,224,5,6,6,6,0,0, + 112,72,232,72,72,112,4,7,7,6,1,0,80,160,144,208, + 176,144,144,4,7,7,6,1,0,64,32,96,144,144,144,96, + 4,7,7,6,1,0,32,64,96,144,144,144,96,4,7,7, + 6,1,0,32,80,96,144,144,144,96,4,7,7,6,1,0, + 80,160,96,144,144,144,96,4,7,7,6,1,0,80,0,96, + 144,144,144,96,5,5,5,6,0,0,136,80,32,80,136,4, + 8,8,6,1,255,16,112,176,176,208,208,224,128,4,7,7, + 6,1,0,64,32,144,144,144,144,96,4,7,7,6,1,0, + 32,64,144,144,144,144,96,4,7,7,6,1,0,32,80,144, + 144,144,144,96,4,7,7,6,1,0,80,0,144,144,144,144, + 96,5,7,7,6,0,0,16,32,136,80,32,32,32,4,6, + 6,6,1,0,128,224,144,144,224,128,4,6,6,6,1,0, + 96,144,160,160,144,160,4,7,7,6,1,0,64,32,0,112, + 144,144,112,4,7,7,6,1,0,32,64,0,112,144,144,112, + 4,7,7,6,1,0,32,80,0,112,144,144,112,4,7,7, + 6,1,0,80,160,0,112,144,144,112,4,6,6,6,1,0, + 80,0,112,144,144,112,4,7,7,6,1,0,32,80,32,112, + 144,144,112,5,4,4,6,0,0,112,168,176,120,4,6,6, + 6,1,254,112,128,128,112,32,64,4,7,7,6,1,0,64, + 32,0,96,176,192,112,4,7,7,6,1,0,32,64,0,96, + 176,192,112,4,7,7,6,1,0,32,80,0,96,176,192,112, + 4,6,6,6,1,0,80,0,96,176,192,112,3,7,7,6, + 1,0,128,64,0,192,64,64,224,3,7,7,6,1,0,32, + 64,0,192,64,64,224,3,7,7,6,1,0,64,160,0,192, + 64,64,224,3,6,6,6,1,0,160,0,192,64,64,224,4, + 7,7,6,1,0,48,96,16,112,144,144,96,4,7,7,6, + 1,0,80,160,0,224,144,144,144,4,7,7,6,1,0,64, + 32,0,96,144,144,96,4,7,7,6,1,0,32,64,0,96, + 144,144,96,4,7,7,6,1,0,32,80,0,96,144,144,96, + 4,7,7,6,1,0,80,160,0,96,144,144,96,4,6,6, + 6,1,0,80,0,96,144,144,96,5,5,5,6,0,0,32, + 0,248,0,32,4,4,4,6,1,0,112,176,208,224,4,7, + 7,6,1,0,64,32,0,144,144,144,112,4,7,7,6,1, + 0,32,64,0,144,144,144,112,4,7,7,6,1,0,32,80, + 0,144,144,144,112,4,6,6,6,1,0,80,0,144,144,144, + 112,4,9,9,6,1,254,32,64,0,144,144,144,112,144,96, + 4,8,8,6,1,254,128,128,224,144,144,224,128,128,4,8, + 8,6,1,254,80,0,144,144,144,112,144,96}; diff --git a/Marlin/dogm_font_data_HD44780_C.h b/Marlin/dogm_font_data_HD44780_C.h new file mode 100644 index 000000000..b4e3ff197 --- /dev/null +++ b/Marlin/dogm_font_data_HD44780_C.h @@ -0,0 +1,171 @@ +/* + Fontname: HD44780_C + Copyright: A. Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w= 5 h= 8 x= 2 y= 8 dx= 6 dy= 0 ascent= 8 len= 8 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent = 8 descent=-1 +*/ +#include +const u8g_fntpgm_uint8_t HD44780_C_5x7[2520] U8G_SECTION(".progmem.HD44780_C_5x7") = { + 0,6,9,0,254,7,1,145,3,34,32,255,255,8,255,7, + 255,0,0,0,6,0,8,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, + 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, + 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, + 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, + 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, + 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, + 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, + 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, + 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, + 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, + 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, + 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, + 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, + 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, + 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, + 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, + 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, + 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, + 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, + 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, + 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, + 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, + 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, + 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, + 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, + 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, + 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, + 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, + 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, + 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, + 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, + 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, + 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, + 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, + 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, + 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, + 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, + 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, + 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, + 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, + 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, + 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, + 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, + 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, + 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, + 5,7,7,6,0,0,32,112,160,160,168,112,32,3,7,7, + 6,1,0,224,32,32,32,32,32,224,5,3,3,6,0,4, + 32,80,136,5,1,1,6,0,0,248,2,2,2,6,2,5, + 128,64,5,5,5,6,0,0,112,8,120,136,120,5,7,7, + 6,0,0,128,128,176,200,136,136,240,5,5,5,6,0,0, + 112,128,128,136,112,5,7,7,6,0,0,8,8,104,152,136, + 136,120,5,5,5,6,0,0,112,136,248,128,112,5,7,7, + 6,0,0,48,72,224,64,64,64,64,5,6,6,6,0,255, + 112,136,136,120,8,112,5,7,7,6,0,0,128,128,176,200, + 136,136,136,1,7,7,6,2,0,128,0,128,128,128,128,128, + 3,8,8,6,1,255,32,0,32,32,32,32,160,64,4,7, + 7,6,0,0,128,128,144,160,192,160,144,3,7,7,6,1, + 0,192,64,64,64,64,64,224,5,5,5,6,0,0,208,168, + 168,168,168,5,5,5,6,0,0,176,200,136,136,136,5,5, + 5,6,0,0,112,136,136,136,112,5,6,6,6,0,255,240, + 136,136,240,128,128,5,6,6,6,0,255,120,136,136,120,8, + 8,5,5,5,6,0,0,176,200,128,128,128,5,5,5,6, + 0,0,112,128,112,8,240,5,7,7,6,0,0,64,64,224, + 64,64,72,48,5,5,5,6,0,0,136,136,136,152,104,5, + 5,5,6,0,0,136,136,136,80,32,5,5,5,6,0,0, + 136,136,168,168,80,5,5,5,6,0,0,136,80,32,80,136, + 5,6,6,6,0,255,136,136,136,120,8,112,5,5,5,6, + 0,0,248,16,32,64,248,5,5,5,6,0,2,184,168,168, + 168,184,5,5,5,6,0,2,184,136,184,160,184,5,5,5, + 6,0,2,184,160,184,136,184,5,6,6,6,0,1,8,40, + 72,248,64,32,5,5,5,6,0,0,56,112,224,136,240,0, + 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, + 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, + 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,0, + 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, + 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, + 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,0, + 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, + 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, + 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,0, + 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, + 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, + 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,5, + 7,7,6,0,0,248,136,128,240,136,136,240,5,7,7,6, + 0,0,248,136,128,128,128,128,128,5,7,7,6,0,0,80, + 0,248,128,240,128,248,5,7,7,6,0,0,168,168,168,112, + 168,168,168,5,7,7,6,0,0,240,8,8,112,8,8,240, + 5,7,7,6,0,0,136,136,152,168,200,136,136,5,8,8, + 6,0,0,80,32,136,152,168,168,200,136,5,7,7,6,0, + 0,120,40,40,40,40,168,72,5,7,7,6,0,0,248,136, + 136,136,136,136,136,5,7,7,6,0,0,136,136,136,80,32, + 64,128,5,7,7,6,0,0,32,112,168,168,168,112,32,5, + 7,7,6,0,0,136,136,136,120,8,8,8,5,7,7,6, + 0,0,168,168,168,168,168,168,248,5,7,7,6,0,0,192, + 64,64,112,72,72,112,5,7,7,6,0,0,136,136,136,200, + 168,168,200,5,7,7,6,0,0,112,136,8,112,8,136,112, + 5,7,7,6,0,0,144,168,168,232,168,168,144,5,7,7, + 6,0,0,120,136,136,120,40,72,136,5,7,7,6,0,0, + 24,96,128,240,136,136,112,4,5,5,6,0,0,224,144,224, + 144,224,5,5,5,6,0,0,248,136,128,128,128,5,7,7, + 6,0,0,80,0,112,136,248,128,112,5,5,5,6,0,0, + 168,168,112,168,168,5,5,5,6,0,0,240,8,48,8,240, + 5,5,5,6,0,0,136,152,168,200,136,5,7,7,6,0, + 0,80,32,136,152,168,200,136,4,5,5,6,0,0,144,160, + 192,160,144,5,5,5,6,0,0,248,40,40,168,72,5,5, + 5,6,0,0,136,216,168,136,136,5,5,5,6,0,0,136, + 136,248,136,136,5,5,5,6,0,0,248,136,136,136,136,5, + 5,5,6,0,0,248,32,32,32,32,5,5,5,6,0,0, + 136,136,120,8,8,5,5,5,6,0,0,168,168,168,168,248, + 5,5,5,6,0,0,192,64,112,72,112,5,5,5,6,0, + 0,136,136,200,168,200,4,5,5,6,0,0,128,128,224,144, + 224,5,5,5,6,0,0,112,136,56,136,112,5,5,5,6, + 0,0,144,168,232,168,144,5,5,5,6,0,0,120,136,120, + 40,72,5,5,5,6,0,1,32,72,144,72,32,5,5,5, + 6,0,1,32,144,72,144,32,5,3,3,6,0,0,72,144, + 216,5,3,3,6,0,4,216,72,144,5,7,7,6,0,0, + 144,208,176,144,56,40,56,5,7,7,6,0,0,32,0,32, + 64,128,136,112,5,7,7,6,0,0,24,32,32,112,32,32, + 192,5,7,7,6,0,0,32,80,64,240,64,64,120,1,2, + 2,6,2,0,128,128,1,4,4,6,2,0,128,128,128,128, + 3,5,5,6,1,0,160,160,160,0,224,3,5,5,6,1, + 0,160,160,160,0,160,5,7,7,6,0,0,160,0,232,16, + 32,64,128,5,5,5,6,0,1,216,112,32,112,216,5,7, + 7,6,0,0,160,64,168,16,32,64,128,3,6,6,6,1, + 1,224,64,64,64,64,224,5,6,6,6,0,1,248,80,80, + 80,80,248,5,7,7,6,0,0,32,112,168,32,32,32,32, + 5,7,7,6,0,0,32,32,32,32,168,112,32,5,7,7, + 6,0,0,128,144,176,248,176,144,128,5,7,7,6,0,0, + 8,72,104,248,104,72,8,5,7,7,6,0,0,128,136,168, + 248,168,136,128,5,7,7,6,0,0,128,224,136,16,32,64, + 128,2,2,2,6,2,2,192,192,5,8,8,6,0,255,120, + 40,40,40,72,136,248,136,5,8,8,6,0,255,136,136,136, + 136,136,136,248,8,5,8,8,6,0,255,168,168,168,168,168, + 168,248,8,5,6,6,6,0,0,120,40,72,136,248,136,5, + 7,7,6,0,0,32,32,112,168,168,112,32,5,6,6,6, + 0,255,136,136,136,136,248,8,5,6,6,6,0,255,168,168, + 168,168,248,8,2,2,2,6,2,6,64,128,3,1,1,6, + 1,7,160,5,2,2,6,0,6,72,176,5,8,8,6,0, + 0,16,32,0,112,136,248,128,112,5,6,6,6,0,255,112, + 128,136,112,32,96,3,7,7,6,1,0,160,0,160,160,160, + 32,192,5,6,6,6,0,1,32,112,112,112,248,32,5,5, + 5,6,0,1,80,0,136,0,80,5,5,5,6,0,1,112, + 136,136,136,112,5,7,7,6,0,0,136,144,168,88,184,8, + 8,5,7,7,6,0,0,136,144,184,72,152,32,56,5,8, + 8,6,0,0,192,64,192,72,216,56,8,8,5,7,7,6, + 0,0,136,248,136,248,136,248,136,4,5,5,6,0,2,192, + 0,48,0,96,5,8,8,6,0,0,64,160,224,168,8,40, + 120,32,5,8,8,6,0,0,64,112,64,120,64,112,64,224, + 5,8,8,6,0,0,64,112,64,120,64,112,64,224,5,8, + 8,6,0,0,32,112,32,248,32,112,32,112,5,7,7,6, + 0,0,104,0,232,0,104,16,56,5,7,7,6,0,0,112, + 16,240,16,112,16,56,5,7,7,6,0,0,32,112,32,248, + 32,112,32,5,7,7,6,0,0,16,144,80,48,80,144,56, + 5,8,8,6,0,0,48,72,32,80,80,32,144,96,5,7, + 7,6,0,0,120,168,168,120,40,40,40,5,7,7,6,0, + 0,248,248,248,248,248,248,248}; diff --git a/Marlin/dogm_font_data_HD44780_J.h b/Marlin/dogm_font_data_HD44780_J.h new file mode 100644 index 000000000..84f568161 --- /dev/null +++ b/Marlin/dogm_font_data_HD44780_J.h @@ -0,0 +1,169 @@ +/* + Fontname: HD44780_J + Copyright: A. Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w= 6 h=10 x= 2 y= 8 dx= 6 dy= 0 ascent= 8 len= 8 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent = 8 descent=-2 +*/ +#include +const u8g_fntpgm_uint8_t HD44780_J_5x7[2491] U8G_SECTION(".progmem.HD44780_J_5x7") = { + 0,6,9,0,254,7,1,145,3,34,32,255,255,8,254,7, + 255,0,0,0,6,0,8,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, + 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, + 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, + 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, + 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, + 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, + 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, + 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, + 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, + 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, + 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, + 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, + 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, + 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, + 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, + 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, + 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, + 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, + 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, + 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, + 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, + 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, + 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, + 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, + 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, + 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, + 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, + 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, + 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, + 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, + 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, + 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, + 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, + 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, + 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, + 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, + 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, + 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, + 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, + 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, + 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, + 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, + 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, + 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, + 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, + 5,7,7,6,0,0,136,80,248,32,248,32,32,3,7,7, + 6,1,0,224,32,32,32,32,32,224,5,3,3,6,0,4, + 32,80,136,5,1,1,6,0,0,248,2,2,2,6,2,5, + 128,64,5,5,5,6,0,0,112,8,120,136,120,5,7,7, + 6,0,0,128,128,176,200,136,136,240,5,5,5,6,0,0, + 112,128,128,136,112,5,7,7,6,0,0,8,8,104,152,136, + 136,120,5,5,5,6,0,0,112,136,248,128,112,5,7,7, + 6,0,0,48,72,224,64,64,64,64,5,6,6,6,0,255, + 112,136,136,120,8,112,5,7,7,6,0,0,128,128,176,200, + 136,136,136,1,7,7,6,2,0,128,0,128,128,128,128,128, + 3,8,8,6,1,255,32,0,32,32,32,32,160,64,4,7, + 7,6,0,0,128,128,144,160,192,160,144,3,7,7,6,1, + 0,192,64,64,64,64,64,224,5,5,5,6,0,0,208,168, + 168,168,168,5,5,5,6,0,0,176,200,136,136,136,5,5, + 5,6,0,0,112,136,136,136,112,5,6,6,6,0,255,240, + 136,136,240,128,128,5,6,6,6,0,255,120,136,136,120,8, + 8,5,5,5,6,0,0,176,200,128,128,128,5,5,5,6, + 0,0,112,128,112,8,240,5,7,7,6,0,0,64,64,224, + 64,64,72,48,5,5,5,6,0,0,136,136,136,152,104,5, + 5,5,6,0,0,136,136,136,80,32,5,5,5,6,0,0, + 136,136,168,168,80,5,5,5,6,0,0,136,80,32,80,136, + 5,6,6,6,0,255,136,136,136,120,8,112,5,5,5,6, + 0,0,248,16,32,64,248,3,7,7,6,1,0,32,64,64, + 128,64,64,32,1,7,7,6,2,0,128,128,128,128,128,128, + 128,3,7,7,6,1,0,128,64,64,32,64,64,128,5,5, + 5,6,0,1,32,16,248,16,32,5,5,5,6,0,1,32, + 64,248,64,32,0,0,0,6,0,8,0,0,0,6,0,8, + 0,0,0,6,0,8,0,0,0,6,0,8,0,0,0,6, + 0,8,0,0,0,6,0,8,0,0,0,6,0,8,0,0, + 0,6,0,8,0,0,0,6,0,8,0,0,0,6,0,8, + 0,0,0,6,0,8,0,0,0,6,0,8,0,0,0,6, + 0,8,0,0,0,6,0,8,0,0,0,6,0,8,0,0, + 0,6,0,8,0,0,0,6,0,8,0,0,0,6,0,8, + 0,0,0,6,0,8,0,0,0,6,0,8,0,0,0,6, + 0,8,0,0,0,6,0,8,0,0,0,6,0,8,0,0, + 0,6,0,8,0,0,0,6,0,8,0,0,0,6,0,8, + 0,0,0,6,0,8,0,0,0,6,0,8,0,0,0,6, + 0,8,0,0,0,6,0,8,0,0,0,6,0,8,0,0, + 0,6,0,8,0,0,0,6,0,8,3,3,3,6,0,0, + 224,160,224,3,4,4,6,2,3,224,128,128,128,3,4,4, + 6,0,0,32,32,32,224,3,3,3,6,0,0,128,64,32, + 2,2,2,6,1,2,192,192,5,6,6,6,0,0,248,8, + 248,8,16,32,5,5,5,6,0,0,248,8,48,32,64,4, + 5,5,6,0,0,16,32,96,160,32,5,5,5,6,0,0, + 32,248,136,8,48,5,4,4,6,0,0,248,32,32,248,5, + 5,5,6,0,0,16,248,48,80,144,5,5,5,6,0,0, + 64,248,72,80,64,5,4,4,6,0,0,112,16,16,248,4, + 5,5,6,0,0,240,16,240,16,240,5,4,4,6,0,0, + 168,168,8,48,5,1,1,6,0,4,248,5,7,7,6,0, + 0,248,8,40,48,32,32,64,5,7,7,6,0,0,8,16, + 32,96,160,32,32,5,7,7,6,0,0,32,248,136,136,8, + 16,32,5,6,6,6,0,0,248,32,32,32,32,248,5,7, + 7,6,0,0,16,248,16,48,80,144,16,5,7,7,6,0, + 0,64,248,72,72,72,72,144,5,7,7,6,0,0,32,248, + 32,248,32,32,32,5,6,6,6,0,0,120,72,136,8,16, + 96,5,7,7,6,0,0,64,120,144,16,16,16,32,5,6, + 6,6,0,0,248,8,8,8,8,248,5,7,7,6,0,0, + 80,248,80,80,16,32,64,5,6,6,6,0,0,192,8,200, + 8,16,224,5,6,6,6,0,0,248,8,16,32,80,136,5, + 7,7,6,0,0,64,248,72,80,64,64,56,5,6,6,6, + 0,0,136,136,72,8,16,96,5,6,6,6,0,0,120,72, + 168,24,16,96,5,7,7,6,0,0,16,224,32,248,32,32, + 64,5,6,6,6,0,0,168,168,168,8,16,32,5,7,7, + 6,0,0,112,0,248,32,32,32,64,3,7,7,6,1,0, + 128,128,128,192,160,128,128,5,7,7,6,0,0,32,32,248, + 32,32,64,128,5,6,6,6,0,0,112,0,0,0,0,248, + 5,6,6,6,0,0,248,8,80,32,80,128,5,6,6,6, + 0,1,32,248,16,32,112,168,3,7,7,6,1,0,32,32, + 32,32,32,64,128,5,6,6,6,0,0,32,16,136,136,136, + 136,5,7,7,6,0,0,128,128,248,128,128,128,120,5,6, + 6,6,0,0,248,8,8,8,16,96,5,5,5,6,0,1, + 64,160,16,8,8,5,7,7,6,0,0,32,248,32,32,168, + 168,32,5,6,6,6,0,0,248,8,8,80,32,16,4,6, + 6,6,1,0,224,0,224,0,224,16,5,6,6,6,0,0, + 32,64,128,136,248,8,5,6,6,6,0,0,8,8,80,32, + 80,128,5,6,6,6,0,0,248,64,248,64,64,56,5,7, + 7,6,0,0,64,64,248,72,80,64,64,5,7,7,6,0, + 0,112,16,16,16,16,16,248,5,6,6,6,0,0,248,8, + 248,8,8,248,5,7,7,6,0,0,112,0,248,8,8,16, + 32,4,7,7,6,0,0,144,144,144,144,16,32,64,5,6, + 6,6,0,0,32,160,160,168,168,176,5,7,7,6,0,0, + 128,128,128,136,144,160,192,5,6,6,6,0,0,248,136,136, + 136,136,248,5,6,6,6,0,0,248,136,136,8,16,32,5, + 6,6,6,0,0,192,0,8,8,16,224,4,3,3,6,0, + 4,32,144,64,3,3,3,6,0,4,224,160,224,5,5,5, + 6,0,1,72,168,144,144,104,5,7,7,6,0,0,80,0, + 112,8,120,136,120,4,8,8,6,1,255,96,144,144,224,144, + 144,224,128,5,5,5,6,0,0,112,128,96,136,112,5,6, + 6,6,0,255,136,136,152,232,136,128,5,5,5,6,0,0, + 120,160,144,136,112,5,7,7,6,0,254,48,72,136,136,240, + 128,128,5,8,8,6,0,254,120,136,136,136,120,8,8,112, + 5,5,5,6,0,1,56,32,32,160,64,4,3,3,6,0, + 3,16,208,16,4,8,8,6,0,255,16,0,48,16,16,16, + 144,96,3,3,3,6,0,4,160,64,160,5,7,7,6,0, + 0,32,112,160,160,168,112,32,5,7,7,6,0,0,64,64, + 224,64,224,64,120,5,7,7,6,0,0,112,0,176,200,136, + 136,136,5,7,7,6,0,0,80,0,112,136,136,136,112,5, + 7,7,6,0,255,176,200,136,136,240,128,128,5,7,7,6, + 0,255,104,152,136,136,120,8,8,5,6,6,6,0,0,112, + 136,248,136,136,112,5,3,3,6,0,2,88,168,208,5,5, + 5,6,0,0,112,136,136,80,216,5,7,7,6,0,0,80, + 0,136,136,136,152,104,5,7,7,6,0,0,248,128,64,32, + 64,128,248,5,5,5,6,0,0,248,80,80,80,152,5,7, + 7,6,0,0,248,0,136,80,32,80,136,5,7,7,6,0, + 255,136,136,136,136,120,8,112,5,6,6,6,0,1,8,240, + 32,248,32,32,5,5,5,6,0,0,248,64,120,72,136,5, + 5,5,6,0,0,248,168,248,136,136,5,5,5,6,0,1, + 32,0,248,0,32,0,0,0,6,0,8,6,10,10,6,0, + 254,252,252,252,252,252,252,252,252,252,252}; diff --git a/Marlin/dogm_font_data_HD44780_W.h b/Marlin/dogm_font_data_HD44780_W.h new file mode 100644 index 000000000..2a52429a6 --- /dev/null +++ b/Marlin/dogm_font_data_HD44780_W.h @@ -0,0 +1,203 @@ +/* + Fontname: HD44780_W + Copyright: A.Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent = 8 descent=-1 +*/ +#include +const u8g_fntpgm_uint8_t HD44780_W_5x7[3034] U8G_SECTION(".progmem.HD44780_W_5x7") = { + 0,6,9,0,254,7,2,79,3,222,16,255,255,8,255,7, + 255,4,7,7,6,0,0,16,48,112,240,112,48,16,4,7, + 7,6,1,0,128,192,224,240,224,192,128,5,3,3,6,0, + 4,216,72,144,5,3,3,6,0,4,216,144,72,5,7,7, + 6,0,0,32,112,248,0,32,112,248,5,7,7,6,0,0, + 248,112,32,0,248,112,32,5,5,5,6,0,1,112,248,248, + 248,112,5,7,7,6,0,0,8,8,40,72,248,64,32,5, + 7,7,6,0,0,32,112,168,32,32,32,32,5,7,7,6, + 0,0,32,32,32,32,168,112,32,5,5,5,6,0,1,32, + 64,248,64,32,5,5,5,6,0,1,32,16,248,16,32,5, + 7,7,6,0,0,16,32,64,32,16,0,248,5,7,7,6, + 0,0,64,32,16,32,64,0,248,5,5,5,6,0,1,32, + 32,112,112,248,5,5,5,6,0,0,248,112,112,32,32,0, + 0,0,6,0,0,1,7,7,6,2,0,128,128,128,128,128, + 0,128,3,2,2,6,1,5,160,160,5,7,7,6,0,0, + 80,80,248,80,248,80,80,5,7,7,6,0,0,32,120,160, + 112,40,240,32,5,7,7,6,0,0,192,200,16,32,64,152, + 24,5,7,7,6,0,0,96,144,160,64,168,144,104,2,3, + 3,6,1,4,192,64,128,3,7,7,6,1,0,32,64,128, + 128,128,64,32,3,7,7,6,1,0,128,64,32,32,32,64, + 128,5,5,5,6,0,1,32,168,112,168,32,5,5,5,6, + 0,1,32,32,248,32,32,2,3,3,6,2,255,192,64,128, + 5,1,1,6,0,3,248,2,2,2,6,2,0,192,192,5, + 5,5,6,0,1,8,16,32,64,128,5,7,7,6,0,0, + 112,136,152,168,200,136,112,3,7,7,6,1,0,64,192,64, + 64,64,64,224,5,7,7,6,0,0,112,136,8,112,128,128, + 248,5,7,7,6,0,0,248,16,32,16,8,8,240,5,7, + 7,6,0,0,16,48,80,144,248,16,16,5,7,7,6,0, + 0,248,128,240,8,8,136,112,5,7,7,6,0,0,48,64, + 128,240,136,136,112,5,7,7,6,0,0,248,8,16,32,32, + 32,32,5,7,7,6,0,0,112,136,136,112,136,136,112,5, + 7,7,6,0,0,112,136,136,120,8,16,96,2,5,5,6, + 2,0,192,192,0,192,192,2,6,6,6,2,255,192,192,0, + 192,64,128,4,7,7,6,0,0,16,32,64,128,64,32,16, + 5,3,3,6,0,2,248,0,248,4,7,7,6,1,0,128, + 64,32,16,32,64,128,5,7,7,6,0,0,112,136,8,16, + 32,0,32,5,6,6,6,0,0,112,136,8,104,168,112,5, + 7,7,6,0,0,112,136,136,248,136,136,136,5,7,7,6, + 0,0,240,136,136,240,136,136,240,5,7,7,6,0,0,112, + 136,128,128,128,136,112,5,7,7,6,0,0,224,144,136,136, + 136,144,224,5,7,7,6,0,0,248,128,128,240,128,128,248, + 5,7,7,6,0,0,248,128,128,240,128,128,128,5,7,7, + 6,0,0,112,136,128,184,136,136,112,5,7,7,6,0,0, + 136,136,136,248,136,136,136,1,7,7,6,2,0,128,128,128, + 128,128,128,128,5,7,7,6,0,0,56,16,16,16,16,144, + 96,5,7,7,6,0,0,136,144,160,192,160,144,136,5,7, + 7,6,0,0,128,128,128,128,128,128,248,5,7,7,6,0, + 0,136,216,168,136,136,136,136,5,7,7,6,0,0,136,136, + 200,168,152,136,136,5,7,7,6,0,0,112,136,136,136,136, + 136,112,5,7,7,6,0,0,240,136,136,240,128,128,128,5, + 7,7,6,0,0,112,136,136,136,168,144,104,5,7,7,6, + 0,0,240,136,136,240,160,144,136,5,7,7,6,0,0,120, + 128,128,112,8,8,240,5,7,7,6,0,0,248,32,32,32, + 32,32,32,5,7,7,6,0,0,136,136,136,136,136,136,112, + 5,7,7,6,0,0,136,136,136,136,136,80,32,5,7,7, + 6,0,0,136,136,136,136,136,168,80,5,7,7,6,0,0, + 136,136,80,32,80,136,136,5,7,7,6,0,0,136,136,136, + 80,32,32,32,5,7,7,6,0,0,248,8,16,32,64,128, + 248,3,7,7,6,1,0,224,128,128,128,128,128,224,5,5, + 5,6,0,1,128,64,32,16,8,3,7,7,6,1,0,224, + 32,32,32,32,32,224,5,3,3,6,0,4,32,80,136,5, + 1,1,6,0,0,248,2,2,2,6,2,5,128,64,5,5, + 5,6,0,0,112,8,120,136,120,5,7,7,6,0,0,128, + 128,176,200,136,136,240,5,5,5,6,0,0,112,128,128,136, + 112,5,7,7,6,0,0,8,8,104,152,136,136,120,5,5, + 5,6,0,0,112,136,248,128,112,5,7,7,6,0,0,48, + 72,224,64,64,64,64,5,6,6,6,0,255,112,136,136,120, + 8,112,5,7,7,6,0,0,128,128,176,200,136,136,136,1, + 7,7,6,2,0,128,0,128,128,128,128,128,3,8,8,6, + 1,255,32,0,32,32,32,32,160,64,4,7,7,6,0,0, + 128,128,144,160,192,160,144,3,7,7,6,1,0,192,64,64, + 64,64,64,224,5,5,5,6,0,0,208,168,168,168,168,5, + 5,5,6,0,0,176,200,136,136,136,5,5,5,6,0,0, + 112,136,136,136,112,5,6,6,6,0,255,240,136,136,240,128, + 128,5,6,6,6,0,255,120,136,136,120,8,8,5,5,5, + 6,0,0,176,200,128,128,128,5,5,5,6,0,0,112,128, + 112,8,240,5,7,7,6,0,0,64,64,224,64,64,72,48, + 5,5,5,6,0,0,136,136,136,152,104,5,5,5,6,0, + 0,136,136,136,80,32,5,5,5,6,0,0,136,136,168,168, + 80,5,5,5,6,0,0,136,80,32,80,136,5,6,6,6, + 0,255,136,136,136,120,8,112,5,5,5,6,0,0,248,16, + 32,64,248,3,7,7,6,1,0,32,64,64,128,64,64,32, + 1,7,7,6,2,0,128,128,128,128,128,128,128,3,7,7, + 6,1,0,128,64,64,32,64,64,128,5,6,6,6,0,1, + 8,40,72,248,64,32,5,7,7,6,0,0,32,80,136,136, + 136,136,248,5,7,7,6,0,0,248,136,128,240,136,136,240, + 5,8,8,6,0,255,120,40,40,40,72,136,248,136,5,7, + 7,6,0,0,168,168,168,112,168,168,168,5,7,7,6,0, + 0,240,8,8,112,8,8,240,5,7,7,6,0,0,136,136, + 152,168,200,136,136,5,8,8,6,0,0,80,32,136,152,168, + 168,200,136,5,7,7,6,0,0,120,40,40,40,40,168,72, + 5,7,7,6,0,0,248,136,136,136,136,136,136,5,7,7, + 6,0,0,136,136,136,80,32,64,128,5,8,8,6,0,255, + 136,136,136,136,136,136,248,8,5,7,7,6,0,0,136,136, + 136,120,8,8,8,5,7,7,6,0,0,168,168,168,168,168, + 168,248,5,8,8,6,0,255,168,168,168,168,168,168,248,8, + 5,7,7,6,0,0,192,64,64,112,72,72,112,5,7,7, + 6,0,0,136,136,136,200,168,168,200,5,7,7,6,0,0, + 112,136,40,80,8,136,112,5,5,5,6,0,0,64,160,144, + 144,104,5,7,7,6,0,0,32,48,40,40,32,224,224,5, + 7,7,6,0,0,248,136,128,128,128,128,128,5,5,5,6, + 0,0,248,80,80,80,152,5,7,7,6,0,0,248,128,64, + 32,64,128,248,5,5,5,6,0,0,120,144,144,144,96,5, + 7,7,6,0,0,48,40,56,40,200,216,24,5,6,6,6, + 0,0,8,112,160,32,32,16,5,6,6,6,0,1,32,112, + 112,112,248,32,5,7,7,6,0,0,112,136,136,248,136,136, + 112,5,5,5,6,0,0,112,136,136,80,216,5,7,7,6, + 0,0,48,72,32,80,136,136,112,5,3,3,6,0,2,88, + 168,208,5,6,6,6,0,0,80,248,248,248,112,32,5,5, + 5,6,0,0,112,128,96,136,112,5,7,7,6,0,0,112, + 136,136,136,136,136,136,5,7,7,6,0,0,216,216,216,216, + 216,216,216,1,7,7,6,2,0,128,0,128,128,128,128,128, + 5,7,7,6,0,0,32,112,160,160,168,112,32,5,7,7, + 6,0,0,48,64,64,224,64,80,168,5,5,5,6,0,0, + 136,112,80,112,136,5,7,7,6,0,0,136,80,248,32,248, + 32,32,1,7,7,6,2,0,128,128,128,0,128,128,128,5, + 8,8,6,0,0,48,72,32,80,80,32,144,96,5,7,7, + 6,0,0,24,32,32,112,32,32,192,5,7,7,6,0,0, + 248,136,184,184,184,136,248,5,7,7,6,0,0,112,8,120, + 136,120,0,248,5,5,5,6,0,1,40,80,160,80,40,5, + 7,7,6,0,0,144,168,168,232,168,168,144,5,7,7,6, + 0,0,120,136,136,120,40,72,136,5,7,7,6,0,0,248, + 136,168,136,152,168,248,2,3,3,6,2,4,64,128,192,4, + 5,5,6,0,3,96,144,144,144,96,5,7,7,6,0,0, + 32,32,248,32,32,0,248,4,5,5,6,0,3,96,144,32, + 64,240,3,5,5,6,0,3,224,32,224,32,224,5,8,8, + 6,0,0,224,144,224,128,144,184,144,24,5,8,8,6,0, + 255,136,136,136,136,152,232,128,128,5,7,7,6,0,0,120, + 152,152,120,24,24,24,2,2,2,6,2,2,192,192,5,5, + 5,6,0,0,80,136,168,168,80,3,5,5,6,0,3,64, + 192,64,64,224,5,7,7,6,0,0,112,136,136,136,112,0, + 248,5,5,5,6,0,1,160,80,40,80,160,5,7,7,6, + 0,0,136,144,168,88,184,8,8,5,7,7,6,0,0,136, + 144,184,72,152,32,56,5,8,8,6,0,0,192,64,192,72, + 216,56,8,8,5,7,7,6,0,0,32,0,32,64,128,136, + 112,5,8,8,6,0,0,64,32,32,80,136,248,136,136,5, + 8,8,6,0,0,16,32,32,80,136,248,136,136,5,8,8, + 6,0,0,32,80,0,112,136,248,136,136,5,8,8,6,0, + 0,104,144,0,112,136,248,136,136,5,8,8,6,0,0,80, + 0,32,80,136,248,136,136,5,8,8,6,0,0,32,80,32, + 112,136,248,136,136,5,7,7,6,0,0,56,96,160,184,224, + 160,184,5,8,8,6,0,255,112,136,128,128,136,112,32,96, + 5,8,8,6,0,0,64,32,0,248,128,240,128,248,5,8, + 8,6,0,0,8,16,0,248,128,240,128,248,5,8,8,6, + 0,0,32,80,0,248,128,240,128,248,5,7,7,6,0,0, + 80,0,248,128,240,128,248,3,8,8,6,1,0,128,64,0, + 224,64,64,64,224,3,8,8,6,1,0,32,64,0,224,64, + 64,64,224,3,8,8,6,1,0,64,160,0,224,64,64,64, + 224,3,7,7,6,1,0,160,0,224,64,64,64,224,5,7, + 7,6,0,0,112,72,72,232,72,72,112,5,8,8,6,0, + 0,104,144,0,136,200,168,152,136,5,8,8,6,0,0,64, + 32,112,136,136,136,136,112,5,8,8,6,0,0,16,32,112, + 136,136,136,136,112,5,8,8,6,0,0,32,80,0,112,136, + 136,136,112,5,8,8,6,0,0,104,144,0,112,136,136,136, + 112,5,8,8,6,0,0,80,0,112,136,136,136,136,112,5, + 5,5,6,0,1,136,80,32,80,136,5,7,7,6,0,0, + 112,32,112,168,112,32,112,5,8,8,6,0,0,64,32,136, + 136,136,136,136,112,5,8,8,6,0,0,16,32,136,136,136, + 136,136,112,5,8,8,6,0,0,32,80,0,136,136,136,136, + 112,5,8,8,6,0,0,80,0,136,136,136,136,136,112,5, + 8,8,6,0,0,16,32,136,80,32,32,32,32,5,8,8, + 6,0,0,192,64,112,72,72,112,64,224,5,7,7,6,0, + 0,48,72,72,112,72,72,176,5,8,8,6,0,0,64,32, + 0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112, + 8,120,136,120,5,8,8,6,0,0,32,80,0,112,8,120, + 136,120,5,8,8,6,0,0,104,144,0,112,8,120,136,120, + 5,7,7,6,0,0,80,0,112,8,120,136,120,5,8,8, + 6,0,0,32,80,32,112,8,120,136,120,5,6,6,6,0, + 0,208,40,120,160,168,80,5,6,6,6,0,255,112,128,136, + 112,32,96,5,8,8,6,0,0,64,32,0,112,136,248,128, + 112,5,8,8,6,0,0,16,32,0,112,136,248,128,112,5, + 8,8,6,0,0,32,80,0,112,136,248,128,112,5,7,7, + 6,0,0,80,0,112,136,248,128,112,3,8,8,6,1,0, + 128,64,0,64,192,64,64,224,3,8,8,6,1,0,32,64, + 0,64,192,64,64,224,3,8,8,6,1,0,64,160,0,64, + 192,64,64,224,3,7,7,6,1,0,160,0,64,192,64,64, + 224,5,7,7,6,0,0,160,64,160,16,120,136,112,5,8, + 8,6,0,0,104,144,0,176,200,136,136,136,5,8,8,6, + 0,0,64,32,0,112,136,136,136,112,5,8,8,6,0,0, + 16,32,0,112,136,136,136,112,5,8,8,6,0,0,32,80, + 0,112,136,136,136,112,5,8,8,6,0,0,104,144,0,112, + 136,136,136,112,5,7,7,6,0,0,80,0,112,136,136,136, + 112,5,5,5,6,0,1,32,0,248,0,32,5,7,7,6, + 0,0,16,32,112,168,112,32,64,5,8,8,6,0,0,64, + 32,0,136,136,136,152,104,5,8,8,6,0,0,16,32,0, + 136,136,136,152,104,5,8,8,6,0,0,32,80,0,136,136, + 136,152,104,5,7,7,6,0,0,80,0,136,136,136,152,104, + 5,9,9,6,0,255,16,32,0,136,136,136,248,8,112,4, + 7,7,6,1,0,192,64,96,80,96,64,224,5,8,8,6, + 0,255,80,0,136,136,136,248,8,112}; diff --git a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h new file mode 100644 index 000000000..4a9b5802b --- /dev/null +++ b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h @@ -0,0 +1,173 @@ +/* + Fontname: ISO10646_5_Cyrillic + Copyright: A. Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent = 8 descent=-1 +*/ +#include +const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2559] U8G_SECTION(".progmem.ISO10646_5_Cyrillic_5x7") = { + 0,6,9,0,254,7,1,145,3,32,32,255,255,8,255,7, + 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, + 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, + 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, + 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, + 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, + 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, + 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, + 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, + 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, + 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, + 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, + 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, + 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, + 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, + 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, + 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, + 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, + 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, + 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, + 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, + 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, + 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, + 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, + 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, + 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, + 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, + 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, + 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, + 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, + 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, + 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, + 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, + 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, + 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, + 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, + 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, + 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, + 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, + 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, + 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, + 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, + 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, + 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, + 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, + 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, + 5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1, + 0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80, + 136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64, + 5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0, + 0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128, + 128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120, + 5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0, + 0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136, + 136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136, + 136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8, + 8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6, + 0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192, + 64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168, + 168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6, + 0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136, + 240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5, + 5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0, + 112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64, + 72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5, + 6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136, + 168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6, + 6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0, + 248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64, + 64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3, + 7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6, + 0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,5,8,8,6,0,0, + 64,32,0,248,128,240,128,248,5,7,7,6,0,0,80,0, + 248,128,240,128,248,5,7,7,6,0,0,248,128,128,240,136, + 136,240,5,8,8,6,0,0,16,32,248,136,128,128,128,128, + 5,7,7,6,0,0,48,72,128,224,128,72,48,5,7,7, + 6,0,0,112,136,128,112,8,136,112,3,7,7,6,1,0, + 224,64,64,64,64,64,224,3,8,8,6,1,0,160,0,224, + 64,64,64,64,224,5,7,7,6,0,0,56,16,16,16,16, + 144,96,5,7,7,6,0,255,160,160,160,184,168,168,184,5, + 7,7,6,0,255,160,160,160,248,168,168,184,4,7,7,6, + 0,255,224,64,112,80,80,80,80,5,8,8,6,0,0,16, + 32,136,144,160,224,144,136,5,8,8,6,0,0,64,32,136, + 152,168,200,136,136,5,9,9,6,0,255,80,32,136,136,136, + 80,32,32,32,5,8,8,6,0,255,136,136,136,136,136,136, + 248,32,5,7,7,6,0,0,112,136,136,248,136,136,136,5, + 7,7,6,0,0,224,64,64,112,72,72,112,5,7,7,6, + 0,0,240,136,136,240,136,136,240,5,7,7,6,0,255,248, + 136,128,128,128,128,128,5,8,8,6,0,255,120,40,40,40, + 72,136,248,136,5,7,7,6,0,0,248,128,128,240,128,128, + 248,5,7,7,6,0,0,168,168,168,112,168,168,168,5,7, + 7,6,0,0,240,8,8,112,8,8,240,5,7,7,6,0, + 0,136,136,152,168,200,136,136,5,8,8,6,0,0,80,32, + 136,152,168,168,200,136,5,7,7,6,0,0,136,144,160,192, + 160,144,136,5,7,7,6,0,0,120,40,40,40,40,168,72, + 5,7,7,6,0,0,136,216,168,136,136,136,136,5,7,7, + 6,0,0,136,136,136,248,136,136,136,5,7,7,6,0,0, + 112,136,136,136,136,136,112,5,7,7,6,0,0,248,136,136, + 136,136,136,136,5,7,7,6,0,0,240,136,136,240,128,128, + 128,5,7,7,6,0,0,112,136,128,128,128,136,112,5,7, + 7,6,0,0,248,32,32,32,32,32,32,5,7,7,6,0, + 0,136,136,136,80,32,64,128,5,7,7,6,0,0,32,112, + 168,168,168,112,32,5,7,7,6,0,0,136,136,80,32,80, + 136,136,5,8,8,6,0,255,136,136,136,136,136,136,248,8, + 5,7,7,6,0,255,136,136,136,152,104,8,8,5,7,7, + 6,0,0,168,168,168,168,168,168,248,5,8,8,6,0,255, + 168,168,168,168,168,168,248,8,5,7,7,6,0,0,192,64, + 64,112,72,72,112,5,7,7,6,0,0,136,136,136,200,168, + 168,200,5,7,7,6,0,0,128,128,240,136,136,136,240,5, + 7,7,6,0,0,112,136,8,112,8,136,112,5,7,7,6, + 0,0,144,168,168,232,168,168,144,5,7,7,6,0,0,120, + 136,136,120,40,72,136,5,5,5,6,0,0,112,8,120,136, + 120,5,7,7,6,0,0,24,96,128,240,136,136,112,4,5, + 5,6,0,0,224,144,224,144,224,5,5,5,6,0,0,248, + 136,128,128,128,5,6,6,6,0,0,120,40,72,136,248,136, + 5,5,5,6,0,0,112,136,248,128,112,5,5,5,6,0, + 0,168,168,112,168,168,5,5,5,6,0,0,240,8,48,8, + 240,5,5,5,6,0,0,136,152,168,200,136,5,7,7,6, + 0,0,80,32,136,152,168,200,136,4,5,5,6,0,0,144, + 160,192,160,144,5,5,5,6,0,0,248,40,40,168,72,5, + 5,5,6,0,0,136,216,168,136,136,5,5,5,6,0,0, + 136,136,248,136,136,5,5,5,6,0,0,112,136,136,136,112, + 5,5,5,6,0,0,248,136,136,136,136,5,6,6,6,0, + 255,240,136,136,240,128,128,5,5,5,6,0,0,112,128,128, + 136,112,5,5,5,6,0,0,248,32,32,32,32,5,6,6, + 6,0,255,136,136,136,120,8,112,5,6,6,6,0,0,32, + 112,168,168,112,32,5,5,5,6,0,0,136,80,32,80,136, + 5,6,6,6,0,255,136,136,136,136,248,8,5,5,5,6, + 0,0,136,136,248,8,8,5,5,5,6,0,0,168,168,168, + 168,248,5,6,6,6,0,255,168,168,168,168,248,8,5,5, + 5,6,0,0,192,64,112,72,112,5,5,5,6,0,0,136, + 136,200,168,200,3,5,5,6,1,0,128,128,192,160,192,5, + 5,5,6,0,0,112,136,56,136,112,5,5,5,6,0,0, + 144,168,232,168,144,5,5,5,6,0,0,120,136,120,40,72, + 5,8,8,6,0,0,64,32,0,112,136,248,128,112,5,7, + 7,6,0,0,80,0,112,136,248,128,112,5,9,9,6,0, + 255,64,224,64,64,120,72,72,72,16,5,8,8,6,0,0, + 16,32,0,248,136,128,128,128,5,5,5,6,0,0,112,136, + 96,136,112,5,5,5,6,0,0,112,128,112,8,240,1,7, + 7,6,2,0,128,0,128,128,128,128,128,3,7,7,6,1, + 0,160,0,64,64,64,64,64,3,8,8,6,1,255,32,0, + 32,32,32,32,160,64,5,5,5,6,0,0,160,160,184,168, + 184,5,5,5,6,0,0,160,160,248,168,184,5,6,6,6, + 0,0,64,224,64,120,72,72,4,8,8,6,0,0,16,32, + 0,144,160,192,160,144,5,8,8,6,0,0,64,32,0,136, + 152,168,200,136,5,9,9,6,0,255,80,32,0,136,136,136, + 120,8,112,5,6,6,6,0,255,136,136,136,136,248,32}; diff --git a/Marlin/dogm_font_data_ISO10646_Kana.h b/Marlin/dogm_font_data_ISO10646_Kana.h new file mode 100644 index 000000000..9970a3823 --- /dev/null +++ b/Marlin/dogm_font_data_ISO10646_Kana.h @@ -0,0 +1,173 @@ +/* + Fontname: ISO10646_Kana + Copyright: A. Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent = 8 descent=-1 +*/ +#include +const u8g_fntpgm_uint8_t ISO10646_Kana_5x7[2549] U8G_SECTION(".progmem.ISO10646_Kana_5x7") = { + 0,6,9,0,254,7,1,145,3,32,32,255,255,8,255,7, + 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, + 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, + 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, + 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, + 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, + 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, + 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, + 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, + 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, + 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, + 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, + 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, + 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, + 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, + 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, + 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, + 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, + 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, + 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, + 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, + 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, + 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, + 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, + 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, + 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, + 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, + 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, + 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, + 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, + 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, + 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, + 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, + 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, + 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, + 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, + 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, + 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, + 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, + 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, + 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, + 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, + 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, + 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, + 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, + 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, + 5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1, + 0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80, + 136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64, + 5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0, + 0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128, + 128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120, + 5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0, + 0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136, + 136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136, + 136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8, + 8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6, + 0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192, + 64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168, + 168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6, + 0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136, + 240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5, + 5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0, + 112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64, + 72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5, + 6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136, + 168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6, + 6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0, + 248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64, + 64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3, + 7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6, + 0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, + 0,6,0,0,0,0,0,6,0,0,5,3,3,6,0,2, + 248,0,248,5,6,6,6,0,0,248,8,40,48,32,64,5, + 7,7,6,0,0,248,8,40,48,32,32,64,4,5,5,6, + 0,0,16,32,96,160,32,5,7,7,6,0,0,8,16,32, + 96,160,32,32,5,5,5,6,0,0,32,248,136,8,48,5, + 7,7,6,0,0,32,248,136,136,8,16,32,5,4,4,6, + 0,0,248,32,32,248,5,6,6,6,0,0,248,32,32,32, + 32,248,5,5,5,6,0,0,16,248,48,80,144,5,7,7, + 6,0,0,16,248,16,48,80,144,16,5,5,5,6,0,0, + 64,248,72,80,64,5,7,7,6,0,0,40,0,64,248,72, + 80,64,5,7,7,6,0,0,32,248,32,248,32,32,32,5, + 8,8,6,0,0,40,0,32,248,32,248,32,32,4,6,6, + 6,0,0,64,112,144,16,16,32,5,8,8,6,0,0,40, + 0,64,112,144,16,16,32,5,6,6,6,0,0,64,120,144, + 16,16,32,5,8,8,6,0,0,40,0,64,120,144,16,16, + 32,5,5,5,6,0,0,248,8,8,8,248,5,7,7,6, + 0,0,40,0,248,8,8,8,248,5,7,7,6,0,255,80, + 248,80,80,16,32,64,5,9,9,6,0,255,40,0,80,248, + 80,80,16,32,64,5,6,6,6,0,0,192,8,200,8,16, + 224,5,8,8,6,0,0,40,0,192,8,200,8,16,224,5, + 6,6,6,0,0,248,8,16,32,80,136,5,8,8,6,0, + 0,40,0,248,8,16,32,80,136,5,6,6,6,0,0,64, + 248,72,80,64,120,5,8,8,6,0,0,40,0,64,248,72, + 80,64,120,4,4,4,6,0,1,16,208,16,224,5,7,7, + 6,0,0,40,0,8,200,8,16,224,5,7,7,6,0,255, + 32,120,136,40,16,40,64,5,9,9,6,0,255,40,0,32, + 120,136,40,16,40,64,5,6,6,6,0,0,240,32,248,32, + 64,128,5,8,8,6,0,0,40,0,240,32,248,32,64,128, + 4,5,5,6,0,1,192,16,208,16,224,5,6,6,6,0, + 0,192,8,200,8,16,224,5,8,8,6,0,0,40,0,192, + 8,200,8,16,224,5,6,6,6,0,0,112,0,248,32,32, + 64,5,8,8,6,0,0,40,0,112,0,248,32,32,64,3, + 7,7,6,1,0,128,128,128,192,160,128,128,4,8,8,6, + 1,0,80,0,128,128,192,160,128,128,5,7,7,6,0,0, + 32,32,248,32,32,64,128,5,6,6,6,0,0,112,0,0, + 0,0,248,5,6,6,6,0,0,248,8,80,32,80,128,5, + 7,7,6,0,255,32,248,8,16,32,112,168,3,7,7,6, + 1,0,32,32,32,32,32,64,128,5,5,5,6,0,0,16, + 136,136,136,136,5,7,7,6,0,0,40,0,16,136,136,136, + 136,5,8,8,6,0,0,24,24,0,16,136,136,136,136,5, + 7,7,6,0,0,128,128,248,128,128,128,120,5,8,8,6, + 0,0,40,128,128,248,128,128,128,120,5,8,8,6,0,0, + 24,152,128,248,128,128,128,120,5,6,6,6,0,0,248,8, + 8,8,16,96,5,8,8,6,0,0,40,0,248,8,8,8, + 16,96,5,8,8,6,0,0,24,24,248,8,8,8,16,96, + 5,5,5,6,0,1,64,160,16,8,8,5,7,7,6,0, + 1,40,0,64,160,16,8,8,5,7,7,6,0,1,24,24, + 64,160,16,8,8,5,6,6,6,0,0,32,248,32,32,168, + 168,5,8,8,6,0,0,40,0,32,248,32,32,168,168,5, + 8,8,6,0,0,24,24,32,248,32,32,168,168,5,6,6, + 6,0,0,248,8,8,80,32,16,4,6,6,6,1,0,224, + 0,224,0,224,16,5,6,6,6,0,0,32,64,128,144,248, + 8,5,6,6,6,0,0,8,8,80,32,80,128,5,6,6, + 6,0,0,120,32,248,32,32,56,5,7,7,6,0,0,64, + 64,248,72,80,64,64,5,7,7,6,0,0,64,248,72,80, + 64,64,64,5,5,5,6,0,0,112,16,16,16,248,5,7, + 7,6,0,0,112,16,16,16,16,16,248,4,5,5,6,1, + 0,240,16,240,16,240,5,7,7,6,0,0,248,8,8,248, + 8,8,248,5,6,6,6,0,0,112,0,248,8,16,32,3, + 6,6,6,1,0,160,160,160,160,32,64,5,6,6,6,0, + 0,80,80,80,80,88,144,4,6,6,6,1,0,128,128,128, + 144,160,192,5,6,6,6,0,0,248,136,136,136,248,136,5, + 5,5,6,0,0,248,136,8,16,96,5,6,6,6,0,0, + 248,136,8,8,16,96,5,6,6,6,0,0,16,248,80,80, + 248,16,5,6,6,6,0,0,248,8,80,96,64,248,5,6, + 6,6,0,0,248,8,248,8,16,32,5,6,6,6,0,0, + 128,64,8,8,16,224,5,8,8,6,0,0,40,0,32,248, + 136,8,24,32,5,6,6,6,0,0,64,248,72,72,136,144, + 4,5,5,6,1,0,128,240,160,32,32,5,8,8,6,0, + 0,40,0,248,136,8,8,16,96,5,8,8,6,0,0,40, + 0,16,248,80,80,248,16,5,7,7,6,0,0,40,0,248, + 16,32,32,248,5,8,8,6,0,0,40,0,248,8,248,8, + 16,32,2,2,2,6,2,2,192,192,5,1,1,6,0,3, + 248,5,5,5,6,0,1,128,64,32,16,8,5,6,6,6, + 0,1,40,128,64,32,16,8,5,7,7,6,0,0,248,8, + 8,8,8,8,8}; diff --git a/Marlin/dogm_font_data_Marlin_symbols.h b/Marlin/dogm_font_data_Marlin_symbols.h new file mode 100644 index 000000000..9fdb0370c --- /dev/null +++ b/Marlin/dogm_font_data_Marlin_symbols.h @@ -0,0 +1,22 @@ +/* + Fontname: Marlin_symbols + Copyright: Created with Fony 1.4.7 + Capital A Height: 0, '1' Height: 0 + Calculated Max Values w= 5 h=10 x= 0 y= 3 dx= 6 dy= 0 ascent= 8 len=10 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 + Pure Font ascent = 0 descent= 0 + X Font ascent = 0 descent= 0 + Max Font ascent = 8 descent=-2 +*/ +#include +const u8g_fntpgm_uint8_t Marlin_symbols[140] U8G_SECTION(".progmem.Marlin_symbols") = { + 0,6,9,0,254,0,0,0,0,0,1,9,0,8,254,0, + 0,5,8,8,6,0,0,64,240,200,136,136,152,120,16,5, + 8,8,6,0,0,192,248,136,136,136,136,136,248,5,5,5, + 6,0,1,32,48,248,48,32,5,8,8,6,0,0,32,112, + 248,32,32,32,32,224,5,9,9,6,0,255,32,112,168,168, + 184,136,136,112,32,5,9,9,6,0,255,224,128,192,176,168, + 40,48,40,40,5,9,9,6,0,255,248,168,136,136,136,136, + 136,168,248,5,10,10,6,0,254,32,80,80,80,80,136,168, + 168,136,112,3,3,3,6,0,3,64,160,64}; diff --git a/Marlin/dogm_font_data_marlin.h b/Marlin/dogm_font_data_marlin.h deleted file mode 100644 index 6b83903cf..000000000 --- a/Marlin/dogm_font_data_marlin.h +++ /dev/null @@ -1,337 +0,0 @@ -/* - Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1 - Copyright: Public domain font. Share and enjoy. - Capital A Height: 6, '1' Height: 6 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 7 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 6 descent=-2 - X Font ascent = 6 descent=-2 - Max Font ascent = 7 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t u8g_font_6x9[2300] U8G_SECTION(".progmem.u8g_font_6x9") = { - 0,6,9,0,254,6,1,137,2,254,32,255,254,7,254,6, - 254,0,0,0,6,0,7,1,6,6,6,2,0,128,128,128, - 128,0,128,3,3,3,6,1,3,160,160,160,5,7,7,6, - 0,255,80,80,248,80,248,80,80,5,9,9,6,0,254,32, - 112,168,160,112,40,168,112,32,6,8,8,6,0,255,64,168, - 72,16,32,72,84,8,5,7,7,6,0,255,96,144,144,96, - 152,144,104,1,3,3,6,2,3,128,128,128,2,7,7,6, - 2,255,64,128,128,128,128,128,64,2,7,7,6,2,255,128, - 64,64,64,64,64,128,5,5,5,6,0,0,136,80,248,80, - 136,5,5,5,6,0,0,32,32,248,32,32,2,4,4,6, - 2,254,192,64,64,128,5,1,1,6,0,2,248,2,2,2, - 6,2,0,192,192,4,6,6,6,1,0,16,16,32,64,128, - 128,4,6,6,6,1,0,96,144,144,144,144,96,3,6,6, - 6,1,0,64,192,64,64,64,224,4,6,6,6,1,0,96, - 144,16,32,64,240,4,6,6,6,1,0,240,32,96,16,16, - 224,5,6,6,6,0,0,16,48,80,144,248,16,4,6,6, - 6,1,0,240,128,224,16,16,224,4,6,6,6,1,0,96, - 128,224,144,144,96,4,6,6,6,1,0,240,16,16,32,64, - 64,4,6,6,6,1,0,96,144,96,144,144,96,4,6,6, - 6,1,0,96,144,144,112,16,96,2,5,5,6,2,0,192, - 192,0,192,192,2,7,7,6,2,254,192,192,0,192,64,64, - 128,5,5,5,6,0,0,24,96,128,96,24,5,3,3,6, - 0,1,248,0,248,5,5,5,6,0,0,192,48,8,48,192, - 4,7,7,6,1,0,96,144,16,96,64,0,64,5,6,6, - 6,0,0,112,144,168,176,128,112,5,6,6,6,0,0,32, - 80,136,248,136,136,5,6,6,6,0,0,240,136,240,136,136, - 240,4,6,6,6,1,0,96,144,128,128,144,96,4,6,6, - 6,1,0,224,144,144,144,144,224,4,6,6,6,1,0,240, - 128,224,128,128,240,4,6,6,6,1,0,240,128,224,128,128, - 128,4,6,6,6,1,0,96,144,128,176,144,96,4,6,6, - 6,1,0,144,144,240,144,144,144,3,6,6,6,1,0,224, - 64,64,64,64,224,5,6,6,6,0,0,56,16,16,16,144, - 96,4,6,6,6,1,0,144,160,192,160,144,144,4,6,6, - 6,1,0,128,128,128,128,128,240,5,6,6,6,0,0,136, - 216,168,168,136,136,4,6,6,6,1,0,144,208,176,144,144, - 144,5,6,6,6,0,0,112,136,136,136,136,112,4,6,6, - 6,1,0,224,144,144,224,128,128,4,7,7,6,1,255,96, - 144,144,208,176,96,16,4,6,6,6,1,0,224,144,144,224, - 144,144,4,6,6,6,1,0,96,144,64,32,144,96,5,6, - 6,6,0,0,248,32,32,32,32,32,4,6,6,6,1,0, - 144,144,144,144,144,96,4,6,6,6,1,0,144,144,144,240, - 96,96,5,6,6,6,0,0,136,136,168,168,216,136,5,6, - 6,6,0,0,136,80,32,32,80,136,5,6,6,6,0,0, - 136,136,80,32,32,32,4,6,6,6,1,0,240,16,32,64, - 128,240,3,6,6,6,1,0,224,128,128,128,128,224,4,6, - 6,6,1,0,128,128,64,32,16,16,3,6,6,6,1,0, - 224,32,32,32,32,224,5,3,3,6,0,3,32,80,136,5, - 1,1,6,0,254,248,2,2,2,6,2,4,128,64,4,4, - 4,6,1,0,112,144,144,112,4,6,6,6,1,0,128,128, - 224,144,144,224,4,4,4,6,1,0,112,128,128,112,4,6, - 6,6,1,0,16,16,112,144,144,112,4,4,4,6,1,0, - 96,176,192,112,4,6,6,6,1,0,32,80,64,224,64,64, - 4,6,6,6,1,254,96,144,144,112,16,96,4,6,6,6, - 1,0,128,128,224,144,144,144,3,6,6,6,1,0,64,0, - 192,64,64,224,3,8,8,6,1,254,32,0,96,32,32,32, - 160,64,4,6,6,6,1,0,128,128,160,192,160,144,3,6, - 6,6,1,0,192,64,64,64,64,224,5,4,4,6,0,0, - 208,168,168,136,4,4,4,6,1,0,224,144,144,144,4,4, - 4,6,1,0,96,144,144,96,4,6,6,6,1,254,224,144, - 144,224,128,128,4,6,6,6,1,254,112,144,144,112,16,16, - 4,4,4,6,1,0,160,208,128,128,4,4,4,6,1,0, - 112,192,48,224,4,6,6,6,1,0,64,64,224,64,80,32, - 4,4,4,6,1,0,144,144,144,112,4,4,4,6,1,0, - 144,144,96,96,5,4,4,6,0,0,136,168,168,80,4,4, - 4,6,1,0,144,96,96,144,4,6,6,6,1,254,144,144, - 144,112,144,96,4,4,4,6,1,0,240,32,64,240,3,7, - 7,6,1,0,32,64,64,128,64,64,32,1,7,7,6,2, - 255,128,128,128,128,128,128,128,3,7,7,6,1,0,128,64, - 64,32,64,64,128,4,2,2,6,1,3,80,160,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0, - 0,6,0,7,1,6,6,6,2,0,128,0,128,128,128,128, - 4,6,6,6,1,255,32,112,160,160,112,32,5,7,7,6, - 0,255,48,72,64,240,64,64,248,5,5,5,6,0,0,168, - 80,136,80,168,5,6,6,6,0,0,136,80,248,32,248,32, - 1,7,7,6,2,255,128,128,128,0,128,128,128,4,7,7, - 6,1,255,112,128,96,144,96,16,224,3,1,1,6,1,5, - 160,6,7,7,6,0,0,120,132,148,164,148,132,120,3,5, - 5,6,1,1,96,160,96,0,224,5,5,5,6,0,0,40, - 80,160,80,40,4,3,3,6,1,0,240,16,16,4,1,1, - 6,1,2,240,6,7,7,6,0,0,120,132,180,164,164,132, - 120,4,1,1,6,1,5,240,4,3,3,6,1,2,96,144, - 96,5,7,7,6,0,255,32,32,248,32,32,0,248,3,5, - 5,6,1,1,64,160,32,64,224,3,5,5,6,1,1,192, - 32,64,32,192,2,2,2,6,2,4,64,128,4,5,5,6, - 1,255,144,144,176,208,128,5,6,6,6,0,0,120,232,232, - 104,40,40,1,1,1,6,2,2,128,2,2,2,6,2,254, - 64,128,3,5,5,6,1,1,64,192,64,64,224,3,5,5, - 6,1,1,64,160,64,0,224,5,5,5,6,0,0,160,80, - 40,80,160,5,8,8,6,0,255,64,192,64,80,112,48,120, - 16,5,8,8,6,0,255,64,192,64,80,104,8,16,56,5, - 8,8,6,0,255,192,32,64,48,240,48,120,16,4,7,7, - 6,1,0,32,0,32,96,128,144,96,5,7,7,6,0,0, - 64,32,32,80,112,136,136,5,7,7,6,0,0,16,32,32, - 80,112,136,136,5,7,7,6,0,0,32,80,32,80,112,136, - 136,5,7,7,6,0,0,40,80,32,80,112,136,136,5,7, - 7,6,0,0,80,0,32,80,112,136,136,5,7,7,6,0, - 0,32,80,32,80,112,136,136,5,6,6,6,0,0,120,160, - 240,160,160,184,4,8,8,6,1,254,96,144,128,128,144,96, - 32,64,4,7,7,6,1,0,64,32,240,128,224,128,240,4, - 7,7,6,1,0,32,64,240,128,224,128,240,4,7,7,6, - 1,0,32,80,240,128,224,128,240,4,7,7,6,1,0,80, - 0,240,128,224,128,240,3,7,7,6,1,0,128,64,224,64, - 64,64,224,3,7,7,6,1,0,32,64,224,64,64,64,224, - 3,7,7,6,1,0,64,160,224,64,64,64,224,3,7,7, - 6,1,0,160,0,224,64,64,64,224,5,6,6,6,0,0, - 112,72,232,72,72,112,4,7,7,6,1,0,80,160,144,208, - 176,144,144,4,7,7,6,1,0,64,32,96,144,144,144,96, - 4,7,7,6,1,0,32,64,96,144,144,144,96,4,7,7, - 6,1,0,32,80,96,144,144,144,96,4,7,7,6,1,0, - 80,160,96,144,144,144,96,4,7,7,6,1,0,80,0,96, - 144,144,144,96,5,5,5,6,0,0,136,80,32,80,136,4, - 8,8,6,1,255,16,112,176,176,208,208,224,128,4,7,7, - 6,1,0,64,32,144,144,144,144,96,4,7,7,6,1,0, - 32,64,144,144,144,144,96,4,7,7,6,1,0,32,80,144, - 144,144,144,96,4,7,7,6,1,0,80,0,144,144,144,144, - 96,5,7,7,6,0,0,16,32,136,80,32,32,32,4,6, - 6,6,1,0,128,224,144,144,224,128,4,6,6,6,1,0, - 96,144,160,160,144,160,4,7,7,6,1,0,64,32,0,112, - 144,144,112,4,7,7,6,1,0,32,64,0,112,144,144,112, - 4,7,7,6,1,0,32,80,0,112,144,144,112,4,7,7, - 6,1,0,80,160,0,112,144,144,112,4,6,6,6,1,0, - 80,0,112,144,144,112,4,7,7,6,1,0,32,80,32,112, - 144,144,112,5,4,4,6,0,0,112,168,176,120,4,6,6, - 6,1,254,112,128,128,112,32,64,4,7,7,6,1,0,64, - 32,0,96,176,192,112,4,7,7,6,1,0,32,64,0,96, - 176,192,112,4,7,7,6,1,0,32,80,0,96,176,192,112, - 4,6,6,6,1,0,80,0,96,176,192,112,3,7,7,6, - 1,0,128,64,0,192,64,64,224,3,7,7,6,1,0,32, - 64,0,192,64,64,224,3,7,7,6,1,0,64,160,0,192, - 64,64,224,3,6,6,6,1,0,160,0,192,64,64,224,4, - 7,7,6,1,0,48,96,16,112,144,144,96,4,7,7,6, - 1,0,80,160,0,224,144,144,144,4,7,7,6,1,0,64, - 32,0,96,144,144,96,4,7,7,6,1,0,32,64,0,96, - 144,144,96,4,7,7,6,1,0,32,80,0,96,144,144,96, - 4,7,7,6,1,0,80,160,0,96,144,144,96,4,6,6, - 6,1,0,80,0,96,144,144,96,5,5,5,6,0,0,32, - 0,248,0,32,4,4,4,6,1,0,112,176,208,224,4,7, - 7,6,1,0,64,32,0,144,144,144,112,4,7,7,6,1, - 0,32,64,0,144,144,144,112,4,7,7,6,1,0,32,80, - 0,144,144,144,112,4,6,6,6,1,0,80,0,144,144,144, - 112,4,9,9,6,1,254,32,64,0,144,144,144,112,144,96, - 4,8,8,6,1,254,128,128,224,144,144,224,128,128,4,8, - 8,6,1,254,80,0,144,144,144,112,144,96}; - -// STB Marlin -/* - Fontname: u8g_font_6x10_marlin - Copyright: Public domain terminal emulator font. Share and enjoy. - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h=10 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len=10 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-2 - X Font ascent = 7 descent=-2 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t u8g_font_6x10_marlin[2617] U8G_SECTION(".progmem.u8g_font_6x10_marlin") = { - 0,6,9,0,254,7,1,153,3,43,32,255,254,8,254,7, - 254,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,3,3,6,1,4,160,160,160,5,7,7, - 6,0,0,80,80,248,80,248,80,80,5,7,7,6,0,0, - 32,112,160,112,40,112,32,5,7,7,6,0,0,72,168,80, - 32,80,168,144,5,7,7,6,0,0,64,160,160,64,168,144, - 104,1,3,3,6,2,4,128,128,128,3,7,7,6,1,0, - 32,64,128,128,128,64,32,3,7,7,6,1,0,128,64,32, - 32,32,64,128,5,5,5,6,0,1,136,80,248,80,136,5, - 5,5,6,0,1,32,32,248,32,32,3,3,3,6,1,255, - 96,64,128,5,1,1,6,0,3,248,3,3,3,6,1,255, - 64,224,64,5,7,7,6,0,0,8,8,16,32,64,128,128, - 5,7,7,6,0,0,32,80,136,136,136,80,32,5,7,7, - 6,0,0,32,96,160,32,32,32,248,5,7,7,6,0,0, - 112,136,8,48,64,128,248,5,7,7,6,0,0,248,8,16, - 48,8,136,112,5,7,7,6,0,0,16,48,80,144,248,16, - 16,5,7,7,6,0,0,248,128,176,200,8,136,112,5,7, - 7,6,0,0,48,64,128,176,200,136,112,5,7,7,6,0, - 0,248,8,16,16,32,64,64,5,7,7,6,0,0,112,136, - 136,112,136,136,112,5,7,7,6,0,0,112,136,152,104,8, - 16,96,3,7,7,6,1,255,64,224,64,0,64,224,64,3, - 7,7,6,1,255,64,224,64,0,96,64,128,4,7,7,6, - 1,0,16,32,64,128,64,32,16,5,3,3,6,0,2,248, - 0,248,4,7,7,6,1,0,128,64,32,16,32,64,128,5, - 7,7,6,0,0,112,136,16,32,32,0,32,5,7,7,6, - 0,0,112,136,152,168,176,128,112,5,7,7,6,0,0,32, - 80,136,136,248,136,136,5,7,7,6,0,0,240,72,72,112, - 72,72,240,5,7,7,6,0,0,112,136,128,128,128,136,112, - 5,7,7,6,0,0,240,72,72,72,72,72,240,5,7,7, - 6,0,0,248,128,128,240,128,128,248,5,7,7,6,0,0, - 248,128,128,240,128,128,128,5,7,7,6,0,0,112,136,128, - 128,152,136,112,5,7,7,6,0,0,136,136,136,248,136,136, - 136,3,7,7,6,1,0,224,64,64,64,64,64,224,5,7, - 7,6,0,0,56,16,16,16,16,144,96,5,7,7,6,0, - 0,136,144,160,192,160,144,136,5,7,7,6,0,0,128,128, - 128,128,128,128,248,5,7,7,6,0,0,136,136,216,168,136, - 136,136,5,7,7,6,0,0,136,136,200,168,152,136,136,5, - 7,7,6,0,0,112,136,136,136,136,136,112,5,7,7,6, - 0,0,240,136,136,240,128,128,128,5,8,8,6,0,255,112, - 136,136,136,136,168,112,8,5,7,7,6,0,0,240,136,136, - 240,160,144,136,5,7,7,6,0,0,112,136,128,112,8,136, - 112,5,7,7,6,0,0,248,32,32,32,32,32,32,5,7, - 7,6,0,0,136,136,136,136,136,136,112,5,7,7,6,0, - 0,136,136,136,80,80,80,32,5,7,7,6,0,0,136,136, - 136,168,168,216,136,5,7,7,6,0,0,136,136,80,32,80, - 136,136,5,7,7,6,0,0,136,136,80,32,32,32,32,5, - 7,7,6,0,0,248,8,16,32,64,128,248,3,7,7,6, - 1,0,224,128,128,128,128,128,224,5,7,7,6,0,0,128, - 128,64,32,16,8,8,3,7,7,6,1,0,224,32,32,32, - 32,32,224,5,3,3,6,0,4,32,80,136,5,1,1,6, - 0,255,248,2,2,2,6,2,6,128,64,5,5,5,6,0, - 0,112,8,120,136,120,5,7,7,6,0,0,128,128,176,200, - 136,200,176,5,5,5,6,0,0,112,136,128,136,112,5,7, - 7,6,0,0,8,8,104,152,136,152,104,5,5,5,6,0, - 0,112,136,248,128,112,5,7,7,6,0,0,48,72,64,240, - 64,64,64,5,7,7,6,0,254,120,136,136,120,8,136,112, - 5,7,7,6,0,0,128,128,176,200,136,136,136,3,7,7, - 6,1,0,64,0,192,64,64,64,224,4,9,9,6,1,254, - 16,0,48,16,16,16,144,144,96,5,7,7,6,0,0,128, - 128,136,144,224,144,136,3,7,7,6,1,0,192,64,64,64, - 64,64,224,5,5,5,6,0,0,208,168,168,168,136,5,5, - 5,6,0,0,176,200,136,136,136,5,5,5,6,0,0,112, - 136,136,136,112,5,7,7,6,0,254,176,200,136,200,176,128, - 128,5,7,7,6,0,254,104,152,136,152,104,8,8,5,5, - 5,6,0,0,176,200,128,128,128,5,5,5,6,0,0,112, - 128,112,8,240,5,7,7,6,0,0,64,64,240,64,64,72, - 48,5,5,5,6,0,0,136,136,136,152,104,5,5,5,6, - 0,0,136,136,80,80,32,5,5,5,6,0,0,136,136,168, - 168,80,5,5,5,6,0,0,136,80,32,80,136,5,7,7, - 6,0,254,136,136,152,104,8,136,112,5,5,5,6,0,0, - 248,16,32,64,248,4,7,7,6,1,0,48,64,32,192,32, - 64,48,1,7,7,6,2,0,128,128,128,128,128,128,128,4, - 7,7,6,1,0,192,32,64,48,64,32,192,5,3,3,6, - 0,4,72,168,144,0,0,0,1,0,0,0,0,0,1,0, - 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, - 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, - 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, - 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, - 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, - 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, - 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, - 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, - 0,0,1,0,0,0,0,0,1,0,0,0,0,0,6,0, - 0,1,7,7,6,2,0,128,0,128,128,128,128,128,5,7, - 7,6,0,255,32,120,160,160,160,120,32,5,7,7,6,0, - 0,48,72,64,224,64,72,176,5,5,5,6,0,0,136,112, - 80,112,136,5,8,8,6,0,255,136,136,80,32,248,32,32, - 32,1,7,7,6,2,0,128,128,128,0,128,128,128,5,8, - 8,6,0,255,112,128,224,144,72,56,8,112,3,1,1,6, - 1,7,160,5,7,7,6,0,0,112,136,168,200,168,136,112, - 4,6,6,6,1,1,112,144,176,80,0,240,6,5,5,6, - 0,0,36,72,144,72,36,4,2,2,6,1,2,240,16,4, - 1,1,6,1,3,240,5,7,7,6,0,0,112,136,232,200, - 200,136,112,5,1,1,6,0,7,248,3,3,3,6,1,4, - 64,160,64,5,6,6,6,0,0,32,32,248,32,32,248,4, - 5,5,6,1,3,96,144,32,64,240,4,5,5,6,1,3, - 224,16,96,16,224,2,2,2,6,2,6,64,128,5,6,6, - 6,0,255,136,136,136,200,176,128,5,7,7,6,0,0,120, - 232,232,104,40,40,40,1,1,1,6,2,3,128,2,2,2, - 6,2,254,64,128,3,5,5,6,1,3,64,192,64,64,224, - 4,6,6,6,1,1,96,144,144,96,0,240,6,5,5,6, - 0,0,144,72,36,72,144,6,9,9,6,0,255,64,192,64, - 64,228,12,20,60,4,6,9,9,6,0,255,64,192,64,64, - 232,20,4,8,28,5,9,9,6,0,255,192,32,64,32,200, - 24,40,120,8,5,7,7,6,0,0,32,0,32,32,64,136, - 112,5,8,8,6,0,0,64,32,112,136,136,248,136,136,5, - 8,8,6,0,0,16,32,112,136,136,248,136,136,5,8,8, - 6,0,0,32,80,112,136,136,248,136,136,5,8,8,6,0, - 0,72,176,112,136,136,248,136,136,5,8,8,6,0,0,80, - 0,112,136,136,248,136,136,5,8,8,6,0,0,32,80,112, - 136,136,248,136,136,6,7,7,6,0,0,60,80,144,156,240, - 144,156,5,9,9,6,0,254,112,136,128,128,128,136,112,32, - 64,5,8,8,6,0,0,64,248,128,128,240,128,128,248,5, - 8,8,6,0,0,16,248,128,128,240,128,128,248,5,8,8, - 6,0,0,32,248,128,128,240,128,128,248,5,8,8,6,0, - 0,80,248,128,128,240,128,128,248,3,8,8,6,1,0,128, - 64,224,64,64,64,64,224,3,8,8,6,1,0,32,64,224, - 64,64,64,64,224,3,8,8,6,1,0,64,160,224,64,64, - 64,64,224,3,8,8,6,1,0,160,0,224,64,64,64,64, - 224,5,7,7,6,0,0,240,72,72,232,72,72,240,5,8, - 8,6,0,0,40,80,136,200,168,152,136,136,5,8,8,6, - 0,0,64,32,112,136,136,136,136,112,5,8,8,6,0,0, - 16,32,112,136,136,136,136,112,5,8,8,6,0,0,32,80, - 112,136,136,136,136,112,5,8,8,6,0,0,40,80,112,136, - 136,136,136,112,5,8,8,6,0,0,80,0,112,136,136,136, - 136,112,5,5,5,6,0,0,136,80,32,80,136,5,7,7, - 6,0,0,112,152,152,168,200,200,112,5,8,8,6,0,0, - 64,32,136,136,136,136,136,112,5,8,8,6,0,0,16,32, - 136,136,136,136,136,112,5,8,8,6,0,0,32,80,0,136, - 136,136,136,112,5,8,8,6,0,0,80,0,136,136,136,136, - 136,112,5,8,8,6,0,0,16,32,136,136,80,32,32,32, - 5,7,7,6,0,0,128,240,136,240,128,128,128,5,7,7, - 6,0,0,112,136,144,160,144,136,176,5,8,8,6,0,0, - 64,32,0,112,8,120,136,120,5,8,8,6,0,0,16,32, - 0,112,8,120,136,120,5,8,8,6,0,0,32,80,0,112, - 8,120,136,120,5,8,8,6,0,0,40,80,0,112,8,120, - 136,120,5,7,7,6,0,0,80,0,112,8,120,136,120,5, - 8,8,6,0,0,32,80,32,112,8,120,136,120,6,5,5, - 6,0,0,120,20,124,144,124,5,7,7,6,0,254,112,136, - 128,136,112,32,64,5,8,8,6,0,0,64,32,0,112,136, - 248,128,112,5,8,8,6,0,0,16,32,0,112,136,248,128, - 112,5,8,8,6,0,0,32,80,0,112,136,248,128,112,5, - 7,7,6,0,0,80,0,112,136,248,128,112,3,8,8,6, - 1,0,128,64,0,192,64,64,64,224,3,8,8,6,1,0, - 64,128,0,192,64,64,64,224,3,8,8,6,1,0,64,160, - 0,192,64,64,64,224,6,10,10,6,0,254,164,168,0,252, - 132,128,128,128,132,252,6,10,10,6,0,254,84,148,0,252, - 132,4,4,4,132,252,5,8,8,6,0,0,40,80,0,176, - 200,136,136,136,5,8,8,6,0,0,64,32,0,112,136,136, - 136,112,4,10,10,6,2,254,48,64,128,144,144,144,144,144, - 144,144,4,10,10,6,0,254,192,32,16,144,144,144,144,144, - 144,144,6,7,7,6,0,1,68,140,140,132,128,64,60,6, - 7,7,6,0,1,136,196,196,132,4,8,240,5,5,5,6, - 0,1,32,0,248,0,32,5,8,8,6,0,0,64,240,200, - 136,136,152,120,16,5,8,8,6,0,0,224,248,136,136,136, - 136,136,248,5,5,5,6,0,1,32,48,248,48,32,5,8, - 8,6,0,0,32,112,248,32,32,32,32,224,5,9,9,6, - 0,255,32,112,168,168,184,136,136,80,32,5,9,9,6,0, - 255,224,128,192,176,168,168,48,40,40,5,9,9,6,0,255, - 248,168,136,136,136,136,136,168,248,5,10,10,6,0,254,32, - 80,80,80,80,136,168,168,136,112}; - From 713626827393113684da673d85595c606adf6f66 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 7 Mar 2015 00:26:28 +0100 Subject: [PATCH 004/302] Added 'dogm_font_data_6x10_marlin_Kanji.h' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is copied from http://www.thingiverse.com/thing:664397 // Japanese Original font // Version 0.1 by ichibey // // 営利目的で利用する際は、かならず許可を得てください。非営利の場合は、CCライセンスに従い使用ください。 // http://creativecommons.org/licenses/by-nc/2.1/jp/legalcode This font is very special. It uses a mixture of katakana an kanji symbols, uses multi character symbols and is only addressable by '\xxx' sequences. --- Marlin/dogm_font_data_6x10_marlin_Kanji.h | 189 ++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 Marlin/dogm_font_data_6x10_marlin_Kanji.h diff --git a/Marlin/dogm_font_data_6x10_marlin_Kanji.h b/Marlin/dogm_font_data_6x10_marlin_Kanji.h new file mode 100644 index 000000000..54c821970 --- /dev/null +++ b/Marlin/dogm_font_data_6x10_marlin_Kanji.h @@ -0,0 +1,189 @@ +/* + Fontname : Japanese Original font, Version 0.1 + Author : http://www.thingiverse.com/ichibey + License : Creative Commons BY-NC +*/ +#include +const u8g_fntpgm_uint8_t u8g_font_6x10_marlin[2911] U8G_SECTION(".progmem.u8g_font_6x10_marlin") = { + 0,6,10,0,254,7,1,153,3,43,32,255,254,8,254,7, + 254,0,0,0,6,0,8,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,3,3,6,1,4,160,160,160,5,7,7, + 6,0,0,80,80,248,80,248,80,80,5,7,7,6,0,0, + 32,112,160,112,40,112,32,5,7,7,6,0,0,72,168,80, + 32,80,168,144,5,7,7,6,0,0,64,160,160,64,168,144, + 104,1,3,3,6,2,4,128,128,128,3,7,7,6,1,0, + 32,64,128,128,128,64,32,3,7,7,6,1,0,128,64,32, + 32,32,64,128,5,5,5,6,0,1,136,80,248,80,136,5, + 5,5,6,0,1,32,32,248,32,32,3,3,3,6,1,255, + 96,64,128,5,1,1,6,0,3,248,3,3,3,6,1,255, + 64,224,64,5,7,7,6,0,0,8,8,16,32,64,128,128, + 5,7,7,6,0,0,112,152,168,168,168,200,112,5,7,7, + 6,0,0,32,96,32,32,32,32,248,5,7,7,6,0,0, + 112,136,8,112,128,128,248,5,7,7,6,0,0,112,136,8, + 48,8,136,112,5,7,7,6,0,0,112,144,144,144,248,16, + 16,5,7,7,6,0,0,248,128,240,8,8,136,112,5,7, + 7,6,0,0,112,136,128,240,136,136,112,5,7,7,6,0, + 0,248,8,8,16,32,32,32,5,7,7,6,0,0,112,136, + 136,112,136,136,112,5,7,7,6,0,0,112,136,136,120,8, + 136,112,3,7,7,6,1,0,64,224,64,0,64,224,64,3, + 7,7,6,1,0,64,224,64,0,96,64,128,4,7,7,6, + 1,0,16,32,64,128,64,32,16,5,3,3,6,0,2,248, + 0,248,4,7,7,6,1,0,128,64,32,16,32,64,128,5, + 7,7,6,0,0,112,136,16,32,32,0,32,5,7,7,6, + 0,0,112,136,152,168,176,128,112,5,7,7,6,0,0,112, + 136,136,136,248,136,136,5,7,7,6,0,0,240,136,136,240, + 136,136,240,5,7,7,6,0,0,112,136,128,128,128,136,112, + 5,7,7,6,0,0,240,136,136,136,136,136,240,5,7,7, + 6,0,0,248,128,128,240,128,128,248,5,7,7,6,0,0, + 248,128,128,240,128,128,128,5,7,7,6,0,0,112,136,128, + 152,136,136,112,5,7,7,6,0,0,136,136,136,248,136,136, + 136,3,7,7,6,1,0,224,64,64,64,64,64,224,5,7, + 7,6,0,0,56,16,16,16,16,144,96,5,7,7,6,0, + 0,136,144,160,192,160,144,136,5,7,7,6,0,0,128,128, + 128,128,128,128,248,5,7,7,6,0,0,136,136,216,168,136, + 136,136,5,7,7,6,0,0,136,136,200,168,152,136,136,5, + 7,7,6,0,0,112,136,136,136,136,136,112,5,7,7,6, + 0,0,240,136,136,240,128,128,128,5,8,8,6,0,255,112, + 136,136,136,136,168,112,8,5,7,7,6,0,0,240,136,136, + 240,136,136,136,5,7,7,6,0,0,112,136,128,112,8,136, + 112,5,7,7,6,0,0,248,32,32,32,32,32,32,5,7, + 7,6,0,0,136,136,136,136,136,136,112,5,7,7,6,0, + 0,136,136,136,80,80,80,32,5,7,7,6,0,0,136,136, + 136,168,168,216,136,5,7,7,6,0,0,136,136,80,32,80, + 136,136,5,7,7,6,0,0,136,136,80,32,32,32,32,5, + 7,7,6,0,0,248,8,80,32,80,128,248,3,7,7,6, + 1,0,224,128,128,128,128,128,224,5,7,7,6,0,0,128, + 128,64,32,16,8,8,3,7,7,6,1,0,224,32,32,32, + 32,32,224,5,3,3,6,0,4,32,80,136,5,1,1,6, + 0,255,248,2,2,2,6,2,6,128,64,5,5,5,6,0, + 0,112,8,120,136,120,5,7,7,6,0,0,128,128,240,136, + 136,136,240,5,5,5,6,0,0,112,136,128,136,112,5,7, + 7,6,0,0,8,8,120,136,136,136,120,5,5,5,6,0, + 0,112,136,248,128,120,4,7,7,6,0,0,48,64,64,240, + 64,64,64,5,7,7,6,0,254,120,136,136,120,8,8,112, + 5,7,7,6,0,0,128,128,240,136,136,136,136,3,7,7, + 6,1,0,64,0,192,64,64,64,224,4,9,9,6,1,254, + 16,0,48,16,16,16,16,16,224,5,7,7,6,0,0,128, + 128,136,144,224,144,136,3,7,7,6,1,0,192,64,64,64, + 64,64,224,5,5,5,6,0,0,240,168,168,168,168,5,5, + 5,6,0,0,240,136,136,136,136,5,5,5,6,0,0,112, + 136,136,136,112,5,7,7,6,0,254,240,136,136,136,240,128, + 128,5,7,7,6,0,254,120,136,136,136,120,8,8,5,5, + 5,6,0,0,176,200,128,128,128,5,5,5,6,0,0,112, + 128,112,8,240,4,7,7,6,0,0,64,64,240,64,64,64, + 48,5,5,5,6,0,0,136,136,136,136,120,5,5,5,6, + 0,0,136,136,80,80,32,5,5,5,6,0,0,136,136,168, + 168,80,5,5,5,6,0,0,136,80,32,80,136,5,7,7, + 6,0,254,136,136,136,120,8,136,112,5,5,5,6,0,0, + 248,16,32,64,248,6,9,9,6,0,255,240,240,240,128,156, + 136,156,136,136,4,9,9,6,0,255,240,240,240,16,208,144, + 208,144,144,5,9,9,6,0,255,112,112,0,248,0,112,112, + 32,248,5,3,3,6,0,4,72,168,144,4,9,9,6,1, + 255,240,16,32,64,32,32,32,32,64,6,9,9,6,0,255, + 4,228,4,228,0,20,36,36,204,5,9,9,6,0,255,224, + 32,224,224,0,240,208,208,248,6,8,8,6,0,255,60,40, + 60,44,32,76,68,156,4,9,9,6,0,255,128,240,32,240, + 224,0,240,64,176,5,9,9,6,0,255,32,32,248,32,48, + 96,160,160,32,5,9,9,6,0,255,248,168,248,168,248,32, + 32,32,32,6,9,9,6,0,255,112,32,252,112,168,160,32, + 32,32,5,9,9,6,0,255,112,144,80,32,120,136,40,16, + 96,6,9,9,6,0,255,112,0,252,120,120,120,32,120,240, + 5,9,9,6,0,255,32,32,248,168,168,248,32,32,32,6, + 9,9,6,0,255,16,220,40,204,8,236,4,124,4,4,7, + 7,6,0,0,224,128,192,128,224,0,240,6,9,9,6,0, + 255,16,124,16,28,16,252,36,76,28,4,9,9,6,0,255, + 128,224,128,128,128,240,64,32,128,5,9,9,6,0,255,32, + 248,32,248,248,248,32,248,32,5,9,9,6,0,255,32,32, + 32,248,168,248,168,168,248,6,9,9,6,0,255,36,44,36, + 76,228,168,44,44,36,4,9,9,6,0,255,32,240,32,240, + 0,240,80,240,80,5,9,9,6,0,255,112,16,32,248,40, + 48,32,32,96,5,9,9,6,0,255,32,64,248,136,248,136, + 248,136,248,6,9,9,6,0,255,32,116,112,116,112,120,128, + 40,72,4,9,9,6,0,255,128,224,160,160,224,176,0,160, + 144,6,9,9,6,0,255,4,8,16,32,92,132,28,4,60, + 4,8,8,6,0,255,128,64,32,208,0,128,0,224,6,9, + 9,6,0,255,60,32,44,40,44,76,64,136,136,5,9,9, + 6,0,255,248,128,240,16,240,240,128,144,144,5,9,9,6, + 1,255,8,8,8,120,64,120,0,80,144,4,8,8,6,0, + 255,192,0,224,32,224,0,160,144,6,9,9,6,0,255,36, + 252,120,120,172,60,4,20,124,4,8,8,6,0,255,240,160, + 192,48,192,128,0,224,5,9,9,6,0,255,32,248,112,112, + 112,248,168,32,96,5,9,9,6,0,255,248,200,232,200,232, + 136,232,232,152,6,9,9,6,0,255,60,4,60,36,44,36, + 252,32,32,4,9,9,6,0,255,224,0,224,32,160,32,240, + 32,96,5,9,9,6,0,255,112,32,248,32,248,248,248,32, + 32,6,9,9,6,0,255,96,32,32,80,80,144,136,8,4, + 5,9,9,6,1,255,8,248,128,152,0,56,16,16,32,4, + 8,8,6,0,255,240,16,128,0,192,128,144,224,5,7,7, + 6,0,0,248,8,248,8,8,48,192,4,5,5,6,1,0, + 240,16,80,64,128,4,5,5,6,1,0,48,64,160,32,32, + 5,5,5,6,0,0,32,248,136,16,96,5,4,4,6,0, + 0,112,32,32,248,4,5,5,6,1,0,32,240,96,160,160, + 4,5,5,6,1,0,64,240,80,64,64,4,4,4,6,1, + 0,224,32,32,240,4,5,5,6,1,0,240,16,112,16,240, + 5,4,4,6,0,0,168,168,8,112,5,1,1,6,0,3, + 248,5,7,7,6,0,0,248,8,40,48,32,64,128,4,7, + 7,6,0,0,16,48,96,160,32,32,32,5,7,7,6,0, + 0,32,248,136,8,16,16,96,5,6,6,6,0,0,112,32, + 32,32,32,248,5,7,7,6,0,0,16,248,48,80,80,144, + 16,5,7,7,6,0,0,64,248,72,72,72,136,152,5,7, + 7,6,0,0,32,240,32,32,248,32,32,5,7,7,6,0, + 0,120,136,136,8,16,16,96,5,7,7,6,0,0,128,248, + 144,16,16,16,96,4,7,7,6,1,0,240,16,16,16,16, + 16,240,5,7,7,6,0,0,80,248,80,16,16,16,96,5, + 7,7,6,0,0,232,8,232,8,8,16,96,5,7,7,6, + 0,0,248,8,16,32,80,136,136,5,8,8,6,0,0,64, + 64,248,72,72,64,64,56,5,7,7,6,0,0,136,136,72, + 8,16,16,96,5,8,8,6,0,0,128,248,136,136,104,24, + 16,224,5,7,7,6,0,0,120,16,16,248,16,16,224,5, + 7,7,6,0,0,168,168,168,8,16,16,224,5,7,7,6, + 0,0,112,0,248,16,16,16,96,4,7,7,6,1,0,128, + 128,192,160,144,128,128,5,7,7,6,0,0,16,248,16,16, + 32,32,192,5,6,6,6,0,0,112,0,0,0,0,248,5, + 7,7,6,0,0,120,8,8,80,32,80,136,5,8,8,6, + 0,0,32,120,8,48,112,168,168,32,4,6,6,6,1,1, + 16,16,32,32,64,128,5,6,6,6,0,1,32,16,136,136, + 136,8,5,7,7,6,0,0,128,152,224,128,128,128,120,5, + 7,7,6,0,0,248,8,8,8,16,16,96,5,7,7,6, + 0,0,32,32,80,144,136,8,8,5,7,7,6,0,0,32, + 248,32,32,168,168,168,5,7,7,6,0,0,248,8,8,80, + 32,16,8,5,7,7,6,0,0,112,0,96,0,0,240,8, + 5,7,7,6,0,0,32,64,64,128,136,248,8,5,7,7, + 6,0,0,8,8,80,48,40,72,128,5,7,7,6,0,0, + 240,64,64,248,64,64,56,5,7,7,6,0,0,64,248,72, + 72,80,64,64,5,6,6,6,0,0,112,16,16,16,16,248, + 5,7,7,6,0,0,248,8,8,120,8,8,248,5,7,7, + 6,0,0,112,0,248,8,8,16,96,4,7,7,6,1,0, + 144,144,144,16,16,16,96,5,7,7,6,0,0,32,160,160, + 160,168,168,48,5,7,7,6,0,0,128,128,128,136,136,144, + 224,5,7,7,6,0,0,248,136,136,136,136,136,248,5,7, + 7,6,0,0,248,136,136,8,16,16,96,5,6,6,6,0, + 0,200,8,8,8,48,192,5,2,2,6,0,5,144,72,4, + 4,4,6,0,4,96,144,144,96,6,9,9,6,0,254,56, + 68,64,132,136,252,8,8,4,6,7,7,6,0,255,112,136, + 136,148,252,148,136,3,3,3,6,0,1,192,32,224,5,9, + 9,6,0,255,64,248,64,120,72,168,144,168,72,6,9,9, + 6,0,255,56,72,16,248,216,136,252,80,136,4,7,7,6, + 0,255,240,144,144,144,144,240,16,5,9,9,6,0,255,64, + 240,64,240,240,224,80,72,248,5,9,9,6,1,255,120,8, + 248,168,168,56,56,56,8,5,10,10,6,0,254,240,0,248, + 72,72,224,224,224,0,240,6,9,9,6,0,255,28,208,20, + 20,212,20,16,84,212,5,9,9,6,0,255,248,64,240,240, + 240,240,64,80,80,5,9,9,6,1,255,8,8,120,32,192, + 56,8,48,192,4,7,7,6,0,255,224,64,48,192,0,192, + 48,5,9,9,6,1,255,64,72,0,224,32,32,72,64,184, + 4,9,9,6,0,255,160,240,64,240,64,160,16,0,240,5, + 9,9,6,0,255,64,248,32,248,16,112,128,128,120,0,0, + 0,6,0,8,4,9,9,6,1,255,96,0,240,96,96,96, + 240,144,240,5,9,9,6,0,255,240,144,152,0,248,80,32, + 80,136,5,9,9,6,1,255,8,248,128,56,8,8,72,120, + 128,4,8,8,6,0,255,240,16,192,0,192,0,0,240,6, + 6,6,6,0,1,4,224,172,228,160,228,4,9,9,6,0, + 255,128,192,128,240,224,32,160,32,96,6,8,8,6,0,255, + 16,16,16,28,80,80,80,252,5,9,9,6,0,255,64,240, + 200,136,136,136,152,120,16,5,8,8,6,0,0,224,248,136, + 136,136,136,136,248,6,7,7,6,0,0,32,48,56,252,56, + 48,32,6,7,7,6,0,1,16,56,124,16,16,16,240,5, + 9,9,6,0,255,32,112,168,168,184,136,136,112,32,5,10, + 10,6,0,254,224,128,192,128,176,40,40,48,40,40,5,10, + 10,6,0,254,248,168,136,136,136,136,136,136,168,248,255}; From 3e8c5678f547fa99457ab5a67c20c98cedf651d2 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Sat, 7 Mar 2015 21:10:40 -0500 Subject: [PATCH 005/302] fix bug where, i.e., "G1X1E1" would be interpretted as "G1 X10 E1", because strtod() will read the E address value as if it was a base 10 exponent. --- Marlin/Marlin_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3c1702a5..491216da1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -909,7 +909,12 @@ void get_command() float code_value() { - return (strtod(strchr_pointer + 1, NULL)); + float ret; + char *e = strchr(strchr_pointer, 'E'); + if (e != NULL) *e = 0; + ret = strtod(strchr_pointer+1, NULL); + if (e != NULL) *e = 'E'; + return ret; } long code_value_long() From 2d5134b0ed2492cbe2d6c1de939974ed3eda1051 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 17:46:25 +0100 Subject: [PATCH 006/302] Introduce - clean - prepae language files --- Marlin/language.h | 93 +++++------------------ Marlin/language_an.h | 8 +- Marlin/language_ca.h | 11 ++- Marlin/language_de.h | 30 ++++---- Marlin/language_en.h | 12 ++- Marlin/language_es.h | 8 +- Marlin/language_eu.h | 8 +- Marlin/language_fi.h | 52 +++++++------ Marlin/language_fr.h | 10 ++- Marlin/language_it.h | 8 +- Marlin/language_kana.h | 141 ++++++++++++++++++++++++++++++++++ Marlin/language_kana_utf8.h | 145 +++++++++++++++++++++++++++++++++++ Marlin/language_kanji.h | 147 ++++++++++++++++++++++++++++++++++++ Marlin/language_nl.h | 8 +- Marlin/language_pl.h | 10 ++- Marlin/language_pt-br.h | 32 ++++---- Marlin/language_pt.h | 32 ++++---- Marlin/language_ru.h | 2 +- 18 files changed, 580 insertions(+), 177 deletions(-) create mode 100644 Marlin/language_kana.h create mode 100644 Marlin/language_kana_utf8.h create mode 100644 Marlin/language_kanji.h diff --git a/Marlin/language.h b/Marlin/language.h index f894a27ef..330bb3c91 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -13,20 +13,23 @@ // ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS // Languages -// en English -// pl Polish -// fr French -// de German -// es Spanish -// ru Russian -// it Italian -// pt Portuguese -// pt-br Portuguese (Brazil) -// fi Finnish -// an Aragonese -// nl Dutch -// ca Catalan -// eu Basque-Euskera +// en English +// pl Polish +// fr French +// de German +// es Spanish +// ru Russian +// it Italian +// pt Portuguese +// pt-br Portuguese (Brazil) +// fi Finnish +// an Aragonese +// nl Dutch +// ca Catalan +// eu Basque-Euskera +// kana Japanese +// kana_utf Japanese +// kanji Japanese #ifndef LANGUAGE_INCLUDE // pick your language from the list above @@ -198,68 +201,6 @@ #define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX // LCD Menu Messages - -// Add your own character. Reference: https://github.com/MarlinFirmware/Marlin/pull/1434 photos -// and https://www.sparkfun.com/datasheets/LCD/HD44780.pdf page 17-18 -#ifdef DOGLCD - #define STR_Ae "\304" // 'Ä' U8glib - #define STR_ae "\344" // 'ä' - #define STR_Oe "\326" // 'Ö' - #define STR_oe STR_Oe // 'ö' - #define STR_Ue "\334" // 'Ü' - #define STR_ue STR_Ue // 'ü' - #define STR_sz "\337" // 'ß' - #define STR_h2 "\262" // '²' - #define STR_h3 "\263" // '³' - #define STR_Deg "\260" // '°' - #define STR_THERMOMETER "\377" -#else - #ifdef DISPLAY_CHARSET_HD44780_JAPAN // HD44780 ROM Code: A00 (Japan) - #define STR_ae "\xe1" - #define STR_Ae STR_ae - #define STR_oe "\357" - #define STR_Oe STR_oe - #define STR_ue "\365" - #define STR_Ue STR_ue - #define STR_sz "\342" - #define STR_h2 "2" - #define STR_h3 "3" - #define STR_Deg "\271" - #define STR_THERMOMETER "\002" - #endif - #ifdef DISPLAY_CHARSET_HD44780_WESTERN // HD44780 ROM Code: A02 (Western) - #define STR_Ae "\216" - #define STR_ae "\204" - #define STR_Oe "\211" - #define STR_oe "\204" - #define STR_Ue "\212" - #define STR_ue "\201" - #define STR_sz "\160" - #define STR_h2 "\262" - #define STR_h3 "\263" - #define STR_Deg "\337" - #define STR_THERMOMETER "\002" - #endif -#endif -/* -#define TESTSTRING000 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" -#define TESTSTRING020 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define TESTSTRING040 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" -#define TESTSTRING060 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" -#define TESTSTRING100 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" -#define TESTSTRING120 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" -#define TESTSTRING140 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" -#define TESTSTRING160 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" -#define TESTSTRING200 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" -#define TESTSTRING220 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" -#define TESTSTRING240 "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" -#define TESTSTRING260 "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" -#define TESTSTRING300 "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" -#define TESTSTRING320 "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" -#define TESTSTRING340 "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" -#define TESTSTRING360 "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" -*/ - #include LANGUAGE_INCLUDE #include "language_en.h" diff --git a/Marlin/language_an.h b/Marlin/language_an.h index e26c7d868..6155d5742 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_AN_H #define LANGUAGE_AN_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " parada." #define MSG_SD_INSERTED "Tarcheta colocada" #define MSG_SD_REMOVED "Tarcheta retirada" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Ixoriador" #define MSG_FLOW "Fluxo" #define MSG_CONTROL "Control" -#define MSG_MIN "\002 Min" -#define MSG_MAX "\002 Max" -#define MSG_FACTOR "\002 Fact" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On" #define MSG_OFF "Off" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index e7f837d5d..2627438ec 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -8,6 +8,9 @@ #ifndef LANGUAGE_CA_H #define LANGUAGE_CA_H +//#define MAPPER_NON +#define MAPPER_C2C3 // because of "ó" + #define WELCOME_MSG MACHINE_NAME " preparada." #define MSG_SD_INSERTED "SD detectada." #define MSG_SD_REMOVED "SD expulsada." @@ -46,9 +49,9 @@ #define MSG_FAN_SPEED "Vel. Ventilador" #define MSG_FLOW "Fluxe" #define MSG_CONTROL "Control" -#define MSG_MIN " \002 Min" -#define MSG_MAX " \002 Max" -#define MSG_FACTOR " \002 Fact" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On " #define MSG_OFF "Off" @@ -76,7 +79,7 @@ #define MSG_TEMPERATURE "Temperatura" #define MSG_MOTION "Moviment" #define MSG_VOLUMETRIC "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index d41df208d..d2eb6d34d 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -8,26 +8,28 @@ #ifndef LANGUAGE_DE_H #define LANGUAGE_DE_H +#define MAPPER_C2C3 + #define WELCOME_MSG MACHINE_NAME " Bereit." #define MSG_SD_INSERTED "SDKarte erkannt." #define MSG_SD_REMOVED "SDKarte entfernt." -#define MSG_MAIN "Hauptmen" STR_ue +#define MSG_MAIN "Hauptmenü" #define MSG_AUTOSTART "Autostart" #define MSG_DISABLE_STEPPERS "Motoren Aus" // M84 #define MSG_AUTO_HOME "Home" // G28 #define MSG_SET_HOME_OFFSETS "Setze Home hier" #define MSG_SET_ORIGIN "Setze Null hier" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp -#define MSG_PREHEAT_PLA "Vorw" STR_ae "rmen PLA" -#define MSG_PREHEAT_PLA_N "Vorw" STR_ae "rmen PLA " +#define MSG_PREHEAT_PLA "Vorwärmen PLA" +#define MSG_PREHEAT_PLA_N "Vorwärmen PLA " #define MSG_PREHEAT_PLA_ALL "Vorw. PLA Alle" #define MSG_PREHEAT_PLA_BEDONLY "Vorw. PLA Bett" -#define MSG_PREHEAT_PLA_SETTINGS "Vorw" STR_ae "rm. PLA Ein." -#define MSG_PREHEAT_ABS "Vorw" STR_ae "rmen ABS" -#define MSG_PREHEAT_ABS_N "Vorw" STR_ae "rmen ABS " +#define MSG_PREHEAT_PLA_SETTINGS "Vorwärm. PLA Ein." +#define MSG_PREHEAT_ABS "Vorwärmen ABS" +#define MSG_PREHEAT_ABS_N "Vorwärmen ABS " #define MSG_PREHEAT_ABS_ALL "Vorw. ABS Alle" #define MSG_PREHEAT_ABS_BEDONLY "Vorw. ABS Bett" -#define MSG_PREHEAT_ABS_SETTINGS "Vorw" STR_ae "rm. ABS Ein." -#define MSG_COOLDOWN "Abk" STR_ue "hlen" +#define MSG_PREHEAT_ABS_SETTINGS "Vorwärm. ABS Ein." +#define MSG_COOLDOWN "Abkühlen" #define MSG_SWITCH_PS_ON "Netzteil Ein" #define MSG_SWITCH_PS_OFF "Netzteil Aus" #define MSG_RETRACT "Retract" @@ -40,14 +42,14 @@ #define MSG_MOVE_1MM " 1.0 mm" #define MSG_MOVE_10MM "10.0 mm" #define MSG_SPEED "Geschw." -#define MSG_NOZZLE "D" STR_ue "se" +#define MSG_NOZZLE "Düse" #define MSG_BED "Bett" -#define MSG_FAN_SPEED "L" STR_ue "ftergeschw." +#define MSG_FAN_SPEED "Lüftergeschw." #define MSG_FLOW "Fluss" #define MSG_CONTROL "Einstellungen" -#define MSG_MIN STR_THERMOMETER " Min" -#define MSG_MAX STR_THERMOMETER " Max" -#define MSG_FACTOR STR_THERMOMETER " Faktor" +#define MSG_MIN LCD_STR_THERMOMETER " " Min" +#define MSG_MAX LCD_STR_THERMOMETER " " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " " Faktor" #define MSG_AUTOTEMP "AutoTemp" #define MSG_ON "Ein" #define MSG_OFF "Aus" @@ -75,7 +77,7 @@ #define MSG_TEMPERATURE "Temperatur" #define MSG_MOTION "Bewegung" #define MSG_VOLUMETRIC "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3 +#define MSG_VOLUMETRIC_ENABLED "E in mm³" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Filament D 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Filament D 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Filament D 3" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 1ba950af9..42e9f0b1c 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -8,6 +8,10 @@ #ifndef LANGUAGE_EN_H #define LANGUAGE_EN_H +#if !(defined(MAPPER_NON) || defined(MAPPER_C2C3) || defined(MAPPER_D0D1_MOD) || defined(MAPPER_E382E383)) + #define MAPPER_NON // For direct asci codes +#endif + #ifndef WELCOME_MSG #define WELCOME_MSG MACHINE_NAME " ready." #endif @@ -156,13 +160,13 @@ #define MSG_CONTROL "Control" #endif #ifndef MSG_MIN -#define MSG_MIN " " STR_THERMOMETER " Min" +#define MSG_MIN " "LCD_STR_THERMOMETER " Min" #endif #ifndef MSG_MAX -#define MSG_MAX " " STR_THERMOMETER " Max" +#define MSG_MAX " "LCD_STR_THERMOMETER " Max" #endif #ifndef MSG_FACTOR -#define MSG_FACTOR " " STR_THERMOMETER " Fact" +#define MSG_FACTOR " "LCD_STR_THERMOMETER " Fact" #endif #ifndef MSG_AUTOTEMP #define MSG_AUTOTEMP "Autotemp" @@ -255,7 +259,7 @@ #define MSG_VOLUMETRIC "Filament" #endif #ifndef MSG_VOLUMETRIC_ENABLED -#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3 +#define MSG_VOLUMETRIC_ENABLED "E in mm3" #endif #ifndef MSG_FILAMENT_SIZE_EXTRUDER_0 #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 2d7b785bd..d6a38d3ce 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_ES_H #define LANGUAGE_ES_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " lista." #define MSG_SD_INSERTED "Tarjeta colocada" #define MSG_SD_REMOVED "Tarjeta retirada" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Ventilador" #define MSG_FLOW "Flujo" #define MSG_CONTROL "Control" -#define MSG_MIN "\002 Min" -#define MSG_MAX "\002 Max" -#define MSG_FACTOR "\002 Fact" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On" #define MSG_OFF "Off" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 0f615d5a3..f4857ccfb 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_EU_H #define LANGUAGE_EU_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " prest." #define MSG_SD_INSERTED "Txartela sartuta" #define MSG_SD_REMOVED "Txartela kenduta" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Haizagailua" #define MSG_FLOW "Fluxua" #define MSG_CONTROL "Kontrola" -#define MSG_MIN " \002 Min" -#define MSG_MAX " \002 Max" -#define MSG_FACTOR " \002 Faktorea" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Faktorea" #define MSG_AUTOTEMP "Auto tenperatura" #define MSG_ON "On " #define MSG_OFF "Off" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 62fdc7638..76dcb882d 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_FI_H #define LANGUAGE_FI_H +#define MAPPER_C2C3 + #define WELCOME_MSG MACHINE_NAME " valmis." #define MSG_SD_INSERTED "Kortti asetettu" #define MSG_SD_REMOVED "Kortti poistettu" @@ -17,21 +19,21 @@ #define MSG_AUTO_HOME "Aja referenssiin" #define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_SET_ORIGIN "Aseta origo" -#define MSG_PREHEAT_PLA "Esil" STR_ae "mmit" STR_ae " PLA" -#define MSG_PREHEAT_PLA_N "Esil" STR_ae "mmit" STR_ae " PLA " -#define MSG_PREHEAT_PLA_ALL "Esil" STR_ae ". PLA Kaikki" -#define MSG_PREHEAT_PLA_BEDONLY "Esil" STR_ae ". PLA Alusta" -#define MSG_PREHEAT_PLA_SETTINGS "Esil" STR_ae "mm. PLA konf" -#define MSG_PREHEAT_ABS "Esil" STR_ae "mmit" STR_ae " ABS" -#define MSG_PREHEAT_ABS_N "Esil" STR_ae "mmit" STR_ae " ABS " -#define MSG_PREHEAT_ABS_ALL "Esil" STR_ae ". ABS Kaikki" -#define MSG_PREHEAT_ABS_BEDONLY "Esil" STR_ae ". ABS Alusta" -#define MSG_PREHEAT_ABS_SETTINGS "Esil" STR_ae "mm. ABS konf" -#define MSG_COOLDOWN "J" STR_ae "" STR_ae "hdyt" STR_ae "" -#define MSG_SWITCH_PS_ON "Virta p" STR_ae "" STR_ae "lle" +#define MSG_PREHEAT_PLA "Esilämmitä PLA" +#define MSG_PREHEAT_PLA_N "Esilämmitä PLA " +#define MSG_PREHEAT_PLA_ALL "Esilä. PLA Kaikki" +#define MSG_PREHEAT_PLA_BEDONLY "Esilä. PLA Alusta" +#define MSG_PREHEAT_PLA_SETTINGS "Esilämm. PLA konf" +#define MSG_PREHEAT_ABS "Esilämmitä ABS" +#define MSG_PREHEAT_ABS_N "Esilämmitä ABS " +#define MSG_PREHEAT_ABS_ALL "Esilä. ABS Kaikki" +#define MSG_PREHEAT_ABS_BEDONLY "Esilä. ABS Alusta" +#define MSG_PREHEAT_ABS_SETTINGS "Esilämm. ABS konf" +#define MSG_COOLDOWN "Jäähdytä" +#define MSG_SWITCH_PS_ON "Virta päälle" #define MSG_SWITCH_PS_OFF "Virta pois" #define MSG_EXTRUDE "Pursota" -#define MSG_RETRACT "Ved" STR_ae " takaisin" +#define MSG_RETRACT "Vedä takaisin" #define MSG_MOVE_AXIS "Liikuta akseleita" #define MSG_MOVE_X "Liikuta X" #define MSG_MOVE_Y "Liikuta Y" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Tuul. nopeus" #define MSG_FLOW "Virtaus" #define MSG_CONTROL "Kontrolli" -#define MSG_MIN STR_THERMOMETER " Min" -#define MSG_MAX STR_THERMOMETER " Max" -#define MSG_FACTOR STR_THERMOMETER " Kerr" +#define MSG_MIN LCD_STR_THERMOMETER "" Min" +#define MSG_MAX LCD_STR_THERMOMETER "" Max" +#define MSG_FACTOR LCD_STR_THERMOMETER "" Kerr" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On " #define MSG_OFF "Off" @@ -73,10 +75,10 @@ #define MSG_YSTEPS "Ysteps/mm" #define MSG_ZSTEPS "Zsteps/mm" #define MSG_ESTEPS "Esteps/mm" -#define MSG_TEMPERATURE "L" STR_ae "mp" STR_oe "tila" +#define MSG_TEMPERATURE "Lämpötila" #define MSG_MOTION "Liike" #define MSG_VOLUMETRIC "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_VOLUMETRIC_ENABLED "E in mm³" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" @@ -84,13 +86,13 @@ #define MSG_STORE_EPROM "Tallenna muistiin" #define MSG_LOAD_EPROM "Lataa muistista" #define MSG_RESTORE_FAILSAFE "Palauta oletus" -#define MSG_REFRESH "P" STR_ae "ivit" STR_ae "" +#define MSG_REFRESH "Päivitä" #define MSG_WATCH "Seuraa" #define MSG_PREPARE "Valmistele" -#define MSG_TUNE "S" STR_ae "" STR_ae "d" STR_ae "" -#define MSG_PAUSE_PRINT "Keskeyt" STR_ae " tulostus" +#define MSG_TUNE "Säädä" +#define MSG_PAUSE_PRINT "Keskeytä tulostus" #define MSG_RESUME_PRINT "Jatka tulostusta" -#define MSG_STOP_PRINT "Pys" STR_ae "yt" STR_ae " tulostus" +#define MSG_STOP_PRINT "Pysäytä tulostus" #define MSG_CARD_MENU "Korttivalikko" #define MSG_NO_CARD "Ei korttia" #define MSG_DWELL "Nukkumassa..." @@ -100,9 +102,9 @@ #define MSG_NO_MOVE "Ei liiketta." #define MSG_KILLED "KILLED. " #define MSG_STOPPED "STOPPED. " -#define MSG_CONTROL_RETRACT "Ved" STR_ae " mm" -#define MSG_CONTROL_RETRACT_SWAP "Va. Ved" STR_ae " mm" -#define MSG_CONTROL_RETRACTF "Ved" STR_ae " V" +#define MSG_CONTROL_RETRACT "Vedä mm" +#define MSG_CONTROL_RETRACT_SWAP "Va. Vedä mm" +#define MSG_CONTROL_RETRACTF "Vedä V" #define MSG_CONTROL_RETRACT_ZLIFT "Z mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER_SWAP "Va. UnRet +mm" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 8019f96a5..4c443f90d 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_FR_H #define LANGUAGE_FR_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " prete." #define MSG_SD_INSERTED "Carte inseree" #define MSG_SD_REMOVED "Carte retiree" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Vite. ventilateur" #define MSG_FLOW "Flux" #define MSG_CONTROL "Controler" -#define MSG_MIN " \002 Min" -#define MSG_MAX " \002 Max" -#define MSG_FACTOR " \002 Facteur" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Facteur" #define MSG_AUTOTEMP "Temp. Auto." #define MSG_ON "Marche " #define MSG_OFF "Arret" @@ -76,7 +78,7 @@ #define MSG_TEMPERATURE "Temperature" #define MSG_MOTION "Mouvement" #define MSG_VOLUMETRIC "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index b0b644231..0cb0dc94d 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_IT_H #define LANGUAGE_IT_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "SD Card inserita" #define MSG_SD_REMOVED "SD Card rimossa" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Ventola" #define MSG_FLOW "Flusso" #define MSG_CONTROL "Controllo" -#define MSG_MIN " \002 Min" -#define MSG_MAX " \002 Max" -#define MSG_FACTOR " \002 Fact" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "ON " #define MSG_OFF "OFF" diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h new file mode 100644 index 000000000..050ebd5c5 --- /dev/null +++ b/Marlin/language_kana.h @@ -0,0 +1,141 @@ +/** + * Japanese (Kana) + * + * LCD Menu Messages + * Please note these are limited to 17 characters! + * + */ + +#ifndef LANGUAGE_KANA_H +#define LANGUAGE_KANA_H + +#define MAPPER_NON + +// 片仮名表示定義 +#define WELCOME_MSG MACHINE_NAME " ready." +#define MSG_SD_INSERTED "\xb6\xb0\xc4\xde\x20\xbf\xb3\xc6\xad\xb3\xbb\xda\xcf\xbc\xc0" // "Card inserted" +#define MSG_SD_REMOVED "\xb6\xb0\xc4\xde\xb6xde\xb1\xd8\xcf\xbe\xdd" // "Card removed" +#define MSG_MAIN "\xd2\xb2\xdd" // "Main" +#define MSG_AUTOSTART "\xbc\xde\xc4\xde\xb3\xb6\xb2\xbc" // "Autostart" +#define MSG_DISABLE_STEPPERS "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "Disable steppers" +#define MSG_AUTO_HOME "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3" // "Auto home" +#define MSG_SET_HOME_OFFSETS "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2" // "Set home offsets" +#define MSG_SET_ORIGIN "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4" // "Set origin" +#define MSG_PREHEAT_PLA "PLA \xd6\xc8\xc2" // "Preheat PLA" +#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \xbd\xcd\xde\xc3" // " All" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xcd\xde\xaf\xc4\xde" // "Bed" +#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xaf\xc3\xb2" // "conf" +#define MSG_PREHEAT_ABS "ABS \xd6\xc8\xc2" // "Preheat ABS" +#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xbd\xcd\xde\xc3" // " All" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xcd\xde\xaf\xc4\xde" // "Bed" +#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xaf\xc3\xb2" // "conf" +#define MSG_COOLDOWN "\xb6\xc8\xc2\xc3\xb2\xbc" // "Cooldown" +#define MSG_SWITCH_PS_ON "\xc3\xde\xdd\xb9\xdd\xde\x20\xb5\xdd" // "Switch power on" +#define MSG_SWITCH_PS_OFF "\xc3\xde\xdd\xb9\xdd\xde\x20\xb5\xcc" // "Switch power off" +#define MSG_EXTRUDE "\xb5\xbc\xc0\xde\xbc" // "Extrude" +#define MSG_RETRACT "\xd8\xc4\xd7\xb8\xc4" // "Retract" +#define MSG_MOVE_AXIS "\xbc\xde\xb8\xb2\xc4\xde\xb3" // "Move axis" +#define MSG_MOVE_X "X\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Move X" +#define MSG_MOVE_Y "Y\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Move Y" +#define MSG_MOVE_Z "Z\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Move Z" +#define MSG_MOVE_E "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0" // "Extruder" +#define MSG_MOVE_01MM "0.1mm \xb2\xc4\xde\xb3" // "Move 0.1mm" +#define MSG_MOVE_1MM " 1mm \xb2\xc4\xde\xb3" // "Move 1mm" +#define MSG_MOVE_10MM " 10mm \xb2\xc4\xde\xb3" // "Move 10mm" +#define MSG_SPEED "\xbd\xcb\xdf\xb0\xc4\xde" // "Speed" +#define MSG_NOZZLE "\xc9\xbd\xde\xd9" // "Nozzle" +#define MSG_BED "\xcd\xde\xaf\xc4\xde" // "Bed" +#define MSG_FAN_SPEED "\xcc\xa7\xdd\xbf\xb8\xc4\xde" // "Fan speed" +#define MSG_FLOW "\xb5\xb8\xd8\xd8\xae\xb3" // "Flow" +#define MSG_CONTROL "\xba\xdd\xc4\xdb\xb0\xd9" // "Control" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "Autotemp" +#define MSG_ON "On " +#define MSG_OFF "Off" +#define MSG_PID_P "PID-P" +#define MSG_PID_I "PID-I" +#define MSG_PID_D "PID-D" +#define MSG_PID_C "PID-C" +#define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "Accel" +#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VZ_JERK "Vz-jerk" +#define MSG_VE_JERK "Ve-jerk" +#define MSG_VMAX "Vmax " +#define MSG_X "x" +#define MSG_Y "y" +#define MSG_Z "z" +#define MSG_E "e" +#define MSG_VMIN "Vmin" +#define MSG_VTRAV_MIN "VTrav min" +#define MSG_AMAX "Amax " +#define MSG_A_RETRACT "A-retract" +#define MSG_XSTEPS "Xsteps/mm" +#define MSG_YSTEPS "Ysteps/mm" +#define MSG_ZSTEPS "Zsteps/mm" +#define MSG_ESTEPS "Esteps/mm" +#define MSG_TEMPERATURE "\xb5\xdd\xc4\xde" // "Temperature" +#define MSG_MOTION "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2" // "Motion" +#define MSG_VOLUMETRIC "\xcc\xa8\xd7\xd2\xdd\xc4" // "Filament" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" +#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" +#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" +#define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4" +#define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCD contrast" +#define MSG_STORE_EPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "Store memory" +#define MSG_LOAD_EPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\ba\xd0" // "Load memory" +#define MSG_RESTORE_FAILSAFE "\xbe\xaf\xc3\xb2\xd8\xbe\xaf\xc4" // "Restore failsafe" +#define MSG_REFRESH "\xd8\xcc\xda\xaf\xbc\xad" // "Refresh" +#define MSG_WATCH "\xb2\xdd\xcc\xab" // "Info screen" +#define MSG_PREPARE "\xbc\xde\xad\xdd\xcb\xde\xbe\xaf\xc3\xb2" // "Prepare" +#define MSG_TUNE "\xc1\xae\xb3\xbe\xb2" // "Tune" +#define MSG_PAUSE_PRINT "\xb2\xc1\xbc\xde\xc3\xb2\xbc" // "Pause print" +#define MSG_RESUME_PRINT "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "Resume print" +#define MSG_STOP_PRINT "\xcc\xdf\xd8\xdd\xc4\xc3\xb2\xbc" // "Stop print" +#define MSG_CARD_MENU "SD\xb6\xb0\xc4\xde\xb6\xd7\xcc\xdf\xd8\xdd\xc4" // "Print from SD" +#define MSG_NO_CARD "SD\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "No SD card" +#define MSG_DWELL "\xbd\xd8\xb0\xcc\xdf" // "Sleep..." +#define MSG_USERWAIT "\xbc\xca\xde\xd7\xb9\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "Wait for user..." +#define MSG_RESUMING "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "Resuming print" +#define MSG_PRINT_ABORTED "\xcc\xdf\xd8\xdd\xc4\xc1\xad\xb3\xbc\xbb\xda\xcf\xbc\xc0" // "Print aborted" +#define MSG_NO_MOVE "\xb3\xba\xde\xb7\xcf\xbe\xdd" // "No move." +#define MSG_KILLED "\xbc\xae\xb3\xb7\xae" // "KILLED. " +#define MSG_STOPPED "\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "STOPPED. " +#define MSG_CONTROL_RETRACT "Retract mm" +#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" +#define MSG_CONTROL_RETRACTF "Retract V" +#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" +#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" +#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" +#define MSG_AUTORETRACT "AutoRetr." +#define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "Change filament" +#define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\xbb\xb2\xd6\xd0\xba\xd0" // "Init. SD card" +#define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xba\xb3\xb6\xdd" // "Change SD card" +#define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde \xcd\xde\xaf\xc4\xee\xb6\xde\xb2" // "Z probe out. bed" +#define MSG_POSITION_UNKNOWN "\xb9\xde\xdd\xc3\xdd\xcaXY\xb2\xc4\xde\xb3\xba\xdeZ" // "Home X/Y before Z" +#define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Z Offset" +#define MSG_BABYSTEP_X "\xcb\xde\xc4\xde\xb3 X" // "Babystep X" +#define MSG_BABYSTEP_Y "\xcb\xde\xc4\xde\xb3 Y" // "Babystep Y" +#define MSG_BABYSTEP_Z "\xcb\xde\xc4\xde\xb3 Z" // "Babystep Z" +#define MSG_ENDSTOP_ABORT "Endstop abort" + +#define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3..." // "Heating..." +#define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8x\xae\xb3" // "Heating done." +#define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\xb6\xc8\xc2\xc1\xad\xb3" // "Bed Heating." +#define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\xb6\xc8\xc2\xb6\xdd\xd8x\xae\xb3" // "Bed done." +#define MSG_ENDSTOPS_HIT "endstops hit: " + +#ifdef DELTA_CALIBRATION_MENU + #define MSG_DELTA_CALIBRATE "Delta Calibration" + #define MSG_DELTA_CALIBRATE_X "Calibrate X" + #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" + #define MSG_DELTA_CALIBRATE_Z "Calibrate Z" + #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" +#endif // DELTA_CALIBRATION_MENU + +#endif // LANGUAGE_KANA_H diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h new file mode 100644 index 000000000..9b74986f8 --- /dev/null +++ b/Marlin/language_kana_utf8.h @@ -0,0 +1,145 @@ +/** + * Japanese (Kana UTF8 version) + * + * LCD Menu Messages + * Please note these are limited to 17 characters! + * + */ + +#ifndef LANGUAGE_KANA_UTF_H +#define LANGUAGE_KANA_UTF_H + +#define MAPPER_E382E383 + +// This is very crude replacement of the codes used in language_kana.h from somebody who really does not know what he is doing. +// Just to show the potential benefit of unicode. +// This translation can be improved by using the full charset of unicode codeblock U+30A0 to U+30FF. + +// 片仮名表示定義 +#define WELCOME_MSG MACHINE_NAME " ready." +#define MSG_SD_INSERTED "セート゛ ンウニユウアレマシタ" // "Card inserted" +#define MSG_SD_REMOVED "セート゛セ゛アリマセン" // "Card removed" +#define MSG_MAIN "ナイン" // "Main" +#define MSG_AUTOSTART "シ゛ト゛ウセイシ" // "Autostart" +#define MSG_DISABLE_STEPPERS "モーターテ゛ンケ゛ン オフ" // "Disable steppers" +#define MSG_AUTO_HOME "ケ゛ンテンニイト゛ウ" // "Auto home" +#define MSG_SET_HOME_OFFSETS "キシ゛ユンオフセツトセツテイ" // "Set home offsets" +#define MSG_SET_ORIGIN "キシ゛ユンセツト" // "Set origin" +#define MSG_PREHEAT_PLA "PLA ヨネシ" // "Preheat PLA" +#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " スヘ゛テ" // " All" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " ヘ゛ツト゛" // "Bed" +#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " セツテイ" // "conf" +#define MSG_PREHEAT_ABS "ABS ヨネシ" // "Preheat ABS" +#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " スヘ゛テ" // " All" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " ヘ゛ツト゛" // "Bed" +#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " セツテイ" // "conf" +#define MSG_COOLDOWN "セネシテイシ" // "Cooldown" +#define MSG_SWITCH_PS_ON "テ゛ンケン゛ オン" // "Switch power on" +#define MSG_SWITCH_PS_OFF "テ゛ンケン゛ オフ" // "Switch power off" +#define MSG_EXTRUDE "オシタ゛シ" // "Extrude" +#define MSG_RETRACT "リトラケト" // "Retract" +#define MSG_MOVE_AXIS "シ゛ケイト゛ウ" // "Move axis" +#define MSG_MOVE_X "Xシ゛ケ イト゛ウ" // "Move X" +#define MSG_MOVE_Y "Yシ゛ケ イト゛ウ" // "Move Y" +#define MSG_MOVE_Z "Zシ゛ケ イト゛ウ" // "Move Z" +#define MSG_MOVE_E "エケストルータ゛ー" // "Extruder" +#define MSG_MOVE_01MM "0.1mm イト゛ウ" // "Move 0.1mm" +#define MSG_MOVE_1MM " 1mm イト゛ウ" // "Move 1mm" +#define MSG_MOVE_10MM " 10mm イト゛ウ" // "Move 10mm" +#define MSG_SPEED "スヒ゜ート゛" // "Speed" +#define MSG_NOZZLE "ノス゛ル" // "Nozzle" +#define MSG_BED "ヘ゛ツト゛" // "Bed" +#define MSG_FAN_SPEED "ファンンケト゛" // "Fan speed" +#define MSG_FLOW "オケリリョウ" // "Flow" +#define MSG_CONTROL "コントロール" // "Control" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "シ゛ト゛ウオント゛" // "Autotemp" +#define MSG_ON "On " +#define MSG_OFF "Off" +#define MSG_PID_P "PID-P" +#define MSG_PID_I "PID-I" +#define MSG_PID_D "PID-D" +#define MSG_PID_C "PID-C" +#define MSG_ACC "センケト゛" // "Accel" +#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VZ_JERK "Vz-jerk" +#define MSG_VE_JERK "Ve-jerk" +#define MSG_VMAX "Vmax " +#define MSG_X "x" +#define MSG_Y "y" +#define MSG_Z "z" +#define MSG_E "e" +#define MSG_VMIN "Vmin" +#define MSG_VTRAV_MIN "VTrav min" +#define MSG_AMAX "Amax " +#define MSG_A_RETRACT "A-retract" +#define MSG_XSTEPS "Xsteps/mm" +#define MSG_YSTEPS "Ysteps/mm" +#define MSG_ZSTEPS "Zsteps/mm" +#define MSG_ESTEPS "Esteps/mm" +#define MSG_TEMPERATURE "オント゛" // "Temperature" +#define MSG_MOTION "ウコ゛キセツテイ" // "Motion" +#define MSG_VOLUMETRIC "フィラナント" // "Filament" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" +#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" +#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" +#define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4" +#define MSG_CONTRAST "LCDコントラスト" // "LCD contrast" +#define MSG_STORE_EPROM "ナモリヘセケノウ" // "Store memory" +#define MSG_LOAD_EPROM "ナモリセラヨミbaミ" // "Load memory" +#define MSG_RESTORE_FAILSAFE "セツテイリセツト" // "Restore failsafe" +#define MSG_REFRESH "リフレツシユ" // "Refresh" +#define MSG_WATCH "インフォ" // "Info screen" +#define MSG_PREPARE "シ゛ユンヒ゛セツテイ" //"Prepare" +#define MSG_TUNE "チョウセイ" // "Tune" +#define MSG_PAUSE_PRINT "イチシ゛テイシ" // "Pause print" +#define MSG_RESUME_PRINT "フ゜リントアイセイ" // "Resume print" +#define MSG_STOP_PRINT "フ゜リントテイシ" // "Stop print" +#define MSG_CARD_MENU "SDセート゛セラフ゜リント" // "Print from SD" +#define MSG_NO_CARD "SDセート゛セ゛アリマセン" // "No SD card" +#define MSG_DWELL "スリーフ゜" // "Sleep..." +#define MSG_USERWAIT "シハ゛ラケオマチケタ゛アイ" // "Wait for user..." +#define MSG_RESUMING "フ゜リントアイセイ" // "Resuming print" +#define MSG_PRINT_ABORTED "フ゜リントチユウシアレマシタ" // "Print aborted" +#define MSG_NO_MOVE "ウコ゛キマセン" // "No move." +#define MSG_KILLED "ショウキョ" // "KILLED. " +#define MSG_STOPPED "テイシシマシタ" // "STOPPED. " +#define MSG_CONTROL_RETRACT "Retract mm" +#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" +#define MSG_CONTROL_RETRACTF "Retract V" +#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" +#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" +#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" +#define MSG_AUTORETRACT "AutoRetr." +#define MSG_FILAMENTCHANGE "フィラナントコウセン" // "Change filament" +#define MSG_INIT_SDCARD "SDセート゛アイヨミコミ" // "Init. SD card" +#define MSG_CNG_SDCARD "SDセート゛コウセン" // "Change SD card" +#define MSG_ZPROBE_OUT "Zフ゜ローフ゛ ヘ゛ツトnセ゛イ" // "Z probe out. bed" +#define MSG_POSITION_UNKNOWN "ケ゛ンテンハXYイト゛ウコ゛Z" // "Home X/Y before Z" +#define MSG_ZPROBE_ZOFFSET "Zオフセツト" // "Z Offset" +#define MSG_BABYSTEP_X "ヒ゛ト゛ウ X" // "Babystep X" +#define MSG_BABYSTEP_Y "ヒ゛ト゛ウ Y" // "Babystep Y" +#define MSG_BABYSTEP_Z "ヒ゛ト゛ウ Z" // "Babystep Z" +#define MSG_ENDSTOP_ABORT "Endstop abort" + +#define MSG_HEATING "セネシチユウ..." // "Heating..." +#define MSG_HEATING_COMPLETE "セネシセンリxョウ" // "Heating done." +#define MSG_BED_HEATING "ヘ゛ツト゛セネシチユウ" // "Bed Heating." 5C 33 34 33 +#define MSG_BED_DONE "ヘ゛ツト゛セネシセンリxョウ" // "Bed done." +#define MSG_ENDSTOPS_HIT "endstops hit: " + +#ifdef DELTA_CALIBRATION_MENU + #define MSG_DELTA_CALIBRATE "Delta Calibration" + #define MSG_DELTA_CALIBRATE_X "Calibrate X" + #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" + #define MSG_DELTA_CALIBRATE_Z "Calibrate Z" + #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" +#endif // DELTA_CALIBRATION_MENU + +#endif // LANGUAGE_KANA_UTF_H diff --git a/Marlin/language_kanji.h b/Marlin/language_kanji.h new file mode 100644 index 000000000..d2e854691 --- /dev/null +++ b/Marlin/language_kanji.h @@ -0,0 +1,147 @@ +/** + * Japanese (Kanji) + * + * LCD Menu Messages + * Please note these are limited to 17 characters! + * + */ +#ifndef DOGLCD + #include "language_kana.h" // fallback to kana + #define LANGUAGE_KANJI_H +#endif + +#ifndef LANGUAGE_KANJI_H +#define LANGUAGE_KANJI_H + +#define MAPPER_NON +#define DISPLAY_CHARSET_KANJI + +// HINT FOR ichibey; YOU CAN NOW MAKE USE OF THE LAST 8 SYMBOLS FOR YOUT PURPOSE, SINCE THE MARLIN_SYMBOLS NOW HAVE THEIR OWN FONT: + +// 漢字混じり表示 +#define WELCOME_MSG MACHINE_NAME "\x8a\x8b\x90\x91\xa4\xa5\x7f" // "ready." +#define MSG_SD_INSERTED "SD\xb6\xb0\xc4\xde\x20\x84\xa2\xa3\xbb\xda\xcf\xbc\xc0" // "Card inserted" +#define MSG_SD_REMOVED "SD\xb6\xb0\xc4\xde\x20\x84\xe3\xb6\xda\xcf\xbc\xc0" // "Card removed" +#define MSG_MAIN "\xd2\xb2\xdd" // "Main" +#define MSG_AUTOSTART "\x93\x88\xb6\xb6\xb2\xbc" // "Autostart" +#define MSG_DISABLE_STEPPERS "\xd3\xb0\xc0\xb0\xe7\xe8\xe9\xea\x20\xb5\xcc" // "Disable steppers" +#define MSG_AUTO_HOME "\x98\x99\x9a\x9b\xcd \x86\x87\x88\xb6" // "Auto home" +#define MSG_SET_HOME_OFFSETS "\x8c\x8d\x8a\x8b\xb5\xcc\xbe\xaf\xc4\xf1\xf2\xf3\xf4" // "Set home offsets" +#define MSG_SET_ORIGIN "\x8c\x8d\x8a\x8b\xbe\xaf\xc4" // "Set origin" +#define MSG_PREHEAT_PLA "PLA \x92\x94\x95" // "Preheat PLA" +#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \x96\x97\xc3" // " All" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xcd\xde\xaf\xc4\xde" // "Bed" +#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xaf\xc3\xb2" // "conf" +#define MSG_PREHEAT_ABS "ABS \x92\x94\x95" // "Preheat ABS" +#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xbd\xcd\xde\xc3" // " All" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xcd\xde\xaf\xc4\xde" // "Bed" +#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xaf\xc3\xb2" // "conf" +#define MSG_COOLDOWN "\xb6\xe5\x94\x95\xb2\x9e\xf7" // "Cooldown" +#define MSG_SWITCH_PS_ON "\xe7\xe8\xe9\xea\x20\xb5\xdd" // "Switch power on" +#define MSG_SWITCH_PS_OFF "\xe7\xe8\xe9\xea\x20\xb5\xcc" // "Switch power off" +#define MSG_EXTRUDE "\x84\x85\xbc\xc0\xde\xbc" // "Extrude" +#define MSG_RETRACT "\xd8\xc4\xd7\xb8\xc4" // "Retract" +#define MSG_MOVE_AXIS "\x8e\x8f\x86\x87\x88\xb6" // "Move axis" +#define MSG_MOVE_X "X\x8e\x8f\x86\x87\x88\xb6" // "Move X" +#define MSG_MOVE_Y "Y\x8e\x8f\x86\x87\x88\xb6" // "Move Y" +#define MSG_MOVE_Z "Z\x8e\x8f\x86\x87\x88\xb6" // "Move Z" +#define MSG_MOVE_E "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0" // "Extruder" +#define MSG_MOVE_01MM "0.1mm \x86\x87\x88\xb6" // "Move 0.1mm" +#define MSG_MOVE_1MM " 1mm \x86\x87\x88\xb6" // "Move 1mm" +#define MSG_MOVE_10MM " 10mm \x86\x87\x88\xb6" // "Move 10mm" +#define MSG_SPEED "\xbd\xcb\xdf\xb0\xc4\xde" // "Speed" +#define MSG_NOZZLE "\xc9\xbd\xde\xd9" // "Nozzle" +#define MSG_BED "\xcd\xde\xaf\xc4\xde" // "Bed" +#define MSG_FAN_SPEED "\xcc\xa7\xdd\xed\xe6\x82\x83" // "Fan speed" +#define MSG_FLOW "\xed\xee\xd8\x7d" // "Flow" +#define MSG_CONTROL "\xba\xdd\xc4\xdb\xb0\xd9" // "Control" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "\x93\x88\xb6\x80\x81\x82\x83" // "Autotemp" +#define MSG_ON "On " +#define MSG_OFF "Off" +#define MSG_PID_P "PID-P" +#define MSG_PID_I "PID-I" +#define MSG_PID_D "PID-D" +#define MSG_PID_C "PID-C" +#define MSG_ACC "\xb6\xe5\xed\xe6\x82\x83" // "Accel" +#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VZ_JERK "Vz-jerk" +#define MSG_VE_JERK "Ve-jerk" +#define MSG_VMAX "Vmax " +#define MSG_X "x" +#define MSG_Y "y" +#define MSG_Z "z" +#define MSG_E "e" +#define MSG_VMIN "Vmin" +#define MSG_VTRAV_MIN "VTrav min" +#define MSG_AMAX "Amax " +#define MSG_A_RETRACT "A-retract" +#define MSG_XSTEPS "Xsteps/mm" +#define MSG_YSTEPS "Ysteps/mm" +#define MSG_ZSTEPS "Zsteps/mm" +#define MSG_ESTEPS "Esteps/mm" +#define MSG_TEMPERATURE "\x80\x81\x82\x83" // "Temperature" +#define MSG_MOTION "\x88\xb6\xef\xf1\xf2\xf3\xf4" // "Motion" +#define MSG_VOLUMETRIC "\xcc\xa8\xd7\xd2\xdd\xc4" // "Filament" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" +#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" +#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" +#define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4" +#define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCD contrast" +#define MSG_STORE_EPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "Store memory" +#define MSG_LOAD_EPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\ba\xd0" // "Load memory" +#define MSG_RESTORE_FAILSAFE "\xf1\xf2\xf3\xf4\xd8\xbe\xaf\xc4" // "Restore failsafe" +#define MSG_REFRESH "\xd8\xcc\xda\xaf\xbc\xad" // "Refresh" +#define MSG_WATCH "\xb2\xdd\xcc\xab" // "Info screen" +#define MSG_PREPARE "\x8a\x8b\x90\x91\xf1\xf2\xf3\xf4" // "Prepare" +#define MSG_TUNE "\xf1\x9f\x9c\x9d" // "Tune" +#define MSG_PAUSE_PRINT "\xb0\xf5\xf6\xb2\x9e\xf7" // "Pause print" +#define MSG_RESUME_PRINT "\xcc\xdf\xd8\xdd\xc4 \xa0\xa1\x7b\x7c" // "Resume print" +#define MSG_STOP_PRINT "\xcc\xdf\xd8\xdd\xc4 \xb2\x9e\xf7" // "Stop print" +#define MSG_CARD_MENU "SD\xb6\xb0\xc4\xde\xb6\xd7\xcc\xdf\xd8\xdd\xc4" // "Print from SD" +#define MSG_NO_CARD "SD\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "No SD card" +#define MSG_DWELL "\xbd\xd8\xb0\xcc\xdf" // "Sleep..." +#define MSG_USERWAIT "\xbc\xca\xde\xd7\xb9\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "Wait for user..." +#define MSG_RESUMING "\xcc\xdf\xd8\xdd\xc4 \xa0\xa1\x7b\x7c" // "Resuming print" +#define MSG_PRINT_ABORTED "\xcc\xdf\xd8\xdd\xc4\xc1\xad\xb3\xbc\xbb\xda\xcf\xbc\xc0" // "Print aborted" +#define MSG_NO_MOVE "\x88\xb6\xb7\xcf\xbe\xdd" // "No move." +#define MSG_KILLED "\xbc\xae\xb3\xb7\xae" // "KILLED. " +#define MSG_STOPPED "\xb2\x9e\xf7\xbc\xcf\xbc\xc0" // "STOPPED. " +#define MSG_CONTROL_RETRACT "Retract mm" +#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" +#define MSG_CONTROL_RETRACTF "Retract V" +#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" +#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" +#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" +#define MSG_AUTORETRACT "AutoRetr." +#define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xeb\xec\x84\xe4" // "Change filament" +#define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\\xa0\xa1\xd6\xd0\xba\xd0" // "Init. SD card" +#define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xeb\xec\x84\xe4" // "Change SD card" +#define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde \xcd\xde\xaf\xc4\xee\xb6\xde\xb2" // "Z probe out. bed" +#define MSG_POSITION_UNKNOWN "\xb9\xde\xdd\xc3\xdd\xcaXY\xb2\xc4\xde\xb3\xba\xdeZ" // "Home X/Y before Z" +#define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Z Offset" +#define MSG_BABYSTEP_X "\xcb\xde\xc4\xde\xb3 X" // "Babystep X" +#define MSG_BABYSTEP_Y "\xcb\xde\xc4\xde\xb3 Y" // "Babystep Y" +#define MSG_BABYSTEP_Z "\xcb\xde\xc4\xde\xb3 Z" // "Babystep Z" +#define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_HEATING "\xb6\xe5\x94\x95\x89..." // "Heating..." +#define MSG_HEATING_COMPLETE "\xb6\xe5\x94\x95\xa4\xa5\x7f" // "Heating done." +#define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\xb6\xe5\x94\x95\x89" // "Bed Heating." +#define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\xb6\xe5\x94\x95\xa4\xa5\x7f" // "Bed done." +#define MSG_ENDSTOPS_HIT "endstops hit: " + +#ifdef DELTA_CALIBRATION_MENU + #define MSG_DELTA_CALIBRATE "Delta Calibration" + #define MSG_DELTA_CALIBRATE_X "Calibrate X" + #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" + #define MSG_DELTA_CALIBRATE_Z "Calibrate Z" + #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" +#endif // DELTA_CALIBRATION_MENU + +#endif // LANGUAGE_JP2_H diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 7de2f9a8e..f691fe6fb 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_NL_H #define LANGUAGE_NL_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " gereed." #define MSG_SD_INSERTED "Kaart ingestoken" #define MSG_SD_REMOVED "Kaart verwijderd" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Fan snelheid" #define MSG_FLOW "Flow" #define MSG_CONTROL "Control" -#define MSG_MIN " \002 Min" -#define MSG_MAX " \002 Max" -#define MSG_FACTOR " \002 Fact" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "Aan " #define MSG_OFF "Uit" diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 93ccf4046..e8d74100a 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -8,6 +8,8 @@ #ifndef LANGUAGE_PL_H #define LANGUAGE_PL_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " gotowy." #define MSG_SD_INSERTED "Karta wlozona" #define MSG_SD_REMOVED "Karta usunieta" @@ -46,9 +48,9 @@ #define MSG_FAN_SPEED "Obroty wiatraka" #define MSG_FLOW "Przeplyw" #define MSG_CONTROL "Ustawienia" -#define MSG_MIN " \002 Min" -#define MSG_MAX " \002 Max" -#define MSG_FACTOR " \002 Mnoznik" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Mnoznik" #define MSG_AUTOTEMP "Auto. temperatura" #define MSG_ON "Wl. " #define MSG_OFF "Wyl." @@ -84,7 +86,7 @@ #define MSG_STORE_EPROM "Zapisz w pamieci" #define MSG_LOAD_EPROM "Wczytaj z pamieci" #define MSG_RESTORE_FAILSAFE "Ustaw. fabryczne" -#define MSG_REFRESH "\004Odswiez" +#define MSG_REFRESH LCD_STR_REFRESH " Odswiez" #define MSG_WATCH "Ekran glowny" #define MSG_PREPARE "Przygotuj" #define MSG_TUNE "Strojenie" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 924b6e4db..f15627a05 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -8,10 +8,12 @@ #ifndef LANGUAGE_PT_BR_H #define LANGUAGE_PT_BR_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "Cartao inserido" #define MSG_SD_REMOVED "Cartao removido" -#define MSG_MAIN " Menu principal \003" +#define MSG_MAIN " Menu principal" #define MSG_AUTOSTART "Autostart" #define MSG_DISABLE_STEPPERS " Apagar motores" #define MSG_AUTO_HOME "Ir para origen" @@ -20,19 +22,19 @@ #define MSG_PREHEAT_PLA "Pre-aquecer PLA" #define MSG_PREHEAT_PLA_N "Pre-aquecer PLA " #define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo" -#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA \002Base" +#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" #define MSG_PREHEAT_PLA_SETTINGS "PLA setting" #define MSG_PREHEAT_ABS "Pre-aquecer ABS" #define MSG_PREHEAT_ABS_N "Pre-aquecer ABS " #define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo" -#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS \002Base" +#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" #define MSG_PREHEAT_ABS_SETTINGS "ABS setting" #define MSG_COOLDOWN "Esfriar" #define MSG_SWITCH_PS_ON "Switch Power On" #define MSG_SWITCH_PS_OFF "Switch Power Off" #define MSG_EXTRUDE "Extrudar" #define MSG_RETRACT "Retrair" -#define MSG_MOVE_AXIS "Mover eixo \x7E" +#define MSG_MOVE_AXIS "Mover eixo" #define MSG_MOVE_X "Move X" #define MSG_MOVE_Y "Move Y" #define MSG_MOVE_Z "Move Z" @@ -41,14 +43,14 @@ #define MSG_MOVE_1MM "Move 1mm" #define MSG_MOVE_10MM "Move 10mm" #define MSG_SPEED "Velocidade" -#define MSG_NOZZLE "\002Nozzle" -#define MSG_BED "\002Base" +#define MSG_NOZZLE LCD_STR_THERMOMETER " Nozzle" +#define MSG_BED LCD_STR_THERMOMETER " Base" #define MSG_FAN_SPEED "Velocidade vento." #define MSG_FLOW "Fluxo" -#define MSG_CONTROL "Controle \003" -#define MSG_MIN "\002 Min" -#define MSG_MAX "\002 Max" -#define MSG_FACTOR "\002 Fact" +#define MSG_CONTROL "Controle" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On " #define MSG_OFF "Off" @@ -76,7 +78,7 @@ #define MSG_TEMPERATURE "Temperatura" #define MSG_MOTION "Movimento" #define MSG_VOLUMETRIC "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" @@ -84,10 +86,10 @@ #define MSG_STORE_EPROM "Guardar memoria" #define MSG_LOAD_EPROM "Carregar memoria" #define MSG_RESTORE_FAILSAFE "Rest. de emergen." -#define MSG_REFRESH "\004Recarregar" -#define MSG_WATCH "Monitorar \003" -#define MSG_PREPARE "Preparar \x7E" -#define MSG_TUNE "Tune \x7E" +#define MSG_REFRESH LCD_STR_REFRESH " Recarregar" +#define MSG_WATCH "Monitorar" +#define MSG_PREPARE "Preparar" +#define MSG_TUNE "Tune" #define MSG_PAUSE_PRINT "Pausar impressao" #define MSG_RESUME_PRINT "Resumir impressao" #define MSG_STOP_PRINT "Parar impressao" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 90c4b5c6c..17e4c3307 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -8,10 +8,12 @@ #ifndef LANGUAGE_PT_H #define LANGUAGE_PT_H +#define MAPPER_NON + #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "Cartao inserido" #define MSG_SD_REMOVED "Cartao removido" -#define MSG_MAIN " Menu principal \003" +#define MSG_MAIN " Menu principal" #define MSG_AUTOSTART "Autostart" #define MSG_DISABLE_STEPPERS " Desligar motores" #define MSG_AUTO_HOME "Ir para home" @@ -20,19 +22,19 @@ #define MSG_PREHEAT_PLA "Pre-aquecer PLA" #define MSG_PREHEAT_PLA_N "Pre-aquecer PLA " #define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo" -#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA \002Base" +#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" #define MSG_PREHEAT_PLA_SETTINGS "PLA definicoes" #define MSG_PREHEAT_ABS "Pre-aquecer ABS" #define MSG_PREHEAT_ABS_N "Pre-aquecer ABS " #define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo" -#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS \002Base" +#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" #define MSG_PREHEAT_ABS_SETTINGS "ABS definicoes" #define MSG_COOLDOWN "Arrefecer" #define MSG_SWITCH_PS_ON "Ligar" #define MSG_SWITCH_PS_OFF "Desligar" #define MSG_EXTRUDE "Extrudir" #define MSG_RETRACT "Retrair" -#define MSG_MOVE_AXIS "Mover eixo \x7E" +#define MSG_MOVE_AXIS "Mover eixo" #define MSG_MOVE_X "Mover X" #define MSG_MOVE_Y "Mover Y" #define MSG_MOVE_Z "Mover Z" @@ -41,14 +43,14 @@ #define MSG_MOVE_1MM "Mover 1mm" #define MSG_MOVE_10MM "Mover 10mm" #define MSG_SPEED "Velocidade" -#define MSG_NOZZLE "\002Bico" -#define MSG_BED "\002Base" +#define MSG_NOZZLE LCD_STR_THERMOMETER "Bico" +#define MSG_BED LCD_STR_THERMOMETER "Base" #define MSG_FAN_SPEED "Velocidade do ar." #define MSG_FLOW "Fluxo" -#define MSG_CONTROL "Controlo \003" -#define MSG_MIN "\002 Min" -#define MSG_MAX "\002 Max" -#define MSG_FACTOR "\002 Fact" +#define MSG_CONTROL "Controlo" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On " #define MSG_OFF "Off" @@ -76,7 +78,7 @@ #define MSG_TEMPERATURE "Temperatura" #define MSG_MOTION "Movimento" #define MSG_VOLUMETRIC "Filamento" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Diam. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Diam. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Diam. 3" @@ -84,10 +86,10 @@ #define MSG_STORE_EPROM "Guardar na memoria" #define MSG_LOAD_EPROM "Carregar da memoria" #define MSG_RESTORE_FAILSAFE "Rest. de emergen." -#define MSG_REFRESH "\004Recarregar" -#define MSG_WATCH "Monitorar \003" -#define MSG_PREPARE "Preparar \x7E" -#define MSG_TUNE "Afinar \x7E" +#define MSG_REFRESH LCD_STR_REFRESH " Recarregar" +#define MSG_WATCH "Monitorar" +#define MSG_PREPARE "Preparar" +#define MSG_TUNE "Afinar" #define MSG_PAUSE_PRINT "Pausar impressao" #define MSG_RESUME_PRINT "Resumir impressao" #define MSG_STOP_PRINT "Parar impressao" diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index bcab50b79..42c974fa1 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -8,7 +8,7 @@ #ifndef LANGUAGE_RU_H #define LANGUAGE_RU_H -#define LANGUAGE_RU +#define MAPPER_D0D1 // For Cyrillic #define WELCOME_MSG MACHINE_NAME " Готов." #define MSG_SD_INSERTED "Карта вставлена" From 901cf203fea3922366ce02218dc9b249ae97ee91 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 17:49:16 +0100 Subject: [PATCH 007/302] Add legal stuff to marlin_kanji.h --- Marlin/dogm_font_data_6x10_marlin_Kanji.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/dogm_font_data_6x10_marlin_Kanji.h b/Marlin/dogm_font_data_6x10_marlin_Kanji.h index 54c821970..bc8dc6b1d 100644 --- a/Marlin/dogm_font_data_6x10_marlin_Kanji.h +++ b/Marlin/dogm_font_data_6x10_marlin_Kanji.h @@ -2,6 +2,9 @@ Fontname : Japanese Original font, Version 0.1 Author : http://www.thingiverse.com/ichibey License : Creative Commons BY-NC + + 営利目的で利用する際は、かならず許可を得てください。非営利の場合は、CCライセンスに従い使用ください。 + http://creativecommons.org/licenses/by-nc/2.1/jp/legalcode */ #include const u8g_fntpgm_uint8_t u8g_font_6x10_marlin[2911] U8G_SECTION(".progmem.u8g_font_6x10_marlin") = { From 6d575b1bc770c6ebed3d5f1ca52a1ff99cda5197 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 17:55:59 +0100 Subject: [PATCH 008/302] Add some documentation. --- Documentation/LCDLanguageFont.md | 125 +++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 126 insertions(+) create mode 100644 Documentation/LCDLanguageFont.md diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md new file mode 100644 index 000000000..a06b39160 --- /dev/null +++ b/Documentation/LCDLanguageFont.md @@ -0,0 +1,125 @@ +# LCD Language Font System + +We deal with a variety of differend displays. +And we try to display different languages on them. +This system is ought to solve some of the related problems. + +## The Displays +We have two different technologys for the displays: + +* Character based displays + Have a fixed set of symbols (charset - font) in their ROM. + All of them have similar but not identical symbols at the positions 0 to 127 similar to US-ASCII. + On the other hand symbols at places higher than 127 have mayor differences. + Until now we know of (and support): + 1.) HD44780 and similar with Kana charset A00 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 17 + These are very common, but sadly not very useful when writing in European languages. + 2.) HD44780 and similar with Western charset A02 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 18 + These are rare, but fairly useful for European languages. Also a limited number of Cyrillic symbols is available. + 3.) HD44780 and similar with Cyrillic charset http://store.comet.bg/download-file.php?id=466 Page 14 + Some of our Russian friends use them. + At all of them you can define 8 different symbols by yourself. In Marlin they are used for the Feedrate-, Thermometer-, ... symbols + +* Full graphic displays + Where we have the full freedom to display whatever we want, when we can make a program for it. + Currently we deal with 128x64 Pixel Displays and devide this area in about 5 Lines with about 22 columns. + Therefore we need fonts with a bounding box of about 6x10. + Until now we used a + 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end what made '' and '' unaccessible in the size 6x10. + 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. + 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. + +## The Languages + For the moment Marlin wants to support a lot of languages: + * en English + * pl Polish + * fr French + * de German + * es Spanish + * ru Russian + * it Italian + * pt Portuguese + * pt-br Portuguese (Brazil) + * fi Finnish + * an Aragonese + * nl Dutch + * ca Catalan + * eu Basque-Euskera + and recently on [Thingiverse](http://www.thingiverse.com/) a new port to + * jp [Japanese](http://www.thingiverse.com/thing:664397) + appeared. + + All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. + Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '') + And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite the programmer wanted.) + The Germans want to use "a" the Finnish at least "". Other European languages want to see their accents an their letters. + For other scripts like Cyrillic, Japanese, Greek, Hebrew, ... you have to find totally different symbol sets. + + Until now the problems where ignored widely. + The German translation used utf8 '' and '' and did not care about showing garbage on all displays. + The Russian translators new that their system only works on the Cyrillic character displays and relied on special LCD routines (LiquidCrystalRus.cpp) to handle UTF8 but missed to implement a proper strlen(). + The Japanese translator dealed with to scritps. He introduced a very special font for the full graphic displays and made use of the Japanese version of the character displays. Therefore he ended up with two pretty unreadable language.h files full of '\xxx' definitions. + Other languages ether tried to avoid wording with their special symbols or ignored the problem at all and used the basic symbols without the accents, dots, ... whatever. + +## The (partial) Solution + On a 'perfect' system like Windows or Linux we'd dig out unifont.ttf and some code from the libraries and they'd do what we want. But we are on a embedded system with very limited resources. So we had to find ways so limit the used space (Alone unifont.ttf is about 12MB) and have to make some compromise. + +### Aims: + 1.) Make the input for translators as convenient as possible. (Unicode UTF8) + 2.) Make the displays show the scripts as good as they can. (fonts, mapping tables) + 3.) Don't destroy the existing language files. + 3.) Don't loose to much speed + 4.) Don't loose to much memory. + +### Actions: + a.) Declare the display hardware we use. (Configuration.h) + b.) Declare the language ore script we use. (Configuration.h) + c.) Declare the kind of input we use. Ether direct pointers to the font (\xxx) or UTF8. (language_xx.h) + d.) Declare the needed translations. (language_xx.h) + e.) Make strlen() work with UTF8. (ultralcd.cpp) + f.) Seperate the Marlin Symbols to their own font. (dogm_font_data_Marlin_symbols.h) + g.) Make the fontswitch function remember the last used font. (dogm_lcd_implementation.h) + h.) Make output functions what count the number of written chars and switch the font to Marlin symbols and back when needed. (dogm_lcd_implementation.h) (ultralcd_implementation_hitachi_HD44780.h) + i.) Make three fonts to simulate the HD44780 charsets on dogm-displays. This makes translations easy because we have less charsets we have to deal with. (What is working on the HD44780s will also work on the dogms.) + j.) Make ISO fonts for Cyrillic and Katakana because they do not need a mapping table and are faster to deal with and have a better charset (less compromises) + k.) Make mapping functions and tables to convert from UTF8 to the fonts and integrate to the new output functions. (utf_mapper.h) + l.) Delete the not needed any more 'LiquidCrystalRus.xxx' files and their calls in 'ultralcd_implementation_hitachi_HD44780.h'. + m.) Split 'dogm_font_data_Marlin.h' into separate fonts and delete. (+dogm_font_data_6x9_marlin.h , +dogm_font_data_Marlin_symbols.h, -dogm_font_data_Marlin.h) + n.) Do a bit of preprocessor magic to match displays - fonts and mappers in 'utf_mapper.h'. + +## Translators handbook + a.) Check is there already is a language_xx.h file for your language (-> b.) or not (-> e.) + b.) Ether their is declared MAPPER_NON (-> c.) or an other mapper (-> d.) + c.) Symbols outside the normal ASCII-range (32-128) are written as "\xxx" and point directly into the font of the hardware you declared in 'Configuration.h' + This is one of the three fonts of the character based Hitachi displays (DISPLAY_CHARSET_HD44780_JAPAN, DISPLAY_CHARSET_HD44780_WEST, DISPLAY_CHARSET_HD44780_CYRILIC). + Even on the full graphic displays one of these will be used. + If you don't make use of the extended character set your file will look like 'language_en.h' and your language file will work on all the displays. + If you make intensive use, your file will look like 'language_kana.h' and your language file will only work on one of displays. (in this case DISPLAY_CHARSET_HD44780_JAPAN) + Be careful with the characters 0x5c = '\', and 0x7b - 0x7f. These are not the same on all variants. + MAPPER_NON is the fastest an least memory consuming variant. + If you want to make use of more than a view symbols outside standard ASCII or want to improve the portability to more different types of displays use UTF8 input. That means define an other mapper. + d.) With a mapper different to MAPPER_NON UTF8 input is used. Instead of "\xe1" (on a display with Japanese font) or STR_ae simply use "?". When the string is read byte by byte , the "?" will expand to "\0xc3\0xa4" or "" will expand to "0xd0\0xaf" or "?" will expand to "\0xe3\0x83\0x9b" + To limit the used memory we can't use all the possibilities UTF8 gives at the same time. We define a subset matching to the language or script we use. + MAPPER_C2C3 correspondents good with west European languages the possible symbols are listed at (http://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)) + MAPPER_D0D1 correspondents well with the Cyrillic languages. See (http://en.wikipedia.org/wiki/Cyrillic_(Unicode_block)) + MAPPER_E382E383 works with the Japanese Katakana script. See (http://en.wikipedia.org/wiki/Katakana_(Unicode_block)) + The mapper functions will only catch the 'lead in' described in the mappers name. If the input they get does not match they'll put out a '?' or garbage. + The last byte in the sequence ether points directly into a matching ISO10646 font or via a mapper_table into one of the HD44780 fonts. + The mapper_tables do their best to find a similar symbol in the HD44780_fonts. For example replacing small letters with the matching capital letters. But they may fail to find something matching and will output a '?'. There are combinations of language and display what simply have no corresponding symbols - like Cyrillic on a Japanese display or visa versa - than the compiler will throw an error. + In short: Chose a Mapper working with the symbols you want to use. Use only symbols matching the mapper. On FULL graphic displays all will be fine, but check for daring replacements or question-marks in the output of character based displays. + If you get a lot of question-marks on the Hitachi based displays with your new translation, maybe creating a new language file with the format 'language_xx_utf8.h' is the way to go. + Mappers together with a ISO10646_font are the second best choice regarding speed and memory consumption. Only a few more decisions are mad per character. + Mappers together with the HD44780_fonts use about additional 128 bytes for the mapping_table. + e.) Creating a new language file is not a big thing. Just make a new file with the format 'language_xx.h' or maybe 'language.xx.utf8.h', define a mapper in there and translate some of the strings defined in language_en.h. You can drop the surrounding #ifndef #endif. You don't have to translate all the stings - the missing one will be added by language_en.h - in English - of cause. + f.) If you cant find a matching mapper things will be a bit more complex. With the Hitachi based displays you will not have big chance to make something useful unless you have one with a matching charset. For a full graphic display - lets explain with - let's say Greece. + Find a matching charset. (http://en.wikipedia.org/wiki/Greek_and_Coptic) + Provide a font containing the symbols in the right size. Normal ASCII in the lower 127 places, the upper with your selection. + Write a mapper catching, in this case, 0xcd to 0xcf and add it to 'utf_mapper.h'. + In case of a ISO10646 font we have a MAPPER_ONE_TO_ONE and don't have to make a table. + g.) If you discover enough useful symbols in one of the HD44780 fonts you can provide a mapping table. For example HD44780_WEST contains 'alpha', 'beta', 'pi', 'Sigma', 'omega' 'My' - what is not enough to make USEFUL table - i think. + h.) If you want to integrate an entirely new variant of a Hitachi based display. + Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. + +## User Instructions + Define your hardware and language in 'Configuration.h'. Done. + \ No newline at end of file diff --git a/README.md b/README.md index 5107cf004..37d4486b6 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ * [Auto Bed Leveling](/Documentation/BedLeveling.md) * [Filament Sensor](/Documentation/FilamentSensor.md) * [Ramps Servo Power](/Documentation/RampsServoPower.md) + * [LCD Language - Font - System](Documentation/LCDLanguageFont.md) ##### [RepRap.org Wiki Page](http://reprap.org/wiki/Marlin) From 0f26f3abf29a84a5ecf56e440119b9eb017600f3 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 17:59:28 +0100 Subject: [PATCH 009/302] Add a test_language. Will show the compleet utf8 or ASCII charset To se the second half of ASCII click on "01234..." --- Marlin/language_test.h | 200 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 Marlin/language_test.h diff --git a/Marlin/language_test.h b/Marlin/language_test.h new file mode 100644 index 000000000..908275414 --- /dev/null +++ b/Marlin/language_test.h @@ -0,0 +1,200 @@ +/** + * TEST + * + * LCD Menu Messages + * Please note these are limited to 17 characters! + * + */ +#ifndef LANGUAGE_TEST_H +#define LANGUAGE_TEST_H + +// Select ONE of the following Mappers. +// They decide what to do with a symbol in the area of [0x80:0xFF]. They take a symbol of this language file and make them point +// into an array with 128 cells, where they find the place of the symbol in the font in use. +// +// a.)For ASCII coded Language_xx.h files like (en) there are no occurrences of symbols above 0x7F so no mapper is needed. +// If such a symbol appers it is mapped directly into the font. This is the case for the language files we used until now, with all the STR_XX or +// "\xxx" symbols. All Symbols are only one byte long. +// b.) For Unicoded Language_xx.h files (currently ru and de) the non ASCII [0x00-0x7F] symbols are represented by more then one byte. +// In the case of two bytes the first is pointing to a 'codepage' and the second to a place in the codepage. These codepages contain 64 symbols. +// So two of them can be mapped. For most of the European languages the necessary symbols are contained in the pages C2 and C3. Cyrillic uses D0 +// and D1. +// c.) For katakana (one of the Japanese symbol sets) Unicode uses 3 bytes. Here the second byte also points to a codepage and byte 3 to the symbol. +// I hope the pages E282 and E283 are sufficient to write katakana. +// Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not +// impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). +// d.) So for Kanji we use a very special and selected subset of symbols and the direct mapping like in a). + +//#define MAPPER_NON // For direct asci codes ( until now all languages except ru, de, ... ) +#define MAPPER_C2C3 // For most European languages when language file is in utf8 +//#define MAPPER_D0D1 // For Cyrillic +//#define MAPPER_D0D1_MOD // For Cyrillic on HD44780_CYRILIC (will save 32 byte in the mapper but adds some more decisions) +//#define MAPPER_E382E383 // For Katakana + + +// next 4 lines select variants in this file only +//#define WEST +#define CYRIL +//#define KANA +//#define KANJI + +// TESTSTRINGS + +#define STRG_ASCII_2 " !\"#$%&'()*+,-./" +#define STRG_ASCII_3 "0123456789:;<=>?" +#define STRG_ASCII_4 "@ABCDEFGHIJKLMNO" +#define STRG_ASCII_5 "PQRSTUVWXYZ[\]^_" +#define STRG_ASCII_6 "`abcdefghijklmno" +#define STRG_ASCII_7 "pqrstuvwxyz{|}~" + +#define STRG_C2_a " ¡¢£¤¥¦§¨©ª«¬­®¯" +#define STRG_C2_b "°±²³´µ¶·¸¹º»¼½¾¿" +#define STRG_C3_8 "ÈÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ" +#define STRG_C3_9 "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" +#define STRG_C3_a "àáâãäåæçèéêëìíîï" +#define STRG_C3_b "ðñòóôõö÷øùúûüýþÿ" + +#define STRG_D0_8 "ЈЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ" +#define STRG_D0_9 "АБВГДЕЖЗИЙКЛМНОП" +#define STRG_D0_a "РСТУФХЦЧШЩЪЫЬЭЮЯ" +#define STRG_D0_b "абвгдежзийклмноп" +#define STRG_D1_8 "шстуфхцчшщъыьэюя" +#define STRG_D1_9 "ѐёђѓєѕіїјљњћќѝўџ" +#define STRG_D1_a "ѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯ" +#define STRG_D1_b "ѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿ" + +#define STRG_E382_8 "よめもゃやゅゆょよらりるれろゎわ" +#define STRG_E382_9 "ゐゑをんゔゕゖ゗゘゙゚゛ ゜ゝゞゟ" +#define STRG_E382_a "゠ァアィイゥウェエォオカガキギク" +#define STRG_E382_b "グケゲコゴサザシジスズセゼソゾタ" +#define STRG_E383_8 "トチヂッツヅテデトドナニヌネノハ" +#define STRG_E383_9 "バパヒビピフブプヘベペホボポマミ" +#define STRG_E383_a "ムメモャヤュユョヨラリルレロヮワ" +#define STRG_E383_b "ヰヱヲンヴヵヶヷヸヹヺ・ーヽヾヿ" + +#define STRG_OKTAL_0 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" +#define STRG_OKTAL_1 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define STRG_OKTAL_2 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" +#define STRG_OKTAL_3 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" +#define STRG_OKTAL_4 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" +#define STRG_OKTAL_5 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" +#define STRG_OKTAL_6 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" +#define STRG_OKTAL_7 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" +#define STRG_OKTAL_8 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" +#define STRG_OKTAL_9 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" +#define STRG_OKTAL_a "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" +#define STRG_OKTAL_b "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" +#define STRG_OKTAL_c "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" +#define STRG_OKTAL_d "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" +#define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" +#define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" + +#ifdef WEST + #define WELCOME_MSG "Language TEST" + + #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" + #define MSG_PREPARE "UTF8" + #define MSG_CONTROL "ASCII" + + //#define MSG_MAIN ".." + #define MSG_DISABLE_STEPPERS STRG_C2_8 + #define MSG_AUTO_HOME STRG_C2_9 + #define MSG_SET_HOME_OFFSETS STRG_C2_a + #define MSG_PREHEAT_PLA STRG_C2_b + #define MSG_PREHEAT_ABS STRG_C3_8 + #define MSG_COOLDOWN STRG_C3_9 + #define MSG_SWITCH_PS_OFF STRG_C3_a + #define MSG_MOVE_AXIS STRG_C3_b + + #define MSG_MAIN STRG_OKTAL_2 + #define MSG_TEMPERATURE STRG_OKTAL_3 + #define MSG_MOTION STRG_OKTAL_4 + #define MSG_VOLUMETRIC STRG_OKTAL_5 + #define MSG_CONTRAST STRG_OKTAL_6 + #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 + + #define MSG_NOZZLE STRG_OKTAL_8 + #define MSG_FAN_SPEED STRG_OKTAL_9 + #define MSG_AUTOTEMP STRG_OKTAL_a + #define MSG_MIN STRG_OKTAL_b + #define MSG_MAX STRG_OKTAL_c + #define MSG_FACTOR STRG_OKTAL_d + #define MSG_PID_P STRG_OKTAL_e + #define MSG_PID_I STRG_OKTAL_f + +#endif + +#ifdef CYRIL + #define WELCOME_MSG "Language TEST" + + #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" + #define MSG_PREPARE "UTF8" + #define MSG_CONTROL "ASCII" + + //#define MSG_MAIN ".." + #define MSG_DISABLE_STEPPERS STRG_D0_8 + #define MSG_AUTO_HOME STRG_D0_9 + #define MSG_SET_HOME_OFFSETS STRG_D0_a + #define MSG_PREHEAT_PLA STRG_D0_b + #define MSG_PREHEAT_ABS STRG_D1_8 + #define MSG_COOLDOWN STRG_D1_9 + #define MSG_SWITCH_PS_OFF STRG_D1_a + #define MSG_MOVE_AXIS STRG_D1_b + + #define MSG_MAIN STRG_OKTAL_2 + #define MSG_TEMPERATURE STRG_OKTAL_3 + #define MSG_MOTION STRG_OKTAL_4 + #define MSG_VOLUMETRIC STRG_OKTAL_5 + #define MSG_CONTRAST STRG_OKTAL_6 + #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 + + #define MSG_NOZZLE STRG_OKTAL_8 + #define MSG_FAN_SPEED STRG_OKTAL_9 + #define MSG_AUTOTEMP STRG_OKTAL_a + #define MSG_MIN STRG_OKTAL_b + #define MSG_MAX STRG_OKTAL_c + #define MSG_FACTOR STRG_OKTAL_d + #define MSG_PID_P STRG_OKTAL_e + #define MSG_PID_I STRG_OKTAL_f + +#endif + +#if defined( KANA ) || defined (KANJI) + #define WELCOME_MSG "Language TEST" + + #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" + #ifdef KANJI + #define MSG_PREPARE "No UTF8 for Kanji" + #else + #define MSG_PREPARE "UTF8" + #endif + #define MSG_CONTROL "ASCII" + + //#define MSG_MAIN ".." + #define MSG_DISABLE_STEPPERS STRG_E382_8 + #define MSG_AUTO_HOME STRG_E382_9 + #define MSG_SET_HOME_OFFSETS STRG_E382_a + #define MSG_PREHEAT_PLA STRG_E382_b + #define MSG_PREHEAT_ABS STRG_E383_8 + #define MSG_COOLDOWN STRG_E383_9 + #define MSG_SWITCH_PS_OFF STRG_E383_a + #define MSG_MOVE_AXIS STRG_E383_b + + #define MSG_MAIN STRG_OKTAL_2 + #define MSG_TEMPERATURE STRG_OKTAL_3 + #define MSG_MOTION STRG_OKTAL_4 + #define MSG_VOLUMETRIC STRG_OKTAL_5 + #define MSG_CONTRAST STRG_OKTAL_6 + #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 + + #define MSG_NOZZLE STRG_OKTAL_8 + #define MSG_FAN_SPEED STRG_OKTAL_9 + #define MSG_AUTOTEMP STRG_OKTAL_a + #define MSG_MIN STRG_OKTAL_b + #define MSG_MAX STRG_OKTAL_c + #define MSG_FACTOR STRG_OKTAL_d + #define MSG_PID_P STRG_OKTAL_e + #define MSG_PID_I STRG_OKTAL_f +#endif + +#endif // LANGUAGE_TEST_H From 6fc2ccd56833c1629782a3f250edfe0788d32fa8 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 18:04:03 +0100 Subject: [PATCH 010/302] Make use of new remenbering fontswitch. --- Marlin/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2f83afe2d..add1bd80f 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1308,7 +1308,7 @@ void lcd_update() { blink++; // Variable for fan animation and alive dot u8g.firstPage(); do { - u8g.setFont(FONT_MENU); + lcd_setFont(FONT_MENU); u8g.setPrintPos(125, 0); if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot u8g.drawPixel(127, 63); // draw alive dot From 255ca681237985f35c208addfc0b324ef733c669 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 18:30:09 +0100 Subject: [PATCH 011/302] Changes in ultralcd_implementation_hitachi_HD44780.h in detail Top -> down: We don't need LiquidCrystalRus.cpp and LiquidCrystalRus.h any more. Functionality is now in utf_mapper.h Comment on LCD_STR_BEDTEMP about behaviour in strings. Change LCD_STR_ARROW_RIGHT from "\x7E" to ">" because "\x7E" is only ARROW_RIGHT on displays with DISPLAY_CHARSET_HD44780_JAPAN. Introduce the counting UTF8 enabled lcd_print functions. Replace the old lcd.print functions and make use of them. A bit of reformatting around the changes. --- Marlin/LiquidCrystalRus.cpp | 393 ------------------ Marlin/LiquidCrystalRus.h | 129 ------ .../ultralcd_implementation_hitachi_HD44780.h | 161 ++++--- 3 files changed, 80 insertions(+), 603 deletions(-) delete mode 100644 Marlin/LiquidCrystalRus.cpp delete mode 100644 Marlin/LiquidCrystalRus.h diff --git a/Marlin/LiquidCrystalRus.cpp b/Marlin/LiquidCrystalRus.cpp deleted file mode 100644 index c74146236..000000000 --- a/Marlin/LiquidCrystalRus.cpp +++ /dev/null @@ -1,393 +0,0 @@ -#include "LiquidCrystalRus.h" - -#include -#include -#include -#include - -#if defined(ARDUINO) && ARDUINO >= 100 - #include "Arduino.h" -#else - #include "WProgram.h" -#endif - -// it is a Russian alphabet translation -// except 0401 --> 0xa2 = ╗, 0451 --> 0xb5 -const PROGMEM uint8_t utf_recode[] = - { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4, - 0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8, - 0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab, - 0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, - 0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7, - 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe, - 0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0, - 0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 - }; - -// When the display powers up, it is configured as follows: -// -// 1. Display clear -// 2. Function set: -// DL = 1; 8-bit interface data -// N = 0; 1-line display -// F = 0; 5x8 dot character font -// 3. Display on/off control: -// D = 0; Display off -// C = 0; Cursor off -// B = 0; Blinking off -// 4. Entry mode set: -// I/D = 1; Increment by 1 -// S = 0; No shift -// -// Note, however, that resetting the Arduino doesn't reset the LCD, so we -// can't assume that it's in that state when a sketch starts (and the -// LiquidCrystal constructor is called). -// -// modified 27 Jul 2011 -// by Ilya V. Danilov http://mk90.ru/ - - -LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, - uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) -{ - init(0, rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7); -} - -LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, - uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) -{ - init(0, rs, 255, enable, d0, d1, d2, d3, d4, d5, d6, d7); -} - -LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) -{ - init(1, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0); -} - -LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) -{ - init(1, rs, 255, enable, d0, d1, d2, d3, 0, 0, 0, 0); -} - -void LiquidCrystalRus::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, - uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) -{ - _rs_pin = rs; - _rw_pin = rw; - _enable_pin = enable; - - _data_pins[0] = d0; - _data_pins[1] = d1; - _data_pins[2] = d2; - _data_pins[3] = d3; - _data_pins[4] = d4; - _data_pins[5] = d5; - _data_pins[6] = d6; - _data_pins[7] = d7; - - pinMode(_rs_pin, OUTPUT); - // we can save 1 pin by not using RW. Indicate by passing 255 instead of pin# - if (_rw_pin != 255) { - pinMode(_rw_pin, OUTPUT); - } - pinMode(_enable_pin, OUTPUT); - - if (fourbitmode) - _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS; - else - _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS; - - begin(16, 1); -} - -void LiquidCrystalRus::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { - if (lines > 1) { - _displayfunction |= LCD_2LINE; - } - _numlines = lines; - _currline = 0; - - // for some 1 line displays you can select a 10 pixel high font - if ((dotsize != 0) && (lines == 1)) { - _displayfunction |= LCD_5x10DOTS; - } - - // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION! - // according to datasheet, we need at least 40ms after power rises above 2.7V - // before sending commands. Arduino can turn on way before 4.5V so we'll wait 50 - delayMicroseconds(50000); - // Now we pull both RS and R/W low to begin commands - digitalWrite(_rs_pin, LOW); - digitalWrite(_enable_pin, LOW); - if (_rw_pin != 255) { - digitalWrite(_rw_pin, LOW); - } - - //put the LCD into 4 bit or 8 bit mode - if (! (_displayfunction & LCD_8BITMODE)) { - // this is according to the Hitachi HD44780 datasheet - // figure 24, pg 46 - - // we start in 8bit mode, try to set 4 bit mode - writeNbits(0x03,4); - delayMicroseconds(4500); // wait min 4.1ms - - // second try - writeNbits(0x03,4); - delayMicroseconds(4500); // wait min 4.1ms - - // third go! - writeNbits(0x03,4); - delayMicroseconds(150); - - // finally, set to 8-bit interface - writeNbits(0x02,4); - } else { - // this is according to the Hitachi HD44780 datasheet - // page 45 figure 23 - - // Send function set command sequence - command(LCD_FUNCTIONSET | _displayfunction); - delayMicroseconds(4500); // wait more than 4.1ms - - // second try - command(LCD_FUNCTIONSET | _displayfunction); - delayMicroseconds(150); - - // third go - command(LCD_FUNCTIONSET | _displayfunction); - } - - // finally, set # lines, font size, etc. - command(LCD_FUNCTIONSET | _displayfunction); - - // turn the display on with no cursor or blinking default - _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF; - display(); - - // clear it off - clear(); - - // Initialize to default text direction (for romance languages) - _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; - // set the entry mode - command(LCD_ENTRYMODESET | _displaymode); - -} - -void LiquidCrystalRus::setDRAMModel(uint8_t model) { - _dram_model = model; -} - -/********** high level commands, for the user! */ -void LiquidCrystalRus::clear() -{ - command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero - delayMicroseconds(2000); // this command takes a long time! -} - -void LiquidCrystalRus::home() -{ - command(LCD_RETURNHOME); // set cursor position to zero - delayMicroseconds(2000); // this command takes a long time! -} - -void LiquidCrystalRus::setCursor(uint8_t col, uint8_t row) -{ - int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 }; - if ( row >= _numlines ) { - row = _numlines-1; // we count rows starting w/0 - } - - command(LCD_SETDDRAMADDR | (col + row_offsets[row])); -} - -// Turn the display on/off (quickly) -void LiquidCrystalRus::noDisplay() { - _displaycontrol &= ~LCD_DISPLAYON; - command(LCD_DISPLAYCONTROL | _displaycontrol); -} -void LiquidCrystalRus::display() { - _displaycontrol |= LCD_DISPLAYON; - command(LCD_DISPLAYCONTROL | _displaycontrol); -} - -// Turns the underline cursor on/off -void LiquidCrystalRus::noCursor() { - _displaycontrol &= ~LCD_CURSORON; - command(LCD_DISPLAYCONTROL | _displaycontrol); -} -void LiquidCrystalRus::cursor() { - _displaycontrol |= LCD_CURSORON; - command(LCD_DISPLAYCONTROL | _displaycontrol); -} - -// Turn on and off the blinking cursor -void LiquidCrystalRus::noBlink() { - _displaycontrol &= ~LCD_BLINKON; - command(LCD_DISPLAYCONTROL | _displaycontrol); -} -void LiquidCrystalRus::blink() { - _displaycontrol |= LCD_BLINKON; - command(LCD_DISPLAYCONTROL | _displaycontrol); -} - -// These commands scroll the display without changing the RAM -void LiquidCrystalRus::scrollDisplayLeft(void) { - command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT); -} -void LiquidCrystalRus::scrollDisplayRight(void) { - command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT); -} - -// This is for text that flows Left to Right -void LiquidCrystalRus::leftToRight(void) { - _displaymode |= LCD_ENTRYLEFT; - command(LCD_ENTRYMODESET | _displaymode); -} - -// This is for text that flows Right to Left -void LiquidCrystalRus::rightToLeft(void) { - _displaymode &= ~LCD_ENTRYLEFT; - command(LCD_ENTRYMODESET | _displaymode); -} - -// This will 'right justify' text from the cursor -void LiquidCrystalRus::autoscroll(void) { - _displaymode |= LCD_ENTRYSHIFTINCREMENT; - command(LCD_ENTRYMODESET | _displaymode); -} - -// This will 'left justify' text from the cursor -void LiquidCrystalRus::noAutoscroll(void) { - _displaymode &= ~LCD_ENTRYSHIFTINCREMENT; - command(LCD_ENTRYMODESET | _displaymode); -} - -// Allows us to fill the first 8 CGRAM locations -// with custom characters -void LiquidCrystalRus::createChar(uint8_t location, uint8_t charmap[]) { - location &= 0x7; // we only have 8 locations 0-7 - command(LCD_SETCGRAMADDR | (location << 3)); - for (int i=0; i<8; i++) { - write(charmap[i]); - } -} - -/*********** mid level commands, for sending data/cmds */ - -inline void LiquidCrystalRus::command(uint8_t value) { - send(value, LOW); -} - -#if defined(ARDUINO) && ARDUINO >= 100 - size_t LiquidCrystalRus::write(uint8_t value) -#else - void LiquidCrystalRus::write(uint8_t value) -#endif -{ - uint8_t out_char=value; - - if (_dram_model == LCD_DRAM_WH1601) { - uint8_t ac=recv(LOW) & 0x7f; - if (ac>7 && ac<0x14) command(LCD_SETDDRAMADDR | (0x40+ac-8)); - } - - if (value>=0x80) { // UTF-8 handling - if (value >= 0xc0) { - utf_hi_char = value - 0xd0; - } else { - value &= 0x3f; - if (!utf_hi_char && (value == 1)) - send(0xa2,HIGH); // ╗ - else if ((utf_hi_char == 1) && (value == 0x11)) - send(0xb5,HIGH); // ╦ - else - send(pgm_read_byte_near(utf_recode + value + (utf_hi_char<<6) - 0x10), HIGH); - } - } else send(out_char, HIGH); -#if defined(ARDUINO) && ARDUINO >= 100 - return 1; // assume success -#endif -} - -/************ low level data pushing commands **********/ - -// write either command or data, with automatic 4/8-bit selection -void LiquidCrystalRus::send(uint8_t value, uint8_t mode) { - digitalWrite(_rs_pin, mode); - - // if there is a RW pin indicated, set it low to Write - if (_rw_pin != 255) { - digitalWrite(_rw_pin, LOW); - } - - if (_displayfunction & LCD_8BITMODE) { - writeNbits(value,8); - } else { - writeNbits(value>>4,4); - writeNbits(value,4); - } -} - -// read data, with automatic 4/8-bit selection -uint8_t LiquidCrystalRus::recv(uint8_t mode) { - uint8_t retval; - digitalWrite(_rs_pin, mode); - - // if there is a RW pin indicated, set it low to Write - if (_rw_pin != 255) { - digitalWrite(_rw_pin, HIGH); - } - - if (_displayfunction & LCD_8BITMODE) { - retval = readNbits(8); - } else { - retval = readNbits(4) << 4; - retval |= readNbits(4); - } - return retval; -} -void LiquidCrystalRus::pulseEnable() { - digitalWrite(_enable_pin, LOW); - delayMicroseconds(1); - digitalWrite(_enable_pin, HIGH); - delayMicroseconds(1); // enable pulse must be >450ns - digitalWrite(_enable_pin, LOW); - delayMicroseconds(100); // commands need > 37us to settle -} - -void LiquidCrystalRus::writeNbits(uint8_t value, uint8_t n) { - for (int i = 0; i < n; i++) { - pinMode(_data_pins[i], OUTPUT); - digitalWrite(_data_pins[i], (value >> i) & 0x01); - } - - pulseEnable(); -} - -uint8_t LiquidCrystalRus::readNbits(uint8_t n) { - uint8_t retval=0; - for (int i = 0; i < n; i++) { - pinMode(_data_pins[i], INPUT); - } - - digitalWrite(_enable_pin, LOW); - delayMicroseconds(1); - digitalWrite(_enable_pin, HIGH); - delayMicroseconds(1); // enable pulse must be >450ns - - for (int i = 0; i < n; i++) { - retval |= (digitalRead(_data_pins[i]) == HIGH)?(1 << i):0; - } - - digitalWrite(_enable_pin, LOW); - - return retval; -} - diff --git a/Marlin/LiquidCrystalRus.h b/Marlin/LiquidCrystalRus.h deleted file mode 100644 index ad85394ae..000000000 --- a/Marlin/LiquidCrystalRus.h +++ /dev/null @@ -1,129 +0,0 @@ -// -// based on LiquidCrystal library from ArduinoIDE, see http://arduino.cc -// modified 27 Jul 2011 -// by Ilya V. Danilov http://mk90.ru/ -// - -#ifndef LiquidCrystalRus_h -#define LiquidCrystalRus_h - -#include -#include "Print.h" - -// commands -#define LCD_CLEARDISPLAY 0x01 -#define LCD_RETURNHOME 0x02 -#define LCD_ENTRYMODESET 0x04 -#define LCD_DISPLAYCONTROL 0x08 -#define LCD_CURSORSHIFT 0x10 -#define LCD_FUNCTIONSET 0x20 -#define LCD_SETCGRAMADDR 0x40 -#define LCD_SETDDRAMADDR 0x80 - -// flags for display entry mode -#define LCD_ENTRYRIGHT 0x00 -#define LCD_ENTRYLEFT 0x02 -#define LCD_ENTRYSHIFTINCREMENT 0x01 -#define LCD_ENTRYSHIFTDECREMENT 0x00 - -// flags for display on/off control -#define LCD_DISPLAYON 0x04 -#define LCD_DISPLAYOFF 0x00 -#define LCD_CURSORON 0x02 -#define LCD_CURSOROFF 0x00 -#define LCD_BLINKON 0x01 -#define LCD_BLINKOFF 0x00 - -// flags for display/cursor shift -#define LCD_DISPLAYMOVE 0x08 -#define LCD_CURSORMOVE 0x00 -#define LCD_MOVERIGHT 0x04 -#define LCD_MOVELEFT 0x00 - -// flags for function set -#define LCD_8BITMODE 0x10 -#define LCD_4BITMODE 0x00 -#define LCD_2LINE 0x08 -#define LCD_1LINE 0x00 -#define LCD_5x10DOTS 0x04 -#define LCD_5x8DOTS 0x00 - -// enum for -#define LCD_DRAM_Normal 0x00 -#define LCD_DRAM_WH1601 0x01 - - -class LiquidCrystalRus : public Print { -public: - LiquidCrystalRus(uint8_t rs, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, - uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); - LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, - uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); - LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); - LiquidCrystalRus(uint8_t rs, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); - - void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, - uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, - uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); - - void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS); - - void clear(); - void home(); - - void noDisplay(); - void display(); - void noBlink(); - void blink(); - void noCursor(); - void cursor(); - void scrollDisplayLeft(); - void scrollDisplayRight(); - void leftToRight(); - void rightToLeft(); - void autoscroll(); - void noAutoscroll(); - - void createChar(uint8_t, uint8_t[]); - void setCursor(uint8_t, uint8_t); - -#if defined(ARDUINO) && ARDUINO >= 100 - virtual size_t write(uint8_t); - using Print::write; -#else - virtual void write(uint8_t); -#endif - - void command(uint8_t); - - void setDRAMModel(uint8_t); - -private: - void send(uint8_t, uint8_t); - void writeNbits(uint8_t, uint8_t); - uint8_t recv(uint8_t); - uint8_t readNbits(uint8_t); - void pulseEnable(); - - uint8_t _rs_pin; // LOW: command. HIGH: character. - uint8_t _rw_pin; // LOW: write to LCD. HIGH: read from LCD. - uint8_t _enable_pin; // activated by a HIGH pulse. - uint8_t _data_pins[8]; - - uint8_t _displayfunction; - uint8_t _displaycontrol; - uint8_t _displaymode; - - uint8_t _initialized; - - uint8_t _numlines,_currline; - - uint8_t _dram_model; - uint8_t utf_hi_char; // UTF-8 high part -}; - -#endif diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 2081414cc..03c43e428 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -179,25 +179,20 @@ // 2 wire Non-latching LCD SR from: // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection #elif defined(SR_LCD_2W_NL) - extern "C" void __cxa_pure_virtual() { while (1); } #include #include #define LCD_CLASS LiquidCrystal_SR LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN); - #else // Standard directly connected LCD implementations - #ifdef LANGUAGE_RU - #include "LiquidCrystalRus.h" - #define LCD_CLASS LiquidCrystalRus - #else - #include - #define LCD_CLASS LiquidCrystal - #endif + #include + #define LCD_CLASS LiquidCrystal LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 #endif +#include "utf_mapper.h" + #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) static uint16_t progressBarTick = 0; #if PROGRESS_MSG_EXPIRE > 0 @@ -207,7 +202,7 @@ #endif /* Custom characters defined in the first 8 characters of the LCD */ -#define LCD_STR_BEDTEMP "\x00" +#define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string! #define LCD_STR_DEGREE "\x01" #define LCD_STR_THERMOMETER "\x02" #define LCD_STR_UPLEVEL "\x03" @@ -215,7 +210,8 @@ #define LCD_STR_FOLDER "\x05" #define LCD_STR_FEEDRATE "\x06" #define LCD_STR_CLOCK "\x07" -#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */ +//#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set. Only available on DISPLAY_CHARSET_HD44780_JAPAN - at this place!*/ +#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ static void lcd_set_custom_characters( #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) @@ -405,15 +401,31 @@ static void lcd_implementation_clear() { lcd.clear(); } + /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */ -static void lcd_printPGM(const char* str) -{ - char c; - while((c = pgm_read_byte(str++)) != '\0') - { - lcd.write(c); - } +char lcd_printPGM(const char* str) { + char c; + char n = 0; + while((c = pgm_read_byte(str++))) { + n += charset_mapper(c); + } + return n; } + +char lcd_print(char* str) { + char c; + char i = 0; + char n = 0; + while((c = str[i++])) { + n += charset_mapper(c); + } + return n; +} + +unsigned lcd_print(char c) { + return charset_mapper(c); +} + /* Possible status screens: 16x2 |0123456789012345| @@ -608,8 +620,9 @@ static void lcd_implementation_status_screen() } #endif //FILAMENT_LCD_DISPLAY - lcd.print(lcd_status_message); + lcd_print(lcd_status_message); } + static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) { char c; @@ -623,12 +636,12 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c lcd.print(pre_char); while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) { - lcd.print(c); + n -= lcd_print(c); pstr++; - if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--; } - while(n--) - lcd.print(' '); + while(n--) { + lcd.print(' '); + } lcd.print(post_char); lcd.print(' '); } @@ -643,16 +656,14 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const #endif lcd.setCursor(0, row); lcd.print(pre_char); - while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) - { - lcd.print(c); - pstr++; - if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--; + while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) { + n -= lcd_print(c); + pstr++; } lcd.print(':'); while(n--) - lcd.print(' '); - lcd.print(data); + lcd.print(' '); + lcd_print(data); } static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, const char* pstr, char pre_char, const char* data) { @@ -665,15 +676,13 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons #endif lcd.setCursor(0, row); lcd.print(pre_char); - while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) - { - lcd.print(c); - pstr++; - if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--; + while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) { + n -= lcd_print(c); + pstr++; } lcd.print(':'); while(n--) - lcd.print(' '); + lcd.print(' '); lcd_printPGM(data); } #define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data))) @@ -726,7 +735,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) #else lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1); #endif - lcd.print(value); + lcd_print(value); } static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename) { @@ -741,9 +750,8 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* } while( ((c = *filename) != '\0') && (n>0) ) { - lcd.print(c); + n -= lcd_print(c); filename++; - n--; } while(n--) lcd.print(' '); @@ -761,54 +769,45 @@ static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, co } while( ((c = *filename) != '\0') && (n>0) ) { - lcd.print(c); + n -= lcd_print(c); filename++; - n--; } while(n--) lcd.print(' '); } -static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename) -{ - char c; - uint8_t n = LCD_WIDTH - 2; - lcd.setCursor(0, row); - lcd.print('>'); - lcd.print(LCD_STR_FOLDER[0]); - if (longFilename[0] != '\0') - { - filename = longFilename; - longFilename[LCD_WIDTH-2] = '\0'; - } - while( ((c = *filename) != '\0') && (n>0) ) - { - lcd.print(c); - filename++; - n--; - } - while(n--) - lcd.print(' '); -} -static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename) -{ - char c; - uint8_t n = LCD_WIDTH - 2; - lcd.setCursor(0, row); +static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename) { + char c; + uint8_t n = LCD_WIDTH - 2; + lcd.setCursor(0, row); + lcd.print('>'); + lcd.print(LCD_STR_FOLDER[0]); + if (longFilename[0] != '\0') { + filename = longFilename; + longFilename[LCD_WIDTH-2] = '\0'; + } + while( ((c = *filename) != '\0') && (n>0) ) { + n -= lcd_print(c); + filename++; + } + while(n--) + lcd.print(' '); +} +static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename) { + char c; + uint8_t n = LCD_WIDTH - 2; + lcd.setCursor(0, row); + lcd.print(' '); + lcd.print(LCD_STR_FOLDER[0]); + if (longFilename[0] != '\0') { + filename = longFilename; + longFilename[LCD_WIDTH-2] = '\0'; + } + while( ((c = *filename) != '\0') && (n>0) ) { + n -= lcd_print(c); + filename++; + } + while(n--) lcd.print(' '); - lcd.print(LCD_STR_FOLDER[0]); - if (longFilename[0] != '\0') - { - filename = longFilename; - longFilename[LCD_WIDTH-2] = '\0'; - } - while( ((c = *filename) != '\0') && (n>0) ) - { - lcd.print(c); - filename++; - n--; - } - while(n--) - lcd.print(' '); } #define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) #define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0]) From ae76b1e8a8b8c69bae2435347f2f24c7edad8315 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 10 Mar 2015 22:34:56 +0100 Subject: [PATCH 012/302] Changes in dogm_lcd_implementation.h in detail. Top -> down - We don't need the old Marlion_font package any more - we made new. - But we need information about configured fonts and the mappers. - We support Cyrillic now. - LCD_CLASS is not used in this file. LiquidCrystalRus.h is deleted anyway. - define some fonts - BIG_EDIT_FONT works only together with western languages. - Select a matching FONT for the MENUE depending on the defined language. - Number the different font-types. Wanted to avoid to store complete font-structures when changing fonts back and forth. - Marlin special symbols are now at the lower end - like in 'ultralcd_implementation_hitachi_HD44780.h' - insert the new remembering setFont function. - insert the new counting lcd_print functions. - make use of the new setFont and lcd_print functions. - On some places redefined one character long strings with chars to avoid overhead and reduce warnings. --- Marlin/dogm_lcd_implementation.h | 245 +++++++++++++++++++++---------- 1 file changed, 165 insertions(+), 80 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 4e2a567ff..171b42733 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -17,8 +17,8 @@ #define MARLIN_VERSION "1.0.2" /** -* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays. -**/ + * Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays. + */ #ifdef ULTIPANEL #define BLEN_A 0 @@ -32,35 +32,72 @@ #include #include "DOGMbitmaps.h" -#include "dogm_font_data_marlin.h" #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" +#include "configuration.h" +#include "utf_mapper.h" -/* Russian language not supported yet, needs custom font +#include +#include "dogm_font_data_6x9_marlin.h" // Height of 'A' is only 5 pixel. +#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols -#ifdef LANGUAGE_RU -#include "LiquidCrystalRus.h" -#define LCD_CLASS LiquidCrystalRus -#else -#include -#define LCD_CLASS LiquidCrystal +#define FONT_STATUSMENU_NAME u8g_font_6x9 // we don't have a small font for Cyrillic, Kana or Kanji +#define FONT_SPECIAL_NAME Marlin_symbols + +// save 3120 bytes of PROGMEM by commenting out the next #define +// we don't have a big font for Cyrillic, Kana or Kanji +#if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) + #define USE_BIG_EDIT_FONT #endif -*/ -#define USE_BIG_EDIT_FONT // save 3120 bytes of PROGMEM by commenting out this line -#define FONT_STATUSMENU u8g_font_6x9 -#define FONT_MENU u8g_font_6x10_marlin +#if defined( MAPPER_C2C3 ) + #include // System font. This is ISO10646-1 + #define FONT_MENU_NAME u8g_font_6x10 + +#elif defined( MAPPER_D0D1 ) + #include "dogm_font_data_ISO10646_5_Cyrillic.h" + #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7 + +#elif defined( MAPPER_E382E383 ) + #include "dogm_font_data_ISO10646_Kana.h" + #define FONT_MENU_NAME ISO10646_Kana_5x7 + +#elif defined( DISPLAY_CHARSET_KANJI ) && defined( MAPPER_NON ) + #include "dogm_font_data_6x10_marlin_Kanji.h" + #define FONT_MENU_NAME u8g_font_6x10_marlin + +#elif defined( DISPLAY_CHARSET_HD44780_JAPAN ) + #include "dogm_font_data_HD44780_J.h" + #define FONT_MENU_NAME HD44780_J_5x7 + +#elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) + #include "dogm_font_data_HD44780_W.h" + #define FONT_MENU_NAME HD44780_W_5x7 + +#elif defined( DISPLAY_CHARSET_HD44780_CYRILIC ) + #include "dogm_font_data_HD44780_C.h" + #define FONT_MENU_NAME HD44780_C_5x7 + +#else // #if defined( MAPPER_C2C3 ) // fall-back + #include // system font + #define FONT_MENU_NAME u8g_font_6x10 +#endif + +#define FONT_STATUSMENU 1 +#define FONT_SPECIAL 2 +#define FONT_MENU_EDIT 3 +#define FONT_MENU 4 // DOGM parameters (size in pixels) #define DOG_CHAR_WIDTH 6 #define DOG_CHAR_HEIGHT 12 #ifdef USE_BIG_EDIT_FONT - #define FONT_MENU_EDIT u8g_font_9x18 + #define FONT_MENU_EDIT_NAME u8g_font_9x18 #define DOG_CHAR_WIDTH_EDIT 9 #define DOG_CHAR_HEIGHT_EDIT 18 #define LCD_WIDTH_EDIT 14 #else - #define FONT_MENU_EDIT u8g_font_6x10_marlin + #define FONT_MENU_EDIT_NAME FONT_MENU_NAME #define DOG_CHAR_WIDTH_EDIT 6 #define DOG_CHAR_HEIGHT_EDIT 12 #define LCD_WIDTH_EDIT 22 @@ -68,16 +105,21 @@ #define START_ROW 0 -/* Custom characters defined in font font_6x10_marlin.c */ -#define LCD_STR_DEGREE "\xB0" -#define LCD_STR_REFRESH "\xF8" -#define LCD_STR_FOLDER "\xF9" -#define LCD_STR_ARROW_RIGHT "\xFA" -#define LCD_STR_UPLEVEL "\xFB" -#define LCD_STR_CLOCK "\xFC" -#define LCD_STR_FEEDRATE "\xFD" -#define LCD_STR_BEDTEMP "\xFE" -#define LCD_STR_THERMOMETER "\xFF" +/* Custom characters defined in font font_6x10_marlin_symbols */ +// \x00 intentionally skipped to avoid problems in strings +#define LCD_STR_REFRESH "\x01" +#define LCD_STR_FOLDER "\x02" +#define LCD_STR_ARROW_RIGHT "\x03" +#define LCD_STR_UPLEVEL "\x04" +#define LCD_STR_CLOCK "\x05" +#define LCD_STR_FEEDRATE "\x06" +#define LCD_STR_BEDTEMP "\x07" +#define LCD_STR_THERMOMETER "\x08" +#define LCD_STR_DEGREE "\x09" + +#define LCD_STR_SPECIAL_MAX LCD_STR_DEGREE +// Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. +// Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. int lcd_contrast; @@ -96,6 +138,49 @@ U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 #endif +char currentfont = 0; + +static void lcd_setFont(char font_nr) { + switch(font_nr) { + case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break; + case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break; + case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break; + case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break; + break; + } +} + +char lcd_print(char c) { + if ((c > 0) && (c < ' ')) { + u8g.setFont(FONT_SPECIAL_NAME); + u8g.print(c); + lcd_setFont(currentfont); + return 1; + } else { + return charset_mapper(c); + } +} + +char lcd_print(char* str) { + char c; + int i = 0; + char n = 0; + while ((c = str[i++])) { + n += lcd_print(c); + } + return n; +} + +/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */ +char lcd_printPGM(const char* str) { + char c; + char n = 0; + while ((c = pgm_read_byte(str++))) { + n += lcd_print(c); + } + return n; +} + static void lcd_implementation_init() { #ifdef LCD_PIN_BL // Enable LCD backlight @@ -130,7 +215,7 @@ static void lcd_implementation_init() u8g.firstPage(); do { u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); - u8g.setFont(FONT_MENU); + lcd_setFont(FONT_MENU); #ifndef STRING_SPLASH_LINE2 u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); #else @@ -143,21 +228,15 @@ static void lcd_implementation_init() static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop -/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */ -static void lcd_printPGM(const char* str) { - char c; - while ((c = pgm_read_byte(str++))) u8g.print(c); -} - static void _draw_heater_status(int x, int heater) { bool isBed = heater < 0; int y = 17 + (isBed ? 1 : 0); - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(x,6); - u8g.print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5))); + lcd_print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5))); lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); u8g.setPrintPos(x,27); - u8g.print(itostr3(int(heater >= 0 ? degHotend(heater) : degBed()) + 0.5)); + lcd_print(itostr3(int(heater >= 0 ? degHotend(heater) : degBed()) + 0.5)); lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); if (!isHeatingHotend(0)) { u8g.drawBox(x+7,y,2,2); @@ -189,7 +268,7 @@ static void lcd_implementation_status_screen() { u8g.drawFrame(54,49,73,4); // SD Card Progress bar and clock - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); if (IS_SD_PRINTING) { // Progress bar solid part @@ -199,9 +278,9 @@ static void lcd_implementation_status_screen() { u8g.setPrintPos(80,47); if (starttime != 0) { uint16_t time = (millis() - starttime) / 60000; - u8g.print(itostr2(time/60)); - u8g.print(':'); - u8g.print(itostr2(time%60)); + lcd_print(itostr2(time/60)); + lcd_print(':'); + lcd_print(itostr2(time%60)); } else { lcd_printPGM(PSTR("--:--")); @@ -215,68 +294,77 @@ static void lcd_implementation_status_screen() { if (EXTRUDERS < 4) _draw_heater_status(81, -1); // Fan - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(104,27); #if defined(FAN_PIN) && FAN_PIN > -1 int per = ((fanSpeed + 1) * 100) / 256; if (per) { - u8g.print(itostr3(per)); - u8g.print("%"); + lcd_print(itostr3(per)); + lcd_print('%'); } else #endif { - u8g.print("---"); + lcd_printPGM(PSTR("---")); } // X, Y, Z-Coordinates - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); u8g.drawBox(0,29,128,10); u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,37); - u8g.print("X"); + lcd_print('X'); u8g.drawPixel(8,33); u8g.drawPixel(8,35); u8g.setPrintPos(10,37); - u8g.print(ftostr31ns(current_position[X_AXIS])); + lcd_print(ftostr31ns(current_position[X_AXIS])); u8g.setPrintPos(43,37); - lcd_printPGM(PSTR("Y")); + lcd_print('Y'); u8g.drawPixel(49,33); u8g.drawPixel(49,35); u8g.setPrintPos(51,37); - u8g.print(ftostr31ns(current_position[Y_AXIS])); + lcd_print(ftostr31ns(current_position[Y_AXIS])); u8g.setPrintPos(83,37); - u8g.print("Z"); + lcd_print('Z'); u8g.drawPixel(89,33); u8g.drawPixel(89,35); u8g.setPrintPos(91,37); - u8g.print(ftostr31(current_position[Z_AXIS])); + lcd_print(ftostr31(current_position[Z_AXIS])); u8g.setColorIndex(1); // black on white // Feedrate - u8g.setFont(FONT_MENU); + lcd_setFont(FONT_MENU); u8g.setPrintPos(3,49); - u8g.print(LCD_STR_FEEDRATE[0]); - u8g.setFont(FONT_STATUSMENU); + lcd_print(LCD_STR_FEEDRATE[0]); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(12,48); - u8g.print(itostr3(feedmultiply)); - u8g.print('%'); + lcd_print(itostr3(feedmultiply)); + lcd_print('%'); // Status line - u8g.setFont(FONT_STATUSMENU); +/* The new fonts are small enough + #ifndef MAPPER_C2C3 + lcd_setFont(FONT_MENU); + #else + lcd_setFont(FONT_STATUSMENU); + #endif +*/ + lcd_setFont(FONT_MENU); + u8g.setPrintPos(0,61); + #ifndef FILAMENT_LCD_DISPLAY - u8g.print(lcd_status_message); + lcd_print(lcd_status_message); #else if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line - u8g.print(lcd_status_message); + lcd_print(lcd_status_message); } else { lcd_printPGM(PSTR("dia:")); - u8g.print(ftostr12ns(filament_width_meas)); + lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - u8g.print(itostr3(extrudemultiply)); - u8g.print('%'); + lcd_print(itostr3(extrudemultiply)); + lcd_print('%'); } #endif } @@ -300,13 +388,12 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c lcd_implementation_mark_as_selected(row, pre_char); while((c = pgm_read_byte(pstr))) { - u8g.print(c); + n -= lcd_print(c); pstr++; - n--; } - while(n--) u8g.print(' '); - u8g.print(post_char); - u8g.print(' '); + while(n--) lcd_print(' '); + lcd_print(post_char); + lcd_print(' '); } static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) { @@ -316,13 +403,12 @@ static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char p lcd_implementation_mark_as_selected(row, pre_char); while( (c = pgm_read_byte(pstr))) { - u8g.print(c); + n -= lcd_print(c); pstr++; - n--; } - u8g.print(':'); - while(n--) u8g.print(' '); - if (pgm) { lcd_printPGM(data); } else { u8g.print(data); } + lcd_print(':'); + while(n--) lcd_print(' '); + if (pgm) { lcd_printPGM(data); } else { lcd_print((char *)data); } } #define lcd_implementation_drawmenu_setting_edit_generic(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, false) @@ -374,13 +460,13 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { #ifdef USE_BIG_EDIT_FONT if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) { - u8g.setFont(FONT_MENU_EDIT); + lcd_setFont(FONT_MENU_EDIT); lcd_width = LCD_WIDTH_EDIT + 1; char_width = DOG_CHAR_WIDTH_EDIT; if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2; } else { - u8g.setFont(FONT_MENU); + lcd_setFont(FONT_MENU); } #endif @@ -391,9 +477,9 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { u8g.setPrintPos(0, rowHeight + kHalfChar); lcd_printPGM(pstr); - u8g.print(':'); + lcd_print(':'); u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar); - u8g.print(value); + lcd_print(value); } static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) { @@ -407,13 +493,12 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch lcd_implementation_mark_as_selected(row, ((isSelected) ? '>' : ' ')); - if (isDir) u8g.print(LCD_STR_FOLDER[0]); + if (isDir) lcd_print(LCD_STR_FOLDER[0]); while((c = *filename) != '\0') { - u8g.print(c); + n -= lcd_print(c); filename++; - n--; } - while(n--) u8g.print(' '); + while(n--) lcd_print(' '); } #define lcd_implementation_drawmenu_sdfile_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, true) From 97ae3c5c6a7c7275a93469b599f5a0bef812d9f2 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 11 Mar 2015 10:26:36 +0100 Subject: [PATCH 013/302] Corected some errors inrtoduced by a faild global replacement. --- Marlin/language_de.h | 6 +++--- Marlin/language_fi.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/language_de.h b/Marlin/language_de.h index d2eb6d34d..af7bdf93c 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -47,9 +47,9 @@ #define MSG_FAN_SPEED "Lüftergeschw." #define MSG_FLOW "Fluss" #define MSG_CONTROL "Einstellungen" -#define MSG_MIN LCD_STR_THERMOMETER " " Min" -#define MSG_MAX LCD_STR_THERMOMETER " " Max" -#define MSG_FACTOR LCD_STR_THERMOMETER " " Faktor" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Faktor" #define MSG_AUTOTEMP "AutoTemp" #define MSG_ON "Ein" #define MSG_OFF "Aus" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 76dcb882d..d84f1b28a 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -48,9 +48,9 @@ #define MSG_FAN_SPEED "Tuul. nopeus" #define MSG_FLOW "Virtaus" #define MSG_CONTROL "Kontrolli" -#define MSG_MIN LCD_STR_THERMOMETER "" Min" -#define MSG_MAX LCD_STR_THERMOMETER "" Max" -#define MSG_FACTOR LCD_STR_THERMOMETER "" Kerr" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Kerr" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "On " #define MSG_OFF "Off" From b60761bcff7705e1102ccab523a480e141751069 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 11 Mar 2015 10:30:38 +0100 Subject: [PATCH 014/302] Removed some messages that shouldn't be translated in the Japanese files. And made falback to kana work. --- Marlin/language_kana.h | 3 +++ Marlin/language_kana_utf8.h | 6 ------ Marlin/language_kanji.h | 5 +++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 050ebd5c5..8c8ecdb87 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -124,11 +124,14 @@ #define MSG_BABYSTEP_Z "\xcb\xde\xc4\xde\xb3 Z" // "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +/* These are from language.h. PLEASE DON'T TRANSLATE! All translatable messages can be found in language_en.h #define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3..." // "Heating..." #define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8x\xae\xb3" // "Heating done." #define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\xb6\xc8\xc2\xc1\xad\xb3" // "Bed Heating." #define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\xb6\xc8\xc2\xb6\xdd\xd8x\xae\xb3" // "Bed done." #define MSG_ENDSTOPS_HIT "endstops hit: " + ^ typho +*/ #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 9b74986f8..d364a0332 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -128,12 +128,6 @@ #define MSG_BABYSTEP_Z "ヒ゛ト゛ウ Z" // "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" -#define MSG_HEATING "セネシチユウ..." // "Heating..." -#define MSG_HEATING_COMPLETE "セネシセンリxョウ" // "Heating done." -#define MSG_BED_HEATING "ヘ゛ツト゛セネシチユウ" // "Bed Heating." 5C 33 34 33 -#define MSG_BED_DONE "ヘ゛ツト゛セネシセンリxョウ" // "Bed done." -#define MSG_ENDSTOPS_HIT "endstops hit: " - #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" diff --git a/Marlin/language_kanji.h b/Marlin/language_kanji.h index d2e854691..15b8359ab 100644 --- a/Marlin/language_kanji.h +++ b/Marlin/language_kanji.h @@ -5,6 +5,7 @@ * Please note these are limited to 17 characters! * */ +#include "Configuration.h" #ifndef DOGLCD #include "language_kana.h" // fallback to kana #define LANGUAGE_KANJI_H @@ -130,11 +131,15 @@ #define MSG_BABYSTEP_Y "\xcb\xde\xc4\xde\xb3 Y" // "Babystep Y" #define MSG_BABYSTEP_Z "\xcb\xde\xc4\xde\xb3 Z" // "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" + +/* These are from language.h. PLEASE DON'T TRANSLATE! All translatable messages can be found in language_en.h #define MSG_HEATING "\xb6\xe5\x94\x95\x89..." // "Heating..." #define MSG_HEATING_COMPLETE "\xb6\xe5\x94\x95\xa4\xa5\x7f" // "Heating done." #define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\xb6\xe5\x94\x95\x89" // "Bed Heating." #define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\xb6\xe5\x94\x95\xa4\xa5\x7f" // "Bed done." #define MSG_ENDSTOPS_HIT "endstops hit: " + ^ typho +*/ #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" From c4b0087f7a96737f57c5f5affc79f0d2cdbf9134 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 11 Mar 2015 10:55:16 +0100 Subject: [PATCH 015/302] Insert utf_mapper.h Top -> down - Decide what output function is to use. - Precautions. If non of the DISPLAY_CHARSET_HD44780's is selected fall back to Japanese. - When we are not on the dogms setup a mapping table depending on display type and mapper. - If we are on dogm we use ONE To ONE mapping - except kanji. - select and define one of the mapping functions. --- Marlin/utf_mapper.h | 255 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 Marlin/utf_mapper.h diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h new file mode 100644 index 000000000..ad13e3654 --- /dev/null +++ b/Marlin/utf_mapper.h @@ -0,0 +1,255 @@ +#ifndef UTF_MAPPER_H +#define UTF_MAPPER_H + +#include "language.h" + +#ifdef DOGLCD + #define HARDWAERE_CHAR_OUT u8g.print +#else + #define HARDWAERE_CHAR_OUT lcd.write +#endif + +#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILIC )) + #define DISPLAY_CHARSET_HD44780_JAPAN +#endif + +#ifndef DOGLCD + #ifdef DISPLAY_CHARSET_KANJI + #error("Kanji does not work on character based displays!"); + #elif defined( DISPLAY_CHARSET_HD44780_JAPAN ) + #if defined( MAPPER_C2C3 ) + const PROGMEM uint8_t utf_recode[] = + { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is fair for symbols + 0x20,0x3f,0xec,0xed,0x3f,0x5c,0x7c,0x3f,0x22,0x63,0x61,0x7f,0x3f,0x3f,0x52,0xb0, // c2a + // ' ' ¢ £ ­ l " c a « R + 0xdf,0x3f,0x32,0x33,0x27,0xe4,0xf1,0xa5,0x2c,0x31,0xdf,0x7e,0x3f,0x3f,0x3f,0x3f, // c2b but relatively bad for letters. + // ° 2 3 ` N p . , 1 ° » + 0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f, // c38 + // ä + 0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0xef,0x78,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0xe2, // c39 missing characters display as '?' + // ö x ü ä + 0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f, // c3a + // ä + 0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xed,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f // c3b + // n ö ü + }; + #elif defined( MAPPER_E382E383 ) + const PROGMEM uint8_t utf_recode[] = + { // 0 1 2 3 4 5 6 7 8 9 a b c d e f + 0x3d,0xb1,0xb1,0xa8,0xb2,0xa9,0xb3,0xaa,0xb4,0xab,0xb5,0xb6,0xb6,0xb7,0xb7,0xb8, // e382a Please test and correct + // = ア ア ィ イ ゥ ウ ェ エ ォ オ ガ ガ キ キ ク + 0xb8,0xb9,0xb9,0xba,0xba,0xbb,0xbb,0xbc,0xbc,0xbd,0xbd,0xbe,0xbe,0xbf,0xbf,0xc0, // e382b + // ク ケ ケ コ コ サ サ シ シ ス ス セ セ ソ ソ タ + 0xc0,0xc1,0xc1,0xc2,0xc2,0xc2,0xc3,0xc3,0xc4,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca, // e3838 + // タ チ チ ッ ッ ッ テ テ ト ト ナ ニ ヌ ネ ノ ハ + 0xca,0xca,0xcb,0xcb,0xcb,0xcc,0xcc,0xcc,0xcd,0xcd,0xcd,0xce,0xce,0xce,0xcf,0xd0, // e3839 + // ハ ハ ヒ ヒ ヒ フ フ フ ヘ ヘ ヘ ホ ホ ホ マ ミ + 0xd1,0xd2,0xd3,0xd4,0xd4,0xd5,0xd5,0xae,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdc, // e383a + // ム メ モ ャ ャ ユ ユ ョ ヨ ラ リ ル レ ロ ワ ワ + 0xec,0xa7,0xa6,0xdd,0xcc,0x3f,0x3f,0x3f,0x3f,0x3f,0xa6,0xa5,0xb0,0xa4,0xa4,0x3f // e383b + // ヰ ヱ ヲ ン フ ? ? ? ? ? ヲ ・ ー ヽ ヽ ? + }; + #elif defined( MAPPER_D0D1 ) + #error( "Cyrillic on a japanese dsplay makes no sense. There are no matching symbols."); + #endif + + #elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) + #if defined( MAPPER_C2C3 ) + const PROGMEM uint8_t utf_recode[] = + { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is relative complete. + 0x20,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0x22,0xa9,0xaa,0xab,0x3f,0x3f,0xae,0x3f, // c2a ¡¢£¤¥¦§¨©ª«¬­®¯ + // ' ' ¡ ¢ £ ¤ ¥ ¦ § " © ª « ? ? ® ? + 0xb0,0xb1,0xb2,0xb3,0x27,0xb5,0xb6,0xb7,0x2c,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, // c2b °±²³´µ¶·¸¹º»¼½¾¿ + // ° ± ³ ² ? µ ¶ · , ¹ º » ¼ ½ ¾ ¿ + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, // c38 ÀÁÃÄÅÆÇÈÉÊËÌÍÎÏ + // À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï + 0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, // c39 ÐÑÓÔÕÖ×ØÙÚÛÜÝÞß + // Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß + 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, // c3a àáãäåæçèéêëìíîï + // à á â ã ä å æ ç è é ê ë ì í î ï + 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff // c3b ðñóôõö÷øùúûüýþÿ + // ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ + }; + #elif defined( MAPPER_D0D1 ) + #define MAPPER_D0D1_MOD + const PROGMEM uint8_t utf_recode[] = + {//0 1 2 3 4 5 6 7 8 9 a b c d e f + 0x41,0x80,0x42,0x92,0x81,0x45,0x82,0x83,0x84,0x85,0x4b,0x86,0x4d,0x48,0x4f,0x87, // d0a + // A Б B Г Д E Ж З И Й K Л M H O П + 0x50,0x43,0x54,0x88,0xd8,0x58,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad, // d0b + // P C T У Ф X Ч ч Ш Щ Ъ Ы b Э Ю Я + 0x61,0x36,0x42,0x92,0x81,0x65,0x82,0xb3,0x84,0x85,0x6b,0x86,0x4d,0x48,0x6f,0x87, // d18 + // a 6 B Г Д e Ж ³ И Й k Л M H o П + 0x70,0x63,0x54,0x79,0xd8,0x78,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad // d19 + // p c T y Ф x Ч ч Ш Щ Ъ Ы b Э Ю Я + }; + #elif defined( MAPPER_E382E383 ) + #error( "Katakana on a western display makes no sense. There are no matching symbols." ); + #endif + + #elif defined( DISPLAY_CHARSET_HD44780_CYRILIC ) + #if defined( MAPPER_D0D1 ) + #define MAPPER_D0D1_MOD + // it is a Russian alphabet translation + // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё + const PROGMEM uint8_t utf_recode[] = + { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4, // unicode U+0400 to U+047f + // A Б->Ё B Г Д E Ж З // 0 Ѐ Ё Ђ Ѓ Є Ѕ І Ї + 0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8, // Ј Љ Њ Ћ Ќ Ѝ Ў Џ + // И Й K Л M H O П // 1 А Б В Г Д Е Ж З + 0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab, // И Й К Л М Н О П + // P C T У Ф X Ч ч // 2 Р С Т У Ф Х Г Ч + 0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, // Ш Щ Ъ Ы Ь Э Ю Я + // Ш Щ Ъ Ы b Э Ю Я // 3 а б в г д е ж з + 0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7, // и й к л м н о п + // a б->ё в г д e ж з // 4 р с т у ф х ц ч + 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe, // ш щ ъ ы ь э ю я + // и й к л м н o п // 5 ѐ ё ђ ѓ є ѕ і ї + 0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0, // ј љ њ ћ ќ ѝ ў џ + // p c т y ф x ц ч // 6 Ѡ ѡ Ѣ ѣ Ѥ ѥ Ѧ ѧ + 0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 // Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ + // ш щ ъ ы ь э ю я // 7 Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ + }; // ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ + #elif defined( MAPPER_C2C3 ) + #error( "Western languages on a cyrillic display makes no sense. There are no matching symbols." ); + #elif defined( MAPPER_E382E383 ) + #error( "Katakana on a cyrillic display makes no sense. There are no matching symbols." ); + #endif + #endif +#else //DOGLCD + #if defined( DISPLAY_CHARSET_KANJI ) + #define MAPPER_NON + #else + #define MAPPER_ONE_TO_ONE + #endif +#endif //DOGLCD + +#if defined( MAPPER_NON ) + char charset_mapper(char c){ + HARDWAERE_CHAR_OUT( c ); + return 1; + } +#elif defined( MAPPER_C2C3 ) + uint8_t utf_hi_char; // UTF-8 high part + bool seen_c2 = false; + char charset_mapper(char c){ + uint8_t d = c; + if ( d >= 0x80 ) { // UTF-8 handling + if ( (d >= 0xc0) && (!seen_c2) ) { + utf_hi_char = d - 0xc2; + seen_c2 = true; + return 0; + } + else if (seen_c2){ + d &= 0x3f; + #ifndef MAPPER_ONE_TO_ONE + HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); + #else + HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; + #endif + } + else { + HARDWAERE_CHAR_OUT('?'); + } + } + else { + HARDWAERE_CHAR_OUT((char) c ); + } + seen_c2 = false; + return 1; + } +#elif defined( MAPPER_D0D1_MOD ) + uint8_t utf_hi_char; // UTF-8 high part + bool seen_d5 = false; + char charset_mapper(char c){ + // it is a Russian alphabet translation + // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё + uint8_t d = c; + if ( d >= 0x80 ) { // UTF-8 handling + if ((d >= 0xd0) && (!seen_d5)) { + utf_hi_char = d - 0xd0; + seen_d5 = true; + return 0; + } else if (seen_d5) { + d &= 0x3f; + if ( !utf_hi_char && ( d == 1 )) { + HARDWAERE_CHAR_OUT((char) 0xa2 ); // Ё + } else if ((utf_hi_char == 1) && (d == 0x11)) { + HARDWAERE_CHAR_OUT((char) 0xb5 ); // ё + } else { + HARDWAERE_CHAR_OUT((char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x10 )); + } + } + else { + HARDWAERE_CHAR_OUT('?'); + } + } else { + HARDWAERE_CHAR_OUT((char) c ); + } + seen_d5 = false; + return 1; + } +#elif defined( MAPPER_D0D1 ) + uint8_t utf_hi_char; // UTF-8 high part + bool seen_d5 = false; + char charset_mapper(char c){ + // it is a Russian alphabet translation + // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё + uint8_t d = c; + if ( d >= 0x80 ) { // UTF-8 handling + if ((d >= 0xd0) && (!seen_d5)) { + utf_hi_char = d - 0xd0; + seen_d5 = true; + return 0; + } else if (seen_d5) { + d &= 0x3f; + #ifndef MAPPER_ONE_TO_ONE + HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); + #else + HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; + #endif + } else { + HARDWAERE_CHAR_OUT('?'); + } + } else { + HARDWAERE_CHAR_OUT((char) c ); + } + seen_d5 = false; + return 1; + } +#elif defined( MAPPER_E382E383 ) + uint8_t utf_hi_char; // UTF-8 high part + bool seen_e3 = false; + bool seen_82_83 = false; + char charset_mapper(char c){ + uint8_t d = c; + if ( d >= 0x80 ) { // UTF-8 handling + if ( (d == 0xe3) && (seen_e3 == false)) { + seen_e3 = true; + return 0; // eat 0xe3 + } else if ( (d >= 0x82) && (seen_e3 == true) && (seen_82_83 == false)) { + utf_hi_char = d - 0x82; + seen_82_83 = true; + return 0; + } else if ((seen_e3 == true) && (seen_82_83 == true)){ + d &= 0x3f; + #ifndef MAPPER_ONE_TO_ONE + HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); + #else + HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; + #endif + } else { + HARDWAERE_CHAR_OUT((char) '?' ); + } + } else { + HARDWAERE_CHAR_OUT((char) c ); + } + seen_e3 = false; + seen_82_83 = false; + return 1; + } +#else + #error "You have to define one of the DISPLAY_INPUT_CODE_MAPPERs in your language_xx.h file" // should not occur because (en) will set. +#endif // code mappers + +#endif // UTF_MAPPER_H From 817751d4b969baf545b0587aca3007d118872c48 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 11 Mar 2015 11:10:35 +0100 Subject: [PATCH 016/302] Added new languages, the Cyrillic display and a test language to find out your hardware. --- Marlin/Configuration.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 076e75c53..70b74123e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -565,13 +565,15 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, kanji, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display chose that one best fitting to your language. +// to find out what type you have - compile with language_test.h - upload - click to get the menu. + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) From 5bafb1fe1f66dfc24e2f003dfe395ea218c9c3fa Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 11 Mar 2015 20:46:52 +0100 Subject: [PATCH 017/302] Add user test to language_test.h and make it default. Improve description in Configuration.h --- Marlin/Configuration.h | 2 +- Marlin/language_test.h | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 70b74123e..96c307bcb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -570,7 +570,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) // Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display chose that one best fitting to your language. -// to find out what type you have - compile with language_test.h - upload - click to get the menu. +// to find out what type you have - compile with language_test.h - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware //#define DISPLAY_CHARSET_HD44780_WESTERN //#define DISPLAY_CHARSET_HD44780_CYRILIC diff --git a/Marlin/language_test.h b/Marlin/language_test.h index 908275414..b58da76f6 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -25,16 +25,17 @@ // impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). // d.) So for Kanji we use a very special and selected subset of symbols and the direct mapping like in a). -//#define MAPPER_NON // For direct asci codes ( until now all languages except ru, de, ... ) -#define MAPPER_C2C3 // For most European languages when language file is in utf8 +#define MAPPER_NON // For direct asci codes ( until now all languages except ru, de, ... ) +//#define MAPPER_C2C3 // For most European languages when language file is in utf8 //#define MAPPER_D0D1 // For Cyrillic -//#define MAPPER_D0D1_MOD // For Cyrillic on HD44780_CYRILIC (will save 32 byte in the mapper but adds some more decisions) +////#define MAPPER_D0D1_MOD // For Cyrillic on HD44780_CYRILIC (will save 32 byte in the mapper but adds some more decisions) //#define MAPPER_E382E383 // For Katakana // next 4 lines select variants in this file only +#define DISPLAYTEST //#define WEST -#define CYRIL +//#define CYRIL //#define KANA //#define KANJI @@ -47,6 +48,8 @@ #define STRG_ASCII_6 "`abcdefghijklmno" #define STRG_ASCII_7 "pqrstuvwxyz{|}~" +#define STRG_C2_8 "" +#define STRG_C2_9 "" #define STRG_C2_a " ¡¢£¤¥¦§¨©ª«¬­®¯" #define STRG_C2_b "°±²³´µ¶·¸¹º»¼½¾¿" #define STRG_C3_8 "ÈÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ" @@ -89,6 +92,14 @@ #define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" #define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" +#ifdef DISPLAYTEST + #define WELCOME_MSG "Language TEST" + + #define MSG_WATCH "Display test" + #define MSG_PREPARE STRG_OKTAL_c + #define MSG_CONTROL STRG_OKTAL_d +#endif + #ifdef WEST #define WELCOME_MSG "Language TEST" From 0620267ebb4d06c9b491b7a5c21fe0d6124006e3 Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Wed, 11 Mar 2015 23:53:28 +0100 Subject: [PATCH 018/302] g29 auto-mode for the new G29 LRFB short: this script scans the first few lines from a gcode. If the line between 2 different z are greater than min_g1 this is our first layer. On this layer we search the min and max values of X and Y. With an offset we write that in a new file. --- Marlin/scripts/g29_auto.py | 164 +++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 Marlin/scripts/g29_auto.py diff --git a/Marlin/scripts/g29_auto.py b/Marlin/scripts/g29_auto.py new file mode 100644 index 000000000..95b3385ce --- /dev/null +++ b/Marlin/scripts/g29_auto.py @@ -0,0 +1,164 @@ +# This file is for preprocessing gcode and the new G29 Autobedleveling from Marlin +# It will analyse the first 2 Layer and return the maximum size for this part +# After this it will replace with g29_keyword = ';MarlinG29Script' with the new G29 LRFB +# the new file will be created in the same folder. + +# your gcode-file/folder +folder = './' +my_file = 'test.gcode' + +# this is the minimum of G1 instructions which should be between 2 different heights +min_g1 = 3 + +# maximum number of lines to parse, I don't want to parse the complete file +# only the first plane is we are interested in +max_g1 = 1000 + +# g29 keyword +g29_keyword = ';MarlinG29Script' + +# output filename +output_file = folder + 'g29_' + my_file + +# offset makes the plane a little bit bigger +offset_x = 10 +offset_y = 10 +probing_points = 3 # points x points + +# other stuff +min_x = 500 +min_y = min_x +max_x = -500 +max_y = max_x +last_z = 0.001 + +layer = 0 +lines_of_g1 = 0 + +gcode = [] + + +def found_g1(line): + return line[:2].upper() == "G1" + + +def find(line, axis): + found = False + number = "" + for char in line: + if found: + if char == ".": + number += char + else: + try: + int(char) + number += char + except ValueError: + break + else: + found = char.upper() == axis.upper() + try: + return float(number) + except ValueError: + return None + + +def set_mima(line): + global min_x, max_x, min_y, max_y, last_z + + current_x = find(line, 'x') + current_y = find(line, 'y') + + if current_x is not None: + min_x = min(current_x, min_x) + max_x = max(current_x, max_x) + if current_y is not None: + min_y = min(current_y, min_y) + max_y = max(current_y, max_y) + + return min_x, max_x, min_y, max_y + + +def find_z(gcode, start_at_line=0): + for i in range(start_at_line, len(gcode)): + my_z = find(gcode[i], 'Z') + if my_z is not None: + return my_z, i + + +def z_parse(gcode, start_at_line=0, end_at_line=0): + i = start_at_line + all_z = [] + line_between_z = [] + z_at_line = [] + # last_z = 0 + last_i = -1 + + while len(gcode) > i: + try: + z, i = find_z(gcode, i + 1) + except TypeError: + break + + all_z.append(z) + z_at_line.append(i) + line_between_z.append(i - last_i - 1) + # last_z = z + last_i = i + if 0 < end_at_line <= i: + break + # print('{}:{}'.format(last_z, last_i)) + + line_between_z = line_between_z[1:] + return all_z, line_between_z, z_at_line + + +def get_lines(gcode, minimum): + i = 0 + all_z, line_between_z, z_at_line = z_parse(gcode, end_at_line=max_g1) + for count in line_between_z: + i += 1 + if count > minimum: + return z_at_line[i - 1], z_at_line[i] + + +with open(my_file, 'r') as file: + lines = 0 + for line in file: + lines += 1 + if lines > 1000: + break + if found_g1(line): + gcode.append(line) +file.close() + +start, end = get_lines(gcode, min_g1) +for i in range(start, end): + set_mima(gcode[i]) + +min_x = int(min_x) - offset_x +max_x = int(max_x) + offset_x +min_y = int(min_y) - offset_y +max_y = int(max_y) + offset_y + +new_command = 'G29 L{0} R{1} F{2} B{3} P{4}\n'.format(min_x, + max_x, + min_y, + max_y, + probing_points) + + +out_file = open(output_file, 'w') +print('out_file open') +input_file = open(my_file, 'r') +print('input_file open') + +for line in input_file: + if line[:len(g29_keyword)] == g29_keyword: + out_file.write(new_command) + print('write new_command') + else: + out_file.write(line) + +file.close() +out_file.close() From 2e7ba44633372f726ef471bf4d1edc7debb2a36e Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Fri, 13 Mar 2015 07:31:27 +0100 Subject: [PATCH 019/302] some renaming for readability --- Marlin/scripts/g29_auto.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/scripts/g29_auto.py b/Marlin/scripts/g29_auto.py index 95b3385ce..b460e97a7 100644 --- a/Marlin/scripts/g29_auto.py +++ b/Marlin/scripts/g29_auto.py @@ -38,11 +38,11 @@ lines_of_g1 = 0 gcode = [] -def found_g1(line): +def has_g1(line): return line[:2].upper() == "G1" -def find(line, axis): +def find_axis(line, axis): found = False number = "" for char in line: @@ -66,8 +66,8 @@ def find(line, axis): def set_mima(line): global min_x, max_x, min_y, max_y, last_z - current_x = find(line, 'x') - current_y = find(line, 'y') + current_x = find_axis(line, 'x') + current_y = find_axis(line, 'y') if current_x is not None: min_x = min(current_x, min_x) @@ -81,7 +81,7 @@ def set_mima(line): def find_z(gcode, start_at_line=0): for i in range(start_at_line, len(gcode)): - my_z = find(gcode[i], 'Z') + my_z = find_axis(gcode[i], 'Z') if my_z is not None: return my_z, i @@ -122,13 +122,13 @@ def get_lines(gcode, minimum): return z_at_line[i - 1], z_at_line[i] -with open(my_file, 'r') as file: +with open(folder+my_file, 'r') as file: lines = 0 for line in file: lines += 1 if lines > 1000: break - if found_g1(line): + if has_g1(line): gcode.append(line) file.close() From 76da32b5679ec4cb6e9525b90e05019d091b9863 Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Fri, 13 Mar 2015 07:44:20 +0100 Subject: [PATCH 020/302] add hash-bang for python3 --- Marlin/scripts/g29_auto.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/scripts/g29_auto.py b/Marlin/scripts/g29_auto.py index b460e97a7..d5f2a1c6e 100644 --- a/Marlin/scripts/g29_auto.py +++ b/Marlin/scripts/g29_auto.py @@ -1,3 +1,5 @@ +#!/usr/bin/python3 + # This file is for preprocessing gcode and the new G29 Autobedleveling from Marlin # It will analyse the first 2 Layer and return the maximum size for this part # After this it will replace with g29_keyword = ';MarlinG29Script' with the new G29 LRFB From 96f8d20f2f3b130ae0cb76536df6b7c0c27fefc1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 14:26:58 +0100 Subject: [PATCH 021/302] Change selection logic another time Automatic selection was to unflexible. Updated documentation Updated language files to new logic and documentation. Updated bdf2u8g.exe --- Documentation/LCDLanguageFont.md | 64 ++++++++++++++++------------ Marlin/Configuration.h | 7 ++-- Marlin/dogm_lcd_implementation.h | 70 ++++++++++++++++--------------- Marlin/language.h | 6 +++ Marlin/language_an.h | 5 ++- Marlin/language_ca.h | 5 ++- Marlin/language_de.h | 5 ++- Marlin/language_en.h | 10 ++++- Marlin/language_es.h | 5 ++- Marlin/language_eu.h | 5 ++- Marlin/language_fi.h | 5 ++- Marlin/language_fr.h | 6 ++- Marlin/language_it.h | 5 ++- Marlin/language_kana.h | 5 ++- Marlin/language_kana_utf8.h | 5 ++- Marlin/language_kanji.h | 2 +- Marlin/language_nl.h | 5 ++- Marlin/language_pl.h | 5 ++- Marlin/language_pt-br.h | 5 ++- Marlin/language_pt.h | 5 ++- Marlin/language_ru.h | 7 +++- Marlin/language_test.h | 26 ++++++++---- Marlin/scripts/Fonts/bdf2u8g.exe | Bin 19968 -> 56515 bytes Marlin/utf_mapper.h | 48 ++++++++++----------- 24 files changed, 194 insertions(+), 117 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index a06b39160..13e70b90a 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -1,15 +1,15 @@ # LCD Language Font System -We deal with a variety of differend displays. -And we try to display different languages on them. +We deal with a variety of different displays. +And we try to display a lot of different languages on them. This system is ought to solve some of the related problems. ## The Displays -We have two different technologys for the displays: +We have two different technologies for the displays: * Character based displays Have a fixed set of symbols (charset - font) in their ROM. - All of them have similar but not identical symbols at the positions 0 to 127 similar to US-ASCII. + All of them have a similar but not identical symbol set at the positions 0 to 127 similar to US-ASCII. On the other hand symbols at places higher than 127 have mayor differences. Until now we know of (and support): 1.) HD44780 and similar with Kana charset A00 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 17 @@ -22,10 +22,10 @@ We have two different technologys for the displays: * Full graphic displays Where we have the full freedom to display whatever we want, when we can make a program for it. - Currently we deal with 128x64 Pixel Displays and devide this area in about 5 Lines with about 22 columns. + Currently we deal with 128x64 Pixel Displays and divide this area in about 5 Lines with about 22 columns. Therefore we need fonts with a bounding box of about 6x10. Until now we used a - 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end what made '' and '' unaccessible in the size 6x10. + 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. @@ -48,17 +48,18 @@ We have two different technologys for the displays: and recently on [Thingiverse](http://www.thingiverse.com/) a new port to * jp [Japanese](http://www.thingiverse.com/thing:664397) appeared. - + +## The Problem All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. - Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '') - And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite the programmer wanted.) - The Germans want to use "a" the Finnish at least "". Other European languages want to see their accents an their letters. + Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '³') + And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of the programmer wanted.) + The Germans want to use "ÄäÖöÜüß" the Finnish at least "äö". Other European languages want to see their accents an their letters. For other scripts like Cyrillic, Japanese, Greek, Hebrew, ... you have to find totally different symbol sets. Until now the problems where ignored widely. - The German translation used utf8 '' and '' and did not care about showing garbage on all displays. + The German translation used utf8 'ä' and 'ö' and did not care about showing garbage on ALL displays. The Russian translators new that their system only works on the Cyrillic character displays and relied on special LCD routines (LiquidCrystalRus.cpp) to handle UTF8 but missed to implement a proper strlen(). - The Japanese translator dealed with to scritps. He introduced a very special font for the full graphic displays and made use of the Japanese version of the character displays. Therefore he ended up with two pretty unreadable language.h files full of '\xxx' definitions. + The Japanese translator dealed with to scripts. He introduced a very special font for the full graphic displays and made use of the Japanese version of the character displays. Therefore he ended up with two pretty unreadable language.h files full of '\xxx' definitions. Other languages ether tried to avoid wording with their special symbols or ignored the problem at all and used the basic symbols without the accents, dots, ... whatever. ## The (partial) Solution @@ -74,15 +75,15 @@ We have two different technologys for the displays: ### Actions: a.) Declare the display hardware we use. (Configuration.h) b.) Declare the language ore script we use. (Configuration.h) - c.) Declare the kind of input we use. Ether direct pointers to the font (\xxx) or UTF8. (language_xx.h) + c.) Declare the kind of input we use. Ether direct pointers to the font (\xxx) or UTF8 and the font to use on graphic displays. (language_xx.h) d.) Declare the needed translations. (language_xx.h) e.) Make strlen() work with UTF8. (ultralcd.cpp) f.) Seperate the Marlin Symbols to their own font. (dogm_font_data_Marlin_symbols.h) g.) Make the fontswitch function remember the last used font. (dogm_lcd_implementation.h) - h.) Make output functions what count the number of written chars and switch the font to Marlin symbols and back when needed. (dogm_lcd_implementation.h) (ultralcd_implementation_hitachi_HD44780.h) - i.) Make three fonts to simulate the HD44780 charsets on dogm-displays. This makes translations easy because we have less charsets we have to deal with. (What is working on the HD44780s will also work on the dogms.) - j.) Make ISO fonts for Cyrillic and Katakana because they do not need a mapping table and are faster to deal with and have a better charset (less compromises) - k.) Make mapping functions and tables to convert from UTF8 to the fonts and integrate to the new output functions. (utf_mapper.h) + h.) Make output functions that count the number of written chars and switch the font to Marlin symbols and back when needed. (dogm_lcd_implementation.h) (ultralcd_implementation_hitachi_HD44780.h) + i.) Make three fonts to simulate the HD44780 charsets on dogm-displays. With this fonts the translator can check how his translation will look on the character based displays. + j.) Make ISO fonts for Cyrillic and Katakana because they do not need a mapping table and are faster to deal with and have a better charset (less compromises) than the HD44780 fonts. + k.) Make mapping functions and tables to convert from UTF8 to the fonts and integrate in the new output functions. (utf_mapper.h) l.) Delete the not needed any more 'LiquidCrystalRus.xxx' files and their calls in 'ultralcd_implementation_hitachi_HD44780.h'. m.) Split 'dogm_font_data_Marlin.h' into separate fonts and delete. (+dogm_font_data_6x9_marlin.h , +dogm_font_data_Marlin_symbols.h, -dogm_font_data_Marlin.h) n.) Do a bit of preprocessor magic to match displays - fonts and mappers in 'utf_mapper.h'. @@ -92,13 +93,13 @@ We have two different technologys for the displays: b.) Ether their is declared MAPPER_NON (-> c.) or an other mapper (-> d.) c.) Symbols outside the normal ASCII-range (32-128) are written as "\xxx" and point directly into the font of the hardware you declared in 'Configuration.h' This is one of the three fonts of the character based Hitachi displays (DISPLAY_CHARSET_HD44780_JAPAN, DISPLAY_CHARSET_HD44780_WEST, DISPLAY_CHARSET_HD44780_CYRILIC). - Even on the full graphic displays one of these will be used. + Even on the full graphic displays one of these will be used when SIMULATE_ROMFONT is defined. If you don't make use of the extended character set your file will look like 'language_en.h' and your language file will work on all the displays. If you make intensive use, your file will look like 'language_kana.h' and your language file will only work on one of displays. (in this case DISPLAY_CHARSET_HD44780_JAPAN) - Be careful with the characters 0x5c = '\', and 0x7b - 0x7f. These are not the same on all variants. + Be careful with the characters 0x5c = '\', and 0x7b - 0x7f. "{|}"These are not the same on all variants. MAPPER_NON is the fastest an least memory consuming variant. If you want to make use of more than a view symbols outside standard ASCII or want to improve the portability to more different types of displays use UTF8 input. That means define an other mapper. - d.) With a mapper different to MAPPER_NON UTF8 input is used. Instead of "\xe1" (on a display with Japanese font) or STR_ae simply use "?". When the string is read byte by byte , the "?" will expand to "\0xc3\0xa4" or "" will expand to "0xd0\0xaf" or "?" will expand to "\0xe3\0x83\0x9b" + d.) With a mapper different to MAPPER_NON UTF8 input is used. Instead of "\xe1" (on a display with Japanese font) or STR_ae simply use "ä". When the string is read byte by byte , the "ä" will expand to "\0xc3\0xa4" or "Я" will expand to "0xd0\0xaf" or "ホ" will expand to "\0xe3\0x83\0x9b" To limit the used memory we can't use all the possibilities UTF8 gives at the same time. We define a subset matching to the language or script we use. MAPPER_C2C3 correspondents good with west European languages the possible symbols are listed at (http://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)) MAPPER_D0D1 correspondents well with the Cyrillic languages. See (http://en.wikipedia.org/wiki/Cyrillic_(Unicode_block)) @@ -106,20 +107,31 @@ We have two different technologys for the displays: The mapper functions will only catch the 'lead in' described in the mappers name. If the input they get does not match they'll put out a '?' or garbage. The last byte in the sequence ether points directly into a matching ISO10646 font or via a mapper_table into one of the HD44780 fonts. The mapper_tables do their best to find a similar symbol in the HD44780_fonts. For example replacing small letters with the matching capital letters. But they may fail to find something matching and will output a '?'. There are combinations of language and display what simply have no corresponding symbols - like Cyrillic on a Japanese display or visa versa - than the compiler will throw an error. - In short: Chose a Mapper working with the symbols you want to use. Use only symbols matching the mapper. On FULL graphic displays all will be fine, but check for daring replacements or question-marks in the output of character based displays. - If you get a lot of question-marks on the Hitachi based displays with your new translation, maybe creating a new language file with the format 'language_xx_utf8.h' is the way to go. + In short: Chose a Mapper working with the symbols you want to use. Use only symbols matching the mapper. On FULL graphic displays all will be fine, but check for daring replacements or question-marks in the output of character based displays by defining SIMULATE_ROMFONT and trying the different variants. + If you get a lot of question-marks on the Hitachi based displays with your new translation, maybe creating an additional language file with the format 'language_xx_utf8.h' is the way to go. + MAPPER_NON is the fastest and least memory consuming variant. Mappers together with a ISO10646_font are the second best choice regarding speed and memory consumption. Only a few more decisions are mad per character. Mappers together with the HD44780_fonts use about additional 128 bytes for the mapping_table. - e.) Creating a new language file is not a big thing. Just make a new file with the format 'language_xx.h' or maybe 'language.xx.utf8.h', define a mapper in there and translate some of the strings defined in language_en.h. You can drop the surrounding #ifndef #endif. You don't have to translate all the stings - the missing one will be added by language_en.h - in English - of cause. + e.) Creating a new language file is not a big thing. Just make a new file with the format 'language_xx.h' or maybe 'language.xx.utf8.h', define a mapper and a font in there and translate some of the strings defined in language_en.h. You can drop the surrounding #ifndef #endif. You don't have to translate all the stings - the missing one will be added by language_en.h - in English - of cause. f.) If you cant find a matching mapper things will be a bit more complex. With the Hitachi based displays you will not have big chance to make something useful unless you have one with a matching charset. For a full graphic display - lets explain with - let's say Greece. Find a matching charset. (http://en.wikipedia.org/wiki/Greek_and_Coptic) Provide a font containing the symbols in the right size. Normal ASCII in the lower 127 places, the upper with your selection. Write a mapper catching, in this case, 0xcd to 0xcf and add it to 'utf_mapper.h'. In case of a ISO10646 font we have a MAPPER_ONE_TO_ONE and don't have to make a table. - g.) If you discover enough useful symbols in one of the HD44780 fonts you can provide a mapping table. For example HD44780_WEST contains 'alpha', 'beta', 'pi', 'Sigma', 'omega' 'My' - what is not enough to make USEFUL table - i think. + g.) If you discover enough useful symbols in one of the HD44780 fonts you can provide a mapping table. For example HD44780_WEST contains 'alpha', 'beta', 'pi', 'Sigma', 'omega' 'My' - what is not enough to make USEFUL table - I think. h.) If you want to integrate an entirely new variant of a Hitachi based display. Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. + The length of the strings is limited. '17 chars' was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. + On the 16x2 displays the strings are cut at the end to fit on the display. So it's a good idea to make them differ early. ('Somverylongoptionname x' -> 'x Somverylongoptionname') + You'll find all translatable strings in 'language_en.h'. Please don't translate any strings from 'language.h', this may break the serial protocol. + ## User Instructions - Define your hardware and language in 'Configuration.h'. Done. - \ No newline at end of file + Define your hardware and the wanted language in 'Configuration.h'. + To find out what charset you harware is define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. + * DISPLAY_CHARSET_HD44780_JAPAN locks like "バパヒビピフブプヘベペホボポマミ" + * DISPLAY_CHARSET_HD44780_WESTERN locks like "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" + * DISPLAY_CHARSET_HD44780_CYRILIC locks like "РСТУФХЦЧШЩЪЫЬЭЮЯ" + + If you get an error about missing mappers during compilation - lie about your displays hardware font to see at lest some garbage, or select an other language. English works on all hardware. + diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 96c307bcb..53f916b31 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -567,10 +567,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Define your display language below. Replace (en) with your language code and uncomment. // en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, kanji, test // See also language.h -//#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) +#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display chose that one best fitting to your language. -// to find out what type you have - compile with language_test.h - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display this information is not important. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// Se also documentation/LCDLanguageFont.md #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware //#define DISPLAY_CHARSET_HD44780_WESTERN //#define DISPLAY_CHARSET_HD44780_CYRILIC diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 171b42733..ab61751a7 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -35,10 +35,10 @@ #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" #include "configuration.h" -#include "utf_mapper.h" + #include -#include "dogm_font_data_6x9_marlin.h" // Height of 'A' is only 5 pixel. +#include "dogm_font_data_6x9_marlin.h" // Height of 'A' is only 6 pixel. #include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols #define FONT_STATUSMENU_NAME u8g_font_6x9 // we don't have a small font for Cyrillic, Kana or Kanji @@ -50,38 +50,38 @@ #define USE_BIG_EDIT_FONT #endif -#if defined( MAPPER_C2C3 ) - #include // System font. This is ISO10646-1 - #define FONT_MENU_NAME u8g_font_6x10 - -#elif defined( MAPPER_D0D1 ) - #include "dogm_font_data_ISO10646_5_Cyrillic.h" - #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7 - -#elif defined( MAPPER_E382E383 ) - #include "dogm_font_data_ISO10646_Kana.h" - #define FONT_MENU_NAME ISO10646_Kana_5x7 - -#elif defined( DISPLAY_CHARSET_KANJI ) && defined( MAPPER_NON ) - #include "dogm_font_data_6x10_marlin_Kanji.h" - #define FONT_MENU_NAME u8g_font_6x10_marlin - -#elif defined( DISPLAY_CHARSET_HD44780_JAPAN ) - #include "dogm_font_data_HD44780_J.h" - #define FONT_MENU_NAME HD44780_J_5x7 - -#elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) - #include "dogm_font_data_HD44780_W.h" - #define FONT_MENU_NAME HD44780_W_5x7 - -#elif defined( DISPLAY_CHARSET_HD44780_CYRILIC ) - #include "dogm_font_data_HD44780_C.h" - #define FONT_MENU_NAME HD44780_C_5x7 - -#else // #if defined( MAPPER_C2C3 ) // fall-back - #include // system font - #define FONT_MENU_NAME u8g_font_6x10 -#endif +#ifndef SIMULATE_ROMFONT + #if defined( DISPLAY_CHARSET_ISO10646_1 ) + #include // System font. + #define FONT_MENU_NAME u8g_font_6x10 + #elif defined( DISPLAY_CHARSET_ISO10646_5 ) + #include "dogm_font_data_ISO10646_5_Cyrillic.h" + #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7 + #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) + #include "dogm_font_data_ISO10646_Kana.h" + #define FONT_MENU_NAME ISO10646_Kana_5x7 + #elif defined( DISPLAY_CHARSET_KANJI ) + #include "dogm_font_data_6x10_marlin_Kanji.h" + #define FONT_MENU_NAME u8g_font_6x10_marlin + #else // fall-back + #include // system font + #define FONT_MENU_NAME u8g_font_6x10 + #endif +#else // SIMULATE_ROMFONT + #if defined( DISPLAY_CHARSET_HD44780_JAPAN ) + #include "dogm_font_data_HD44780_J.h" + #define FONT_MENU_NAME HD44780_J_5x7 + #elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) + #include "dogm_font_data_HD44780_W.h" + #define FONT_MENU_NAME HD44780_W_5x7 + #elif defined( DISPLAY_CHARSET_HD44780_CYRILIC ) + #include "dogm_font_data_HD44780_C.h" + #define FONT_MENU_NAME HD44780_C_5x7 + #else // fall-back + #include // system font + #define FONT_MENU_NAME u8g_font_6x10 + #endif +#endif // SIMULATE_ROMFONT #define FONT_STATUSMENU 1 #define FONT_SPECIAL 2 @@ -138,6 +138,8 @@ U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 #endif +#include "utf_mapper.h" + char currentfont = 0; static void lcd_setFont(char font_nr) { diff --git a/Marlin/language.h b/Marlin/language.h index 330bb3c91..b4c6f3aba 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -11,6 +11,7 @@ // // ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" // ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS +// Se also documentation/LCDLanguageFont.md // Languages // en English @@ -201,6 +202,11 @@ #define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX // LCD Menu Messages + +#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILIC )) + #define DISPLAY_CHARSET_HD44780_JAPAN +#endif + #include LANGUAGE_INCLUDE #include "language_en.h" diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 6155d5742..aef304075 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -2,13 +2,16 @@ * Aragonese * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_AN_H #define LANGUAGE_AN_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " parada." #define MSG_SD_INSERTED "Tarcheta colocada" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 2627438ec..8f00f8b7d 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -2,7 +2,7 @@ * Catalan * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_CA_H @@ -10,6 +10,9 @@ //#define MAPPER_NON #define MAPPER_C2C3 // because of "ó" +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " preparada." #define MSG_SD_INSERTED "SD detectada." diff --git a/Marlin/language_de.h b/Marlin/language_de.h index af7bdf93c..2487ba93a 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -2,13 +2,16 @@ * German * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_DE_H #define LANGUAGE_DE_H #define MAPPER_C2C3 +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " Bereit." #define MSG_SD_INSERTED "SDKarte erkannt." diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 42e9f0b1c..51c575aae 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -2,16 +2,22 @@ * English * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_EN_H #define LANGUAGE_EN_H -#if !(defined(MAPPER_NON) || defined(MAPPER_C2C3) || defined(MAPPER_D0D1_MOD) || defined(MAPPER_E382E383)) +#if !( defined(MAPPER_NON)|| defined(MAPPER_C2C3)|| defined(MAPPER_D0D1)|| defined(MAPPER_D0D1_MOD)|| defined(MAPPER_E382E383) ) #define MAPPER_NON // For direct asci codes #endif +//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays +#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA)|| defined(DISPLAY_CHARSET_KANJI) ) + #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. +#endif + + #ifndef WELCOME_MSG #define WELCOME_MSG MACHINE_NAME " ready." #endif diff --git a/Marlin/language_es.h b/Marlin/language_es.h index d6a38d3ce..1602c3c1c 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -2,13 +2,16 @@ * Spanish * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_ES_H #define LANGUAGE_ES_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " lista." #define MSG_SD_INSERTED "Tarjeta colocada" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index f4857ccfb..9bce0a7c1 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -2,13 +2,16 @@ * Basque-Euskera * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_EU_H #define LANGUAGE_EU_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " prest." #define MSG_SD_INSERTED "Txartela sartuta" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index d84f1b28a..711f09639 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -2,13 +2,16 @@ * Finnish * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_FI_H #define LANGUAGE_FI_H #define MAPPER_C2C3 +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " valmis." #define MSG_SD_INSERTED "Kortti asetettu" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 4c443f90d..7e1194d7b 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -2,13 +2,17 @@ * French * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_FR_H #define LANGUAGE_FR_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 + #define WELCOME_MSG MACHINE_NAME " prete." #define MSG_SD_INSERTED "Carte inseree" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 0cb0dc94d..5b2709faf 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -2,13 +2,16 @@ * Italian * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_IT_H #define LANGUAGE_IT_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "SD Card inserita" diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 8c8ecdb87..5810fa11d 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -2,7 +2,7 @@ * Japanese (Kana) * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ @@ -10,6 +10,9 @@ #define LANGUAGE_KANA_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_KANA // 片仮名表示定義 #define WELCOME_MSG MACHINE_NAME " ready." diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index d364a0332..5501475ea 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -2,7 +2,7 @@ * Japanese (Kana UTF8 version) * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ @@ -10,6 +10,9 @@ #define LANGUAGE_KANA_UTF_H #define MAPPER_E382E383 +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_KANA // This is very crude replacement of the codes used in language_kana.h from somebody who really does not know what he is doing. // Just to show the potential benefit of unicode. diff --git a/Marlin/language_kanji.h b/Marlin/language_kanji.h index 15b8359ab..8c98b6a05 100644 --- a/Marlin/language_kanji.h +++ b/Marlin/language_kanji.h @@ -2,7 +2,7 @@ * Japanese (Kanji) * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #include "Configuration.h" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index f691fe6fb..81eef72bb 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -2,13 +2,16 @@ * Dutch * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_NL_H #define LANGUAGE_NL_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " gereed." #define MSG_SD_INSERTED "Kaart ingestoken" diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index e8d74100a..2d5643024 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -2,13 +2,16 @@ * Polish * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_PL_H #define LANGUAGE_PL_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " gotowy." #define MSG_SD_INSERTED "Karta wlozona" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index f15627a05..734272a29 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -2,13 +2,16 @@ * Portuguese (Brazil) * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_PT_BR_H #define LANGUAGE_PT_BR_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "Cartao inserido" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 17e4c3307..08274e112 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -2,13 +2,16 @@ * Portuguese * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_PT_H #define LANGUAGE_PT_H #define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "Cartao inserido" diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 42c974fa1..3e3359855 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -2,13 +2,16 @@ * Russian * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_RU_H #define LANGUAGE_RU_H -#define MAPPER_D0D1 // For Cyrillic +#define MAPPER_D0D1 // For Cyrillic +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_5 #define WELCOME_MSG MACHINE_NAME " Готов." #define MSG_SD_INSERTED "Карта вставлена" diff --git a/Marlin/language_test.h b/Marlin/language_test.h index b58da76f6..a2ba43fae 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -2,7 +2,7 @@ * TEST * * LCD Menu Messages - * Please note these are limited to 17 characters! + * Se also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_TEST_H @@ -10,12 +10,12 @@ // Select ONE of the following Mappers. // They decide what to do with a symbol in the area of [0x80:0xFF]. They take a symbol of this language file and make them point -// into an array with 128 cells, where they find the place of the symbol in the font in use. +// into an array with 128 cells, where they'll find the place of the symbol of the font in use. // // a.)For ASCII coded Language_xx.h files like (en) there are no occurrences of symbols above 0x7F so no mapper is needed. -// If such a symbol appers it is mapped directly into the font. This is the case for the language files we used until now, with all the STR_XX or +// If such a symbol appears it is mapped directly into the font. This is the case for the language files we used until now, with all the STR_XX or // "\xxx" symbols. All Symbols are only one byte long. -// b.) For Unicoded Language_xx.h files (currently ru and de) the non ASCII [0x00-0x7F] symbols are represented by more then one byte. +// b.) For Unicoded Language_xx.h files (currently ru, de and kana_utf8 ) the non ASCII [0x00-0x7F] symbols are represented by more then one byte. // In the case of two bytes the first is pointing to a 'codepage' and the second to a place in the codepage. These codepages contain 64 symbols. // So two of them can be mapped. For most of the European languages the necessary symbols are contained in the pages C2 and C3. Cyrillic uses D0 // and D1. @@ -25,14 +25,22 @@ // impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). // d.) So for Kanji we use a very special and selected subset of symbols and the direct mapping like in a). -#define MAPPER_NON // For direct asci codes ( until now all languages except ru, de, ... ) +#define MAPPER_NON // For direct asci codes ( until now all languages except ru, de, fi, kana_utf8, ... ) //#define MAPPER_C2C3 // For most European languages when language file is in utf8 //#define MAPPER_D0D1 // For Cyrillic -////#define MAPPER_D0D1_MOD // For Cyrillic on HD44780_CYRILIC (will save 32 byte in the mapper but adds some more decisions) //#define MAPPER_E382E383 // For Katakana +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT -// next 4 lines select variants in this file only +// Select the better font for full graphic displays. +//#define DISPLAY_CHARSET_ISO10646_1 +//#define DISPLAY_CHARSET_ISO10646_5 +//#define DISPLAY_CHARSET_ISO10646_KANA +//#define DISPLAY_CHARSET_KANJI + + +// next 5 lines select variants in this file only #define DISPLAYTEST //#define WEST //#define CYRIL @@ -96,8 +104,8 @@ #define WELCOME_MSG "Language TEST" #define MSG_WATCH "Display test" - #define MSG_PREPARE STRG_OKTAL_c - #define MSG_CONTROL STRG_OKTAL_d + #define MSG_PREPARE STRG_OKTAL_b + #define MSG_CONTROL STRG_OKTAL_c #endif #ifdef WEST diff --git a/Marlin/scripts/Fonts/bdf2u8g.exe b/Marlin/scripts/Fonts/bdf2u8g.exe index ab4e3f96dd34f1378d0ca929f86570ad32c10f80..1e51b26567d78d2ba1b5eda6942a18561846dee2 100644 GIT binary patch literal 56515 zcmeHw3w%_?z5hA88#q8nf&`5gbcLW%AtV}J3Uwh_gc>9Qv7p!`B%6mWNt*2Puz+Yl zi7Oh^R`0#G5V5_qS6bV8TPm~-j|y6AsntrAwrNGXH2hmyQ=3+9^Z$Nl=Dc!(t@-zJ z|M%g6lbQLw=Qr;;XV1*PxlQwHnijy_+pB4N5b_F%zwiHNBhVQaJ)5CDGvo&s@6k(t zaPi{Wy5?YGQ$tNt#mZo1MSXokJh&nnY)aGz>*|9g3l;@eHdICPhYuf`t3;QDHLX<7 z&>lbV+Kt+MnzjkXbZUe3VY=^J?Me_W#NFxBHlBkp3wIfATF1Cg+N~o>`{jig{;zvL z7x~h(prj=Od2p#fCYJlP9-CRhKFHsVel4dz`U<~xs6V)Z<;SCI;)v%J;13OAUi;Xw zTq|3iUsVyW0ICeP_=7xaQ<$)?khZ)dzey4<9t`+$+y?GxxE)tWD+o<0l7RS7gpIh< zaffg_F4E<%Xl^EG@z0@fqXX%PZlvBisaN=LISOwO2udA9h(caRe(}P^gbH6Zf{yuM z**Y#k7mo?OLBcmGI>BiZl5SF=%!r_CQ*<}kG>nC`tl5*UoGyS{&PA{TbTnXz09k(o zT~VP(ucTcapkrCkKaNY#O`a?uLFV%)=;-ITg9uSUH)W~-=J9W*vTvOLS$_oGR9Q%K zSstfB$MV=n1au)I zYcFdPDrYChlvWgLJ4?U|WFT3b)f&i6Wtb!qRzTQaCMq@wD zkg9t}g-{bxxBmwyP!KM>&&FTx#Y(=W{(7fHQ|fQ&nW}o5d<5kAfVsV7=nkA!%I;!H$NXQ1n4q~XjURFC+$=vqS_KM z1axHSJ^K8?Jld$I{S>ECBX^u39!>p`Y*C&(V?lh9#r)7Sl zgRO*?RKXI+qht15j#3MEZ!Ob>u;~ZlBZ&bKG6_Sq)B}XeWvGu!4x(!Tu=Z&U2?3q+))CwOO8>QN9u;+s-pnk}Z~RQBQU8M?vLnvFcgU~%e;;F0vR zrA&z0aG@YemY=!nK=A9cwJpBh@R`(fDgCEVo(!K!BjP#c^GxbC%An24^;t@pX=Y2$ zMg5C>8|?!I_al<6%_*|4{X>P#C%2uVA}4hfpw9dYBfBQ{=P*MG{1;R2M@@mUIf{PSEXu~KKn{($dC1ENEQXfOlgK{?Yrq;tC!1qVb1X7CxltaZOm zhO<}(laNl+&~UB@XN`vm8#i~X9Xxk9Rwlinq?Ahy9$y@>{3jcAm(tYH7D7Hmn>79X zwj#}GS)Z=0DMa2;I;2Bae2JYxSIF^9PD*5V_^t79S)dJVScrhDEl#t~a`Z4RbS6{f z=`fs{AVJjX!)fUcs=`h?jb4t|;k0RJ1u~YhU_lF3u-&A~vtXSTT>yQ{mf|8?{nfBa+3c<)uf|8?{xAsFYNN_N+lc3}%W>x9fFjPc#5|kXp zoGTqb2pt3^N6`^V2M|IBK~Qe%07B>>C^?F5YB$V$FtU@Ngj;9Bfqlf(j zCZ+A15Vv#$IRf8=bjzWFTRx$BL5w3kEUm6dW|JC|EbnPOy1&z>^N(n|X(1?=0}-10 z$PGX14fou&zUMIbHpqtZaoWAEJ#S-3OkOwd#-dSKNR#!WJDJUPW}>BMR${2g;m%wn z6|B&N9YG-}SPfvJ1cE40lo_eXA_|j{odhWa`2>OyflyNN66Y%tx66e%Y0xe2Ly{cD z3f)craS*q)3>REI)xtWzE5|DqyaxP$5>Rw}LQD z&bL!TU{W%CVkhgmFbETm24N4UgCO4iM_9^wtI`iLO=^|ClWDdsm2O~~wOyqnf*yWW z=>LY28L(=7x#N4;^{B@mdnk_xUH(Z|_Bf8M^vmkEB~2lJ24;7PXKh%3Kx$ zqaI23_mMQxA!#Zl(NUZO1!U$sd_&}HCNWXUDv|4)7yHQhK9=HU%lIAQLeBoqz?K8H z996IG{R8S1vnkOubI4JJyPY_ex?+Vf7H$D>cJ)in6qSSBTx<9cDjg%`9df*Aoxe}G zq&2)JIf|-U%byYEb1`y`irsOiksQNn+Lg99sG%{7VF#JeK0QlIU5QMjG1j^+H#a%| z5DGV#Ebl=1j!w?shg43od=FCD$@$NSf?tMiBQBkjT`8Bw?~aBeR9}_(Ahts=)9l1w zt!w__@Np5jJXzl99Dt7NN5udn7nSHmmi`{IxA`Y}!^c$t6{ZE=q=vsZ#y)X_TBxt}91A z=Hqi<(&G7hxLI>W_>~`ZZrT6i=rLQyjs44zc}FjIO}I1j!E50w;es)ofQI^U!Sx@} zw6>N*>u&i(L`(`Wl3TNaQcN>Bf?x&`HvV+9rE_p=_;jBMLbs!QjwZvWTYn5Y-)lYA z(y3zxtk&M=V9KD%q-Wii#EP!vP}VK|DeN&7_SgyyXNCCt6|$aB5BICkTXm2#wUKdh zmnd#AF*=F8IxSh=?KGgr%JJ6pv*EU2dfq>ifwj-pCAtf(A5&GlBQjS{HRpTN zXik~#%paC((wr=)cG_{qVTW94b+7A?CUH+kSaM+9=hcEJ&^1PwFqcFBPRvwL9nO`I zouW_YpUoY2zTP#Zt?MemEl5vF(h2RH2hH7S&4%Xg6#X~5wa`vE%!oez&O==nwsn0Z zH5Q9|(aDB(im{F2=L${i!EmK6l#-_jBcS=ku8AfpE>V}IIw+-I&D?9D1z>#MT(hyU zw5&I@wW^-4=OWNdGzvY_!^S#=ji|y(Hvu=8?F*%9wy$ok>l_nsyS8P11MRE3Z~J1$ z)s?n~8FZGuSpw^nB*N*bM&oZMqY`xQvp@Dn+|f1dIEYH6CaWxs8g#c!~t zfPagj))NJ(4XA}m_sPp(n^J#r2;!ouam!;ahKT^H#kb&X?sCHbP@ckH1nAeWTeBRk zQAFS*_Br}dEQyf+@A>&2yu&~EQIEHLe6S2G1bGT&|q5D zck3IT>J6W6S$|sJ@XsylPo>>C^+4uV%1^cDBHp@x|H+H=BR_)v zGyNJt;*Hy`K?3Ri(n^iQTm$b$qY~YXQ z@?a3!U`AJQOOG!;uBFExpU^cGEdY-y@Em3o@_!jpcvhgL%9;8IQdcl_9aF=R8pqUh zq}tf^u!RYWyE7kLi%fukPn}XZAb^8KZ5Q~{nGco$uX1Fhj-s`tE;J!%M7gN{^v~_T z5%poybC^k|5-PC|iS`0?2CONas7I+JFdWKntPF9E6-1Yi`nPNi1c?h%zEcuOD3O>k zr9K1X$pqw(>lO!B!sPnA5~;XCXy~csLAOJ zWcjK4K*sD{3Db6Rf|VTgBz$MiMMYCM|F^xpCtud3iS-UCFOL)%J3m!IWt`)su4asT z4JX?bL&Cw(E*U1KMv|f4qBt;g7q_y?n~W5Da~dZ|qe3?Vrrk!7aX0}0Z?8t$6fv&+X|XzKI`G!zUK zEr)XDREJNF#B7sB0->^EAS*jrA()0N%IVF7yg+V*~;s1z!?9Bq+PJBerm4|-HJs;E{A%elY9OV|ev zW&S2a+u2E}$?cxEIE12}sPrzTS@~4@F{W7sReB54tcWVTM&Qv(Hg{lY!kr$4hyc-* z)y^#*1(^>Byh5W=vmEisj`(Gc_!z|D1jU^xQdugcJLvv+!j^l|5&xMZ{v${Hdx)EU zNA8cI-_H7#~D>jM!WubYtgz!#$$FP;%)a^2A#xtgfM=%tXAM*6i;w zo_HGwk$B?QjL|59Q)c3clZ_;wRHT|~T626wfmeAR`V}uIlw+I6v1dL-*a4h#;V5| zT@^xQ5XNRw*BCa* zZW45g&H|5+q#h)qk#Tao7@J+fcFU@`t#2P*b#UnOxrIGVVHZOfs|FLQARg&tlRlf3 zUnf_W5{x=_4AGWD%gmL0dl8(3HhqDJU?qiQd*>swFlP(wWQd_d&D+_9@QJ_VFrPln z5!6XGezk%rQjq(!857O5eNe$d_i0y$&zR7msXNejI7X%ur}1bbH4_iPkjDwgKEpg+ zhN1^YI;h~I89_RS9S#;){yVQg8{5PD`bB=z#cMcxZ{P%ht1#~rx=xOTXOS6^S$4wA zXX6ooQsB2daHHfVqz;3w>nEU0kn&eZ^`ZRh5J8!j`Yb7*0%bEP z_joB^k(9ZqW>Ve_%0;AnKvIrTKBM+8Ny=bq9&jhiVIGKAkhsE2yj~KIPK_pUo+OTv zxX4RfCW&)Wzr%d{SW0EY|M&E&uNSt8eqW8-7{%Ml$eOreT&3Z_6Fj zr@xapCP{T1M_=6vBLX;Md(tD^T3Euyq?x_Foa==Gn-wg zAMoSo)W5)iaPDZl#HajPz$%n_81U3*@JGEUXT49h3=&FP4?=t{#bZZV)H(9UbIV$P zg7J27>knIFxl2-yf*r3u(#6k$3~Hve^aK)DfW!cCfG-YSL;aAL1alIsNid>QKd98U z^n~I^!C0_0hE^AobCHnJ33zTRD#28tCyVkOqQRQ^>5|+Fp_1W6siSFd^t#-OwDtqC-4zer;XJ!`8>tN%02t7u1Tl*5!6ja;62W7L^v$!Ut zP2``Jp23IHh(%f9HITEMe-6#HW(O zmm#)yIg`(4Zu%CGdr6rrHpEi#I*4sKn10uL1ZK9h0H67dMMknYkQ~fNl9pFmuys5iv41J%b2)9ONbs0#K4UfM}_G=nRD(DY!X5xhU|h05Dtc76KpQ zU;oIKg9f-qZ^fPB2BxHLdKo1dL`mkNB=cGhO*q&lZ63M#<;0hh#duL9bJI2OXIFdX zH_?lPv}$Dhn?G4Q=&l#Ah0=T33*YiV)m^_KO8*NqR$HHnc%B#%lt;xrk69n z@dvQH#MfF{{~)QsN#;fHRP>OQPB zogGN~+%mY4C43QTa&=qpQ32Un7D$Eyt)qy=bm3&nq4akSs`p=Wl4G(%DF63*yvT#3;t(ZCm zoC>~!g6{3Q&-AY_h&7E9HMp>_n|>@YqU(CopT_i`#xH6; zkeqFRn}s3NjshE$Dq+dFM(fAK(6<{IGHHH~IB2?F2k%Z{|Iw~D)OgBKuA~Wroj-o7 zIi!mEAZ&%ES`h(RqEpE`oJPO$N^Mt?zlZ*WK-9KNC7S;1PhR|=Q$Ez(u7^$Is+5Q$ zso$VlcWpE4aPRmcj0J6Nz2g_FaE1z}sc^0epH$&S6|Pg^ause-;bSUnRAGqD$G)0whAYx zFi(X673QiiU4^4nsHreVgz{bF)X!d)GwqRReP2cVd5*@ctv%OTBYK&);>O=V@IIa0Oy%87;fRk4^B zi8MuP>YC%xrbsn@#}|#%)mJxYg7CJ9g;z#FObO_yn7gC^KRKlU;YXxU}jiWO^uG*`09Rk7|}K53{X3Up?$Kr3EQwshgV>*g-j<}A2jv9@U5&0#HkL-B%=c{g0A z$#N5z*$c{VAZ+%6CED!SxaTdNKdTI+CB<`RE%esa8Nt~lb0YI+Es4wx3-L`WwACxL zhD1D4-59(Wd&=ddr7(S{77Wg5sE^m9eR&NVX(O4I+hy`Z_=Zb0% zc-4g9rG=L|(t@!fR+)&=Ey4K}Yl1gb#1g32t7neCvMN|B{;m;!*NVSYGEpT{@DN(H zK)^W+S=Xg;!PyOodeKN%G^`2oI*UxQfT!4D2YyJb>=2CN&snWd{AG!zsPGD?rCmX3 zanv#rl)>N(7v zNz~QHr$yo@EwrXvgXPn%i?H%U7KMu!&s%Uq-q`WYV=qH3{}jtaTYn9tpx;7|L?P&y z(YwGF)x|*is%R5>@8GJ!{DMOGZ+vs`mWi=oV?|B$R>TrktU1_RTUQ+?a8WSP*cfe^ zXaQE>hubxE^~6Qd9AMTh6RVYuTZO{vx>!_1Sk;24h>eLjVM8^m=WME|M}H}Mh@o0t zJt)v4g6-1r&6f_ZMeAI#Hje6wZnvVUswvvs930;$>r;9C?ez_->w}HW(L_~4uqhgA zsH}+BH2~7o5O1h#hy~%pW&&V53oRHtJI@OA@y&I2h>VH?rjq|A7w2}o^g9-6`Z`1Z zNO~Z!1(Uu!z_?q~xxKeHos+;>8Agk*I3u(oqX>UXGiKng@0E-hKm~En#eHZ;Z*Qf8 zw!jx2nqka3m=TyWEDLz<=Vv|9+l$vtG_5!zNZ3Z)qx--f0W1$NY}<;9bh~ipI$&qB zI|w@3ZGbk3kalnO%^sfSTQl@~$lEMDjtBxA!rcg(VuTh=LXebzM9g`K>gyNE=Dh~I zc;s*MUQg)~N1xOHf2k8+Y2%jxUJv}kPQ33yK|tB-aQ_ncA}7Al=6@XUKLUS_6Mut^ z-v{`wflqVdXW97UfWHWQffFCI@n--(4*W_d-d86GMguk)WqjGr-d;W-v3%!SVBu!~ zzYO?ST==6Fp6{<@J=xofH(71|kK6j!0Y41*^PTu|8~-@)0pQm-@xHhve;@S&e~}Y^ zi_L!=_*;OV;>0)E_%pzN68N+Ee>65*HUn?A3sJxPhE56e&kW!{`T5@7E1dFcZ28N8 zUkALa?%iqQ*8#sB__NvnIPjkXewK|uSC1AopJdV33zPpka= z6NUY`0G$DT+`snr);syb_xM`^zRH8Mo)a~Ra&rBeRtLIyPC8#$=;0H?65t;K{zW!q zvmMU4*MCo-CC&fc!4!2^RZA@hk~rw|ztY?LNyIJsk`}+O_Mjjm&10bX)Zd`l2bv?G zInh_n8&VE!?*z@3r?I)}r17n{e8dIsN#Ngh;eRFYLBN8*f90#ay?pfIvh@L5M+s=g zeyz8+%t_-bwRBVgzYzGd^%I+bUkdypS2-;Z<-|NZ3H<$E@9llrCI2N${vqH$`b_`* zL@szv0AB$7Z&2ROJotaYKg2OI>)`V98$! zd<=N;^w_Ki{#+{`G2r9)WB}(Xmi(1MywHC?@SA}zclqH)!Owd36!6b}tG9O$%GBaF z>)D@?7e_s#J;y=chTo50hPXu^we{gAsMe8g zq3QQv8S+pp7^UKRsnUYpEYf1mcNA==!2cNep?3-DXc(nHOCut_OcDcqw!AanydVEw z|6@2%A71}OJTPOq*<+w>S0Rq?Ry8_crvNJgtiS6J;Ky-ysf>^;C>x<3in@d2P*wq2JUll2XRlpU4;9ixaZ(5!@UIe3fwW=aop>0 z--G)B+@HbyIow~s{WR`paUa6{67HYi?!^5Y+}*hUirYY*&S740{ZGil54DnLEEM z59#?0Rf$-1Zbf}nEIJDv31MWIB^T0~_H*C7dT6VNVcpwTLB78Vz5&CbYO9;8EVAlj`r<PvdSJgEk^V$NLuI3l#G_4Y;=4d=p(byP?uWbaRRf}-nx+$(btVJrL z@Q9`j)gyHcEAZtDJ<@>9YJk3^lTFIF&R4Ob0rWTcup=hu%Mfd*!<#rhxE*^4Sa{g|7tP0DCrg|Et_9n^#pf#ZAkYxeqVl0qn0mJtg#^GyWHP;QWon+GyORZ6Pgy zHyA&>{&#tR^K>p_%_sa%j|^!&V+G*DKmQ9nu<2Z@{PpW@C=V6~i}I)D7ic;jFsUc! z#aA!G)0gW$zHDXl+U8|=rnIcKVP$mL?M)Sl=4H)ImCNuLXBnQ3$C{V%In*-6sj({U zQp1WbFgQ`qISC%lV8)~Qe1n^7F_#Luq52>(jq!69mZ;W(zPl!1jUR|K#+x)>3*)|V zNLEt9rYl7<5Qwa(z&y*hS)z?Vq&iknqxtTU_;jT4#7XnrE7MtE$5e^peOn|b8zK_b zc!Hz(S|ubW5Q(pBtmb1W&3B&^JX%W&Y(QKe z3rK*>YMRU{6N7a={*Q3(tm!*+y6C&OdFh74l_h}syiV}jxVe#_e-l|9QVB34zHP|8 zZdjfZE*mPDKQ3m8`oHO9U7H;epRm;n(ZYwwC&ilnZ%p~NX+!Gj`Pu~lQw1O}tWMK+ zi~Mhk4HJ*fB6uPw-jvYvFH1x%oG=|Wqy=VzDV_cp-Wb7DIWD}a>CfpTq~_hY`P4?w z&>K+%P0c3B4+RO)-^JZYl7FUwd^JPUe<-cN6CAKbo0>HJRh@K)aOXg@{yoyJY_0*q zB+UdVALU1y8!IXyyMujv!_0ofw?a~h^nccYN z<%{s;kjRQyMg8rX{%0YA?9brtpa?85g^2e|5m`z#CfIn0sp&&>!9<2F=c2bI(?5Y} z1oRFQD3G*))31^QL>8SF z(sl?5*mxWP_5@ru*;4Fai?9}GdPwq;ZxQZeD*U zA-1M3keuXd#hry*>W_jmJ0ZzPA>AZ$f1@RAln^GH$r4>B^S5!&rGW2IHGFk*AL?>G zz%FfA9c?PZlWt94uIuD^J|`qTB(1MV)3kGku(~Zbm7a@l}Ex8fJJb$ ztf5)c@7Hx&+>Lt=bNh8LQQrfmKJ5a*gr&5_^RTXye(L!l@d;`DPvFU}h8YiwrjN#c zt}yapB_p7Xl!}|f>Sd`}tMEjq1{j;*nDC{QOdGNM=HFmtEh|ek!nkH>u6mMvX zT88Y>b@Hsmy_|e^S$w-pzU)Tka+iJ+yyDvy&^{t8Ss2AC8*f!;`g^)g_MsPqw8tny z;>#P+Z$<^daGy@(H6ICSM@gXEQQNRuy#J%=SNe1!zlhs_BlKx_{4^Spi+n7J(P&O8 zCTq8uV2`ZgHK3j>s7KU*Tt)(*7N+BUWhoIKOOIWg|FRTFFw)D*NJw*v-+V22G#q7llKmlX9^Xq~eAUhmf_ zE$xz!wuBOIRT3MOkQgO?QYA#`nu$j3LRGh`5|vR^z-#?FMRnnBqd3_RvF){FDK@?| zeYY*qP1m%G#Bh}96wZ0FzCnto z=vQ!Wq4+A$pPQ{Aw!ySj4hI{Qk%1BD`!=dX?Fd?Om$D?Le0`mI!;qg8Exmg)M6N zhO(xAN1otn2?g{d61{}tM^F@YBg5@1z*$>w^?4GWB@l<#(8bDQs9 zYWg3Pj%6dv6~H^HWR_s?t*OA<-YXkcMI+cm*YseTPNiSPy@QIgNKn@-k$GvN;t@Hj z2=hP^EY6^1jnI>qwiOkGQ`am^-s&)9O_lVdD9)Hr5qQM`e!dENt(a&k&pt5 zS$A0SoMZFN z(Rf3|nnTYQlTA?Y1Ks09yJuyi#7J|zqA4B`*0hQ_7s&YOnjFr*j4W$bD%i}5De3Ri zdt|OUKrisDZV~yKsir?8Dg(sjB6k7}U0g0aYa;SYL{s#WcyAbQ5j(2>UXzNST@mb+ z=3B~|en@m^%ricTVX4N{--Ppv9il*fWM<*8m|l;R)EENkDCyJZ^t~X0Fn$+VFbx`^ z^8LJE`if*ickbdltn;`8^5LT@bypdU5S9jI+K8l%;ZObkB)Vq-9Ly=-Fmkr06~yNOxm zFCX+*Od5Vh#YIzS(Y$KX@bf2vCdLI-Wup1X94A^@e9A=g!!-h3!=LR$M29R^OTRTK z_$lYU6jUOperHncFe{_k17b#H;`seHA;H8&rc9O{6957^yqBN?2UZAA2`JhNwe5}5IfXM_?g-1Bpg=c zB22$TqxRwX3VLb!ypaxt8BRGSMoG$a8tK4ctz~hg+42cTmg6<+A2h8%Q4LQxuK#uuZqUTl}ewdpf}9_s|qJ>zWY*QOKj;q_n7 z1ALd+r$u3yuD_Qt9Dj9G0S&iadG(}~{MFT@6?OHK^7AL*hh~%TTVV;j>dHytK_L;= zfAwQG@#{4EXSdDqs=9`J%xjtZG#{UN`FH60%w{(t@~3~!pPoPSt!;_jOABYV;4X}e7Pz)SJGQM_dSy*wn=$1hJB&%&t{DH?QluZV z6NNx--)=13=Fc+n{msE0+l+!8OE1~o0BYmh!kOC>OABk3?gg2U__;ybpZ7#|FP&Lf z+j4!&O#hJl+HG&$r0jZlX<_Yl#Id7}KZh0cp~6oy`4IoS!$03sh}c8M$hYu?A(^R1 zi4sJ{)e2rGKgi`G35@c*_5@9^A6(p>4Z;`6C+?*XNhkc_9g-bT9BeX5QzUEKKs1XDXI& zsqlDRjZrF!Lz+I>tO$20f|G?c1;$t=c0GD|E~2}4GvUAEDgTf*{~h_46f6~hU4Z%q z{bA6f1>H+``|mg+*n@+!r|3%G7DoxutLb6G060-e@J!hBfbgQJHGmmzrtYQux;}Rm}ui;jdKcXkL`QN zHzWJC*Ix6lmFA)G4>iv5$DcLHGC@|ebm`8>@_qjV~Lk zwj+irD*tXb>WnXM|MfBB*wUrjQ@>ul!#8f^%qwz*Lk2xN$p5uFji;{l|4<9wR_h<~ ztpASSJI1lS=thP#>LzAZu2+cwE~&FbMD@@Z^!f7pWnd-`9$Hv#!`VnRr~U` z9h+d3vEA5?+UARm@?D+nyLuErOkR@B2>xHrzs4lrxSZYoA$QMwX!ozi74Aikn0P+% zRswxq+tLh{{;vkBi8V zCH}RD%v|>IamJUIF7>DTa&lau&+`G34*hME($FO1QU;nu0NWM#c?>exJ-A!+?m#Ek35x6pZ0u z88;ZdCgKT$Az$`kSVD4TgUZ@r1$f9SOJinC@0EhVRO_!EhKV9m|1X zx`^BQm>#ZR3^QfiVAvw!34`G#3Agkyy;;E+-Yeqn#I?ffy#AAr)w40)O>%bj5k*4pG_c)p0+ zd`w@UU<^mgxWTYk#8J->mPk0H$&2Z*f-$^K#tnw|h%oM;qwx1@iF~^f-!ti#tnu`#hNu?FuYmBZND&m zi-Iw{RmKg5_u-*D{mC#X;x-@C_bV8~2V~q}*dyWzgW;bg+_IDDzbF{PGcs;4oP`}U z>SH)t#BF^{7b_UUu#6iFhoeI!AHxh0xA~aPR4|4kWZYo5LBtaV!#gG1vXkkJ3dZnm z88;aIPQ()iLq76yws)p~uV4({k#U3JkMS6db~1cL#BDp7epSI3z9!=a!^IdR$j7i; z#BDyNZ&EOZOJv+&cr|vr$j9&+5x4o6o}pk2KPuw}!yk!w!eGeLS)BP}`o{{!@KqT% z7+#Dw9;lDuSP{4NF+EPf7><{5gW+5ePZ$j6Nw`%GOn*$l7?#So!SG+O^G#cS z3@?>&gCUQ~qhA=7inz_k^n3+lxIo4YhU-K;VK7`T;g+3DZ%{CX8)e*J_#^z7g8CS~ zEaJ94rhlwp3}2OTgW+rV&&BVkXaja0Gx z+bWwFwexOzm32sZ74L4?&kz(Jya}H?ZRY(f{^8o~yC#j`JRgv^U6ApBtVPk-b@fU> zb}NWa!%xZi;}iVq-1IXAg+Rlv>e%)920*%9kmZ0>pondn^?*F%f+PXif@)>cdIY`*fczt{ACw}tI$8YAm;&6in)o+ zl?%v)n045YX@C^CAaek@0IxIJGz$RA>Divr}y6hDQ z{9%8af3#*SOIYS;mV&EUgHH#o{0DT!+w=N za3iT-p9VRTTqI@>xeZX+L&jsx&56doWA%9u@bo3J1kW~7Urr^Lnx!0xMAlSA?hs=J zItqASLMp@#pM=nqnc!-(xU9M%bkXKFK|^Z$GV4YNAbPGpd(65KLXD7h!&5c1{Nja+ zbC;BsaBLFx=*$3|<+v10F)?SQQDf7S@Ggti-=7?~)f7v8elZSGs(mS4H?z!bT{fOE zMKg=>v(i9U?#(yfj75N$8TfT~p2(X|npv}EaWt0p^g|>3Q*tv${j=(lG_&a4v(W&h zu^yIzfH_9{;$PhMW!A%g0!Y?F2(F1WtZ-CBvu^CTRF+b|<*ud)A;^(+!|h{gH0ws0 zRW}HAU#30n09*EmufEs@eGq#}Am?w@Rok9^Y*sVsFIx7**N6|u*yf;2<(&5K@sDj! zKf2VMcJbfgpMSUPsccL{s-qQgd_lL_Hj2OKl=cMi^I{P9xx6+X2Zg)aG~4@JVE&d5 zZJWLMqH5N|V^%$!hLqbVv)m5=W0gC;gp{tXbzX3HB=GA%5DJH`o0^UuJ%LB;ONoCEB#`e*vadl5Rr z^4Q}@xl73O*qgvekKx57&TedH388yoLgy9lQ#Ts(3#U#g6kj(M^;vMe1g4|?Fsg45ADjtB%;>TB@Dd~kc}?LL_j)S<#jzERW6zcAdM5vQl_AdfN1$9#Ot3N zxS;=b@%Q-0(yj-g#(S|$LzsxNR$v~Ezl_BB#xoMf32_i5T}U8c=DL@xf{%XE|J zF`cFFzW&j=wphB{dYJO)vifJs^VVF#lB4Cu&mS3(c78U(t^G-l_D+xXpLnz%9gy~?JlZ#UwD0q1zsIBf z*nqU}@@QY@(Z0u{eVs>p=YX`|@6o>8qn$G&SLsaos7HHhK-!=2Xy-S7T)K)5d9;7V zqy6-Nv~%CsrEBtI9__Dqv_I?7-ZLQWk9)K?dbB^~(Z0f?otsi%$hw3m7Eo;4utogVFcH_M&((;n@A^=Qu-koH$R z+IM-hpYUk!^k@$bNc$0w_QyTik9o8o@@UT+koIF9?R>!4fV4m9(Z0r`{TYvTo_*rhzGOh!`OPd>9h)5UXy4`0zQm(_ z`GBlR2%9*Cy}*O0CG& zrRvXPW-fr~dwJ$;{n4mBMr)s>KN?xbuFN*=(HTRQ9GBWlDY9)gcUK%XtGw5}Pu|VF zo&Usq6`esogrED{t5of)!}R>wX{Mes>xRxJ(eBHWuMae%4w;gzJ*%K;j|nMS28FJ6 zF(u}iQSUHo%Lme)=h1F>w3m3aciS|ouI?I;_5zRgEL*ZHog%JE+<8C8llP|wq`k$b%%h!e&nSCT-uDbhd#OkJ1dsMwkM=Klw08_h`&^IqJdgG&kM_qr+K&uKd#*=& zz@t6n(SF>fQJz0KAnhd{?YXvORqK{}wBP5+`>_FOpWxA+?$JKiqa8ot>{IJH2c&(5 zNBd}x_9Y(ei#^&?1JWM!Xy+D$t92L6@Mu3|)2MPkJs|DVJlbMzB_DIdEfj#c{j(w|HOP1 z#jJdxaQj?lE(*+2exLEZ%&Z$a-|TW<=JU86R^BV^_k{83LG#fje+k8}>Ch56gW3ZK z$1gA{$oBw|{t5Q`-19%vhs-6PMOrrNtO4%I=y|`lA0JZA>sG#yQys5U_L)PHCIygXu>90YI92pj$g zo8<^gNCcnd;#cT`qUD-21_Ugw32D7}-YvN<1!PB-dfojv7Z=}&T&ygVTnlIj zE~X^p6M*0(dQm2jBaf8QJswrfSCQfgz#M?IewWr{XHOyakJG*nlu`M%l6nbK+Kgm z{ERm(W06YH*1@Q__?y2DETC))`SopHww!uGkS`l@FCYZ~+FXwcuAqbFtAMayvAKRA zXyhA!(&k@yAisA(q|JAT_gih7b-ami%ql_FaK1EIYeA6EMu29TtG0{>WRHtx3LtY` z<+T8iLoRPD1Eka?habh=<&v`wkUcJ%Bp~uadFgm9yiXrR+!LTV;?lJTkQZH$?*r0l zLGZR14{Foovp?2^i2Tsqs!l8e?6P=OX}2M70 zO9*~iZcCm=NT$yL`2-;HxiBr{6$2#TqWKgc=E_CVJPe3j6Pa9}2Ly$q+2#ICKn$0h z?*n4)>PtDV0}=$6ZQ%(((p_Bq(6?K%fhF>jmVY9Vs#q)%ffQ%$Jr^`PEE?j*s)ejC{odfOPiMf!m_Y!t^_2@Wpe`{nig`jrVW79x+LF68e~k_ zBaa8vdSAX_Xs5p~4hMprKOfySKEN}G=W;;t=kQ}RX5n(!w;X4sPD zCmBVbVCQs5I{G@8&1Nqpj{+puCFcr2cDU@h8jv!@A-S$2jd(iAoXUQq0u*Nbk&r5( z$F5N~fh)Vf9IZ&ruZ{CkK8)b~;>i5P%i&eq<~V5bTo&E~$Syml>d-~`wAA$cr$Mv$ z=T85$17g0-D|4|MkO?lydja7kZRY!;ILfD5K7ThQe;+gj7MJQ1DvK-#`HzF9)Rl{r zOEPKx0!ZA>17(U3%!z8sbSLvJ!8jhaQW06XEJmnUPCK8bcW0ru1 z`IdRVR83>;@#1Pgrnz!)tD>>FVt_ni*$iRY9e_OLg7Ew4RANj17eLHaq}2W`Kte8E zF95RKCFduAbmlut@NGccW88ayXfCcH8PElwtl{`=m-sUD2}=%-4Xt8tgVM2E!ANkG zxa5ol#N2C=HqQVgWyygGtrU<`79^q$;*@Wyn6;$>G|m~CJSudFRXUW@0Gf4{b}>W4 zk(~uDnhl^iZRsM{!+;!d(fk`Ayll^R0ur+%6Zcy{x-B^odH5*uMK_u@`!hi}$?5s? z2)W7$$s+_#v~|q_1Wt8~Ad3V|$U(Cl5YC}&u6jV8aap(ykVY5eK0uy!K^_C7%7R4X zVXfMlNzPn+0W?L>W%nd|0Ff7RD%QCW(dYUBXacUB{v41smM)TaQL+mnYLkmA9j*w1 z)~bj6z`GW7(VWjZ=#rBUNC>xT%j%%kX_L%+MdTr|TF8RXo;lz+?SfPSV!m}RYi~0k zn_Rm1ors_d!nwS>=pXzjPXoHo^=;4)YM0=vlvC`i8^2L8_(RzMxX@ZO9d_YRz zSyfx)am1S8l3WOyqb^7Y5Eh~BjR+tGF3Amm6uBUG0@7*8iKvr?<@-^nEtmtSBbF^1 z+WaWErn%(&D$M&OohFp?|1Hy`D&o{;Z(&)11 zQgXRw1y=zQaCzfKK-yf82q4oSS^D`?NaaUsvDoIBf%#R@6^R-Q-WByV(PlGQ#}9X# zs1+-kqN~i57>*PMRlx!`@Yw2z_zEj$L5p~pL!uF|n)*Z}Y962+ktb?5g^D!sQv@gF z$Ls3n<981ZkZmPIhv!D-ESxnz9GM-yZr%+T0Rj71@xn;yyhV#;3O}5{2_ZFgIKH7t z^5`9_#L+faUry$nYg%9uQt5CgA$R3H+LQvs23oZyF4pTqh*5a%&`3JK5g zfIXGs!FejmV}n$bhvC^#dB7c<*5}|l0THLqNu2v+xd@LHAa;&Av`qjU2eL_mehycY zgw7+=1jIW1Or-3y&Lp{YvYAMFjvNzEcv_x)BU1C4&9l8!(maPtB>SA1)fdK7uLNvi z)IPUL0IXB0M9Mt&+M5$e%KK@>P?y$W3+Vk1JwjO%3sAC5mzi#V;(sVeve4sb!18 zv;z}H!2{EECm8bWJUb$rP0!OzjsJ+_r zS4S&u&qo)&3Qa}!*~K_`su{oYgz$d5a;X<*PplEu41J?o8H&avPOW04b{r(6Y(;NS zierYttc4*|I5hwAdN~qRh0UP}jTPet2PT<8W%7-QXwzCz^XU(D!h}#LPHT~8#lT{= z8_NeIH9uD>PS+3&{hTeNbS;iG!^WFbi=d^87ittCyK-5xi_wzm zP<K@-QQ=xgtqF2_b&jsRuLHz#{{W!WKa#T3r3$* zRKky_!F6a6tPea#DAG_(?^NC%!D$~W>*7SvNoIM)S&!U={H1FX4*Q~rl@+%&G~sNI z6*$&89$gt(6>Vxpre&j`o3K@FIUk)8A$9#g$gXs2%p-tg)8oo462ZGrjvR}&A~%2qA1bc%02C-bd)qg=8?!uWqnLEK%S{Y8 zLa~tdw**;B5xd)CxKU6uZstSeN974bDg{V@*TuU4ars|8MKjI=p$>TmZ zDxR9a@dPp3SM0W|Mk*=>K9?hQP!zM;^{_>8OhI9z!ZkFzYMSt=`V3SA=S)>pq5fJ8 zRqBMbtjo-{=pQhJLzTd%ipA02qQVL>st;?Htv7zWe-{y_2Rj_1j;2!Ps3(VDXZX%(HxgiO~!5 zLwC_j152Y7tD^n%<22EE?wgV)cJ6Hto5d|V%|3OQ)yH-R2QByT@=sofRt^t`5*S9?6OocX%=~kBxkGMY9;ltbvMymvF7xHBl+G<8R|Cv0tiEYX4i9 zBZf!woWB0%O46NnGnd^BCq`nYU5Uhe%Gpw_GNev1aWUJSFttycca3|^i3W4nd*7)D znx5m!9cI?V<9%h*-5j8p*V>`I&su2PKy za=ht(f+KPLW>}1@R++Err;Ul@?W}5WmOj~Rg|4FJ%1_O3`c6-Uze=J!w9VUQG5otu z4;5|`hN@xs{dza6Yhk9&KD?PT6b!$%o2{9$Ytbs6Cy6DNtm=toE(%#}vjXe*r=nM#caD literal 19968 zcmeHveOz4Co%i7~n2`{`2#S^@*Em$7gn%YC(O@UQL}EySNzhoLyv+bpCo^Q`PF`G+ z5C>w$D~d1Oc6Vdj3Hn*v$KATt+E`;t07G*oe}Z ze#L>L%Ga-0-{KC)t$ts#zkZY4Snu`v6uH4A`-5KD?Ul>dtdlqSoUXzdGg56rbd`g# z$|Ng$@5ykLp>3FDBu`J0E@1_L+=8@TV(l}LXCm2==tX5ow>t?%vR{AT4JvLQ<9;zF z>$Jo`Ja|N=SB4}uoM6^rf69AIVmarapM>1rbHEKyq2k)6pdw#`7a2spo?%BFtEww> z)+_abg!>MkSrL-yv9qGyLcdP9VHyxsNLHk4O++Yy&R*zhsck~*JaZucbx5g5Hz1iF zPS+3!5J*`Eg{>x}so2iydJEmUULHgE%q{>yxrqoxZeQ8j^#tXy8U`Ky@wO$PcsQNn z;d*6)A-0^ZQV@uY=%zxxto^wWSQi>y9C_+CJL~LKatF(8)NL4Y3$@Rn#YWZGP-rv_ z<;;uhOslz?vCybRYn;oNcGH!Nb(Px+!sWKi2(#NcCu>D+u~{esjwAq|2D*IYR&Cxq z#v)biTxF>`tKzLv)?)!LkQTKpGi~}oD+H?w{66yH-q1jPO`nBzZDA#kfmvBu z@|TodTJk8e;IE@UE=i$!X~`_AziE<6(zOM;RK<-(d6q&6U~K3>3{Uil;^QM*Q0RIN z9!@c6IIT9PWZYqwecv#>r z1+Lq~$OEDP*?F9sn$hux&tfqIJy*Nr3N!=?Bkuvy^*ofbu7jY2lF?jPNUCGmOVJaw zyZ-|eXox9zDS=-(6(89Err2=!w4jev@_M)NREOUWjpjfFtFklg@1b)og6bl(F9w8q zLWKMowE}z*fvxBupg&M&M}*WFY3P}quPDU;%_9+a3lUcn?bn2eyW%1)1Rb%&hF8J_f%Wvg6CE!%_Bi8g`n&yf^-{R=|?}(Wqe3722*61NY9=9T%<*HSob<6 zBLu#`dU9{~aEG1on!Sf$ujpj?gN`v;X$BqCSy^KIQU()(G)^Sv}m$Pyi3?lOr(8@J5Wz_r*V=g)|(t~$~TNzDmKUeLuHrKrV!#V`8lb5lVp(1BJ`O;nPFyVV$Qimet_`-gU=z7Mw?mW znf9l0n@65CTnbIhRW5-~50g*-1hG2)5#Y6UT?@IqkI>H>=;#*1<&D8y?GBx65y*Z- zWDmv3)`%F-4d!Uq0c!T28yTH{u7Fu}fq!G@y~z-$cL!>Jm>ry^T@GiXDcU;VMIX=6 z-T@4Z6lLwJSa;3{t*~gp&PzpU$*viCNh=CFCZl!%u8R{i#R+aFf;ob~zB5~tmhYM_ zBzz47+AWxQ(9VWlZ3hej{E%zXqHRVw$uVg{8!dh*V5+5)eXo?==&%M;P>o)MKC*kq zB(~dZ=P+*1l1M+sLh%N%UtEwGi_R#P&L7xR>Nkb)M+pd|agID`h$3)ojEi%nyK%b$N zyQtd-f#JtGCq6|uOfDLP7Xdw}#{vXI0>F)q%(f3zM<%tw0@PC&2F^8(%siOT-r2i- zTEz^UOk#FbmrEMXip7z5{PaN`6`Fe6?eK$-Nh97L2-2L;jx@Hd7`~%*hz?WnR}(c% zg|wdOn-YCGd_hLYEZrExTm(WL=QQRl(+o2Ook6wgG#E~rAc6Pl!IZRJqOnuPFw4<1 zm}18$&`VkzmLG=|J!D{u;;`X3odttK=au7h-*2}I*l3(CKaPD3^FKY@AT^r|iaZ65 zC4DY;(6n!Cg-h;?Lw zS}VH17*ey;>WT2spLE8H=k!g?RGN!$X6-0Y% zG8W?D~$c405!s2`*{QH%Q1RHxx0>ieip9az*K z;PeQcsJEd$n6em6O8Q6cf#+OYXYV%j2JnR@GIoAV&E^JC6PP`*pW#WxR}!9hQ09hk zNo0|bL`5DJv!sqQBz<;yLegB4L@sbiR1lJ=c$TDrGbBA{lJqvpyo-k>K5NrEduU?D z&XwvcKC#WvrylB0y4Z~v=#?1grpB|ZwNGihYLocwB%bD8ZYULmp;SD}(8@C;O*cte zK$57Hxg;tGNmM*b(gSBmI&@hgc<-akgGajxi|%}{bfLaK2+r4KmFp*m*Upf$-6ZF6 zL(ZXL%ig|(9MO#y{T|(n+|Y47GRmO`a) zo6V+HA49v!YV{DZT($Z&WI1Z}5oFjh4IsCn00dF$~!(x@ypI zf)}nbf4TS2FFy^x9U4x;Zc3cvW@7mf#!a;Ske?1h1DQ4FQaE8KoJc6N znj`aHS4f>{iQ}9K&yFEH6NloFrw|me$d2INhpE-$W&l~Jv5)TB zkTeCI^tNd0UTxamS1;^SSB-~{(0WcUb=5@D5su%Ri7K%JT9U-p7Fpf z0K|ieMm(2`H5PubYzz)n+>;O?K$J_VKn}-6Xmnpb@*IukA^( zxwb@SaT6+N&FR6ahwgBR4(Z{u8NE7tcfAw6zB_sy=jNm%I%z?K*3^og_{xeR&0I8~ z?LB;gr8)!*L}zzLzoN~>L6Hx0dk>%0Nqhy@M1vQPHd~jByG~v6Yti`zO3_jCv|f^O zPR(>~7aCtN_Wu|xHVh5&(D_^PFr(wJ1WjI1IfzQ6h_AsJox>PxS_d#R9B;)qgmM|) zX#27l{0Pq0J{{AM1SKS_VNaPz!;K+`H!AK~B@6n*Bt3Vkxo^ZYE~uk)!aAO!S(h^k2*! zyG$z~Wi&Bs*HMYK+#?ae5HvA7qBG3b(uiy+F-TPE1%oyLKYI!Y_7Rop`eFM)IfZQCn*-QHdH)`!SWMe`r6T67{3AcfBJiLTuP1_Vi40CZltNW``7NR1l#= zorRu}A-s5F(`9gHA8Lq)b()@Ax*|!*bSi+A2GFkY4@U@IuPHa`b z14Ffuix{I*ZfL-!&(d^(%2y0B5(weSA3@hc9fIm&4-m_MJd4dvhP?|s#{H#6{RnM* zY2g9zMTjxqX62I+KZAB5`|rSur6;swoGC^6og!{I$EnBNgiaxfb(r>ORnif=!GlF8 znsR{bG>-X$DRj)Chg8tSDO7Zz$oI%%pYadBL7lpts7I(yoln#sraE;&QQu8<>WHGg znd)@l>FmXZf(in$0f=ZOKk^93azGFjGD^F_R4z1?=bFlwpo}00ZY!^4irOb530WVR z$|p_bUzy6Un#w;%*@%<&HyGtm(nBX4J!sU&)9mPs9Ds?2K0B#2`?>PLIiag#2sdq_I!^+ug^=tm9G zB-&hoK6EEsRE^WUv}oF^scGp@f|->*T+v}ldrON0l?#a8F@`H?6mS8xbC1z-X}qxi zeYATtmA4r$N64B(6W0A70KqH!Kco^FMPSXS>>r^L9Xt1rQi-k#_Wv7|=yb6EBP!8Z zcK>gwM90kiV|ekP@?-f%>ZUIxMnX?IjfCOQj$sz$ALy3QeIIDVko^Tnwd+A-c!28; z$j2!%YUTE$q&kKXoiuP+G2S^hpT8`&H;B6m+=Qd1BFRU&_F)=qKbfJUsQCzWGJ*PQ zpww)B0l*cSPC4TVDuq+=%M}U*_T>?}(+N9<)DnK{vxuLaX4#=zoxyLJ=)wv6=QFn0 z*mUPixjGRuPVRa;Is-S>O1fszkW^>TKvlD8`0_E0z4%#YvDO6V8)?MJFM?+1_eA_= zi7uJW#rZ^n^D%Jp=B5DS=uQ2b0(B}uvYCYI_Y&0da4mk8Ppgg_zmijNwLDNJs)Y%v zJfecP=Wfj!5Nh{MCAny7gVz#CElBtvqdQ4Dsc_rlRw)U6KfxD2lRjyxu;)nFOb8>7 zsUjMp>wOy1=d<#s#C1XlMjv|x#n8Y;;}8;Ah#+B1U(O5I`Joya?pTI9F-s5SSUSXY z7>#%O@TGGYm$1t@wMv6u96=Te$o*{TeB)Rm3z+?Wc7tQmfTn8qVD2!jOsB?h!>3)3 zyI}ZO0QV`+=cA|G#%FNUWdYBn0_r(5;e>WrlXqQ%+2A6)XF`7Ye4+-tAPfh;2O6PB#n~R?#ELu@ zIp6qxJR#8NmTD#^4E0*kG6G-lNt|8S&`LJ6p(hDqOT07eCQL&DLt=EhzeSh|V8ouL z8{f-epbZV29hyj1GR1j1w=a!#(`R#-Xm}x$$>d26_Ms-aDc|4eCO9ipQrB*05(!pP z2UBM%>fuSNQk zmi#_AI)w?c`5uo(j)=BQwzXY=E#>#|fm?jPFYfI(KHc+t-@XmuzD115tm^T78y+tn z`T>_V?vrAvH#O#{Lq@w#*{UsC6FQHkUKnmDJtb0Q&7x&F}m5 zN;`<7hr0y^EYYLn;PLmS`ithk#-6Ts@q3wtm`kjef)P3Yc}A$;PPa3x8!9QEqa8^>pxbP7nDQX9*-W_)99*c` zb3^DmpvG0mNG)a?xXf2&au&fGpi%V*ri!NS$cA=)Aeq*$4~qjEZnv}f^a@Q(8%!ZA z+6td(L!$+uiRlm|!*d(V%+Gl6*TATYh`94~MrSA0W^JU}@!(&mGwM)!(Mi=;GCE!W z@6WW*ICtoMV%h{B(rM|V;}|_upJKq8~Q}f=osS# zYevU&D9}^`Zwep)Es1+QwD>{Hf?SU-I8dmrv%G*EBkQ`C3w(s$$rp$Et>Dh>Lel8c zMW^;3MN7(PNgG-+KQvI#->utxap%$C->YT#P@2(kBjOp2Wc>7blGFspfBLKK7wmo& zA6aAbUVTA=s@=aKRMIEVkOK`l+I=)NXMnG%JLCDxj-wgR{|+o~&}ZH7?{sRgQk+dp zYl-O{G}7)vByQfD+>PYLBoX1y(Ta)S1rShwM;s=oRS)8jX`VnLRy)E-6Vn{@Y{0osS zfNBe{J6C75qljPFLG}EmZZ(+($ZQ}03Ln;TQKC~#=V`@?1_>{;;YUg}R`j@kGNdHw z#F&0-?&`;S5phBwI&DtzX>?zFf)1vK$I#GOXy}~KKyE)ej|H1J8X07m)*_LPaKCah zjV~cKoXiJSnMDf&9U&vb+|)2S^eDxjyU+n-7<(p*S;5cI(6Q+KMtmb=5cM?Lp&^9D zy*2#?e*yT_Y$F6mmD#GaGh6`ERj0c62pA#X5++@MGM zwvhZX<`V*)HH@RnEHdth_8WBT=)*=Ij^!0$E$Hr!Zxy*B@)nUl zAoA~s{5g@Y7kRhH>qOoz@?4QyM4l${Op)h{+$M4+a#`e7k>`kfa!8L~7O(5S!PDOV zXMJmZF-F}BD8E9hF!j>08|>7iG&RvC{(t<#{j@Wdi;3&Y=YL-WJnn|(#>Uz}t#j+O z^NS0e9uKRn^}Cwg0mbF#e<|Rqb$gq9j1zuye(`lW%`IDM*9xjKPkkWZ3V_e)Iu|F) zbF$PtoH&DC*S1zyqvCSPjy22W{CLgnba@qbliTH=$L7ig_$>Ol^UeZooW~j(w#j+U z#6Op}(dTq~n*m8>4bG-(gNvIB8>wYcsr9(MuG)r8JeNyKWP&xe)cb2&T<+!;h28Ag z-r6E>bt^5hNsx>`Yf*eY*;DUtcFFlrcawbWqDAvk&qwd{xdJl%^-Gf*$>*oEsa}zb z<$U^k3EAWF$|bN664;+1qx|+2TqQx5xSAnmlJ=VV?8O zKPwhn-A)AB2*jW6hu&z0fIpo-aJRcv-c;|uTW)rFUH*D>P580k>M3oX*H|E**~#Sk zKqGZIC-uFn7o;-Ype1q~0ttnrz`evrL8^@Hc zsa{R6(lr}cX(`f*^{bXufwa7=V%gfW`|47;w0wE(s%0B$D;!+BzkzLKzMxXu)GA+5 zBCoEltc2yMOqQ4Xyo$Gelj{aKFF^G&U+Z>1^==(Nkos1)Qty$M$rZfY1K})?uPVOE zROg)ap2nbu!XmG#-zMKy?+Kz`Z!O8Y)+x8}_cs3C&fiYG;?!%15JojeAUKp$U)QaZ zOMO8vAEXVwZ8AOQkx4AzDKpuDKO_@&a7O+*uN8v7D(H9duz*^(OV%xR#f=1|EN?J~ zzJQK`K~W~<=aom@;!3x-(GzsKkNty~^TR14sFfTB79(wv;P`j`lH$oETF3d_K2$M5r7}z7G z8EDwz@?!>$w1#OVDAu95WUEmd(yqVOHNte@v*jp{%Li?Lo8NK=HWE?N@^Jo?C-1|8|Z* zhoxB;BeY?=f-Z}xx8CXWy8;0@uT}3;)!w_kzO7!lHQ)+5eX`%>@io>fZXY0ipWS;EGod)Bg~Hfz#X(kzy}IE&;1PPZk) zKZ?cD=oGUo-5Qe0((MiD3-PW@Uy8SMEPW|ZGExQ7z%#K}qlvaia-^nPm-VMxmQT+F zo-VR8pN++`k+ZUNnPBZmxo5y011ujf`g~3g(LIG^Gr`Vhw+uS6+X`A0IoaJQmCi_! zwxzxd-{3I2V6{{i@!X8h^|{vhBV0*?!@gni2r_!9uX27Hkj z?@8b%0Y3r!CNo}gbAnvJa?!@~ejJO@r-69vq&0E;Qs6fNe{2eVD2}JIZsv2b7=DioJ1O9yW?*sn3 zz+Y*WUz^}R2z&(ihs}7YixZH2CxD;%d@NQBKjZC}JfGWd185TXD}Ne`dCmNeJ;@=9 z)Y!l5Fz-nu$Cix0vj*J?Go9q%dgxPGIq;7FpM&e&xSr+rCGW9>Qj(`%K%xdkw`4L% z6wu%EQY^L^vG8UVbB}{&2BS|v?CrP zhOxZp7qQp}Q}8D_o?;{e|0(dlL9EQSCci7`N&qH36`*^mFBYpuIZh|t8Q0SS{Aa-5 zF$J%8cH-X){MY(pG5*QXn9GuFysZfT6!2dkKwFymH*xV?{}JG;fUlm?*0*wgY9kH! z&X;4c3lNXEeMTGo5x$t(i1g)PQmHwDt6sA{S3=)n;GMub&3LIU?(YWRp920-bKH_2 zl8E4o=3L7^iZO$=qdGO+QZcAb8^eWV)wLAm4 z4T*eBdmVE#@q5yX)`Tp3lJAqG_fk1i>F2F|uMVDf*0ci|0B!iyw#fy9-np2>yLryVBv}a{{?uvA|Dm@npzRBNZ>1o(x z@CN2~kRI!svDgE|3#t`+q~)RHTT>}2%ccj?b8k(TA;pm{uT1Snub@4_Qjm5d)q#(4 zBkpn)d?@3Lx?-=cG7kL)uk-!V5ZImp|96NVdN-htI?xJaX)P~r)QN#UpYP;1r44VL zd;J6I|LL=Ihz6qmEIlSM`hP20O|WBt6}^?9F=#122>3CiQKV0hQjbb(Hc}B%C6W{A zUZifM{YdmYi@Xo%DAF*}?~o>uF8HOy(vfnIY)A!2*CXA8RDo25^bI5@k_Sma+KIFW z=|QBwMEWk$Q%KJu9Yh*HdIRZgq?1UaNT-n)e4^*SyZvvna+k-YxXS!)#obu%S%%5=D^-49BhEqWv!t6{N@aaOarpf{KVuh3sIT%lgC18!z1Qh+ zEyExn7%?o<4^NE!tF*!kZS@|UbcBC5t%AL8}6P82g0*;io&ShPY^Kb}5_c-Co?r1=uRoTWf1w-YsrF zoM&tFdK3LmGmJH&7H}!G^{uV7%Jx=3!mO6=EBy+4l+`x65E1+*C`q+$UjzQ)HL2Ez zOGi2bIdV``J?q*x1CdGxT*zHo& zRx~a!Ka_9>(Ac`2v44;RGkZ<~GwxOUq=38GTkm1)Who$#|0o3%f8(ZB#$M+o;(Uur zxQk)zmsIi+dQ{qC7{eHi`#&MAbgW(NsJ!l4ej|+Wlm*`ZAJV44mPWr~SjC6>m#@!@ mz_oVvOtJm*D89t~4~@WOW2Gz?sj}V9EcgZ2m(TyM2>d6!D%8XP diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index ad13e3654..d54be6ceb 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -9,14 +9,18 @@ #define HARDWAERE_CHAR_OUT lcd.write #endif -#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILIC )) - #define DISPLAY_CHARSET_HD44780_JAPAN -#endif - -#ifndef DOGLCD - #ifdef DISPLAY_CHARSET_KANJI - #error("Kanji does not work on character based displays!"); - #elif defined( DISPLAY_CHARSET_HD44780_JAPAN ) +#ifndef SIMULATE_ROMFONT + #if defined( DISPLAY_CHARSET_ISO10646_1 ) && defined( DOGLCD ) + #define MAPPER_ONE_TO_ONE + #elif defined( DISPLAY_CHARSET_ISO10646_5 ) && defined( DOGLCD ) + #define MAPPER_ONE_TO_ONE + #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) && defined( DOGLCD ) + #define MAPPER_ONE_TO_ONE + #elif defined( DISPLAY_CHARSET_KANJI ) && defined( DOGLCD ) + #define MAPPER_NON + #endif +#else // SIMULATE_ROMFONT + #if defined( DISPLAY_CHARSET_HD44780_JAPAN ) #if defined( MAPPER_C2C3 ) const PROGMEM uint8_t utf_recode[] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is fair for symbols @@ -27,11 +31,11 @@ 0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f, // c38 // ä 0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0xef,0x78,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0xe2, // c39 missing characters display as '?' - // ö x ü ä + // ö x ü ß 0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f, // c3a // ä - 0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xed,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f // c3b - // n ö ü + 0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xfd,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f // c3b + // n ö ÷ ü }; #elif defined( MAPPER_E382E383 ) const PROGMEM uint8_t utf_recode[] = @@ -115,14 +119,8 @@ #elif defined( MAPPER_E382E383 ) #error( "Katakana on a cyrillic display makes no sense. There are no matching symbols." ); #endif - #endif -#else //DOGLCD - #if defined( DISPLAY_CHARSET_KANJI ) - #define MAPPER_NON - #else - #define MAPPER_ONE_TO_ONE - #endif -#endif //DOGLCD + #endif // DISPLAY_CHARSET_HD44780_CYRILIC +#endif // SIMULATE_ROMFONT #if defined( MAPPER_NON ) char charset_mapper(char c){ @@ -193,20 +191,18 @@ uint8_t utf_hi_char; // UTF-8 high part bool seen_d5 = false; char charset_mapper(char c){ - // it is a Russian alphabet translation - // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё uint8_t d = c; - if ( d >= 0x80 ) { // UTF-8 handling - if ((d >= 0xd0) && (!seen_d5)) { - utf_hi_char = d - 0xd0; + if ( d >= 0x80u ) { // UTF-8 handling + if ((d >= 0xd0u) && (!seen_d5)) { + utf_hi_char = d - 0xd0u; seen_d5 = true; return 0; } else if (seen_d5) { - d &= 0x3f; + d &= 0x3fu; #ifndef MAPPER_ONE_TO_ONE HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); #else - HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; + HARDWAERE_CHAR_OUT( (char) (0xa0u + ( utf_hi_char << 6 ) + d) ) ; #endif } else { HARDWAERE_CHAR_OUT('?'); From 09838dc948bed223f4656d7b73a64ac63a05b761 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 14:46:15 +0100 Subject: [PATCH 022/302] reformat documentation --- Documentation/LCDLanguageFont.md | 66 ++++++++++++++++---------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index 13e70b90a..c42bf7aa5 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -12,11 +12,11 @@ We have two different technologies for the displays: All of them have a similar but not identical symbol set at the positions 0 to 127 similar to US-ASCII. On the other hand symbols at places higher than 127 have mayor differences. Until now we know of (and support): - 1.) HD44780 and similar with Kana charset A00 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 17 + ** 1.) HD44780 and similar with Kana charset A00 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 17 These are very common, but sadly not very useful when writing in European languages. - 2.) HD44780 and similar with Western charset A02 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 18 + ** 2.) HD44780 and similar with Western charset A02 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 18 These are rare, but fairly useful for European languages. Also a limited number of Cyrillic symbols is available. - 3.) HD44780 and similar with Cyrillic charset http://store.comet.bg/download-file.php?id=466 Page 14 + ** 3.) HD44780 and similar with Cyrillic charset http://store.comet.bg/download-file.php?id=466 Page 14 Some of our Russian friends use them. At all of them you can define 8 different symbols by yourself. In Marlin they are used for the Feedrate-, Thermometer-, ... symbols @@ -25,9 +25,9 @@ We have two different technologies for the displays: Currently we deal with 128x64 Pixel Displays and divide this area in about 5 Lines with about 22 columns. Therefore we need fonts with a bounding box of about 6x10. Until now we used a - 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. - 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. - 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. + ** 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. + ** 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. + ** 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. ## The Languages For the moment Marlin wants to support a lot of languages: @@ -66,32 +66,32 @@ We have two different technologies for the displays: On a 'perfect' system like Windows or Linux we'd dig out unifont.ttf and some code from the libraries and they'd do what we want. But we are on a embedded system with very limited resources. So we had to find ways so limit the used space (Alone unifont.ttf is about 12MB) and have to make some compromise. ### Aims: - 1.) Make the input for translators as convenient as possible. (Unicode UTF8) - 2.) Make the displays show the scripts as good as they can. (fonts, mapping tables) - 3.) Don't destroy the existing language files. - 3.) Don't loose to much speed - 4.) Don't loose to much memory. + * 1.) Make the input for translators as convenient as possible. (Unicode UTF8) + * 2.) Make the displays show the scripts as good as they can. (fonts, mapping tables) + * 3.) Don't destroy the existing language files. + * 3.) Don't loose to much speed + * 4.) Don't loose to much memory. ### Actions: - a.) Declare the display hardware we use. (Configuration.h) - b.) Declare the language ore script we use. (Configuration.h) - c.) Declare the kind of input we use. Ether direct pointers to the font (\xxx) or UTF8 and the font to use on graphic displays. (language_xx.h) - d.) Declare the needed translations. (language_xx.h) - e.) Make strlen() work with UTF8. (ultralcd.cpp) - f.) Seperate the Marlin Symbols to their own font. (dogm_font_data_Marlin_symbols.h) - g.) Make the fontswitch function remember the last used font. (dogm_lcd_implementation.h) - h.) Make output functions that count the number of written chars and switch the font to Marlin symbols and back when needed. (dogm_lcd_implementation.h) (ultralcd_implementation_hitachi_HD44780.h) - i.) Make three fonts to simulate the HD44780 charsets on dogm-displays. With this fonts the translator can check how his translation will look on the character based displays. - j.) Make ISO fonts for Cyrillic and Katakana because they do not need a mapping table and are faster to deal with and have a better charset (less compromises) than the HD44780 fonts. - k.) Make mapping functions and tables to convert from UTF8 to the fonts and integrate in the new output functions. (utf_mapper.h) - l.) Delete the not needed any more 'LiquidCrystalRus.xxx' files and their calls in 'ultralcd_implementation_hitachi_HD44780.h'. - m.) Split 'dogm_font_data_Marlin.h' into separate fonts and delete. (+dogm_font_data_6x9_marlin.h , +dogm_font_data_Marlin_symbols.h, -dogm_font_data_Marlin.h) - n.) Do a bit of preprocessor magic to match displays - fonts and mappers in 'utf_mapper.h'. + * a.) Declare the display hardware we use. (Configuration.h) + * b.) Declare the language ore script we use. (Configuration.h) + * c.) Declare the kind of input we use. Ether direct pointers to the font (\xxx) or UTF8 and the font to use on graphic displays. (language_xx.h) + * d.) Declare the needed translations. (language_xx.h) + * e.) Make strlen() work with UTF8. (ultralcd.cpp) + * f.) Seperate the Marlin Symbols to their own font. (dogm_font_data_Marlin_symbols.h) + * g.) Make the fontswitch function remember the last used font. (dogm_lcd_implementation.h) + * h.) Make output functions that count the number of written chars and switch the font to Marlin symbols and back when needed. (dogm_lcd_implementation.h) (ultralcd_implementation_hitachi_HD44780.h) + * i.) Make three fonts to simulate the HD44780 charsets on dogm-displays. With this fonts the translator can check how his translation will look on the character based displays. + * j.) Make ISO fonts for Cyrillic and Katakana because they do not need a mapping table and are faster to deal with and have a better charset (less compromises) than the HD44780 fonts. + * k.) Make mapping functions and tables to convert from UTF8 to the fonts and integrate in the new output functions. (utf_mapper.h) + * l.) Delete the not needed any more 'LiquidCrystalRus.xxx' files and their calls in 'ultralcd_implementation_hitachi_HD44780.h'. + * m.) Split 'dogm_font_data_Marlin.h' into separate fonts and delete. (+dogm_font_data_6x9_marlin.h , +dogm_font_data_Marlin_symbols.h, -dogm_font_data_Marlin.h) + * n.) Do a bit of preprocessor magic to match displays - fonts and mappers in 'utf_mapper.h'. ## Translators handbook - a.) Check is there already is a language_xx.h file for your language (-> b.) or not (-> e.) - b.) Ether their is declared MAPPER_NON (-> c.) or an other mapper (-> d.) - c.) Symbols outside the normal ASCII-range (32-128) are written as "\xxx" and point directly into the font of the hardware you declared in 'Configuration.h' + * a.) Check is there already is a language_xx.h file for your language (-> b.) or not (-> e.) + * b.) Ether their is declared MAPPER_NON (-> c.) or an other mapper (-> d.) + * c.) Symbols outside the normal ASCII-range (32-128) are written as "\xxx" and point directly into the font of the hardware you declared in 'Configuration.h' This is one of the three fonts of the character based Hitachi displays (DISPLAY_CHARSET_HD44780_JAPAN, DISPLAY_CHARSET_HD44780_WEST, DISPLAY_CHARSET_HD44780_CYRILIC). Even on the full graphic displays one of these will be used when SIMULATE_ROMFONT is defined. If you don't make use of the extended character set your file will look like 'language_en.h' and your language file will work on all the displays. @@ -99,7 +99,7 @@ We have two different technologies for the displays: Be careful with the characters 0x5c = '\', and 0x7b - 0x7f. "{|}"These are not the same on all variants. MAPPER_NON is the fastest an least memory consuming variant. If you want to make use of more than a view symbols outside standard ASCII or want to improve the portability to more different types of displays use UTF8 input. That means define an other mapper. - d.) With a mapper different to MAPPER_NON UTF8 input is used. Instead of "\xe1" (on a display with Japanese font) or STR_ae simply use "ä". When the string is read byte by byte , the "ä" will expand to "\0xc3\0xa4" or "Я" will expand to "0xd0\0xaf" or "ホ" will expand to "\0xe3\0x83\0x9b" + * d.) With a mapper different to MAPPER_NON UTF8 input is used. Instead of "\xe1" (on a display with Japanese font) or STR_ae simply use "ä". When the string is read byte by byte , the "ä" will expand to "\0xc3\0xa4" or "Я" will expand to "0xd0\0xaf" or "ホ" will expand to "\0xe3\0x83\0x9b" To limit the used memory we can't use all the possibilities UTF8 gives at the same time. We define a subset matching to the language or script we use. MAPPER_C2C3 correspondents good with west European languages the possible symbols are listed at (http://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)) MAPPER_D0D1 correspondents well with the Cyrillic languages. See (http://en.wikipedia.org/wiki/Cyrillic_(Unicode_block)) @@ -112,14 +112,14 @@ We have two different technologies for the displays: MAPPER_NON is the fastest and least memory consuming variant. Mappers together with a ISO10646_font are the second best choice regarding speed and memory consumption. Only a few more decisions are mad per character. Mappers together with the HD44780_fonts use about additional 128 bytes for the mapping_table. - e.) Creating a new language file is not a big thing. Just make a new file with the format 'language_xx.h' or maybe 'language.xx.utf8.h', define a mapper and a font in there and translate some of the strings defined in language_en.h. You can drop the surrounding #ifndef #endif. You don't have to translate all the stings - the missing one will be added by language_en.h - in English - of cause. - f.) If you cant find a matching mapper things will be a bit more complex. With the Hitachi based displays you will not have big chance to make something useful unless you have one with a matching charset. For a full graphic display - lets explain with - let's say Greece. + * e.) Creating a new language file is not a big thing. Just make a new file with the format 'language_xx.h' or maybe 'language.xx.utf8.h', define a mapper and a font in there and translate some of the strings defined in language_en.h. You can drop the surrounding #ifndef #endif. You don't have to translate all the stings - the missing one will be added by language_en.h - in English - of cause. + * f.) If you cant find a matching mapper things will be a bit more complex. With the Hitachi based displays you will not have big chance to make something useful unless you have one with a matching charset. For a full graphic display - lets explain with - let's say Greece. Find a matching charset. (http://en.wikipedia.org/wiki/Greek_and_Coptic) Provide a font containing the symbols in the right size. Normal ASCII in the lower 127 places, the upper with your selection. Write a mapper catching, in this case, 0xcd to 0xcf and add it to 'utf_mapper.h'. In case of a ISO10646 font we have a MAPPER_ONE_TO_ONE and don't have to make a table. - g.) If you discover enough useful symbols in one of the HD44780 fonts you can provide a mapping table. For example HD44780_WEST contains 'alpha', 'beta', 'pi', 'Sigma', 'omega' 'My' - what is not enough to make USEFUL table - I think. - h.) If you want to integrate an entirely new variant of a Hitachi based display. + * g.) If you discover enough useful symbols in one of the HD44780 fonts you can provide a mapping table. For example HD44780_WEST contains 'alpha', 'beta', 'pi', 'Sigma', 'omega' 'My' - what is not enough to make USEFUL table - I think. + * h.) If you want to integrate an entirely new variant of a Hitachi based display. Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. The length of the strings is limited. '17 chars' was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. From d9b3232e940a8340aea18d9d14a3ff331f8872dd Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 14:55:15 +0100 Subject: [PATCH 023/302] Another update for the documentation. --- Documentation/LCDLanguageFont.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index c42bf7aa5..35317a62e 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -12,12 +12,13 @@ We have two different technologies for the displays: All of them have a similar but not identical symbol set at the positions 0 to 127 similar to US-ASCII. On the other hand symbols at places higher than 127 have mayor differences. Until now we know of (and support): - ** 1.) HD44780 and similar with Kana charset A00 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 17 + * 1.) HD44780 and similar with Kana charset A00 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 17 These are very common, but sadly not very useful when writing in European languages. - ** 2.) HD44780 and similar with Western charset A02 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 18 + * 2.) HD44780 and similar with Western charset A02 https://www.sparkfun.com/datasheets/LCD/HD44780.pdf Page 18 These are rare, but fairly useful for European languages. Also a limited number of Cyrillic symbols is available. - ** 3.) HD44780 and similar with Cyrillic charset http://store.comet.bg/download-file.php?id=466 Page 14 + * 3.) HD44780 and similar with Cyrillic charset http://store.comet.bg/download-file.php?id=466 Page 14 Some of our Russian friends use them. + At all of them you can define 8 different symbols by yourself. In Marlin they are used for the Feedrate-, Thermometer-, ... symbols * Full graphic displays @@ -25,9 +26,9 @@ We have two different technologies for the displays: Currently we deal with 128x64 Pixel Displays and divide this area in about 5 Lines with about 22 columns. Therefore we need fonts with a bounding box of about 6x10. Until now we used a - ** 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. - ** 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. - ** 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. + * 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. + * 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. + * 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. ## The Languages For the moment Marlin wants to support a lot of languages: @@ -63,7 +64,7 @@ We have two different technologies for the displays: Other languages ether tried to avoid wording with their special symbols or ignored the problem at all and used the basic symbols without the accents, dots, ... whatever. ## The (partial) Solution - On a 'perfect' system like Windows or Linux we'd dig out unifont.ttf and some code from the libraries and they'd do what we want. But we are on a embedded system with very limited resources. So we had to find ways so limit the used space (Alone unifont.ttf is about 12MB) and have to make some compromise. + On a 'perfect' system like Windows or Linux we'd dig out unifont.ttf and some code from the libraries and they'd do what we want. But we are on a embedded system with very limited resources. So we had to find ways to limit the used space (Alone unifont.ttf is about 12MB) and have to make some compromise. ### Aims: * 1.) Make the input for translators as convenient as possible. (Unicode UTF8) @@ -128,7 +129,7 @@ We have two different technologies for the displays: ## User Instructions Define your hardware and the wanted language in 'Configuration.h'. - To find out what charset you harware is define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. + To find out what charset your hardware is define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. * DISPLAY_CHARSET_HD44780_JAPAN locks like "バパヒビピフブプヘベペホボポマミ" * DISPLAY_CHARSET_HD44780_WESTERN locks like "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" * DISPLAY_CHARSET_HD44780_CYRILIC locks like "РСТУФХЦЧШЩЪЫЬЭЮЯ" From 9518b1c873c259ae12c51cd3b6033749d6f7a408 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 14:59:53 +0100 Subject: [PATCH 024/302] And another update for the documentation. --- Documentation/LCDLanguageFont.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index 35317a62e..249918e92 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -46,9 +46,11 @@ We have two different technologies for the displays: * nl Dutch * ca Catalan * eu Basque-Euskera + and recently on [Thingiverse](http://www.thingiverse.com/) a new port to * jp [Japanese](http://www.thingiverse.com/thing:664397) - appeared. + + appeared. ## The Problem All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. From 1feb71895b652c2a0f392a2b9d8e589da475d1e2 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 15:16:55 +0100 Subject: [PATCH 025/302] And an other one --- Documentation/LCDLanguageFont.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index 249918e92..f6e31944a 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -55,8 +55,8 @@ We have two different technologies for the displays: ## The Problem All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '³') - And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of the programmer wanted.) - The Germans want to use "ÄäÖöÜüß" the Finnish at least "äö". Other European languages want to see their accents an their letters. + And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of what the programmer wanted.) + The Germans want to use "ÄäÖöÜüß" the Finnish at least "äö". Other European languages want to see their accents on their letters. For other scripts like Cyrillic, Japanese, Greek, Hebrew, ... you have to find totally different symbol sets. Until now the problems where ignored widely. @@ -104,9 +104,10 @@ We have two different technologies for the displays: If you want to make use of more than a view symbols outside standard ASCII or want to improve the portability to more different types of displays use UTF8 input. That means define an other mapper. * d.) With a mapper different to MAPPER_NON UTF8 input is used. Instead of "\xe1" (on a display with Japanese font) or STR_ae simply use "ä". When the string is read byte by byte , the "ä" will expand to "\0xc3\0xa4" or "Я" will expand to "0xd0\0xaf" or "ホ" will expand to "\0xe3\0x83\0x9b" To limit the used memory we can't use all the possibilities UTF8 gives at the same time. We define a subset matching to the language or script we use. - MAPPER_C2C3 correspondents good with west European languages the possible symbols are listed at (http://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)) - MAPPER_D0D1 correspondents well with the Cyrillic languages. See (http://en.wikipedia.org/wiki/Cyrillic_(Unicode_block)) - MAPPER_E382E383 works with the Japanese Katakana script. See (http://en.wikipedia.org/wiki/Katakana_(Unicode_block)) + * MAPPER_C2C3 correspondents good with west European languages the possible symbols are listed at (http://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)) + * MAPPER_D0D1 correspondents well with the Cyrillic languages. See (http://en.wikipedia.org/wiki/Cyrillic_(Unicode_block)) + * MAPPER_E382E383 works with the Japanese Katakana script. See (http://en.wikipedia.org/wiki/Katakana_(Unicode_block)) + The mapper functions will only catch the 'lead in' described in the mappers name. If the input they get does not match they'll put out a '?' or garbage. The last byte in the sequence ether points directly into a matching ISO10646 font or via a mapper_table into one of the HD44780 fonts. The mapper_tables do their best to find a similar symbol in the HD44780_fonts. For example replacing small letters with the matching capital letters. But they may fail to find something matching and will output a '?'. There are combinations of language and display what simply have no corresponding symbols - like Cyrillic on a Japanese display or visa versa - than the compiler will throw an error. @@ -126,7 +127,9 @@ We have two different technologies for the displays: Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. The length of the strings is limited. '17 chars' was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. + On the 16x2 displays the strings are cut at the end to fit on the display. So it's a good idea to make them differ early. ('Somverylongoptionname x' -> 'x Somverylongoptionname') + You'll find all translatable strings in 'language_en.h'. Please don't translate any strings from 'language.h', this may break the serial protocol. ## User Instructions From bfb8a5315607d1b636b6cf20a6142481039f0c02 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 15:23:30 +0100 Subject: [PATCH 026/302] Documentation reformating The last for today - i hope. --- Documentation/LCDLanguageFont.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index f6e31944a..83b821145 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -126,7 +126,7 @@ We have two different technologies for the displays: * h.) If you want to integrate an entirely new variant of a Hitachi based display. Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. - The length of the strings is limited. '17 chars' was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. + The length of the strings is limited. '17 chars' a was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. On the 16x2 displays the strings are cut at the end to fit on the display. So it's a good idea to make them differ early. ('Somverylongoptionname x' -> 'x Somverylongoptionname') @@ -139,5 +139,7 @@ We have two different technologies for the displays: * DISPLAY_CHARSET_HD44780_WESTERN locks like "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" * DISPLAY_CHARSET_HD44780_CYRILIC locks like "РСТУФХЦЧШЩЪЫЬЭЮЯ" - If you get an error about missing mappers during compilation - lie about your displays hardware font to see at lest some garbage, or select an other language. English works on all hardware. + If you get an error about missing mappers during compilation - lie about your displays hardware font to see at lest some garbage, or select an other language. + + English works on all hardware. From ace3c62a1c6b3665ab9c6c694749283b8f95f2c6 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 15:26:01 +0100 Subject: [PATCH 027/302] Argh! Did not hit save --- Documentation/LCDLanguageFont.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index 83b821145..2d6b9cbf7 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -113,9 +113,9 @@ We have two different technologies for the displays: The mapper_tables do their best to find a similar symbol in the HD44780_fonts. For example replacing small letters with the matching capital letters. But they may fail to find something matching and will output a '?'. There are combinations of language and display what simply have no corresponding symbols - like Cyrillic on a Japanese display or visa versa - than the compiler will throw an error. In short: Chose a Mapper working with the symbols you want to use. Use only symbols matching the mapper. On FULL graphic displays all will be fine, but check for daring replacements or question-marks in the output of character based displays by defining SIMULATE_ROMFONT and trying the different variants. If you get a lot of question-marks on the Hitachi based displays with your new translation, maybe creating an additional language file with the format 'language_xx_utf8.h' is the way to go. - MAPPER_NON is the fastest and least memory consuming variant. - Mappers together with a ISO10646_font are the second best choice regarding speed and memory consumption. Only a few more decisions are mad per character. - Mappers together with the HD44780_fonts use about additional 128 bytes for the mapping_table. + * MAPPER_NON is the fastest and least memory consuming variant. + * Mappers together with a ISO10646_font are the second best choice regarding speed and memory consumption. Only a few more decisions are mad per character. + * Mappers together with the HD44780_fonts use about additional 128 bytes for the mapping_table. * e.) Creating a new language file is not a big thing. Just make a new file with the format 'language_xx.h' or maybe 'language.xx.utf8.h', define a mapper and a font in there and translate some of the strings defined in language_en.h. You can drop the surrounding #ifndef #endif. You don't have to translate all the stings - the missing one will be added by language_en.h - in English - of cause. * f.) If you cant find a matching mapper things will be a bit more complex. With the Hitachi based displays you will not have big chance to make something useful unless you have one with a matching charset. For a full graphic display - lets explain with - let's say Greece. Find a matching charset. (http://en.wikipedia.org/wiki/Greek_and_Coptic) From 3240d89f7d275d93357d38cd3f7d6665760975ae Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 19:45:10 +0100 Subject: [PATCH 028/302] Logic cleanup in utf_mapper. --- Marlin/utf_mapper.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index d54be6ceb..f04f1f87c 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -9,14 +9,14 @@ #define HARDWAERE_CHAR_OUT lcd.write #endif -#ifndef SIMULATE_ROMFONT - #if defined( DISPLAY_CHARSET_ISO10646_1 ) && defined( DOGLCD ) +#if !(defined( SIMULATE_ROMFONT )) && defined( DOGLCD ) + #if defined( DISPLAY_CHARSET_ISO10646_1 ) #define MAPPER_ONE_TO_ONE - #elif defined( DISPLAY_CHARSET_ISO10646_5 ) && defined( DOGLCD ) + #elif defined( DISPLAY_CHARSET_ISO10646_5 ) #define MAPPER_ONE_TO_ONE - #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) && defined( DOGLCD ) + #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) #define MAPPER_ONE_TO_ONE - #elif defined( DISPLAY_CHARSET_KANJI ) && defined( DOGLCD ) + #elif defined( DISPLAY_CHARSET_KANJI ) #define MAPPER_NON #endif #else // SIMULATE_ROMFONT @@ -59,6 +59,7 @@ #elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) #if defined( MAPPER_C2C3 ) + : const PROGMEM uint8_t utf_recode[] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is relative complete. 0x20,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0x22,0xa9,0xaa,0xab,0x3f,0x3f,0xae,0x3f, // c2a ¡¢£¤¥¦§¨©ª«¬­®¯ @@ -119,6 +120,8 @@ #elif defined( MAPPER_E382E383 ) #error( "Katakana on a cyrillic display makes no sense. There are no matching symbols." ); #endif + #else + #error("Something went wrong in the selection of DISPLAY_CHARSET_HD44780's"); #endif // DISPLAY_CHARSET_HD44780_CYRILIC #endif // SIMULATE_ROMFONT @@ -141,7 +144,7 @@ else if (seen_c2){ d &= 0x3f; #ifndef MAPPER_ONE_TO_ONE - HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); + HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); #else HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; #endif @@ -175,7 +178,7 @@ } else if ((utf_hi_char == 1) && (d == 0x11)) { HARDWAERE_CHAR_OUT((char) 0xb5 ); // ё } else { - HARDWAERE_CHAR_OUT((char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x10 )); + HARDWAERE_CHAR_OUT((char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x10 ) ); } } else { @@ -200,9 +203,9 @@ } else if (seen_d5) { d &= 0x3fu; #ifndef MAPPER_ONE_TO_ONE - HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); + HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); #else - HARDWAERE_CHAR_OUT( (char) (0xa0u + ( utf_hi_char << 6 ) + d) ) ; + HARDWAERE_CHAR_OUT( (char) (0xa0u + ( utf_hi_char << 6 ) + d ) ) ; #endif } else { HARDWAERE_CHAR_OUT('?'); @@ -230,9 +233,9 @@ } else if ((seen_e3 == true) && (seen_82_83 == true)){ d &= 0x3f; #ifndef MAPPER_ONE_TO_ONE - HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20) ); + HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); #else - HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; + HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d ) ) ; #endif } else { HARDWAERE_CHAR_OUT((char) '?' ); From 730497aaa1781446064bacea771c512502b0b669 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 13 Mar 2015 19:47:40 +0100 Subject: [PATCH 029/302] Make use of ligatures in language_kana_utf8.h --- Marlin/language_kana_utf8.h | 96 ++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 5501475ea..d08c18833 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -20,54 +20,54 @@ // 片仮名表示定義 #define WELCOME_MSG MACHINE_NAME " ready." -#define MSG_SD_INSERTED "セート゛ ンウニユウアレマシタ" // "Card inserted" -#define MSG_SD_REMOVED "セート゛セ゛アリマセン" // "Card removed" +#define MSG_SD_INSERTED "セード ンウニユウアレマシタ" // "Card inserted" +#define MSG_SD_REMOVED "セードゼアリマセン" // "Card removed" #define MSG_MAIN "ナイン" // "Main" -#define MSG_AUTOSTART "シ゛ト゛ウセイシ" // "Autostart" -#define MSG_DISABLE_STEPPERS "モーターテ゛ンケ゛ン オフ" // "Disable steppers" -#define MSG_AUTO_HOME "ケ゛ンテンニイト゛ウ" // "Auto home" -#define MSG_SET_HOME_OFFSETS "キシ゛ユンオフセツトセツテイ" // "Set home offsets" -#define MSG_SET_ORIGIN "キシ゛ユンセツト" // "Set origin" +#define MSG_AUTOSTART "ヅドウセイシ" // "Autostart" +#define MSG_DISABLE_STEPPERS "モーターデンゲン オフ" // "Disable steppers" +#define MSG_AUTO_HOME "ゲンテンニイドウ" // "Auto home" +#define MSG_SET_HOME_OFFSETS "キヅユンオフセツトセツテイ" // "Set home offsets" +#define MSG_SET_ORIGIN "キヅユンセツト" // "Set origin" #define MSG_PREHEAT_PLA "PLA ヨネシ" // "Preheat PLA" #define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " スヘ゛テ" // " All" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " ヘ゛ツト゛" // "Bed" +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " スベテ" // " All" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " ベツド" // "Bed" #define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " セツテイ" // "conf" #define MSG_PREHEAT_ABS "ABS ヨネシ" // "Preheat ABS" #define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " スヘ゛テ" // " All" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " ヘ゛ツト゛" // "Bed" +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " スベテ" // " All" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " ベツド" // "Bed" #define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " セツテイ" // "conf" #define MSG_COOLDOWN "セネシテイシ" // "Cooldown" -#define MSG_SWITCH_PS_ON "テ゛ンケン゛ オン" // "Switch power on" -#define MSG_SWITCH_PS_OFF "テ゛ンケン゛ オフ" // "Switch power off" -#define MSG_EXTRUDE "オシタ゛シ" // "Extrude" +#define MSG_SWITCH_PS_ON "デンケゾ オン" // "Switch power on" +#define MSG_SWITCH_PS_OFF "デンケゾ オフ" // "Switch power off" +#define MSG_EXTRUDE "オシダシ" // "Extrude" #define MSG_RETRACT "リトラケト" // "Retract" -#define MSG_MOVE_AXIS "シ゛ケイト゛ウ" // "Move axis" -#define MSG_MOVE_X "Xシ゛ケ イト゛ウ" // "Move X" -#define MSG_MOVE_Y "Yシ゛ケ イト゛ウ" // "Move Y" -#define MSG_MOVE_Z "Zシ゛ケ イト゛ウ" // "Move Z" -#define MSG_MOVE_E "エケストルータ゛ー" // "Extruder" -#define MSG_MOVE_01MM "0.1mm イト゛ウ" // "Move 0.1mm" -#define MSG_MOVE_1MM " 1mm イト゛ウ" // "Move 1mm" -#define MSG_MOVE_10MM " 10mm イト゛ウ" // "Move 10mm" -#define MSG_SPEED "スヒ゜ート゛" // "Speed" -#define MSG_NOZZLE "ノス゛ル" // "Nozzle" -#define MSG_BED "ヘ゛ツト゛" // "Bed" -#define MSG_FAN_SPEED "ファンンケト゛" // "Fan speed" +#define MSG_MOVE_AXIS "ヅケイドウ" // "Move axis" +#define MSG_MOVE_X "Xヅケ イドウ" // "Move X" +#define MSG_MOVE_Y "Yヅケ イドウ" // "Move Y" +#define MSG_MOVE_Z "Zヅケ イドウ" // "Move Z" +#define MSG_MOVE_E "エケストルーダー" // "Extruder" +#define MSG_MOVE_01MM "0.1mm イドウ" // "Move 0.1mm" +#define MSG_MOVE_1MM " 1mm イドウ" // "Move 1mm" +#define MSG_MOVE_10MM " 10mm イドウ" // "Move 10mm" +#define MSG_SPEED "スヒ゜ード" // "Speed" +#define MSG_NOZZLE "ノズル" // "Nozzle" +#define MSG_BED "ベツド" // "Bed" +#define MSG_FAN_SPEED "ファンンケド" // "Fan speed" #define MSG_FLOW "オケリリョウ" // "Flow" #define MSG_CONTROL "コントロール" // "Control" #define MSG_MIN LCD_STR_THERMOMETER " Min" #define MSG_MAX LCD_STR_THERMOMETER " Max" #define MSG_FACTOR LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP "シ゛ト゛ウオント゛" // "Autotemp" +#define MSG_AUTOTEMP "ヅドウオンド" // "Autotemp" #define MSG_ON "On " #define MSG_OFF "Off" #define MSG_PID_P "PID-P" #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" -#define MSG_ACC "センケト゛" // "Accel" +#define MSG_ACC "センケド" // "Accel" #define MSG_VXY_JERK "Vxy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" @@ -84,8 +84,8 @@ #define MSG_YSTEPS "Ysteps/mm" #define MSG_ZSTEPS "Zsteps/mm" #define MSG_ESTEPS "Esteps/mm" -#define MSG_TEMPERATURE "オント゛" // "Temperature" -#define MSG_MOTION "ウコ゛キセツテイ" // "Motion" +#define MSG_TEMPERATURE "オンド" // "Temperature" +#define MSG_MOTION "ウゴキセツテイ" // "Motion" #define MSG_VOLUMETRIC "フィラナント" // "Filament" #define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" @@ -98,18 +98,18 @@ #define MSG_RESTORE_FAILSAFE "セツテイリセツト" // "Restore failsafe" #define MSG_REFRESH "リフレツシユ" // "Refresh" #define MSG_WATCH "インフォ" // "Info screen" -#define MSG_PREPARE "シ゛ユンヒ゛セツテイ" //"Prepare" +#define MSG_PREPARE "ヅユンゼセツテイ" //"Prepare" #define MSG_TUNE "チョウセイ" // "Tune" -#define MSG_PAUSE_PRINT "イチシ゛テイシ" // "Pause print" -#define MSG_RESUME_PRINT "フ゜リントアイセイ" // "Resume print" -#define MSG_STOP_PRINT "フ゜リントテイシ" // "Stop print" -#define MSG_CARD_MENU "SDセート゛セラフ゜リント" // "Print from SD" -#define MSG_NO_CARD "SDセート゛セ゛アリマセン" // "No SD card" -#define MSG_DWELL "スリーフ゜" // "Sleep..." -#define MSG_USERWAIT "シハ゛ラケオマチケタ゛アイ" // "Wait for user..." -#define MSG_RESUMING "フ゜リントアイセイ" // "Resuming print" -#define MSG_PRINT_ABORTED "フ゜リントチユウシアレマシタ" // "Print aborted" -#define MSG_NO_MOVE "ウコ゛キマセン" // "No move." +#define MSG_PAUSE_PRINT "イチヅテイシ" // "Pause print" +#define MSG_RESUME_PRINT "プリントアイセイ" // "Resume print" +#define MSG_STOP_PRINT "プリントテイシ" // "Stop print" +#define MSG_CARD_MENU "SDセードセラプリント" // "Print from SD" +#define MSG_NO_CARD "SDセードゼアリマセン" // "No SD card" +#define MSG_DWELL "スリープ" // "Sleep..." +#define MSG_USERWAIT "シバラケオマチケダアイ" // "Wait for user..." +#define MSG_RESUMING "プリントアイセイ" // "Resuming print" +#define MSG_PRINT_ABORTED "プリントチユウシアレマシタ" // "Print aborted" +#define MSG_NO_MOVE "ウゴキマセン" // "No move." #define MSG_KILLED "ショウキョ" // "KILLED. " #define MSG_STOPPED "テイシシマシタ" // "STOPPED. " #define MSG_CONTROL_RETRACT "Retract mm" @@ -121,14 +121,14 @@ #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "AutoRetr." #define MSG_FILAMENTCHANGE "フィラナントコウセン" // "Change filament" -#define MSG_INIT_SDCARD "SDセート゛アイヨミコミ" // "Init. SD card" -#define MSG_CNG_SDCARD "SDセート゛コウセン" // "Change SD card" -#define MSG_ZPROBE_OUT "Zフ゜ローフ゛ ヘ゛ツトnセ゛イ" // "Z probe out. bed" -#define MSG_POSITION_UNKNOWN "ケ゛ンテンハXYイト゛ウコ゛Z" // "Home X/Y before Z" +#define MSG_INIT_SDCARD "SDセードアイヨミコミ" // "Init. SD card" +#define MSG_CNG_SDCARD "SDセードコウセン" // "Change SD card" +#define MSG_ZPROBE_OUT "Zプローブ ベツトnゼイ" // "Z probe out. bed" +#define MSG_POSITION_UNKNOWN "ゲンテンハXYイドウゴZ" // "Home X/Y before Z" #define MSG_ZPROBE_ZOFFSET "Zオフセツト" // "Z Offset" -#define MSG_BABYSTEP_X "ヒ゛ト゛ウ X" // "Babystep X" -#define MSG_BABYSTEP_Y "ヒ゛ト゛ウ Y" // "Babystep Y" -#define MSG_BABYSTEP_Z "ヒ゛ト゛ウ Z" // "Babystep Z" +#define MSG_BABYSTEP_X "ゼドウ X" // "Babystep X" +#define MSG_BABYSTEP_Y "ゼドウ Y" // "Babystep Y" +#define MSG_BABYSTEP_Z "ゼドウ Z" // "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" #ifdef DELTA_CALIBRATION_MENU From 44a205d9d9ead16cc8dcc069b8d2a88fec2a48c1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 14 Mar 2015 12:27:47 +0100 Subject: [PATCH 030/302] Corrected Cyrillic fonts. Cleaned typo in language_test.h Cyrillic part. --- Marlin/dogm_font_data_HD44780_C.h | 62 ++++---- Marlin/dogm_font_data_ISO10646_5_Cyrillic.h | 153 ++++++++++--------- Marlin/language_test.h | 4 +- Marlin/scripts/Fonts/HD44780_C.fon | Bin 4176 -> 4176 bytes Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon | Bin 4224 -> 4224 bytes 5 files changed, 110 insertions(+), 109 deletions(-) diff --git a/Marlin/dogm_font_data_HD44780_C.h b/Marlin/dogm_font_data_HD44780_C.h index b4e3ff197..a4c826103 100644 --- a/Marlin/dogm_font_data_HD44780_C.h +++ b/Marlin/dogm_font_data_HD44780_C.h @@ -2,7 +2,7 @@ Fontname: HD44780_C Copyright: A. Hardtung, public domain Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 8 x= 2 y= 8 dx= 6 dy= 0 ascent= 8 len= 8 + Calculated Max Values w= 5 h= 8 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 8 Font Bounding box w= 6 h= 9 x= 0 y=-2 Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 Pure Font ascent = 7 descent=-1 @@ -10,9 +10,9 @@ Max Font ascent = 8 descent=-1 */ #include -const u8g_fntpgm_uint8_t HD44780_C_5x7[2520] U8G_SECTION(".progmem.HD44780_C_5x7") = { +const u8g_fntpgm_uint8_t HD44780_C_5x7[2522] U8G_SECTION(".progmem.HD44780_C_5x7") = { 0,6,9,0,254,7,1,145,3,34,32,255,255,8,255,7, - 255,0,0,0,6,0,8,1,7,7,6,2,0,128,128,128, + 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, @@ -84,18 +84,18 @@ const u8g_fntpgm_uint8_t HD44780_C_5x7[2520] U8G_SECTION(".progmem.HD44780_C_5x7 168,184,5,5,5,6,0,2,184,136,184,160,184,5,5,5, 6,0,2,184,160,184,136,184,5,6,6,6,0,1,8,40, 72,248,64,32,5,5,5,6,0,0,56,112,224,136,240,0, - 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, - 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, - 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,0, - 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, - 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, - 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,0, - 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, - 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, - 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,0, - 0,0,6,0,8,0,0,0,6,0,8,0,0,0,6,0, - 8,0,0,0,6,0,8,0,0,0,6,0,8,0,0,0, - 6,0,8,0,0,0,6,0,8,0,0,0,6,0,8,5, + 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, + 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, + 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, + 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, + 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, + 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, + 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, + 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, + 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, + 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, + 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, + 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,5, 7,7,6,0,0,248,136,128,240,136,136,240,5,7,7,6, 0,0,248,136,128,128,128,128,128,5,7,7,6,0,0,80, 0,248,128,240,128,248,5,7,7,6,0,0,168,168,168,112, @@ -108,7 +108,7 @@ const u8g_fntpgm_uint8_t HD44780_C_5x7[2520] U8G_SECTION(".progmem.HD44780_C_5x7 7,7,6,0,0,136,136,136,120,8,8,8,5,7,7,6, 0,0,168,168,168,168,168,168,248,5,7,7,6,0,0,192, 64,64,112,72,72,112,5,7,7,6,0,0,136,136,136,200, - 168,168,200,5,7,7,6,0,0,112,136,8,112,8,136,112, + 168,168,200,5,7,7,6,0,0,112,136,8,48,8,136,112, 5,7,7,6,0,0,144,168,168,232,168,168,144,5,7,7, 6,0,0,120,136,136,120,40,72,136,5,7,7,6,0,0, 24,96,128,240,136,136,112,4,5,5,6,0,0,224,144,224, @@ -146,8 +146,8 @@ const u8g_fntpgm_uint8_t HD44780_C_5x7[2520] U8G_SECTION(".progmem.HD44780_C_5x7 128,2,2,2,6,2,2,192,192,5,8,8,6,0,255,120, 40,40,40,72,136,248,136,5,8,8,6,0,255,136,136,136, 136,136,136,248,8,5,8,8,6,0,255,168,168,168,168,168, - 168,248,8,5,6,6,6,0,0,120,40,72,136,248,136,5, - 7,7,6,0,0,32,32,112,168,168,112,32,5,6,6,6, + 168,248,8,5,6,6,6,0,255,120,40,72,136,248,136,5, + 7,7,6,0,255,32,32,112,168,168,112,32,5,6,6,6, 0,255,136,136,136,136,248,8,5,6,6,6,0,255,168,168, 168,168,248,8,2,2,2,6,2,6,64,128,3,1,1,6, 1,7,160,5,2,2,6,0,6,72,176,5,8,8,6,0, @@ -156,16 +156,16 @@ const u8g_fntpgm_uint8_t HD44780_C_5x7[2520] U8G_SECTION(".progmem.HD44780_C_5x7 32,192,5,6,6,6,0,1,32,112,112,112,248,32,5,5, 5,6,0,1,80,0,136,0,80,5,5,5,6,0,1,112, 136,136,136,112,5,7,7,6,0,0,136,144,168,88,184,8, - 8,5,7,7,6,0,0,136,144,184,72,152,32,56,5,8, - 8,6,0,0,192,64,192,72,216,56,8,8,5,7,7,6, - 0,0,136,248,136,248,136,248,136,4,5,5,6,0,2,192, - 0,48,0,96,5,8,8,6,0,0,64,160,224,168,8,40, - 120,32,5,8,8,6,0,0,64,112,64,120,64,112,64,224, - 5,8,8,6,0,0,64,112,64,120,64,112,64,224,5,8, - 8,6,0,0,32,112,32,248,32,112,32,112,5,7,7,6, - 0,0,104,0,232,0,104,16,56,5,7,7,6,0,0,112, - 16,240,16,112,16,56,5,7,7,6,0,0,32,112,32,248, - 32,112,32,5,7,7,6,0,0,16,144,80,48,80,144,56, - 5,8,8,6,0,0,48,72,32,80,80,32,144,96,5,7, - 7,6,0,0,120,168,168,120,40,40,40,5,7,7,6,0, - 0,248,248,248,248,248,248,248}; + 8,5,7,7,6,0,0,136,144,184,72,184,8,56,5,7, + 7,6,0,0,136,144,184,72,152,32,56,5,8,8,6,0, + 0,192,64,192,72,216,56,8,8,5,7,7,6,0,0,136, + 248,136,248,136,248,136,4,5,5,6,0,2,192,0,48,0, + 96,5,8,8,6,0,0,64,160,224,168,8,40,120,32,5, + 8,8,6,0,0,64,112,64,120,64,112,64,224,5,8,8, + 6,0,0,32,112,32,248,32,112,32,112,5,7,7,6,0, + 0,104,0,232,0,104,16,56,5,8,8,6,0,0,16,112, + 16,240,16,112,16,56,5,7,7,6,0,1,32,112,32,248, + 32,112,32,5,8,8,6,0,0,16,144,80,48,80,144,16, + 56,5,8,8,6,0,0,48,72,32,80,80,32,144,96,5, + 7,7,6,0,0,120,168,168,120,40,40,40,5,8,8,6, + 0,0,248,248,248,248,248,248,248,248}; diff --git a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h index 4a9b5802b..5b0e43e08 100644 --- a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h +++ b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h @@ -10,7 +10,7 @@ Max Font ascent = 8 descent=-1 */ #include -const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2559] U8G_SECTION(".progmem.ISO10646_5_Cyrillic_5x7") = { +const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2560] U8G_SECTION(".progmem.ISO10646_5_Cyrillic_5x7") = { 0,6,9,0,254,7,1,145,3,32,32,255,255,8,255,7, 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, @@ -96,78 +96,79 @@ const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2559] U8G_SECTION(".progmem.ISO 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, 0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0, 0,6,0,0,0,0,0,6,0,0,5,8,8,6,0,0, - 64,32,0,248,128,240,128,248,5,7,7,6,0,0,80,0, - 248,128,240,128,248,5,7,7,6,0,0,248,128,128,240,136, - 136,240,5,8,8,6,0,0,16,32,248,136,128,128,128,128, - 5,7,7,6,0,0,48,72,128,224,128,72,48,5,7,7, - 6,0,0,112,136,128,112,8,136,112,3,7,7,6,1,0, - 224,64,64,64,64,64,224,3,8,8,6,1,0,160,0,224, - 64,64,64,64,224,5,7,7,6,0,0,56,16,16,16,16, - 144,96,5,7,7,6,0,255,160,160,160,184,168,168,184,5, - 7,7,6,0,255,160,160,160,248,168,168,184,4,7,7,6, - 0,255,224,64,112,80,80,80,80,5,8,8,6,0,0,16, - 32,136,144,160,224,144,136,5,8,8,6,0,0,64,32,136, - 152,168,200,136,136,5,9,9,6,0,255,80,32,136,136,136, - 80,32,32,32,5,8,8,6,0,255,136,136,136,136,136,136, - 248,32,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,224,64,64,112,72,72,112,5,7,7,6, - 0,0,240,136,136,240,136,136,240,5,7,7,6,0,255,248, - 136,128,128,128,128,128,5,8,8,6,0,255,120,40,40,40, - 72,136,248,136,5,7,7,6,0,0,248,128,128,240,128,128, - 248,5,7,7,6,0,0,168,168,168,112,168,168,168,5,7, - 7,6,0,0,240,8,8,112,8,8,240,5,7,7,6,0, - 0,136,136,152,168,200,136,136,5,8,8,6,0,0,80,32, - 136,152,168,168,200,136,5,7,7,6,0,0,136,144,160,192, - 160,144,136,5,7,7,6,0,0,120,40,40,40,40,168,72, - 5,7,7,6,0,0,136,216,168,136,136,136,136,5,7,7, - 6,0,0,136,136,136,248,136,136,136,5,7,7,6,0,0, - 112,136,136,136,136,136,112,5,7,7,6,0,0,248,136,136, - 136,136,136,136,5,7,7,6,0,0,240,136,136,240,128,128, - 128,5,7,7,6,0,0,112,136,128,128,128,136,112,5,7, - 7,6,0,0,248,32,32,32,32,32,32,5,7,7,6,0, - 0,136,136,136,80,32,64,128,5,7,7,6,0,0,32,112, - 168,168,168,112,32,5,7,7,6,0,0,136,136,80,32,80, - 136,136,5,8,8,6,0,255,136,136,136,136,136,136,248,8, - 5,7,7,6,0,255,136,136,136,152,104,8,8,5,7,7, - 6,0,0,168,168,168,168,168,168,248,5,8,8,6,0,255, - 168,168,168,168,168,168,248,8,5,7,7,6,0,0,192,64, - 64,112,72,72,112,5,7,7,6,0,0,136,136,136,200,168, - 168,200,5,7,7,6,0,0,128,128,240,136,136,136,240,5, - 7,7,6,0,0,112,136,8,112,8,136,112,5,7,7,6, - 0,0,144,168,168,232,168,168,144,5,7,7,6,0,0,120, - 136,136,120,40,72,136,5,5,5,6,0,0,112,8,120,136, - 120,5,7,7,6,0,0,24,96,128,240,136,136,112,4,5, - 5,6,0,0,224,144,224,144,224,5,5,5,6,0,0,248, - 136,128,128,128,5,6,6,6,0,0,120,40,72,136,248,136, - 5,5,5,6,0,0,112,136,248,128,112,5,5,5,6,0, - 0,168,168,112,168,168,5,5,5,6,0,0,240,8,48,8, - 240,5,5,5,6,0,0,136,152,168,200,136,5,7,7,6, - 0,0,80,32,136,152,168,200,136,4,5,5,6,0,0,144, - 160,192,160,144,5,5,5,6,0,0,248,40,40,168,72,5, - 5,5,6,0,0,136,216,168,136,136,5,5,5,6,0,0, - 136,136,248,136,136,5,5,5,6,0,0,112,136,136,136,112, - 5,5,5,6,0,0,248,136,136,136,136,5,6,6,6,0, - 255,240,136,136,240,128,128,5,5,5,6,0,0,112,128,128, - 136,112,5,5,5,6,0,0,248,32,32,32,32,5,6,6, - 6,0,255,136,136,136,120,8,112,5,6,6,6,0,0,32, - 112,168,168,112,32,5,5,5,6,0,0,136,80,32,80,136, - 5,6,6,6,0,255,136,136,136,136,248,8,5,5,5,6, - 0,0,136,136,248,8,8,5,5,5,6,0,0,168,168,168, - 168,248,5,6,6,6,0,255,168,168,168,168,248,8,5,5, - 5,6,0,0,192,64,112,72,112,5,5,5,6,0,0,136, - 136,200,168,200,3,5,5,6,1,0,128,128,192,160,192,5, - 5,5,6,0,0,112,136,56,136,112,5,5,5,6,0,0, - 144,168,232,168,144,5,5,5,6,0,0,120,136,120,40,72, - 5,8,8,6,0,0,64,32,0,112,136,248,128,112,5,7, - 7,6,0,0,80,0,112,136,248,128,112,5,9,9,6,0, - 255,64,224,64,64,120,72,72,72,16,5,8,8,6,0,0, - 16,32,0,248,136,128,128,128,5,5,5,6,0,0,112,136, - 96,136,112,5,5,5,6,0,0,112,128,112,8,240,1,7, - 7,6,2,0,128,0,128,128,128,128,128,3,7,7,6,1, - 0,160,0,64,64,64,64,64,3,8,8,6,1,255,32,0, - 32,32,32,32,160,64,5,5,5,6,0,0,160,160,184,168, - 184,5,5,5,6,0,0,160,160,248,168,184,5,6,6,6, - 0,0,64,224,64,120,72,72,4,8,8,6,0,0,16,32, - 0,144,160,192,160,144,5,8,8,6,0,0,64,32,0,136, - 152,168,200,136,5,9,9,6,0,255,80,32,0,136,136,136, - 120,8,112,5,6,6,6,0,255,136,136,136,136,248,32}; + 64,248,128,128,240,128,128,248,5,8,8,6,0,0,80,248, + 128,128,240,128,128,248,5,7,7,6,0,0,224,64,64,112, + 72,72,112,5,8,8,6,0,0,16,32,248,136,128,128,128, + 128,5,7,7,6,0,0,48,72,128,224,128,72,48,5,7, + 7,6,0,0,112,136,128,112,8,136,112,3,7,7,6,1, + 0,224,64,64,64,64,64,224,3,8,8,6,1,0,160,0, + 224,64,64,64,64,224,5,7,7,6,0,0,56,16,16,16, + 16,144,96,5,7,7,6,0,0,160,160,160,184,168,168,184, + 5,7,7,6,0,0,160,160,160,248,168,168,184,4,7,7, + 6,0,0,224,64,112,80,80,80,80,5,8,8,6,0,0, + 16,32,136,144,160,224,144,136,5,8,8,6,0,0,64,32, + 136,152,168,200,136,136,5,9,9,6,0,255,80,32,136,136, + 136,80,32,32,32,5,8,8,6,0,255,136,136,136,136,136, + 136,248,32,5,7,7,6,0,0,112,136,136,248,136,136,136, + 5,7,7,6,0,0,248,128,128,240,136,136,240,5,7,7, + 6,0,0,240,136,136,240,136,136,240,5,7,7,6,0,0, + 248,136,128,128,128,128,128,5,8,8,6,0,255,120,40,40, + 40,72,136,248,136,5,7,7,6,0,0,248,128,128,240,128, + 128,248,5,7,7,6,0,0,168,168,168,112,168,168,168,5, + 7,7,6,0,0,240,8,8,112,8,8,240,5,7,7,6, + 0,0,136,136,152,168,200,136,136,5,8,8,6,0,0,80, + 32,136,152,168,168,200,136,5,7,7,6,0,0,136,144,160, + 192,160,144,136,5,7,7,6,0,0,120,40,40,40,40,168, + 72,5,7,7,6,0,0,136,216,168,136,136,136,136,5,7, + 7,6,0,0,136,136,136,248,136,136,136,5,7,7,6,0, + 0,112,136,136,136,136,136,112,5,7,7,6,0,0,248,136, + 136,136,136,136,136,5,7,7,6,0,0,240,136,136,240,128, + 128,128,5,7,7,6,0,0,112,136,128,128,128,136,112,5, + 7,7,6,0,0,248,32,32,32,32,32,32,5,7,7,6, + 0,0,136,136,136,80,32,64,128,5,7,7,6,0,0,32, + 112,168,168,168,112,32,5,7,7,6,0,0,136,136,80,32, + 80,136,136,5,8,8,6,0,255,136,136,136,136,136,136,248, + 8,5,7,7,6,0,0,136,136,136,152,104,8,8,5,7, + 7,6,0,0,168,168,168,168,168,168,248,5,8,8,6,0, + 255,168,168,168,168,168,168,248,8,5,7,7,6,0,0,192, + 64,64,112,72,72,112,5,7,7,6,0,0,136,136,136,200, + 168,168,200,5,7,7,6,0,0,128,128,128,240,136,136,240, + 5,7,7,6,0,0,112,136,8,48,8,136,112,5,7,7, + 6,0,0,144,168,168,232,168,168,144,5,7,7,6,0,0, + 120,136,136,120,40,72,136,5,5,5,6,0,0,112,8,120, + 136,120,5,7,7,6,0,0,24,96,128,240,136,136,112,4, + 5,5,6,0,0,224,144,224,144,224,5,5,5,6,0,0, + 248,136,128,128,128,5,6,6,6,0,0,120,40,72,136,248, + 136,5,5,5,6,0,0,112,136,248,128,112,5,5,5,6, + 0,0,168,168,112,168,168,5,5,5,6,0,0,240,8,48, + 8,240,5,5,5,6,0,0,136,152,168,200,136,5,7,7, + 6,0,0,80,32,136,152,168,200,136,4,5,5,6,0,0, + 144,160,192,160,144,5,5,5,6,0,0,248,40,40,168,72, + 5,5,5,6,0,0,136,216,168,136,136,5,5,5,6,0, + 0,136,136,248,136,136,5,5,5,6,0,0,112,136,136,136, + 112,5,5,5,6,0,0,248,136,136,136,136,5,6,6,6, + 0,255,240,136,136,240,128,128,5,5,5,6,0,0,112,128, + 128,136,112,5,5,5,6,0,0,248,32,32,32,32,5,6, + 6,6,0,255,136,136,136,120,8,112,5,6,6,6,0,0, + 32,112,168,168,112,32,5,5,5,6,0,0,136,80,32,80, + 136,5,6,6,6,0,255,136,136,136,136,248,8,5,5,5, + 6,0,0,136,136,248,8,8,5,5,5,6,0,0,168,168, + 168,168,248,5,6,6,6,0,255,168,168,168,168,248,8,5, + 5,5,6,0,0,192,64,112,72,112,5,5,5,6,0,0, + 136,136,200,168,200,3,5,5,6,1,0,128,128,192,160,192, + 5,5,5,6,0,0,112,136,56,136,112,5,5,5,6,0, + 0,144,168,232,168,144,5,5,5,6,0,0,120,136,120,40, + 72,5,8,8,6,0,0,64,32,0,112,136,248,128,112,5, + 7,7,6,0,0,80,0,112,136,248,128,112,5,9,9,6, + 0,255,64,224,64,64,120,72,72,72,16,5,8,8,6,0, + 0,16,32,0,248,136,128,128,128,5,5,5,6,0,0,112, + 136,96,136,112,5,5,5,6,0,0,112,128,112,8,240,1, + 7,7,6,2,0,128,0,128,128,128,128,128,3,7,7,6, + 1,0,160,0,64,64,64,64,64,3,8,8,6,1,255,32, + 0,32,32,32,32,160,64,5,5,5,6,0,0,160,160,184, + 168,184,5,5,5,6,0,0,160,160,248,168,184,5,6,6, + 6,0,0,64,224,64,120,72,72,4,8,8,6,0,0,16, + 32,0,144,160,192,160,144,5,8,8,6,0,0,64,32,0, + 136,152,168,200,136,5,9,9,6,0,255,80,32,0,136,136, + 136,120,8,112,5,6,6,6,0,255,136,136,136,136,248,32 + }; diff --git a/Marlin/language_test.h b/Marlin/language_test.h index a2ba43fae..ba6f7e523 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -65,11 +65,11 @@ #define STRG_C3_a "àáâãäåæçèéêëìíîï" #define STRG_C3_b "ðñòóôõö÷øùúûüýþÿ" -#define STRG_D0_8 "ЈЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ" +#define STRG_D0_8 "ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ" #define STRG_D0_9 "АБВГДЕЖЗИЙКЛМНОП" #define STRG_D0_a "РСТУФХЦЧШЩЪЫЬЭЮЯ" #define STRG_D0_b "абвгдежзийклмноп" -#define STRG_D1_8 "шстуфхцчшщъыьэюя" +#define STRG_D1_8 "рстуфхцчшщъыьэюя" #define STRG_D1_9 "ѐёђѓєѕіїјљњћќѝўџ" #define STRG_D1_a "ѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯ" #define STRG_D1_b "ѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿ" diff --git a/Marlin/scripts/Fonts/HD44780_C.fon b/Marlin/scripts/Fonts/HD44780_C.fon index 00936e2541764768f6d2f027832b19dbf5e361f8..0ca52b47d6ca5c1780cce1bff4f9ab58be29275d 100644 GIT binary patch delta 123 zcmcbha6w_h0!EFA3lmjU-2DAQf?R_Y3=Ir)EX{yO!Aily#l*zi!XVyR!9t76e#=vVjxRkLV!WQgvt5> M;#>?rAb^1Z0D-|GZU6uP diff --git a/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon b/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon index 13d56d5e50ab3e2e8f59c9f40bd498a7ce4c413d..75a7dd273247e0d50ec52185c5b7c33c5aceb19f 100644 GIT binary patch delta 157 zcmZorY*3uAfYE5;!fZyp$-Io3tO{j@dWM^=85_8ze>60FXlVGszz_guF+6Z^DDdzo zn0$@LUS`391v^%(*ulWS0A&4uupT%R1ONfUWJ6vP8IZP)jt@WuAPU0z(a`_`43isq f4{&sJbj--$;9!{S$*02uQ(Mr%VX(Q8?>{2|8!|qM delta 157 zcmZorY*3uAfKhki!fZy($-Io3tPCKq*_yF|TUvqPN5hAPA3%Npob{uj;X_BqhsoD? z>}41hELgB(#flw31whsh2!d;Hsm#tdEnqs;NejKln3bnA|Q+5M@It)Om5^o gz`@Yb(J>=~gJZHMpAHXD0a!&r2S>r?M!x@y0Nr&v!T Date: Sat, 14 Mar 2015 15:10:45 +0100 Subject: [PATCH 031/302] Corrected Cyrillic fonts. Round II. --- Marlin/dogm_font_data_HD44780_C.h | 4 ++-- Marlin/dogm_font_data_ISO10646_5_Cyrillic.h | 4 ++-- Marlin/scripts/Fonts/HD44780_C.fon | Bin 4176 -> 4176 bytes Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon | Bin 4224 -> 4224 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/dogm_font_data_HD44780_C.h b/Marlin/dogm_font_data_HD44780_C.h index a4c826103..bc6af9150 100644 --- a/Marlin/dogm_font_data_HD44780_C.h +++ b/Marlin/dogm_font_data_HD44780_C.h @@ -1,5 +1,5 @@ /* - Fontname: HD44780_C + Fontname: HD44780_C v1.2 Copyright: A. Hardtung, public domain Capital A Height: 7, '1' Height: 7 Calculated Max Values w= 5 h= 8 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 8 @@ -108,7 +108,7 @@ const u8g_fntpgm_uint8_t HD44780_C_5x7[2522] U8G_SECTION(".progmem.HD44780_C_5x7 7,7,6,0,0,136,136,136,120,8,8,8,5,7,7,6, 0,0,168,168,168,168,168,168,248,5,7,7,6,0,0,192, 64,64,112,72,72,112,5,7,7,6,0,0,136,136,136,200, - 168,168,200,5,7,7,6,0,0,112,136,8,48,8,136,112, + 168,168,200,5,7,7,6,0,0,112,136,8,56,8,136,112, 5,7,7,6,0,0,144,168,168,232,168,168,144,5,7,7, 6,0,0,120,136,136,120,40,72,136,5,7,7,6,0,0, 24,96,128,240,136,136,112,4,5,5,6,0,0,224,144,224, diff --git a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h index 5b0e43e08..9c93fc8c5 100644 --- a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h +++ b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h @@ -1,5 +1,5 @@ /* - Fontname: ISO10646_5_Cyrillic + Fontname: ISO10646_5_Cyrillic v1.2 Copyright: A. Hardtung, public domain Capital A Height: 7, '1' Height: 7 Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 @@ -133,7 +133,7 @@ const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2560] U8G_SECTION(".progmem.ISO 255,168,168,168,168,168,168,248,8,5,7,7,6,0,0,192, 64,64,112,72,72,112,5,7,7,6,0,0,136,136,136,200, 168,168,200,5,7,7,6,0,0,128,128,128,240,136,136,240, - 5,7,7,6,0,0,112,136,8,48,8,136,112,5,7,7, + 5,7,7,6,0,0,112,136,8,56,8,136,112,5,7,7, 6,0,0,144,168,168,232,168,168,144,5,7,7,6,0,0, 120,136,136,120,40,72,136,5,5,5,6,0,0,112,8,120, 136,120,5,7,7,6,0,0,24,96,128,240,136,136,112,4, diff --git a/Marlin/scripts/Fonts/HD44780_C.fon b/Marlin/scripts/Fonts/HD44780_C.fon index 0ca52b47d6ca5c1780cce1bff4f9ab58be29275d..bb9ca2a500ff1b0ea691f2358f0dcd814d0900f1 100644 GIT binary patch delta 21 ccmcbha6w^%8Y838W_3np9!87J+PtdF07jSvApigX delta 21 ccmcbha6w^%8Y83OW_3np9!7)B+PtdF07hE{7ytkO diff --git a/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon b/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon index 75a7dd273247e0d50ec52185c5b7c33c5aceb19f..bb13545ba81d4580e41adc238070459638b41e9f 100644 GIT binary patch delta 21 ccmZorY*5@_#mH#1*_zRnm(gN#Bj0~U071b99RL6T delta 21 ccmZorY*5@_#mH#5*_zRnm(gHzBj0~U06~NX6aWAK From 2f374f146537387e415b525782e27d50beae42c8 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 15 Mar 2015 16:44:37 +0100 Subject: [PATCH 032/302] Removed Kanji. --- Marlin/Configuration.h | 2 +- Marlin/dogm_font_data_6x10_marlin_Kanji.h | 192 ---------------------- Marlin/dogm_lcd_implementation.h | 7 +- Marlin/language.h | 1 - Marlin/language_en.h | 2 +- Marlin/language_kanji.h | 152 ----------------- Marlin/language_test.h | 14 +- Marlin/utf_mapper.h | 2 - 8 files changed, 9 insertions(+), 363 deletions(-) delete mode 100644 Marlin/dogm_font_data_6x10_marlin_Kanji.h delete mode 100644 Marlin/language_kanji.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 53f916b31..eb23965a6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -565,7 +565,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, kanji, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/dogm_font_data_6x10_marlin_Kanji.h b/Marlin/dogm_font_data_6x10_marlin_Kanji.h deleted file mode 100644 index bc8dc6b1d..000000000 --- a/Marlin/dogm_font_data_6x10_marlin_Kanji.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - Fontname : Japanese Original font, Version 0.1 - Author : http://www.thingiverse.com/ichibey - License : Creative Commons BY-NC - - 営利目的で利用する際は、かならず許可を得てください。非営利の場合は、CCライセンスに従い使用ください。 - http://creativecommons.org/licenses/by-nc/2.1/jp/legalcode -*/ -#include -const u8g_fntpgm_uint8_t u8g_font_6x10_marlin[2911] U8G_SECTION(".progmem.u8g_font_6x10_marlin") = { - 0,6,10,0,254,7,1,153,3,43,32,255,254,8,254,7, - 254,0,0,0,6,0,8,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,3,3,6,1,4,160,160,160,5,7,7, - 6,0,0,80,80,248,80,248,80,80,5,7,7,6,0,0, - 32,112,160,112,40,112,32,5,7,7,6,0,0,72,168,80, - 32,80,168,144,5,7,7,6,0,0,64,160,160,64,168,144, - 104,1,3,3,6,2,4,128,128,128,3,7,7,6,1,0, - 32,64,128,128,128,64,32,3,7,7,6,1,0,128,64,32, - 32,32,64,128,5,5,5,6,0,1,136,80,248,80,136,5, - 5,5,6,0,1,32,32,248,32,32,3,3,3,6,1,255, - 96,64,128,5,1,1,6,0,3,248,3,3,3,6,1,255, - 64,224,64,5,7,7,6,0,0,8,8,16,32,64,128,128, - 5,7,7,6,0,0,112,152,168,168,168,200,112,5,7,7, - 6,0,0,32,96,32,32,32,32,248,5,7,7,6,0,0, - 112,136,8,112,128,128,248,5,7,7,6,0,0,112,136,8, - 48,8,136,112,5,7,7,6,0,0,112,144,144,144,248,16, - 16,5,7,7,6,0,0,248,128,240,8,8,136,112,5,7, - 7,6,0,0,112,136,128,240,136,136,112,5,7,7,6,0, - 0,248,8,8,16,32,32,32,5,7,7,6,0,0,112,136, - 136,112,136,136,112,5,7,7,6,0,0,112,136,136,120,8, - 136,112,3,7,7,6,1,0,64,224,64,0,64,224,64,3, - 7,7,6,1,0,64,224,64,0,96,64,128,4,7,7,6, - 1,0,16,32,64,128,64,32,16,5,3,3,6,0,2,248, - 0,248,4,7,7,6,1,0,128,64,32,16,32,64,128,5, - 7,7,6,0,0,112,136,16,32,32,0,32,5,7,7,6, - 0,0,112,136,152,168,176,128,112,5,7,7,6,0,0,112, - 136,136,136,248,136,136,5,7,7,6,0,0,240,136,136,240, - 136,136,240,5,7,7,6,0,0,112,136,128,128,128,136,112, - 5,7,7,6,0,0,240,136,136,136,136,136,240,5,7,7, - 6,0,0,248,128,128,240,128,128,248,5,7,7,6,0,0, - 248,128,128,240,128,128,128,5,7,7,6,0,0,112,136,128, - 152,136,136,112,5,7,7,6,0,0,136,136,136,248,136,136, - 136,3,7,7,6,1,0,224,64,64,64,64,64,224,5,7, - 7,6,0,0,56,16,16,16,16,144,96,5,7,7,6,0, - 0,136,144,160,192,160,144,136,5,7,7,6,0,0,128,128, - 128,128,128,128,248,5,7,7,6,0,0,136,136,216,168,136, - 136,136,5,7,7,6,0,0,136,136,200,168,152,136,136,5, - 7,7,6,0,0,112,136,136,136,136,136,112,5,7,7,6, - 0,0,240,136,136,240,128,128,128,5,8,8,6,0,255,112, - 136,136,136,136,168,112,8,5,7,7,6,0,0,240,136,136, - 240,136,136,136,5,7,7,6,0,0,112,136,128,112,8,136, - 112,5,7,7,6,0,0,248,32,32,32,32,32,32,5,7, - 7,6,0,0,136,136,136,136,136,136,112,5,7,7,6,0, - 0,136,136,136,80,80,80,32,5,7,7,6,0,0,136,136, - 136,168,168,216,136,5,7,7,6,0,0,136,136,80,32,80, - 136,136,5,7,7,6,0,0,136,136,80,32,32,32,32,5, - 7,7,6,0,0,248,8,80,32,80,128,248,3,7,7,6, - 1,0,224,128,128,128,128,128,224,5,7,7,6,0,0,128, - 128,64,32,16,8,8,3,7,7,6,1,0,224,32,32,32, - 32,32,224,5,3,3,6,0,4,32,80,136,5,1,1,6, - 0,255,248,2,2,2,6,2,6,128,64,5,5,5,6,0, - 0,112,8,120,136,120,5,7,7,6,0,0,128,128,240,136, - 136,136,240,5,5,5,6,0,0,112,136,128,136,112,5,7, - 7,6,0,0,8,8,120,136,136,136,120,5,5,5,6,0, - 0,112,136,248,128,120,4,7,7,6,0,0,48,64,64,240, - 64,64,64,5,7,7,6,0,254,120,136,136,120,8,8,112, - 5,7,7,6,0,0,128,128,240,136,136,136,136,3,7,7, - 6,1,0,64,0,192,64,64,64,224,4,9,9,6,1,254, - 16,0,48,16,16,16,16,16,224,5,7,7,6,0,0,128, - 128,136,144,224,144,136,3,7,7,6,1,0,192,64,64,64, - 64,64,224,5,5,5,6,0,0,240,168,168,168,168,5,5, - 5,6,0,0,240,136,136,136,136,5,5,5,6,0,0,112, - 136,136,136,112,5,7,7,6,0,254,240,136,136,136,240,128, - 128,5,7,7,6,0,254,120,136,136,136,120,8,8,5,5, - 5,6,0,0,176,200,128,128,128,5,5,5,6,0,0,112, - 128,112,8,240,4,7,7,6,0,0,64,64,240,64,64,64, - 48,5,5,5,6,0,0,136,136,136,136,120,5,5,5,6, - 0,0,136,136,80,80,32,5,5,5,6,0,0,136,136,168, - 168,80,5,5,5,6,0,0,136,80,32,80,136,5,7,7, - 6,0,254,136,136,136,120,8,136,112,5,5,5,6,0,0, - 248,16,32,64,248,6,9,9,6,0,255,240,240,240,128,156, - 136,156,136,136,4,9,9,6,0,255,240,240,240,16,208,144, - 208,144,144,5,9,9,6,0,255,112,112,0,248,0,112,112, - 32,248,5,3,3,6,0,4,72,168,144,4,9,9,6,1, - 255,240,16,32,64,32,32,32,32,64,6,9,9,6,0,255, - 4,228,4,228,0,20,36,36,204,5,9,9,6,0,255,224, - 32,224,224,0,240,208,208,248,6,8,8,6,0,255,60,40, - 60,44,32,76,68,156,4,9,9,6,0,255,128,240,32,240, - 224,0,240,64,176,5,9,9,6,0,255,32,32,248,32,48, - 96,160,160,32,5,9,9,6,0,255,248,168,248,168,248,32, - 32,32,32,6,9,9,6,0,255,112,32,252,112,168,160,32, - 32,32,5,9,9,6,0,255,112,144,80,32,120,136,40,16, - 96,6,9,9,6,0,255,112,0,252,120,120,120,32,120,240, - 5,9,9,6,0,255,32,32,248,168,168,248,32,32,32,6, - 9,9,6,0,255,16,220,40,204,8,236,4,124,4,4,7, - 7,6,0,0,224,128,192,128,224,0,240,6,9,9,6,0, - 255,16,124,16,28,16,252,36,76,28,4,9,9,6,0,255, - 128,224,128,128,128,240,64,32,128,5,9,9,6,0,255,32, - 248,32,248,248,248,32,248,32,5,9,9,6,0,255,32,32, - 32,248,168,248,168,168,248,6,9,9,6,0,255,36,44,36, - 76,228,168,44,44,36,4,9,9,6,0,255,32,240,32,240, - 0,240,80,240,80,5,9,9,6,0,255,112,16,32,248,40, - 48,32,32,96,5,9,9,6,0,255,32,64,248,136,248,136, - 248,136,248,6,9,9,6,0,255,32,116,112,116,112,120,128, - 40,72,4,9,9,6,0,255,128,224,160,160,224,176,0,160, - 144,6,9,9,6,0,255,4,8,16,32,92,132,28,4,60, - 4,8,8,6,0,255,128,64,32,208,0,128,0,224,6,9, - 9,6,0,255,60,32,44,40,44,76,64,136,136,5,9,9, - 6,0,255,248,128,240,16,240,240,128,144,144,5,9,9,6, - 1,255,8,8,8,120,64,120,0,80,144,4,8,8,6,0, - 255,192,0,224,32,224,0,160,144,6,9,9,6,0,255,36, - 252,120,120,172,60,4,20,124,4,8,8,6,0,255,240,160, - 192,48,192,128,0,224,5,9,9,6,0,255,32,248,112,112, - 112,248,168,32,96,5,9,9,6,0,255,248,200,232,200,232, - 136,232,232,152,6,9,9,6,0,255,60,4,60,36,44,36, - 252,32,32,4,9,9,6,0,255,224,0,224,32,160,32,240, - 32,96,5,9,9,6,0,255,112,32,248,32,248,248,248,32, - 32,6,9,9,6,0,255,96,32,32,80,80,144,136,8,4, - 5,9,9,6,1,255,8,248,128,152,0,56,16,16,32,4, - 8,8,6,0,255,240,16,128,0,192,128,144,224,5,7,7, - 6,0,0,248,8,248,8,8,48,192,4,5,5,6,1,0, - 240,16,80,64,128,4,5,5,6,1,0,48,64,160,32,32, - 5,5,5,6,0,0,32,248,136,16,96,5,4,4,6,0, - 0,112,32,32,248,4,5,5,6,1,0,32,240,96,160,160, - 4,5,5,6,1,0,64,240,80,64,64,4,4,4,6,1, - 0,224,32,32,240,4,5,5,6,1,0,240,16,112,16,240, - 5,4,4,6,0,0,168,168,8,112,5,1,1,6,0,3, - 248,5,7,7,6,0,0,248,8,40,48,32,64,128,4,7, - 7,6,0,0,16,48,96,160,32,32,32,5,7,7,6,0, - 0,32,248,136,8,16,16,96,5,6,6,6,0,0,112,32, - 32,32,32,248,5,7,7,6,0,0,16,248,48,80,80,144, - 16,5,7,7,6,0,0,64,248,72,72,72,136,152,5,7, - 7,6,0,0,32,240,32,32,248,32,32,5,7,7,6,0, - 0,120,136,136,8,16,16,96,5,7,7,6,0,0,128,248, - 144,16,16,16,96,4,7,7,6,1,0,240,16,16,16,16, - 16,240,5,7,7,6,0,0,80,248,80,16,16,16,96,5, - 7,7,6,0,0,232,8,232,8,8,16,96,5,7,7,6, - 0,0,248,8,16,32,80,136,136,5,8,8,6,0,0,64, - 64,248,72,72,64,64,56,5,7,7,6,0,0,136,136,72, - 8,16,16,96,5,8,8,6,0,0,128,248,136,136,104,24, - 16,224,5,7,7,6,0,0,120,16,16,248,16,16,224,5, - 7,7,6,0,0,168,168,168,8,16,16,224,5,7,7,6, - 0,0,112,0,248,16,16,16,96,4,7,7,6,1,0,128, - 128,192,160,144,128,128,5,7,7,6,0,0,16,248,16,16, - 32,32,192,5,6,6,6,0,0,112,0,0,0,0,248,5, - 7,7,6,0,0,120,8,8,80,32,80,136,5,8,8,6, - 0,0,32,120,8,48,112,168,168,32,4,6,6,6,1,1, - 16,16,32,32,64,128,5,6,6,6,0,1,32,16,136,136, - 136,8,5,7,7,6,0,0,128,152,224,128,128,128,120,5, - 7,7,6,0,0,248,8,8,8,16,16,96,5,7,7,6, - 0,0,32,32,80,144,136,8,8,5,7,7,6,0,0,32, - 248,32,32,168,168,168,5,7,7,6,0,0,248,8,8,80, - 32,16,8,5,7,7,6,0,0,112,0,96,0,0,240,8, - 5,7,7,6,0,0,32,64,64,128,136,248,8,5,7,7, - 6,0,0,8,8,80,48,40,72,128,5,7,7,6,0,0, - 240,64,64,248,64,64,56,5,7,7,6,0,0,64,248,72, - 72,80,64,64,5,6,6,6,0,0,112,16,16,16,16,248, - 5,7,7,6,0,0,248,8,8,120,8,8,248,5,7,7, - 6,0,0,112,0,248,8,8,16,96,4,7,7,6,1,0, - 144,144,144,16,16,16,96,5,7,7,6,0,0,32,160,160, - 160,168,168,48,5,7,7,6,0,0,128,128,128,136,136,144, - 224,5,7,7,6,0,0,248,136,136,136,136,136,248,5,7, - 7,6,0,0,248,136,136,8,16,16,96,5,6,6,6,0, - 0,200,8,8,8,48,192,5,2,2,6,0,5,144,72,4, - 4,4,6,0,4,96,144,144,96,6,9,9,6,0,254,56, - 68,64,132,136,252,8,8,4,6,7,7,6,0,255,112,136, - 136,148,252,148,136,3,3,3,6,0,1,192,32,224,5,9, - 9,6,0,255,64,248,64,120,72,168,144,168,72,6,9,9, - 6,0,255,56,72,16,248,216,136,252,80,136,4,7,7,6, - 0,255,240,144,144,144,144,240,16,5,9,9,6,0,255,64, - 240,64,240,240,224,80,72,248,5,9,9,6,1,255,120,8, - 248,168,168,56,56,56,8,5,10,10,6,0,254,240,0,248, - 72,72,224,224,224,0,240,6,9,9,6,0,255,28,208,20, - 20,212,20,16,84,212,5,9,9,6,0,255,248,64,240,240, - 240,240,64,80,80,5,9,9,6,1,255,8,8,120,32,192, - 56,8,48,192,4,7,7,6,0,255,224,64,48,192,0,192, - 48,5,9,9,6,1,255,64,72,0,224,32,32,72,64,184, - 4,9,9,6,0,255,160,240,64,240,64,160,16,0,240,5, - 9,9,6,0,255,64,248,32,248,16,112,128,128,120,0,0, - 0,6,0,8,4,9,9,6,1,255,96,0,240,96,96,96, - 240,144,240,5,9,9,6,0,255,240,144,152,0,248,80,32, - 80,136,5,9,9,6,1,255,8,248,128,56,8,8,72,120, - 128,4,8,8,6,0,255,240,16,192,0,192,0,0,240,6, - 6,6,6,0,1,4,224,172,228,160,228,4,9,9,6,0, - 255,128,192,128,240,224,32,160,32,96,6,8,8,6,0,255, - 16,16,16,28,80,80,80,252,5,9,9,6,0,255,64,240, - 200,136,136,136,152,120,16,5,8,8,6,0,0,224,248,136, - 136,136,136,136,248,6,7,7,6,0,0,32,48,56,252,56, - 48,32,6,7,7,6,0,1,16,56,124,16,16,16,240,5, - 9,9,6,0,255,32,112,168,168,184,136,136,112,32,5,10, - 10,6,0,254,224,128,192,128,176,40,40,48,40,40,5,10, - 10,6,0,254,248,168,136,136,136,136,136,136,168,248,255}; diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index ab61751a7..47571c710 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -41,11 +41,11 @@ #include "dogm_font_data_6x9_marlin.h" // Height of 'A' is only 6 pixel. #include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols -#define FONT_STATUSMENU_NAME u8g_font_6x9 // we don't have a small font for Cyrillic, Kana or Kanji +#define FONT_STATUSMENU_NAME u8g_font_6x9 // we don't have a small font for Cyrillic, Kana #define FONT_SPECIAL_NAME Marlin_symbols // save 3120 bytes of PROGMEM by commenting out the next #define -// we don't have a big font for Cyrillic, Kana or Kanji +// we don't have a big font for Cyrillic, Kana #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) #define USE_BIG_EDIT_FONT #endif @@ -60,9 +60,6 @@ #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) #include "dogm_font_data_ISO10646_Kana.h" #define FONT_MENU_NAME ISO10646_Kana_5x7 - #elif defined( DISPLAY_CHARSET_KANJI ) - #include "dogm_font_data_6x10_marlin_Kanji.h" - #define FONT_MENU_NAME u8g_font_6x10_marlin #else // fall-back #include // system font #define FONT_MENU_NAME u8g_font_6x10 diff --git a/Marlin/language.h b/Marlin/language.h index b4c6f3aba..124b7e991 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -30,7 +30,6 @@ // eu Basque-Euskera // kana Japanese // kana_utf Japanese -// kanji Japanese #ifndef LANGUAGE_INCLUDE // pick your language from the list above diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 51c575aae..4bc41600f 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -13,7 +13,7 @@ #endif //#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays -#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA)|| defined(DISPLAY_CHARSET_KANJI) ) +#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA) ) #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #endif diff --git a/Marlin/language_kanji.h b/Marlin/language_kanji.h deleted file mode 100644 index 8c98b6a05..000000000 --- a/Marlin/language_kanji.h +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Japanese (Kanji) - * - * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md - * - */ -#include "Configuration.h" -#ifndef DOGLCD - #include "language_kana.h" // fallback to kana - #define LANGUAGE_KANJI_H -#endif - -#ifndef LANGUAGE_KANJI_H -#define LANGUAGE_KANJI_H - -#define MAPPER_NON -#define DISPLAY_CHARSET_KANJI - -// HINT FOR ichibey; YOU CAN NOW MAKE USE OF THE LAST 8 SYMBOLS FOR YOUT PURPOSE, SINCE THE MARLIN_SYMBOLS NOW HAVE THEIR OWN FONT: - -// 漢字混じり表示 -#define WELCOME_MSG MACHINE_NAME "\x8a\x8b\x90\x91\xa4\xa5\x7f" // "ready." -#define MSG_SD_INSERTED "SD\xb6\xb0\xc4\xde\x20\x84\xa2\xa3\xbb\xda\xcf\xbc\xc0" // "Card inserted" -#define MSG_SD_REMOVED "SD\xb6\xb0\xc4\xde\x20\x84\xe3\xb6\xda\xcf\xbc\xc0" // "Card removed" -#define MSG_MAIN "\xd2\xb2\xdd" // "Main" -#define MSG_AUTOSTART "\x93\x88\xb6\xb6\xb2\xbc" // "Autostart" -#define MSG_DISABLE_STEPPERS "\xd3\xb0\xc0\xb0\xe7\xe8\xe9\xea\x20\xb5\xcc" // "Disable steppers" -#define MSG_AUTO_HOME "\x98\x99\x9a\x9b\xcd \x86\x87\x88\xb6" // "Auto home" -#define MSG_SET_HOME_OFFSETS "\x8c\x8d\x8a\x8b\xb5\xcc\xbe\xaf\xc4\xf1\xf2\xf3\xf4" // "Set home offsets" -#define MSG_SET_ORIGIN "\x8c\x8d\x8a\x8b\xbe\xaf\xc4" // "Set origin" -#define MSG_PREHEAT_PLA "PLA \x92\x94\x95" // "Preheat PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \x96\x97\xc3" // " All" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xcd\xde\xaf\xc4\xde" // "Bed" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xaf\xc3\xb2" // "conf" -#define MSG_PREHEAT_ABS "ABS \x92\x94\x95" // "Preheat ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xbd\xcd\xde\xc3" // " All" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xcd\xde\xaf\xc4\xde" // "Bed" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xaf\xc3\xb2" // "conf" -#define MSG_COOLDOWN "\xb6\xe5\x94\x95\xb2\x9e\xf7" // "Cooldown" -#define MSG_SWITCH_PS_ON "\xe7\xe8\xe9\xea\x20\xb5\xdd" // "Switch power on" -#define MSG_SWITCH_PS_OFF "\xe7\xe8\xe9\xea\x20\xb5\xcc" // "Switch power off" -#define MSG_EXTRUDE "\x84\x85\xbc\xc0\xde\xbc" // "Extrude" -#define MSG_RETRACT "\xd8\xc4\xd7\xb8\xc4" // "Retract" -#define MSG_MOVE_AXIS "\x8e\x8f\x86\x87\x88\xb6" // "Move axis" -#define MSG_MOVE_X "X\x8e\x8f\x86\x87\x88\xb6" // "Move X" -#define MSG_MOVE_Y "Y\x8e\x8f\x86\x87\x88\xb6" // "Move Y" -#define MSG_MOVE_Z "Z\x8e\x8f\x86\x87\x88\xb6" // "Move Z" -#define MSG_MOVE_E "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0" // "Extruder" -#define MSG_MOVE_01MM "0.1mm \x86\x87\x88\xb6" // "Move 0.1mm" -#define MSG_MOVE_1MM " 1mm \x86\x87\x88\xb6" // "Move 1mm" -#define MSG_MOVE_10MM " 10mm \x86\x87\x88\xb6" // "Move 10mm" -#define MSG_SPEED "\xbd\xcb\xdf\xb0\xc4\xde" // "Speed" -#define MSG_NOZZLE "\xc9\xbd\xde\xd9" // "Nozzle" -#define MSG_BED "\xcd\xde\xaf\xc4\xde" // "Bed" -#define MSG_FAN_SPEED "\xcc\xa7\xdd\xed\xe6\x82\x83" // "Fan speed" -#define MSG_FLOW "\xed\xee\xd8\x7d" // "Flow" -#define MSG_CONTROL "\xba\xdd\xc4\xdb\xb0\xd9" // "Control" -#define MSG_MIN LCD_STR_THERMOMETER " Min" -#define MSG_MAX LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP "\x93\x88\xb6\x80\x81\x82\x83" // "Autotemp" -#define MSG_ON "On " -#define MSG_OFF "Off" -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_ACC "\xb6\xe5\xed\xe6\x82\x83" // "Accel" -#define MSG_VXY_JERK "Vxy-jerk" -#define MSG_VZ_JERK "Vz-jerk" -#define MSG_VE_JERK "Ve-jerk" -#define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" -#define MSG_VMIN "Vmin" -#define MSG_VTRAV_MIN "VTrav min" -#define MSG_AMAX "Amax " -#define MSG_A_RETRACT "A-retract" -#define MSG_XSTEPS "Xsteps/mm" -#define MSG_YSTEPS "Ysteps/mm" -#define MSG_ZSTEPS "Zsteps/mm" -#define MSG_ESTEPS "Esteps/mm" -#define MSG_TEMPERATURE "\x80\x81\x82\x83" // "Temperature" -#define MSG_MOTION "\x88\xb6\xef\xf1\xf2\xf3\xf4" // "Motion" -#define MSG_VOLUMETRIC "\xcc\xa8\xd7\xd2\xdd\xc4" // "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" -#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" -#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" -#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" -#define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4" -#define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCD contrast" -#define MSG_STORE_EPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "Store memory" -#define MSG_LOAD_EPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\ba\xd0" // "Load memory" -#define MSG_RESTORE_FAILSAFE "\xf1\xf2\xf3\xf4\xd8\xbe\xaf\xc4" // "Restore failsafe" -#define MSG_REFRESH "\xd8\xcc\xda\xaf\xbc\xad" // "Refresh" -#define MSG_WATCH "\xb2\xdd\xcc\xab" // "Info screen" -#define MSG_PREPARE "\x8a\x8b\x90\x91\xf1\xf2\xf3\xf4" // "Prepare" -#define MSG_TUNE "\xf1\x9f\x9c\x9d" // "Tune" -#define MSG_PAUSE_PRINT "\xb0\xf5\xf6\xb2\x9e\xf7" // "Pause print" -#define MSG_RESUME_PRINT "\xcc\xdf\xd8\xdd\xc4 \xa0\xa1\x7b\x7c" // "Resume print" -#define MSG_STOP_PRINT "\xcc\xdf\xd8\xdd\xc4 \xb2\x9e\xf7" // "Stop print" -#define MSG_CARD_MENU "SD\xb6\xb0\xc4\xde\xb6\xd7\xcc\xdf\xd8\xdd\xc4" // "Print from SD" -#define MSG_NO_CARD "SD\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "No SD card" -#define MSG_DWELL "\xbd\xd8\xb0\xcc\xdf" // "Sleep..." -#define MSG_USERWAIT "\xbc\xca\xde\xd7\xb9\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "Wait for user..." -#define MSG_RESUMING "\xcc\xdf\xd8\xdd\xc4 \xa0\xa1\x7b\x7c" // "Resuming print" -#define MSG_PRINT_ABORTED "\xcc\xdf\xd8\xdd\xc4\xc1\xad\xb3\xbc\xbb\xda\xcf\xbc\xc0" // "Print aborted" -#define MSG_NO_MOVE "\x88\xb6\xb7\xcf\xbe\xdd" // "No move." -#define MSG_KILLED "\xbc\xae\xb3\xb7\xae" // "KILLED. " -#define MSG_STOPPED "\xb2\x9e\xf7\xbc\xcf\xbc\xc0" // "STOPPED. " -#define MSG_CONTROL_RETRACT "Retract mm" -#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" -#define MSG_CONTROL_RETRACTF "Retract V" -#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" -#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" -#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" -#define MSG_AUTORETRACT "AutoRetr." -#define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xeb\xec\x84\xe4" // "Change filament" -#define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\\xa0\xa1\xd6\xd0\xba\xd0" // "Init. SD card" -#define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xeb\xec\x84\xe4" // "Change SD card" -#define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde \xcd\xde\xaf\xc4\xee\xb6\xde\xb2" // "Z probe out. bed" -#define MSG_POSITION_UNKNOWN "\xb9\xde\xdd\xc3\xdd\xcaXY\xb2\xc4\xde\xb3\xba\xdeZ" // "Home X/Y before Z" -#define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Z Offset" -#define MSG_BABYSTEP_X "\xcb\xde\xc4\xde\xb3 X" // "Babystep X" -#define MSG_BABYSTEP_Y "\xcb\xde\xc4\xde\xb3 Y" // "Babystep Y" -#define MSG_BABYSTEP_Z "\xcb\xde\xc4\xde\xb3 Z" // "Babystep Z" -#define MSG_ENDSTOP_ABORT "Endstop abort" - -/* These are from language.h. PLEASE DON'T TRANSLATE! All translatable messages can be found in language_en.h -#define MSG_HEATING "\xb6\xe5\x94\x95\x89..." // "Heating..." -#define MSG_HEATING_COMPLETE "\xb6\xe5\x94\x95\xa4\xa5\x7f" // "Heating done." -#define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\xb6\xe5\x94\x95\x89" // "Bed Heating." -#define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\xb6\xe5\x94\x95\xa4\xa5\x7f" // "Bed done." -#define MSG_ENDSTOPS_HIT "endstops hit: " - ^ typho -*/ - -#ifdef DELTA_CALIBRATION_MENU - #define MSG_DELTA_CALIBRATE "Delta Calibration" - #define MSG_DELTA_CALIBRATE_X "Calibrate X" - #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" - #define MSG_DELTA_CALIBRATE_Z "Calibrate Z" - #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" -#endif // DELTA_CALIBRATION_MENU - -#endif // LANGUAGE_JP2_H diff --git a/Marlin/language_test.h b/Marlin/language_test.h index ba6f7e523..da79d4f1b 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -23,7 +23,7 @@ // I hope the pages E282 and E283 are sufficient to write katakana. // Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not // impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). -// d.) So for Kanji we use a very special and selected subset of symbols and the direct mapping like in a). + #define MAPPER_NON // For direct asci codes ( until now all languages except ru, de, fi, kana_utf8, ... ) //#define MAPPER_C2C3 // For most European languages when language file is in utf8 @@ -37,7 +37,7 @@ //#define DISPLAY_CHARSET_ISO10646_1 //#define DISPLAY_CHARSET_ISO10646_5 //#define DISPLAY_CHARSET_ISO10646_KANA -//#define DISPLAY_CHARSET_KANJI + // next 5 lines select variants in this file only @@ -45,7 +45,7 @@ //#define WEST //#define CYRIL //#define KANA -//#define KANJI + // TESTSTRINGS @@ -178,15 +178,11 @@ #endif -#if defined( KANA ) || defined (KANJI) +#if defined( KANA ) #define WELCOME_MSG "Language TEST" #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #ifdef KANJI - #define MSG_PREPARE "No UTF8 for Kanji" - #else - #define MSG_PREPARE "UTF8" - #endif + #define MSG_PREPARE "UTF8" #define MSG_CONTROL "ASCII" //#define MSG_MAIN ".." diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index f04f1f87c..5a0ba2f43 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -16,8 +16,6 @@ #define MAPPER_ONE_TO_ONE #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) #define MAPPER_ONE_TO_ONE - #elif defined( DISPLAY_CHARSET_KANJI ) - #define MAPPER_NON #endif #else // SIMULATE_ROMFONT #if defined( DISPLAY_CHARSET_HD44780_JAPAN ) From 14f02508535815c45219e5e64da337acc0dbacfc Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Mon, 16 Mar 2015 14:26:59 +0100 Subject: [PATCH 033/302] allow negative values and some more comments --- Marlin/scripts/g29_auto.py | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/Marlin/scripts/g29_auto.py b/Marlin/scripts/g29_auto.py index d5f2a1c6e..c28352b29 100644 --- a/Marlin/scripts/g29_auto.py +++ b/Marlin/scripts/g29_auto.py @@ -12,15 +12,18 @@ my_file = 'test.gcode' # this is the minimum of G1 instructions which should be between 2 different heights min_g1 = 3 -# maximum number of lines to parse, I don't want to parse the complete file +# maximum number of lines to parse, I don't want to parse the complete file # only the first plane is we are interested in max_g1 = 1000 # g29 keyword -g29_keyword = ';MarlinG29Script' +g29_keyword = 'g29' +g29_keyword = g29_keyword.upper() # output filename output_file = folder + 'g29_' + my_file +# input filename +input_file = folder + my_file # offset makes the plane a little bit bigger offset_x = 10 @@ -40,10 +43,12 @@ lines_of_g1 = 0 gcode = [] +# return only g1-lines def has_g1(line): return line[:2].upper() == "G1" +# find position in g1 (x,y,z) def find_axis(line, axis): found = False number = "" @@ -51,6 +56,8 @@ def find_axis(line, axis): if found: if char == ".": number += char + elif char == "-": + number += char else: try: int(char) @@ -65,6 +72,7 @@ def find_axis(line, axis): return None +# save the min or max-values for each axis def set_mima(line): global min_x, max_x, min_y, max_y, last_z @@ -81,6 +89,7 @@ def set_mima(line): return min_x, max_x, min_y, max_y +# find z in the code and return it def find_z(gcode, start_at_line=0): for i in range(start_at_line, len(gcode)): my_z = find_axis(gcode[i], 'Z') @@ -104,27 +113,30 @@ def z_parse(gcode, start_at_line=0, end_at_line=0): all_z.append(z) z_at_line.append(i) + temp_line = i - last_i -1 line_between_z.append(i - last_i - 1) # last_z = z last_i = i - if 0 < end_at_line <= i: + if 0 < end_at_line <= i or temp_line >= min_g1: + # print('break at line {} at heigth {}'.format(i, z)) break - # print('{}:{}'.format(last_z, last_i)) line_between_z = line_between_z[1:] return all_z, line_between_z, z_at_line +# get the lines which should be the first layer def get_lines(gcode, minimum): i = 0 all_z, line_between_z, z_at_line = z_parse(gcode, end_at_line=max_g1) for count in line_between_z: i += 1 if count > minimum: + # print('layer: {}:{}'.format(z_at_line[i-1], z_at_line[i])) return z_at_line[i - 1], z_at_line[i] -with open(folder+my_file, 'r') as file: +with open(input_file, 'r') as file: lines = 0 for line in file: lines += 1 @@ -138,6 +150,8 @@ start, end = get_lines(gcode, min_g1) for i in range(start, end): set_mima(gcode[i]) +print('x_min:{} x_max:{}\ny_min:{} y_max:{}'.format(min_x, max_x, min_y, max_y)) + min_x = int(min_x) - offset_x max_x = int(max_x) + offset_x min_y = int(min_y) - offset_y @@ -149,18 +163,17 @@ new_command = 'G29 L{0} R{1} F{2} B{3} P{4}\n'.format(min_x, max_y, probing_points) - out_file = open(output_file, 'w') -print('out_file open') -input_file = open(my_file, 'r') -print('input_file open') +in_file = open(input_file, 'r') -for line in input_file: - if line[:len(g29_keyword)] == g29_keyword: +for line in in_file: + if line[:len(g29_keyword)].upper() == g29_keyword: out_file.write(new_command) - print('write new_command') + print('write G29') else: out_file.write(line) file.close() out_file.close() + +print('auto G29 finished') From 752c8046773ef326434f63ea7c9f3392fd0a8425 Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Mon, 16 Mar 2015 15:13:16 +0100 Subject: [PATCH 034/302] remove offset, add minimum scan area --- Marlin/scripts/g29_auto.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Marlin/scripts/g29_auto.py b/Marlin/scripts/g29_auto.py index c28352b29..884e62b2a 100644 --- a/Marlin/scripts/g29_auto.py +++ b/Marlin/scripts/g29_auto.py @@ -14,7 +14,7 @@ min_g1 = 3 # maximum number of lines to parse, I don't want to parse the complete file # only the first plane is we are interested in -max_g1 = 1000 +max_g1 = 100000000 # g29 keyword g29_keyword = 'g29' @@ -25,9 +25,8 @@ output_file = folder + 'g29_' + my_file # input filename input_file = folder + my_file -# offset makes the plane a little bit bigger -offset_x = 10 -offset_y = 10 +# minimum scan size +min_size = 40 probing_points = 3 # points x points # other stuff @@ -152,10 +151,18 @@ for i in range(start, end): print('x_min:{} x_max:{}\ny_min:{} y_max:{}'.format(min_x, max_x, min_y, max_y)) -min_x = int(min_x) - offset_x -max_x = int(max_x) + offset_x -min_y = int(min_y) - offset_y -max_y = int(max_y) + offset_y +# resize min/max - values for minimum scan +if max_x - min_x < min_size: + offset_x = int((min_size - (max_x - min_x)) / 2 + 0.5) # int round up + # print('min_x! with {}'.format(int(max_x - min_x))) + min_x = int(min_x) - offset_x + max_x = int(max_x) + offset_x +if max_y - min_y < min_size: + offset_y = int((min_size - (max_y - min_y)) / 2 + 0.5) # int round up + # print('min_y! with {}'.format(int(max_y - min_y))) + min_y = int(min_y) - offset_y + max_y = int(max_y) + offset_y + new_command = 'G29 L{0} R{1} F{2} B{3} P{4}\n'.format(min_x, max_x, From 08e4651ecedb0081e7af7b081e6d7b8e8f7f77ae Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 16 Mar 2015 16:59:14 +0100 Subject: [PATCH 035/302] Corrected cyrillic font again Thank you @Nprod. --- Marlin/dogm_font_data_ISO10646_5_Cyrillic.h | 4 ++-- Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon | Bin 4224 -> 4224 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h index 9c93fc8c5..b44936cef 100644 --- a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h +++ b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h @@ -1,5 +1,5 @@ /* - Fontname: ISO10646_5_Cyrillic v1.2 + Fontname: ISO10646_5_Cyrillic Copyright: A. Hardtung, public domain Capital A Height: 7, '1' Height: 7 Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 @@ -138,7 +138,7 @@ const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2560] U8G_SECTION(".progmem.ISO 120,136,136,120,40,72,136,5,5,5,6,0,0,112,8,120, 136,120,5,7,7,6,0,0,24,96,128,240,136,136,112,4, 5,5,6,0,0,224,144,224,144,224,5,5,5,6,0,0, - 248,136,128,128,128,5,6,6,6,0,0,120,40,72,136,248, + 248,136,128,128,128,5,6,6,6,0,255,120,40,72,136,248, 136,5,5,5,6,0,0,112,136,248,128,112,5,5,5,6, 0,0,168,168,112,168,168,5,5,5,6,0,0,240,8,48, 8,240,5,5,5,6,0,0,136,152,168,200,136,5,7,7, diff --git a/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon b/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon index bb13545ba81d4580e41adc238070459638b41e9f..f52970cbc7712b5ee871c78a93d4575fd77cf827 100644 GIT binary patch delta 27 icmZorY*5@_#mH#9*_yGFmz|+P!=vLz$L7;~TNwdztO+0h delta 27 icmZorY*5@_#mH#1*_yGFm%T#6qvJ;h!{*a`TNwd$i3uM7 From 7e69f72db661ec4a50ed911e3a8b0ae3feb00bcf Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 16 Mar 2015 17:27:27 +0100 Subject: [PATCH 036/302] Moved font directory. Updated README.fonts --- Marlin/{scripts/Fonts => fonts}/HD44780_C.fon | Bin Marlin/{scripts/Fonts => fonts}/HD44780_J.fon | Bin Marlin/{scripts/Fonts => fonts}/HD44780_W.fon | Bin .../Fonts => fonts}/ISO10646-5_Cyrillic.fon | Bin Marlin/{scripts/Fonts => fonts}/ISO10646_Kana.fon | Bin Marlin/{scripts/Fonts => fonts}/Marlin_symbols.fon | Bin Marlin/{scripts/Fonts => fonts}/README.fonts | 2 +- Marlin/{scripts/Fonts => fonts}/bdf2u8g.exe | Bin Marlin/{scripts/Fonts => fonts}/make_fonts.bat | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename Marlin/{scripts/Fonts => fonts}/HD44780_C.fon (100%) rename Marlin/{scripts/Fonts => fonts}/HD44780_J.fon (100%) rename Marlin/{scripts/Fonts => fonts}/HD44780_W.fon (100%) rename Marlin/{scripts/Fonts => fonts}/ISO10646-5_Cyrillic.fon (100%) rename Marlin/{scripts/Fonts => fonts}/ISO10646_Kana.fon (100%) rename Marlin/{scripts/Fonts => fonts}/Marlin_symbols.fon (100%) rename Marlin/{scripts/Fonts => fonts}/README.fonts (78%) rename Marlin/{scripts/Fonts => fonts}/bdf2u8g.exe (100%) rename Marlin/{scripts/Fonts => fonts}/make_fonts.bat (100%) diff --git a/Marlin/scripts/Fonts/HD44780_C.fon b/Marlin/fonts/HD44780_C.fon similarity index 100% rename from Marlin/scripts/Fonts/HD44780_C.fon rename to Marlin/fonts/HD44780_C.fon diff --git a/Marlin/scripts/Fonts/HD44780_J.fon b/Marlin/fonts/HD44780_J.fon similarity index 100% rename from Marlin/scripts/Fonts/HD44780_J.fon rename to Marlin/fonts/HD44780_J.fon diff --git a/Marlin/scripts/Fonts/HD44780_W.fon b/Marlin/fonts/HD44780_W.fon similarity index 100% rename from Marlin/scripts/Fonts/HD44780_W.fon rename to Marlin/fonts/HD44780_W.fon diff --git a/Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon b/Marlin/fonts/ISO10646-5_Cyrillic.fon similarity index 100% rename from Marlin/scripts/Fonts/ISO10646-5_Cyrillic.fon rename to Marlin/fonts/ISO10646-5_Cyrillic.fon diff --git a/Marlin/scripts/Fonts/ISO10646_Kana.fon b/Marlin/fonts/ISO10646_Kana.fon similarity index 100% rename from Marlin/scripts/Fonts/ISO10646_Kana.fon rename to Marlin/fonts/ISO10646_Kana.fon diff --git a/Marlin/scripts/Fonts/Marlin_symbols.fon b/Marlin/fonts/Marlin_symbols.fon similarity index 100% rename from Marlin/scripts/Fonts/Marlin_symbols.fon rename to Marlin/fonts/Marlin_symbols.fon diff --git a/Marlin/scripts/Fonts/README.fonts b/Marlin/fonts/README.fonts similarity index 78% rename from Marlin/scripts/Fonts/README.fonts rename to Marlin/fonts/README.fonts index 976cdb749..0bfc9e988 100644 --- a/Marlin/scripts/Fonts/README.fonts +++ b/Marlin/fonts/README.fonts @@ -1,6 +1,6 @@ The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack off experience). In Fony export the fonts to bdf-format. Maybe another one can edit them with Fontforge. Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to produce the .h files. -The .h files must be edited to replace '#include "u8g.h"' with '#include ' and moved to the main directory. +The .h files must be edited to replace '#include "u8g.h"' with '#include ', replace 'U8G_FONT_SECTION' with 'U8G_SECTION', inset '.progmem.' right behind the first '"' and moved to the main directory. Especially the Kana and Cyrillic fonts should be revised by someone who knows what he/she does. I am only a west-European with very little knowledge about this scripts. diff --git a/Marlin/scripts/Fonts/bdf2u8g.exe b/Marlin/fonts/bdf2u8g.exe similarity index 100% rename from Marlin/scripts/Fonts/bdf2u8g.exe rename to Marlin/fonts/bdf2u8g.exe diff --git a/Marlin/scripts/Fonts/make_fonts.bat b/Marlin/fonts/make_fonts.bat similarity index 100% rename from Marlin/scripts/Fonts/make_fonts.bat rename to Marlin/fonts/make_fonts.bat From 8a29dd4839fde0c81cef420c908bf47506c51006 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 16 Mar 2015 20:18:48 +0100 Subject: [PATCH 037/302] Cleaned typo in dogm_lcd_implementation.h --- Marlin/dogm_lcd_implementation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index ca9a63170..c13c2d32e 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -34,7 +34,7 @@ #include "DOGMbitmaps.h" #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" -#include "configuration.h" +#include "Configuration.h" #include From 1883e1bb602ad054b2dfeb5ae0d65b278ad8475c Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 17 Mar 2015 11:23:44 +0100 Subject: [PATCH 038/302] Applied thinkyheads corrections from 2015-03-17 --- Marlin/Configuration.h | 4 +-- Marlin/dogm_lcd_implementation.h | 4 +-- Marlin/language.h | 4 +-- Marlin/language_an.h | 2 +- Marlin/language_ca.h | 2 +- Marlin/language_de.h | 2 +- Marlin/language_es.h | 2 +- Marlin/language_eu.h | 2 +- Marlin/language_fi.h | 2 +- Marlin/language_fr.h | 2 +- Marlin/language_it.h | 2 +- Marlin/language_kana.h | 2 +- Marlin/language_kana_utf8.h | 2 +- Marlin/language_nl.h | 2 +- Marlin/language_pl.h | 2 +- Marlin/language_pt-br.h | 2 +- Marlin/language_pt.h | 2 +- Marlin/language_ru.h | 2 +- Marlin/language_test.h | 2 +- Marlin/utf_mapper.h | 44 ++++++++++++++++---------------- 20 files changed, 43 insertions(+), 45 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 87102f79a..1a432f1cc 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -558,10 +558,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display this information is not important. // To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. -// Se also documentation/LCDLanguageFont.md +// See also documentation/LCDLanguageFont.md #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware //#define DISPLAY_CHARSET_HD44780_WESTERN - //#define DISPLAY_CHARSET_HD44780_CYRILIC + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index c13c2d32e..f92696ac8 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -14,8 +14,6 @@ #ifndef DOGM_LCD_IMPLEMENTATION_H #define DOGM_LCD_IMPLEMENTATION_H -#define MARLIN_VERSION "1.0.2" - /** * Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays. */ @@ -71,7 +69,7 @@ #elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) #include "dogm_font_data_HD44780_W.h" #define FONT_MENU_NAME HD44780_W_5x7 - #elif defined( DISPLAY_CHARSET_HD44780_CYRILIC ) + #elif defined( DISPLAY_CHARSET_HD44780_CYRILLIC ) #include "dogm_font_data_HD44780_C.h" #define FONT_MENU_NAME HD44780_C_5x7 #else // fall-back diff --git a/Marlin/language.h b/Marlin/language.h index 505581496..559e33571 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -11,7 +11,7 @@ // // ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" // ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS -// Se also documentation/LCDLanguageFont.md +// See also documentation/LCDLanguageFont.md // Languages // en English @@ -203,7 +203,7 @@ // LCD Menu Messages -#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILIC )) +#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC )) #define DISPLAY_CHARSET_HD44780_JAPAN #endif diff --git a/Marlin/language_an.h b/Marlin/language_an.h index aef304075..b8e83d3b3 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -2,7 +2,7 @@ * Aragonese * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_AN_H diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 8f00f8b7d..f25fe5789 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -2,7 +2,7 @@ * Catalan * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_CA_H diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 2487ba93a..0f7b832a5 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -2,7 +2,7 @@ * German * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_DE_H diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 1602c3c1c..143a1f457 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -2,7 +2,7 @@ * Spanish * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_ES_H diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 9bce0a7c1..21cb733a1 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -2,7 +2,7 @@ * Basque-Euskera * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_EU_H diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 711f09639..e1bfbf1af 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -2,7 +2,7 @@ * Finnish * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_FI_H diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 7e1194d7b..ed65efdbd 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -2,7 +2,7 @@ * French * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_FR_H diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 5b2709faf..7fbcb46ac 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -2,7 +2,7 @@ * Italian * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_IT_H diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 5810fa11d..272440bac 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -2,7 +2,7 @@ * Japanese (Kana) * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index d08c18833..94ce69bc4 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -2,7 +2,7 @@ * Japanese (Kana UTF8 version) * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 81eef72bb..bc44dcc7e 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -2,7 +2,7 @@ * Dutch * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_NL_H diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 2d5643024..f654594bc 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -2,7 +2,7 @@ * Polish * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_PL_H diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 734272a29..060f3ba89 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -2,7 +2,7 @@ * Portuguese (Brazil) * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_PT_BR_H diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 08274e112..9d3ff2654 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -2,7 +2,7 @@ * Portuguese * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_PT_H diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 3e3359855..b961be7ee 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -2,7 +2,7 @@ * Russian * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_RU_H diff --git a/Marlin/language_test.h b/Marlin/language_test.h index da79d4f1b..57505bc13 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -2,7 +2,7 @@ * TEST * * LCD Menu Messages - * Se also documentation/LCDLanguageFont.md + * See also documentation/LCDLanguageFont.md * */ #ifndef LANGUAGE_TEST_H diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index 5a0ba2f43..69e2e5da5 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -4,9 +4,9 @@ #include "language.h" #ifdef DOGLCD - #define HARDWAERE_CHAR_OUT u8g.print + #define HARDWARE_CHAR_OUT u8g.print #else - #define HARDWAERE_CHAR_OUT lcd.write + #define HARDWARE_CHAR_OUT lcd.write #endif #if !(defined( SIMULATE_ROMFONT )) && defined( DOGLCD ) @@ -90,7 +90,7 @@ #error( "Katakana on a western display makes no sense. There are no matching symbols." ); #endif - #elif defined( DISPLAY_CHARSET_HD44780_CYRILIC ) + #elif defined( DISPLAY_CHARSET_HD44780_CYRILLIC ) #if defined( MAPPER_D0D1 ) #define MAPPER_D0D1_MOD // it is a Russian alphabet translation @@ -120,12 +120,12 @@ #endif #else #error("Something went wrong in the selection of DISPLAY_CHARSET_HD44780's"); - #endif // DISPLAY_CHARSET_HD44780_CYRILIC + #endif // DISPLAY_CHARSET_HD44780_CYRILLIC #endif // SIMULATE_ROMFONT #if defined( MAPPER_NON ) char charset_mapper(char c){ - HARDWAERE_CHAR_OUT( c ); + HARDWARE_CHAR_OUT( c ); return 1; } #elif defined( MAPPER_C2C3 ) @@ -142,17 +142,17 @@ else if (seen_c2){ d &= 0x3f; #ifndef MAPPER_ONE_TO_ONE - HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); + HARDWARE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); #else - HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; + HARDWARE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d) ) ; #endif } else { - HARDWAERE_CHAR_OUT('?'); + HARDWARE_CHAR_OUT('?'); } } else { - HARDWAERE_CHAR_OUT((char) c ); + HARDWARE_CHAR_OUT((char) c ); } seen_c2 = false; return 1; @@ -172,18 +172,18 @@ } else if (seen_d5) { d &= 0x3f; if ( !utf_hi_char && ( d == 1 )) { - HARDWAERE_CHAR_OUT((char) 0xa2 ); // Ё + HARDWARE_CHAR_OUT((char) 0xa2 ); // Ё } else if ((utf_hi_char == 1) && (d == 0x11)) { - HARDWAERE_CHAR_OUT((char) 0xb5 ); // ё + HARDWARE_CHAR_OUT((char) 0xb5 ); // ё } else { - HARDWAERE_CHAR_OUT((char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x10 ) ); + HARDWARE_CHAR_OUT((char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x10 ) ); } } else { - HARDWAERE_CHAR_OUT('?'); + HARDWARE_CHAR_OUT('?'); } } else { - HARDWAERE_CHAR_OUT((char) c ); + HARDWARE_CHAR_OUT((char) c ); } seen_d5 = false; return 1; @@ -201,15 +201,15 @@ } else if (seen_d5) { d &= 0x3fu; #ifndef MAPPER_ONE_TO_ONE - HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); + HARDWARE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); #else - HARDWAERE_CHAR_OUT( (char) (0xa0u + ( utf_hi_char << 6 ) + d ) ) ; + HARDWARE_CHAR_OUT( (char) (0xa0u + ( utf_hi_char << 6 ) + d ) ) ; #endif } else { - HARDWAERE_CHAR_OUT('?'); + HARDWARE_CHAR_OUT('?'); } } else { - HARDWAERE_CHAR_OUT((char) c ); + HARDWARE_CHAR_OUT((char) c ); } seen_d5 = false; return 1; @@ -231,15 +231,15 @@ } else if ((seen_e3 == true) && (seen_82_83 == true)){ d &= 0x3f; #ifndef MAPPER_ONE_TO_ONE - HARDWAERE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); + HARDWARE_CHAR_OUT( (char) pgm_read_byte_near( utf_recode + d + ( utf_hi_char << 6 ) - 0x20 ) ); #else - HARDWAERE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d ) ) ; + HARDWARE_CHAR_OUT( (char) (0x80 + ( utf_hi_char << 6 ) + d ) ) ; #endif } else { - HARDWAERE_CHAR_OUT((char) '?' ); + HARDWARE_CHAR_OUT((char) '?' ); } } else { - HARDWAERE_CHAR_OUT((char) c ); + HARDWARE_CHAR_OUT((char) c ); } seen_e3 = false; seen_82_83 = false; From eff6a2bd2e558fae617f1f27c9115e1586b54667 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 19 Mar 2015 12:58:43 +0100 Subject: [PATCH 039/302] Clean out a warning in ultralcd_implementation_hitachi_HD44780.h lcd_print( about array index. --- Marlin/ultralcd_implementation_hitachi_HD44780.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 507b747b0..8ac0fac59 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -414,7 +414,7 @@ char lcd_printPGM(const char* str) { char lcd_print(char* str) { char c; - char i = 0; + unsigned char i = 0; char n = 0; while((c = str[i++])) { n += charset_mapper(c); From 8c5bb3874871e1baf4efd5ce141c113053a36dc9 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 20 Mar 2015 14:12:12 +0100 Subject: [PATCH 040/302] Removed now unneded FONT_STATUSMENU --- Marlin/dogm_lcd_implementation.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index cd0e09a17..4abf67aa0 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -74,12 +74,9 @@ #endif #endif // SIMULATE_ROMFONT -#define FONT_STATUSMENU_NAME FONT_MENU_NAME - -#define FONT_STATUSMENU 1 +#define FONT_MENU 1 #define FONT_SPECIAL 2 #define FONT_MENU_EDIT 3 -#define FONT_MENU 4 // DOGM parameters (size in pixels) #define DOG_CHAR_WIDTH 6 @@ -137,7 +134,6 @@ char currentfont = 0; static void lcd_setFont(char font_nr) { switch(font_nr) { - case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break; case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break; case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break; case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break; @@ -227,7 +223,7 @@ static void _draw_heater_status(int x, int heater) { bool isBed = heater < 0; int y = 17 + (isBed ? 1 : 0); - lcd_setFont(FONT_STATUSMENU); + lcd_setFont(FONT_MENU); u8g.setPrintPos(x,7); lcd_print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5))); lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); @@ -252,7 +248,8 @@ static void lcd_implementation_status_screen() { // Symbols menu graphics, animated fan u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp); - + lcd_setFont(FONT_MENU); + #ifdef SDSUPPORT // SD Card Symbol u8g.drawBox(42,42,8,7); @@ -264,8 +261,6 @@ static void lcd_implementation_status_screen() { u8g.drawFrame(54,49,73,4); // SD Card Progress bar and clock - lcd_setFont(FONT_STATUSMENU); - if (IS_SD_PRINTING) { // Progress bar solid part u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2); @@ -290,7 +285,6 @@ static void lcd_implementation_status_screen() { if (EXTRUDERS < 4) _draw_heater_status(81, -1); // Fan - lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(104,27); #if defined(FAN_PIN) && FAN_PIN > -1 int per = ((fanSpeed + 1) * 100) / 256; @@ -307,7 +301,6 @@ static void lcd_implementation_status_screen() { // X, Y, Z-Coordinates #define XYZ_BASELINE 38 - u8g.setFont(FONT_STATUSMENU); u8g.drawBox(0,30,128,9); u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); @@ -331,16 +324,13 @@ static void lcd_implementation_status_screen() { u8g.setColorIndex(1); // black on white // Feedrate - lcd_setFont(FONT_MENU); u8g.setPrintPos(3,49); lcd_print(LCD_STR_FEEDRATE[0]); - u8g.setFont(FONT_STATUSMENU); u8g.setPrintPos(12,49); lcd_print(itostr3(feedmultiply)); lcd_print('%'); // Status line - u8g.setFont(FONT_STATUSMENU); u8g.setPrintPos(0,63); #ifndef FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); From b00a531df806f089b3fda18a70d226f71cc47a24 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 24 Mar 2015 17:01:56 +0100 Subject: [PATCH 041/302] Revert "Removed now unneded FONT_STATUSMENU" This reverts commit 8c5bb3874871e1baf4efd5ce141c113053a36dc9. --- Marlin/dogm_lcd_implementation.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 4abf67aa0..cd0e09a17 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -74,9 +74,12 @@ #endif #endif // SIMULATE_ROMFONT -#define FONT_MENU 1 +#define FONT_STATUSMENU_NAME FONT_MENU_NAME + +#define FONT_STATUSMENU 1 #define FONT_SPECIAL 2 #define FONT_MENU_EDIT 3 +#define FONT_MENU 4 // DOGM parameters (size in pixels) #define DOG_CHAR_WIDTH 6 @@ -134,6 +137,7 @@ char currentfont = 0; static void lcd_setFont(char font_nr) { switch(font_nr) { + case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break; case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break; case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break; case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break; @@ -223,7 +227,7 @@ static void _draw_heater_status(int x, int heater) { bool isBed = heater < 0; int y = 17 + (isBed ? 1 : 0); - lcd_setFont(FONT_MENU); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(x,7); lcd_print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5))); lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); @@ -248,8 +252,7 @@ static void lcd_implementation_status_screen() { // Symbols menu graphics, animated fan u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp); - lcd_setFont(FONT_MENU); - + #ifdef SDSUPPORT // SD Card Symbol u8g.drawBox(42,42,8,7); @@ -261,6 +264,8 @@ static void lcd_implementation_status_screen() { u8g.drawFrame(54,49,73,4); // SD Card Progress bar and clock + lcd_setFont(FONT_STATUSMENU); + if (IS_SD_PRINTING) { // Progress bar solid part u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2); @@ -285,6 +290,7 @@ static void lcd_implementation_status_screen() { if (EXTRUDERS < 4) _draw_heater_status(81, -1); // Fan + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(104,27); #if defined(FAN_PIN) && FAN_PIN > -1 int per = ((fanSpeed + 1) * 100) / 256; @@ -301,6 +307,7 @@ static void lcd_implementation_status_screen() { // X, Y, Z-Coordinates #define XYZ_BASELINE 38 + u8g.setFont(FONT_STATUSMENU); u8g.drawBox(0,30,128,9); u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); @@ -324,13 +331,16 @@ static void lcd_implementation_status_screen() { u8g.setColorIndex(1); // black on white // Feedrate + lcd_setFont(FONT_MENU); u8g.setPrintPos(3,49); lcd_print(LCD_STR_FEEDRATE[0]); + u8g.setFont(FONT_STATUSMENU); u8g.setPrintPos(12,49); lcd_print(itostr3(feedmultiply)); lcd_print('%'); // Status line + u8g.setFont(FONT_STATUSMENU); u8g.setPrintPos(0,63); #ifndef FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); From c686069ccd24d29d12768b655fa7c44dc96289ac Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 16 Mar 2015 11:18:27 +0100 Subject: [PATCH 042/302] Revert "Remove 6x9 font" This reverts commit e6cb8ee1884db31d0a4034ded7f26e928e7b8a22. Conflicts: Marlin/dogm_lcd_implementation.h Confilkt solved Needs rework. --- Marlin/dogm_lcd_implementation.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index cd0e09a17..812c290f0 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -43,6 +43,8 @@ #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) #define USE_BIG_EDIT_FONT #endif +#define FONT_STATUSMENU u8g_font_6x9 +#define FONT_MENU u8g_font_6x10_marlin #ifndef SIMULATE_ROMFONT #if defined( DISPLAY_CHARSET_ISO10646_1 ) @@ -233,6 +235,7 @@ static void _draw_heater_status(int x, int heater) { lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); u8g.setPrintPos(x,28); lcd_print(itostr3(int(heater >= 0 ? degHotend(heater) : degBed()) + 0.5)); + lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); if (!isHeatingHotend(0)) { u8g.drawBox(x+7,y,2,2); From 4beffbca691dd2159035f1dad40d0180be62d731 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 24 Mar 2015 23:40:04 +0100 Subject: [PATCH 043/302] Make SMALL_INFOFONT configurable. Tweak the documentation --- Documentation/LCDLanguageFont.md | 14 ++++++------ Marlin/dogm_lcd_implementation.h | 39 +++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index 2d6b9cbf7..a1acfb63f 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -1,13 +1,13 @@ # LCD Language Font System We deal with a variety of different displays. -And we try to display a lot of different languages on them. +And we try to display a lot of different languages in different scripts on them. This system is ought to solve some of the related problems. ## The Displays We have two different technologies for the displays: -* Character based displays +* Character based displays: Have a fixed set of symbols (charset - font) in their ROM. All of them have a similar but not identical symbol set at the positions 0 to 127 similar to US-ASCII. On the other hand symbols at places higher than 127 have mayor differences. @@ -21,13 +21,13 @@ We have two different technologies for the displays: At all of them you can define 8 different symbols by yourself. In Marlin they are used for the Feedrate-, Thermometer-, ... symbols -* Full graphic displays +* Full graphic displays: Where we have the full freedom to display whatever we want, when we can make a program for it. Currently we deal with 128x64 Pixel Displays and divide this area in about 5 Lines with about 22 columns. Therefore we need fonts with a bounding box of about 6x10. Until now we used a * 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. - * 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. + * 2.) Because these letters where to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9.(3200 byte) * 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. ## The Languages @@ -55,7 +55,7 @@ We have two different technologies for the displays: ## The Problem All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '³') - And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of what the programmer wanted.) + And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is true only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of what the programmer wanted.) The Germans want to use "ÄäÖöÜüß" the Finnish at least "äö". Other European languages want to see their accents on their letters. For other scripts like Cyrillic, Japanese, Greek, Hebrew, ... you have to find totally different symbol sets. @@ -126,7 +126,7 @@ We have two different technologies for the displays: * h.) If you want to integrate an entirely new variant of a Hitachi based display. Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. - The length of the strings is limited. '17 chars' a was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. + The length of the strings is limited. '17 chars' was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. On the 16x2 displays the strings are cut at the end to fit on the display. So it's a good idea to make them differ early. ('Somverylongoptionname x' -> 'x Somverylongoptionname') @@ -134,7 +134,7 @@ We have two different technologies for the displays: ## User Instructions Define your hardware and the wanted language in 'Configuration.h'. - To find out what charset your hardware is define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. + To find out what charset your hardware is, define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. * DISPLAY_CHARSET_HD44780_JAPAN locks like "バパヒビピフブプヘベペホボポマミ" * DISPLAY_CHARSET_HD44780_WESTERN locks like "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" * DISPLAY_CHARSET_HD44780_CYRILIC locks like "РСТУФХЦЧШЩЪЫЬЭЮЯ" diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 812c290f0..205b69589 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -35,16 +35,24 @@ #include "ultralcd_st7920_u8glib_rrd.h" #include "Configuration.h" -#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols -#define FONT_SPECIAL_NAME Marlin_symbols - // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) - #define USE_BIG_EDIT_FONT +// #define USE_BIG_EDIT_FONT #endif -#define FONT_STATUSMENU u8g_font_6x9 -#define FONT_MENU u8g_font_6x10_marlin + +// If you have spare 2300Byte of progmem and want to use a +// smaller font on the Info-screen uncomment the next line. +//#define USE_SMALL_INFOFONT +#ifdef USE_SMALL_INFOFONT + #include "dogm_font_data_6x9_marlin.h" + #define FONT_STATUSMENU_NAME u8g_font_6x9 +#else + #define FONT_STATUSMENU_NAME FONT_MENU_NAME +#endif + +#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols +#define FONT_SPECIAL_NAME Marlin_symbols #ifndef SIMULATE_ROMFONT #if defined( DISPLAY_CHARSET_ISO10646_1 ) @@ -76,7 +84,7 @@ #endif #endif // SIMULATE_ROMFONT -#define FONT_STATUSMENU_NAME FONT_MENU_NAME +//#define FONT_STATUSMENU_NAME FONT_MENU_NAME #define FONT_STATUSMENU 1 #define FONT_SPECIAL 2 @@ -310,8 +318,13 @@ static void lcd_implementation_status_screen() { // X, Y, Z-Coordinates #define XYZ_BASELINE 38 - u8g.setFont(FONT_STATUSMENU); - u8g.drawBox(0,30,128,9); + lcd_setFont(FONT_STATUSMENU); + + #ifdef USE_SMALL_INFOFONT + u8g.drawBox(0,30,128,10); + #else + u8g.drawBox(0,30,128,9); + #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); lcd_print('X'); @@ -337,14 +350,18 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_MENU); u8g.setPrintPos(3,49); lcd_print(LCD_STR_FEEDRATE[0]); - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(12,49); lcd_print(itostr3(feedmultiply)); lcd_print('%'); // Status line - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); + #ifdef USE_SMALL_INFOFONT + u8g.setPrintPos(0,62); + #else u8g.setPrintPos(0,63); + #endif #ifndef FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); #else From 8848b7e9ef17c8e6ce2c1f8418416d54f48fe4df Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 09:48:21 +0100 Subject: [PATCH 044/302] Add the missed {} to END_MENU in ultralcd.cpp what caused an extra update of encoderLine most of the time. --- Marlin/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0c27e7d50..f6af156d5 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -204,7 +204,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) #endif //!ENCODER_RATE_MULTIPLIER #define END_MENU() \ - if (encoderLine >= _menuItemNr) encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\ + if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\ if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ } } while(0) From dd0067afa6966cf0243ad9eb38accc8ed6a5aafa Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 11:08:24 +0100 Subject: [PATCH 045/302] Fix MAX6675 again and introduce set_current_temp_raw() to make the temperature-code work again with Arduino 1.0.6. Sorry could not make an extra block on base level. --- Marlin/temperature.cpp | 65 +++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 713d0312f..e236afee9 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -576,6 +576,12 @@ void manage_heater() { updateTemperaturesFromRawValues(); + #ifdef HEATER_0_USES_MAX6675 + float ct = current_temperature[0]; + if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0); + if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0); + #endif //HEATER_0_USES_MAX6675 + unsigned long ms = millis(); // Loop through all extruders @@ -1162,20 +1168,40 @@ enum TempState { StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle }; +#ifdef TEMP_SENSOR_1_AS_REDUNDANT + #define TEMP_SENSOR_COUNT 2 +#else + #define TEMP_SENSOR_COUNT EXTRUDERS +#endif + +unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 }; +unsigned long raw_temp_bed_value = 0; + +void set_current_temp_raw() { + #ifndef HEATER_0_USES_MAX6675 + current_temperature_raw[0] = raw_temp_value[0]; + #endif + #if EXTRUDERS > 1 + current_temperature_raw[1] = raw_temp_value[1]; + #if EXTRUDERS > 2 + current_temperature_raw[2] = raw_temp_value[2]; + #if EXTRUDERS > 3 + current_temperature_raw[3] = raw_temp_value[3]; + #endif + #endif + #endif + #ifdef TEMP_SENSOR_1_AS_REDUNDANT + redundant_temperature_raw = raw_temp_value[1]; + #endif + current_temperature_bed_raw = raw_temp_bed_value; +} + // // Timer 0 is shared with millies // ISR(TIMER0_COMPB_vect) { - #ifdef TEMP_SENSOR_1_AS_REDUNDANT - #define TEMP_SENSOR_COUNT 2 - #else - #define TEMP_SENSOR_COUNT EXTRUDERS - #endif - //these variables are only accesible from the ISR, but static, so they don't lose their value static unsigned char temp_count = 0; - static unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 }; - static unsigned long raw_temp_bed_value = 0; static TempState temp_state = StartupDelay; static unsigned char pwm_count = BIT(SOFT_PWM_SCALE); @@ -1478,22 +1504,7 @@ ISR(TIMER0_COMPB_vect) { if (temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. if (!temp_meas_ready) { //Only update the raw values if they have been read. Else we could be updating them during reading. - #ifndef HEATER_0_USES_MAX6675 - current_temperature_raw[0] = raw_temp_value[0]; - #endif - #if EXTRUDERS > 1 - current_temperature_raw[1] = raw_temp_value[1]; - #if EXTRUDERS > 2 - current_temperature_raw[2] = raw_temp_value[2]; - #if EXTRUDERS > 3 - current_temperature_raw[3] = raw_temp_value[3]; - #endif - #endif - #endif - #ifdef TEMP_SENSOR_1_AS_REDUNDANT - redundant_temperature_raw = raw_temp_value[1]; - #endif - current_temperature_bed_raw = raw_temp_bed_value; + set_current_temp_raw(); } //!temp_meas_ready // Filament Sensor - can be read any time since IIR filtering is used @@ -1506,11 +1517,7 @@ ISR(TIMER0_COMPB_vect) { for (int i = 0; i < TEMP_SENSOR_COUNT; i++) raw_temp_value[i] = 0; raw_temp_bed_value = 0; - #ifdef HEATER_0_USES_MAX6675 - float ct = current_temperature[0]; - if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0); - if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0); - #else + #ifndef HEATER_0_USES_MAX6675 #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP #define GE0 <= #else From 94330705c7e48ef2d4462368c01ea74281c63db4 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 11:51:41 +0100 Subject: [PATCH 046/302] Move definition of PIDdT back to temperature.h make it unconditional remove all definitions in the 'Configuration.h's remove form 'Conditionals.h' --- Marlin/Conditionals.h | 11 ----------- Marlin/Configuration.h | 3 +-- Marlin/configurator/config/Configuration.h | 3 +-- Marlin/example_configurations/Felix/Configuration.h | 3 +-- .../example_configurations/Felix/Configuration_DUAL.h | 3 +-- .../example_configurations/Hephestos/Configuration.h | 3 +-- Marlin/example_configurations/K8200/Configuration.h | 3 +-- Marlin/example_configurations/SCARA/Configuration.h | 3 +-- Marlin/example_configurations/WITBOX/Configuration.h | 3 +-- .../delta/generic/Configuration.h | 3 +-- .../delta/kossel_mini/Configuration.h | 3 +-- Marlin/example_configurations/makibox/Configuration.h | 3 +-- .../tvrrug/Round2/Configuration.h | 3 +-- Marlin/temperature.cpp | 4 ++++ 14 files changed, 16 insertions(+), 35 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index fc6d6573e..c471ec436 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -390,16 +390,5 @@ #define WRITE_FAN(v) WRITE(FAN_PIN, v) #endif - /** - * Sampling period of the temperature routine - * This override comes originally from temperature.cpp - * The Configuration.h option is basically ignored. - */ - #ifdef PID_dT - #undef PID_dT - #endif - #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0)) - - #endif //CONFIGURATION_LCD #endif //CONDITIONALS_H diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f5a36e6b9..c02392be4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -209,7 +208,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 71cbdebae..bfc62f578 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -193,7 +193,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -218,7 +217,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index e9801813f..865a55167 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // Felix 2.0+ electronics with v4 Hotend #define DEFAULT_Kp 12 @@ -199,7 +198,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index e9e4623ca..e9e0adba4 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // Felix 2.0+ electronics with v4 Hotend #define DEFAULT_Kp 12 @@ -199,7 +198,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index c5b0243d5..5c426a5da 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -215,7 +214,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index bc0f3e5df..96a261caf 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -214,7 +213,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index d42bebe3a..30dc73184 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -202,7 +202,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -238,7 +237,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 481b59125..7a395d012 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -214,7 +213,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 0baf7de1c..fb78c269d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -217,7 +217,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -242,7 +241,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 9f5f89ca5..556a98bf3 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -218,7 +218,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -243,7 +242,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f6561b3af..3e8c07fe4 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -209,7 +208,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 17928b536..22e16e4ee 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // J-Head Mk V-B @@ -214,7 +213,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 713d0312f..abbc0600c 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -45,6 +45,10 @@ #define K2 (1.0-K1) #endif +#ifdef PIDTEMPBED + #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0)) +#endif + //=========================================================================== //============================= public variables ============================ //=========================================================================== From 01cc97a3c36f9cfde39cb2a7075d89aeec650383 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 12:08:23 +0100 Subject: [PATCH 047/302] Corected condition for PIDdT --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index abbc0600c..1909280af 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -45,7 +45,7 @@ #define K2 (1.0-K1) #endif -#ifdef PIDTEMPBED +#if defined(PIDTEMPBED) || defined(PIDTEMP) #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0)) #endif From 4c3cbc09619155d0c397b46755129b55933f25c8 Mon Sep 17 00:00:00 2001 From: Christian Bohn Date: Wed, 25 Mar 2015 12:23:50 +0100 Subject: [PATCH 048/302] use only one implementation for beeper feedback --- Marlin/dogm_lcd_implementation.h | 12 --------- Marlin/ultralcd.cpp | 23 +++++++++++++++- .../ultralcd_implementation_hitachi_HD44780.h | 26 ------------------- 3 files changed, 22 insertions(+), 39 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 7025e87bb..e38b1d2a4 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -408,16 +408,4 @@ static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const c #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') -static void lcd_implementation_quick_feedback() { - #if BEEPER > -1 - SET_OUTPUT(BEEPER); - for(int8_t i=0; i<10; i++) { - WRITE(BEEPER,HIGH); - delay(3); - WRITE(BEEPER,LOW); - delay(3); - } - #endif -} - #endif //__DOGM_LCD_IMPLEMENTATION_H diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index f6af156d5..846a5ac09 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1137,7 +1137,28 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) static void lcd_quick_feedback() { lcdDrawUpdate = 2; blocking_enc = millis() + 500; - lcd_implementation_quick_feedback(); + +#ifdef LCD_USE_I2C_BUZZER +#if defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) && defined(LCD_FEEDBACK_FREQUENCY_HZ) + lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); +#else + lcd_buzz(1000/6, 100); +#endif +#elif defined(BEEPER) && BEEPER > -1 + SET_OUTPUT(BEEPER); +#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) +#define LCD_FEEDBACK_FREQUENCY_HZ 500 +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 +#endif + const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; + int8_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; + while (i--) { + WRITE(BEEPER,HIGH); + delayMicroseconds(delay); + WRITE(BEEPER,LOW); + delayMicroseconds(delay); +} +#endif } /** Menu action functions **/ diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 044ac95ee..c303ff06a 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -709,32 +709,6 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') -static void lcd_implementation_quick_feedback() -{ - #ifdef LCD_USE_I2C_BUZZER - #if defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) && defined(LCD_FEEDBACK_FREQUENCY_HZ) - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #else - lcd_buzz(1000/6, 100); - #endif - #elif defined(BEEPER) && BEEPER > -1 - SET_OUTPUT(BEEPER); - #if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) - const unsigned int delay = 100; - uint8_t i = 10; - #else - const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; - int8_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; - #endif - while (i--) { - WRITE(BEEPER,HIGH); - delayMicroseconds(delay); - WRITE(BEEPER,LOW); - delayMicroseconds(delay); - } - #endif -} - #ifdef LCD_HAS_STATUS_INDICATORS static void lcd_implementation_update_indicators() { From 2dfd0e5ce73f1948494267aa9fe2f3f80c1cc3f0 Mon Sep 17 00:00:00 2001 From: chris-bo Date: Wed, 25 Mar 2015 12:44:29 +0100 Subject: [PATCH 049/302] Update Configuration.h documentation how to disable buzzer feedback --- Marlin/Configuration.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f5a36e6b9..cffcf40c4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -579,8 +579,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. //#define ULTIPANEL //the UltiPanel as on Thingiverse -//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click -//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click +#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne From a4ad9117ddb0151c32a1121bd6203a221ae00db5 Mon Sep 17 00:00:00 2001 From: wurstnase Date: Wed, 25 Mar 2015 13:46:29 +0100 Subject: [PATCH 050/302] comment #define Z_DUAL_STEPPER_DRIVERS --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 721074e23..9ff7644f8 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -98,7 +98,7 @@ // Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used // to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. -#define Z_DUAL_STEPPER_DRIVERS +//#define Z_DUAL_STEPPER_DRIVERS #ifdef Z_DUAL_STEPPER_DRIVERS From 55025558dc87ecd7aed6c8fc8cd5df3dfb29d217 Mon Sep 17 00:00:00 2001 From: alexborro Date: Wed, 25 Mar 2015 11:12:30 -0300 Subject: [PATCH 051/302] Implement Dry-Run mode in G29 It just probe all the bed without appliying the matrix. Useful after a first G29 to check the topology. --- Marlin/Marlin_main.cpp | 78 +++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3235f559..6361559b0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1168,6 +1168,7 @@ static void run_z_probe() { zPosition += home_retract_mm(Z_AXIS); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); st_synchronize(); + endstops_hit_on_purpose(); // move back down slowly to find bed @@ -1185,6 +1186,7 @@ static void run_z_probe() { zPosition -= home_retract_mm(Z_AXIS) * 2; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); st_synchronize(); + endstops_hit_on_purpose(); current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); // make sure the planner knows where we are as it may be a bit different than we last said to move to @@ -1389,11 +1391,11 @@ static float probe_pt(float x, float y, float z_before, ProbeAction retract_acti if (verbose_level > 2) { SERIAL_PROTOCOLPGM(MSG_BED); SERIAL_PROTOCOLPGM(" X: "); - SERIAL_PROTOCOL(x + 0.0001); + SERIAL_PROTOCOL_F(x, 3); SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL(y + 0.0001); + SERIAL_PROTOCOL_F(y, 3); SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL(measured_z + 0.0001); + SERIAL_PROTOCOL_F(measured_z, 3); SERIAL_EOL; } return measured_z; @@ -2109,6 +2111,9 @@ inline void gcode_G28() { * * S Set the XY travel speed between probe points (in mm/min) * + * D Dry-Run mode. Just evaluate the bed Topology - It does not apply or clean the rotation Matrix + * Useful to check the topology after a first run of G29. + * * V Set the verbose level (0-4). Example: "G29 V3" * * T Generate a Bed Topology Report. Example: "G29 P5 T" for a detailed report. @@ -2150,6 +2155,7 @@ inline void gcode_G28() { } } + bool dryrun = code_seen('D') || code_seen('d'); bool enhanced_g29 = code_seen('E') || code_seen('e'); #ifdef AUTO_BED_LEVELING_GRID @@ -2159,7 +2165,10 @@ inline void gcode_G28() { #endif if (verbose_level > 0) + { SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); + if (dryrun) SERIAL_ECHOLN("Running in DRY-RUN mode"); + } int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; #ifndef DELTA @@ -2216,22 +2225,27 @@ inline void gcode_G28() { st_synchronize(); - #ifdef DELTA - reset_bed_level(); - #else + if (!dryrun) + { + #ifdef DELTA + reset_bed_level(); + #else - // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly - //vector_3 corrected_position = plan_get_position_mm(); - //corrected_position.debug("position before G29"); - plan_bed_level_matrix.set_to_identity(); - vector_3 uncorrected_position = plan_get_position(); - //uncorrected_position.debug("position during G29"); - current_position[X_AXIS] = uncorrected_position.x; - current_position[Y_AXIS] = uncorrected_position.y; - current_position[Z_AXIS] = uncorrected_position.z; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - #endif + // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly + //vector_3 corrected_position = plan_get_position_mm(); + //corrected_position.debug("position before G29"); + plan_bed_level_matrix.set_to_identity(); + vector_3 uncorrected_position = plan_get_position(); +// uncorrected_position.debug("position during G29"); + current_position[X_AXIS] = uncorrected_position.x; + current_position[Y_AXIS] = uncorrected_position.y; + current_position[Z_AXIS] = uncorrected_position.z; + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + + #endif + } + setup_for_endstop_move(); feedrate = homing_feedrate[Z_AXIS]; @@ -2381,12 +2395,12 @@ inline void gcode_G28() { } //do_topography_map - set_bed_level_equation_lsq(plane_equation_coefficients); + if (!dryrun) set_bed_level_equation_lsq(plane_equation_coefficients); free(plane_equation_coefficients); - #else - extrapolate_unprobed_bed_level(); + #else //Delta + if (!dryrun) extrapolate_unprobed_bed_level(); print_bed_level(); - #endif + #endif //Delta #else // !AUTO_BED_LEVELING_GRID @@ -2405,25 +2419,27 @@ inline void gcode_G28() { z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level); } clean_up_after_endstop_move(); - set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); + if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); #endif // !AUTO_BED_LEVELING_GRID #ifndef DELTA - if (verbose_level > 0) - plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); + if (verbose_level > 0) plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); // Correct the Z height difference from z-probe position and hotend tip position. // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. // When the bed is uneven, this height must be corrected. - real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) - x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; - y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; - z_tmp = current_position[Z_AXIS]; + if (!dryrun) + { + real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) + x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; + y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; + z_tmp = current_position[Z_AXIS]; - apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset - current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset + current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + } #endif #ifdef Z_PROBE_SLED From 4a78db29eb15d599f22c99d66cf79d1427061c64 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 25 Mar 2015 21:28:05 +0100 Subject: [PATCH 052/302] Added instructions for Mesh bed leveling --- Documentation/MeshBedLeveling.md | 76 ++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 77 insertions(+) create mode 100644 Documentation/MeshBedLeveling.md diff --git a/Documentation/MeshBedLeveling.md b/Documentation/MeshBedLeveling.md new file mode 100644 index 000000000..318c0fa0d --- /dev/null +++ b/Documentation/MeshBedLeveling.md @@ -0,0 +1,76 @@ +============================================== +Instructions for configuring Mesh Bed Leveling +============================================== + +Background +---------- + +This mesh based method of leveling/compensating can compensate for an non-flat bed. There are various opinions about doing this. It was primarily written to compensate a RigidBot BIG bed (40x30cm) that was somewhat bent. + +Currently there is no automatic way to probe the bed like the Auto Bed Leveling feature. This might soon be implemented though, stay tuned. + +Theory +------ + +The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on grid square borders. During fast travel moves one can sometimes notice a de-acceleration on these borders. + +Mesh point probing can either be carried out from the display, or by issuing `G29` commands. + +The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some press though should also work. + +Configuration +------------- + +In `Configuration.h` there are two options that can be enabled. + +`MESH_BED_LEVELING` will enable mesh bed leveling.
+`MANUAL_BED_LEVELING` will add the menu option for bed leveling. + +There is also some values that can be set. + +Following four define the area to cover. Default 10mm from max bed size + +`MESH_MIN_X`
+`MESH_MAX_X`
+`MESH_MIN_Y`
+`MESH_MAX_Y` + +Following two define the number of points to probe, total number will be these two multiplied. Default is 3x3 points. Don't probe more than 7x7 points (software limited) + +`MESH_NUM_X_POINTS`
+`MESH_NUM_Y_POINTS`
+ +The following will set the Z-endstop height during probing. When initiating a bed leveling probing a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm + +`MESH_HOME_SEARCH_Z` + +The probed points will also be saved in the EEPROM if it has been enables. Otherwise a new probe sequence needs to be made next time the printer has been turned on. + +Probing the bed with the display +-------------------------------- + +If `MANUAL_BED_LEVELING` has been enabled then will a `Level bed` menu option be available in the `Prepare` menu. + +When selecting this option the printer will first do a homing, and then travel to the first probe point. There is will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed. + +If the EEPROM has been enable it can be good to issue a `M500` to get these points saved. + +Issuing a `G29` will return the state of the mesh leveling. + +Probing the bed with G-codes +---------------------------- + +Probing the bed by G-codes follows the sequence much like doing it with the display. + +`G29` or `G29 S0` will return the state bed leveling. + +`G29 S1` will initiate the bed leveling, homing and traveling to the first point to probe. + +Then use your preferred Printer controller program, i.e. Printrun, to lower the hotend until it touches the bed. Using a paper to feel the distance when it gets close. + +`G29 S2` will store the point and travel to the next point until last point has been probed. + +Note +---- + +Depending how firm feel you aim for on the paper you can use the `Z offset` option in Slic3r to compensate a slight height diff. (I like the paper loose so I needed to put `-0.05` in Slic3r) \ No newline at end of file diff --git a/README.md b/README.md index 155e916f5..e674c62c6 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ * [Auto Bed Leveling](/Documentation/BedLeveling.md) * [Filament Sensor](/Documentation/FilamentSensor.md) * [Ramps Servo Power](/Documentation/RampsServoPower.md) + * [Mesh Bed Leveling](/Documentation/MeshBedLeveling.md) ##### [RepRap.org Wiki Page](http://reprap.org/wiki/Marlin) From 92a7260fd05d7af241b23dd7eedf897ac6234cd7 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 25 Mar 2015 21:34:55 +0100 Subject: [PATCH 053/302] typos --- Documentation/MeshBedLeveling.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/MeshBedLeveling.md b/Documentation/MeshBedLeveling.md index 318c0fa0d..21eabb6b0 100644 --- a/Documentation/MeshBedLeveling.md +++ b/Documentation/MeshBedLeveling.md @@ -12,11 +12,11 @@ Currently there is no automatic way to probe the bed like the Auto Bed Leveling Theory ------ -The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on grid square borders. During fast travel moves one can sometimes notice a de-acceleration on these borders. +The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on the borders of the grid squares. During fast travel moves one can sometimes notice a de-acceleration on these borders. Mesh point probing can either be carried out from the display, or by issuing `G29` commands. -The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some press though should also work. +The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some travel though should also work. Configuration ------------- @@ -26,7 +26,7 @@ In `Configuration.h` there are two options that can be enabled. `MESH_BED_LEVELING` will enable mesh bed leveling.
`MANUAL_BED_LEVELING` will add the menu option for bed leveling. -There is also some values that can be set. +There are also some values that can be set. Following four define the area to cover. Default 10mm from max bed size @@ -40,7 +40,7 @@ Following two define the number of points to probe, total number will be these t `MESH_NUM_X_POINTS`
`MESH_NUM_Y_POINTS`
-The following will set the Z-endstop height during probing. When initiating a bed leveling probing a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm +The following will set the Z-endstop height during probing. When initiating a bed leveling probing, a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm `MESH_HOME_SEARCH_Z` @@ -51,7 +51,7 @@ Probing the bed with the display If `MANUAL_BED_LEVELING` has been enabled then will a `Level bed` menu option be available in the `Prepare` menu. -When selecting this option the printer will first do a homing, and then travel to the first probe point. There is will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed. +When selecting this option the printer will first do a homing, and then travel to the first probe point. There it will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed. If the EEPROM has been enable it can be good to issue a `M500` to get these points saved. From ac81b4084feb55d8cdea584202bae0fffaeb61f2 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 21:37:15 +0100 Subject: [PATCH 054/302] Make variables and function static. --- Marlin/temperature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index e236afee9..c66959674 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1174,10 +1174,10 @@ enum TempState { #define TEMP_SENSOR_COUNT EXTRUDERS #endif -unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 }; -unsigned long raw_temp_bed_value = 0; +static unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 }; +static unsigned long raw_temp_bed_value = 0; -void set_current_temp_raw() { +static void set_current_temp_raw() { #ifndef HEATER_0_USES_MAX6675 current_temperature_raw[0] = raw_temp_value[0]; #endif From d43d47da1430eadbaf19a4e785868deb0c7dc1f6 Mon Sep 17 00:00:00 2001 From: Victor Torre Date: Wed, 25 Mar 2015 22:05:18 +0100 Subject: [PATCH 055/302] Clean "fromsd" array is not SDSUPPORT if not have SDSUPPORT the fromsd array is not necessary --- Marlin/Marlin_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6361559b0..6130ac8f5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -395,7 +395,9 @@ static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; static bool relative_mode = false; //Determines Absolute or Relative Coordinates static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; +#ifdef SDSUPPORT static bool fromsd[BUFSIZE]; +#endif //!SDSUPPORT static int bufindr = 0; static int bufindw = 0; static int buflen = 0; @@ -655,10 +657,12 @@ void setup() SERIAL_ECHO(freeMemory()); SERIAL_ECHOPGM(MSG_PLANNER_BUFFER_BYTES); SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); + #ifdef SDSUPPORT for(int8_t i = 0; i < BUFSIZE; i++) { fromsd[i] = false; } + #endif //!SDSUPPORT // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); @@ -764,8 +768,9 @@ void get_command() return; } cmdbuffer[bufindw][serial_count] = 0; //terminate string - + #ifdef SDSUPPORT fromsd[bufindw] = false; + #endif //!SDSUPPORT if(strchr(cmdbuffer[bufindw], 'N') != NULL) { strchr_pointer = strchr(cmdbuffer[bufindw], 'N'); From f680e509c4a3897a7563ac96e3c7e2262225af32 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 23:26:06 +0100 Subject: [PATCH 056/302] Enclosed error-messages for TEMP_SENSOR_1_AS_REDUNDANT in PSTR() --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index c66959674..ef75ae439 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -613,7 +613,7 @@ void manage_heater() { #ifdef TEMP_SENSOR_1_AS_REDUNDANT if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) { disable_heater(); - _temp_error(-1, MSG_EXTRUDER_SWITCHED_OFF, MSG_ERR_REDUNDANT_TEMP); + _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP)); } #endif //TEMP_SENSOR_1_AS_REDUNDANT From 96b5da71983adffa86dffa5961da78aa24183fb4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Mar 2015 20:36:24 -0700 Subject: [PATCH 057/302] Fix up bed leveling code - Init `zprobe_zoffset` - Remove `current_position[Z_AXIS] = zprobe_zoffset` lines from the `set_bed_level_equation_*` functions - Apply standards to `mesh_bed_leveling` files - Document `MESH_BED_LEVELING` --- Marlin/ConfigurationStore.cpp | 2 +- Marlin/Marlin_main.cpp | 271 +++++++++++++++++----------------- Marlin/mesh_bed_leveling.cpp | 22 ++- Marlin/mesh_bed_leveling.h | 62 ++++---- 4 files changed, 173 insertions(+), 184 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index fc485e226..a0be20276 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -11,7 +11,7 @@ * max_acceleration_units_per_sq_second (x4) * acceleration * retract_acceleration - * travel_aceeleration + * travel_acceleration * minimumfeedrate * mintravelfeedrate * minsegmenttime diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3235f559..ff6e96499 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -255,7 +255,7 @@ float home_offset[3] = { 0, 0, 0 }; float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; bool axis_known_position[3] = { false, false, false }; -float zprobe_zoffset; +float zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; // Extruder offset #if EXTRUDERS > 1 @@ -1092,9 +1092,6 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients) current_position[Y_AXIS] = corrected_position.y; current_position[Z_AXIS] = corrected_position.z; - // put the bed at 0 so we don't go below it. - current_position[Z_AXIS] = zprobe_zoffset; // in the lsq we reach here after raising the extruder due to the loop structure - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } #endif @@ -1121,9 +1118,6 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float current_position[Y_AXIS] = corrected_position.y; current_position[Z_AXIS] = corrected_position.z; - // put the bed at 0 so we don't go below it. - current_position[Z_AXIS] = zprobe_zoffset; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } @@ -2010,8 +2004,19 @@ inline void gcode_G28() { endstops_hit_on_purpose(); } -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING + /** + * G29: Mesh-based Z-Probe, probes a grid and produces a + * mesh to compensate for variable bed height + * + * Parameters With MESH_BED_LEVELING: + * + * S0 Produce a mesh report + * S1 Start probing mesh points + * S2 Probe the next mesh point + * + */ inline void gcode_G29() { static int probe_point = -1; int state = 0; @@ -2053,7 +2058,7 @@ inline void gcode_G28() { } else if (state == 2) { // Goto next point if (probe_point < 0) { - SERIAL_PROTOCOLPGM("Mesh probing not started.\n"); + SERIAL_PROTOCOLPGM("Start mesh probing with \"G29 S1\" first.\n"); return; } int ix, iy; @@ -2063,16 +2068,14 @@ inline void gcode_G28() { } else { ix = (probe_point-1) % MESH_NUM_X_POINTS; iy = (probe_point-1) / MESH_NUM_X_POINTS; - if (iy&1) { // Zig zag - ix = (MESH_NUM_X_POINTS - 1) - ix; - } + if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag mbl.set_z(ix, iy, current_position[Z_AXIS]); current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[X_AXIS]/60, active_extruder); st_synchronize(); } - if (probe_point == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS) { - SERIAL_PROTOCOLPGM("Mesh done.\n"); + if (probe_point == MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { + SERIAL_PROTOCOLPGM("Mesh probing done.\n"); probe_point = -1; mbl.active = 1; enquecommands_P(PSTR("G28")); @@ -2080,9 +2083,7 @@ inline void gcode_G28() { } ix = probe_point % MESH_NUM_X_POINTS; iy = probe_point / MESH_NUM_X_POINTS; - if (iy&1) { // Zig zag - ix = (MESH_NUM_X_POINTS - 1) - ix; - } + if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag current_position[X_AXIS] = mbl.get_x(ix); current_position[Y_AXIS] = mbl.get_y(iy); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[X_AXIS]/60, active_extruder); @@ -2091,9 +2092,7 @@ inline void gcode_G28() { } } -#endif - -#ifdef ENABLE_AUTO_BED_LEVELING +#elif defined(ENABLE_AUTO_BED_LEVELING) /** * G29: Detailed Z-Probe, probes the bed at 3 or more points. @@ -2154,9 +2153,9 @@ inline void gcode_G28() { #ifdef AUTO_BED_LEVELING_GRID - #ifndef DELTA - bool do_topography_map = verbose_level > 2 || code_seen('T') || code_seen('t'); - #endif + #ifndef DELTA + bool do_topography_map = verbose_level > 2 || code_seen('T') || code_seen('t'); + #endif if (verbose_level > 0) SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); @@ -2210,7 +2209,7 @@ inline void gcode_G28() { #ifdef Z_PROBE_SLED dock_sled(false); // engage (un-dock) the probe - #elif defined(Z_PROBE_ALLEN_KEY) + #elif defined(Z_PROBE_ALLEN_KEY) //|| defined(SERVO_LEVELING) engage_z_probe(); #endif @@ -2218,19 +2217,18 @@ inline void gcode_G28() { #ifdef DELTA reset_bed_level(); - #else - - // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly - //vector_3 corrected_position = plan_get_position_mm(); - //corrected_position.debug("position before G29"); - plan_bed_level_matrix.set_to_identity(); - vector_3 uncorrected_position = plan_get_position(); - //uncorrected_position.debug("position during G29"); - current_position[X_AXIS] = uncorrected_position.x; - current_position[Y_AXIS] = uncorrected_position.y; - current_position[Z_AXIS] = uncorrected_position.z; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - #endif + #else //!DELTA + // make sure the bed_level_rotation_matrix is identity or the planner will get it wrong + //vector_3 corrected_position = plan_get_position_mm(); + //corrected_position.debug("position before G29"); + plan_bed_level_matrix.set_to_identity(); + vector_3 uncorrected_position = plan_get_position(); + //uncorrected_position.debug("position during G29"); + current_position[X_AXIS] = uncorrected_position.x; + current_position[Y_AXIS] = uncorrected_position.y; + current_position[Z_AXIS] = uncorrected_position.z; + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + #endif //!DELTA setup_for_endstop_move(); @@ -2242,26 +2240,24 @@ inline void gcode_G28() { const int xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points-1); const int yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points-1); - #ifndef DELTA - // solve the plane equation ax + by + d = z - // A is the matrix with rows [x y 1] for all the probed points - // B is the vector of the Z positions - // the normal vector to the plane is formed by the coefficients of the plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0 - // so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z + #ifdef DELTA + delta_grid_spacing[0] = xGridSpacing; + delta_grid_spacing[1] = yGridSpacing; + float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER; + if (code_seen(axis_codes[Z_AXIS])) z_offset += code_value(); + #else // !DELTA + // solve the plane equation ax + by + d = z + // A is the matrix with rows [x y 1] for all the probed points + // B is the vector of the Z positions + // the normal vector to the plane is formed by the coefficients of the plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0 + // so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z - int abl2 = auto_bed_leveling_grid_points * auto_bed_leveling_grid_points; + int abl2 = auto_bed_leveling_grid_points * auto_bed_leveling_grid_points; - double eqnAMatrix[abl2 * 3], // "A" matrix of the linear system of equations - eqnBVector[abl2], // "B" vector of Z points - mean = 0.0; - - #else - delta_grid_spacing[0] = xGridSpacing; - delta_grid_spacing[1] = yGridSpacing; - - float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER; - if (code_seen(axis_codes[Z_AXIS])) z_offset += code_value(); - #endif + double eqnAMatrix[abl2 * 3], // "A" matrix of the linear system of equations + eqnBVector[abl2], // "B" vector of Z points + mean = 0.0; + #endif // !DELTA int probePointCounter = 0; bool zig = true; @@ -2294,12 +2290,12 @@ inline void gcode_G28() { float measured_z, z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS; - #ifdef DELTA - // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. - float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe); - if (distance_from_center > DELTA_PROBABLE_RADIUS) - continue; - #endif //DELTA + #ifdef DELTA + // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. + float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe); + if (distance_from_center > DELTA_PROBABLE_RADIUS) + continue; + #endif //DELTA // Enhanced G29 - Do not retract servo between probes ProbeAction act; @@ -2316,16 +2312,16 @@ inline void gcode_G28() { measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level); - #ifndef DELTA - mean += measured_z; + #ifndef DELTA + mean += measured_z; - eqnBVector[probePointCounter] = measured_z; - eqnAMatrix[probePointCounter + 0 * abl2] = xProbe; - eqnAMatrix[probePointCounter + 1 * abl2] = yProbe; - eqnAMatrix[probePointCounter + 2 * abl2] = 1; - #else - bed_level[xCount][yCount] = measured_z + z_offset; - #endif + eqnBVector[probePointCounter] = measured_z; + eqnAMatrix[probePointCounter + 0 * abl2] = xProbe; + eqnAMatrix[probePointCounter + 1 * abl2] = yProbe; + eqnAMatrix[probePointCounter + 2 * abl2] = 1; + #else + bed_level[xCount][yCount] = measured_z + z_offset; + #endif probePointCounter++; } //xProbe @@ -2333,60 +2329,61 @@ inline void gcode_G28() { clean_up_after_endstop_move(); - #ifndef DELTA - // solve lsq problem - double *plane_equation_coefficients = qr_solve(abl2, 3, eqnAMatrix, eqnBVector); + #ifdef DELTA + extrapolate_unprobed_bed_level(); + print_bed_level(); + #else // !DELTA + // solve lsq problem + double *plane_equation_coefficients = qr_solve(abl2, 3, eqnAMatrix, eqnBVector); - mean /= abl2; + mean /= abl2; - if (verbose_level) { - SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[0], 8); - SERIAL_PROTOCOLPGM(" b: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[1], 8); - SERIAL_PROTOCOLPGM(" d: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[2], 8); - SERIAL_EOL; - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mean of sampled points: "); - SERIAL_PROTOCOL_F(mean, 8); + if (verbose_level) { + SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); + SERIAL_PROTOCOL_F(plane_equation_coefficients[0], 8); + SERIAL_PROTOCOLPGM(" b: "); + SERIAL_PROTOCOL_F(plane_equation_coefficients[1], 8); + SERIAL_PROTOCOLPGM(" d: "); + SERIAL_PROTOCOL_F(plane_equation_coefficients[2], 8); SERIAL_EOL; + if (verbose_level > 2) { + SERIAL_PROTOCOLPGM("Mean of sampled points: "); + SERIAL_PROTOCOL_F(mean, 8); + SERIAL_EOL; + } } - } - // Show the Topography map if enabled - if (do_topography_map) { + // Show the Topography map if enabled + if (do_topography_map) { - SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n"); - SERIAL_PROTOCOLPGM("+-----------+\n"); - SERIAL_PROTOCOLPGM("|...Back....|\n"); - SERIAL_PROTOCOLPGM("|Left..Right|\n"); - SERIAL_PROTOCOLPGM("|...Front...|\n"); - SERIAL_PROTOCOLPGM("+-----------+\n"); + SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n"); + SERIAL_PROTOCOLPGM("+-----------+\n"); + SERIAL_PROTOCOLPGM("|...Back....|\n"); + SERIAL_PROTOCOLPGM("|Left..Right|\n"); + SERIAL_PROTOCOLPGM("|...Front...|\n"); + SERIAL_PROTOCOLPGM("+-----------+\n"); - for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) { - for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) { - int ind = yy * auto_bed_leveling_grid_points + xx; - float diff = eqnBVector[ind] - mean; - if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment - else - SERIAL_PROTOCOLPGM(" "); - SERIAL_PROTOCOL_F(diff, 5); - } // xx + for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) { + for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) { + int ind = yy * auto_bed_leveling_grid_points + xx; + float diff = eqnBVector[ind] - mean; + if (diff >= 0.0) + SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment + else + SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOL_F(diff, 5); + } // xx + SERIAL_EOL; + } // yy SERIAL_EOL; - } // yy - SERIAL_EOL; - } //do_topography_map + } //do_topography_map - set_bed_level_equation_lsq(plane_equation_coefficients); - free(plane_equation_coefficients); - #else - extrapolate_unprobed_bed_level(); - print_bed_level(); - #endif + set_bed_level_equation_lsq(plane_equation_coefficients); + free(plane_equation_coefficients); + + #endif // !DELTA #else // !AUTO_BED_LEVELING_GRID @@ -2409,33 +2406,33 @@ inline void gcode_G28() { #endif // !AUTO_BED_LEVELING_GRID - #ifndef DELTA - if (verbose_level > 0) - plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); + #ifndef DELTA + if (verbose_level > 0) + plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); - // Correct the Z height difference from z-probe position and hotend tip position. - // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. - // When the bed is uneven, this height must be corrected. - real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) - x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; - y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; - z_tmp = current_position[Z_AXIS]; + // Correct the Z height difference from z-probe position and hotend tip position. + // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. + // When the bed is uneven, this height must be corrected. + real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) + x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; + y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; + z_tmp = current_position[Z_AXIS]; - apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset - current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - #endif + apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset + current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + #endif - #ifdef Z_PROBE_SLED - dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel - #elif defined(Z_PROBE_ALLEN_KEY) - retract_z_probe(); - #endif - - #ifdef Z_PROBE_END_SCRIPT - enquecommands_P(PSTR(Z_PROBE_END_SCRIPT)); - st_synchronize(); - #endif + #ifdef Z_PROBE_SLED + dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel + #elif defined(Z_PROBE_ALLEN_KEY) //|| defined(SERVO_LEVELING) + retract_z_probe(); + #endif + + #ifdef Z_PROBE_END_SCRIPT + enquecommands_P(PSTR(Z_PROBE_END_SCRIPT)); + st_synchronize(); + #endif } #ifndef Z_PROBE_SLED diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp index b383fe589..a48a6e619 100644 --- a/Marlin/mesh_bed_leveling.cpp +++ b/Marlin/mesh_bed_leveling.cpp @@ -1,20 +1,16 @@ #include "mesh_bed_leveling.h" -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING -mesh_bed_leveling mbl; + mesh_bed_leveling mbl; -mesh_bed_leveling::mesh_bed_leveling() { - reset(); -} - -void mesh_bed_leveling::reset() { - for (int y=0; y get_x(i) && i < MESH_NUM_X_POINTS-1) { - i++; - } - return i-1; + int i = 1; + while (x > get_x(i) && i < MESH_NUM_X_POINTS-1) i++; + return i - 1; } int select_y_index(float y) { - int i = 1; - while (y > get_y(i) && i < MESH_NUM_Y_POINTS-1) { - i++; - } - return i-1; + int i = 1; + while (y > get_y(i) && i < MESH_NUM_Y_POINTS - 1) i++; + return i - 1; } float calc_z0(float a0, float a1, float z1, float a2, float z2) { - float delta_z = (z2 - z1)/(a2 - a1); - float delta_a = a0 - a1; - return z1 + delta_a * delta_z; + float delta_z = (z2 - z1)/(a2 - a1); + float delta_a = a0 - a1; + return z1 + delta_a * delta_z; } float get_z(float x0, float y0) { - int x_index = select_x_index(x0); - int y_index = select_y_index(y0); - float z1 = calc_z0(x0, - get_x(x_index), z_values[y_index][x_index], - get_x(x_index+1), z_values[y_index][x_index+1]); - float z2 = calc_z0(x0, - get_x(x_index), z_values[y_index+1][x_index], - get_x(x_index+1), z_values[y_index+1][x_index+1]); - float z0 = calc_z0(y0, - get_y(y_index), z1, - get_y(y_index+1), z2); - return z0; + int x_index = select_x_index(x0); + int y_index = select_y_index(y0); + float z1 = calc_z0(x0, + get_x(x_index), z_values[y_index][x_index], + get_x(x_index+1), z_values[y_index][x_index+1]); + float z2 = calc_z0(x0, + get_x(x_index), z_values[y_index+1][x_index], + get_x(x_index+1), z_values[y_index+1][x_index+1]); + float z0 = calc_z0(y0, + get_y(y_index), z1, + get_y(y_index+1), z2); + return z0; } -}; + }; -extern mesh_bed_leveling mbl; + extern mesh_bed_leveling mbl; #endif // MESH_BED_LEVELING From 5261d35737f4a129327de8c5b9ed7e7f4cccbe30 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Mar 2015 21:20:50 -0700 Subject: [PATCH 058/302] Fix custom m-code behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t set CUSTOM_M_CODE_SET_Z_PROBE_OFFSET if there’s no Z probe --- Marlin/Configuration.h | 8 +++++--- Marlin/configurator/config/Configuration.h | 8 +++++--- Marlin/example_configurations/Felix/Configuration.h | 8 +++++--- Marlin/example_configurations/Felix/Configuration_DUAL.h | 8 +++++--- Marlin/example_configurations/Hephestos/Configuration.h | 8 +++++--- Marlin/example_configurations/K8200/Configuration.h | 8 +++++--- Marlin/example_configurations/SCARA/Configuration.h | 8 +++++--- Marlin/example_configurations/WITBOX/Configuration.h | 8 +++++--- .../example_configurations/delta/generic/Configuration.h | 8 +++++--- .../delta/kossel_mini/Configuration.h | 8 +++++--- Marlin/example_configurations/makibox/Configuration.h | 8 +++++--- .../example_configurations/tvrrug/Round2/Configuration.h | 8 +++++--- 12 files changed, 60 insertions(+), 36 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f5a36e6b9..cb46c530e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -533,9 +533,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 71cbdebae..78c40b2e9 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -570,9 +570,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif // @section extras diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index e9801813f..17631860c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -512,9 +512,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index e9e4623ca..e72277417 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -512,9 +512,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index c5b0243d5..1e726a0b7 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -540,9 +540,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index bc0f3e5df..edb026b7a 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -544,9 +544,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index d42bebe3a..79b3ded98 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -570,9 +570,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points //#define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 481b59125..6362bb997 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -537,9 +537,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 0baf7de1c..9a4165605 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -553,9 +553,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 9f5f89ca5..ca77c3984 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -555,9 +555,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f6561b3af..341ac6034 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -535,9 +535,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 17928b536..da82ccd63 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -542,9 +542,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #ifdef ENABLE_AUTO_BED_LEVELING + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -15 + #define Z_PROBE_OFFSET_RANGE_MAX -5 + #endif #endif From 32331faee49b426bf5966816687dc56fd0aa8ea7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Mar 2015 22:13:59 -0700 Subject: [PATCH 059/302] Prettify Bed Level Correction Matrix - Put + in front of positive values in the output --- Marlin/vector_3.cpp | 84 ++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp index 2e42da553..681eceec2 100644 --- a/Marlin/vector_3.cpp +++ b/Marlin/vector_3.cpp @@ -26,57 +26,40 @@ vector_3::vector_3() : x(0), y(0), z(0) { } vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { } -vector_3 vector_3::cross(vector_3 left, vector_3 right) -{ +vector_3 vector_3::cross(vector_3 left, vector_3 right) { return vector_3(left.y * right.z - left.z * right.y, left.z * right.x - left.x * right.z, left.x * right.y - left.y * right.x); } -vector_3 vector_3::operator+(vector_3 v) -{ - return vector_3((x + v.x), (y + v.y), (z + v.z)); -} +vector_3 vector_3::operator+(vector_3 v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); } +vector_3 vector_3::operator-(vector_3 v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); } -vector_3 vector_3::operator-(vector_3 v) -{ - return vector_3((x - v.x), (y - v.y), (z - v.z)); -} - -vector_3 vector_3::get_normal() -{ +vector_3 vector_3::get_normal() { vector_3 normalized = vector_3(x, y, z); normalized.normalize(); return normalized; } -float vector_3::get_length() -{ - float length = sqrt((x * x) + (y * y) + (z * z)); - return length; -} - -void vector_3::normalize() -{ +float vector_3::get_length() { return sqrt((x * x) + (y * y) + (z * z)); } + +void vector_3::normalize() { float length = get_length(); x /= length; y /= length; z /= length; } -void vector_3::apply_rotation(matrix_3x3 matrix) -{ +void vector_3::apply_rotation(matrix_3x3 matrix) { float resultX = x * matrix.matrix[3*0+0] + y * matrix.matrix[3*1+0] + z * matrix.matrix[3*2+0]; float resultY = x * matrix.matrix[3*0+1] + y * matrix.matrix[3*1+1] + z * matrix.matrix[3*2+1]; float resultZ = x * matrix.matrix[3*0+2] + y * matrix.matrix[3*1+2] + z * matrix.matrix[3*2+2]; - x = resultX; y = resultY; z = resultZ; } -void vector_3::debug(char* title) -{ +void vector_3::debug(char* title) { SERIAL_PROTOCOL(title); SERIAL_PROTOCOLPGM(" x: "); SERIAL_PROTOCOL_F(x, 6); @@ -87,8 +70,7 @@ void vector_3::debug(char* title) SERIAL_EOL; } -void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) -{ +void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) { vector_3 vector = vector_3(x, y, z); vector.apply_rotation(matrix); x = vector.x; @@ -96,48 +78,41 @@ void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) z = vector.z; } -matrix_3x3 matrix_3x3::create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2) -{ - //row_0.debug("row_0"); - //row_1.debug("row_1"); - //row_2.debug("row_2"); +matrix_3x3 matrix_3x3::create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2) { + //row_0.debug("row_0"); + //row_1.debug("row_1"); + //row_2.debug("row_2"); matrix_3x3 new_matrix; new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z; new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z; new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z; - //new_matrix.debug("new_matrix"); - + //new_matrix.debug("new_matrix"); return new_matrix; } -void matrix_3x3::set_to_identity() -{ +void matrix_3x3::set_to_identity() { matrix[0] = 1; matrix[1] = 0; matrix[2] = 0; matrix[3] = 0; matrix[4] = 1; matrix[5] = 0; matrix[6] = 0; matrix[7] = 0; matrix[8] = 1; } -matrix_3x3 matrix_3x3::create_look_at(vector_3 target) -{ - vector_3 z_row = target.get_normal(); - vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal(); - vector_3 y_row = vector_3::cross(z_row, x_row).get_normal(); +matrix_3x3 matrix_3x3::create_look_at(vector_3 target) { + vector_3 z_row = target.get_normal(); + vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal(); + vector_3 y_row = vector_3::cross(z_row, x_row).get_normal(); - // x_row.debug("x_row"); - // y_row.debug("y_row"); - // z_row.debug("z_row"); + // x_row.debug("x_row"); + // y_row.debug("y_row"); + // z_row.debug("z_row"); - - // create the matrix already correctly transposed - matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); + // create the matrix already correctly transposed + matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); - // rot.debug("rot"); - return rot; + // rot.debug("rot"); + return rot; } - -matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) -{ +matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) { matrix_3x3 new_matrix; new_matrix.matrix[0] = original.matrix[0]; new_matrix.matrix[1] = original.matrix[3]; new_matrix.matrix[2] = original.matrix[6]; new_matrix.matrix[3] = original.matrix[1]; new_matrix.matrix[4] = original.matrix[4]; new_matrix.matrix[5] = original.matrix[7]; @@ -150,6 +125,7 @@ void matrix_3x3::debug(char* title) { int count = 0; for(int i=0; i<3; i++) { for(int j=0; j<3; j++) { + if (matrix[count] >= 0.0) SERIAL_PROTOCOLPGM("+"); SERIAL_PROTOCOL_F(matrix[count], 6); SERIAL_PROTOCOLPGM(" "); count++; @@ -158,5 +134,5 @@ void matrix_3x3::debug(char* title) { } } -#endif // #ifdef ENABLE_AUTO_BED_LEVELING +#endif // ENABLE_AUTO_BED_LEVELING From abadeac08dd19739d30ef5d5c54086772ca7f022 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Mar 2015 23:06:33 -0700 Subject: [PATCH 060/302] Group zprobe_zoffset with bed leveling --- Marlin/ConfigurationStore.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index ac41d7b65..2ae1e19a8 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -470,9 +470,13 @@ void Config_ResetDefault() { max_e_jerk = DEFAULT_EJERK; home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0; - #if defined(MESH_BED_LEVELING) + #ifdef MESH_BED_LEVELING mbl.active = 0; - #endif // MESH_BED_LEVELING + #endif + + #ifdef ENABLE_AUTO_BED_LEVELING + zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; + #endif #ifdef DELTA endstop_adj[X_AXIS] = endstop_adj[Y_AXIS] = endstop_adj[Z_AXIS] = 0; @@ -493,10 +497,6 @@ void Config_ResetDefault() { absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED; #endif - #ifdef ENABLE_AUTO_BED_LEVELING - zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; - #endif - #ifdef DOGLCD lcd_contrast = DEFAULT_LCD_CONTRAST; #endif From eab5fad53983b1ca39fa3e29e2d67ec8db706794 Mon Sep 17 00:00:00 2001 From: Christian Bohn Date: Thu, 26 Mar 2015 09:00:34 +0100 Subject: [PATCH 061/302] code formatting --- Marlin/Configuration.h | 4 ++-- Marlin/ultralcd.cpp | 48 +++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index cffcf40c4..7ee90d117 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -579,8 +579,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. //#define ULTIPANEL //the UltiPanel as on Thingiverse -#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click -#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 846a5ac09..0bc49dea5 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1137,28 +1137,32 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) static void lcd_quick_feedback() { lcdDrawUpdate = 2; blocking_enc = millis() + 500; - -#ifdef LCD_USE_I2C_BUZZER -#if defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) && defined(LCD_FEEDBACK_FREQUENCY_HZ) - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); -#else - lcd_buzz(1000/6, 100); -#endif -#elif defined(BEEPER) && BEEPER > -1 - SET_OUTPUT(BEEPER); -#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) -#define LCD_FEEDBACK_FREQUENCY_HZ 500 -#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 -#endif - const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; - int8_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; - while (i--) { - WRITE(BEEPER,HIGH); - delayMicroseconds(delay); - WRITE(BEEPER,LOW); - delayMicroseconds(delay); -} -#endif + + #ifdef LCD_USE_I2C_BUZZER + #ifndef LCD_FEEDBACK_FREQUENCY_HZ + #define LCD_FEEDBACK_FREQUENCY_HZ 100 + #endif + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6) + #endif + lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #elif defined(BEEPER) && BEEPER > -1 + SET_OUTPUT(BEEPER); + #ifndef LCD_FEEDBACK_FREQUENCY_HZ + #define LCD_FEEDBACK_FREQUENCY_HZ 500 + #endif + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 + #endif + const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; + int i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; + while (i--) { + WRITE(BEEPER,HIGH); + delayMicroseconds(delay); + WRITE(BEEPER,LOW); + delayMicroseconds(delay); + } + #endif } /** Menu action functions **/ From ebe5b87c2cd261f1d39fd440529e24a8c0850804 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 26 Mar 2015 21:18:19 +0100 Subject: [PATCH 062/302] < like in the oher compareble loops to avoid: Marlin_main.cpp:1790: warning: array subscript is above array bounds. --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6130ac8f5..084dea197 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1787,7 +1787,7 @@ inline void gcode_G28() { enable_endstops(true); - for (int i = X_AXIS; i <= NUM_AXIS; i++) destination[i] = current_position[i]; + for (int i = X_AXIS; i < NUM_AXIS; i++) destination[i] = current_position[i]; feedrate = 0.0; From 1ff6df8f9e0acd3931b7d5eb2371d2a96f34a56a Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 26 Mar 2015 21:30:53 +0100 Subject: [PATCH 063/302] Avoid warnings in SanitiCheck.h /SanityCheck.h:107:53: warning: missing terminating ' character ... --- Marlin/SanityCheck.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a8937b44b..d228bdf99 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -104,13 +104,13 @@ // Make sure probing points are reachable #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X - #error The given LEFT_PROBE_BED_POSITION can't be reached by the probe. + #error The given LEFT_PROBE_BED_POSITION can not be reached by the probe. #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X - #error The given RIGHT_PROBE_BED_POSITION can't be reached by the probe. + #error The given RIGHT_PROBE_BED_POSITION can not be reached by the probe. #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y - #error The given FRONT_PROBE_BED_POSITION can't be reached by the probe. + #error The given FRONT_PROBE_BED_POSITION can not be reached by the probe. #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y - #error The given BACK_PROBE_BED_POSITION can't be reached by the probe. + #error The given BACK_PROBE_BED_POSITION can not be reached by the probe. #endif #define PROBE_SIZE_X (X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) From 78090275a9999f8fd4a335576891f7087a2c304b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 13:52:48 -0700 Subject: [PATCH 064/302] Fix probe range editing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Increase the probe offset range to -20…20 - Apply the range limits to the menu item --- Marlin/Configuration.h | 4 ++-- Marlin/ultralcd.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d191ead2a..760c3f260 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -534,8 +534,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index f6af156d5..623327181 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -911,7 +911,7 @@ static void lcd_control_motion_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); #ifdef ENABLE_AUTO_BED_LEVELING - MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.0, 50); + MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000); MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990); From 04328d7537807ebfe0520927aaf686a4b3a6969e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 15:29:16 -0700 Subject: [PATCH 065/302] Add zprobe_zoffset in set_bed_level_equation_* - Also a small tweak to SanityCheck.h --- Marlin/Marlin_main.cpp | 5 ++--- Marlin/SanityCheck.h | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8b4472ab7..19d07cbe7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1090,7 +1090,7 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients) // corrected_position.debug("position after"); current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; + current_position[Z_AXIS] = corrected_position.z + zprobe_zoffset; plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } @@ -1116,10 +1116,9 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float vector_3 corrected_position = plan_get_position(); current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; + current_position[Z_AXIS] = corrected_position.z + zprobe_zoffset; plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - } #endif // AUTO_BED_LEVELING_GRID diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a8937b44b..d5183abba 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -104,13 +104,13 @@ // Make sure probing points are reachable #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X - #error The given LEFT_PROBE_BED_POSITION can't be reached by the probe. + #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe." #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X - #error The given RIGHT_PROBE_BED_POSITION can't be reached by the probe. + #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe." #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y - #error The given FRONT_PROBE_BED_POSITION can't be reached by the probe. + #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe." #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y - #error The given BACK_PROBE_BED_POSITION can't be reached by the probe. + #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe." #endif #define PROBE_SIZE_X (X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) From 53169d96e8f2df88b8bd0bd45234235c65dc78aa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 16:02:15 -0700 Subject: [PATCH 066/302] Set temp_meas_ready in set_current_temp_raw --- Marlin/temperature.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index cb7001324..0450d1ccd 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -226,7 +226,7 @@ void PID_autotune(float temp, int extruder, int ncycles) unsigned long ms = millis(); - if (temp_meas_ready == true) { // temp sample ready + if (temp_meas_ready) { // temp sample ready updateTemperaturesFromRawValues(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; @@ -1198,6 +1198,7 @@ static void set_current_temp_raw() { redundant_temperature_raw = raw_temp_value[1]; #endif current_temperature_bed_raw = raw_temp_bed_value; + temp_meas_ready = true; } // @@ -1507,16 +1508,14 @@ ISR(TIMER0_COMPB_vect) { } // switch(temp_state) if (temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - if (!temp_meas_ready) { //Only update the raw values if they have been read. Else we could be updating them during reading. - set_current_temp_raw(); - } //!temp_meas_ready + // Update the raw values if they've been read. Else we could be updating them during reading. + if (!temp_meas_ready) set_current_temp_raw(); // Filament Sensor - can be read any time since IIR filtering is used #if HAS_FILAMENT_SENSOR current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach #endif - temp_meas_ready = true; temp_count = 0; for (int i = 0; i < TEMP_SENSOR_COUNT; i++) raw_temp_value[i] = 0; raw_temp_bed_value = 0; From 0b3243155109c9c946ddc818919efb9099aa9ff6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 16:20:23 -0700 Subject: [PATCH 067/302] Remove abs() from planeNormal.z --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 36156a3d2..47a4a7908 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1114,7 +1114,7 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float vector_3 from_2_to_1 = (pt1 - pt2).get_normal(); vector_3 from_2_to_3 = (pt3 - pt2).get_normal(); vector_3 planeNormal = vector_3::cross(from_2_to_1, from_2_to_3).get_normal(); - planeNormal = vector_3(planeNormal.x, planeNormal.y, abs(planeNormal.z)); + planeNormal = vector_3(planeNormal.x, planeNormal.y, planeNormal.z); plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); From 410f64782acb30083ae8abfb7f4719061bf1983d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 16:22:21 -0700 Subject: [PATCH 068/302] Always 4 temp sensors --- Marlin/temperature.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index cb7001324..4a5f7a7e5 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -226,7 +226,7 @@ void PID_autotune(float temp, int extruder, int ncycles) unsigned long ms = millis(); - if (temp_meas_ready == true) { // temp sample ready + if (temp_meas_ready) { // temp sample ready updateTemperaturesFromRawValues(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; @@ -1172,32 +1172,27 @@ enum TempState { StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle }; -#ifdef TEMP_SENSOR_1_AS_REDUNDANT - #define TEMP_SENSOR_COUNT 2 -#else - #define TEMP_SENSOR_COUNT EXTRUDERS -#endif - -static unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 }; +static unsigned long raw_temp_value[4] = { 0 }; static unsigned long raw_temp_bed_value = 0; static void set_current_temp_raw() { - #ifndef HEATER_0_USES_MAX6675 + #if HAS_TEMP_0 && !defined(HEATER_0_USES_MAX6675) current_temperature_raw[0] = raw_temp_value[0]; #endif - #if EXTRUDERS > 1 + #if HAS_TEMP_1 + #ifdef TEMP_SENSOR_1_AS_REDUNDANT + redundant_temperature_raw = + #endif current_temperature_raw[1] = raw_temp_value[1]; - #if EXTRUDERS > 2 + #if HAS_TEMP_2 current_temperature_raw[2] = raw_temp_value[2]; - #if EXTRUDERS > 3 + #if HAS_TEMP_3 current_temperature_raw[3] = raw_temp_value[3]; #endif #endif #endif - #ifdef TEMP_SENSOR_1_AS_REDUNDANT - redundant_temperature_raw = raw_temp_value[1]; - #endif current_temperature_bed_raw = raw_temp_bed_value; + temp_meas_ready = true; } // @@ -1507,18 +1502,16 @@ ISR(TIMER0_COMPB_vect) { } // switch(temp_state) if (temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - if (!temp_meas_ready) { //Only update the raw values if they have been read. Else we could be updating them during reading. - set_current_temp_raw(); - } //!temp_meas_ready + // Update the raw values if they've been read. Else we could be updating them during reading. + if (!temp_meas_ready) set_current_temp_raw(); // Filament Sensor - can be read any time since IIR filtering is used #if HAS_FILAMENT_SENSOR current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach #endif - temp_meas_ready = true; temp_count = 0; - for (int i = 0; i < TEMP_SENSOR_COUNT; i++) raw_temp_value[i] = 0; + for (int i = 0; i < 4; i++) raw_temp_value[i] = 0; raw_temp_bed_value = 0; #ifndef HEATER_0_USES_MAX6675 From b76a352d41a2483409dfd471457d0db4fc0b9231 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 17:14:07 -0700 Subject: [PATCH 069/302] Fix the planeNormal calculation --- Marlin/Marlin_main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 47a4a7908..f1667cbf8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1110,11 +1110,13 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); + vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - vector_3 from_2_to_1 = (pt1 - pt2).get_normal(); - vector_3 from_2_to_3 = (pt3 - pt2).get_normal(); - vector_3 planeNormal = vector_3::cross(from_2_to_1, from_2_to_3).get_normal(); - planeNormal = vector_3(planeNormal.x, planeNormal.y, planeNormal.z); + if (planeNormal.z < 0) { + planeNormal.x = -planeNormal.x; + planeNormal.y = -planeNormal.y; + planeNormal.z = -planeNormal.z; + } plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); From 267d6bef15f7014b16f3fa093dc4a4f1fef621c3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 20:07:17 -0700 Subject: [PATCH 070/302] Eliminate most warnings - Fix a bug reading `code_value` for `M503 Sn` - Hide and remove unused variables --- Marlin/Marlin_main.cpp | 36 +++++++++++++++++++++--------------- Marlin/stepper.cpp | 6 +++--- Marlin/temperature.cpp | 2 +- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f1667cbf8..ee620bfbb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3548,7 +3548,6 @@ inline void gcode_M200() { } } - float area = .0; if (code_seen('D')) { float diameter = code_value(); // setting any extruder filament size disables volumetric on the assumption that @@ -4286,7 +4285,7 @@ inline void gcode_M502() { * M503: print settings currently in memory */ inline void gcode_M503() { - Config_PrintSettings(code_seen('S') && code_value == 0); + Config_PrintSettings(code_seen('S') && code_value() == 0); } #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED @@ -4583,9 +4582,14 @@ inline void gcode_T() { SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); } else { - boolean make_move = false; + #if EXTRUDERS > 1 + bool make_move = false; + #endif + if (code_seen('F')) { - make_move = true; + #if EXTRUDERS > 1 + make_move = true; + #endif next_feedrate = code_value(); if (next_feedrate > 0.0) feedrate = next_feedrate; } @@ -5182,20 +5186,22 @@ void ClearToSend() SERIAL_PROTOCOLLNPGM(MSG_OK); } -void get_coordinates() -{ - bool seen[4]={false,false,false,false}; - for(int8_t i=0; i < NUM_AXIS; i++) { - if(code_seen(axis_codes[i])) - { - destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i]; - seen[i]=true; +void get_coordinates() { + for (int i = 0; i < NUM_AXIS; i++) { + float dest; + if (code_seen(axis_codes[i])) { + dest = code_value(); + if (axis_relative_modes[i] || relative_mode) + dest += current_position[i]; } - else destination[i] = current_position[i]; //Are these else lines really needed? + else + dest = current_position[i]; + + destination[i] = dest; } - if(code_seen('F')) { + if (code_seen('F')) { next_feedrate = code_value(); - if(next_feedrate > 0.0) feedrate = next_feedrate; + if (next_feedrate > 0.0) feedrate = next_feedrate; } } diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 8be4b98af..8d55d7ba3 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1176,8 +1176,6 @@ void digipot_current(uint8_t driver, int current) { } void microstep_init() { - const uint8_t microstep_modes[] = MICROSTEP_MODES; - #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0 pinMode(E1_MS1_PIN,OUTPUT); pinMode(E1_MS2_PIN,OUTPUT); @@ -1192,7 +1190,9 @@ void microstep_init() { pinMode(Z_MS2_PIN,OUTPUT); pinMode(E0_MS1_PIN,OUTPUT); pinMode(E0_MS2_PIN,OUTPUT); - for (int i = 0; i <= 4; i++) microstep_mode(i, microstep_modes[i]); + const uint8_t microstep_modes[] = MICROSTEP_MODES; + for (int i = 0; i < sizeof(microstep_modes) / sizeof(microstep_modes[0]); i++) + microstep_mode(i, microstep_modes[i]); #endif } diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 4a5f7a7e5..6b26b0b5c 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -55,7 +55,7 @@ int target_temperature[EXTRUDERS] = { 0 }; int target_temperature_bed = 0; -int current_temperature_raw[EXTRUDERS] = { 0 }; +int current_temperature_raw[4] = { 0 }; float current_temperature[EXTRUDERS] = { 0.0 }; int current_temperature_bed_raw = 0; float current_temperature_bed = 0.0; From b2496533c6a5e632ec2fd537dac4ccfbbd53b4a9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Mar 2015 20:30:14 -0700 Subject: [PATCH 071/302] Put " M" into pmem --- Marlin/ConfigurationStore.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 2ae1e19a8..939d83f9e 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -754,8 +754,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); SERIAL_ECHO_START; } - SERIAL_ECHO(" M"); - SERIAL_ECHO(CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); + SERIAL_ECHOPAIR(" M", CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); SERIAL_ECHOPAIR(" Z", -zprobe_zoffset); #else if (!forReplay) { From 19d418cd6a343688cb5b433205eafd08e9586dda Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 00:32:58 -0700 Subject: [PATCH 072/302] Fix up the code to eliminate warnings --- Marlin/Marlin_main.cpp | 29 ++++++++++----------- Marlin/cardreader.cpp | 2 +- Marlin/configurator/config/language.h | 3 ++- Marlin/language.h | 1 + Marlin/pins.h | 6 +++++ Marlin/planner.cpp | 36 +++++++++++++-------------- Marlin/qr_solve.cpp | 1 - Marlin/stepper.cpp | 36 ++++++++++++++++----------- Marlin/ultralcd.h | 3 +-- 9 files changed, 65 insertions(+), 52 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 084dea197..2391b8b50 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -388,7 +388,11 @@ const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; static float destination[NUM_AXIS] = { 0, 0, 0, 0 }; static float offset[3] = { 0, 0, 0 }; -static bool home_all_axis = true; + +#ifndef DELTA + static bool home_all_axis = true; +#endif + static float feedrate = 1500.0, next_feedrate, saved_feedrate; static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; @@ -396,8 +400,8 @@ static bool relative_mode = false; //Determines Absolute or Relative Coordinate static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; #ifdef SDSUPPORT -static bool fromsd[BUFSIZE]; -#endif //!SDSUPPORT + static bool fromsd[BUFSIZE]; +#endif static int bufindr = 0; static int bufindw = 0; static int buflen = 0; @@ -1233,10 +1237,6 @@ static void do_blocking_move_to(float x, float y, float z) { feedrate = oldFeedRate; } -static void do_blocking_move_relative(float offset_x, float offset_y, float offset_z) { - do_blocking_move_to(current_position[X_AXIS] + offset_x, current_position[Y_AXIS] + offset_y, current_position[Z_AXIS] + offset_z); -} - static void setup_for_endstop_move() { saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; @@ -2150,7 +2150,6 @@ inline void gcode_G28() { } int verbose_level = 1; - float x_tmp, y_tmp, z_tmp, real_z; if (code_seen('V') || code_seen('v')) { verbose_level = code_value_long(); @@ -2436,6 +2435,7 @@ inline void gcode_G28() { // When the bed is uneven, this height must be corrected. if (!dryrun) { + float x_tmp, y_tmp, z_tmp, real_z; real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; @@ -3545,7 +3545,6 @@ inline void gcode_M200() { } } - float area = .0; if (code_seen('D')) { float diameter = code_value(); // setting any extruder filament size disables volumetric on the assumption that @@ -4283,7 +4282,7 @@ inline void gcode_M502() { * M503: print settings currently in memory */ inline void gcode_M503() { - Config_PrintSettings(code_seen('S') && code_value == 0); + Config_PrintSettings(code_seen('S') && code_value() == 0); } #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED @@ -4580,9 +4579,13 @@ inline void gcode_T() { SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); } else { - boolean make_move = false; + #if EXTRUDERS > 1 + bool make_move = false; + #endif if (code_seen('F')) { - make_move = true; + #if EXTRUDERS > 1 + make_move = true; + #endif next_feedrate = code_value(); if (next_feedrate > 0.0) feedrate = next_feedrate; } @@ -5181,12 +5184,10 @@ void ClearToSend() void get_coordinates() { - bool seen[4]={false,false,false,false}; for(int8_t i=0; i < NUM_AXIS; i++) { if(code_seen(axis_codes[i])) { destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i]; - seen[i]=true; } else destination[i] = current_position[i]; //Are these else lines really needed? } diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 125caab01..fae6c1be6 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -489,7 +489,7 @@ void CardReader::updir() { if (workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; - for (int d = 0; d < workDirDepth; d++) + for (uint16_t d = 0; d < workDirDepth; d++) workDirParents[d] = workDirParents[d+1]; } } diff --git a/Marlin/configurator/config/language.h b/Marlin/configurator/config/language.h index e13fc3176..a1c47133f 100644 --- a/Marlin/configurator/config/language.h +++ b/Marlin/configurator/config/language.h @@ -62,11 +62,12 @@ #endif #ifdef CUSTOM_MENDEL_NAME + #undef MACHINE_NAME #define MACHINE_NAME CUSTOM_MENDEL_NAME #endif #ifndef MACHINE_UUID - #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" #endif diff --git a/Marlin/language.h b/Marlin/language.h index 9e348c929..a7692bd80 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -62,6 +62,7 @@ #endif #ifdef CUSTOM_MENDEL_NAME + #undef MACHINE_NAME #define MACHINE_NAME CUSTOM_MENDEL_NAME #endif diff --git a/Marlin/pins.h b/Marlin/pins.h index 939dab5e6..1e79a0cad 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -167,12 +167,18 @@ #endif #ifdef DISABLE_MAX_ENDSTOPS + #undef X_MAX_PIN + #undef Y_MAX_PIN + #undef Z_MAX_PIN #define X_MAX_PIN -1 #define Y_MAX_PIN -1 #define Z_MAX_PIN -1 #endif #ifdef DISABLE_MIN_ENDSTOPS + #undef X_MIN_PIN + #undef Y_MIN_PIN + #undef Z_MIN_PIN #define X_MIN_PIN -1 #define Y_MIN_PIN -1 #define Z_MIN_PIN -1 diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index a1ef453c0..958941f58 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -701,26 +701,26 @@ float junction_deviation = 0.1; int moves_queued = movesplanned(); - // slow down when de buffer starts to empty, rather than wait at the corner for a buffer refill - bool mq = moves_queued > 1 && moves_queued < BLOCK_BUFFER_SIZE / 2; - #ifdef OLD_SLOWDOWN - if (mq) feed_rate *= 2.0 * moves_queued / BLOCK_BUFFER_SIZE; - #endif - - #ifdef SLOWDOWN - // segment time im micro seconds - unsigned long segment_time = lround(1000000.0/inverse_second); - if (mq) { - if (segment_time < minsegmenttime) { - // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. - inverse_second = 1000000.0 / (segment_time + lround(2 * (minsegmenttime - segment_time) / moves_queued)); - #ifdef XY_FREQUENCY_LIMIT - segment_time = lround(1000000.0 / inverse_second); - #endif + // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill + #if defined(OLD_SLOWDOWN) || defined(SLOWDOWN) + bool mq = moves_queued > 1 && moves_queued < BLOCK_BUFFER_SIZE / 2; + #ifdef OLD_SLOWDOWN + if (mq) feed_rate *= 2.0 * moves_queued / BLOCK_BUFFER_SIZE; + #endif + #ifdef SLOWDOWN + // segment time im micro seconds + unsigned long segment_time = lround(1000000.0/inverse_second); + if (mq) { + if (segment_time < minsegmenttime) { + // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. + inverse_second = 1000000.0 / (segment_time + lround(2 * (minsegmenttime - segment_time) / moves_queued)); + #ifdef XY_FREQUENCY_LIMIT + segment_time = lround(1000000.0 / inverse_second); + #endif + } } - } + #endif #endif - // END OF SLOW DOWN SECTION block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0 diff --git a/Marlin/qr_solve.cpp b/Marlin/qr_solve.cpp index f19d989d4..4202db067 100644 --- a/Marlin/qr_solve.cpp +++ b/Marlin/qr_solve.cpp @@ -607,7 +607,6 @@ double dnrm2 ( int n, double x[], int incx ) double norm; double scale; double ssq; - double value; if ( n < 1 || incx < 1 ) { diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 8be4b98af..add20d5f4 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -85,18 +85,24 @@ static volatile bool endstop_z_hit = false; int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT; #endif -static bool old_x_min_endstop = false, - old_x_max_endstop = false, - old_y_min_endstop = false, - old_y_max_endstop = false, - old_z_min_endstop = false, - #ifndef Z_DUAL_ENDSTOPS - old_z_max_endstop = false; - #else - old_z_max_endstop = false, - old_z2_min_endstop = false, - old_z2_max_endstop = false; - #endif +#if defined(X_MIN_PIN) && X_MIN_PIN >= 0 + static bool old_x_min_endstop = false; +#endif +#if defined(X_MAX_PIN) && X_MAX_PIN >= 0 + static bool old_x_max_endstop = false; +#endif +#if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 + static bool old_y_min_endstop = false; +#endif +#if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 + static bool old_y_max_endstop = false; +#endif + +static bool old_z_min_endstop = false, old_z_max_endstop = false; + +#ifdef Z_DUAL_ENDSTOPS + static bool old_z2_min_endstop = false, old_z2_max_endstop = false; +#endif static bool check_endstops = true; @@ -1176,8 +1182,6 @@ void digipot_current(uint8_t driver, int current) { } void microstep_init() { - const uint8_t microstep_modes[] = MICROSTEP_MODES; - #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0 pinMode(E1_MS1_PIN,OUTPUT); pinMode(E1_MS2_PIN,OUTPUT); @@ -1192,7 +1196,9 @@ void microstep_init() { pinMode(Z_MS2_PIN,OUTPUT); pinMode(E0_MS1_PIN,OUTPUT); pinMode(E0_MS2_PIN,OUTPUT); - for (int i = 0; i <= 4; i++) microstep_mode(i, microstep_modes[i]); + const uint8_t microstep_modes[] = MICROSTEP_MODES; + for (int i = 0; i < sizeof(microstep_modes) / sizeof(microstep_modes[0]); i++) + microstep_mode(i, microstep_modes[i]); #endif } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index befe8fd1e..b699b8a5d 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -17,10 +17,9 @@ #ifdef DOGLCD extern int lcd_contrast; void lcd_setcontrast(uint8_t value); + static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD #endif - static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD - #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x)) From 460f73056bd20458380c17fedaa5204e9b912570 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 00:46:39 -0700 Subject: [PATCH 073/302] Fix ECHOPAIR ambiguity - Also patch up some warnings --- Marlin/ConfigurationStore.cpp | 2 +- Marlin/Marlin_main.cpp | 2 +- Marlin/vector_3.cpp | 4 ++-- Marlin/vector_3.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 939d83f9e..3872b505d 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -754,7 +754,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M", CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); + SERIAL_ECHOPAIR(" M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); SERIAL_ECHOPAIR(" Z", -zprobe_zoffset); #else if (!forReplay) { diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ee620bfbb..70fd46957 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2922,7 +2922,7 @@ inline void gcode_M42() { do_blocking_move_to( X_probe_location, Y_probe_location, Z_start_location); // Make sure we are at the probe location if (n_legs) { - double radius=0.0, theta=0.0, x_sweep, y_sweep; + double radius=0.0, theta=0.0; int l; int rotational_direction = (unsigned long) millis() & 0x0001; // clockwise or counter clockwise radius = (unsigned long)millis() % (long)(X_MAX_LENGTH / 4); // limit how far out to go diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp index 681eceec2..243f0838f 100644 --- a/Marlin/vector_3.cpp +++ b/Marlin/vector_3.cpp @@ -59,7 +59,7 @@ void vector_3::apply_rotation(matrix_3x3 matrix) { z = resultZ; } -void vector_3::debug(char* title) { +void vector_3::debug(const char title[]) { SERIAL_PROTOCOL(title); SERIAL_PROTOCOLPGM(" x: "); SERIAL_PROTOCOL_F(x, 6); @@ -120,7 +120,7 @@ matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) { return new_matrix; } -void matrix_3x3::debug(char* title) { +void matrix_3x3::debug(const char title[]) { SERIAL_PROTOCOLLN(title); int count = 0; for(int i=0; i<3; i++) { diff --git a/Marlin/vector_3.h b/Marlin/vector_3.h index 0b9decafa..0c5938bac 100644 --- a/Marlin/vector_3.h +++ b/Marlin/vector_3.h @@ -37,7 +37,7 @@ struct vector_3 float get_length(); vector_3 get_normal(); - void debug(char* title); + void debug(const char title[]); void apply_rotation(matrix_3x3 matrix); }; @@ -52,7 +52,7 @@ struct matrix_3x3 void set_to_identity(); - void debug(char* title); + void debug(const char title[]); }; From 782464ea4d65884c63530362b4aaae349ec346b0 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Fri, 27 Mar 2015 20:22:59 +0100 Subject: [PATCH 074/302] Parentheses need here otherwise sanitycheck.h does wrong thing on line 222 --- Marlin/Conditionals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c471ec436..c72f9d13e 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -362,7 +362,7 @@ #define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0) #define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0) #define HAS_AUTO_FAN_3 (defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN >= 0) - #define HAS_AUTO_FAN HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 + #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3) #define HAS_FAN (defined(FAN_PIN) && FAN_PIN >= 0) /** From ce485175eb5f1e710a389bfdc1b467197d1e4849 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 16:11:28 -0700 Subject: [PATCH 075/302] Give all temp arrays 4 indices --- Marlin/temperature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 4a5f7a7e5..8f43aab08 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -53,10 +53,10 @@ //============================= public variables ============================ //=========================================================================== -int target_temperature[EXTRUDERS] = { 0 }; +int target_temperature[4] = { 0 }; int target_temperature_bed = 0; -int current_temperature_raw[EXTRUDERS] = { 0 }; -float current_temperature[EXTRUDERS] = { 0.0 }; +int current_temperature_raw[4] = { 0 }; +float current_temperature[4] = { 0.0 }; int current_temperature_bed_raw = 0; float current_temperature_bed = 0.0; #ifdef TEMP_SENSOR_1_AS_REDUNDANT From fe29bdd72b899c5a236617a82c79cad18f41ab5b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 16:26:07 -0700 Subject: [PATCH 076/302] Also fix temperature externs --- Marlin/temperature.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/temperature.h b/Marlin/temperature.h index b29fc2b57..853179be5 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -41,10 +41,10 @@ void manage_heater(); //it is critical that this is called periodically. // low level conversion routines // do not use these routines and variables outside of temperature.cpp -extern int target_temperature[EXTRUDERS]; -extern float current_temperature[EXTRUDERS]; +extern int target_temperature[4]; +extern float current_temperature[4]; #ifdef SHOW_TEMP_ADC_VALUES - extern int current_temperature_raw[EXTRUDERS]; + extern int current_temperature_raw[4]; extern int current_temperature_bed_raw; #endif extern int target_temperature_bed; From df02b992b0879fd04ed4143f7c4be98cbe6c5a09 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 16:37:22 -0700 Subject: [PATCH 077/302] Fix redundant_temperatrure_raw setting --- Marlin/temperature.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 8f43aab08..7b7eceaf7 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1181,9 +1181,10 @@ static void set_current_temp_raw() { #endif #if HAS_TEMP_1 #ifdef TEMP_SENSOR_1_AS_REDUNDANT - redundant_temperature_raw = + redundant_temperature_raw = raw_temp_value[1]; + #else + current_temperature_raw[1] = raw_temp_value[1]; #endif - current_temperature_raw[1] = raw_temp_value[1]; #if HAS_TEMP_2 current_temperature_raw[2] = raw_temp_value[2]; #if HAS_TEMP_3 From 55739a4efef19969e8fb167345593d4f520ca959 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 17:02:11 -0700 Subject: [PATCH 078/302] Fix Z_APPLY_STEP --- Marlin/stepper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 8d55d7ba3..40d5a36eb 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -155,7 +155,7 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; Z2_STEP_WRITE(v); \ } #else - #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v), Z2_STEP_WRITE(v) + #define Z_APPLY_STEP(v,Q) { Z_STEP_WRITE(v); Z2_STEP_WRITE(v); } #endif #else #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v) From ba871e46bf497f323cf35c8130608bea86e676a0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 27 Mar 2015 20:29:05 -0700 Subject: [PATCH 079/302] Fix compiler warnings - Patched up for most included configurations --- Marlin/ConfigurationStore.cpp | 4 +- Marlin/Marlin_main.cpp | 137 +++--- Marlin/configurator/config/language.h | 2 +- .../SCARA/Configuration_adv.h | 6 +- Marlin/language.h | 5 + Marlin/pins.h | 3 + Marlin/pins_3DRAG.h | 26 +- Marlin/pins_5DPRINT.h | 9 + Marlin/pins_AZTEEG_X3.h | 3 + Marlin/pins_AZTEEG_X3_PRO.h | 7 + Marlin/pins_BAM_DICE_DUE.h | 5 + Marlin/pins_FELIX2.h | 13 + Marlin/pins_HEPHESTOS.h | 3 + Marlin/pins_WITBOX.h | 3 + Marlin/stepper.cpp | 16 +- Marlin/temperature.cpp | 4 +- Marlin/ultralcd.cpp | 443 +++++++++--------- 17 files changed, 381 insertions(+), 308 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 3872b505d..b1da94a30 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -263,8 +263,6 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, dummy); } - int storageSize = i; - char ver2[4] = EEPROM_VERSION; int j = EEPROM_OFFSET; EEPROM_WRITE_VAR(j, ver2); // validate data @@ -446,7 +444,7 @@ void Config_ResetDefault() { float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT; float tmp2[] = DEFAULT_MAX_FEEDRATE; long tmp3[] = DEFAULT_MAX_ACCELERATION; - for (int i = 0; i < NUM_AXIS; i++) { + for (uint16_t i = 0; i < NUM_AXIS; i++) { axis_steps_per_unit[i] = tmp1[i]; max_feedrate[i] = tmp2[i]; max_acceleration_units_per_sq_second[i] = tmp3[i]; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 708333883..204226eeb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -937,19 +937,22 @@ void get_command() } - -float code_value() -{ - return (strtod(strchr_pointer + 1, NULL)); +float code_value() { + float ret; + char *e = strchr(strchr_pointer, 'E'); + if (e) { + *e = 0; + ret = strtod(strchr_pointer+1, NULL); + *e = 'E'; + } + else + ret = strtod(strchr_pointer+1, NULL); + return ret; } -long code_value_long() -{ - return (strtol(strchr_pointer + 1, NULL, 10)); -} +long code_value_long() { return (strtol(strchr_pointer + 1, NULL, 10)); } -bool code_seen(char code) -{ +bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); return (strchr_pointer != NULL); //Return True if a character was found } @@ -1008,76 +1011,70 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); #endif //DUAL_X_CARRIAGE static void axis_is_at_home(int axis) { -#ifdef DUAL_X_CARRIAGE - if (axis == X_AXIS) { - if (active_extruder != 0) { - current_position[X_AXIS] = x_home_pos(active_extruder); - min_pos[X_AXIS] = X2_MIN_POS; - max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS); - return; + + #ifdef DUAL_X_CARRIAGE + if (axis == X_AXIS) { + if (active_extruder != 0) { + current_position[X_AXIS] = x_home_pos(active_extruder); + min_pos[X_AXIS] = X2_MIN_POS; + max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS); + return; + } + else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { + current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; + min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS]; + max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS], + max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset); + return; + } } - else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) { - current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; - min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS]; - max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS], - max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset); - return; - } - } -#endif -#ifdef SCARA - float homeposition[3]; - char i; + #endif + + #ifdef SCARA + float homeposition[3]; - if (axis < 2) - { - - for (i=0; i<3; i++) - { - homeposition[i] = base_home_pos(i); - } - // SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]); - // SERIAL_ECHOPGM("homeposition[y]= "); SERIAL_ECHOLN(homeposition[1]); - // Works out real Homeposition angles using inverse kinematics, - // and calculates homing offset using forward kinematics - calculate_delta(homeposition); + if (axis < 2) { + + for (int i = 0; i < 3; i++) homeposition[i] = base_home_pos(i); + + // SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]); + // SERIAL_ECHOPGM("homeposition[y]= "); SERIAL_ECHOLN(homeposition[1]); + // Works out real Homeposition angles using inverse kinematics, + // and calculates homing offset using forward kinematics + calculate_delta(homeposition); - // SERIAL_ECHOPGM("base Theta= "); SERIAL_ECHO(delta[X_AXIS]); - // SERIAL_ECHOPGM(" base Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); + // SERIAL_ECHOPGM("base Theta= "); SERIAL_ECHO(delta[X_AXIS]); + // SERIAL_ECHOPGM(" base Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); - for (i=0; i<2; i++) - { - delta[i] -= home_offset[i]; - } + for (int i = 0; i < 2; i++) delta[i] -= home_offset[i]; - // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]); - // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]); - // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]); - // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); + // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]); + // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]); + // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]); + // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); - calculate_SCARA_forward_Transform(delta); + calculate_SCARA_forward_Transform(delta); - // SERIAL_ECHOPGM("Delta X="); SERIAL_ECHO(delta[X_AXIS]); - // SERIAL_ECHOPGM(" Delta Y="); SERIAL_ECHOLN(delta[Y_AXIS]); + // SERIAL_ECHOPGM("Delta X="); SERIAL_ECHO(delta[X_AXIS]); + // SERIAL_ECHOPGM(" Delta Y="); SERIAL_ECHOLN(delta[Y_AXIS]); - current_position[axis] = delta[axis]; + current_position[axis] = delta[axis]; - // SCARA home positions are based on configuration since the actual limits are determined by the - // inverse kinematic transform. - min_pos[axis] = base_min_pos(axis); // + (delta[axis] - base_home_pos(axis)); - max_pos[axis] = base_max_pos(axis); // + (delta[axis] - base_home_pos(axis)); - } - else - { + // SCARA home positions are based on configuration since the actual limits are determined by the + // inverse kinematic transform. + min_pos[axis] = base_min_pos(axis); // + (delta[axis] - base_home_pos(axis)); + max_pos[axis] = base_max_pos(axis); // + (delta[axis] - base_home_pos(axis)); + } + else { current_position[axis] = base_home_pos(axis) + home_offset[axis]; - min_pos[axis] = base_min_pos(axis) + home_offset[axis]; - max_pos[axis] = base_max_pos(axis) + home_offset[axis]; - } -#else - current_position[axis] = base_home_pos(axis) + home_offset[axis]; - min_pos[axis] = base_min_pos(axis) + home_offset[axis]; - max_pos[axis] = base_max_pos(axis) + home_offset[axis]; -#endif + min_pos[axis] = base_min_pos(axis) + home_offset[axis]; + max_pos[axis] = base_max_pos(axis) + home_offset[axis]; + } + #else + current_position[axis] = base_home_pos(axis) + home_offset[axis]; + min_pos[axis] = base_min_pos(axis) + home_offset[axis]; + max_pos[axis] = base_max_pos(axis) + home_offset[axis]; + #endif } #ifdef ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/configurator/config/language.h b/Marlin/configurator/config/language.h index a1c47133f..f1193b924 100644 --- a/Marlin/configurator/config/language.h +++ b/Marlin/configurator/config/language.h @@ -34,7 +34,6 @@ #endif #define PROTOCOL_VERSION "1.0" -#define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) #define MACHINE_NAME "Ultimaker" @@ -59,6 +58,7 @@ #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" #else // Default firmware set to Mendel #define MACHINE_NAME "Mendel" + #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" #endif #ifdef CUSTOM_MENDEL_NAME diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 452f8edeb..0a1833c75 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -275,13 +275,9 @@ #ifdef ADVANCE #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 1.75 #define STEPS_MM_E 1000 - #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) - #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA) - -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 diff --git a/Marlin/language.h b/Marlin/language.h index 89e45d8e6..10ef445d8 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -40,12 +40,14 @@ #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) + #undef FIRMWARE_URL #define MACHINE_NAME "Ultimaker" #define FIRMWARE_URL "http://firmware.ultimaker.com" #elif MB(RUMBA) #define MACHINE_NAME "Rumba" #elif MB(3DRAG) #define MACHINE_NAME "3Drag" + #undef FIRMWARE_URL #define FIRMWARE_URL "http://3dprint.elettronicain.it/" #elif MB(K8200) #define MACHINE_NAME "K8200" @@ -53,12 +55,15 @@ #define MACHINE_NAME "Makibox" #elif MB(SAV_MKI) #define MACHINE_NAME "SAV MkI" + #undef FIRMWARE_URL #define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" #elif MB(WITBOX) #define MACHINE_NAME "WITBOX" + #undef FIRMWARE_URL #define FIRMWARE_URL "http://www.bq.com/gb/downloads-witbox.html" #elif MB(HEPHESTOS) #define MACHINE_NAME "HEPHESTOS" + #undef FIRMWARE_URL #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" #else // Default firmware set to Mendel #define MACHINE_NAME "Mendel" diff --git a/Marlin/pins.h b/Marlin/pins.h index 1e79a0cad..3c75a73ba 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -127,10 +127,13 @@ #define _E3_PINS #if EXTRUDERS > 1 + #undef _E1_PINS #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN, analogInputToDigitalPin(TEMP_1_PIN), #if EXTRUDERS > 2 + #undef _E2_PINS #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN, analogInputToDigitalPin(TEMP_2_PIN), #if EXTRUDERS > 3 + #undef _E3_PINS #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, HEATER_3_PIN, analogInputToDigitalPin(TEMP_3_PIN), #endif #endif diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h index 9db6b56e4..fa54eea61 100644 --- a/Marlin/pins_3DRAG.h +++ b/Marlin/pins_3DRAG.h @@ -4,18 +4,25 @@ #include "pins_RAMPS_13.h" +#undef Z_ENABLE_PIN #define Z_ENABLE_PIN 63 +#undef X_MAX_PIN +#undef Y_MAX_PIN +#undef Z_MAX_PIN #define X_MAX_PIN 2 #define Y_MAX_PIN 15 #define Z_MAX_PIN -1 +#undef SDSS #define SDSS 25//53 -#define BEEPER 33 - +#undef FAN_PIN #define FAN_PIN 8 +#undef HEATER_1_PIN +#undef HEATER_2_PIN +#undef HEATER_BED_PIN #define HEATER_0_PIN 10 #define HEATER_1_PIN 12 #define HEATER_2_PIN 6 @@ -23,8 +30,15 @@ #define HEATER_BED_PIN 9 // BED #if defined(ULTRA_LCD) && defined(NEWPANEL) + #undef BEEPER #define BEEPER -1 + #undef LCD_PINS_RS + #undef LCD_PINS_ENABLE + #undef LCD_PINS_D4 + #undef LCD_PINS_D5 + #undef LCD_PINS_D6 + #undef LCD_PINS_D7 #define LCD_PINS_RS 27 #define LCD_PINS_ENABLE 29 #define LCD_PINS_D4 37 @@ -33,7 +47,15 @@ #define LCD_PINS_D7 31 // Buttons + #undef BTN_EN1 + #undef BTN_EN2 + #undef BTN_ENC #define BTN_EN1 16 #define BTN_EN2 17 #define BTN_ENC 23 //the click + +#else + + #define BEEPER 33 + #endif // ULTRA_LCD && NEWPANEL diff --git a/Marlin/pins_5DPRINT.h b/Marlin/pins_5DPRINT.h index 20e69ef36..b483326d3 100644 --- a/Marlin/pins_5DPRINT.h +++ b/Marlin/pins_5DPRINT.h @@ -64,6 +64,15 @@ // Microstepping pins // Note that the pin mapping is not from fastio.h // See Sd2PinMap.h for the pin configurations + +#undef X_MS1_PIN +#undef X_MS2_PIN +#undef Y_MS1_PIN +#undef Y_MS2_PIN +#undef Z_MS1_PIN +#undef Z_MS2_PIN +#undef E0_MS1_PIN +#undef E0_MS2_PIN #define X_MS1_PIN 25 #define X_MS2_PIN 26 #define Y_MS1_PIN 9 diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index d346e0bd2..3359fe8b1 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -4,7 +4,10 @@ #include "pins_RAMPS_13.h" +#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) + +#undef HEATER_1_PIN #define HEATER_1_PIN -1 #ifdef TEMP_STAT_LEDS diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 5d0d70db6..c58c359e6 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -4,7 +4,9 @@ #include "pins_RAMPS_13.h" +#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) + #define BEEPER 33 #define E2_STEP_PIN 23 @@ -19,6 +21,9 @@ #define E4_DIR_PIN 37 #define E4_ENABLE_PIN 42 +#undef HEATER_1_PIN +#undef HEATER_2_PIN +#undef HEATER_3_PIN #define HEATER_1_PIN -1 #define HEATER_2_PIN 16 #define HEATER_3_PIN 17 @@ -27,6 +32,8 @@ #define HEATER_6_PIN 6 #define HEATER_7_PIN 11 +#undef TEMP_2_PIN +#undef TEMP_3_PIN #define TEMP_2_PIN 12 // ANALOG NUMBERING #define TEMP_3_PIN 11 // ANALOG NUMBERING #define TEMP_4_PIN 10 // ANALOG NUMBERING diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h index c3123d043..fba7f1b8c 100644 --- a/Marlin/pins_BAM_DICE_DUE.h +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -4,8 +4,13 @@ #include "pins_RAMPS_13.h" +#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) + +#undef HEATER_1_PIN #define HEATER_1_PIN -1 +#undef TEMP_0_PIN +#undef TEMP_1_PIN #define TEMP_0_PIN 9 // ANALOG NUMBERING #define TEMP_1_PIN 11 // ANALOG NUMBERING diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 5b31c8de6..f54de3453 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -4,13 +4,23 @@ #include "pins_RAMPS_13.h" +#undef X_MAX_PIN +#undef Y_MAX_PIN +#undef Z_MAX_PIN #define X_MAX_PIN -1 #define Y_MAX_PIN -1 #define Z_MAX_PIN -1 +#undef Y2_STEP_PIN +#undef Y2_DIR_PIN +#undef Y2_ENABLE_PIN #define Y2_STEP_PIN -1 #define Y2_DIR_PIN -1 #define Y2_ENABLE_PIN -1 + +#undef Z2_STEP_PIN +#undef Z2_DIR_PIN +#undef Z2_ENABLE_PIN #define Z2_STEP_PIN -1 #define Z2_DIR_PIN -1 #define Z2_ENABLE_PIN -1 @@ -19,11 +29,14 @@ #define E1_DIR_PIN 34 #define E1_ENABLE_PIN 30 +#undef SDPOWER #define SDPOWER 1 +#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) #define PS_ON_PIN 12 +#undef HEATER_1_PIN #define HEATER_1_PIN 7 // EXTRUDER 2 #if defined(ULTRA_LCD) && defined(NEWPANEL) diff --git a/Marlin/pins_HEPHESTOS.h b/Marlin/pins_HEPHESTOS.h index 8fc5ba643..ec8d3fab2 100644 --- a/Marlin/pins_HEPHESTOS.h +++ b/Marlin/pins_HEPHESTOS.h @@ -4,5 +4,8 @@ #include "pins_RAMPS_13.h" +#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) + +#undef HEATER_1_PIN #define HEATER_1_PIN -1 diff --git a/Marlin/pins_WITBOX.h b/Marlin/pins_WITBOX.h index a4eb0e313..037b38de8 100644 --- a/Marlin/pins_WITBOX.h +++ b/Marlin/pins_WITBOX.h @@ -4,5 +4,8 @@ #include "pins_RAMPS_13.h" +#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) + +#undef HEATER_1_PIN #define HEATER_1_PIN -1 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index d3397ad56..bae91039f 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -97,11 +97,19 @@ static volatile bool endstop_z_hit = false; #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 static bool old_y_max_endstop = false; #endif - -static bool old_z_min_endstop = false, old_z_max_endstop = false; - +#if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 + static bool old_z_min_endstop = false; +#endif +#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 + static bool old_z_max_endstop = false; +#endif #ifdef Z_DUAL_ENDSTOPS - static bool old_z2_min_endstop = false, old_z2_max_endstop = false; + #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0 + static bool old_z2_min_endstop = false; + #endif + #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 + static bool old_z2_max_endstop = false; + #endif #endif static bool check_endstops = true; diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 7b7eceaf7..18f9d6c00 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -586,7 +586,9 @@ void manage_heater() { if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0); #endif //HEATER_0_USES_MAX6675 - unsigned long ms = millis(); + #if defined(WATCH_TEMP_PERIOD) || !defined(PIDTEMPBED) || HAS_AUTO_FAN + unsigned long ms = millis(); + #endif // Loop through all extruders for (int e = 0; e < EXTRUDERS; e++) { diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 98629ad51..c85f8e14d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -25,10 +25,6 @@ int absPreheatFanSpeed; unsigned long message_millis = 0; #endif -#ifdef ULTIPANEL - static float manual_feedrate[] = MANUAL_FEEDRATE; -#endif // ULTIPANEL - /* !Configuration settings */ //Function pointer to menu functions. @@ -38,193 +34,197 @@ uint8_t lcd_status_message_level; char lcd_status_message[LCD_WIDTH+1] = WELCOME_MSG; #ifdef DOGLCD -#include "dogm_lcd_implementation.h" + #include "dogm_lcd_implementation.h" #else -#include "ultralcd_implementation_hitachi_HD44780.h" + #include "ultralcd_implementation_hitachi_HD44780.h" #endif -/* Different menus */ +// The main status screen static void lcd_status_screen(); + #ifdef ULTIPANEL -extern bool powersupply; -static void lcd_main_menu(); -static void lcd_tune_menu(); -static void lcd_prepare_menu(); -static void lcd_move_menu(); -static void lcd_control_menu(); -static void lcd_control_temperature_menu(); -static void lcd_control_temperature_preheat_pla_settings_menu(); -static void lcd_control_temperature_preheat_abs_settings_menu(); -static void lcd_control_motion_menu(); -static void lcd_control_volumetric_menu(); -#ifdef DOGLCD -static void lcd_set_contrast(); -#endif -#ifdef FWRETRACT -static void lcd_control_retract_menu(); -#endif -static void lcd_sdcard_menu(); -#ifdef DELTA_CALIBRATION_MENU -static void lcd_delta_calibrate_menu(); -#endif // DELTA_CALIBRATION_MENU - -#if defined(MANUAL_BED_LEVELING) -#include "mesh_bed_leveling.h" -static void _lcd_level_bed(); -static void _lcd_level_bed_homing(); -static void lcd_level_bed(); -#endif // MANUAL_BED_LEVELING - -static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visual or audible feedback that something has happened - -/* Different types of actions that can be used in menu items. */ -static void menu_action_back(menuFunc_t data); -static void menu_action_submenu(menuFunc_t data); -static void menu_action_gcode(const char* pgcode); -static void menu_action_function(menuFunc_t data); -static void menu_action_sdfile(const char* filename, char* longFilename); -static void menu_action_sddirectory(const char* filename, char* longFilename); -static void menu_action_setting_edit_bool(const char* pstr, bool* ptr); -static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); -static void menu_action_setting_edit_float3(const char* pstr, float* ptr, float minValue, float maxValue); -static void menu_action_setting_edit_float32(const char* pstr, float* ptr, float minValue, float maxValue); -static void menu_action_setting_edit_float43(const char* pstr, float* ptr, float minValue, float maxValue); -static void menu_action_setting_edit_float5(const char* pstr, float* ptr, float minValue, float maxValue); -static void menu_action_setting_edit_float51(const char* pstr, float* ptr, float minValue, float maxValue); -static void menu_action_setting_edit_float52(const char* pstr, float* ptr, float minValue, float maxValue); -static void menu_action_setting_edit_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue); -static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); -static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, menuFunc_t callbackFunc); - -#define ENCODER_FEEDRATE_DEADZONE 10 - -#if !defined(LCD_I2C_VIKI) - #ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM 5 + extern bool powersupply; + static float manual_feedrate[] = MANUAL_FEEDRATE; + static void lcd_main_menu(); + static void lcd_tune_menu(); + static void lcd_prepare_menu(); + static void lcd_move_menu(); + static void lcd_control_menu(); + static void lcd_control_temperature_menu(); + static void lcd_control_temperature_preheat_pla_settings_menu(); + static void lcd_control_temperature_preheat_abs_settings_menu(); + static void lcd_control_motion_menu(); + static void lcd_control_volumetric_menu(); + #ifdef DOGLCD + static void lcd_set_contrast(); #endif - #ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 1 + #ifdef FWRETRACT + static void lcd_control_retract_menu(); #endif -#else - #ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation + static void lcd_sdcard_menu(); + + #ifdef DELTA_CALIBRATION_MENU + static void lcd_delta_calibrate_menu(); #endif - #ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 1 + + #if defined(MANUAL_BED_LEVELING) + #include "mesh_bed_leveling.h" + static void _lcd_level_bed(); + static void _lcd_level_bed_homing(); + static void lcd_level_bed(); + #endif + + static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visual or audible feedback that something has happened + + /* Different types of actions that can be used in menu items. */ + static void menu_action_back(menuFunc_t data); + static void menu_action_submenu(menuFunc_t data); + static void menu_action_gcode(const char* pgcode); + static void menu_action_function(menuFunc_t data); + static void menu_action_sdfile(const char* filename, char* longFilename); + static void menu_action_sddirectory(const char* filename, char* longFilename); + static void menu_action_setting_edit_bool(const char* pstr, bool* ptr); + static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); + static void menu_action_setting_edit_float3(const char* pstr, float* ptr, float minValue, float maxValue); + static void menu_action_setting_edit_float32(const char* pstr, float* ptr, float minValue, float maxValue); + static void menu_action_setting_edit_float43(const char* pstr, float* ptr, float minValue, float maxValue); + static void menu_action_setting_edit_float5(const char* pstr, float* ptr, float minValue, float maxValue); + static void menu_action_setting_edit_float51(const char* pstr, float* ptr, float minValue, float maxValue); + static void menu_action_setting_edit_float52(const char* pstr, float* ptr, float minValue, float maxValue); + static void menu_action_setting_edit_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue); + static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, menuFunc_t callbackFunc); + + #define ENCODER_FEEDRATE_DEADZONE 10 + + #if !defined(LCD_I2C_VIKI) + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 5 + #endif + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 1 + #endif + #else + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation + #endif + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 1 + #endif #endif -#endif -/* Helper macros for menus */ + /* Helper macros for menus */ -/** - * START_MENU generates the init code for a menu function - */ -#define START_MENU() do { \ - encoderRateMultiplierEnabled = false; \ - if (encoderPosition > 0x8000) encoderPosition = 0; \ - uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ - if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \ - uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ - bool wasClicked = LCD_CLICKED, itemSelected; \ - if (wasClicked) lcd_quick_feedback(); \ - for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ - _menuItemNr = 0; - -/** - * MENU_ITEM generates draw & handler code for a menu item, potentially calling: - * - * lcd_implementation_drawmenu_[type](sel, row, label, arg3...) - * menu_action_[type](arg3...) - * - * Examples: - * MENU_ITEM(back, MSG_WATCH, lcd_status_screen) - * lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH), lcd_status_screen) - * menu_action_back(lcd_status_screen) - * - * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) - * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) - * menu_action_function(lcd_sdcard_pause) - * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999) - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedmultiply, 10, 999) - * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedmultiply, 10, 999) - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedmultiply, 10, 999) - * - */ -#define MENU_ITEM(type, label, args...) do { \ - if (_menuItemNr == _lineNr) { \ - itemSelected = encoderLine == _menuItemNr; \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \ - if (wasClicked && itemSelected) { \ - menu_action_ ## type(args); \ - return; \ - } \ - } \ - _menuItemNr++; \ -} while(0) - -#ifdef ENCODER_RATE_MULTIPLIER /** - * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item + * START_MENU generates the init code for a menu function */ - #define MENU_MULTIPLIER_ITEM(type, label, args...) do { \ + #define START_MENU() do { \ + encoderRateMultiplierEnabled = false; \ + if (encoderPosition > 0x8000) encoderPosition = 0; \ + uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ + if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \ + uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ + bool wasClicked = LCD_CLICKED, itemSelected; \ + if (wasClicked) lcd_quick_feedback(); \ + for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ + _menuItemNr = 0; + + /** + * MENU_ITEM generates draw & handler code for a menu item, potentially calling: + * + * lcd_implementation_drawmenu_[type](sel, row, label, arg3...) + * menu_action_[type](arg3...) + * + * Examples: + * MENU_ITEM(back, MSG_WATCH, lcd_status_screen) + * lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH), lcd_status_screen) + * menu_action_back(lcd_status_screen) + * + * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) + * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) + * menu_action_function(lcd_sdcard_pause) + * + * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999) + * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedmultiply, 10, 999) + * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedmultiply, 10, 999) + * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedmultiply, 10, 999) + * + */ + #define MENU_ITEM(type, label, args...) do { \ if (_menuItemNr == _lineNr) { \ itemSelected = encoderLine == _menuItemNr; \ if (lcdDrawUpdate) \ lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \ if (wasClicked && itemSelected) { \ - encoderRateMultiplierEnabled = true; \ - lastEncoderMovementMillis = 0; \ menu_action_ ## type(args); \ return; \ } \ } \ _menuItemNr++; \ } while(0) -#endif //ENCODER_RATE_MULTIPLIER -#define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0) -#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) -#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) -#ifdef ENCODER_RATE_MULTIPLIER - #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) -#else //!ENCODER_RATE_MULTIPLIER - #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) -#endif //!ENCODER_RATE_MULTIPLIER -#define END_MENU() \ - if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\ - if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ - } } while(0) + #ifdef ENCODER_RATE_MULTIPLIER + /** + * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item + */ + #define MENU_MULTIPLIER_ITEM(type, label, args...) do { \ + if (_menuItemNr == _lineNr) { \ + itemSelected = encoderLine == _menuItemNr; \ + if (lcdDrawUpdate) \ + lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \ + if (wasClicked && itemSelected) { \ + encoderRateMultiplierEnabled = true; \ + lastEncoderMovementMillis = 0; \ + menu_action_ ## type(args); \ + return; \ + } \ + } \ + _menuItemNr++; \ + } while(0) + #endif //ENCODER_RATE_MULTIPLIER -/** Used variables to keep track of the menu */ -#ifndef REPRAPWORLD_KEYPAD -volatile uint8_t buttons;//Contains the bits of the currently pressed buttons. -#else -volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shift register values -#endif -#ifdef LCD_HAS_SLOW_BUTTONS -volatile uint8_t slow_buttons;//Contains the bits of the currently pressed buttons. -#endif -uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ -uint32_t blocking_enc; -uint8_t lastEncoderBits; -uint32_t encoderPosition; -#if (SDCARDDETECT > 0) -bool lcd_oldcardstatus; -#endif -#endif //ULTIPANEL + #define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0) + #define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) + #define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) + #ifdef ENCODER_RATE_MULTIPLIER + #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) + #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) + #else //!ENCODER_RATE_MULTIPLIER + #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) + #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) + #endif //!ENCODER_RATE_MULTIPLIER + #define END_MENU() \ + if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\ + if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ + } } while(0) + + /** Used variables to keep track of the menu */ + #ifndef REPRAPWORLD_KEYPAD + volatile uint8_t buttons; // Bits of the pressed buttons. + #else + volatile uint8_t buttons_reprapworld_keypad; // The reprapworld_keypad shift register values + #endif + #ifdef LCD_HAS_SLOW_BUTTONS + volatile uint8_t slow_buttons; // Bits of the pressed buttons. + #endif + uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ + uint32_t blocking_enc; + uint8_t lastEncoderBits; + uint32_t encoderPosition; + #if (SDCARDDETECT > 0) + bool lcd_oldcardstatus; + #endif + +#endif // ULTIPANEL menuFunc_t currentMenu = lcd_status_screen; /* function pointer to the currently active menu */ uint32_t lcd_next_update_millis; @@ -520,22 +520,21 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } -#if TEMP_SENSOR_1 != 0 //2nd extruder preheat - void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } -#endif //2nd extruder preheat +#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 //more than one extruder present -#if TEMP_SENSOR_2 != 0 //3 extruder preheat - void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } -#endif //3 extruder preheat + #if TEMP_SENSOR_1 != 0 + void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + #endif + #if TEMP_SENSOR_2 != 0 + void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + #endif + #if TEMP_SENSOR_3 != 0 + void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + #endif -#if TEMP_SENSOR_3 != 0 //4 extruder preheat - void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } -#endif //4 extruder preheat - -#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //more than one extruder present void lcd_preheat_pla0123() { setTargetHotend0(plaPreheatHotendTemp); setTargetHotend1(plaPreheatHotendTemp); @@ -548,54 +547,54 @@ void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTem setTargetHotend2(absPreheatHotendTemp); _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } -#endif //more than one extruder present -void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); } -void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); } + #if TEMP_SENSOR_0 != 0 -static void lcd_preheat_pla_menu() { - START_MENU(); - MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0); - #if TEMP_SENSOR_1 != 0 //2 extruder preheat - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1); - #endif //2 extruder preheat - #if TEMP_SENSOR_2 != 0 //3 extruder preheat - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2); - #endif //3 extruder preheat - #if TEMP_SENSOR_3 != 0 //4 extruder preheat - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3); - #endif //4 extruder preheat - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //all extruder preheat - MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123); - #endif //all extruder preheat - #if TEMP_SENSOR_BED != 0 - MENU_ITEM(function, MSG_PREHEAT_PLA_BEDONLY, lcd_preheat_pla_bedonly); + void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); } + + static void lcd_preheat_pla_menu() { + START_MENU(); + MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0); + #if TEMP_SENSOR_1 != 0 + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1); + #endif + #if TEMP_SENSOR_2 != 0 + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2); + #endif + #if TEMP_SENSOR_3 != 0 + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3); + #endif + MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123); + #if TEMP_SENSOR_BED != 0 + MENU_ITEM(function, MSG_PREHEAT_PLA_BEDONLY, lcd_preheat_pla_bedonly); + #endif + END_MENU(); + } + + static void lcd_preheat_abs_menu() { + START_MENU(); + MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0); + #if TEMP_SENSOR_1 != 0 + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1); + #endif + #if TEMP_SENSOR_2 != 0 + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2); + #endif + #if TEMP_SENSOR_3 != 0 + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3); + #endif + MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123); + #if TEMP_SENSOR_BED != 0 + MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly); + #endif + END_MENU(); + } #endif - END_MENU(); -} -static void lcd_preheat_abs_menu() { - START_MENU(); - MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0); - #if TEMP_SENSOR_1 != 0 //2 extruder preheat - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1); - #endif //2 extruder preheat - #if TEMP_SENSOR_2 != 0 //3 extruder preheat - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2); - #endif //3 extruder preheat - #if TEMP_SENSOR_3 != 0 //4 extruder preheat - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3); - #endif //4 extruder preheat - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //all extruder preheat - MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123); - #endif //all extruder preheat - #if TEMP_SENSOR_BED != 0 - MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly); - #endif - END_MENU(); -} +#endif // more than one temperature sensor present void lcd_cooldown() { setTargetHotend0(0); @@ -618,7 +617,7 @@ static void lcd_prepare_menu() { MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0")); #if TEMP_SENSOR_0 != 0 - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0 + #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu); MENU_ITEM(submenu, MSG_PREHEAT_ABS, lcd_preheat_abs_menu); #else From 9f3ff14008fbcdc82e12a4cdf57129fde29219b6 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 04:31:51 -0500 Subject: [PATCH 080/302] Enabled separate Z Probe and Z Axis endstop use at same time. Typo fixes in comments in existing code. --- Marlin/Configuration.h | 28 +++++++++++++++++++++++ Marlin/pins.h | 4 ++++ Marlin/pins_RAMPS_13.h | 1 + Marlin/stepper.cpp | 52 +++++++++++++++++++++++++++++++++++++++++- 4 files changed, 84 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ad7ec4590..ff6a57c23 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -317,6 +317,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. + //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS @@ -483,6 +484,33 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif +// If you have are a Z Probe in addition to endstop(s) for Z Homing, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. +// Only use this if you have both a Z PROBE and Z HOMING ENDSTOP(S). If you are using Z_SAFE_HOMING above, then you probably don't need this unless you want to make use of +// a non-default pin for your Z Probe. +// Note: It's expected that your Z Probe triggers in the direction towards your bed. If your Z Probe does not trigger when traveling towards you bed, it will trigger when it's moving +// away from the bed. + +// #define Z_PROBE_AND_ENDSTOP + + #ifdef Z_PROBE_AND_ENDSTOP + +// As of 3-28-2015, there are NO Z Probe pins defined in any board config files. +// Z_PROBE_PIN is for the signal pin only. RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D1 pin in the Aux 1 section of the RAMPS board for the signal. +// The D1 pin in Aux 1 on RAMPS maps to the Arduino D1 pin. The Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D1 pin on the RAMPS maps to D1 on Arduino, this works. +// If you have RAMPS 1.3/1.4 and want to use the RAMPS D1 pin, set Z_PROBE_PIN to 1 and use ground and 5v next to it as needed. Check the RAMPS 1.3/1.4 pinout diagram for details. +// WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. + #define Z_PROBE_PIN -1 + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). + const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. + +// The pullups are needed if you directly connect a mechanical endstop between the signal and ground pins. + #define ENDSTOPPULLUP_ZPROBE + +// If you want to enable the Z Probe pin, but disable its use, uncomment the line below. +// #define DISABLE_Z_PROBE_ENDSTOP + #endif + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/pins.h b/Marlin/pins.h index 939dab5e6..8f013d5d0 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -178,6 +178,10 @@ #define Z_MIN_PIN -1 #endif +#ifdef DISABLE_Z_PROBE_ENDSTOP + #define Z_PROBE_PIN -1 +#endif + #ifdef DISABLE_XMAX_ENDSTOP #undef X_MAX_PIN #define X_MAX_PIN -1 diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 71287f683..ece70005b 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -34,6 +34,7 @@ #define Z_ENABLE_PIN 62 #define Z_MIN_PIN 18 #define Z_MAX_PIN 19 +#define Z_PROBE_PIN -1 #define Y2_STEP_PIN 36 #define Y2_DIR_PIN 34 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 40d5a36eb..bf83c927e 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -97,6 +97,9 @@ static bool old_x_min_endstop = false, old_z2_min_endstop = false, old_z2_max_endstop = false; #endif + #if defined Z_PROBE_AND_ENDSTOP + old_z_probe_endstop = false; + #endif static bool check_endstops = true; @@ -520,6 +523,26 @@ ISR(TIMER1_COMPA_vect) { old_z2_min_endstop = z2_min_endstop; #endif #endif + + #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 + UPDATE_ENDSTOP(z, Z, probe, PROBE); + bool z_probe_endstop(READ(Z_PROBE_PIN) != Z_MIN_ENDSTOP_INVERTING); + if(z_probe_endstop && old_z_probe_endstop) + { + endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; + endstop_z_hit=true; + +// if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); + + + if (!(performing_homing)) //if not performing home + { + step_events_completed = current_block->step_event_count; + } + } + old_z_probe_endstop = z_probe_endstop; + old_z2_probe_endstop = z2_probe_endstop; + #endif } } else { // +direction @@ -554,6 +577,26 @@ ISR(TIMER1_COMPA_vect) { old_z2_max_endstop = z2_max_endstop; #endif #endif + + #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 + UPDATE_ENDSTOP(z, Z, probe, PROBE); + bool z_probe_endstop(READ(Z_PROBE_PIN) != Z_MAX_ENDSTOP_INVERTING); + if(z_probe_endstop && old_z_probe_endstop) + { + endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; + endstop_z_hit=true; + +// if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); + + + if (!(performing_homing)) //if not performing home + { + step_events_completed = current_block->step_event_count; + } + } + old_z_probe_endstop = z_probe_endstop; + old_z2_probe_endstop = z2_probe_endstop; + #endif } } @@ -635,7 +678,7 @@ ISR(TIMER1_COMPA_vect) { step_events_completed++; if (step_events_completed >= current_block->step_event_count) break; } - // Calculare new timer value + // Calculate new timer value unsigned short timer; unsigned short step_rate; if (step_events_completed <= (unsigned long int)current_block->accelerate_until) { @@ -918,6 +961,13 @@ void st_init() { #endif #endif +#if defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0 + SET_INPUT(Z_PROBE_PIN); + #ifdef ENDSTOPPULLUP_ZPROBE + WRITE(Z_PROBE_PIN,HIGH); + #endif +#endif + #define AXIS_INIT(axis, AXIS, PIN) \ AXIS ##_STEP_INIT; \ AXIS ##_STEP_WRITE(INVERT_## PIN ##_STEP_PIN); \ From 2979b40a7a3ef2937aa900c06b733ee3f6b4373a Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 04:41:03 -0500 Subject: [PATCH 081/302] Fixed typo in Z Probe and Endstop section. --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ff6a57c23..21141938b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -484,7 +484,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif -// If you have are a Z Probe in addition to endstop(s) for Z Homing, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. +// If you have a Z Probe in addition to endstop(s) for Z Homing, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. // Only use this if you have both a Z PROBE and Z HOMING ENDSTOP(S). If you are using Z_SAFE_HOMING above, then you probably don't need this unless you want to make use of // a non-default pin for your Z Probe. // Note: It's expected that your Z Probe triggers in the direction towards your bed. If your Z Probe does not trigger when traveling towards you bed, it will trigger when it's moving From 44b88b41a29ffd436ae79539a35749a5f98f9650 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 05:01:04 -0500 Subject: [PATCH 082/302] Added credit for code. --- Marlin/Configuration.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 21141938b..b8ef0755a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -484,6 +484,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif +// Z Probe and Z endstop support +// Added by Chris Roadfeldt 3-28-2015 // If you have a Z Probe in addition to endstop(s) for Z Homing, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. // Only use this if you have both a Z PROBE and Z HOMING ENDSTOP(S). If you are using Z_SAFE_HOMING above, then you probably don't need this unless you want to make use of // a non-default pin for your Z Probe. From 92eb8109ab73871da4b651c6f45cb908f0155a2f Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 05:09:48 -0500 Subject: [PATCH 083/302] Fix declaration of old_z_probe_endstop. --- Marlin/stepper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index bf83c927e..4241111d7 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -97,9 +97,10 @@ static bool old_x_min_endstop = false, old_z2_min_endstop = false, old_z2_max_endstop = false; #endif - #if defined Z_PROBE_AND_ENDSTOP - old_z_probe_endstop = false; - #endif + +#ifdef Z_PROBE_AND_ENDSTOP +static bool old_z_probe_endstop = false; +#endif static bool check_endstops = true; From fd823449adc46369ff4e3efdb51dfc03f041615e Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 05:42:38 -0500 Subject: [PATCH 084/302] Added serial message for Z Probe trigger. --- Marlin/Configuration.h | 6 +++--- Marlin/Marlin_main.cpp | 5 ++++- Marlin/language.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b8ef0755a..262b4e15b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -497,9 +497,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef Z_PROBE_AND_ENDSTOP // As of 3-28-2015, there are NO Z Probe pins defined in any board config files. -// Z_PROBE_PIN is for the signal pin only. RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D1 pin in the Aux 1 section of the RAMPS board for the signal. -// The D1 pin in Aux 1 on RAMPS maps to the Arduino D1 pin. The Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D1 pin on the RAMPS maps to D1 on Arduino, this works. -// If you have RAMPS 1.3/1.4 and want to use the RAMPS D1 pin, set Z_PROBE_PIN to 1 and use ground and 5v next to it as needed. Check the RAMPS 1.3/1.4 pinout diagram for details. +// Z_PROBE_PIN is for the signal pin only. RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board for the signal. +// The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. The Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. +// If you have RAMPS 1.3/1.4 and want to use the RAMPS D32 pin, set Z_PROBE_PIN to 32 and use ground and 5v next to it as needed. Check the RAMPS 1.3/1.4 pinout diagram for details. // WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. #define Z_PROBE_PIN -1 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0808a727d..ca06000b6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3509,7 +3509,10 @@ inline void gcode_M119() { SERIAL_PROTOCOLPGM(MSG_Z2_MAX); SERIAL_PROTOCOLLN(((READ(Z2_MAX_PIN)^Z2_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - + #if defined(Z_PROBE_PIN) && Z_PROBE_PIN >-1 + SERIAL_PROTOCOLPGM(MSG_Z_PROBE); + SERIALPROTOCOLLN(((READ(Z_PROBE_PIN)^72Z_PROBE_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); + #endif } /** diff --git a/Marlin/language.h b/Marlin/language.h index 3f2291a94..0fbaa39b1 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -132,6 +132,7 @@ #define MSG_Z_MIN "z_min: " #define MSG_Z_MAX "z_max: " #define MSG_Z2_MAX "z2_max: " +#define MSG_Z_PROBE "z_probe: " #define MSG_M119_REPORT "Reporting endstop status" #define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_OPEN "open" From 8b81f20c6127f4fd579512f004a85facf1a2501a Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 05:55:42 -0500 Subject: [PATCH 085/302] Filling in more places where Z_PROBE_PIN and Z_PROBE_AND_ENDSTOP need to be. Added Sanity Check for it. Added hook so it's enabled. --- Marlin/Marlin_main.cpp | 5 +++++ Marlin/SanityCheck.h | 11 ++++++----- Marlin/pins.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ca06000b6..7f8592b2c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1290,8 +1290,13 @@ static void engage_z_probe() { st_synchronize(); + #if defined(Z_PROBE_AND_ENDSTOP) + bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); + if (z_probe_endstop) + #else bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); if (z_min_endstop) + #endif { if (!Stopped) { diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index d5183abba..1024b6ab4 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -90,13 +90,14 @@ * Require a Z Min pin */ #if Z_MIN_PIN == -1 - #ifdef Z_PROBE_REPEATABILITY_TEST - #error You must have a Z_MIN endstop to enable Z_PROBE_REPEATABILITY_TEST. - #else - #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN endstop. Z_MIN_PIN must point to a valid hardware pin. + #if Z_PROBE_PIN == -1 + #ifdef Z_PROBE_REPEATABILITY_TEST + #error You must have a Z_MIN endstop to enable Z_PROBE_REPEATABILITY_TEST. + #else + #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin. + #endif #endif #endif - /** * Check if Probe_Offset * Grid Points is greater than Probing Range */ diff --git a/Marlin/pins.h b/Marlin/pins.h index 8f013d5d0..e9d06e998 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -211,7 +211,7 @@ #define Z_MIN_PIN -1 #endif -#define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \ +#define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, PS_ON_PIN, \ HEATER_BED_PIN, FAN_PIN, \ _E0_PINS _E1_PINS _E2_PINS _E3_PINS \ analogInputToDigitalPin(TEMP_BED_PIN) \ From 059052889f76dea37bfe9bd8e6b402231b9c0995 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sat, 28 Mar 2015 06:08:04 -0500 Subject: [PATCH 086/302] Further Sanity Checks for Z_PROBE_AND_ENDSTOP. --- Marlin/SanityCheck.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 1024b6ab4..5a24cbc1c 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -92,12 +92,22 @@ #if Z_MIN_PIN == -1 #if Z_PROBE_PIN == -1 #ifdef Z_PROBE_REPEATABILITY_TEST - #error You must have a Z_MIN endstop to enable Z_PROBE_REPEATABILITY_TEST. + #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST. #else #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin. #endif #endif #endif + + /** + * Require a Z Probe Pin if Z_PROBE_AND_ENDSTOP is enabled. + */ + #if defined(Z_PROBE_AND_ENDSTOP) + #if Z_PROBE_PIN == -1 + #error You must have a Z_PROBE_PIN defined if you enable Z_PROBE_AND_ENDSTOP + #endif + #endif + /** * Check if Probe_Offset * Grid Points is greater than Probing Range */ From c481c3b1808f281e0a7f8308238c339578f351d0 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 28 Mar 2015 13:14:38 +0100 Subject: [PATCH 087/302] Move variable blink from ultralcd.h to dogm_lcd_implementation.h to avoid warnings about unused blink. Concentrate definitions of variables in dogm_lcd_implementation.h to one place. Make only local used variable currentfont static. --- Marlin/dogm_lcd_implementation.h | 6 +++--- Marlin/ultralcd.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b9235145b..ae3468582 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -124,8 +124,6 @@ // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. -int lcd_contrast; - // LCD selection #ifdef U8GLIB_ST7920 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); @@ -143,7 +141,9 @@ U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 #include "utf_mapper.h" -char currentfont = 0; +int lcd_contrast; +static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD +static char currentfont = 0; static void lcd_setFont(char font_nr) { switch(font_nr) { diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index b699b8a5d..4cdecb8bd 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -17,7 +17,6 @@ #ifdef DOGLCD extern int lcd_contrast; void lcd_setcontrast(uint8_t value); - static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD #endif #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) From edb67ea165cf648982fc715a3262878506caa927 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 Mar 2015 14:13:25 -0700 Subject: [PATCH 088/302] Patch generic delta config - Addressing issue mentioned at #1699 --- .../delta/generic/Configuration.h | 19 ++++++++++--------- .../delta/kossel_mini/Configuration.h | 5 ++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index bbbcdbaae..41eb19f4a 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -107,11 +107,11 @@ Here are some standard links for getting your machine calibrated: // Horizontal offset of the universal joints on the carriages. #define DELTA_CARRIAGE_OFFSET 18.0 // mm -// Effective horizontal distance bridged by diagonal push rods. +// Horizontal distance bridged by diagonal push rods when effector is centered. #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET) // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). -#define DELTA_PRINTABLE_RADIUS 90 +#define DELTA_PRINTABLE_RADIUS 140 //=========================================================================== @@ -391,10 +391,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 90 -#define X_MIN_POS -90 -#define Y_MAX_POS 90 -#define Y_MIN_POS -90 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define X_MIN_POS -DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MIN_POS -DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS #define Z_MIN_POS 0 @@ -441,7 +441,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS - #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Non-linear bed leveling will be used. // Compensate by interpolating between the nearest four Z probe values for each point. @@ -532,7 +534,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves - // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -652,7 +653,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define DELTA_CALIBRATION_MENU /** - * I2C PANELS + * I2C Panels */ //#define LCD_I2C_SAINSMART_YWROBOT diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 7e58bb0b7..8381e1523 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -107,7 +107,6 @@ Here are some standard links for getting your machine calibrated: // Horizontal offset of the universal joints on the carriages. #define DELTA_CARRIAGE_OFFSET 19.5 // mm - // Horizontal distance bridged by diagonal push rods when effector is centered. #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET) @@ -531,8 +530,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define DEFAULT_MAX_FEEDRATE {500, 500, 500, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). From 22bea373930be493845ad6569f1f74d81b3ab6e1 Mon Sep 17 00:00:00 2001 From: Natealus Date: Sat, 28 Mar 2015 20:14:42 -0600 Subject: [PATCH 089/302] Azteeg X3 Pro Pin Revisions I added the fan pins in here and left them at -1 in configuration_adv.h and it works fine. Pinned for a 4 extruder from 1-4 and HE5 being the controller fan, HE6 being the Extruder Auto Fan/Water pump in the Kraken case, and HE7 being for part cooling fan. Added in descriptions for the MIN MAX pin swap and for servo motor additions. --- Marlin/pins_AZTEEG_X3_PRO.h | 55 +++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index c58c359e6..b9be31188 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -5,9 +5,35 @@ #include "pins_RAMPS_13.h" #undef FAN_PIN -#define FAN_PIN 9 // (Sprinter config) - +#define FAN_PIN 6 //Part Cooling System #define BEEPER 33 +#define CONTROLLERFAN_PIN 4 //Pin used for the fan to cool motherboard (-1 to disable) +//Fans/Water Pump to cool the hotend cool side. +#define EXTRUDER_0_AUTO_FAN_PIN 5 +#define EXTRUDER_1_AUTO_FAN_PIN 5 +#define EXTRUDER_2_AUTO_FAN_PIN 5 +#define EXTRUDER_3_AUTO_FAN_PIN 5 +// +//This section is to swap the MIN and MAX pins because the X3 Pro comes with only +//MIN endstops soldered onto the board. Delta code wants the homing endstops to be +//the MAX so I swapped them here. Comment them out with // if you want them original. +//Note: I had to solder on the additional MAX Endstop pins to attach a Z-Probe +//endstop switch. +// +#undef X_MIN_PIN +#undef X_MAX_PIN +#undef Y_MIN_PIN +#undef Y_MAX_PIN +#undef Z_MIN_PIN +#undef Z_MAX_PIN + +#define X_MIN_PIN 2 +#define X_MAX_PIN 3 +#define Y_MIN_PIN 15 +#define Y_MAX_PIN 14 +#define Z_MIN_PIN 19 +#define Z_MAX_PIN 18 +// #define E2_STEP_PIN 23 #define E2_DIR_PIN 25 @@ -24,7 +50,7 @@ #undef HEATER_1_PIN #undef HEATER_2_PIN #undef HEATER_3_PIN -#define HEATER_1_PIN -1 +#define HEATER_1_PIN 9 #define HEATER_2_PIN 16 #define HEATER_3_PIN 17 #define HEATER_4_PIN 4 @@ -39,3 +65,26 @@ #define TEMP_4_PIN 10 // ANALOG NUMBERING #define TC1 4 // ANALOG NUMBERING Thermo couple on Azteeg X3Pro #define TC2 5 // ANALOG NUMBERING Thermo couple on Azteeg X3Pro + +// +//These Servo pins are for when they are defined. Tested for usage with bed leveling +//on a Delta with 1 servo. Running through the Z servo endstop in code. +//Physical wire attachment was done on EXT1 on the GND, 5V, and D47 pins. +// +#undef SERVO0_PIN +#undef SERVO1_PIN +#undef SERVO2_PIN +#undef SERVO3_PIN + +#ifdef NUM_SERVOS + #define SERVO0_PIN -1 + #if NUM_SERVOS > 1 + #define SERVO1_PIN -1 + #if NUM_SERVOS > 2 + #define SERVO2_PIN 47 + #if NUM_SERVOS > 3 + #define SERVO3_PIN -1 + #endif + #endif + #endif +#endif From 2b0c25a091e7b4bf03b934642c89f212ae09e2bc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 Mar 2015 19:18:24 -0700 Subject: [PATCH 090/302] Tweak G92 to call plan_set_position only once, yes? --- Marlin/Marlin_main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 204226eeb..750b19c0b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2494,15 +2494,17 @@ inline void gcode_G92() { if (!code_seen(axis_codes[E_AXIS])) st_synchronize(); + bool didXYZ = false; for (int i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { - current_position[i] = code_value(); + float v = current_position[i] = code_value(); if (i == E_AXIS) - plan_set_e_position(current_position[E_AXIS]); + plan_set_e_position(v); else - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + didXYZ = true; } } + if (didXYZ) plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } #ifdef ULTIPANEL From afff968e88f4feb88c2630d2afdd77b4fb58882c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 Mar 2015 20:33:21 -0700 Subject: [PATCH 091/302] ARRAY_BY_EXTRUDERS, shorthand to sync planner - Add some documentation to planner and stepper headers - Patch up RAMBO pins with undefs - Add `sync_plan_position` inline to set current XYZE - Swap indices in `extruder_offset` to fix initialization values --- Marlin/Marlin_main.cpp | 207 +++++++++++++++-------------------------- Marlin/pins_RAMBO.h | 12 +++ Marlin/planner.cpp | 2 +- Marlin/planner.h | 26 +++++- Marlin/stepper.cpp | 2 +- 5 files changed, 112 insertions(+), 137 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 750b19c0b..222ad08b0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -211,72 +211,37 @@ bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; int extrudemultiply = 100; //100->1 200->2 -int extruder_multiply[EXTRUDERS] = { 100 - #if EXTRUDERS > 1 - , 100 - #if EXTRUDERS > 2 - , 100 - #if EXTRUDERS > 3 - , 100 - #endif - #endif - #endif -}; +int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; -float filament_size[EXTRUDERS] = { DEFAULT_NOMINAL_FILAMENT_DIA - #if EXTRUDERS > 1 - , DEFAULT_NOMINAL_FILAMENT_DIA - #if EXTRUDERS > 2 - , DEFAULT_NOMINAL_FILAMENT_DIA - #if EXTRUDERS > 3 - , DEFAULT_NOMINAL_FILAMENT_DIA - #endif - #endif - #endif -}; -float volumetric_multiplier[EXTRUDERS] = {1.0 - #if EXTRUDERS > 1 - , 1.0 - #if EXTRUDERS > 2 - , 1.0 - #if EXTRUDERS > 3 - , 1.0 - #endif - #endif - #endif -}; -float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 }; -float home_offset[3] = { 0, 0, 0 }; +float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); +float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS(1.0, 1.0, 1.0, 1.0); +float current_position[NUM_AXIS] = { 0.0 }; +float home_offset[3] = { 0 }; #ifdef DELTA - float endstop_adj[3] = { 0, 0, 0 }; + float endstop_adj[3] = { 0 }; #elif defined(Z_DUAL_ENDSTOPS) float z_endstop_adj = 0; #endif float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; -bool axis_known_position[3] = { false, false, false }; +bool axis_known_position[3] = { false }; // Extruder offset #if EXTRUDERS > 1 -#ifndef DUAL_X_CARRIAGE - #define NUM_EXTRUDER_OFFSETS 2 // only in XY plane -#else - #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane -#endif -float extruder_offset[NUM_EXTRUDER_OFFSETS][EXTRUDERS] = { - #if defined(EXTRUDER_OFFSET_X) - EXTRUDER_OFFSET_X - #else - 0 + #ifndef EXTRUDER_OFFSET_X + #define EXTRUDER_OFFSET_X 0 #endif - , - #if defined(EXTRUDER_OFFSET_Y) - EXTRUDER_OFFSET_Y - #else - 0 + #ifndef EXTRUDER_OFFSET_Y + #define EXTRUDER_OFFSET_Y 0 #endif -}; + #ifndef DUAL_X_CARRIAGE + #define NUM_EXTRUDER_OFFSETS 2 // only in XY plane + #else + #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane + #endif + #define _EXY { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y } + float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS] = ARRAY_BY_EXTRUDERS(_EXY, _EXY, _EXY, _EXY); #endif uint8_t active_extruder = 0; @@ -295,28 +260,8 @@ int fanSpeed = 0; #ifdef FWRETRACT bool autoretract_enabled = false; - bool retracted[EXTRUDERS] = { false - #if EXTRUDERS > 1 - , false - #if EXTRUDERS > 2 - , false - #if EXTRUDERS > 3 - , false - #endif - #endif - #endif - }; - bool retracted_swap[EXTRUDERS] = { false - #if EXTRUDERS > 1 - , false - #if EXTRUDERS > 2 - , false - #if EXTRUDERS > 3 - , false - #endif - #endif - #endif - }; + bool retracted[EXTRUDERS] = { false }; + bool retracted_swap[EXTRUDERS] = { false }; float retract_length = RETRACT_LENGTH; float retract_length_swap = RETRACT_LENGTH_SWAP; @@ -385,9 +330,9 @@ const char errormagic[] PROGMEM = "Error:"; const char echomagic[] PROGMEM = "echo:"; const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; -static float destination[NUM_AXIS] = { 0, 0, 0, 0 }; +static float destination[NUM_AXIS] = { 0 }; -static float offset[3] = { 0, 0, 0 }; +static float offset[3] = { 0 }; #ifndef DELTA static bool home_all_axis = true; @@ -993,7 +938,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); // second X-carriage offset when homed - otherwise X2_HOME_POS is used. // This allow soft recalibration of the second extruder offset position without firmware reflash // (through the M218 command). - return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS; + return (extruder_offset[1][X_AXIS] > 0) ? extruder_offset[1][X_AXIS] : X2_HOME_POS; } static int x_home_dir(int extruder) { @@ -1017,14 +962,14 @@ static void axis_is_at_home(int axis) { if (active_extruder != 0) { current_position[X_AXIS] = x_home_pos(active_extruder); min_pos[X_AXIS] = X2_MIN_POS; - max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS); + max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); return; } else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS]; max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS], - max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset); + max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); return; } } @@ -1077,12 +1022,18 @@ static void axis_is_at_home(int axis) { #endif } +/** + * Shorthand to tell the planner our current position (in mm). + */ +inline void sync_plan_position() { + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); +} + #ifdef ENABLE_AUTO_BED_LEVELING #ifdef AUTO_BED_LEVELING_GRID #ifndef DELTA -static void set_bed_level_equation_lsq(double *plane_equation_coefficients) -{ + static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); planeNormal.debug("planeNormal"); plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); @@ -1093,13 +1044,13 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients) //uncorrected_position.debug("position before"); vector_3 corrected_position = plan_get_position(); -// corrected_position.debug("position after"); + //corrected_position.debug("position after"); current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); -} + sync_plan_position(); + } #endif #else // not AUTO_BED_LEVELING_GRID @@ -1124,9 +1075,9 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float vector_3 corrected_position = plan_get_position(); current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); } #endif // AUTO_BED_LEVELING_GRID @@ -1172,18 +1123,14 @@ static void run_z_probe() { endstops_hit_on_purpose(); // move back down slowly to find bed - - if (homing_bump_divisor[Z_AXIS] >= 1) - { - feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS]; + if (homing_bump_divisor[Z_AXIS] >= 1) { + feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS]; } - else - { - feedrate = homing_feedrate[Z_AXIS]/10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + else { + feedrate = homing_feedrate[Z_AXIS]/10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); } - zPosition -= home_retract_mm(Z_AXIS) * 2; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); st_synchronize(); @@ -1191,7 +1138,7 @@ static void run_z_probe() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); // make sure the planner knows where we are as it may be a bit different than we last said to move to - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #endif } @@ -1471,7 +1418,7 @@ static void homeaxis(int axis) { #endif current_position[axis] = 0; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #ifndef Z_PROBE_SLED @@ -1497,7 +1444,7 @@ static void homeaxis(int axis) { st_synchronize(); current_position[axis] = 0; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); @@ -1520,7 +1467,7 @@ static void homeaxis(int axis) { if (axis==Z_AXIS) { feedrate = homing_feedrate[axis]; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); if (axis_home_dir > 0) { destination[axis] = (-1) * fabs(z_endstop_adj); @@ -1540,7 +1487,7 @@ static void homeaxis(int axis) { #ifdef DELTA // retrace by the amount specified in endstop_adj if (endstop_adj[axis] * axis_home_dir < 0) { - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); destination[axis] = endstop_adj[axis]; plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); @@ -1596,7 +1543,7 @@ void refresh_cmd_timeout(void) calculate_delta(current_position); // change cartesian kinematic to delta kinematic; plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); #else - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #endif prepare_move(); } @@ -1612,7 +1559,7 @@ void refresh_cmd_timeout(void) calculate_delta(current_position); // change cartesian kinematic to delta kinematic; plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); #else - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #endif //prepare_move(); } @@ -1789,7 +1736,7 @@ inline void gcode_G28() { // Move all carriages up together until the first endstop is hit. for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = 0; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH; feedrate = 1.732 * homing_feedrate[X_AXIS]; @@ -1829,7 +1776,7 @@ inline void gcode_G28() { extruder_duplication_enabled = false; #endif - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir; destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS); feedrate = homing_feedrate[X_AXIS]; @@ -1844,7 +1791,7 @@ inline void gcode_G28() { axis_is_at_home(X_AXIS); axis_is_at_home(Y_AXIS); - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); @@ -1921,7 +1868,7 @@ inline void gcode_G28() { feedrate = XY_TRAVEL_SPEED / 60; current_position[Z_AXIS] = 0; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); current_position[X_AXIS] = destination[X_AXIS]; @@ -1973,7 +1920,7 @@ inline void gcode_G28() { if (home_all_axis || code_seen(axis_codes[Z_AXIS])) current_position[Z_AXIS] += zprobe_zoffset; //Add Z_Probe offset (the distance is negative) #endif - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #endif // else DELTA @@ -1998,7 +1945,7 @@ inline void gcode_G28() { plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); mbl.active = 1; } #endif @@ -2069,7 +2016,7 @@ inline void gcode_G28() { int ix, iy; if (probe_point == 0) { current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); } else { ix = (probe_point-1) % MESH_NUM_X_POINTS; iy = (probe_point-1) / MESH_NUM_X_POINTS; @@ -2242,7 +2189,7 @@ inline void gcode_G28() { current_position[X_AXIS] = uncorrected_position.x; current_position[Y_AXIS] = uncorrected_position.y; current_position[Z_AXIS] = uncorrected_position.z; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #endif } @@ -2443,7 +2390,7 @@ inline void gcode_G28() { apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); } #endif // !DELTA @@ -2504,7 +2451,7 @@ inline void gcode_G92() { didXYZ = true; } } - if (didXYZ) plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + if (didXYZ) sync_plan_position(); } #ifdef ULTIPANEL @@ -3762,23 +3709,23 @@ inline void gcode_M206() { inline void gcode_M218() { if (setTargetedHotend(218)) return; - if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value(); - if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value(); + if (code_seen('X')) extruder_offset[tmp_extruder][X_AXIS] = code_value(); + if (code_seen('Y')) extruder_offset[tmp_extruder][Y_AXIS] = code_value(); #ifdef DUAL_X_CARRIAGE - if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value(); + if (code_seen('Z')) extruder_offset[tmp_extruder][Z_AXIS] = code_value(); #endif SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) { SERIAL_ECHO(" "); - SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]); + SERIAL_ECHO(extruder_offset[tmp_extruder][X_AXIS]); SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]); + SERIAL_ECHO(extruder_offset[tmp_extruder][Y_AXIS]); #ifdef DUAL_X_CARRIAGE SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]); + SERIAL_ECHO(extruder_offset[tmp_extruder][Z_AXIS]); #endif } SERIAL_EOL; @@ -4469,13 +4416,13 @@ inline void gcode_M503() { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); SERIAL_ECHO(" "); - SERIAL_ECHO(extruder_offset[X_AXIS][0]); + SERIAL_ECHO(extruder_offset[0][X_AXIS]); SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Y_AXIS][0]); + SERIAL_ECHO(extruder_offset[0][Y_AXIS]); SERIAL_ECHO(" "); SERIAL_ECHO(duplicate_extruder_x_offset); SERIAL_ECHO(","); - SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]); + SERIAL_ECHOLN(extruder_offset[1][Y_AXIS]); break; case DXC_FULL_CONTROL_MODE: case DXC_AUTO_PARK_MODE: @@ -4610,11 +4557,11 @@ inline void gcode_T() { // apply Y & Z extruder offset (x offset is already used in determining home pos) current_position[Y_AXIS] = current_position[Y_AXIS] - - extruder_offset[Y_AXIS][active_extruder] + - extruder_offset[Y_AXIS][tmp_extruder]; + extruder_offset[active_extruder][Y_AXIS] + + extruder_offset[tmp_extruder][Y_AXIS]; current_position[Z_AXIS] = current_position[Z_AXIS] - - extruder_offset[Z_AXIS][active_extruder] + - extruder_offset[Z_AXIS][tmp_extruder]; + extruder_offset[active_extruder][Z_AXIS] + + extruder_offset[tmp_extruder][Z_AXIS]; active_extruder = tmp_extruder; @@ -4644,7 +4591,7 @@ inline void gcode_T() { #else // !DUAL_X_CARRIAGE // Offset extruder (only by XY) for (int i=X_AXIS; i<=Y_AXIS; i++) - current_position[i] += extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder]; + current_position[i] += extruder_offset[tmp_extruder][i] - extruder_offset[active_extruder][i]; // Set the new active extruder and position active_extruder = tmp_extruder; #endif // !DUAL_X_CARRIAGE @@ -4653,7 +4600,7 @@ inline void gcode_T() { //sent position to plan_set_position(); plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS],current_position[E_AXIS]); #else - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); #endif // Move to the old position if 'F' was in the parameters if (make_move && !Stopped) prepare_move(); @@ -5494,7 +5441,7 @@ for (int s = 1; s <= steps; s++) { plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], max_feedrate[X_AXIS], 1); - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + sync_plan_position(); st_synchronize(); extruder_duplication_enabled = true; active_extruder_parked = false; diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 3849e2948..e17503579 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -22,6 +22,17 @@ #endif #endif +#undef X_MS1_PIN +#undef X_MS2_PIN +#undef Y_MS1_PIN +#undef Y_MS2_PIN +#undef Z_MS1_PIN +#undef Z_MS2_PIN +#undef E0_MS1_PIN +#undef E0_MS2_PIN +#undef E1_MS1_PIN +#undef E1_MS2_PIN + #define X_STEP_PIN 37 #define X_DIR_PIN 48 #define X_MIN_PIN 12 @@ -75,6 +86,7 @@ #define E1_MS1_PIN 63 #define E1_MS2_PIN 64 +#undef DIGIPOTSS_PIN #define DIGIPOTSS_PIN 38 #define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 958941f58..786527d0d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -342,7 +342,7 @@ void planner_recalculate_trapezoids() { // b. No speed reduction within one block requires faster deceleration than the one, true constant // acceleration. // 2. Go over every block in chronological order and dial down junction speed reduction values if -// a. The speed increase within one block would require faster accelleration than the one, true +// a. The speed increase within one block would require faster acceleration than the one, true // constant acceleration. // // When these stages are complete all blocks have an entry_factor that will allow all speed changes to diff --git a/Marlin/planner.h b/Marlin/planner.h index ed219fa23..41471a2b0 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -80,21 +80,37 @@ extern volatile unsigned char block_buffer_tail; FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); } #if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING) + #if defined(ENABLE_AUTO_BED_LEVELING) #include "vector_3.h" - // this holds the required transform to compensate for bed level + + // Transform required to compensate for bed level extern matrix_3x3 plan_bed_level_matrix; - // Get the position applying the bed level matrix if enabled + + /** + * Get the position applying the bed level matrix + */ vector_3 plan_get_position(); #endif // ENABLE_AUTO_BED_LEVELING - // Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in - // millimeters. Feed rate specifies the speed of the motion. + + /** + * Add a new linear movement to the buffer. x, y, z are the signed, absolute target position in + * millimeters. Feed rate specifies the (target) speed of the motion. + */ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder); - // Set position. Used for G92 instructions. + + /** + * Set the planner positions. Used for G92 instructions. + * Multiplies by axis_steps_per_unit[] to set stepper positions. + * Clears previous speed values. + */ void plan_set_position(float x, float y, float z, const float &e); + #else + void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder); void plan_set_position(const float &x, const float &y, const float &z, const float &e); + #endif // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING void plan_set_e_position(const float &e); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index bae91039f..bb45fe2a8 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1205,7 +1205,7 @@ void microstep_init() { pinMode(E0_MS1_PIN,OUTPUT); pinMode(E0_MS2_PIN,OUTPUT); const uint8_t microstep_modes[] = MICROSTEP_MODES; - for (int i = 0; i < sizeof(microstep_modes) / sizeof(microstep_modes[0]); i++) + for (uint16_t i = 0; i < sizeof(microstep_modes) / sizeof(microstep_modes[0]); i++) microstep_mode(i, microstep_modes[i]); #endif } From 234a9d0b12e6c2d1c709208803fde4904760111d Mon Sep 17 00:00:00 2001 From: Natealus Date: Sat, 28 Mar 2015 22:11:12 -0600 Subject: [PATCH 092/302] Viki 2 Pins from Manual I added in the pins into the new board files for the Azteeg X3, X3 Pro, Printrboard, and Rambo. I'm sure it can be added for others too but these are the manual specified pins. Just like many things here though, I can't test for the boards other than the Azteeg X3 Pro. Hopefully it works smoothly for everyone who happens on this nifty display. :) --- Marlin/pins_AZTEEG_X3.h | 28 ++++++++++++++++++++++++---- Marlin/pins_AZTEEG_X3_PRO.h | 23 +++++++++++++++++++++++ Marlin/pins_PRINTRBOARD.h | 23 +++++++++++++++++++++++ Marlin/pins_RAMBO.h | 20 ++++++++++++++++++++ 4 files changed, 90 insertions(+), 4 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index 3359fe8b1..ea98f95c5 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -4,13 +4,33 @@ #include "pins_RAMPS_13.h" -#undef FAN_PIN #define FAN_PIN 9 // (Sprinter config) - -#undef HEATER_1_PIN #define HEATER_1_PIN -1 -#ifdef TEMP_STAT_LEDS +//LCD Pins// + +#if defined(VIKI2) || defined(miniVIKI) + #define BEEPER 33 + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 31 + #define DOGLCD_CS 32 + #define LCD_SCREEN_ROT_180 + + //The encoder and click button + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 12 //the click switch + + #define SDSS 53 + #define SDCARDDETECT -1 // Pin 49 if using display sd interface + + #ifdef TEMP_STAT_LEDS + #define STAT_LED_RED 64 + #define STAT_LED_BLUE 63 + #endif +#endif + +#elif define TEMP_STAT_LEDS #define STAT_LED_RED 6 #define STAT_LED_BLUE 11 #endif diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index b9be31188..3ba85ccd1 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -88,3 +88,26 @@ #endif #endif #endif + +//LCD Pins// + +#if defined(VIKI2) || defined(miniVIKI) + #define BEEPER 33 + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 44 + #define DOGLCD_CS 45 + #define LCD_SCREEN_ROT_180 + + //The encoder and click button + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 39 //the click switch + + #define SDSS 53 + #define SDCARDDETECT 49 + + #define KILL_PIN 31 + + #define STAT_LED_RED 32 + #define STAT_LED_BLUE 35 +#endif diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index 2bf6efd14..74deb9157 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -59,6 +59,8 @@ #define TEMP_1_PIN -1 #define TEMP_2_PIN -1 +////LCD Pin Setup//// + #define SDPOWER -1 #define SDSS 8 #define LED_PIN -1 @@ -86,3 +88,24 @@ //not connected to a pin #define SDCARDDETECT -1 #endif // ULTRA_LCD && NEWPANEL + +#if defined(VIKI2) || defined(miniVIKI) + #define BEEPER 32 //FastIO + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 42 //Non-FastIO + #define DOGLCD_CS 43 //Non-FastIO + #define LCD_SCREEN_ROT_180 + + //The encoder and click button (FastIO Pins) + #define BTN_EN1 26 + #define BTN_EN2 27 + #define BTN_ENC 47 //the click switch + + #define SDSS 45 + #define SDCARDDETECT -1 // FastIO (Manual says 72 I'm not certain cause I can't test) + + #ifdef TEMP_STAT_LEDS + #define STAT_LED_RED 12 //Non-FastIO + #define STAT_LED_BLUE 10 //Non-FastIO + #endif +#endif diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 3849e2948..a1fc0e5c5 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -148,6 +148,26 @@ #endif // ULTRA_LCD +#if defined(VIKI2) || defined(miniVIKI) + #define BEEPER 44 + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 70 + #define DOGLCD_CS 71 + #define LCD_SCREEN_ROT_180 + + //The encoder and click button + #define BTN_EN1 85 + #define BTN_EN2 84 + #define BTN_ENC 83 //the click switch + + #define SDCARDDETECT -1 // Pin 72 if using easy adapter board + + #ifdef TEMP_STAT_LEDS + #define STAT_LED_RED 22 + #define STAT_LED_BLUE 32 + #endif +#endif // VIKI2/miniVIKI + #ifdef FILAMENT_SENSOR //Filip added pin for Filament sensor analog input #define FILWIDTH_PIN 3 From 18245c6cd2f036522cf9f6c3494d672eaa48d70f Mon Sep 17 00:00:00 2001 From: Nate Stokes Date: Sat, 28 Mar 2015 22:29:54 -0600 Subject: [PATCH 093/302] Update pins_RAMBO.h Updated for the changes that Thinkyhead made before I submitted mine. --- Marlin/pins_RAMBO.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index a1fc0e5c5..6d782b9d9 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -22,6 +22,17 @@ #endif #endif +#undef X_MS1_PIN +#undef X_MS2_PIN +#undef Y_MS1_PIN +#undef Y_MS2_PIN +#undef Z_MS1_PIN +#undef Z_MS2_PIN +#undef E0_MS1_PIN +#undef E0_MS2_PIN +#undef E1_MS1_PIN +#undef E1_MS2_PIN + #define X_STEP_PIN 37 #define X_DIR_PIN 48 #define X_MIN_PIN 12 @@ -75,6 +86,7 @@ #define E1_MS1_PIN 63 #define E1_MS2_PIN 64 +#undef DIGIPOTSS_PIN #define DIGIPOTSS_PIN 38 #define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping From 15028e9b0817a819a52fa62f3d7b8c638cf95e1b Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 29 Mar 2015 00:42:12 -0600 Subject: [PATCH 094/302] Undesired behavior with endstops swapped I made my changes to swap MIN and MAX endstops on the Azteeg X3 Pro the option rather than the default to fix unexpected reversal. --- Marlin/pins_AZTEEG_X3_PRO.h | 53 ++++++++++--------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 3ba85ccd1..26a7b2044 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -16,23 +16,21 @@ // //This section is to swap the MIN and MAX pins because the X3 Pro comes with only //MIN endstops soldered onto the board. Delta code wants the homing endstops to be -//the MAX so I swapped them here. Comment them out with // if you want them original. -//Note: I had to solder on the additional MAX Endstop pins to attach a Z-Probe -//endstop switch. +//the MAX so I swapped them here. UnComment the section below if you want this change. // -#undef X_MIN_PIN -#undef X_MAX_PIN -#undef Y_MIN_PIN -#undef Y_MAX_PIN -#undef Z_MIN_PIN -#undef Z_MAX_PIN - -#define X_MIN_PIN 2 -#define X_MAX_PIN 3 -#define Y_MIN_PIN 15 -#define Y_MAX_PIN 14 -#define Z_MIN_PIN 19 -#define Z_MAX_PIN 18 +//#undef X_MIN_PIN +//#undef X_MAX_PIN +//#undef Y_MIN_PIN +//#undef Y_MAX_PIN +//#undef Z_MIN_PIN +//#undef Z_MAX_PIN +// +//#define X_MIN_PIN 2 +//#define X_MAX_PIN 3 +//#define Y_MIN_PIN 15 +//#define Y_MAX_PIN 14 +//#define Z_MIN_PIN 19 +//#define Z_MAX_PIN 18 // #define E2_STEP_PIN 23 @@ -88,26 +86,3 @@ #endif #endif #endif - -//LCD Pins// - -#if defined(VIKI2) || defined(miniVIKI) - #define BEEPER 33 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - //The encoder and click button - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 //the click switch - - #define SDSS 53 - #define SDCARDDETECT 49 - - #define KILL_PIN 31 - - #define STAT_LED_RED 32 - #define STAT_LED_BLUE 35 -#endif From ca1477d8305ca45ad60d03c944ee49b76a0f4b1d Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 29 Mar 2015 00:52:53 -0600 Subject: [PATCH 095/302] Revert "Undesired behavior with endstops swapped" This reverts commit 15028e9b0817a819a52fa62f3d7b8c638cf95e1b. --- Marlin/pins_AZTEEG_X3_PRO.h | 53 +++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 26a7b2044..3ba85ccd1 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -16,21 +16,23 @@ // //This section is to swap the MIN and MAX pins because the X3 Pro comes with only //MIN endstops soldered onto the board. Delta code wants the homing endstops to be -//the MAX so I swapped them here. UnComment the section below if you want this change. +//the MAX so I swapped them here. Comment them out with // if you want them original. +//Note: I had to solder on the additional MAX Endstop pins to attach a Z-Probe +//endstop switch. // -//#undef X_MIN_PIN -//#undef X_MAX_PIN -//#undef Y_MIN_PIN -//#undef Y_MAX_PIN -//#undef Z_MIN_PIN -//#undef Z_MAX_PIN -// -//#define X_MIN_PIN 2 -//#define X_MAX_PIN 3 -//#define Y_MIN_PIN 15 -//#define Y_MAX_PIN 14 -//#define Z_MIN_PIN 19 -//#define Z_MAX_PIN 18 +#undef X_MIN_PIN +#undef X_MAX_PIN +#undef Y_MIN_PIN +#undef Y_MAX_PIN +#undef Z_MIN_PIN +#undef Z_MAX_PIN + +#define X_MIN_PIN 2 +#define X_MAX_PIN 3 +#define Y_MIN_PIN 15 +#define Y_MAX_PIN 14 +#define Z_MIN_PIN 19 +#define Z_MAX_PIN 18 // #define E2_STEP_PIN 23 @@ -86,3 +88,26 @@ #endif #endif #endif + +//LCD Pins// + +#if defined(VIKI2) || defined(miniVIKI) + #define BEEPER 33 + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 44 + #define DOGLCD_CS 45 + #define LCD_SCREEN_ROT_180 + + //The encoder and click button + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 39 //the click switch + + #define SDSS 53 + #define SDCARDDETECT 49 + + #define KILL_PIN 31 + + #define STAT_LED_RED 32 + #define STAT_LED_BLUE 35 +#endif From 04fda6b3e9c546e1bb3acec6151ab535fb8dce48 Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 29 Mar 2015 00:55:47 -0600 Subject: [PATCH 096/302] Undesired behavior with endstops swapped Made my swap commented out so its the option not the default. --- Marlin/pins_AZTEEG_X3_PRO.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 3ba85ccd1..83944c582 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -20,19 +20,19 @@ //Note: I had to solder on the additional MAX Endstop pins to attach a Z-Probe //endstop switch. // -#undef X_MIN_PIN -#undef X_MAX_PIN -#undef Y_MIN_PIN -#undef Y_MAX_PIN -#undef Z_MIN_PIN -#undef Z_MAX_PIN +//#undef X_MIN_PIN +//#undef X_MAX_PIN +//#undef Y_MIN_PIN +//#undef Y_MAX_PIN +//#undef Z_MIN_PIN +//#undef Z_MAX_PIN -#define X_MIN_PIN 2 -#define X_MAX_PIN 3 -#define Y_MIN_PIN 15 -#define Y_MAX_PIN 14 -#define Z_MIN_PIN 19 -#define Z_MAX_PIN 18 +//#define X_MIN_PIN 2 +//#define X_MAX_PIN 3 +//#define Y_MIN_PIN 15 +//#define Y_MAX_PIN 14 +//#define Z_MIN_PIN 19 +//#define Z_MAX_PIN 18 // #define E2_STEP_PIN 23 From ca5821aa5784387ea2dfc02bcb12cc3dd854543a Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 29 Mar 2015 01:08:00 -0600 Subject: [PATCH 097/302] Made #ifdef DELTA branch instead Another fellow here gave me the idea to do it this way --- Marlin/pins_AZTEEG_X3_PRO.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 83944c582..0cdc71601 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -16,23 +16,23 @@ // //This section is to swap the MIN and MAX pins because the X3 Pro comes with only //MIN endstops soldered onto the board. Delta code wants the homing endstops to be -//the MAX so I swapped them here. Comment them out with // if you want them original. -//Note: I had to solder on the additional MAX Endstop pins to attach a Z-Probe -//endstop switch. +//the MAX so I swapped them here. // -//#undef X_MIN_PIN -//#undef X_MAX_PIN -//#undef Y_MIN_PIN -//#undef Y_MAX_PIN -//#undef Z_MIN_PIN -//#undef Z_MAX_PIN + #ifdef DELTA + #undef X_MIN_PIN + #undef X_MAX_PIN + #undef Y_MIN_PIN + #undef Y_MAX_PIN + #undef Z_MIN_PIN + #undef Z_MAX_PIN -//#define X_MIN_PIN 2 -//#define X_MAX_PIN 3 -//#define Y_MIN_PIN 15 -//#define Y_MAX_PIN 14 -//#define Z_MIN_PIN 19 -//#define Z_MAX_PIN 18 + #define X_MIN_PIN 2 + #define X_MAX_PIN 3 + #define Y_MIN_PIN 15 + #define Y_MAX_PIN 14 + #define Z_MIN_PIN 19 + #define Z_MAX_PIN 18 + #endif // #define E2_STEP_PIN 23 From 324c14943bdb58a26cf95574dc9b0d329bbe4027 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 02:16:09 -0500 Subject: [PATCH 098/302] Bug fixes for Z_PROBE_AND_ENDSTOP. Code cleanup for Z_PROBE_AND_ENDSTOP. Added Z_PROBE_PIN to pins_RAMPS_13.h --- Marlin/Configuration.h | 3 +-- Marlin/Marlin_main.cpp | 9 +++++++-- Marlin/pins_RAMPS_13.h | 5 +++++ Marlin/stepper.cpp | 19 ++----------------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 262b4e15b..b23864065 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -499,9 +499,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // As of 3-28-2015, there are NO Z Probe pins defined in any board config files. // Z_PROBE_PIN is for the signal pin only. RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board for the signal. // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. The Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. -// If you have RAMPS 1.3/1.4 and want to use the RAMPS D32 pin, set Z_PROBE_PIN to 32 and use ground and 5v next to it as needed. Check the RAMPS 1.3/1.4 pinout diagram for details. +// D32 is currently selected in the RAMPS 1.3/1.4 pin file. Update the pins.h file for your control board to make use of this. Not doing so nullifies Z_PROBE_AND_ENDSTOP // WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. - #define Z_PROBE_PIN -1 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7f8592b2c..87ec4792c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1359,8 +1359,13 @@ static void retract_z_probe() { st_synchronize(); + #if defined(Z_PROBE_AND_ENDSTOP) + bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); + if (z_probe_endstop) + #else bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) + if (z_min_endstop) + #endif { if (!Stopped) { @@ -3516,7 +3521,7 @@ inline void gcode_M119() { #endif #if defined(Z_PROBE_PIN) && Z_PROBE_PIN >-1 SERIAL_PROTOCOLPGM(MSG_Z_PROBE); - SERIALPROTOCOLLN(((READ(Z_PROBE_PIN)^72Z_PROBE_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); + SERIAL_PROTOCOLLN(((READ(Z_PROBE_PIN)^Z_PROBE_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif } diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index ece70005b..4bd2bce46 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -62,6 +62,11 @@ #define FILWIDTH_PIN 5 #endif +#if defined(Z_PROBE_ANDENDSTOP) + // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. + #define 32 +#endif + #if defined(FILAMENT_RUNOUT_SENSOR) // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector #define FILRUNOUT_PIN 4 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 4241111d7..c246e5e52 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -527,22 +527,15 @@ ISR(TIMER1_COMPA_vect) { #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 UPDATE_ENDSTOP(z, Z, probe, PROBE); - bool z_probe_endstop(READ(Z_PROBE_PIN) != Z_MIN_ENDSTOP_INVERTING); + z_probe_endstop=(READ(Z_PROBE_PIN) != Z_MIN_ENDSTOP_INVERTING); if(z_probe_endstop && old_z_probe_endstop) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; endstop_z_hit=true; // if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); - - - if (!(performing_homing)) //if not performing home - { - step_events_completed = current_block->step_event_count; - } } old_z_probe_endstop = z_probe_endstop; - old_z2_probe_endstop = z2_probe_endstop; #endif } } @@ -581,22 +574,14 @@ ISR(TIMER1_COMPA_vect) { #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 UPDATE_ENDSTOP(z, Z, probe, PROBE); - bool z_probe_endstop(READ(Z_PROBE_PIN) != Z_MAX_ENDSTOP_INVERTING); + z_probe_endstop=(READ(Z_PROBE_PIN) != Z_MAX_ENDSTOP_INVERTING); if(z_probe_endstop && old_z_probe_endstop) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; endstop_z_hit=true; - // if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); - - - if (!(performing_homing)) //if not performing home - { - step_events_completed = current_block->step_event_count; - } } old_z_probe_endstop = z_probe_endstop; - old_z2_probe_endstop = z2_probe_endstop; #endif } } From 6125124d6c3e76d7826f81355779c9d0e958dce2 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 02:29:16 -0500 Subject: [PATCH 099/302] Config file cleanup for Z_PROBE_AND_ENDSTOP support. --- Marlin/Configuration.h | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b23864065..e2b0bfc37 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -309,6 +309,7 @@ your extruder heater takes 2 minutes to hit the target on heating. #define ENDSTOPPULLUP_XMIN #define ENDSTOPPULLUP_YMIN #define ENDSTOPPULLUP_ZMIN +#define ENDSTOPPULLUP_ZPROBE // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. @@ -317,9 +318,15 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS +// If you want to enable the Z Probe pin, but disable its use, uncomment the line below. +// This only affects a Z Probe Endstop if you have separate Z min endstop as well and have +// activated Z_PROBE_AND_ENDSTOP below. If you are using the Z Min endstop on your Z Probe, +// this has no effect. +//#define DISABLE_Z_PROBE_ENDSTOP // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 #define X_ENABLE_ON 0 @@ -484,33 +491,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif -// Z Probe and Z endstop support +// Seaparte concurrent Z Probe and Z min endstop support // Added by Chris Roadfeldt 3-28-2015 -// If you have a Z Probe in addition to endstop(s) for Z Homing, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. -// Only use this if you have both a Z PROBE and Z HOMING ENDSTOP(S). If you are using Z_SAFE_HOMING above, then you probably don't need this unless you want to make use of -// a non-default pin for your Z Probe. -// Note: It's expected that your Z Probe triggers in the direction towards your bed. If your Z Probe does not trigger when traveling towards you bed, it will trigger when it's moving -// away from the bed. - -// #define Z_PROBE_AND_ENDSTOP - - #ifdef Z_PROBE_AND_ENDSTOP - -// As of 3-28-2015, there are NO Z Probe pins defined in any board config files. -// Z_PROBE_PIN is for the signal pin only. RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board for the signal. +// If you have a Z Probe in addition to a Z min endstop, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. +// Only use this if you have both a Z PROBE and Z Min ENDSTOP. +// Note: It's expected that your Z Probe triggers in the direction towards your bed. +// In order to use this, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. +// RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board for the signal. // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. The Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. // D32 is currently selected in the RAMPS 1.3/1.4 pin file. Update the pins.h file for your control board to make use of this. Not doing so nullifies Z_PROBE_AND_ENDSTOP // WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. - -// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). - const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. - -// The pullups are needed if you directly connect a mechanical endstop between the signal and ground pins. - #define ENDSTOPPULLUP_ZPROBE - -// If you want to enable the Z Probe pin, but disable its use, uncomment the line below. -// #define DISABLE_Z_PROBE_ENDSTOP - #endif +// #define Z_PROBE_AND_ENDSTOP #endif // ENABLE_AUTO_BED_LEVELING From a98ac4033b605e622be3f0e35039b1bdd95c0466 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 02:36:26 -0500 Subject: [PATCH 100/302] Added Z_PROBE_PIN to #define for Z_PROBE_AND_ENDSTOP support. --- Marlin/pins_RAMPS_13.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 4bd2bce46..173310031 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -64,7 +64,7 @@ #if defined(Z_PROBE_ANDENDSTOP) // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. - #define 32 + #define Z_PROBE_PIN 32 #endif #if defined(FILAMENT_RUNOUT_SENSOR) From c75a5e8c551985cbb5aabc4e4475be6f54782c12 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 02:38:08 -0500 Subject: [PATCH 101/302] Fixed typo for Z_PROBE_AND_ENDSTOP support in pins_RAMPS.h. Confirmed Sanity checks are working..... --- Marlin/pins_RAMPS_13.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 173310031..3ca12dd15 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -62,7 +62,7 @@ #define FILWIDTH_PIN 5 #endif -#if defined(Z_PROBE_ANDENDSTOP) +#if defined(Z_PROBE_AND_ENDSTOP) // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. #define Z_PROBE_PIN 32 #endif From 05134f0807a1a3be6306947e5cf5a1c567522c5e Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 02:51:51 -0500 Subject: [PATCH 102/302] Additional Sanity Checks for Z_PROBE_AND_ENDSTOP --- Marlin/SanityCheck.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5a24cbc1c..cd8ef97c9 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -106,8 +106,16 @@ #if Z_PROBE_PIN == -1 #error You must have a Z_PROBE_PIN defined if you enable Z_PROBE_AND_ENDSTOP #endif + #ifndef (NUM_SERVOS) + #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_AND_ENDSTOP + #endif + #if defined(NUM_SERVOS) && NUM_SERVOS < 1 + #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_AND_ENDSTOP + #endif + #ifndef SERVO_ENDSTOPS + #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 1 to use Z_PROBE_AND_ENDSTOP + #endif #endif - /** * Check if Probe_Offset * Grid Points is greater than Probing Range */ From 82d2f111299f7c48be64b6f5830fc17cd2a0873d Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 02:53:55 -0500 Subject: [PATCH 103/302] More additional sanity checks for Z_PROBE_AND_ENDSTOP --- Marlin/SanityCheck.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index cd8ef97c9..8c60415fa 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -115,6 +115,9 @@ #ifndef SERVO_ENDSTOPS #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 1 to use Z_PROBE_AND_ENDSTOP #endif + #ifndef SERVO_ENDSTOP_ANGLES + #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP + #endif #endif /** * Check if Probe_Offset * Grid Points is greater than Probing Range From fe4549cd834e1b6b4901b74e163c2f8c12bf09fb Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 03:04:59 -0500 Subject: [PATCH 104/302] Config file Z_PROBE_AND_ENDSTOP description clean up. --- Marlin/Configuration.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e2b0bfc37..6d76a8ee4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -491,14 +491,13 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif -// Seaparte concurrent Z Probe and Z min endstop support +// Support for concurrent and seperate Z Probe and Z min endstop use. // Added by Chris Roadfeldt 3-28-2015 -// If you have a Z Probe in addition to a Z min endstop, uncomment the #define Z_PROBE_AND_ENDSTOP line below and configure Z Probe settings. -// Only use this if you have both a Z PROBE and Z Min ENDSTOP. -// Note: It's expected that your Z Probe triggers in the direction towards your bed. +// If you would like to use both a Z Probe and a Z min endstop at the same time, uncomment #define Z_PROBE_AND_ENDSTOP below +// You will want to disable Z_SAFE_HOMING above as you will still use the Z min endstop for homing. // In order to use this, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board for the signal. -// The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. The Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. +// The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. // D32 is currently selected in the RAMPS 1.3/1.4 pin file. Update the pins.h file for your control board to make use of this. Not doing so nullifies Z_PROBE_AND_ENDSTOP // WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. // #define Z_PROBE_AND_ENDSTOP From 80285251cccf1464b39469122e26804e23a96efb Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 03:06:20 -0500 Subject: [PATCH 105/302] More config cleanup work for Z_PROBE_AND_ENDSTOP. --- Marlin/Configuration.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6d76a8ee4..29ea48c59 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -500,6 +500,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. // D32 is currently selected in the RAMPS 1.3/1.4 pin file. Update the pins.h file for your control board to make use of this. Not doing so nullifies Z_PROBE_AND_ENDSTOP // WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. + // #define Z_PROBE_AND_ENDSTOP #endif // ENABLE_AUTO_BED_LEVELING From 08a7aa16c548951c0be7f7b5a4956f62768447f9 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 03:21:48 -0500 Subject: [PATCH 106/302] Don't deploy Z Probe on Z homing if Z_PROBE_AND_ENDSTOP is defined. --- Marlin/Marlin_main.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 87ec4792c..a020c6e0d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1493,18 +1493,20 @@ static void homeaxis(int axis) { #ifndef Z_PROBE_SLED - // Engage Servo endstop if enabled - #ifdef SERVO_ENDSTOPS - #if SERVO_LEVELING + // Engage Servo endstop if enabled and we are not using Z_PROBE_AND_ENDSTOP + #ifndef Z_PROBE_AND_ENDSTOP + #ifdef SERVO_ENDSTOPS + #if SERVO_LEVELING if (axis==Z_AXIS) { engage_z_probe(); } else - #endif + #endif if (servo_endstops[axis] > -1) { servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); } - #endif + #endif + #endif // Z_PROBE_AND_ENDSTOP #endif // Z_PROBE_SLED #ifdef Z_DUAL_ENDSTOPS if (axis==Z_AXIS) In_Homing_Process(true); @@ -1922,10 +1924,12 @@ inline void gcode_G28() { if (home_all_axis || code_seen(axis_codes[Z_AXIS])) { #if defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 + #ifndef Z_PROBE_AND_ENDSTOP destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); + #endif #endif HOMEAXIS(Z); } From 666fad349471c7d1d3b5556d30497966df5f7104 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 03:25:03 -0500 Subject: [PATCH 107/302] Typo fixed in sanity check. --- Marlin/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 8c60415fa..11d4d8464 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -106,7 +106,7 @@ #if Z_PROBE_PIN == -1 #error You must have a Z_PROBE_PIN defined if you enable Z_PROBE_AND_ENDSTOP #endif - #ifndef (NUM_SERVOS) + #ifndef NUM_SERVOS #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_AND_ENDSTOP #endif #if defined(NUM_SERVOS) && NUM_SERVOS < 1 From 62834a1c43ad20fe815d52fef1d3c1944b81a609 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 03:55:41 -0500 Subject: [PATCH 108/302] Don't deploy probe on Z Axis homing if Z_PROBE_AND_ENDSTOP is enabled, unless Z_SAFE_HOMING is. --- Marlin/Marlin_main.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a020c6e0d..520d4a6a5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1493,20 +1493,18 @@ static void homeaxis(int axis) { #ifndef Z_PROBE_SLED - // Engage Servo endstop if enabled and we are not using Z_PROBE_AND_ENDSTOP - #ifndef Z_PROBE_AND_ENDSTOP - #ifdef SERVO_ENDSTOPS - #if SERVO_LEVELING + // Engage Servo endstop if enabled and we are not using Z_PROBE_AND_ENDSTOP unless we are using Z_SAFE_HOMING + #ifdef SERVO_ENDSTOPS && (defined (Z_SAFE_HOMING) || ! defined (Z_PROBE_AND_ENDSTOP)) + #if SERVO_LEVELING if (axis==Z_AXIS) { engage_z_probe(); } else - #endif + #endif if (servo_endstops[axis] > -1) { servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); } - #endif - #endif // Z_PROBE_AND_ENDSTOP + #endif #endif // Z_PROBE_SLED #ifdef Z_DUAL_ENDSTOPS if (axis==Z_AXIS) In_Homing_Process(true); From a9802c95b32eac41b35b520db299fabf7a88e205 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Sun, 29 Mar 2015 04:18:37 -0500 Subject: [PATCH 109/302] Ensure Z_PROBE_PIN is defined if Z_PROBE_AND_ENDSTOP is. --- Marlin/SanityCheck.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 11d4d8464..1427da212 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -103,8 +103,11 @@ * Require a Z Probe Pin if Z_PROBE_AND_ENDSTOP is enabled. */ #if defined(Z_PROBE_AND_ENDSTOP) + #ifndef Z_PROBE_PIN + #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_AND_ENDSTOP + #endif #if Z_PROBE_PIN == -1 - #error You must have a Z_PROBE_PIN defined if you enable Z_PROBE_AND_ENDSTOP + #error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_AND_ENDSTOP #endif #ifndef NUM_SERVOS #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_AND_ENDSTOP From 81bab8739da44cb714659e3625f15fcfb7fe8a20 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 29 Mar 2015 17:29:48 +0200 Subject: [PATCH 110/302] Get back folder symbols on Hitachi displays and make use of column 20. --- Marlin/ultralcd_implementation_hitachi_HD44780.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index aaa55800a..c21785ed2 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -624,7 +624,7 @@ static void lcd_implementation_status_screen() static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) { char c; - uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2); + uint8_t n = LCD_WIDTH - 2; lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -633,12 +633,11 @@ static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const cha } while(n--) lcd.print(' '); lcd.print(post_char); - lcd.print(' '); } static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) { char c; - uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data); + uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -651,7 +650,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t r } static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) { char c; - uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data); + uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -688,11 +687,11 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { lcd.setCursor(1, 1); lcd_printPGM(pstr); lcd.print(':'); - lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1); + lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); lcd_print(value); } -static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) { +static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) { char c; uint8_t n = LCD_WIDTH - concat; lcd.setCursor(0, row); @@ -706,14 +705,15 @@ static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* ps filename++; } while (n--) lcd.print(' '); + lcd.print(post_char); } static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1); + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' '); } static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2); + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]); } #define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) From 0f1bd6e4a7036bacfd62fb82cb55e42c9dec17d0 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 01:40:58 +0200 Subject: [PATCH 111/302] In ST7920_SWSPI_SND_8BIT(uint8_t val) parameter is unsigned therefor in macro ST7920_WRITE_BYTE(a) cast a to uint8_t to make the compiler happy. --- Marlin/ultralcd_st7920_u8glib_rrd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index 6b6c005ad..fbf010982 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -43,7 +43,7 @@ static void ST7920_SWSPI_SND_8BIT(uint8_t val) #define ST7920_NCS() {WRITE(ST7920_CS_PIN,0);} #define ST7920_SET_CMD() {ST7920_SWSPI_SND_8BIT(0xf8);u8g_10MicroDelay();} #define ST7920_SET_DAT() {ST7920_SWSPI_SND_8BIT(0xfa);u8g_10MicroDelay();} -#define ST7920_WRITE_BYTE(a) {ST7920_SWSPI_SND_8BIT((a)&0xf0);ST7920_SWSPI_SND_8BIT((a)<<4);u8g_10MicroDelay();} +#define ST7920_WRITE_BYTE(a) {ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xf0u));ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u));u8g_10MicroDelay();} #define ST7920_WRITE_BYTES(p,l) {uint8_t i;for(i=0;i Date: Mon, 30 Mar 2015 01:42:35 +0200 Subject: [PATCH 112/302] Some additional {} to make the compiler happy. --- Marlin/stepper.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index bb45fe2a8..d0500ac2c 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -459,7 +459,7 @@ ISR(TIMER1_COMPA_vect) { #ifdef COREXY // Head direction in -X axis for CoreXY bots. // If DeltaX == -DeltaY, the movement is only in Y axis - if (current_block->steps[A_AXIS] != current_block->steps[B_AXIS] || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) + if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) { if (TEST(out_bits, X_HEAD)) #else if (TEST(out_bits, X_AXIS)) // stepping along -X axis (regular cartesians bot) @@ -487,9 +487,10 @@ ISR(TIMER1_COMPA_vect) { } } #ifdef COREXY + } // Head direction in -Y axis for CoreXY bots. // If DeltaX == DeltaY, the movement is only in X axis - if (current_block->steps[A_AXIS] != current_block->steps[B_AXIS] || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) + if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) { if (TEST(out_bits, Y_HEAD)) #else if (TEST(out_bits, Y_AXIS)) // -direction @@ -504,6 +505,9 @@ ISR(TIMER1_COMPA_vect) { UPDATE_ENDSTOP(y, Y, max, MAX); #endif } + #ifdef COREXY + } + #endif } if (TEST(out_bits, Z_AXIS)) { // -direction From 507efa771b762e72ebb4d19998dccd0b49944768 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 01:46:38 +0200 Subject: [PATCH 113/302] Remove unused variable fan_rot and satisfy the compiler about the implicit compare. --- Marlin/dogm_lcd_implementation.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index ae3468582..89cd5e835 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -256,9 +256,6 @@ static void _draw_heater_status(int x, int heater) { } static void lcd_implementation_status_screen() { - - static unsigned char fan_rot = 0; - u8g.setColorIndex(1); // black on white // Symbols menu graphics, animated fan @@ -485,7 +482,7 @@ static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const c lcd_implementation_mark_as_selected(row, isSelected); if (isDir) lcd_print(LCD_STR_FOLDER[0]); - while (c = *filename) { + while ((c = *filename)) { n -= lcd_print(c); filename++; } From 7b2550a604e33da35b88176381c044a396eb0392 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 01:58:46 +0200 Subject: [PATCH 114/302] Times can't be negative. cardreader.cpp needs temperature.h for autotempShutdown() when AUTOTEMP is defined but warns about unused variables. Unpublished variables by putting them in to temperature.cpp. --- Marlin/temperature.cpp | 15 +++++++++++++-- Marlin/temperature.h | 18 ++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 18f9d6c00..d0720c5ec 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -83,6 +83,17 @@ unsigned char soft_pwm_bed; #ifdef FILAMENT_SENSOR int current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only #endif +#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0 +void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); +static int thermal_runaway_state_machine[4]; // = {0,0,0,0}; +static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; +static bool thermal_runaway = false; +#if TEMP_SENSOR_BED != 0 + static int thermal_runaway_bed_state_machine; + static unsigned long thermal_runaway_bed_timer; +#endif +#endif + //=========================================================================== //=============================private variables============================ //=========================================================================== @@ -1100,8 +1111,8 @@ void disable_heater() { } #ifdef HEATER_0_USES_MAX6675 - #define MAX6675_HEAT_INTERVAL 250 - long max6675_previous_millis = MAX6675_HEAT_INTERVAL; + #define MAX6675_HEAT_INTERVAL 250u + unsigned long max6675_previous_millis = MAX6675_HEAT_INTERVAL; int max6675_temp = 2000; static int read_max6675() { diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 853179be5..79146a355 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -146,16 +146,10 @@ void disable_heater(); void setWatch(); void updatePID(); -#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0 -void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); -static int thermal_runaway_state_machine[4]; // = {0,0,0,0}; -static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; -static bool thermal_runaway = false; -#if TEMP_SENSOR_BED != 0 - static int thermal_runaway_bed_state_machine; - static unsigned long thermal_runaway_bed_timer; -#endif -#endif +void PID_autotune(float temp, int extruder, int ncycles); + +void setExtruderAutoFanState(int pin, bool state); +void checkExtruderAutoFans(); FORCE_INLINE void autotempShutdown() { #ifdef AUTOTEMP @@ -167,9 +161,5 @@ FORCE_INLINE void autotempShutdown() { #endif } -void PID_autotune(float temp, int extruder, int ncycles); - -void setExtruderAutoFanState(int pin, bool state); -void checkExtruderAutoFans(); #endif From e8ae51bfe329b4d510ddfce705bb78fc6c2adb82 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 18:06:59 -0700 Subject: [PATCH 115/302] Fix G28 homing Y with X - Fixed a typo causing G28 to home incorrectly - Added documentation to G28 - Added homeXYZ bools to neaten the code - Added a note about home_offsets being questionable --- Marlin/Marlin_main.cpp | 90 ++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 30 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 222ad08b0..20bd963b5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1703,7 +1703,25 @@ inline void gcode_G4() { #endif //FWRETRACT /** - * G28: Home all axes, one at a time + * G28: Home all axes according to settings + * + * Parameters + * + * None Home to all axes with no parameters. + * With QUICK_HOME enabled XY will home together, then Z. + * + * Cartesian parameters + * + * X Home to the X endstop + * Y Home to the Y endstop + * Z Home to the Z endstop + * + * If numbers are included with XYZ set the position as with G92 + * Currently adds the home_offset, which may be wrong and removed soon. + * + * Xn Home X, setting X to n + home_offset[X_AXIS] + * Yn Home Y, setting Y to n + home_offset[Y_AXIS] + * Zn Home Z, setting Z to n + home_offset[Z_AXIS] */ inline void gcode_G28() { #ifdef ENABLE_AUTO_BED_LEVELING @@ -1726,7 +1744,7 @@ inline void gcode_G28() { enable_endstops(true); - for (int i = X_AXIS; i < NUM_AXIS; i++) destination[i] = current_position[i]; + for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; // includes E_AXIS feedrate = 0.0; @@ -1757,23 +1775,25 @@ inline void gcode_G28() { #else // NOT DELTA - home_all_axis = !(code_seen(axis_codes[X_AXIS]) || code_seen(axis_codes[Y_AXIS]) || code_seen(axis_codes[Z_AXIS])); + bool homeX = code_seen(axis_codes[X_AXIS]), + homeY = code_seen(axis_codes[Y_AXIS]), + homeZ = code_seen(axis_codes[Z_AXIS]); + + home_all_axis = !homeX && !homeY && !homeZ; // No parameters means home all axes #if Z_HOME_DIR > 0 // If homing away from BED do Z first - if (home_all_axis || code_seen(axis_codes[Z_AXIS])) { - HOMEAXIS(Z); - } + if (home_all_axis || homeZ) HOMEAXIS(Z); #endif #ifdef QUICK_HOME - if (home_all_axis || code_seen(axis_codes[X_AXIS] && code_seen(axis_codes[Y_AXIS]))) { //first diagonal move + if (home_all_axis || (homeX && homeY)) { //first diagonal move current_position[X_AXIS] = current_position[Y_AXIS] = 0; - #ifndef DUAL_X_CARRIAGE - int x_axis_home_dir = home_dir(X_AXIS); - #else + #ifdef DUAL_X_CARRIAGE int x_axis_home_dir = x_home_dir(active_extruder); extruder_duplication_enabled = false; + #else + int x_axis_home_dir = home_dir(X_AXIS); #endif sync_plan_position(); @@ -1807,7 +1827,8 @@ inline void gcode_G28() { } #endif //QUICK_HOME - if ((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) { + // Home X + if (home_all_axis || homeX) { #ifdef DUAL_X_CARRIAGE int tmp_extruder = active_extruder; extruder_duplication_enabled = false; @@ -1825,31 +1846,38 @@ inline void gcode_G28() { #endif } - if (home_all_axis || code_seen(axis_codes[Y_AXIS])) HOMEAXIS(Y); + // Home Y + if (home_all_axis || homeY) HOMEAXIS(Y); + // Set the X position, if included + // Adds the home_offset as well, which may be wrong if (code_seen(axis_codes[X_AXIS])) { - if (code_value_long() != 0) { - current_position[X_AXIS] = code_value() - #ifndef SCARA - + home_offset[X_AXIS] - #endif - ; - } + float v = code_value(); + if (v) current_position[X_AXIS] = v + #ifndef SCARA + + home_offset[X_AXIS] + #endif + ; } - if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) { - current_position[Y_AXIS] = code_value() + // Set the Y position, if included + // Adds the home_offset as well, which may be wrong + if (code_seen(axis_codes[Y_AXIS])) { + float v = code_value(); + if (v) current_position[Y_AXIS] = v #ifndef SCARA + home_offset[Y_AXIS] #endif ; } - #if Z_HOME_DIR < 0 // If homing towards BED do Z last + // Home Z last if homing towards the bed + #if Z_HOME_DIR < 0 #ifndef Z_SAFE_HOMING - if (home_all_axis || code_seen(axis_codes[Z_AXIS])) { + if (home_all_axis || homeZ) { + // Raise Z before homing Z? Shouldn't this happen before homing X or Y? #if defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; @@ -1878,7 +1906,7 @@ inline void gcode_G28() { } // Let's see if X and Y are homed and probe is inside bed area. - if (code_seen(axis_codes[Z_AXIS])) { + if (homeZ) { if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { @@ -1912,13 +1940,15 @@ inline void gcode_G28() { #endif // Z_HOME_DIR < 0 - - if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0) - current_position[Z_AXIS] = code_value() + home_offset[Z_AXIS]; + // Set the Z position, if included + // Adds the home_offset as well, which may be wrong + if (code_seen(axis_codes[Z_AXIS])) { + float v = code_value(); + if (v) current_position[Z_AXIS] = v + home_offset[Z_AXIS]; + } #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0) - if (home_all_axis || code_seen(axis_codes[Z_AXIS])) - current_position[Z_AXIS] += zprobe_zoffset; //Add Z_Probe offset (the distance is negative) + if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative) #endif sync_plan_position(); @@ -2741,7 +2771,7 @@ inline void gcode_M42() { * E = Engage probe for each reading * L = Number of legs of movement before probe * - * This function assumes the bed has been homed. Specificaly, that a G28 command + * This function assumes the bed has been homed. Specifically, that a G28 command * as been issued prior to invoking the M48 Z-Probe repeatability measurement function. * Any information generated by a prior G29 Bed leveling command will be lost and need to be * regenerated. From 803425e12c425f64a3ce348b5be2cdbff9f613d2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 18:56:09 -0700 Subject: [PATCH 116/302] Fix G29 E and M48 n - Users prefer `G29 E` to work like `M48 E` so fixed that - `M48 n` replaced with `M48 P` (or `p`). `n` legacy support - Shorten some strings to save precious bytes - Smaller code for 3-point probing --- Marlin/Marlin_main.cpp | 60 +++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 20bd963b5..8b9cf1e39 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2108,8 +2108,8 @@ inline void gcode_G28() { * * Global Parameters: * - * E/e By default G29 engages / disengages the probe for each point. - * Include "E" to engage and disengage the probe just once. + * E/e By default G29 will engages the probe, test the bed, then disengage. + * Include "E" to engage/disengage the probe for each sample. * There's no extra effect if you have a fixed probe. * Usage: "G29 E" or "G29 e" * @@ -2135,7 +2135,7 @@ inline void gcode_G28() { } bool dryrun = code_seen('D') || code_seen('d'); - bool enhanced_g29 = code_seen('E') || code_seen('e'); + bool engage_probe_for_each_reading = code_seen('E') || code_seen('e'); #ifdef AUTO_BED_LEVELING_GRID @@ -2293,16 +2293,14 @@ inline void gcode_G28() { // Enhanced G29 - Do not retract servo between probes ProbeAction act; - if (enhanced_g29) { - if (yProbe == front_probe_bed_position && xCount == 0) - act = ProbeEngage; - else if (yProbe == front_probe_bed_position + (yGridSpacing * (auto_bed_leveling_grid_points - 1)) && xCount == auto_bed_leveling_grid_points - 1) - act = ProbeRetract; - else - act = ProbeStay; - } - else + if (engage_probe_for_each_reading) act = ProbeEngageAndRetract; + else if (yProbe == front_probe_bed_position && xCount == 0) + act = ProbeEngage; + else if (yProbe == front_probe_bed_position + (yGridSpacing * (auto_bed_leveling_grid_points - 1)) && xCount == auto_bed_leveling_grid_points - 1) + act = ProbeRetract; + else + act = ProbeStay; measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level); @@ -2386,18 +2384,14 @@ inline void gcode_G28() { // Probe at 3 arbitrary points float z_at_pt_1, z_at_pt_2, z_at_pt_3; - - if (enhanced_g29) { - // Basic Enhanced G29 - z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, ProbeEngage, verbose_level); - z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeStay, verbose_level); - z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeRetract, verbose_level); - } - else { - z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, ProbeEngageAndRetract, verbose_level); - z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level); - z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level); - } + ProbeAction p1, p2, p3; + if (engage_probe_for_each_reading) + p1 = p2 = p3 = ProbeEngageAndRetract; + else + p1 = ProbeEngage, p2 = ProbeStay, p3 = ProbeRetract; + z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, p1, verbose_level); + z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p2, verbose_level); + z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); clean_up_after_endstop_move(); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); @@ -2764,7 +2758,7 @@ inline void gcode_M42() { * * Usage: * M48 - * n = Number of samples (4-50, default 10) + * P = Number of sampled points (4-50, default 10) * X = Sample X position * Y = Sample Y position * V = Verbose level (0-4, default=1) @@ -2798,10 +2792,10 @@ inline void gcode_M42() { if (verbose_level > 0) SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); - if (code_seen('n')) { + if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`! n_samples = code_value(); if (n_samples < 4 || n_samples > 50) { - SERIAL_PROTOCOLPGM("?Specified sample size not plausible (4-50).\n"); + SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); return; } } @@ -2818,7 +2812,7 @@ inline void gcode_M42() { if (code_seen('X') || code_seen('x')) { X_probe_location = code_value() - X_PROBE_OFFSET_FROM_EXTRUDER; if (X_probe_location < X_MIN_POS || X_probe_location > X_MAX_POS) { - SERIAL_PROTOCOLPGM("?Specified X position out of range.\n"); + SERIAL_PROTOCOLPGM("?X position out of range.\n"); return; } } @@ -2826,7 +2820,7 @@ inline void gcode_M42() { if (code_seen('Y') || code_seen('y')) { Y_probe_location = code_value() - Y_PROBE_OFFSET_FROM_EXTRUDER; if (Y_probe_location < Y_MIN_POS || Y_probe_location > Y_MAX_POS) { - SERIAL_PROTOCOLPGM("?Specified Y position out of range.\n"); + SERIAL_PROTOCOLPGM("?Y position out of range.\n"); return; } } @@ -2835,7 +2829,7 @@ inline void gcode_M42() { n_legs = code_value(); if (n_legs == 1) n_legs = 2; if (n_legs < 0 || n_legs > 15) { - SERIAL_PROTOCOLPGM("?Specified number of legs in movement not plausible (0-15).\n"); + SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); return; } } @@ -2858,7 +2852,7 @@ inline void gcode_M42() { // use that as a starting point for each probe. // if (verbose_level > 2) - SERIAL_PROTOCOL("Positioning probe for the test.\n"); + SERIAL_PROTOCOL("Positioning the probe...\n"); plan_buffer_line( X_probe_location, Y_probe_location, Z_start_location, ext_position, @@ -2907,7 +2901,7 @@ inline void gcode_M42() { //SERIAL_ECHOPAIR("starting radius: ",radius); //SERIAL_ECHOPAIR(" theta: ",theta); //SERIAL_ECHOPAIR(" direction: ",rotational_direction); - //SERIAL_PROTOCOLLNPGM(""); + //SERIAL_EOL; float dir = rotational_direction ? 1 : -1; for (l = 0; l < n_legs - 1; l++) { @@ -2926,7 +2920,7 @@ inline void gcode_M42() { if (verbose_level > 3) { SERIAL_ECHOPAIR("x: ", X_current); SERIAL_ECHOPAIR("y: ", Y_current); - SERIAL_PROTOCOLLNPGM(""); + SERIAL_EOL; } do_blocking_move_to( X_current, Y_current, Z_current ); From 0213f7f01670035e12547c06e7f23c119924658b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 19:39:43 -0700 Subject: [PATCH 117/302] Cleanup case for M666 --- Marlin/Marlin_main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8b9cf1e39..7726ca52e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4927,14 +4927,13 @@ void process_commands() { case 665: // M665 set delta configurations L R S gcode_M665(); break; - case 666: // M666 set delta endstop adjustment + #endif + + #if defined(DELTA) || defined(Z_DUAL_ENDSTOPS) + case 666: // M666 set delta / dual endstop adjustment gcode_M666(); break; - #elif defined(Z_DUAL_ENDSTOPS) - case 666: // M666 set delta endstop adjustment - gcode_M666(); - break; - #endif // DELTA + #endif #ifdef FWRETRACT case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] From ce44bee28bb7854ec138464a4b17828ebc7b2327 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 19:45:14 -0700 Subject: [PATCH 118/302] Small code reduction --- Marlin/Marlin_main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7726ca52e..6802a8251 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2382,16 +2382,17 @@ inline void gcode_G28() { #else // !AUTO_BED_LEVELING_GRID - // Probe at 3 arbitrary points - float z_at_pt_1, z_at_pt_2, z_at_pt_3; + // Actions for each probe ProbeAction p1, p2, p3; if (engage_probe_for_each_reading) p1 = p2 = p3 = ProbeEngageAndRetract; else p1 = ProbeEngage, p2 = ProbeStay, p3 = ProbeRetract; - z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, p1, verbose_level); - z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p2, verbose_level); - z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); + + // Probe at 3 arbitrary points + float z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, p1, verbose_level), + z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p2, verbose_level), + z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); clean_up_after_endstop_move(); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); From d73b169de3b031779771a14a65cad7fe476d3d98 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 23:16:12 -0700 Subject: [PATCH 119/302] Apply leveling for DELTA, - Fix `prepare_move` function not calling `adjust_delta` - Add more shorthand for plan_buffer_line. - Fix wrong `federate` usage, assuming they are all mm/m - Minor `stepper.cpp` cleanup --- Marlin/Marlin_main.cpp | 996 +++++++++++++++++++++-------------------- Marlin/stepper.cpp | 116 +++-- 2 files changed, 585 insertions(+), 527 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6802a8251..29d526628 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -79,7 +79,7 @@ // G4 - Dwell S or P // G10 - retract filament according to settings of M207 // G11 - retract recover filament according to settings of M208 -// G28 - Home all Axis +// G28 - Home one or more axes // G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. // G30 - Single Z Probe, probes bed at current XY location. // G31 - Dock sled (Z_PROBE_SLED only) @@ -306,7 +306,7 @@ int fanSpeed = 0; #ifdef SCARA float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 static float delta[3] = { 0, 0, 0 }; -#endif +#endif bool cancel_heatup = false; @@ -477,8 +477,6 @@ bool enquecommand(const char *cmd) return true; } - - void setup_killpin() { #if defined(KILL_PIN) && KILL_PIN > -1 @@ -901,7 +899,7 @@ bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); return (strchr_pointer != NULL); //Return True if a character was found } - + #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } @@ -932,7 +930,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static float x_home_pos(int extruder) { if (extruder == 0) - return base_home_pos(X_AXIS) + home_offset[X_AXIS]; + return base_home_pos(X_AXIS) + home_offset[X_AXIS]; else // In dual carriage mode the extruder offset provides an override of the // second X-carriage offset when homed - otherwise X2_HOME_POS is used. @@ -961,15 +959,15 @@ static void axis_is_at_home(int axis) { if (axis == X_AXIS) { if (active_extruder != 0) { current_position[X_AXIS] = x_home_pos(active_extruder); - min_pos[X_AXIS] = X2_MIN_POS; - max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); + min_pos[X_AXIS] = X2_MIN_POS; + max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); return; } else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { - current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; - min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS]; - max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS], - max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); + float xoff = home_offset[X_AXIS]; + current_position[X_AXIS] = base_home_pos(X_AXIS) + xoff; + min_pos[X_AXIS] = base_min_pos(X_AXIS) + xoff; + max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); return; } } @@ -1023,445 +1021,470 @@ static void axis_is_at_home(int axis) { } /** - * Shorthand to tell the planner our current position (in mm). + * Some planner shorthand inline functions */ +inline void line_to_current_position() { + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); +} +inline void line_to_z(float zPosition) { + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); +} +inline void line_to_destination() { + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); +} inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } #ifdef ENABLE_AUTO_BED_LEVELING -#ifdef AUTO_BED_LEVELING_GRID -#ifndef DELTA - static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { - vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); - planeNormal.debug("planeNormal"); - plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - //bedLevel.debug("bedLevel"); + #ifdef AUTO_BED_LEVELING_GRID - //plan_bed_level_matrix.debug("bed level before"); - //vector_3 uncorrected_position = plan_get_position_mm(); - //uncorrected_position.debug("position before"); + #ifndef DELTA - vector_3 corrected_position = plan_get_position(); - //corrected_position.debug("position after"); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { + vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); + planeNormal.debug("planeNormal"); + plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + //bedLevel.debug("bedLevel"); - sync_plan_position(); + //plan_bed_level_matrix.debug("bed level before"); + //vector_3 uncorrected_position = plan_get_position_mm(); + //uncorrected_position.debug("position before"); + + vector_3 corrected_position = plan_get_position(); + //corrected_position.debug("position after"); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + + sync_plan_position(); + } + + #endif // !DELTA + + #else // !AUTO_BED_LEVELING_GRID + + static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { + + plan_bed_level_matrix.set_to_identity(); + + vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); + vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); + vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); + vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); + + if (planeNormal.z < 0) { + planeNormal.x = -planeNormal.x; + planeNormal.y = -planeNormal.y; + planeNormal.z = -planeNormal.z; + } + + plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + + vector_3 corrected_position = plan_get_position(); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + + sync_plan_position(); + } + + #endif // !AUTO_BED_LEVELING_GRID + + static void run_z_probe() { + + #ifdef DELTA + + float start_z = current_position[Z_AXIS]; + long start_steps = st_get_position(Z_AXIS); + + // move down slowly until you find the bed + feedrate = homing_feedrate[Z_AXIS] / 4; + destination[Z_AXIS] = -10; + prepare_move_raw(); + st_synchronize(); + endstops_hit_on_purpose(); + + // we have to let the planner know where we are right now as it is not where we said to go. + long stop_steps = st_get_position(Z_AXIS); + float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; + current_position[Z_AXIS] = mm; + calculate_delta(current_position); + plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + + #else // !DELTA + + plan_bed_level_matrix.set_to_identity(); + feedrate = homing_feedrate[Z_AXIS]; + + // move down until you find the bed + float zPosition = -10; + line_to_z(zPosition); + st_synchronize(); + + // we have to let the planner know where we are right now as it is not where we said to go. + zPosition = st_get_position_mm(Z_AXIS); + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); + + // move up the retract distance + zPosition += home_retract_mm(Z_AXIS); + line_to_z(zPosition); + st_synchronize(); + endstops_hit_on_purpose(); + + // move back down slowly to find bed + if (homing_bump_divisor[Z_AXIS] >= 1) + feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; + else { + feedrate = homing_feedrate[Z_AXIS] / 10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + } + + zPosition -= home_retract_mm(Z_AXIS) * 2; + line_to_z(zPosition); + st_synchronize(); + endstops_hit_on_purpose(); + + current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); + // make sure the planner knows where we are as it may be a bit different than we last said to move to + sync_plan_position(); + + #endif // !DELTA } -#endif -#else // not AUTO_BED_LEVELING_GRID - -static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { - - plan_bed_level_matrix.set_to_identity(); - - vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); - vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); - vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); - vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - - if (planeNormal.z < 0) { - planeNormal.x = -planeNormal.x; - planeNormal.y = -planeNormal.y; - planeNormal.z = -planeNormal.z; - } - - plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - vector_3 corrected_position = plan_get_position(); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - - sync_plan_position(); -} - -#endif // AUTO_BED_LEVELING_GRID - -static void run_z_probe() { - #ifdef DELTA - - float start_z = current_position[Z_AXIS]; - long start_steps = st_get_position(Z_AXIS); - - // move down slowly until you find the bed - feedrate = homing_feedrate[Z_AXIS] / 4; - destination[Z_AXIS] = -10; - prepare_move_raw(); - st_synchronize(); - endstops_hit_on_purpose(); - - // we have to let the planner know where we are right now as it is not where we said to go. - long stop_steps = st_get_position(Z_AXIS); - float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; - current_position[Z_AXIS] = mm; - calculate_delta(current_position); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); - - #else - - plan_bed_level_matrix.set_to_identity(); - feedrate = homing_feedrate[Z_AXIS]; - - // move down until you find the bed - float zPosition = -10; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); - - // we have to let the planner know where we are right now as it is not where we said to go. - zPosition = st_get_position_mm(Z_AXIS); - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); - - // move up the retract distance - zPosition += home_retract_mm(Z_AXIS); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); - endstops_hit_on_purpose(); - - // move back down slowly to find bed - if (homing_bump_divisor[Z_AXIS] >= 1) { - feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS]; - } - else { - feedrate = homing_feedrate[Z_AXIS]/10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); - } - - zPosition -= home_retract_mm(Z_AXIS) * 2; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); - endstops_hit_on_purpose(); - - current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); - // make sure the planner knows where we are as it may be a bit different than we last said to move to - sync_plan_position(); - - #endif -} - -static void do_blocking_move_to(float x, float y, float z) { + static void do_blocking_move_to(float x, float y, float z) { float oldFeedRate = feedrate; -#ifdef DELTA + #ifdef DELTA - feedrate = XY_TRAVEL_SPEED; - - destination[X_AXIS] = x; - destination[Y_AXIS] = y; - destination[Z_AXIS] = z; - prepare_move_raw(); - st_synchronize(); + feedrate = XY_TRAVEL_SPEED; + + destination[X_AXIS] = x; + destination[Y_AXIS] = y; + destination[Z_AXIS] = z; + prepare_move_raw(); + st_synchronize(); -#else + #else - feedrate = homing_feedrate[Z_AXIS]; + feedrate = homing_feedrate[Z_AXIS]; - current_position[Z_AXIS] = z; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); + current_position[Z_AXIS] = z; + line_to_current_position(); + st_synchronize(); - feedrate = xy_travel_speed; + feedrate = xy_travel_speed; - current_position[X_AXIS] = x; - current_position[Y_AXIS] = y; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); + current_position[X_AXIS] = x; + current_position[Y_AXIS] = y; + line_to_current_position(); + st_synchronize(); -#endif + #endif feedrate = oldFeedRate; -} + } -static void setup_for_endstop_move() { + static void setup_for_endstop_move() { saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; feedmultiply = 100; previous_millis_cmd = millis(); - enable_endstops(true); -} - -static void clean_up_after_endstop_move() { -#ifdef ENDSTOPS_ONLY_FOR_HOMING - enable_endstops(false); -#endif + } + static void clean_up_after_endstop_move() { + #ifdef ENDSTOPS_ONLY_FOR_HOMING + enable_endstops(false); + #endif feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; previous_millis_cmd = millis(); -} + } -static void engage_z_probe() { - // Engage Z Servo endstop if enabled - #ifdef SERVO_ENDSTOPS - if (servo_endstops[Z_AXIS] > -1) { - #if SERVO_LEVELING - servos[servo_endstops[Z_AXIS]].attach(0); - #endif - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); - #if SERVO_LEVELING - delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); - #endif - } - #elif defined(Z_PROBE_ALLEN_KEY) - feedrate = homing_feedrate[X_AXIS]; - - // Move to the start position to initiate deployment - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z; - prepare_move_raw(); + static void engage_z_probe() { - // Home X to touch the belt - feedrate = homing_feedrate[X_AXIS]/10; - destination[X_AXIS] = 0; - prepare_move_raw(); - - // Home Y for safety - feedrate = homing_feedrate[X_AXIS]/2; - destination[Y_AXIS] = 0; - prepare_move_raw(); - - st_synchronize(); - - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) - { - if (!Stopped) - { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + #ifdef SERVO_ENDSTOPS + + // Engage Z Servo endstop if enabled + if (servo_endstops[Z_AXIS] >= 0) { + #if SERVO_LEVELING + servos[servo_endstops[Z_AXIS]].attach(0); + #endif + servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); + #if SERVO_LEVELING + delay(PROBE_SERVO_DEACTIVATION_DELAY); + servos[servo_endstops[Z_AXIS]].detach(); + #endif + } + + #elif defined(Z_PROBE_ALLEN_KEY) + + feedrate = homing_feedrate[X_AXIS]; + + // Move to the start position to initiate deployment + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z; + prepare_move_raw(); + + // Home X to touch the belt + feedrate = homing_feedrate[X_AXIS]/10; + destination[X_AXIS] = 0; + prepare_move_raw(); + + // Home Y for safety + feedrate = homing_feedrate[X_AXIS]/2; + destination[Y_AXIS] = 0; + prepare_move_raw(); + + st_synchronize(); + + bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (z_min_endstop) { + if (!Stopped) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); } Stop(); - } - #endif + } -} + #endif // Z_PROBE_ALLEN_KEY -static void retract_z_probe() { - // Retract Z Servo endstop if enabled - #ifdef SERVO_ENDSTOPS - if (servo_endstops[Z_AXIS] > -1) - { - #if Z_RAISE_AFTER_PROBING > 0 - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); - st_synchronize(); - #endif - - #if SERVO_LEVELING - servos[servo_endstops[Z_AXIS]].attach(0); - #endif - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); - #if SERVO_LEVELING - delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); - #endif - } - #elif defined(Z_PROBE_ALLEN_KEY) - // Move up for safety - feedrate = homing_feedrate[X_AXIS]; - destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; - prepare_move_raw(); + } - // Move to the start position to initiate retraction - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Z; - prepare_move_raw(); + static void retract_z_probe() { - // Move the nozzle down to push the probe into retracted position - feedrate = homing_feedrate[Z_AXIS]/10; - destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH; - prepare_move_raw(); - - // Move up for safety - feedrate = homing_feedrate[Z_AXIS]/2; - destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2; - prepare_move_raw(); - - // Home XY for safety - feedrate = homing_feedrate[X_AXIS]/2; - destination[X_AXIS] = 0; - destination[Y_AXIS] = 0; - prepare_move_raw(); - - st_synchronize(); - - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) - { - if (!Stopped) - { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + #ifdef SERVO_ENDSTOPS + + // Retract Z Servo endstop if enabled + if (servo_endstops[Z_AXIS] >= 0) { + + #if Z_RAISE_AFTER_PROBING > 0 + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); + st_synchronize(); + #endif + + #if SERVO_LEVELING + servos[servo_endstops[Z_AXIS]].attach(0); + #endif + + servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); + + #if SERVO_LEVELING + delay(PROBE_SERVO_DEACTIVATION_DELAY); + servos[servo_endstops[Z_AXIS]].detach(); + #endif + } + + #elif defined(Z_PROBE_ALLEN_KEY) + + // Move up for safety + feedrate = homing_feedrate[X_AXIS]; + destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; + prepare_move_raw(); + + // Move to the start position to initiate retraction + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Z; + prepare_move_raw(); + + // Move the nozzle down to push the probe into retracted position + feedrate = homing_feedrate[Z_AXIS]/10; + destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH; + prepare_move_raw(); + + // Move up for safety + feedrate = homing_feedrate[Z_AXIS]/2; + destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2; + prepare_move_raw(); + + // Home XY for safety + feedrate = homing_feedrate[X_AXIS]/2; + destination[X_AXIS] = 0; + destination[Y_AXIS] = 0; + prepare_move_raw(); + + st_synchronize(); + + bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (!z_min_endstop) { + if (!Stopped) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); } Stop(); + } + + #endif + + } + + enum ProbeAction { + ProbeStay = 0, + ProbeEngage = BIT(0), + ProbeRetract = BIT(1), + ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) + }; + + // Probe bed height at position (x,y), returns the measured z value + static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { + // move to right place + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); + do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); + + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) + if (retract_action & ProbeEngage) engage_z_probe(); + #endif + + run_z_probe(); + float measured_z = current_position[Z_AXIS]; + + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) + if (retract_action & ProbeRetract) retract_z_probe(); + #endif + + if (verbose_level > 2) { + SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM(" X: "); + SERIAL_PROTOCOL_F(x, 3); + SERIAL_PROTOCOLPGM(" Y: "); + SERIAL_PROTOCOL_F(y, 3); + SERIAL_PROTOCOLPGM(" Z: "); + SERIAL_PROTOCOL_F(measured_z, 3); + SERIAL_EOL; } - #endif - -} - -enum ProbeAction { - ProbeStay = 0, - ProbeEngage = BIT(0), - ProbeRetract = BIT(1), - ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) -}; - -/// Probe bed height at position (x,y), returns the measured z value -static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { - // move to right place - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); - do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); - - #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeEngage) engage_z_probe(); - #endif - - run_z_probe(); - float measured_z = current_position[Z_AXIS]; - - #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) retract_z_probe(); - #endif - - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(MSG_BED); - SERIAL_PROTOCOLPGM(" X: "); - SERIAL_PROTOCOL_F(x, 3); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL_F(y, 3); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z, 3); - SERIAL_EOL; + return measured_z; } - return measured_z; -} -#ifdef DELTA -static void extrapolate_one_point(int x, int y, int xdir, int ydir) { - if (bed_level[x][y] != 0.0) { - return; // Don't overwrite good values. - } - float a = 2*bed_level[x+xdir][y] - bed_level[x+xdir*2][y]; // Left to right. - float b = 2*bed_level[x][y+ydir] - bed_level[x][y+ydir*2]; // Front to back. - float c = 2*bed_level[x+xdir][y+ydir] - bed_level[x+xdir*2][y+ydir*2]; // Diagonal. - float median = c; // Median is robust (ignores outliers). - if (a < b) { - if (b < c) median = b; - if (c < a) median = a; - } else { // b <= a - if (c < b) median = b; - if (a < c) median = a; - } - bed_level[x][y] = median; -} + #ifdef DELTA -// Fill in the unprobed points (corners of circular print surface) -// using linear extrapolation, away from the center. -static void extrapolate_unprobed_bed_level() { - int half = (AUTO_BED_LEVELING_GRID_POINTS-1)/2; - for (int y = 0; y <= half; y++) { - for (int x = 0; x <= half; x++) { - if (x + y < 3) continue; - extrapolate_one_point(half-x, half-y, x>1?+1:0, y>1?+1:0); - extrapolate_one_point(half+x, half-y, x>1?-1:0, y>1?+1:0); - extrapolate_one_point(half-x, half+y, x>1?+1:0, y>1?-1:0); - extrapolate_one_point(half+x, half+y, x>1?-1:0, y>1?-1:0); + /** + * All DELTA leveling in the Marlin uses NONLINEAR_BED_LEVELING + */ + + static void extrapolate_one_point(int x, int y, int xdir, int ydir) { + if (bed_level[x][y] != 0.0) { + return; // Don't overwrite good values. + } + float a = 2*bed_level[x+xdir][y] - bed_level[x+xdir*2][y]; // Left to right. + float b = 2*bed_level[x][y+ydir] - bed_level[x][y+ydir*2]; // Front to back. + float c = 2*bed_level[x+xdir][y+ydir] - bed_level[x+xdir*2][y+ydir*2]; // Diagonal. + float median = c; // Median is robust (ignores outliers). + if (a < b) { + if (b < c) median = b; + if (c < a) median = a; + } else { // b <= a + if (c < b) median = b; + if (a < c) median = a; + } + bed_level[x][y] = median; } - } -} -// Print calibration results for plotting or manual frame adjustment. -static void print_bed_level() { - for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { - for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { - SERIAL_PROTOCOL_F(bed_level[x][y], 2); - SERIAL_PROTOCOLPGM(" "); + // Fill in the unprobed points (corners of circular print surface) + // using linear extrapolation, away from the center. + static void extrapolate_unprobed_bed_level() { + int half = (AUTO_BED_LEVELING_GRID_POINTS-1)/2; + for (int y = 0; y <= half; y++) { + for (int x = 0; x <= half; x++) { + if (x + y < 3) continue; + extrapolate_one_point(half-x, half-y, x>1?+1:0, y>1?+1:0); + extrapolate_one_point(half+x, half-y, x>1?-1:0, y>1?+1:0); + extrapolate_one_point(half-x, half+y, x>1?+1:0, y>1?-1:0); + extrapolate_one_point(half+x, half+y, x>1?-1:0, y>1?-1:0); + } + } } - SERIAL_ECHOLN(""); - } -} -// Reset calibration results to zero. -void reset_bed_level() { - for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { - for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { - bed_level[x][y] = 0.0; + // Print calibration results for plotting or manual frame adjustment. + static void print_bed_level() { + for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { + for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { + SERIAL_PROTOCOL_F(bed_level[x][y], 2); + SERIAL_PROTOCOLPGM(" "); + } + SERIAL_ECHOLN(""); + } } - } -} -#endif // DELTA + // Reset calibration results to zero. + void reset_bed_level() { + for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { + for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { + bed_level[x][y] = 0.0; + } + } + } + + #endif // DELTA #endif // ENABLE_AUTO_BED_LEVELING static void homeaxis(int axis) { -#define HOMEAXIS_DO(LETTER) \ - ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) + #define HOMEAXIS_DO(LETTER) \ + ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) - if (axis==X_AXIS ? HOMEAXIS_DO(X) : - axis==Y_AXIS ? HOMEAXIS_DO(Y) : - axis==Z_AXIS ? HOMEAXIS_DO(Z) : - 0) { - int axis_home_dir = home_dir(axis); -#ifdef DUAL_X_CARRIAGE - if (axis == X_AXIS) - axis_home_dir = x_home_dir(active_extruder); -#endif + if (axis == X_AXIS ? HOMEAXIS_DO(X) : + axis == Y_AXIS ? HOMEAXIS_DO(Y) : + axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { + + int axis_home_dir; + + #ifdef DUAL_X_CARRIAGE + if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder); + #else + axis_home_dir = home_dir(axis); + #endif current_position[axis] = 0; sync_plan_position(); + #ifndef Z_PROBE_SLED + // Engage Servo endstop if enabled + #ifdef SERVO_ENDSTOPS + #if SERVO_LEVELING + if (axis == Z_AXIS) { + engage_z_probe(); + } + else + #endif // SERVO_LEVELING + + if (servo_endstops[axis] > -1) + servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); + + #endif // SERVO_ENDSTOPS + + #endif // Z_PROBE_SLED -#ifndef Z_PROBE_SLED - // Engage Servo endstop if enabled - #ifdef SERVO_ENDSTOPS - #if SERVO_LEVELING - if (axis==Z_AXIS) { - engage_z_probe(); - } - else - #endif - if (servo_endstops[axis] > -1) { - servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); - } - #endif -#endif // Z_PROBE_SLED #ifdef Z_DUAL_ENDSTOPS - if (axis==Z_AXIS) In_Homing_Process(true); + if (axis == Z_AXIS) In_Homing_Process(true); #endif + destination[axis] = 1.5 * max_length(axis) * axis_home_dir; feedrate = homing_feedrate[axis]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); current_position[axis] = 0; sync_plan_position(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); - destination[axis] = 2*home_retract_mm(axis) * axis_home_dir; + destination[axis] = 2 * home_retract_mm(axis) * axis_home_dir; if (homing_bump_divisor[axis] >= 1) - { - feedrate = homing_feedrate[axis]/homing_bump_divisor[axis]; - } - else - { - feedrate = homing_feedrate[axis]/10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; + else { + feedrate = homing_feedrate[axis] / 10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); } - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); #ifdef Z_DUAL_ENDSTOPS if (axis==Z_AXIS) @@ -1476,7 +1499,7 @@ static void homeaxis(int axis) { destination[axis] = fabs(z_endstop_adj); if (z_endstop_adj < 0) Lock_z_motor(true); else Lock_z2_motor(true); } - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); Lock_z_motor(false); Lock_z2_motor(false); @@ -1489,7 +1512,7 @@ static void homeaxis(int axis) { if (endstop_adj[axis] * axis_home_dir < 0) { sync_plan_position(); destination[axis] = endstop_adj[axis]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); } #endif @@ -1534,7 +1557,7 @@ void refresh_cmd_timeout(void) } plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate=retract_feedrate*60; + feedrate = retract_feedrate * 60; retracted[active_extruder]=true; prepare_move(); if(retract_zlift > 0.01) { @@ -1570,8 +1593,8 @@ void refresh_cmd_timeout(void) } plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate=retract_recover_feedrate*60; - retracted[active_extruder]=false; + feedrate = retract_recover_feedrate * 60; + retracted[active_extruder] = false; prepare_move(); feedrate = oldFeedrate; } @@ -1725,17 +1748,16 @@ inline void gcode_G4() { */ inline void gcode_G28() { #ifdef ENABLE_AUTO_BED_LEVELING + plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #ifdef DELTA reset_bed_level(); - #else - plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #endif #endif #if defined(MESH_BED_LEVELING) uint8_t mbl_was_active = mbl.active; mbl.active = 0; - #endif // MESH_BED_LEVELING + #endif saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; @@ -1758,7 +1780,7 @@ inline void gcode_G28() { for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH; feedrate = 1.732 * homing_feedrate[X_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); endstops_hit_on_purpose(); @@ -1806,7 +1828,7 @@ inline void gcode_G28() { } else { feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1); } - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); axis_is_at_home(X_AXIS); @@ -1814,7 +1836,7 @@ inline void gcode_G28() { sync_plan_position(); destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); feedrate = 0.0; st_synchronize(); endstops_hit_on_purpose(); @@ -1881,7 +1903,7 @@ inline void gcode_G28() { #if defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); #endif HOMEAXIS(Z); @@ -1893,11 +1915,11 @@ inline void gcode_G28() { destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER); destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = XY_TRAVEL_SPEED / 60; + feedrate = XY_TRAVEL_SPEED; current_position[Z_AXIS] = 0; sync_plan_position(); - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); current_position[X_AXIS] = destination[X_AXIS]; current_position[Y_AXIS] = destination[Y_AXIS]; @@ -1919,7 +1941,7 @@ inline void gcode_G28() { plan_set_position(cpx, cpy, current_position[Z_AXIS], current_position[E_AXIS]); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); HOMEAXIS(Z); } @@ -1972,7 +1994,7 @@ inline void gcode_G28() { destination[Z_AXIS] = current_position[Z_AXIS]; destination[E_AXIS] = current_position[E_AXIS]; feedrate = homing_feedrate[X_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; sync_plan_position(); @@ -1986,6 +2008,19 @@ inline void gcode_G28() { endstops_hit_on_purpose(); } +#if defined(MESH_BED_LEVELING) || defined(ENABLE_AUTO_BED_LEVELING) + + // Check for known positions in X and Y + bool can_run_bed_leveling() { + if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) return true; + LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); + return false; + } + +#endif // MESH_BED_LEVELING || ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING /** @@ -2000,6 +2035,10 @@ inline void gcode_G28() { * */ inline void gcode_G29() { + + // Prevent leveling without first homing in X and Y + if (!can_run_bed_leveling()) return; + static int probe_point = -1; int state = 0; if (code_seen('S') || code_seen('s')) { @@ -2116,13 +2155,8 @@ inline void gcode_G28() { */ inline void gcode_G29() { - // Prevent user from running a G29 without first homing in X and Y - if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { - LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); - return; - } + // Prevent leveling without first homing in X and Y + if (!can_run_bed_leveling()) return; int verbose_level = 1; @@ -2204,16 +2238,15 @@ inline void gcode_G28() { st_synchronize(); - if (!dryrun) - { + if (!dryrun) { + // make sure the bed_level_rotation_matrix is identity or the planner will get it wrong + plan_bed_level_matrix.set_to_identity(); + #ifdef DELTA reset_bed_level(); #else //!DELTA - - // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly //vector_3 corrected_position = plan_get_position_mm(); //corrected_position.debug("position before G29"); - plan_bed_level_matrix.set_to_identity(); vector_3 uncorrected_position = plan_get_position(); //uncorrected_position.debug("position during G29"); current_position[X_AXIS] = uncorrected_position.x; @@ -2221,7 +2254,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = uncorrected_position.z; sync_plan_position(); - #endif + #endif // !DELTA } setup_for_endstop_move(); @@ -2287,8 +2320,7 @@ inline void gcode_G28() { #ifdef DELTA // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe); - if (distance_from_center > DELTA_PROBABLE_RADIUS) - continue; + if (distance_from_center > DELTA_PROBABLE_RADIUS) continue; #endif //DELTA // Enhanced G29 - Do not retract servo between probes @@ -2316,6 +2348,11 @@ inline void gcode_G28() { #endif probePointCounter++; + + manage_heater(); + manage_inactivity(); + lcd_update(); + } //xProbe } //yProbe @@ -2402,16 +2439,14 @@ inline void gcode_G28() { if (verbose_level > 0) plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); - // Correct the Z height difference from z-probe position and hotend tip position. - // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. - // When the bed is uneven, this height must be corrected. - if (!dryrun) - { - float x_tmp, y_tmp, z_tmp, real_z; - real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) - x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; - y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; - z_tmp = current_position[Z_AXIS]; + if (!dryrun) { + // Correct the Z height difference from z-probe position and hotend tip position. + // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. + // When the bed is uneven, this height must be corrected. + float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER, + y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER, + z_tmp = current_position[Z_AXIS], + real_z = (float)st_get_position(Z_AXIS) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. @@ -4686,18 +4721,14 @@ void process_commands() { gcode_G28(); break; - #if defined(MESH_BED_LEVELING) - case 29: // G29 Handle mesh based leveling + #if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING) + case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. gcode_G29(); break; #endif #ifdef ENABLE_AUTO_BED_LEVELING - case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. - gcode_G29(); - break; - #ifndef Z_PROBE_SLED case 30: // G30 Single Z Probe @@ -5392,69 +5423,72 @@ void prepare_move() #ifdef SCARA //for now same as delta-code -float difference[NUM_AXIS]; -for (int8_t i=0; i < NUM_AXIS; i++) { - difference[i] = destination[i] - current_position[i]; -} + float difference[NUM_AXIS]; + for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; -float cartesian_mm = sqrt( sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); -if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } -if (cartesian_mm < 0.000001) { return; } -float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; -int steps = max(1, int(scara_segments_per_second * seconds)); - //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); - //SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); - //SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); -for (int s = 1; s <= steps; s++) { - float fraction = float(s) / float(steps); - for(int8_t i=0; i < NUM_AXIS; i++) { - destination[i] = current_position[i] + difference[i] * fraction; - } + float cartesian_mm = sqrt( sq(difference[X_AXIS]) + + sq(difference[Y_AXIS]) + + sq(difference[Z_AXIS])); + if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } + if (cartesian_mm < 0.000001) { return; } + float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + int steps = max(1, int(scara_segments_per_second * seconds)); + //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); + //SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); + //SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); + + for (int s = 1; s <= steps; s++) { + float fraction = float(s) / float(steps); + for(int8_t i = 0; i < NUM_AXIS; i++) { + destination[i] = current_position[i] + difference[i] * fraction; + } - calculate_delta(destination); - //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); - //SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]); - //SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]); - //SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]); - //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); - //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); - - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); -} -#endif // SCARA - -#ifdef DELTA - float difference[NUM_AXIS]; - for (int8_t i=0; i < NUM_AXIS; i++) { - difference[i] = destination[i] - current_position[i]; - } - float cartesian_mm = sqrt(sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); - if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } - if (cartesian_mm < 0.000001) { return; } - float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; - int steps = max(1, int(delta_segments_per_second * seconds)); - // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); - // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); - // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); - for (int s = 1; s <= steps; s++) { - float fraction = float(s) / float(steps); - for(int8_t i=0; i < NUM_AXIS; i++) { - destination[i] = current_position[i] + difference[i] * fraction; + calculate_delta(destination); + //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); + //SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]); + //SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]); + //SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]); + //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); + //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); + + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], + destination[E_AXIS], feedrate*feedmultiply/60/100.0, + active_extruder); } - calculate_delta(destination); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); - } + + #endif // SCARA -#endif // DELTA + #ifdef DELTA + + float difference[NUM_AXIS]; + for (int8_t i=0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; + + float cartesian_mm = sqrt(sq(difference[X_AXIS]) + + sq(difference[Y_AXIS]) + + sq(difference[Z_AXIS])); + if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); + if (cartesian_mm < 0.000001) return; + float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + int steps = max(1, int(delta_segments_per_second * seconds)); + + // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); + // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); + // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); + + for (int s = 1; s <= steps; s++) { + float fraction = float(s) / float(steps); + for (int8_t i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i] + difference[i] * fraction; + calculate_delta(destination); + #ifdef ENABLE_AUTO_BED_LEVELING + adjust_delta(destination); + #endif + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], + destination[E_AXIS], feedrate*feedmultiply/60/100.0, + active_extruder); + } + + #endif // DELTA #ifdef DUAL_X_CARRIAGE if (active_extruder_parked) @@ -5500,13 +5534,13 @@ for (int s = 1; s <= steps; s++) { #if ! (defined DELTA || defined SCARA) // Do not use feedmultiply for E or Z only moves if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); } else { #if defined(MESH_BED_LEVELING) - mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); + mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); return; #else - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); #endif // MESH_BED_LEVELING } #endif // !(DELTA || SCARA) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index bb45fe2a8..a4da4f6ff 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -507,83 +507,107 @@ ISR(TIMER1_COMPA_vect) { } if (TEST(out_bits, Z_AXIS)) { // -direction + Z_APPLY_DIR(INVERT_Z_DIR,0); count_direction[Z_AXIS] = -1; - if (check_endstops) - { - #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 - #ifndef Z_DUAL_ENDSTOPS - UPDATE_ENDSTOP(z, Z, min, MIN); - #else - bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - #if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1 - bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING); - #else - bool z2_min_endstop=z_min_endstop; - #endif - if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0)) - { + + if (check_endstops) { + + #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 + + #ifdef Z_DUAL_ENDSTOPS + + bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING, + z2_min_endstop = + #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0 + READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING + #else + z_min_endstop + #endif + ; + + bool z_min_both = z_min_endstop && old_z_min_endstop, + z2_min_both = z2_min_endstop && old_z2_min_endstop; + if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit=true; - if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing... - { + endstop_z_hit = true; + if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing... step_events_completed = current_block->step_event_count; - } } old_z_min_endstop = z_min_endstop; old_z2_min_endstop = z2_min_endstop; - #endif - #endif - } + + #else // !Z_DUAL_ENDSTOPS + + UPDATE_ENDSTOP(z, Z, min, MIN); + + #endif // !Z_DUAL_ENDSTOPS + + #endif // Z_MIN_PIN + + } // check_endstops + } else { // +direction + Z_APPLY_DIR(!INVERT_Z_DIR,0); count_direction[Z_AXIS] = 1; + if (check_endstops) { + #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 - #ifndef Z_DUAL_ENDSTOPS - UPDATE_ENDSTOP(z, Z, max, MAX); - #else - bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING); - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1 - bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING); - #else - bool z2_max_endstop=z_max_endstop; - #endif - if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0)) - { + + #ifdef Z_DUAL_ENDSTOPS + + bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING, + z2_max_endstop = + #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 + READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING + #else + z_max_endstop + #endif + ; + + bool z_max_both = z_max_endstop && old_z_max_endstop, + z2_max_both = z2_max_endstop && old_z2_max_endstop; + if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit=true; + endstop_z_hit = true; -// if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true"); -// if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true"); + // if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true"); + // if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true"); - - if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing... - { + if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing... step_events_completed = current_block->step_event_count; - } } old_z_max_endstop = z_max_endstop; old_z2_max_endstop = z2_max_endstop; - #endif - #endif - } - } + + #else // !Z_DUAL_ENDSTOPS + + UPDATE_ENDSTOP(z, Z, max, MAX); + + #endif // !Z_DUAL_ENDSTOPS + + #endif // Z_MAX_PIN + + } // check_endstops + + } // +direction #ifndef ADVANCE if (TEST(out_bits, E_AXIS)) { // -direction REV_E_DIR(); - count_direction[E_AXIS]=-1; + count_direction[E_AXIS] = -1; } else { // +direction NORM_E_DIR(); - count_direction[E_AXIS]=1; + count_direction[E_AXIS] = 1; } #endif //!ADVANCE // Take multiple steps per interrupt (For high speed moves) - for (int8_t i=0; i < step_loops; i++) { + for (int8_t i = 0; i < step_loops; i++) { #ifndef AT90USB MSerial.checkRx(); // Check for serial chars. #endif From e96db1cd6c0eeace4aeb15f05ace080c20080faa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 23:21:39 -0700 Subject: [PATCH 120/302] Make G29 shared function inline --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 29d526628..d92f2ae8c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2011,7 +2011,7 @@ inline void gcode_G28() { #if defined(MESH_BED_LEVELING) || defined(ENABLE_AUTO_BED_LEVELING) // Check for known positions in X and Y - bool can_run_bed_leveling() { + inline bool can_run_bed_leveling() { if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) return true; LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); SERIAL_ECHO_START; From 41d258697ac7e272e6dc54cb93722e0b4462a8b4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 00:45:02 -0700 Subject: [PATCH 121/302] Pass the z for after probing to retract_z_probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A `z_before` value is passed to probe_pt, but the `retract_z_probe` function assumes that Z is 0, doesn’t add `current_position[Z_AXIS]` as other cases do. This may be superfluous, so this is a test, and will be reverted if it has no effect. --- Marlin/Marlin_main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d92f2ae8c..e58836cb9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1138,7 +1138,7 @@ inline void sync_plan_position() { feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; else { feedrate = homing_feedrate[Z_AXIS] / 10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); } zPosition -= home_retract_mm(Z_AXIS) * 2; @@ -1255,17 +1255,17 @@ inline void sync_plan_position() { } - static void retract_z_probe() { + static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) { #ifdef SERVO_ENDSTOPS // Retract Z Servo endstop if enabled if (servo_endstops[Z_AXIS] >= 0) { - #if Z_RAISE_AFTER_PROBING > 0 - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); + if (z_after > 0) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after); st_synchronize(); - #endif + } #if SERVO_LEVELING servos[servo_endstops[Z_AXIS]].attach(0); @@ -1345,7 +1345,7 @@ inline void sync_plan_position() { float measured_z = current_position[Z_AXIS]; #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) retract_z_probe(); + if (retract_action & ProbeRetract) retract_z_probe(z_before); #endif if (verbose_level > 2) { @@ -1481,7 +1481,7 @@ static void homeaxis(int axis) { feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; else { feedrate = homing_feedrate[axis] / 10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); } line_to_destination(); @@ -2315,7 +2315,7 @@ inline void gcode_G28() { // raise extruder float measured_z, - z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS; + z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0); #ifdef DELTA // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. From 50a732360acf54d53cbd8daccafd807b8db64f43 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 13:35:03 +0200 Subject: [PATCH 122/302] Replace extrudemultiply by extruder_multiply[active_extruder] Fix for #1460. Seems to work with only one extruder. Can't test this myself with more. --- Marlin/Marlin.h | 1 - Marlin/Marlin_main.cpp | 5 ++--- Marlin/dogm_lcd_implementation.h | 2 +- Marlin/planner.cpp | 4 ++-- Marlin/ultralcd.cpp | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 46720d9a3..45a94e82e 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -229,7 +229,6 @@ void refresh_cmd_timeout(void); extern float homing_feedrate[]; extern bool axis_relative_modes[]; extern int feedmultiply; -extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6802a8251..0a8a613c5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -210,7 +210,6 @@ int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; -int extrudemultiply = 100; //100->1 200->2 int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); @@ -3776,7 +3775,7 @@ inline void gcode_M221() { extruder_multiply[tmp_extruder] = sval; } else { - extrudemultiply = sval; + extruder_multiply[active_extruder] = sval; } } } @@ -4213,7 +4212,7 @@ inline void gcode_M400() { st_synchronize(); } //SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); //SERIAL_PROTOCOL(filament_width_meas); //SERIAL_PROTOCOLPGM("Extrusion ratio(%):"); - //SERIAL_PROTOCOL(extrudemultiply); + //SERIAL_PROTOCOL(extruder_multiply[active_extruder]); } /** diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 89cd5e835..b3dbd2166 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("dia:")); lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - lcd_print(itostr3(extrudemultiply)); + lcd_print(itostr3(extruder_multiply[active_extruder])); lcd_print('%'); } #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 786527d0d..d98ef63d4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -545,7 +545,7 @@ float junction_deviation = 0.1; block->steps[Z_AXIS] = labs(dz); block->steps[E_AXIS] = labs(de); block->steps[E_AXIS] *= volumetric_multiplier[active_extruder]; - block->steps[E_AXIS] *= extrudemultiply; + block->steps[E_AXIS] *= extruder_multiply[active_extruder]; block->steps[E_AXIS] /= 100; block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS]))); @@ -679,7 +679,7 @@ float junction_deviation = 0.1; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; #endif delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; - delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extrudemultiply / 100.0; + delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c85f8e14d..58a66973f 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -485,7 +485,7 @@ static void lcd_tune_menu() { MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); #endif MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); - MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); + MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999); #if TEMP_SENSOR_1 != 0 MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999); From 9ac7dc675effc3ecda5b529e835b5ec1b36c9d95 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 30 Mar 2015 16:56:21 +0200 Subject: [PATCH 123/302] Make filament display on dogm_... same as hitachi... Thanks @MagoKimbra. --- Marlin/dogm_lcd_implementation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b3dbd2166..63e99bd3a 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("dia:")); lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - lcd_print(itostr3(extruder_multiply[active_extruder])); + lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM])); lcd_print('%'); } #endif From 2faed961ceae7b9b653d1c8315846b7260e61d11 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 16:39:47 -0700 Subject: [PATCH 124/302] Allow POWER_SUPPLY 0 for no power switch --- Marlin/Conditionals.h | 7 +- Marlin/Marlin_main.cpp | 82 +++++++-------- Marlin/ultralcd.cpp | 225 +++++++++++++++++++---------------------- 3 files changed, 148 insertions(+), 166 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c72f9d13e..5df6424b8 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -265,16 +265,15 @@ #ifndef POWER_SUPPLY #define POWER_SUPPLY 1 #endif - // 1 = ATX - #if (POWER_SUPPLY == 1) + #if (POWER_SUPPLY == 1) // 1 = ATX #define PS_ON_AWAKE LOW #define PS_ON_ASLEEP HIGH #endif - // 2 = X-Box 360 203W - #if (POWER_SUPPLY == 2) + #if (POWER_SUPPLY == 2) // 2 = X-Box 360 203W #define PS_ON_AWAKE HIGH #define PS_ON_ASLEEP LOW #endif + HAS_POWER_SWITCH = POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0 /** * Temp Sensor defines diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 67821b46a..854bf5953 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -168,12 +168,12 @@ // M401 - Lower z-probe if present // M402 - Raise z-probe if present // M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters -// M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder -// M406 - Turn off Filament Sensor extrusion control -// M407 - Displays measured filament diameter +// M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder +// M406 - Turn off Filament Sensor extrusion control +// M407 - Display measured filament diameter // M500 - Store parameters in EEPROM // M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). -// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] @@ -310,14 +310,14 @@ int fanSpeed = 0; bool cancel_heatup = false; #ifdef FILAMENT_SENSOR - //Variables for Filament Sensor input - float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 - bool filament_sensor=false; //M405 turns on filament_sensor control, M406 turns it off - float filament_width_meas=DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter - signed char measurement_delay[MAX_MEASUREMENT_DELAY+1]; //ring buffer to delay measurement store extruder factor after subtracting 100 - int delay_index1=0; //index into ring buffer - int delay_index2=-1; //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized - float delay_dist=0; //delay distance counter + //Variables for Filament Sensor input + float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 + bool filament_sensor = false; //M405 turns on filament_sensor control, M406 turns it off + float filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter + signed char measurement_delay[MAX_MEASUREMENT_DELAY+1]; //ring buffer to delay measurement store extruder factor after subtracting 100 + int delay_index1 = 0; //index into ring buffer + int delay_index2 = -1; //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized + float delay_dist = 0; //delay distance counter int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting #endif @@ -516,7 +516,7 @@ void setup_powerhold() #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 OUT_WRITE(SUICIDE_PIN, HIGH); #endif - #if defined(PS_ON_PIN) && PS_ON_PIN > -1 + #if HAS_POWER_SWITCH #if defined(PS_DEFAULT_OFF) OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #else @@ -898,7 +898,7 @@ bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); return (strchr_pointer != NULL); //Return True if a character was found } - + #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } @@ -3291,7 +3291,7 @@ inline void gcode_M140() { if (code_seen('S')) setTargetBed(code_value()); } -#if defined(PS_ON_PIN) && PS_ON_PIN > -1 +#if HAS_POWER_SWITCH /** * M80: Turn on Power Supply @@ -3313,33 +3313,33 @@ inline void gcode_M140() { #endif } -#endif // PS_ON_PIN - -/** - * M81: Turn off Power Supply - */ -inline void gcode_M81() { - disable_heater(); - st_synchronize(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); - finishAndDisableSteppers(); - fanSpeed = 0; - delay(1000); // Wait 1 second before switching off - #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + /** + * M81: Turn off Power Supply + */ + inline void gcode_M81() { + disable_heater(); st_synchronize(); - suicide(); - #elif defined(PS_ON_PIN) && PS_ON_PIN > -1 - OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); - #endif - #ifdef ULTIPANEL - powersupply = false; - LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); - lcd_update(); - #endif -} + disable_e0(); + disable_e1(); + disable_e2(); + disable_e3(); + finishAndDisableSteppers(); + fanSpeed = 0; + delay(1000); // Wait 1 second before switching off + #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + st_synchronize(); + suicide(); + #elif HAS_POWER_SWITCH + OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); + #endif + #ifdef ULTIPANEL + powersupply = false; + LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); + lcd_update(); + #endif + } + +#endif // PS_ON_PIN /** * M82: Set E codes absolute (default) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 58a66973f..96bba79b0 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -616,6 +616,7 @@ static void lcd_prepare_menu() { MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0")); + #if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu); @@ -625,15 +626,16 @@ static void lcd_prepare_menu() { MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); #endif #endif + MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); - #if defined(POWER_SUPPLY) && POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN > -1 - if (powersupply) { + + #if HAS_POWER_SWITCH + if (powersupply) MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); - } - else { + else MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); - } #endif + MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); #if defined(MANUAL_BED_LEVELING) @@ -1338,7 +1340,7 @@ void lcd_update() { } lastEncoderMovementMillis = ms; - } + } // encoderRateMultiplierEnabled #endif //ENCODER_RATE_MULTIPLIER lcdDrawUpdate = 1; @@ -1541,70 +1543,62 @@ bool lcd_clicked() { return LCD_CLICKED; } #endif //ULTIPANEL -/********************************/ -/** Float conversion utilities **/ -/********************************/ -// convert float to string with +123.4 format +/*********************************/ +/** Number to string conversion **/ +/*********************************/ + char conv[8]; -char *ftostr3(const float &x) -{ + +// Convert float to string with +123.4 format +char *ftostr3(const float &x) { return itostr3((int)x); } -char *itostr2(const uint8_t &x) -{ +// Convert int to string with 12 format +char *itostr2(const uint8_t &x) { //sprintf(conv,"%5.1f",x); - int xx=x; - conv[0]=(xx/10)%10+'0'; - conv[1]=(xx)%10+'0'; - conv[2]=0; + int xx = x; + conv[0] = (xx / 10) % 10 + '0'; + conv[1] = xx % 10 + '0'; + conv[2] = 0; + return conv; +} + +// Convert float to string with +123.4 format +char *ftostr31(const float &x) { + int xx = abs(x * 10); + conv[0] = (x >= 0) ? '+' : '-'; + conv[1] = (xx / 1000) % 10 + '0'; + conv[2] = (xx / 100) % 10 + '0'; + conv[3] = (xx / 10) % 10 + '0'; + conv[4] = '.'; + conv[5] = xx % 10 + '0'; + conv[6] = 0; return conv; } // Convert float to string with 123.4 format, dropping sign -char *ftostr31(const float &x) -{ - int xx=x*10; - conv[0]=(xx>=0)?'+':'-'; - xx=abs(xx); - conv[1]=(xx/1000)%10+'0'; - conv[2]=(xx/100)%10+'0'; - conv[3]=(xx/10)%10+'0'; - conv[4]='.'; - conv[5]=(xx)%10+'0'; - conv[6]=0; +char *ftostr31ns(const float &x) { + int xx = abs(x * 10); + conv[0] = (xx / 1000) % 10 + '0'; + conv[1] = (xx / 100) % 10 + '0'; + conv[2] = (xx / 10) % 10 + '0'; + conv[3] = '.'; + conv[4] = xx % 10 + '0'; + conv[5] = 0; return conv; } // Convert float to string with 123.4 format -char *ftostr31ns(const float &x) -{ - int xx=x*10; - //conv[0]=(xx>=0)?'+':'-'; - xx=abs(xx); - conv[0]=(xx/1000)%10+'0'; - conv[1]=(xx/100)%10+'0'; - conv[2]=(xx/10)%10+'0'; - conv[3]='.'; - conv[4]=(xx)%10+'0'; - conv[5]=0; - return conv; -} - -char *ftostr32(const float &x) -{ - long xx=x*100; - if (xx >= 0) - conv[0]=(xx/10000)%10+'0'; - else - conv[0]='-'; - xx=abs(xx); - conv[1]=(xx/1000)%10+'0'; - conv[2]=(xx/100)%10+'0'; - conv[3]='.'; - conv[4]=(xx/10)%10+'0'; - conv[5]=(xx)%10+'0'; - conv[6]=0; +char *ftostr32(const float &x) { + long xx = abs(x * 100); + conv[0] = x >= 0 ? (xx / 10000) % 10 + '0' : '-'; + conv[1] = (xx / 1000) % 10 + '0'; + conv[2] = (xx / 100) % 10 + '0'; + conv[3] = '.'; + conv[4] = (xx / 10) % 10 + '0'; + conv[5] = xx % 10 + '0'; + conv[6] = 0; return conv; } @@ -1625,7 +1619,7 @@ char *ftostr43(const float &x) return conv; } -//Float to string with 1.23 format +// Convert float to string with 1.23 format char *ftostr12ns(const float &x) { long xx=x*100; @@ -1639,7 +1633,7 @@ char *ftostr12ns(const float &x) return conv; } -// convert float to space-padded string with -_23.4_ format +// Convert float to space-padded string with -_23.4_ format char *ftostr32sp(const float &x) { long xx = abs(x * 100); uint8_t dig; @@ -1685,58 +1679,51 @@ char *ftostr32sp(const float &x) { return conv; } -char *itostr31(const int &xx) -{ - conv[0]=(xx>=0)?'+':'-'; - conv[1]=(xx/1000)%10+'0'; - conv[2]=(xx/100)%10+'0'; - conv[3]=(xx/10)%10+'0'; - conv[4]='.'; - conv[5]=(xx)%10+'0'; - conv[6]=0; +// Convert int to lj string with +123.0 format +char *itostr31(const int &x) { + conv[0] = x >= 0 ? '+' : '-'; + int xx = abs(x); + conv[1] = (xx / 100) % 10 + '0'; + conv[2] = (xx / 10) % 10 + '0'; + conv[3] = xx % 10 + '0'; + conv[4] = '.'; + conv[5] = '0'; + conv[6] = 0; return conv; } // Convert int to rj string with 123 or -12 format -char *itostr3(const int &x) -{ +char *itostr3(const int &x) { int xx = x; if (xx < 0) { - conv[0]='-'; + conv[0] = '-'; xx = -xx; - } else if (xx >= 100) - conv[0]=(xx/100)%10+'0'; + } else - conv[0]=' '; - if (xx >= 10) - conv[1]=(xx/10)%10+'0'; - else - conv[1]=' '; - conv[2]=(xx)%10+'0'; - conv[3]=0; + conv[0] = xx >= 100 ? (xx / 100) % 10 + '0' : ' '; + + conv[1] = xx >= 10 ? (xx / 10) % 10 + '0' : ' '; + conv[2] = xx % 10 + '0'; + conv[3] = 0; return conv; } // Convert int to lj string with 123 format -char *itostr3left(const int &xx) -{ - if (xx >= 100) - { - conv[0]=(xx/100)%10+'0'; - conv[1]=(xx/10)%10+'0'; - conv[2]=(xx)%10+'0'; - conv[3]=0; +char *itostr3left(const int &xx) { + if (xx >= 100) { + conv[0] = (xx / 100) % 10 + '0'; + conv[1] = (xx / 10) % 10 + '0'; + conv[2] = xx % 10 + '0'; + conv[3] = 0; } - else if (xx >= 10) - { - conv[0]=(xx/10)%10+'0'; - conv[1]=(xx)%10+'0'; - conv[2]=0; + else if (xx >= 10) { + conv[0] = (xx / 10) % 10 + '0'; + conv[1] = xx % 10 + '0'; + conv[2] = 0; } - else - { - conv[0]=(xx)%10+'0'; - conv[1]=0; + else { + conv[0] = xx % 10 + '0'; + conv[1] = 0; } return conv; } @@ -1764,34 +1751,30 @@ char *ftostr5(const float &x) { } // Convert float to string with +1234.5 format -char *ftostr51(const float &x) -{ - long xx=x*10; - conv[0]=(xx>=0)?'+':'-'; - xx=abs(xx); - conv[1]=(xx/10000)%10+'0'; - conv[2]=(xx/1000)%10+'0'; - conv[3]=(xx/100)%10+'0'; - conv[4]=(xx/10)%10+'0'; - conv[5]='.'; - conv[6]=(xx)%10+'0'; - conv[7]=0; +char *ftostr51(const float &x) { + long xx = abs(x * 10); + conv[0] = (x >= 0) ? '+' : '-'; + conv[1] = (xx / 10000) % 10 + '0'; + conv[2] = (xx / 1000) % 10 + '0'; + conv[3] = (xx / 100) % 10 + '0'; + conv[4] = (xx / 10) % 10 + '0'; + conv[5] = '.'; + conv[6] = xx % 10 + '0'; + conv[7] = 0; return conv; } // Convert float to string with +123.45 format -char *ftostr52(const float &x) -{ - long xx=x*100; - conv[0]=(xx>=0)?'+':'-'; - xx=abs(xx); - conv[1]=(xx/10000)%10+'0'; - conv[2]=(xx/1000)%10+'0'; - conv[3]=(xx/100)%10+'0'; - conv[4]='.'; - conv[5]=(xx/10)%10+'0'; - conv[6]=(xx)%10+'0'; - conv[7]=0; +char *ftostr52(const float &x) { + conv[0] = (x >= 0) ? '+' : '-'; + long xx = abs(x * 100); + conv[1] = (xx / 10000) % 10 + '0'; + conv[2] = (xx / 1000) % 10 + '0'; + conv[3] = (xx / 100) % 10 + '0'; + conv[4] = '.'; + conv[5] = (xx / 10) % 10 + '0'; + conv[6] = xx % 10 + '0'; + conv[7] = 0; return conv; } From 8c136a5ab5200e1daa3c0943f43cf37f5c5f8dbb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 16:50:05 -0700 Subject: [PATCH 125/302] Conditionals and comments for PS = 0 --- Marlin/Marlin_main.cpp | 79 ++++++++++++++++++++++-------------------- Marlin/ultralcd.cpp | 4 ++- 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 854bf5953..28c761395 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -272,7 +272,7 @@ int fanSpeed = 0; #endif // FWRETRACT -#ifdef ULTIPANEL +#if defined(ULTIPANEL) && HAS_POWER_SWITCH bool powersupply = #ifdef PS_DEFAULT_OFF false @@ -517,7 +517,7 @@ void setup_powerhold() OUT_WRITE(SUICIDE_PIN, HIGH); #endif #if HAS_POWER_SWITCH - #if defined(PS_DEFAULT_OFF) + #ifdef PS_DEFAULT_OFF OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #else OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -3313,33 +3313,38 @@ inline void gcode_M140() { #endif } - /** - * M81: Turn off Power Supply - */ - inline void gcode_M81() { - disable_heater(); - st_synchronize(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); - finishAndDisableSteppers(); - fanSpeed = 0; - delay(1000); // Wait 1 second before switching off - #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 - st_synchronize(); - suicide(); - #elif HAS_POWER_SWITCH - OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); - #endif - #ifdef ULTIPANEL - powersupply = false; - LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); - lcd_update(); - #endif - } +#endif // HAS_POWER_SWITCH + +/** + * M81: Turn off Power, including Power Supply, if there is one. + * + * This code should ALWAYS be available for EMERGENCY SHUTDOWN! + */ +inline void gcode_M81() { + disable_heater(); + st_synchronize(); + disable_e0(); + disable_e1(); + disable_e2(); + disable_e3(); + finishAndDisableSteppers(); + fanSpeed = 0; + delay(1000); // Wait 1 second before switching off + #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + st_synchronize(); + suicide(); + #elif HAS_POWER_SWITCH + OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); + #endif + #ifdef ULTIPANEL + #if HAS_POWER_SWITCH + powersupply = false; + #endif + LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); + lcd_update(); + #endif +} -#endif // PS_ON_PIN /** * M82: Set E codes absolute (default) @@ -4874,15 +4879,15 @@ void process_commands() { #endif //HEATER_2_PIN #endif //BARICUDA - #if defined(PS_ON_PIN) && PS_ON_PIN > -1 + #if HAS_POWER_SWITCH case 80: // M80 - Turn on Power Supply gcode_M80(); break; - #endif // PS_ON_PIN + #endif // HAS_POWER_SWITCH - case 81: // M81 - Turn off Power Supply + case 81: // M81 - Turn off Power, including Power Supply, if possible gcode_M81(); break; @@ -5859,19 +5864,17 @@ void kill() disable_e2(); disable_e3(); -#if defined(PS_ON_PIN) && PS_ON_PIN > -1 - pinMode(PS_ON_PIN,INPUT); -#endif + #if HAS_POWER_SWITCH + pinMode(PS_ON_PIN, INPUT); + #endif + SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_KILLED); LCD_ALERTMESSAGEPGM(MSG_KILLED); // FMC small patch to update the LCD before ending sei(); // enable interrupts - for ( int i=5; i--; lcd_update()) - { - delay(200); - } + for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time cli(); // disable interrupts suicide(); while(1) { /* Intentionally left empty */ } // Wait for reset diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 96bba79b0..94f530f89 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -44,7 +44,9 @@ static void lcd_status_screen(); #ifdef ULTIPANEL - extern bool powersupply; + #if HAS_POWER_SWITCH + extern bool powersupply; + #endif static float manual_feedrate[] = MANUAL_FEEDRATE; static void lcd_main_menu(); static void lcd_tune_menu(); From 68642808032b7eaed642fccf4b797f5ed0e8dcf5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 16:52:27 -0700 Subject: [PATCH 126/302] Use elif and parentheses in conditionals --- Marlin/Conditionals.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5df6424b8..36f1ffb54 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -265,15 +265,14 @@ #ifndef POWER_SUPPLY #define POWER_SUPPLY 1 #endif - #if (POWER_SUPPLY == 1) // 1 = ATX + #if (POWER_SUPPLY == 1) // 1 = ATX #define PS_ON_AWAKE LOW #define PS_ON_ASLEEP HIGH - #endif - #if (POWER_SUPPLY == 2) // 2 = X-Box 360 203W + #elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W #define PS_ON_AWAKE HIGH #define PS_ON_ASLEEP LOW #endif - HAS_POWER_SWITCH = POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0 + HAS_POWER_SWITCH = (POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0) /** * Temp Sensor defines From 5519882eea465203bc10be8bba8ac08b4587c2ff Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 18:00:54 -0700 Subject: [PATCH 127/302] Fix up LCD_PROGRESS_BAR - Some messages should not expire with `PROGRESS_MSG_EXPIRE`. - Simplify conditional for progress bar with sanity checks. - Rename `messageTick` to `expireStatusMillis` and make it the expire time. --- Marlin/Marlin_main.cpp | 10 ++- Marlin/SanityCheck.h | 5 +- Marlin/ultralcd.cpp | 62 +++++++++++-------- Marlin/ultralcd.h | 8 ++- .../ultralcd_implementation_hitachi_HD44780.h | 14 ++--- 5 files changed, 59 insertions(+), 40 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 67821b46a..f8e829df7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -846,7 +846,7 @@ void get_command() sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); SERIAL_ECHO_START; SERIAL_ECHOLN(time); - lcd_setstatus(time); + lcd_setstatus(time, true); card.printingHasFinished(); card.checkautostart(true); @@ -2536,9 +2536,13 @@ inline void gcode_G92() { if (starpos != NULL) *(starpos) = '\0'; while (*src == ' ') ++src; if (!hasP && !hasS && *src != '\0') - lcd_setstatus(src); - else + lcd_setstatus(src, true); + else { LCD_MESSAGEPGM(MSG_USERWAIT); + #if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 + dontExpireStatus(); + #endif + } lcd_ignore_click(); st_synchronize(); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index d5183abba..8c05f83bc 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -17,8 +17,11 @@ * Progress Bar */ #ifdef LCD_PROGRESS_BAR + #ifndef SDSUPPORT + #error LCD_PROGRESS_BAR requires SDSUPPORT. + #endif #ifdef DOGLCD - #warning LCD_PROGRESS_BAR does not apply to graphical displays. + #error LCD_PROGRESS_BAR does not apply to graphical displays. #endif #ifdef FILAMENT_LCD_DISPLAY #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both. diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 58a66973f..0e7ab526d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -252,7 +252,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool if (feedback) lcd_quick_feedback(); // For LCD_PROGRESS_BAR re-initialize the custom characters - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) + #ifdef LCD_PROGRESS_BAR lcd_set_custom_characters(menu == lcd_status_screen); #endif } @@ -262,29 +262,32 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool static void lcd_status_screen() { encoderRateMultiplierEnabled = false; - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) - uint16_t mil = millis(); + + #ifdef LCD_PROGRESS_BAR + unsigned long ms = millis(); #ifndef PROGRESS_MSG_ONCE - if (mil > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { - progressBarTick = mil; + if (ms > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { + progressBarTick = ms; } #endif #if PROGRESS_MSG_EXPIRE > 0 - // keep the message alive if paused, count down otherwise - if (messageTick > 0) { + // Handle message expire + if (expireStatusMillis > 0) { if (card.isFileOpen()) { + // Expire the message when printing is active if (IS_SD_PRINTING) { - if ((mil-messageTick) >= PROGRESS_MSG_EXPIRE) { + // Expire the message when printing is active + if (ms >= expireStatusMillis) { lcd_status_message[0] = '\0'; - messageTick = 0; + expireStatusMillis = 0; } } else { - messageTick += LCD_UPDATE_INTERVAL; + expireStatusMillis += LCD_UPDATE_INTERVAL; } } else { - messageTick = 0; + expireStatusMillis = 0; } } #endif @@ -324,7 +327,7 @@ static void lcd_status_screen() { lcd_goto_menu(lcd_main_menu); lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) + #ifdef LCD_PROGRESS_BAR currentMenu == lcd_status_screen #endif ); @@ -380,7 +383,7 @@ static void lcd_sdcard_stop() { card.closefile(); autotempShutdown(); cancel_heatup = true; - lcd_setstatus(MSG_PRINT_ABORTED); + lcd_setstatus(MSG_PRINT_ABORTED, true); } /* Menu implementation */ @@ -1275,7 +1278,7 @@ void lcd_update() { lcdDrawUpdate = 2; lcd_oldcardstatus = IS_SD_INSERTED; lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) + #ifdef LCD_PROGRESS_BAR currentMenu == lcd_status_screen #endif ); @@ -1393,7 +1396,7 @@ void lcd_ignore_click(bool b) { wait_for_unclick = false; } -void lcd_finishstatus() { +void lcd_finishstatus(bool persist=false) { int len = lcd_strlen(lcd_status_message); if (len > 0) { while (len < LCD_WIDTH) { @@ -1401,11 +1404,11 @@ void lcd_finishstatus() { } } lcd_status_message[LCD_WIDTH] = '\0'; - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) - #if PROGRESS_MSG_EXPIRE > 0 - messageTick = - #endif + #ifdef LCD_PROGRESS_BAR progressBarTick = millis(); + #if PROGRESS_MSG_EXPIRE > 0 + expireStatusMillis = persist ? 0 : progressBarTick + PROGRESS_MSG_EXPIRE; + #endif #endif lcdDrawUpdate = 2; @@ -1414,21 +1417,26 @@ void lcd_finishstatus() { #endif } -void lcd_setstatus(const char* message) { +#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 + void dontExpireStatus() { expireStatusMillis = 0; } +#endif + +void lcd_setstatus(const char* message, bool persist) { if (lcd_status_message_level > 0) return; strncpy(lcd_status_message, message, LCD_WIDTH); - lcd_finishstatus(); + lcd_finishstatus(persist); } -void lcd_setstatuspgm(const char* message) { - if (lcd_status_message_level > 0) return; - strncpy_P(lcd_status_message, message, LCD_WIDTH); - lcd_finishstatus(); +void lcd_setstatuspgm(const char* message, uint8_t level) { + if (level >= lcd_status_message_level) { + strncpy_P(lcd_status_message, message, LCD_WIDTH); + lcd_status_message_level = level; + lcd_finishstatus(level > 0); + } } void lcd_setalertstatuspgm(const char* message) { - lcd_setstatuspgm(message); - lcd_status_message_level = 1; + lcd_setstatuspgm(message, 1); #ifdef ULTIPANEL lcd_return_to_status(); #endif diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 4cdecb8bd..c2529d1d1 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -8,12 +8,16 @@ int lcd_strlen_P(const char *s); void lcd_update(); void lcd_init(); - void lcd_setstatus(const char* message); - void lcd_setstatuspgm(const char* message); + void lcd_setstatus(const char* message, const bool persist=false); + void lcd_setstatuspgm(const char* message, const uint8_t level=0); void lcd_setalertstatuspgm(const char* message); void lcd_reset_alert_level(); bool lcd_detected(void); + #if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 + void dontExpireStatus(); + #endif + #ifdef DOGLCD extern int lcd_contrast; void lcd_setcontrast(uint8_t value); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index c21785ed2..4819e3e00 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -193,10 +193,10 @@ #include "utf_mapper.h" -#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) +#ifdef LCD_PROGRESS_BAR static uint16_t progressBarTick = 0; #if PROGRESS_MSG_EXPIRE > 0 - static uint16_t messageTick = 0; + static uint16_t expireStatusMillis = 0; #endif #define LCD_STR_PROGRESS "\x03\x04\x05" #endif @@ -214,7 +214,7 @@ #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ static void lcd_set_custom_characters( - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) + #ifdef LCD_PROGRESS_BAR bool progress_bar_set=true #endif ) { @@ -299,7 +299,7 @@ static void lcd_set_custom_characters( B00000 }; //thanks Sonny Mounicou - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) + #ifdef LCD_PROGRESS_BAR static bool char_mode = false; byte progress[3][8] = { { B00000, @@ -360,7 +360,7 @@ static void lcd_set_custom_characters( } static void lcd_implementation_init( - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) + #ifdef LCD_PROGRESS_BAR bool progress_bar_set=true #endif ) { @@ -390,7 +390,7 @@ static void lcd_implementation_init( #endif lcd_set_custom_characters( - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) + #ifdef LCD_PROGRESS_BAR progress_bar_set #endif ); @@ -583,7 +583,7 @@ static void lcd_implementation_status_screen() // Status message line at the bottom lcd.setCursor(0, LCD_HEIGHT - 1); - #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) + #ifdef LCD_PROGRESS_BAR if (card.isFileOpen()) { uint16_t mil = millis(), diff = mil - progressBarTick; From 92b54aa27ebc9bb3e55a06b53a839bb14fe1c8cb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 19:44:53 -0700 Subject: [PATCH 128/302] #define HAS_POWER_SWITCH --- Marlin/Conditionals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 36f1ffb54..62ea7ba54 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -272,7 +272,7 @@ #define PS_ON_AWAKE HIGH #define PS_ON_ASLEEP LOW #endif - HAS_POWER_SWITCH = (POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0) + #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0) /** * Temp Sensor defines From 8500c80b337c1be96cadbd1fd465ad9987f0f9c9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 20:22:21 -0700 Subject: [PATCH 129/302] Apply Z_RAISE_BEFORE_HOMING before homing XY --- Marlin/Marlin_main.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 67821b46a..0c2ee2402 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1803,7 +1803,19 @@ inline void gcode_G28() { home_all_axis = !homeX && !homeY && !homeZ; // No parameters means home all axes #if Z_HOME_DIR > 0 // If homing away from BED do Z first + if (home_all_axis || homeZ) HOMEAXIS(Z); + + #elif !defined(Z_SAFE_HOMING) && defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 + + // Raise Z before homing any other axes + if (home_all_axis || homeZ) { + destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed + feedrate = max_feedrate[Z_AXIS]; + line_to_destination(); + st_synchronize(); + } + #endif #ifdef QUICK_HOME @@ -1897,16 +1909,7 @@ inline void gcode_G28() { #ifndef Z_SAFE_HOMING - if (home_all_axis || homeZ) { - // Raise Z before homing Z? Shouldn't this happen before homing X or Y? - #if defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 - destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = max_feedrate[Z_AXIS]; - line_to_destination(); - st_synchronize(); - #endif - HOMEAXIS(Z); - } + if (home_all_axis || homeZ) HOMEAXIS(Z); #else // Z_SAFE_HOMING From 992b07ca5741fe179670d521f9e3912e720debf8 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Mon, 30 Mar 2015 22:58:10 -0500 Subject: [PATCH 130/302] Don't disable Z_RAISE_BEFORE_HOMING when Z_PROBE_AND_ENDSTOP is enabled. --- Marlin/Marlin_main.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0f0445352..d4c454ba3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2032,12 +2032,10 @@ inline void gcode_G28() { if (home_all_axis || homeZ) { // Raise Z before homing Z? Shouldn't this happen before homing X or Y? #if defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 - #ifndef Z_PROBE_AND_ENDSTOP destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; line_to_destination(); st_synchronize(); - #endif #endif HOMEAXIS(Z); } From 5e82ed4f305c0f28a6e46a40331bc8b1a7759430 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 21:15:16 -0700 Subject: [PATCH 131/302] Restore ENDSTOPPULLUPS in Configuration.h --- Marlin/Configuration.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ad7ec4590..889690d82 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -302,13 +302,18 @@ your extruder heater takes 2 minutes to hit the target on heating. // Enable this option for Toshiba steppers // #define CONFIG_STEPPERS_TOSHIBA -// The pullups are needed if you directly connect a mechanical endstop between the signal and ground pins. -#define ENDSTOPPULLUP_XMAX -#define ENDSTOPPULLUP_YMAX -#define ENDSTOPPULLUP_ZMAX -#define ENDSTOPPULLUP_XMIN -#define ENDSTOPPULLUP_YMIN -#define ENDSTOPPULLUP_ZMIN +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + +#ifndef ENDSTOPPULLUPS + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined + // #define ENDSTOPPULLUP_XMAX + // #define ENDSTOPPULLUP_YMAX + // #define ENDSTOPPULLUP_ZMAX + // #define ENDSTOPPULLUP_XMIN + // #define ENDSTOPPULLUP_YMIN + // #define ENDSTOPPULLUP_ZMIN +#endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. From e08f8eed0581bb91c886ffbf7e1234ef58935501 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Mon, 30 Mar 2015 23:51:36 -0500 Subject: [PATCH 132/302] Revert 06f767d..cba5692 This rolls back to commit 06f767d608120f09bcd0fd0aee582220cd8657d9. --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 869 +++++++----------- Marlin/dogm_lcd_implementation.h | 2 +- Marlin/planner.cpp | 4 +- Marlin/stepper.cpp | 115 +-- Marlin/ultralcd.cpp | 2 +- .../ultralcd_implementation_hitachi_HD44780.h | 16 +- 7 files changed, 409 insertions(+), 600 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 45a94e82e..46720d9a3 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -229,6 +229,7 @@ void refresh_cmd_timeout(void); extern float homing_feedrate[]; extern bool axis_relative_modes[]; extern int feedmultiply; +extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0f0445352..009620624 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -79,7 +79,7 @@ // G4 - Dwell S or P // G10 - retract filament according to settings of M207 // G11 - retract recover filament according to settings of M208 -// G28 - Home one or more axes +// G28 - Home all Axis // G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. // G30 - Single Z Probe, probes bed at current XY location. // G31 - Dock sled (Z_PROBE_SLED only) @@ -210,6 +210,7 @@ int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; +int extrudemultiply = 100; //100->1 200->2 int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); @@ -305,7 +306,7 @@ int fanSpeed = 0; #ifdef SCARA float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 static float delta[3] = { 0, 0, 0 }; -#endif +#endif bool cancel_heatup = false; @@ -476,6 +477,8 @@ bool enquecommand(const char *cmd) return true; } + + void setup_killpin() { #if defined(KILL_PIN) && KILL_PIN > -1 @@ -898,7 +901,7 @@ bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); return (strchr_pointer != NULL); //Return True if a character was found } - + #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } @@ -929,7 +932,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static float x_home_pos(int extruder) { if (extruder == 0) - return base_home_pos(X_AXIS) + home_offset[X_AXIS]; + return base_home_pos(X_AXIS) + home_offset[X_AXIS]; else // In dual carriage mode the extruder offset provides an override of the // second X-carriage offset when homed - otherwise X2_HOME_POS is used. @@ -958,15 +961,15 @@ static void axis_is_at_home(int axis) { if (axis == X_AXIS) { if (active_extruder != 0) { current_position[X_AXIS] = x_home_pos(active_extruder); - min_pos[X_AXIS] = X2_MIN_POS; - max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); + min_pos[X_AXIS] = X2_MIN_POS; + max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); return; } else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { - float xoff = home_offset[X_AXIS]; - current_position[X_AXIS] = base_home_pos(X_AXIS) + xoff; - min_pos[X_AXIS] = base_min_pos(X_AXIS) + xoff; - max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); + current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; + min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS]; + max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS], + max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); return; } } @@ -1020,189 +1023,178 @@ static void axis_is_at_home(int axis) { } /** - * Some planner shorthand inline functions + * Shorthand to tell the planner our current position (in mm). */ -inline void line_to_current_position() { - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); -} -inline void line_to_z(float zPosition) { - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); -} -inline void line_to_destination() { - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); -} inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } #ifdef ENABLE_AUTO_BED_LEVELING +#ifdef AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID +#ifndef DELTA + static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { + vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); + planeNormal.debug("planeNormal"); + plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + //bedLevel.debug("bedLevel"); - #ifndef DELTA + //plan_bed_level_matrix.debug("bed level before"); + //vector_3 uncorrected_position = plan_get_position_mm(); + //uncorrected_position.debug("position before"); - static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { - vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); - planeNormal.debug("planeNormal"); - plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - //bedLevel.debug("bedLevel"); + vector_3 corrected_position = plan_get_position(); + //corrected_position.debug("position after"); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - //plan_bed_level_matrix.debug("bed level before"); - //vector_3 uncorrected_position = plan_get_position_mm(); - //uncorrected_position.debug("position before"); + sync_plan_position(); + } +#endif - vector_3 corrected_position = plan_get_position(); - //corrected_position.debug("position after"); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z +#else // not AUTO_BED_LEVELING_GRID - sync_plan_position(); - } +static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { - #endif // !DELTA + plan_bed_level_matrix.set_to_identity(); - #else // !AUTO_BED_LEVELING_GRID + vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); + vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); + vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); + vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { - - plan_bed_level_matrix.set_to_identity(); - - vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); - vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); - vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); - vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - - if (planeNormal.z < 0) { - planeNormal.x = -planeNormal.x; - planeNormal.y = -planeNormal.y; - planeNormal.z = -planeNormal.z; - } - - plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - vector_3 corrected_position = plan_get_position(); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - - sync_plan_position(); + if (planeNormal.z < 0) { + planeNormal.x = -planeNormal.x; + planeNormal.y = -planeNormal.y; + planeNormal.z = -planeNormal.z; } - #endif // !AUTO_BED_LEVELING_GRID + plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - static void run_z_probe() { + vector_3 corrected_position = plan_get_position(); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - #ifdef DELTA + sync_plan_position(); +} + +#endif // AUTO_BED_LEVELING_GRID + +static void run_z_probe() { + #ifdef DELTA - float start_z = current_position[Z_AXIS]; - long start_steps = st_get_position(Z_AXIS); + float start_z = current_position[Z_AXIS]; + long start_steps = st_get_position(Z_AXIS); + + // move down slowly until you find the bed + feedrate = homing_feedrate[Z_AXIS] / 4; + destination[Z_AXIS] = -10; + prepare_move_raw(); + st_synchronize(); + endstops_hit_on_purpose(); - // move down slowly until you find the bed - feedrate = homing_feedrate[Z_AXIS] / 4; - destination[Z_AXIS] = -10; - prepare_move_raw(); - st_synchronize(); - endstops_hit_on_purpose(); - - // we have to let the planner know where we are right now as it is not where we said to go. - long stop_steps = st_get_position(Z_AXIS); - float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; - current_position[Z_AXIS] = mm; - calculate_delta(current_position); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); - - #else // !DELTA + // we have to let the planner know where we are right now as it is not where we said to go. + long stop_steps = st_get_position(Z_AXIS); + float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; + current_position[Z_AXIS] = mm; + calculate_delta(current_position); + plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + + #else - plan_bed_level_matrix.set_to_identity(); - feedrate = homing_feedrate[Z_AXIS]; + plan_bed_level_matrix.set_to_identity(); + feedrate = homing_feedrate[Z_AXIS]; - // move down until you find the bed - float zPosition = -10; - line_to_z(zPosition); - st_synchronize(); + // move down until you find the bed + float zPosition = -10; + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); + st_synchronize(); - // we have to let the planner know where we are right now as it is not where we said to go. - zPosition = st_get_position_mm(Z_AXIS); - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); + // we have to let the planner know where we are right now as it is not where we said to go. + zPosition = st_get_position_mm(Z_AXIS); + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); - // move up the retract distance - zPosition += home_retract_mm(Z_AXIS); - line_to_z(zPosition); - st_synchronize(); - endstops_hit_on_purpose(); + // move up the retract distance + zPosition += home_retract_mm(Z_AXIS); + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); + st_synchronize(); + endstops_hit_on_purpose(); - // move back down slowly to find bed - if (homing_bump_divisor[Z_AXIS] >= 1) - feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; - else { - feedrate = homing_feedrate[Z_AXIS] / 10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); - } + // move back down slowly to find bed + if (homing_bump_divisor[Z_AXIS] >= 1) { + feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS]; + } + else { + feedrate = homing_feedrate[Z_AXIS]/10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + } - zPosition -= home_retract_mm(Z_AXIS) * 2; - line_to_z(zPosition); - st_synchronize(); - endstops_hit_on_purpose(); + zPosition -= home_retract_mm(Z_AXIS) * 2; + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); + st_synchronize(); + endstops_hit_on_purpose(); - current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); - // make sure the planner knows where we are as it may be a bit different than we last said to move to - sync_plan_position(); - - #endif // !DELTA - } + current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); + // make sure the planner knows where we are as it may be a bit different than we last said to move to + sync_plan_position(); + + #endif +} - static void do_blocking_move_to(float x, float y, float z) { +static void do_blocking_move_to(float x, float y, float z) { float oldFeedRate = feedrate; - #ifdef DELTA +#ifdef DELTA - feedrate = XY_TRAVEL_SPEED; - - destination[X_AXIS] = x; - destination[Y_AXIS] = y; - destination[Z_AXIS] = z; - prepare_move_raw(); - st_synchronize(); + feedrate = XY_TRAVEL_SPEED; + + destination[X_AXIS] = x; + destination[Y_AXIS] = y; + destination[Z_AXIS] = z; + prepare_move_raw(); + st_synchronize(); - #else +#else - feedrate = homing_feedrate[Z_AXIS]; + feedrate = homing_feedrate[Z_AXIS]; - current_position[Z_AXIS] = z; - line_to_current_position(); - st_synchronize(); + current_position[Z_AXIS] = z; + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); + st_synchronize(); - feedrate = xy_travel_speed; + feedrate = xy_travel_speed; - current_position[X_AXIS] = x; - current_position[Y_AXIS] = y; - line_to_current_position(); - st_synchronize(); + current_position[X_AXIS] = x; + current_position[Y_AXIS] = y; + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); + st_synchronize(); - #endif +#endif feedrate = oldFeedRate; - } +} - static void setup_for_endstop_move() { +static void setup_for_endstop_move() { saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; feedmultiply = 100; previous_millis_cmd = millis(); - enable_endstops(true); - } - static void clean_up_after_endstop_move() { - #ifdef ENDSTOPS_ONLY_FOR_HOMING - enable_endstops(false); - #endif + enable_endstops(true); +} + +static void clean_up_after_endstop_move() { +#ifdef ENDSTOPS_ONLY_FOR_HOMING + enable_endstops(false); +#endif + feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; previous_millis_cmd = millis(); - } +} -<<<<<<< HEAD static void engage_z_probe() { // Engage Z Servo endstop if enabled #ifdef SERVO_ENDSTOPS @@ -1250,59 +1242,13 @@ static void engage_z_probe() { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); -======= - static void engage_z_probe() { - - #ifdef SERVO_ENDSTOPS - - // Engage Z Servo endstop if enabled - if (servo_endstops[Z_AXIS] >= 0) { - #if SERVO_LEVELING - servos[servo_endstops[Z_AXIS]].attach(0); - #endif - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); - #if SERVO_LEVELING - delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); - #endif - } - - #elif defined(Z_PROBE_ALLEN_KEY) - - feedrate = homing_feedrate[X_AXIS]; - - // Move to the start position to initiate deployment - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z; - prepare_move_raw(); - - // Home X to touch the belt - feedrate = homing_feedrate[X_AXIS]/10; - destination[X_AXIS] = 0; - prepare_move_raw(); - - // Home Y for safety - feedrate = homing_feedrate[X_AXIS]/2; - destination[Y_AXIS] = 0; - prepare_move_raw(); - - st_synchronize(); - - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) { - if (!Stopped) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); ->>>>>>> MarlinFirmware/Development } Stop(); - } + } + #endif - #endif // Z_PROBE_ALLEN_KEY +} -<<<<<<< HEAD static void retract_z_probe() { // Retract Z Servo endstop if enabled #ifdef SERVO_ENDSTOPS @@ -1365,216 +1311,126 @@ static void retract_z_probe() { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); -======= - } - - static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) { - - #ifdef SERVO_ENDSTOPS - - // Retract Z Servo endstop if enabled - if (servo_endstops[Z_AXIS] >= 0) { - - if (z_after > 0) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after); - st_synchronize(); ->>>>>>> MarlinFirmware/Development - } - - #if SERVO_LEVELING - servos[servo_endstops[Z_AXIS]].attach(0); - #endif - - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); - - #if SERVO_LEVELING - delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); - #endif - } - - #elif defined(Z_PROBE_ALLEN_KEY) - - // Move up for safety - feedrate = homing_feedrate[X_AXIS]; - destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; - prepare_move_raw(); - - // Move to the start position to initiate retraction - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Z; - prepare_move_raw(); - - // Move the nozzle down to push the probe into retracted position - feedrate = homing_feedrate[Z_AXIS]/10; - destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH; - prepare_move_raw(); - - // Move up for safety - feedrate = homing_feedrate[Z_AXIS]/2; - destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2; - prepare_move_raw(); - - // Home XY for safety - feedrate = homing_feedrate[X_AXIS]/2; - destination[X_AXIS] = 0; - destination[Y_AXIS] = 0; - prepare_move_raw(); - - st_synchronize(); - - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) { - if (!Stopped) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); } Stop(); - } + } + #endif - #endif +} +enum ProbeAction { + ProbeStay = 0, + ProbeEngage = BIT(0), + ProbeRetract = BIT(1), + ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) +}; + +/// Probe bed height at position (x,y), returns the measured z value +static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { + // move to right place + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); + do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); + + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) + if (retract_action & ProbeEngage) engage_z_probe(); + #endif + + run_z_probe(); + float measured_z = current_position[Z_AXIS]; + + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) + if (retract_action & ProbeRetract) retract_z_probe(); + #endif + + if (verbose_level > 2) { + SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM(" X: "); + SERIAL_PROTOCOL_F(x, 3); + SERIAL_PROTOCOLPGM(" Y: "); + SERIAL_PROTOCOL_F(y, 3); + SERIAL_PROTOCOLPGM(" Z: "); + SERIAL_PROTOCOL_F(measured_z, 3); + SERIAL_EOL; } + return measured_z; +} - enum ProbeAction { - ProbeStay = 0, - ProbeEngage = BIT(0), - ProbeRetract = BIT(1), - ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) - }; - - // Probe bed height at position (x,y), returns the measured z value - static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { - // move to right place - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); - do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); - - #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeEngage) engage_z_probe(); - #endif - - run_z_probe(); - float measured_z = current_position[Z_AXIS]; - - #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) retract_z_probe(z_before); - #endif - - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(MSG_BED); - SERIAL_PROTOCOLPGM(" X: "); - SERIAL_PROTOCOL_F(x, 3); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL_F(y, 3); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z, 3); - SERIAL_EOL; - } - return measured_z; +#ifdef DELTA +static void extrapolate_one_point(int x, int y, int xdir, int ydir) { + if (bed_level[x][y] != 0.0) { + return; // Don't overwrite good values. } + float a = 2*bed_level[x+xdir][y] - bed_level[x+xdir*2][y]; // Left to right. + float b = 2*bed_level[x][y+ydir] - bed_level[x][y+ydir*2]; // Front to back. + float c = 2*bed_level[x+xdir][y+ydir] - bed_level[x+xdir*2][y+ydir*2]; // Diagonal. + float median = c; // Median is robust (ignores outliers). + if (a < b) { + if (b < c) median = b; + if (c < a) median = a; + } else { // b <= a + if (c < b) median = b; + if (a < c) median = a; + } + bed_level[x][y] = median; +} - #ifdef DELTA - - /** - * All DELTA leveling in the Marlin uses NONLINEAR_BED_LEVELING - */ - - static void extrapolate_one_point(int x, int y, int xdir, int ydir) { - if (bed_level[x][y] != 0.0) { - return; // Don't overwrite good values. - } - float a = 2*bed_level[x+xdir][y] - bed_level[x+xdir*2][y]; // Left to right. - float b = 2*bed_level[x][y+ydir] - bed_level[x][y+ydir*2]; // Front to back. - float c = 2*bed_level[x+xdir][y+ydir] - bed_level[x+xdir*2][y+ydir*2]; // Diagonal. - float median = c; // Median is robust (ignores outliers). - if (a < b) { - if (b < c) median = b; - if (c < a) median = a; - } else { // b <= a - if (c < b) median = b; - if (a < c) median = a; - } - bed_level[x][y] = median; +// Fill in the unprobed points (corners of circular print surface) +// using linear extrapolation, away from the center. +static void extrapolate_unprobed_bed_level() { + int half = (AUTO_BED_LEVELING_GRID_POINTS-1)/2; + for (int y = 0; y <= half; y++) { + for (int x = 0; x <= half; x++) { + if (x + y < 3) continue; + extrapolate_one_point(half-x, half-y, x>1?+1:0, y>1?+1:0); + extrapolate_one_point(half+x, half-y, x>1?-1:0, y>1?+1:0); + extrapolate_one_point(half-x, half+y, x>1?+1:0, y>1?-1:0); + extrapolate_one_point(half+x, half+y, x>1?-1:0, y>1?-1:0); } + } +} - // Fill in the unprobed points (corners of circular print surface) - // using linear extrapolation, away from the center. - static void extrapolate_unprobed_bed_level() { - int half = (AUTO_BED_LEVELING_GRID_POINTS-1)/2; - for (int y = 0; y <= half; y++) { - for (int x = 0; x <= half; x++) { - if (x + y < 3) continue; - extrapolate_one_point(half-x, half-y, x>1?+1:0, y>1?+1:0); - extrapolate_one_point(half+x, half-y, x>1?-1:0, y>1?+1:0); - extrapolate_one_point(half-x, half+y, x>1?+1:0, y>1?-1:0); - extrapolate_one_point(half+x, half+y, x>1?-1:0, y>1?-1:0); - } - } +// Print calibration results for plotting or manual frame adjustment. +static void print_bed_level() { + for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { + for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { + SERIAL_PROTOCOL_F(bed_level[x][y], 2); + SERIAL_PROTOCOLPGM(" "); } + SERIAL_ECHOLN(""); + } +} - // Print calibration results for plotting or manual frame adjustment. - static void print_bed_level() { - for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { - for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { - SERIAL_PROTOCOL_F(bed_level[x][y], 2); - SERIAL_PROTOCOLPGM(" "); - } - SERIAL_ECHOLN(""); - } +// Reset calibration results to zero. +void reset_bed_level() { + for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { + for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { + bed_level[x][y] = 0.0; } + } +} - // Reset calibration results to zero. - void reset_bed_level() { - for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { - for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { - bed_level[x][y] = 0.0; - } - } - } - - #endif // DELTA +#endif // DELTA #endif // ENABLE_AUTO_BED_LEVELING static void homeaxis(int axis) { - #define HOMEAXIS_DO(LETTER) \ - ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) +#define HOMEAXIS_DO(LETTER) \ + ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) - if (axis == X_AXIS ? HOMEAXIS_DO(X) : - axis == Y_AXIS ? HOMEAXIS_DO(Y) : - axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { - - int axis_home_dir; - - #ifdef DUAL_X_CARRIAGE - if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder); - #else - axis_home_dir = home_dir(axis); - #endif + if (axis==X_AXIS ? HOMEAXIS_DO(X) : + axis==Y_AXIS ? HOMEAXIS_DO(Y) : + axis==Z_AXIS ? HOMEAXIS_DO(Z) : + 0) { + int axis_home_dir = home_dir(axis); +#ifdef DUAL_X_CARRIAGE + if (axis == X_AXIS) + axis_home_dir = x_home_dir(active_extruder); +#endif current_position[axis] = 0; sync_plan_position(); - #ifndef Z_PROBE_SLED - // Engage Servo endstop if enabled - #ifdef SERVO_ENDSTOPS - #if SERVO_LEVELING - if (axis == Z_AXIS) { - engage_z_probe(); - } - else - #endif // SERVO_LEVELING - if (servo_endstops[axis] > -1) - servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); - - #endif // SERVO_ENDSTOPS - - #endif // Z_PROBE_SLED - -<<<<<<< HEAD #ifndef Z_PROBE_SLED // Engage Servo endstop if enabled and we are not using Z_PROBE_AND_ENDSTOP unless we are using Z_SAFE_HOMING #ifdef SERVO_ENDSTOPS && (defined (Z_SAFE_HOMING) || ! defined (Z_PROBE_AND_ENDSTOP)) @@ -1589,33 +1445,33 @@ static void homeaxis(int axis) { } #endif #endif // Z_PROBE_SLED -======= ->>>>>>> MarlinFirmware/Development #ifdef Z_DUAL_ENDSTOPS - if (axis == Z_AXIS) In_Homing_Process(true); + if (axis==Z_AXIS) In_Homing_Process(true); #endif - destination[axis] = 1.5 * max_length(axis) * axis_home_dir; feedrate = homing_feedrate[axis]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); current_position[axis] = 0; sync_plan_position(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); - destination[axis] = 2 * home_retract_mm(axis) * axis_home_dir; + destination[axis] = 2*home_retract_mm(axis) * axis_home_dir; if (homing_bump_divisor[axis] >= 1) - feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; - else { - feedrate = homing_feedrate[axis] / 10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); + { + feedrate = homing_feedrate[axis]/homing_bump_divisor[axis]; + } + else + { + feedrate = homing_feedrate[axis]/10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); } - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); #ifdef Z_DUAL_ENDSTOPS if (axis==Z_AXIS) @@ -1630,7 +1486,7 @@ static void homeaxis(int axis) { destination[axis] = fabs(z_endstop_adj); if (z_endstop_adj < 0) Lock_z_motor(true); else Lock_z2_motor(true); } - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); Lock_z_motor(false); Lock_z2_motor(false); @@ -1643,7 +1499,7 @@ static void homeaxis(int axis) { if (endstop_adj[axis] * axis_home_dir < 0) { sync_plan_position(); destination[axis] = endstop_adj[axis]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); } #endif @@ -1688,7 +1544,7 @@ void refresh_cmd_timeout(void) } plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate = retract_feedrate * 60; + feedrate=retract_feedrate*60; retracted[active_extruder]=true; prepare_move(); if(retract_zlift > 0.01) { @@ -1724,8 +1580,8 @@ void refresh_cmd_timeout(void) } plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate = retract_recover_feedrate * 60; - retracted[active_extruder] = false; + feedrate=retract_recover_feedrate*60; + retracted[active_extruder]=false; prepare_move(); feedrate = oldFeedrate; } @@ -1879,16 +1735,17 @@ inline void gcode_G4() { */ inline void gcode_G28() { #ifdef ENABLE_AUTO_BED_LEVELING - plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #ifdef DELTA reset_bed_level(); + #else + plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #endif #endif #if defined(MESH_BED_LEVELING) uint8_t mbl_was_active = mbl.active; mbl.active = 0; - #endif + #endif // MESH_BED_LEVELING saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; @@ -1911,7 +1768,7 @@ inline void gcode_G28() { for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH; feedrate = 1.732 * homing_feedrate[X_AXIS]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); endstops_hit_on_purpose(); @@ -1959,7 +1816,7 @@ inline void gcode_G28() { } else { feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1); } - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); axis_is_at_home(X_AXIS); @@ -1967,7 +1824,7 @@ inline void gcode_G28() { sync_plan_position(); destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); feedrate = 0.0; st_synchronize(); endstops_hit_on_purpose(); @@ -2035,7 +1892,7 @@ inline void gcode_G28() { #ifndef Z_PROBE_AND_ENDSTOP destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); #endif #endif @@ -2048,11 +1905,11 @@ inline void gcode_G28() { destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER); destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = XY_TRAVEL_SPEED; + feedrate = XY_TRAVEL_SPEED / 60; current_position[Z_AXIS] = 0; sync_plan_position(); - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); current_position[X_AXIS] = destination[X_AXIS]; current_position[Y_AXIS] = destination[Y_AXIS]; @@ -2074,7 +1931,7 @@ inline void gcode_G28() { plan_set_position(cpx, cpy, current_position[Z_AXIS], current_position[E_AXIS]); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); HOMEAXIS(Z); } @@ -2127,7 +1984,7 @@ inline void gcode_G28() { destination[Z_AXIS] = current_position[Z_AXIS]; destination[E_AXIS] = current_position[E_AXIS]; feedrate = homing_feedrate[X_AXIS]; - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); st_synchronize(); current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; sync_plan_position(); @@ -2141,19 +1998,6 @@ inline void gcode_G28() { endstops_hit_on_purpose(); } -#if defined(MESH_BED_LEVELING) || defined(ENABLE_AUTO_BED_LEVELING) - - // Check for known positions in X and Y - inline bool can_run_bed_leveling() { - if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) return true; - LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); - return false; - } - -#endif // MESH_BED_LEVELING || ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING /** @@ -2168,10 +2012,6 @@ inline void gcode_G28() { * */ inline void gcode_G29() { - - // Prevent leveling without first homing in X and Y - if (!can_run_bed_leveling()) return; - static int probe_point = -1; int state = 0; if (code_seen('S') || code_seen('s')) { @@ -2288,8 +2128,13 @@ inline void gcode_G28() { */ inline void gcode_G29() { - // Prevent leveling without first homing in X and Y - if (!can_run_bed_leveling()) return; + // Prevent user from running a G29 without first homing in X and Y + if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { + LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); + return; + } int verbose_level = 1; @@ -2371,15 +2216,16 @@ inline void gcode_G28() { st_synchronize(); - if (!dryrun) { - // make sure the bed_level_rotation_matrix is identity or the planner will get it wrong - plan_bed_level_matrix.set_to_identity(); - + if (!dryrun) + { #ifdef DELTA reset_bed_level(); #else //!DELTA + + // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly //vector_3 corrected_position = plan_get_position_mm(); //corrected_position.debug("position before G29"); + plan_bed_level_matrix.set_to_identity(); vector_3 uncorrected_position = plan_get_position(); //uncorrected_position.debug("position during G29"); current_position[X_AXIS] = uncorrected_position.x; @@ -2387,7 +2233,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = uncorrected_position.z; sync_plan_position(); - #endif // !DELTA + #endif } setup_for_endstop_move(); @@ -2448,12 +2294,13 @@ inline void gcode_G28() { // raise extruder float measured_z, - z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0); + z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS; #ifdef DELTA // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe); - if (distance_from_center > DELTA_PROBABLE_RADIUS) continue; + if (distance_from_center > DELTA_PROBABLE_RADIUS) + continue; #endif //DELTA // Enhanced G29 - Do not retract servo between probes @@ -2481,11 +2328,6 @@ inline void gcode_G28() { #endif probePointCounter++; - - manage_heater(); - manage_inactivity(); - lcd_update(); - } //xProbe } //yProbe @@ -2572,14 +2414,16 @@ inline void gcode_G28() { if (verbose_level > 0) plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); - if (!dryrun) { - // Correct the Z height difference from z-probe position and hotend tip position. - // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. - // When the bed is uneven, this height must be corrected. - float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER, - y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER, - z_tmp = current_position[Z_AXIS], - real_z = (float)st_get_position(Z_AXIS) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) + // Correct the Z height difference from z-probe position and hotend tip position. + // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. + // When the bed is uneven, this height must be corrected. + if (!dryrun) + { + float x_tmp, y_tmp, z_tmp, real_z; + real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) + x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; + y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; + z_tmp = current_position[Z_AXIS]; apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. @@ -3947,7 +3791,7 @@ inline void gcode_M221() { extruder_multiply[tmp_extruder] = sval; } else { - extruder_multiply[active_extruder] = sval; + extrudemultiply = sval; } } } @@ -4384,7 +4228,7 @@ inline void gcode_M400() { st_synchronize(); } //SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); //SERIAL_PROTOCOL(filament_width_meas); //SERIAL_PROTOCOLPGM("Extrusion ratio(%):"); - //SERIAL_PROTOCOL(extruder_multiply[active_extruder]); + //SERIAL_PROTOCOL(extrudemultiply); } /** @@ -4857,14 +4701,18 @@ void process_commands() { gcode_G28(); break; - #if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING) - case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. + #if defined(MESH_BED_LEVELING) + case 29: // G29 Handle mesh based leveling gcode_G29(); break; #endif #ifdef ENABLE_AUTO_BED_LEVELING + case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. + gcode_G29(); + break; + #ifndef Z_PROBE_SLED case 30: // G30 Single Z Probe @@ -5559,72 +5407,69 @@ void prepare_move() #ifdef SCARA //for now same as delta-code - float difference[NUM_AXIS]; - for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; +float difference[NUM_AXIS]; +for (int8_t i=0; i < NUM_AXIS; i++) { + difference[i] = destination[i] - current_position[i]; +} - float cartesian_mm = sqrt( sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); - if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } - if (cartesian_mm < 0.000001) { return; } - float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; - int steps = max(1, int(scara_segments_per_second * seconds)); +float cartesian_mm = sqrt( sq(difference[X_AXIS]) + + sq(difference[Y_AXIS]) + + sq(difference[Z_AXIS])); +if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } +if (cartesian_mm < 0.000001) { return; } +float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; +int steps = max(1, int(scara_segments_per_second * seconds)); + //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); + //SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); + //SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); +for (int s = 1; s <= steps; s++) { + float fraction = float(s) / float(steps); + for(int8_t i=0; i < NUM_AXIS; i++) { + destination[i] = current_position[i] + difference[i] * fraction; + } - //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); - //SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); - //SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); - - for (int s = 1; s <= steps; s++) { - float fraction = float(s) / float(steps); - for(int8_t i = 0; i < NUM_AXIS; i++) { - destination[i] = current_position[i] + difference[i] * fraction; - } - calculate_delta(destination); - //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); - //SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]); - //SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]); - //SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]); - //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); - //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); - - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); - } - - #endif // SCARA + calculate_delta(destination); + //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); + //SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]); + //SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]); + //SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]); + //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); + //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); + + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], + destination[E_AXIS], feedrate*feedmultiply/60/100.0, + active_extruder); +} +#endif // SCARA - #ifdef DELTA - - float difference[NUM_AXIS]; - for (int8_t i=0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; - - float cartesian_mm = sqrt(sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); - if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); - if (cartesian_mm < 0.000001) return; - float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; - int steps = max(1, int(delta_segments_per_second * seconds)); - - // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); - // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); - // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); - - for (int s = 1; s <= steps; s++) { - float fraction = float(s) / float(steps); - for (int8_t i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i] + difference[i] * fraction; - calculate_delta(destination); - #ifdef ENABLE_AUTO_BED_LEVELING - adjust_delta(destination); - #endif - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); +#ifdef DELTA + float difference[NUM_AXIS]; + for (int8_t i=0; i < NUM_AXIS; i++) { + difference[i] = destination[i] - current_position[i]; + } + float cartesian_mm = sqrt(sq(difference[X_AXIS]) + + sq(difference[Y_AXIS]) + + sq(difference[Z_AXIS])); + if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } + if (cartesian_mm < 0.000001) { return; } + float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + int steps = max(1, int(delta_segments_per_second * seconds)); + // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); + // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); + // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); + for (int s = 1; s <= steps; s++) { + float fraction = float(s) / float(steps); + for(int8_t i=0; i < NUM_AXIS; i++) { + destination[i] = current_position[i] + difference[i] * fraction; } - - #endif // DELTA + calculate_delta(destination); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], + destination[E_AXIS], feedrate*feedmultiply/60/100.0, + active_extruder); + } + +#endif // DELTA #ifdef DUAL_X_CARRIAGE if (active_extruder_parked) @@ -5670,13 +5515,13 @@ void prepare_move() #if ! (defined DELTA || defined SCARA) // Do not use feedmultiply for E or Z only moves if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { - line_to_destination(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); } else { #if defined(MESH_BED_LEVELING) - mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); return; #else - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); #endif // MESH_BED_LEVELING } #endif // !(DELTA || SCARA) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 63e99bd3a..89cd5e835 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("dia:")); lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM])); + lcd_print(itostr3(extrudemultiply)); lcd_print('%'); } #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d98ef63d4..786527d0d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -545,7 +545,7 @@ float junction_deviation = 0.1; block->steps[Z_AXIS] = labs(dz); block->steps[E_AXIS] = labs(de); block->steps[E_AXIS] *= volumetric_multiplier[active_extruder]; - block->steps[E_AXIS] *= extruder_multiply[active_extruder]; + block->steps[E_AXIS] *= extrudemultiply; block->steps[E_AXIS] /= 100; block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS]))); @@ -679,7 +679,7 @@ float junction_deviation = 0.1; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; #endif delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; - delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0; + delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extrudemultiply / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index d38474baf..73c23ae9d 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -515,36 +515,31 @@ ISR(TIMER1_COMPA_vect) { } if (TEST(out_bits, Z_AXIS)) { // -direction - Z_APPLY_DIR(INVERT_Z_DIR,0); count_direction[Z_AXIS] = -1; - - if (check_endstops) { - - #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 - - #ifdef Z_DUAL_ENDSTOPS - - bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING, - z2_min_endstop = - #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0 - READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING - #else - z_min_endstop - #endif - ; - - bool z_min_both = z_min_endstop && old_z_min_endstop, - z2_min_both = z2_min_endstop && old_z2_min_endstop; - if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) { + if (check_endstops) + { + #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 + #ifndef Z_DUAL_ENDSTOPS + UPDATE_ENDSTOP(z, Z, min, MIN); + #else + bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + #if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1 + bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING); + #else + bool z2_min_endstop=z_min_endstop; + #endif + if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0)) + { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit = true; - if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing... + endstop_z_hit=true; + if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing... + { step_events_completed = current_block->step_event_count; + } } old_z_min_endstop = z_min_endstop; old_z2_min_endstop = z2_min_endstop; -<<<<<<< HEAD #endif #endif @@ -561,55 +556,37 @@ ISR(TIMER1_COMPA_vect) { old_z_probe_endstop = z_probe_endstop; #endif } -======= - - #else // !Z_DUAL_ENDSTOPS - - UPDATE_ENDSTOP(z, Z, min, MIN); - - #endif // !Z_DUAL_ENDSTOPS - - #endif // Z_MIN_PIN - - } // check_endstops - ->>>>>>> MarlinFirmware/Development } else { // +direction - Z_APPLY_DIR(!INVERT_Z_DIR,0); count_direction[Z_AXIS] = 1; - if (check_endstops) { - #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 - - #ifdef Z_DUAL_ENDSTOPS - - bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING, - z2_max_endstop = - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 - READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING - #else - z_max_endstop - #endif - ; - - bool z_max_both = z_max_endstop && old_z_max_endstop, - z2_max_both = z2_max_endstop && old_z2_max_endstop; - if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) { + #ifndef Z_DUAL_ENDSTOPS + UPDATE_ENDSTOP(z, Z, max, MAX); + #else + bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING); + #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1 + bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING); + #else + bool z2_max_endstop=z_max_endstop; + #endif + if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0)) + { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit = true; + endstop_z_hit=true; - // if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true"); - // if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true"); +// if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true"); +// if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true"); - if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing... + + if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing... + { step_events_completed = current_block->step_event_count; + } } old_z_max_endstop = z_max_endstop; old_z2_max_endstop = z2_max_endstop; -<<<<<<< HEAD #endif #endif @@ -626,34 +603,20 @@ ISR(TIMER1_COMPA_vect) { #endif } } -======= - - #else // !Z_DUAL_ENDSTOPS - - UPDATE_ENDSTOP(z, Z, max, MAX); - - #endif // !Z_DUAL_ENDSTOPS - - #endif // Z_MAX_PIN - - } // check_endstops - - } // +direction ->>>>>>> MarlinFirmware/Development #ifndef ADVANCE if (TEST(out_bits, E_AXIS)) { // -direction REV_E_DIR(); - count_direction[E_AXIS] = -1; + count_direction[E_AXIS]=-1; } else { // +direction NORM_E_DIR(); - count_direction[E_AXIS] = 1; + count_direction[E_AXIS]=1; } #endif //!ADVANCE // Take multiple steps per interrupt (For high speed moves) - for (int8_t i = 0; i < step_loops; i++) { + for (int8_t i=0; i < step_loops; i++) { #ifndef AT90USB MSerial.checkRx(); // Check for serial chars. #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 58a66973f..c85f8e14d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -485,7 +485,7 @@ static void lcd_tune_menu() { MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); #endif MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); - MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999); + MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999); #if TEMP_SENSOR_1 != 0 MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index c21785ed2..aaa55800a 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -624,7 +624,7 @@ static void lcd_implementation_status_screen() static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) { char c; - uint8_t n = LCD_WIDTH - 2; + uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -633,11 +633,12 @@ static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const cha } while(n--) lcd.print(' '); lcd.print(post_char); + lcd.print(' '); } static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) { char c; - uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data); + uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -650,7 +651,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t r } static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) { char c; - uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data); + uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -687,11 +688,11 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { lcd.setCursor(1, 1); lcd_printPGM(pstr); lcd.print(':'); - lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); + lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1); lcd_print(value); } -static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) { +static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) { char c; uint8_t n = LCD_WIDTH - concat; lcd.setCursor(0, row); @@ -705,15 +706,14 @@ static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* ps filename++; } while (n--) lcd.print(' '); - lcd.print(post_char); } static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' '); + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1); } static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]); + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2); } #define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) From 3175c70c796281e3aa3bf5df2300f405345fdf63 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Tue, 31 Mar 2015 00:11:11 -0500 Subject: [PATCH 133/302] Manually synching back up with MarlinFirmware/Development. --- Marlin/Conditionals.h | 3 +++ Marlin/Configuration.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 62ea7ba54..5f626b9fb 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -185,6 +185,9 @@ #define ENDSTOPPULLUP_YMIN #define ENDSTOPPULLUP_ZMIN #endif + #ifndef DISABLE_Z_PROBE_ENDSTOP + #define ENDSTOPPULL_ZPROBE + #endif #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 481004f1d..82d710745 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -313,8 +313,8 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN + // #define ENDSTOPPULLUP_ZPROBE #endif ->>>>>>> MarlinFirmware/Development // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. From ec1d9c0b8f87a0d76c1f54496b0e8584081dd099 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Tue, 31 Mar 2015 01:06:01 -0500 Subject: [PATCH 134/302] Use Z_PROBE_ENDSTOP_INVERTING when checking pin status. --- Marlin/stepper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 73c23ae9d..0dbc2a297 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -545,7 +545,7 @@ ISR(TIMER1_COMPA_vect) { #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 UPDATE_ENDSTOP(z, Z, probe, PROBE); - z_probe_endstop=(READ(Z_PROBE_PIN) != Z_MIN_ENDSTOP_INVERTING); + z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if(z_probe_endstop && old_z_probe_endstop) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; @@ -592,7 +592,7 @@ ISR(TIMER1_COMPA_vect) { #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 UPDATE_ENDSTOP(z, Z, probe, PROBE); - z_probe_endstop=(READ(Z_PROBE_PIN) != Z_MAX_ENDSTOP_INVERTING); + z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if(z_probe_endstop && old_z_probe_endstop) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; From ba2c7cb46725428c94d04fe2f696a4f09a224f77 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 23:24:33 -0700 Subject: [PATCH 135/302] Update configs with all the latest --- Marlin/Configuration.h | 30 +- Marlin/Configuration_adv.h | 91 ++--- Marlin/configurator/config/Configuration.h | 76 ++-- .../configurator/config/Configuration_adv.h | 282 ++++++++++---- .../Felix/Configuration.h | 132 ++++--- .../Felix/Configuration_DUAL.h | 133 ++++--- .../Felix/Configuration_adv.h | 297 +++++++++++---- .../Hephestos/Configuration.h | 88 +++-- .../Hephestos/Configuration_adv.h | 287 ++++++++++---- .../K8200/Configuration.h | 84 +++-- .../K8200/Configuration_adv.h | 277 +++++++++++--- .../SCARA/Configuration.h | 89 ++--- .../SCARA/Configuration_adv.h | 287 ++++++++++---- .../WITBOX/Configuration.h | 82 ++-- .../WITBOX/Configuration_adv.h | 283 ++++++++++---- .../delta/generic/Configuration.h | 127 ++++--- .../delta/generic/Configuration_adv.h | 350 ------------------ .../delta/kossel_mini/Configuration.h | 131 ++++--- .../delta/kossel_mini/Configuration_adv.h | 340 ++++++++++++----- .../makibox/Configuration.h | 84 +++-- .../makibox/Configuration_adv.h | 292 +++++++++++---- .../tvrrug/Round2/Configuration.h | 89 +++-- .../tvrrug/Round2/Configuration_adv.h | 295 +++++++++++---- 23 files changed, 2714 insertions(+), 1512 deletions(-) delete mode 100644 Marlin/example_configurations/delta/generic/Configuration_adv.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 889690d82..bd1bff6d2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -104,7 +104,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -118,7 +118,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -264,15 +264,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -338,7 +338,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -// If you motor turns to wrong direction, you can invert it here: +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false #define INVERT_Y_DIR false #define INVERT_Z_DIR false @@ -421,14 +421,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 - + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -442,7 +441,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right @@ -454,7 +452,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. @@ -572,7 +570,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display this information is not important. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. // To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. // See also documentation/LCDLanguageFont.md #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware @@ -645,7 +643,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -653,7 +651,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -707,9 +705,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards @@ -726,7 +724,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code -#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially +#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 9ff7644f8..b81e63c8e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -102,28 +102,27 @@ #ifdef Z_DUAL_STEPPER_DRIVERS -// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. -// That way the machine is capable to align the bed during home, since both Z steppers are homed. -// There is also an implementation of M666 (software endstops adjustment) to this feature. -// After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. -// One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. -// If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. -// Play a little bit with small adjustments (0.5mm) and check the behaviour. -// The M119 (endstops report) will start reporting the Z2 Endstop as well. + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. -#define Z_DUAL_ENDSTOPS + #define Z_DUAL_ENDSTOPS -#ifdef Z_DUAL_ENDSTOPS - #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. - #define Z2_DIR_PIN E2_DIR_PIN - #define Z2_ENABLE_PIN E2_ENABLE_PIN - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. -#endif + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif - -#endif +#endif // Z_DUAL_STEPPER_DRIVERS // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -242,27 +241,37 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on HD44780 LCDs for SD printing -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -300,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -308,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 35eafff76..7ba259704 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -113,7 +113,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -127,7 +127,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -274,15 +274,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -329,13 +329,13 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS @@ -361,17 +361,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR false // Direct drive extruder v9: true. Geared extruder: false -#define INVERT_E1_DIR false // Direct drive extruder v9: true. Geared extruder: false -#define INVERT_E2_DIR false // Direct drive extruder v9: true. Geared extruder: false -#define INVERT_E3_DIR false // Direct drive extruder v9: true. Geared extruder: false +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // @section homing @@ -455,11 +455,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -473,11 +474,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -485,9 +485,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points + #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -571,8 +575,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -604,13 +608,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // @section lcd // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -623,6 +630,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -677,7 +685,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -687,7 +695,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -741,9 +749,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index b03402e79..21b30580c 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -112,6 +112,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -124,41 +148,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -168,6 +192,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 2 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. // @section machine @@ -231,8 +256,8 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ @@ -240,27 +265,37 @@ // @section lcd -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on HD44780 LCDs for SD printing -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // @section more @@ -298,12 +333,8 @@ #ifdef ADVANCE #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 #define STEPS_MM_E 836 - #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) - #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA) - #endif // ADVANCE // Arc interpretation settings: @@ -312,14 +343,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// @section lcd - -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // @section temperature // Control heater 0 and heater 1 in parallel. @@ -333,7 +356,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -377,6 +400,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 0ee841071..4500b6c1f 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -264,24 +264,27 @@ your extruder heater takes 2 minutes to hit the target on heating. // uncomment the 2 defines below: // Parameters for all extruder heaters -//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 60 //in seconds -//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 5 // in degree Celsius +//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds +//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius // If you want to enable this feature for your bed heater, // uncomment the 2 defines below: // Parameters for the bed heater -//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 30 //in seconds -//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 5// in degree Celsius +//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds +//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius //=========================================================================== //============================= Mechanical Settings ========================= //=========================================================================== -// Uncomment the following line to enable CoreXY kinematics +// Uncomment this option to enable CoreXY kinematics // #define COREXY +// Enable this option for Toshiba steppers +// #define CONFIG_STEPPERS_TOSHIBA + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -295,7 +298,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. @@ -318,13 +321,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -336,12 +340,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 255 #define X_MIN_POS 0 -#define Y_MAX_POS 205 #define Y_MIN_POS 0 -#define Z_MAX_POS 235 #define Z_MIN_POS 0 +#define X_MAX_POS 255 +#define Y_MAX_POS 205 +#define Z_MAX_POS 235 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -379,39 +383,38 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING -// There are 2 different ways to pick the X and Y locations to probe: - -// - "grid" mode -// Probe every point in a rectangular grid -// You must specify the rectangle, and the density of sample points -// This mode is preferred because there are more measurements. -// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive - -// - "3-point" mode -// Probe 3 arbitrary points on the bed (that aren't colinear) -// You must specify the X & Y coordinates of all 3 points + // There are 2 different ways to specify probing locations + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't colinear) + // You specify the XY coordinates of all 3 points. + // Enable this to sample the bed in a grid (least squares solution) + // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - // with AUTO_BED_LEVELING_GRID, the bed is sampled in a - // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid - // and least squares solution is calculated - // Note: this feature occupies 10'206 byte + #ifdef AUTO_BED_LEVELING_GRID #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 - #define BACK_PROBE_BED_POSITION 180 #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 180 - // set the number of grid points per dimension - // I wouldn't see a reason to go above 3 (=9 probing points on the bed) + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + + // Set the number of grid points per dimension + // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 + #else // !AUTO_BED_LEVELING_GRID - #else // not AUTO_BED_LEVELING_GRID - // with no grid, just probe 3 arbitrary points. A simple cross-product - // is used to esimate the plane of the print bed - + // Arbitrary points to probe. A simple cross-product + // is used to estimate the plane of the bed. #define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_2_X 15 @@ -421,21 +424,24 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - - // these are the offsets to the probe relative to the extruder tip (Hotend - Probe) + // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind + #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. // Be sure you have this distance over your Z_MAX_POS in case #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points + #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -470,12 +476,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -513,8 +521,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -542,13 +550,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -//#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -561,6 +572,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -622,11 +634,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino #define FAST_PWM_FAN -// Temperature status LEDs that display the hotend and bet temperature. -// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. -// Otherwise the RED led is on. There is 1C hysteresis. -//#define TEMP_STAT_LEDS - // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. @@ -638,6 +645,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 +// Temperature status LEDs that display the hotend and bet temperature. +// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. +// Otherwise the RED led is on. There is 1C hysteresis. +//#define TEMP_STAT_LEDS + // M240 Triggers a camera by emulating a Canon RC-1 Remote // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ // #define PHOTOGRAPH_PIN 23 diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index f5fc0ea5d..d3509a763 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -264,24 +264,27 @@ your extruder heater takes 2 minutes to hit the target on heating. // uncomment the 2 defines below: // Parameters for all extruder heaters -//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 60 //in seconds -//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 5 // in degree Celsius +//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds +//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius // If you want to enable this feature for your bed heater, // uncomment the 2 defines below: // Parameters for the bed heater -//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 30 //in seconds -//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 5// in degree Celsius +//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds +//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius //=========================================================================== //============================= Mechanical Settings ========================= //=========================================================================== -// Uncomment the following line to enable CoreXY kinematics +// Uncomment this option to enable CoreXY kinematics // #define COREXY +// Enable this option for Toshiba steppers +// #define CONFIG_STEPPERS_TOSHIBA + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -295,7 +298,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. @@ -318,13 +321,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true +#define INVERT_E0_DIR false +#define INVERT_E1_DIR true +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -336,12 +340,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 255 #define X_MIN_POS 0 -#define Y_MAX_POS 205 #define Y_MIN_POS 0 -#define Z_MAX_POS 235 #define Z_MIN_POS 0 +#define X_MAX_POS 255 +#define Y_MAX_POS 205 +#define Z_MAX_POS 235 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -379,39 +383,38 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING -// There are 2 different ways to pick the X and Y locations to probe: - -// - "grid" mode -// Probe every point in a rectangular grid -// You must specify the rectangle, and the density of sample points -// This mode is preferred because there are more measurements. -// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive - -// - "3-point" mode -// Probe 3 arbitrary points on the bed (that aren't colinear) -// You must specify the X & Y coordinates of all 3 points + // There are 2 different ways to specify probing locations + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't colinear) + // You specify the XY coordinates of all 3 points. + // Enable this to sample the bed in a grid (least squares solution) + // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - // with AUTO_BED_LEVELING_GRID, the bed is sampled in a - // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid - // and least squares solution is calculated - // Note: this feature occupies 10'206 byte + #ifdef AUTO_BED_LEVELING_GRID #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 - #define BACK_PROBE_BED_POSITION 180 #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 180 - // set the number of grid points per dimension - // I wouldn't see a reason to go above 3 (=9 probing points on the bed) + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + + // Set the number of grid points per dimension + // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 + #else // !AUTO_BED_LEVELING_GRID - #else // not AUTO_BED_LEVELING_GRID - // with no grid, just probe 3 arbitrary points. A simple cross-product - // is used to esimate the plane of the print bed - + // Arbitrary points to probe. A simple cross-product + // is used to estimate the plane of the bed. #define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_2_X 15 @@ -421,21 +424,24 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - - // these are the offsets to the probe relative to the extruder tip (Hotend - Probe) + // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind + #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. // Be sure you have this distance over your Z_MAX_POS in case #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points + #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -470,12 +476,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -513,8 +521,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -542,13 +550,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -//#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -561,6 +572,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -619,15 +631,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define SAV_3DLCD - // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino #define FAST_PWM_FAN -// Temperature status LEDs that display the hotend and bet temperature. -// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. -// Otherwise the RED led is on. There is 1C hysteresis. -//#define TEMP_STAT_LEDS - // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. @@ -639,6 +645,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 +// Temperature status LEDs that display the hotend and bet temperature. +// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. +// Otherwise the RED led is on. There is 1C hysteresis. +//#define TEMP_STAT_LEDS + // M240 Triggers a camera by emulating a Canon RC-1 Remote // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ // #define PHOTOGRAPH_PIN 23 diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index da2424d64..9bbd515ca 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -100,6 +100,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -210,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on HD44780 LCDs for SD printing -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -275,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -283,32 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - -//#ifdef ULTIPANEL -// #undef SDCARDDETECTINVERTED -//#endif - -// Power Signal Control Definitions -// By default use ATX definition -#ifndef POWER_SUPPLY - #define POWER_SUPPLY 1 -#endif -// 1 = ATX -#if (POWER_SUPPLY == 1) - #define PS_ON_AWAKE LOW - #define PS_ON_ASLEEP HIGH -#endif -// 2 = X-Box 360 203W -#if (POWER_SUPPLY == 2) - #define PS_ON_AWAKE HIGH - #define PS_ON_ASLEEP LOW -#endif - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -318,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -360,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 78ff90e85..0ecf1ed46 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -104,7 +104,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -118,7 +118,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -270,15 +270,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -321,7 +321,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. @@ -344,13 +344,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -361,13 +362,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. -// Travel limits after homing (units in mm) -#define X_MAX_POS 215 +// Travel limits after homing (units are in mm) #define X_MIN_POS 0 -#define Y_MAX_POS 210 #define Y_MIN_POS 0 -#define Z_MAX_POS 180 #define Z_MIN_POS 0 +#define X_MAX_POS 215 +#define Y_MAX_POS 210 +#define Z_MAX_POS 180 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -426,14 +427,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 - + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -447,11 +447,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -459,10 +458,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -497,12 +499,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -518,8 +522,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves - - // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -541,8 +543,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -570,13 +572,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC #define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -589,6 +594,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -643,7 +649,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -651,7 +657,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -705,9 +711,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards @@ -724,7 +730,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code -#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially +#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index fcdf4d161..bac3b571a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -100,6 +100,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -158,11 +182,7 @@ //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} -#ifdef CONFIG_STEPPERS_TOSHIBA -#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers -#else -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) -#endif + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -214,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on HD44780 LCDs for SD printing -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -279,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 1.75 #define STEPS_MM_E 100.47095761381482 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -287,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -302,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -325,11 +349,11 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 80*60 //default feedrate for retracting (mm/s) + #define RETRACT_FEEDRATE 80*60 //default feedrate for retracting (mm/s) #define RETRACT_ZLIFT 0 //default retract Z-lift #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) //#define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8*60 //default feedrate for recovering from retraction (mm/s) + #define RETRACT_RECOVER_FEEDRATE 8*60 //default feedrate for recovering from retraction (mm/s) #endif // Add support for experimental filament exchange support M600; requires display @@ -344,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 22ba764cd..97e514cd9 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -104,7 +104,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -118,7 +118,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -275,15 +275,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -326,7 +326,7 @@ your extruder heater takes 2 minutes to hit the target on heating. #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. @@ -349,13 +349,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false +#define INVERT_E0_DIR true +#define INVERT_E1_DIR true +#define INVERT_E2_DIR true +#define INVERT_E3_DIR true // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -367,12 +368,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 200 #define X_MIN_POS 0 -#define Y_MAX_POS 200 #define Y_MIN_POS 0 -#define Z_MAX_POS 200 #define Z_MIN_POS 0 +#define X_MAX_POS 200 +#define Y_MAX_POS 200 +#define Z_MAX_POS 200 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -432,13 +433,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 - #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this - + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -452,11 +452,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -464,10 +463,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -502,12 +504,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -545,8 +549,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -574,13 +578,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -593,6 +600,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -647,7 +655,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -655,7 +663,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -709,9 +717,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index e802338b8..9bbd515ca 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -100,6 +100,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -210,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on HD44780 LCDs for SD printing -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -275,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -283,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -298,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -340,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 5b6f994ed..4c781a8c0 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -136,7 +136,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -299,15 +299,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -350,7 +350,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. @@ -373,13 +373,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -391,12 +392,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 200 #define X_MIN_POS 0 -#define Y_MAX_POS 200 #define Y_MIN_POS 0 -#define Z_MAX_POS 225 #define Z_MIN_POS MANUAL_Z_HOME_POS +#define X_MAX_POS 200 +#define Y_MAX_POS 200 +#define Z_MAX_POS 225 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -456,13 +457,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 - #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this - + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -476,11 +476,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) //#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -488,10 +487,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -526,13 +528,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -// For SCARA: Offset between HomingPosition and Bed X=0 / Y=0 -#define MANUAL_X_HOME_POS -22. -#define MANUAL_Y_HOME_POS -52. -#define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing. - +#ifdef MANUAL_HOME_POSITIONS + // For SCARA: Offset between HomingPosition and Bed X=0 / Y=0 + #define MANUAL_X_HOME_POS -22. + #define MANUAL_Y_HOME_POS -52. + #define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -548,8 +551,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves - - // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -571,8 +572,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -600,13 +601,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -619,6 +623,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -673,7 +678,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -681,7 +686,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -735,9 +740,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards @@ -754,7 +759,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code -#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially +#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 0a1833c75..7b00532e4 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -77,10 +77,10 @@ // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. // Multiple extruders can be assigned to the same pin in which case // the fan will turn on when any selected extruder is above the threshold. -#define EXTRUDER_0_AUTO_FAN_PIN -1 -#define EXTRUDER_1_AUTO_FAN_PIN -1 -#define EXTRUDER_2_AUTO_FAN_PIN -1 -#define EXTRUDER_3_AUTO_FAN_PIN -1 +#define EXTRUDER_0_AUTO_FAN_PIN -1 +#define EXTRUDER_1_AUTO_FAN_PIN -1 +#define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -100,6 +100,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -159,8 +183,6 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) - //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -212,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on the LCD when printing from SD? -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -285,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -300,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -322,9 +348,11 @@ const unsigned int dropsegments=5; //everything with less than this number of st #ifdef FWRETRACT #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change #define RETRACT_FEEDRATE 35 //default feedrate for retracting (mm/s) #define RETRACT_ZLIFT 0 //default retract Z-lift #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #endif @@ -340,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 6fec28b24..9b863e3dd 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -104,7 +104,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -118,7 +118,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -269,15 +269,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -320,7 +320,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. @@ -343,13 +343,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -361,12 +362,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 297 #define X_MIN_POS 0 -#define Y_MAX_POS 210 #define Y_MIN_POS 0 -#define Z_MAX_POS 200 #define Z_MIN_POS 0 +#define X_MAX_POS 297 +#define Y_MAX_POS 210 +#define Z_MAX_POS 200 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -427,12 +428,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define BACK_PROBE_BED_POSITION 170 #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this - + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -446,11 +446,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -458,10 +457,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -496,12 +498,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -538,8 +542,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -567,13 +571,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC #define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -586,6 +593,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -640,7 +648,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -648,7 +656,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -702,9 +710,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index fcdf4d161..965ecbf40 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -100,6 +100,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -158,11 +182,7 @@ //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} -#ifdef CONFIG_STEPPERS_TOSHIBA -#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers -#else -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) -#endif + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -214,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on HD44780 LCDs for SD printing -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -279,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 1.75 #define STEPS_MM_E 100.47095761381482 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -287,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -302,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -344,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 41eb19f4a..1c5ef0bcf 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -137,7 +137,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -151,7 +151,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -297,15 +297,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -348,7 +348,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. @@ -371,19 +371,18 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false // DELTA does not invert #define INVERT_Y_DIR false #define INVERT_Z_DIR false - -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN -// deltas always home to max -#define X_HOME_DIR 1 +#define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 @@ -391,12 +390,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS DELTA_PRINTABLE_RADIUS #define X_MIN_POS -DELTA_PRINTABLE_RADIUS -#define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Y_MIN_POS -DELTA_PRINTABLE_RADIUS -#define Z_MAX_POS MANUAL_Z_HOME_POS #define Z_MIN_POS 0 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Z_MAX_POS MANUAL_Z_HOME_POS //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -430,31 +429,59 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //=========================================================================== //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) -// Z-Probe Repeatability test is not supported in Deltas yet. +//#define Z_PROBE_REPEATABILITY_TEST // Z-Probe Repeatability test is not supported in Deltas yet. #ifdef ENABLE_AUTO_BED_LEVELING - // Deltas only support grid mode - #define AUTO_BED_LEVELING_GRID + // There are 2 different ways to specify probing locations + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't colinear) + // You specify the XY coordinates of all 3 points. - #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) - #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS - #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS - #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS - #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + // Enable this to sample the bed in a grid (least squares solution) + // Note: this feature generates 10KB extra code size + #define AUTO_BED_LEVELING_GRID // Deltas only support grid mode - #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + #ifdef AUTO_BED_LEVELING_GRID - // Non-linear bed leveling will be used. - // Compensate by interpolating between the nearest four Z probe values for each point. - // Useful for deltas where the print surface may appear like a bowl or dome shape. - // Works best with ACCURATE_BED_LEVELING_POINTS 5 or higher. - #define AUTO_BED_LEVELING_GRID_POINTS 9 + #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) + + #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + + // Non-linear bed leveling will be used. + // Compensate by interpolating between the nearest four Z probe values for each point. + // Useful for deltas where the print surface may appear like a bowl or dome shape. + // Works best with ACCURATE_BED_LEVELING_POINTS 5 or higher. + #define AUTO_BED_LEVELING_GRID_POINTS 9 + + #else // !AUTO_BED_LEVELING_GRID + + // Arbitrary points to probe. A simple cross-product + // is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 15 + #define ABL_PROBE_PT_1_Y 180 + #define ABL_PROBE_PT_2_X 15 + #define ABL_PROBE_PT_2_Y 20 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 20 + + #endif // AUTO_BED_LEVELING_GRID // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -465,7 +492,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 50 //How much the extruder will be raised after the last probing point. - + +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell + //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. //#define Z_PROBE_ALLEN_KEY @@ -507,16 +540,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // ENABLE_AUTO_BED_LEVELING - // The position of the homing switches #define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -555,8 +589,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -588,7 +622,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display this information is not important. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. // To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. // See also documentation/LCDLanguageFont.md #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware @@ -606,6 +640,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -667,7 +702,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -675,7 +710,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -729,9 +764,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards @@ -748,7 +783,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code -#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially +#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h deleted file mode 100644 index a622d4781..000000000 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ /dev/null @@ -1,350 +0,0 @@ -#ifndef CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H - -#include "Conditionals.h" - -//=========================================================================== -//=============================Thermal Settings ============================ -//=========================================================================== - -#ifdef BED_LIMIT_SWITCHING - #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS -#endif -#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control - -//// Heating sanity check: -// This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature -// If the temperature has not increased at the end of that period, the target temperature is set to zero. -// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature -// differ by at least 2x WATCH_TEMP_INCREASE -//#define WATCH_TEMP_PERIOD 40000 //40 seconds -//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds - -#ifdef PIDTEMP - // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed. - // if Kc is choosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE - #define DEFAULT_Kc (1) //heatingpower=Kc*(e_speed) - #endif -#endif - - -//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode. -//The maximum buffered steps/sec of the extruder motor are called "se". -//You enter the autotemp mode by a M109 S T F -// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp -// you exit the value by any M109 without F* -// Also, if the temperature is set to a value -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) - -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 - -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 - -#endif //DUAL_X_CARRIAGE - -//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) - -//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. - -#define AXIS_RELATIVE_MODES {false, false, false, false} - -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) - -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. -#define INVERT_X_STEP_PIN false -#define INVERT_Y_STEP_PIN false -#define INVERT_Z_STEP_PIN false -#define INVERT_E_STEP_PIN false - -// Default stepper release if idle. Set to 0 to deactivate. -#define DEFAULT_STEPPER_DEACTIVE_TIME 60 - -#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate -#define DEFAULT_MINTRAVELFEEDRATE 0.0 - -// Feedrates for manual moves along X, Y, Z, E from panel -#ifdef ULTIPANEL - #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel -#endif - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 - -// If defined the movements slow down when the look ahead buffer is only half full -// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) -//#define SLOWDOWN - -// Frequency limit -// See nophead's blog for more info -// Not working O -//#define XY_FREQUENCY_LIMIT 15 - -// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end -// of the buffer and all stops. This should not be much greater than zero and should only be changed -// if unwanted behavior is observed on a user's machine when running at very slow speeds. -#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec) - -// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. -#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] - -// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards) -#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) - -// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro -//#define DIGIPOT_I2C -// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8 -#define DIGIPOT_I2C_NUM_CHANNELS 8 -// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS -#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} - -//=========================================================================== -//=============================Additional Features=========================== -//=========================================================================== - -#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value - -//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ -#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again - -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. - -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. -// if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART - -// Show a progress bar on the LCD when printing from SD -//#define LCD_PROGRESS_BAR - -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 2000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif - -// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. -//#define USE_WATCHDOG - -#ifdef USE_WATCHDOG -// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. -// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. -// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. -//#define WATCHDOG_RESET_MANUAL -#endif - -// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. -//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - -// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process -// it can e.g. be used to change z-positions in the print startup phase in realtime -// does not respect endstops! -//#define BABYSTEPPING -#ifdef BABYSTEPPING - #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - #define BABYSTEP_INVERT_Z false //true for inverse movements in Z - #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements -#endif - -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#ifdef ADVANCE - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 - #define STEPS_MM_E 836 -#endif // ADVANCE - -// Arc interpretation settings: -#define MM_PER_ARC_SEGMENT 1 -#define N_ARC_CORRECTION 25 - -const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement - -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - -// Control heater 0 and heater 1 in parallel. -//#define HEATERS_PARALLEL - -//=========================================================================== -//=============================Buffers ============================ -//=========================================================================== - -// The number of linear motions that can be in the plan at any give time. -// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering. -#if defined SDSUPPORT - #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller -#else - #define BLOCK_BUFFER_SIZE 16 // maximize block buffer -#endif - - -//The ASCII buffer for recieving from the serial: -#define MAX_CMD_SIZE 96 -#define BUFSIZE 4 - - -// Firmware based and LCD controled retract -// M207 and M208 can be used to define parameters for the retraction. -// The retraction can be called by the slicer using G10 and G11 -// until then, intended retractions can be detected by moves that only extrude and the direction. -// the moves are than replaced by the firmware controlled ones. - -// #define FWRETRACT //ONLY PARTIALLY TESTED -#ifdef FWRETRACT - #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt - #define RETRACT_LENGTH 3 //default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s) - #define RETRACT_ZLIFT 0 //default retract Z-lift - #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) -#endif - -// Add support for experimental filament exchange support M600; requires display -#ifdef ULTIPANEL - //#define FILAMENTCHANGEENABLE - #ifdef FILAMENTCHANGEENABLE - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #endif -#endif - -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 8381e1523..40d4e4ee2 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -137,7 +137,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -151,7 +151,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -297,15 +297,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -348,7 +348,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. @@ -371,19 +371,18 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false // DELTA does not invert #define INVERT_Y_DIR false #define INVERT_Z_DIR false - -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN -// deltas always home to max -#define X_HOME_DIR 1 +#define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 @@ -391,12 +390,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS DELTA_PRINTABLE_RADIUS #define X_MIN_POS -DELTA_PRINTABLE_RADIUS -#define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Y_MIN_POS -DELTA_PRINTABLE_RADIUS -#define Z_MAX_POS MANUAL_Z_HOME_POS #define Z_MIN_POS 0 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Z_MAX_POS MANUAL_Z_HOME_POS //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -430,31 +429,59 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o //=========================================================================== #define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) -// Z-Probe Repeatability test is not supported in Deltas yet. +// #define Z_PROBE_REPEATABILITY_TEST // Z-Probe Repeatability test is not supported in Deltas yet. #ifdef ENABLE_AUTO_BED_LEVELING - // Deltas only support grid mode - #define AUTO_BED_LEVELING_GRID + // There are 2 different ways to specify probing locations + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't colinear) + // You specify the XY coordinates of all 3 points. - #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) - #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS - #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS - #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS - #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + // Enable this to sample the bed in a grid (least squares solution) + // Note: this feature generates 10KB extra code size + #define AUTO_BED_LEVELING_GRID // Deltas only support grid mode - #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + #ifdef AUTO_BED_LEVELING_GRID - // Non-linear bed leveling will be used. - // Compensate by interpolating between the nearest four Z probe values for each point. - // Useful for deltas where the print surface may appear like a bowl or dome shape. - // Works best with ACCURATE_BED_LEVELING_POINTS 5 or higher. - #define AUTO_BED_LEVELING_GRID_POINTS 9 + #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) + + #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS + #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + + // Non-linear bed leveling will be used. + // Compensate by interpolating between the nearest four Z probe values for each point. + // Useful for deltas where the print surface may appear like a bowl or dome shape. + // Works best with ACCURATE_BED_LEVELING_POINTS 5 or higher. + #define AUTO_BED_LEVELING_GRID_POINTS 9 + + #else // !AUTO_BED_LEVELING_GRID + + // Arbitrary points to probe. A simple cross-product + // is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 15 + #define ABL_PROBE_PT_1_Y 180 + #define ABL_PROBE_PT_2_X 15 + #define ABL_PROBE_PT_2_Y 20 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 20 + + #endif // AUTO_BED_LEVELING_GRID // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // -below (always!) #define Z_RAISE_BEFORE_HOMING 15 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -465,7 +492,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 50 //How much the extruder will be raised after the last probing point. - + +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell + //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + + //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk + //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. + // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. #define Z_PROBE_ALLEN_KEY @@ -507,16 +544,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif // ENABLE_AUTO_BED_LEVELING - // The position of the homing switches #define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used #define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -555,8 +593,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -588,7 +626,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Chose ONE of the next three charsets. This has to match your hardware. In case of a full graphic display this information is not important. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. // To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. // See also documentation/LCDLanguageFont.md #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware @@ -606,6 +644,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -667,7 +706,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -675,7 +714,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -729,9 +768,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards @@ -748,7 +787,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code -#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially +#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index a940e3f3e..b255000bc 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -13,30 +13,30 @@ #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control //// Heating sanity check: -// This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature -// If the temperature has not increased at the end of that period, the target temperature is set to zero. +// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature +// If the temperature has not increased at the end of that period, the target temperature is set to zero. // It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature // differ by at least 2x WATCH_TEMP_INCREASE //#define WATCH_TEMP_PERIOD 40000 //40 seconds //#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds #ifdef PIDTEMP - // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed. - // if Kc is choosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + #define PID_ADD_EXTRUSION_RATE #ifdef PID_ADD_EXTRUSION_RATE - #define DEFAULT_Kc (1) //heatingpower=Kc*(e_speed) + #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif //automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode. //The maximum buffered steps/sec of the extruder motor are called "se". -//You enter the autotemp mode by a M109 S T F +//You enter the autotemp mode by a M109 S B F // the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp // you exit the value by any M109 without F* // Also, if the temperature is set to a value Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS // Define if the two Y drives need to rotate in opposite directions #define INVERT_Y2_VS_Y_DIR true -// Enable this for dual x-carriage printers. +// Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE - + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 +#define X_HOME_RETRACT_MM 5 +#define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) - //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) - //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -174,9 +195,9 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 -// Feedrates for manual moves along X, Y, Z, E from panel #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif // minimum time in microseconds that a movement needs to take if the buffer is emptied. @@ -213,36 +234,46 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. -// if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on the LCD when printing from SD -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 2000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART -// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT + +// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG #ifdef USE_WATCHDOG @@ -256,7 +287,7 @@ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process -// it can e.g. be used to change z-positions in the print startup phase in realtime +// it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! //#define BABYSTEPPING #ifdef BABYSTEPPING @@ -269,7 +300,7 @@ // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// hooke's law says: force = k * distance +// Hooke's law says: force = k * distance // Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -278,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -286,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -299,24 +324,24 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== -// The number of linear motions that can be in the plan at any give time. -// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering. -#if defined SDSUPPORT +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -//The ASCII buffer for recieving from the serial: +//The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Firmware based and LCD controled retract -// M207 and M208 can be used to define parameters for the retraction. +// Firmware based and LCD controlled retract +// M207 and M208 can be used to define parameters for the retraction. // The retraction can be called by the slicer using G10 and G11 -// until then, intended retractions can be detected by moves that only extrude and the direction. +// until then, intended retractions can be detected by moves that only extrude and the direction. // the moves are than replaced by the firmware controlled ones. // #define FWRETRACT //ONLY PARTIALLY TESTED @@ -343,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f423ce737..e8e89234f 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -104,7 +104,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -118,7 +118,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -267,15 +267,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -318,7 +318,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. @@ -341,13 +341,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -359,12 +360,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 110 #define X_MIN_POS 0 -#define Y_MAX_POS 150 #define Y_MIN_POS 0 -#define Z_MAX_POS 86 #define Z_MIN_POS 0 +#define X_MAX_POS 110 +#define Y_MAX_POS 150 +#define Z_MAX_POS 86 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -424,13 +425,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 - #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this - + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -444,11 +444,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -456,10 +455,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -494,12 +496,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -536,8 +540,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -565,13 +569,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -584,6 +591,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -638,7 +646,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -646,7 +654,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -700,9 +708,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 12c3d71d4..5e0e6ef4d 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -32,7 +32,7 @@ //automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode. //The maximum buffered steps/sec of the extruder motor are called "se". -//You enter the autotemp mode by a M109 S T F +//You enter the autotemp mode by a M109 S B F // the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp // you exit the value by any M109 without F* // Also, if the temperature is set to a value Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -159,8 +183,6 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) - //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -205,7 +227,6 @@ // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8 #define DIGIPOT_I2C_NUM_CHANNELS 4 // actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS -//#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} #define DIGIPOT_I2C_MOTOR_CURRENTS {1.7, 1.7, 1.7, 1.7} //=========================================================================== @@ -213,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + //#define SDCARDDETECTINVERTED -// Show a progress bar on the LCD when printing from SD -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 2000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -278,7 +309,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -286,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -//#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -301,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -323,9 +348,11 @@ const unsigned int dropsegments=5; //everything with less than this number of st #ifdef FWRETRACT #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s) #define RETRACT_ZLIFT 0 //default retract Z-lift #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #endif @@ -341,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 73a6ef958..b37489c89 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -104,7 +104,7 @@ Here are some standard links for getting your machine calibrated: // 10 is 100k RS thermistor 198-961 (4.7k pullup) // 11 is 100k beta 3950 1% thermistor (4.7k pullup) // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) -// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 // @@ -118,7 +118,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 @@ -193,8 +193,8 @@ Here are some standard links for getting your machine calibrated: // Ultimaker // #define DEFAULT_Kp 22.2 -// #define DEFAULT_Ki 1.08 -// #define DEFAULT_Kd 114 +// #define DEFAULT_Ki 1.08 +// #define DEFAULT_Kd 114 // MakerGear // #define DEFAULT_Kp 7.0 @@ -269,15 +269,15 @@ The issue: If a thermistor come off, it will read a lower temperature than actua The system will turn the heater on forever, burning up the filament and anything else around. -After the temperature reaches the target for the first time, this feature will -start measuring for how long the current temperature stays below the target +After the temperature reaches the target for the first time, this feature will +start measuring for how long the current temperature stays below the target minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS). If it stays longer than _PERIOD, it means the thermistor temperature cannot catch up with the target, so something *may be* wrong. Then, to be on the safe side, the system will he halt. -Bear in mind the count down will just start AFTER the first time the +Bear in mind the count down will just start AFTER the first time the thermistor temperature is over the target, so you will have no problem if your extruder heater takes 2 minutes to hit the target on heating. @@ -320,7 +320,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_ZMIN #endif -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. @@ -343,13 +343,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -361,12 +362,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 205 #define X_MIN_POS 0 -#define Y_MAX_POS 205 #define Y_MIN_POS 0 -#define Z_MAX_POS 120 #define Z_MIN_POS 0 +#define X_MAX_POS 205 +#define Y_MAX_POS 205 +#define Z_MAX_POS 120 //=========================================================================== //============================= Filament Runout Sensor ====================== @@ -425,14 +426,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 - - #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 - #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. A simple cross-product @@ -446,11 +446,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // AUTO_BED_LEVELING_GRID - // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -458,10 +457,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points #define Z_RAISE_AFTER_PROBING 15 //How much the extruder will be raised after the last probing point. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -496,12 +498,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) -//Manual homing switch locations: +// Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#define MANUAL_X_HOME_POS 0 -#define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 -//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#ifdef MANUAL_HOME_POSITIONS + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E @@ -521,7 +525,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves - // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -543,8 +546,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef CUSTOM_M_CODES #ifdef ENABLE_AUTO_BED_LEVELING #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #endif @@ -572,13 +575,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -// Character based displays can have different extended charsets. -#define DISPLAY_CHARSET_HD44780_JAPAN // "ääööüüß23°" -//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one. +// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. +// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. +// See also documentation/LCDLanguageFont.md + #define DISPLAY_CHARSET_HD44780_JAPAN // this is the most common hardware + //#define DISPLAY_CHARSET_HD44780_WESTERN + //#define DISPLAY_CHARSET_HD44780_CYRILLIC //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -591,6 +597,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define ULTIPANEL //the UltiPanel as on Thingiverse //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click + // 0 to disable buzzer feedback // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne @@ -645,7 +652,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Shift register panels // --------------------- // 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection //#define SAV_3DLCD @@ -653,7 +660,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define FAST_PWM_FAN // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency -// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. //#define FAN_SOFT_PWM @@ -707,9 +714,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) * Single extruder only at this point (extruder 0) - * + * * Motherboards - * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) * 301 - Rambo - uses Analog input 3 * Note may require analog pins to be defined for different motherboards diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 14d2019cc..bbf7dc005 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -77,10 +77,10 @@ // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. // Multiple extruders can be assigned to the same pin in which case // the fan will turn on when any selected extruder is above the threshold. -#define EXTRUDER_0_AUTO_FAN_PIN -1 -#define EXTRUDER_1_AUTO_FAN_PIN -1 -#define EXTRUDER_2_AUTO_FAN_PIN -1 -#define EXTRUDER_3_AUTO_FAN_PIN -1 +#define EXTRUDER_0_AUTO_FAN_PIN -1 +#define EXTRUDER_1_AUTO_FAN_PIN -1 +#define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -100,6 +100,30 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS +#ifdef Z_DUAL_STEPPER_DRIVERS + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + // Same again but for Y Axis. //#define Y_DUAL_STEPPER_DRIVERS @@ -112,41 +136,41 @@ // allowing faster printing speeds. //#define DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE -// Configuration for second X-carriage -// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; -// the second x-carriage always homes to the maximum endstop. -#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage -#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed -#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position -#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. -// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) -#define X2_ENABLE_PIN 29 -#define X2_STEP_PIN 25 -#define X2_DIR_PIN 23 + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 -// There are a few selectable movement modes for dual x-carriages using M605 S -// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results -// as long as it supports dual x-carriages. (M605 S0) -// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so -// that additional slicer support is not required. (M605 S1) -// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all -// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at -// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) -// This is the default power-up mode which can be later using M605. -#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 -// Default settings in "Auto-park Mode" -#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder -#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder -// Default x offset in duplication mode (typically set to half print bed width) -#define DEFAULT_DUPLICATION_X_OFFSET 100 + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 #endif //DUAL_X_CARRIAGE @@ -158,11 +182,7 @@ //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} -#ifdef CONFIG_STEPPERS_TOSHIBA -#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers -#else -#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) -#endif + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -214,34 +234,44 @@ //=========================================================================== #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again -#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? -#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#ifdef SDSUPPORT -#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. -// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. -// using: -//#define MENU_ADDAUTOSTART + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED -// Show a progress bar on the LCD when printing from SD? -//#define LCD_PROGRESS_BAR + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. -#ifdef LCD_PROGRESS_BAR - // Amount of time (ms) to show the bar - #define PROGRESS_BAR_BAR_TIME 2000 - // Amount of time (ms) to show the status message - #define PROGRESS_BAR_MSG_TIME 3000 - // Amount of time (ms) to retain the status message (0=forever) - #define PROGRESS_MSG_EXPIRE 0 - // Enable this to show messages for MSG_TIME then hide them - //#define PROGRESS_MSG_ONCE -#endif + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -277,13 +307,9 @@ #ifdef ADVANCE #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 #define STEPS_MM_E 836 - #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) - #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA) - -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 @@ -291,12 +317,6 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted -// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT -// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should -// be commented out otherwise -#define SDCARDDETECTINVERTED - // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -306,7 +326,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#if defined SDSUPPORT +#ifdef SDSUPPORT #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -348,6 +368,139 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif #endif +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + #include "Conditionals.h" #include "SanityCheck.h" From 82794fa5f7cf30518d34ea6019fdaa26c3e11b89 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 23:25:04 -0700 Subject: [PATCH 136/302] Add delta generic not renaming --- .../delta/generic/Configuration_adv.h | 508 ++++++++++++++++++ 1 file changed, 508 insertions(+) create mode 100644 Marlin/example_configurations/delta/generic/Configuration_adv.h diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h new file mode 100644 index 000000000..abecacec2 --- /dev/null +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -0,0 +1,508 @@ +#ifndef CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H + +#include "Conditionals.h" + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +#ifdef BED_LIMIT_SWITCHING + #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS +#endif +#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control + +//// Heating sanity check: +// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature +// If the temperature has not increased at the end of that period, the target temperature is set to zero. +// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature +// differ by at least 2x WATCH_TEMP_INCREASE +//#define WATCH_TEMP_PERIOD 40000 //40 seconds +//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds + +#ifdef PIDTEMP + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + #define PID_ADD_EXTRUSION_RATE + #ifdef PID_ADD_EXTRUSION_RATE + #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) + #endif +#endif + + +//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode. +//The maximum buffered steps/sec of the extruder motor are called "se". +//You enter the autotemp mode by a M109 S B F +// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp +// you exit the value by any M109 without F* +// Also, if the temperature is set to a value Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + #define Z_DUAL_ENDSTOPS + + #ifdef Z_DUAL_ENDSTOPS + #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. + #define Z2_DIR_PIN E2_DIR_PIN + #define Z2_ENABLE_PIN E2_ENABLE_PIN + #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) + const bool Z2_MAX_ENDSTOP_INVERTING = false; + #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + +// Same again but for Y Axis. +//#define Y_DUAL_STEPPER_DRIVERS + +// Define if the two Y drives need to rotate in opposite directions +#define INVERT_Y2_VS_Y_DIR true + +// Enable this for dual x-carriage printers. +// A dual x-carriage design has the advantage that the inactive extruder can be parked which +// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage +// allowing faster printing speeds. +//#define DUAL_X_CARRIAGE +#ifdef DUAL_X_CARRIAGE + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h) + #define X2_ENABLE_PIN 29 + #define X2_STEP_PIN 25 + #define X2_DIR_PIN 23 + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif //DUAL_X_CARRIAGE + +//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: +#define X_HOME_RETRACT_MM 5 +#define Y_HOME_RETRACT_MM 5 +#define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +#define DEFAULT_STEPPER_DEACTIVE_TIME 60 + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +#ifdef ULTIPANEL + #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) +//#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec) + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] + +// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards) +#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) + +// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro +//#define DIGIPOT_I2C +// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8 +#define DIGIPOT_I2C_NUM_CHANNELS 8 +// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS +#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value +//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value + +//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ +#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again + +#ifdef SDSUPPORT + + // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise + #define SDCARDDETECTINVERTED + + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. + + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #ifdef LCD_PROGRESS_BAR + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + +#endif // SDSUPPORT + +// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +//#define USE_WATCHDOG + +#ifdef USE_WATCHDOG +// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. +// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. +// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. +//#define WATCHDOG_RESET_MANUAL +#endif + +// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. +//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + +// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process +// it can e.g. be used to change z-positions in the print startup phase in real-time +// does not respect endstops! +//#define BABYSTEPPING +#ifdef BABYSTEPPING + #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions + #define BABYSTEP_INVERT_Z false //true for inverse movements in Z + #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements +#endif + +// extruder advance constant (s2/mm3) +// +// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 +// +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// so: v ^ 2 is proportional to number of steps we advance the extruder +//#define ADVANCE + +#ifdef ADVANCE + #define EXTRUDER_ADVANCE_K .0 + #define D_FILAMENT 2.85 + #define STEPS_MM_E 836 +#endif + +// Arc interpretation settings: +#define MM_PER_ARC_SEGMENT 1 +#define N_ARC_CORRECTION 25 + +const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//=============================Buffers ============================ +//=========================================================================== + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. +#ifdef SDSUPPORT + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + + +//The ASCII buffer for receiving from the serial: +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + + +// Firmware based and LCD controlled retract +// M207 and M208 can be used to define parameters for the retraction. +// The retraction can be called by the slicer using G10 and G11 +// until then, intended retractions can be detected by moves that only extrude and the direction. +// the moves are than replaced by the firmware controlled ones. + +// #define FWRETRACT //ONLY PARTIALLY TESTED +#ifdef FWRETRACT + #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt + #define RETRACT_LENGTH 3 //default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s) + #define RETRACT_ZLIFT 0 //default retract Z-lift + #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) +#endif + +// Add support for experimental filament exchange support M600; requires display +#ifdef ULTIPANEL + //#define FILAMENTCHANGEENABLE + #ifdef FILAMENTCHANGEENABLE + #define FILAMENTCHANGE_XPOS 3 + #define FILAMENTCHANGE_YPOS 3 + #define FILAMENTCHANGE_ZADD 10 + #define FILAMENTCHANGE_FIRSTRETRACT -2 + #define FILAMENTCHANGE_FINALRETRACT -100 + #endif +#endif + +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_TMCDRIVER +#ifdef HAVE_TMCDRIVER + +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the arduino IDE for this + ******************************************************************************/ + +//#define HAVE_L6470DRIVER +#ifdef HAVE_L6470DRIVER + +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + +#include "Conditionals.h" +#include "SanityCheck.h" + +#endif //CONFIGURATION_ADV_H From 3348b3bf0c3870a013422371281fb74650f83ff8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Mar 2015 23:31:48 -0700 Subject: [PATCH 137/302] Allow SD_FINISHED_RELEASECOMMAND to be undefined --- Marlin/Conditionals.h | 2 +- Marlin/stepper.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 62ea7ba54..8399c4bf6 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -257,7 +257,7 @@ #endif #ifdef ULTIPANEL - #undef SDCARDDETECTINVERTED + #undef SDCARDDETECTINVERTED #endif // Power Signal Control Definitions diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index f127da499..a7dba4659 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -388,7 +388,9 @@ ISR(TIMER1_COMPA_vect) { { current_block = NULL; plan_discard_current_block(); - if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + #ifdef SD_FINISHED_RELEASECOMMAND + if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + #endif cleaning_buffer_counter--; OCR1A = 200; return; From 17707e7479e943fa06965336b9fe380427d3060c Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Tue, 31 Mar 2015 02:56:41 -0500 Subject: [PATCH 138/302] Fixed Z_PROBE_PIN pullup bug. Documented some additional areas that should be addressed if Z_PROBE is fully separated from Z_MIN or Z_MAX. Fixed a documentation error in sanity checks. Servos start at 0 not 1. --- Marlin/Conditionals.h | 2 +- Marlin/Marlin_main.cpp | 977 ++++++++++++++++++++++++----------------- Marlin/SanityCheck.h | 2 +- Marlin/stepper.cpp | 13 +- 4 files changed, 581 insertions(+), 413 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5f626b9fb..413e22562 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -186,7 +186,7 @@ #define ENDSTOPPULLUP_ZMIN #endif #ifndef DISABLE_Z_PROBE_ENDSTOP - #define ENDSTOPPULL_ZPROBE + #define ENDSTOPPULLUP_ZPROBE #endif #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 13905683a..0683c67e7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -79,7 +79,7 @@ // G4 - Dwell S or P // G10 - retract filament according to settings of M207 // G11 - retract recover filament according to settings of M208 -// G28 - Home all Axis +// G28 - Home one or more axes // G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. // G30 - Single Z Probe, probes bed at current XY location. // G31 - Dock sled (Z_PROBE_SLED only) @@ -170,10 +170,10 @@ // M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters // M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder // M406 - Turn off Filament Sensor extrusion control -// M407 - Display measured filament diameter +// M407 - Displays measured filament diameter // M500 - Store parameters in EEPROM // M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). -// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] @@ -210,7 +210,6 @@ int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; -int extrudemultiply = 100; //100->1 200->2 int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); @@ -273,7 +272,7 @@ int fanSpeed = 0; #endif // FWRETRACT -#if defined(ULTIPANEL) && HAS_POWER_SWITCH +#ifdef ULTIPANEL bool powersupply = #ifdef PS_DEFAULT_OFF false @@ -306,19 +305,19 @@ int fanSpeed = 0; #ifdef SCARA float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 static float delta[3] = { 0, 0, 0 }; -#endif +#endif bool cancel_heatup = false; #ifdef FILAMENT_SENSOR //Variables for Filament Sensor input - float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 - bool filament_sensor = false; //M405 turns on filament_sensor control, M406 turns it off - float filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter + float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 + bool filament_sensor=false; //M405 turns on filament_sensor control, M406 turns it off + float filament_width_meas=DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter signed char measurement_delay[MAX_MEASUREMENT_DELAY+1]; //ring buffer to delay measurement store extruder factor after subtracting 100 - int delay_index1 = 0; //index into ring buffer - int delay_index2 = -1; //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized - float delay_dist = 0; //delay distance counter + int delay_index1=0; //index into ring buffer + int delay_index2=-1; //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized + float delay_dist=0; //delay distance counter int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting #endif @@ -477,8 +476,6 @@ bool enquecommand(const char *cmd) return true; } - - void setup_killpin() { #if defined(KILL_PIN) && KILL_PIN > -1 @@ -519,8 +516,8 @@ void setup_powerhold() #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 OUT_WRITE(SUICIDE_PIN, HIGH); #endif - #if HAS_POWER_SWITCH - #ifdef PS_DEFAULT_OFF + #if defined(PS_ON_PIN) && PS_ON_PIN > -1 + #if defined(PS_DEFAULT_OFF) OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #else OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -932,7 +929,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static float x_home_pos(int extruder) { if (extruder == 0) - return base_home_pos(X_AXIS) + home_offset[X_AXIS]; + return base_home_pos(X_AXIS) + home_offset[X_AXIS]; else // In dual carriage mode the extruder offset provides an override of the // second X-carriage offset when homed - otherwise X2_HOME_POS is used. @@ -961,15 +958,15 @@ static void axis_is_at_home(int axis) { if (axis == X_AXIS) { if (active_extruder != 0) { current_position[X_AXIS] = x_home_pos(active_extruder); - min_pos[X_AXIS] = X2_MIN_POS; - max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); + min_pos[X_AXIS] = X2_MIN_POS; + max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); return; } else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { - current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; - min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS]; - max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS], - max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); + float xoff = home_offset[X_AXIS]; + current_position[X_AXIS] = base_home_pos(X_AXIS) + xoff; + min_pos[X_AXIS] = base_min_pos(X_AXIS) + xoff; + max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); return; } } @@ -1023,178 +1020,189 @@ static void axis_is_at_home(int axis) { } /** - * Shorthand to tell the planner our current position (in mm). + * Some planner shorthand inline functions */ +inline void line_to_current_position() { + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); +} +inline void line_to_z(float zPosition) { + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); +} +inline void line_to_destination() { + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); +} inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } #ifdef ENABLE_AUTO_BED_LEVELING -#ifdef AUTO_BED_LEVELING_GRID -#ifndef DELTA - static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { - vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); - planeNormal.debug("planeNormal"); - plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - //bedLevel.debug("bedLevel"); + #ifdef AUTO_BED_LEVELING_GRID - //plan_bed_level_matrix.debug("bed level before"); - //vector_3 uncorrected_position = plan_get_position_mm(); - //uncorrected_position.debug("position before"); + #ifndef DELTA - vector_3 corrected_position = plan_get_position(); - //corrected_position.debug("position after"); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + static void set_bed_level_equation_lsq(double *plane_equation_coefficients) { + vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); + planeNormal.debug("planeNormal"); + plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + //bedLevel.debug("bedLevel"); - sync_plan_position(); + //plan_bed_level_matrix.debug("bed level before"); + //vector_3 uncorrected_position = plan_get_position_mm(); + //uncorrected_position.debug("position before"); + + vector_3 corrected_position = plan_get_position(); + //corrected_position.debug("position after"); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + + sync_plan_position(); + } + + #endif // !DELTA + + #else // !AUTO_BED_LEVELING_GRID + + static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { + + plan_bed_level_matrix.set_to_identity(); + + vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); + vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); + vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); + vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); + + if (planeNormal.z < 0) { + planeNormal.x = -planeNormal.x; + planeNormal.y = -planeNormal.y; + planeNormal.z = -planeNormal.z; + } + + plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + + vector_3 corrected_position = plan_get_position(); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + + sync_plan_position(); + } + + #endif // !AUTO_BED_LEVELING_GRID + + static void run_z_probe() { + + #ifdef DELTA + + float start_z = current_position[Z_AXIS]; + long start_steps = st_get_position(Z_AXIS); + + // move down slowly until you find the bed + feedrate = homing_feedrate[Z_AXIS] / 4; + destination[Z_AXIS] = -10; + prepare_move_raw(); + st_synchronize(); + endstops_hit_on_purpose(); + + // we have to let the planner know where we are right now as it is not where we said to go. + long stop_steps = st_get_position(Z_AXIS); + float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; + current_position[Z_AXIS] = mm; + calculate_delta(current_position); + plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + + #else // !DELTA + + plan_bed_level_matrix.set_to_identity(); + feedrate = homing_feedrate[Z_AXIS]; + + // move down until you find the bed + float zPosition = -10; + line_to_z(zPosition); + st_synchronize(); + + // we have to let the planner know where we are right now as it is not where we said to go. + zPosition = st_get_position_mm(Z_AXIS); + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); + + // move up the retract distance + zPosition += home_retract_mm(Z_AXIS); + line_to_z(zPosition); + st_synchronize(); + endstops_hit_on_purpose(); + + // move back down slowly to find bed + if (homing_bump_divisor[Z_AXIS] >= 1) + feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; + else { + feedrate = homing_feedrate[Z_AXIS] / 10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); + } + + zPosition -= home_retract_mm(Z_AXIS) * 2; + line_to_z(zPosition); + st_synchronize(); + endstops_hit_on_purpose(); + + current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); + // make sure the planner knows where we are as it may be a bit different than we last said to move to + sync_plan_position(); + + #endif // !DELTA } -#endif -#else // not AUTO_BED_LEVELING_GRID - -static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { - - plan_bed_level_matrix.set_to_identity(); - - vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); - vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); - vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); - vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - - if (planeNormal.z < 0) { - planeNormal.x = -planeNormal.x; - planeNormal.y = -planeNormal.y; - planeNormal.z = -planeNormal.z; - } - - plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - vector_3 corrected_position = plan_get_position(); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z - - sync_plan_position(); -} - -#endif // AUTO_BED_LEVELING_GRID - -static void run_z_probe() { - #ifdef DELTA - - float start_z = current_position[Z_AXIS]; - long start_steps = st_get_position(Z_AXIS); - - // move down slowly until you find the bed - feedrate = homing_feedrate[Z_AXIS] / 4; - destination[Z_AXIS] = -10; - prepare_move_raw(); - st_synchronize(); - endstops_hit_on_purpose(); - - // we have to let the planner know where we are right now as it is not where we said to go. - long stop_steps = st_get_position(Z_AXIS); - float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; - current_position[Z_AXIS] = mm; - calculate_delta(current_position); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); - - #else - - plan_bed_level_matrix.set_to_identity(); - feedrate = homing_feedrate[Z_AXIS]; - - // move down until you find the bed - float zPosition = -10; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); - - // we have to let the planner know where we are right now as it is not where we said to go. - zPosition = st_get_position_mm(Z_AXIS); - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); - - // move up the retract distance - zPosition += home_retract_mm(Z_AXIS); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); - endstops_hit_on_purpose(); - - // move back down slowly to find bed - if (homing_bump_divisor[Z_AXIS] >= 1) { - feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS]; - } - else { - feedrate = homing_feedrate[Z_AXIS]/10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); - } - - zPosition -= home_retract_mm(Z_AXIS) * 2; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); - endstops_hit_on_purpose(); - - current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); - // make sure the planner knows where we are as it may be a bit different than we last said to move to - sync_plan_position(); - - #endif -} - -static void do_blocking_move_to(float x, float y, float z) { + static void do_blocking_move_to(float x, float y, float z) { float oldFeedRate = feedrate; -#ifdef DELTA + #ifdef DELTA - feedrate = XY_TRAVEL_SPEED; - - destination[X_AXIS] = x; - destination[Y_AXIS] = y; - destination[Z_AXIS] = z; - prepare_move_raw(); - st_synchronize(); + feedrate = XY_TRAVEL_SPEED; -#else + destination[X_AXIS] = x; + destination[Y_AXIS] = y; + destination[Z_AXIS] = z; + prepare_move_raw(); + st_synchronize(); - feedrate = homing_feedrate[Z_AXIS]; + #else - current_position[Z_AXIS] = z; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); + feedrate = homing_feedrate[Z_AXIS]; - feedrate = xy_travel_speed; + current_position[Z_AXIS] = z; + line_to_current_position(); + st_synchronize(); - current_position[X_AXIS] = x; - current_position[Y_AXIS] = y; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); - st_synchronize(); + feedrate = xy_travel_speed; -#endif + current_position[X_AXIS] = x; + current_position[Y_AXIS] = y; + line_to_current_position(); + st_synchronize(); + + #endif feedrate = oldFeedRate; -} + } -static void setup_for_endstop_move() { + static void setup_for_endstop_move() { saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; feedmultiply = 100; previous_millis_cmd = millis(); - enable_endstops(true); -} - -static void clean_up_after_endstop_move() { -#ifdef ENDSTOPS_ONLY_FOR_HOMING - enable_endstops(false); -#endif + } + static void clean_up_after_endstop_move() { + #ifdef ENDSTOPS_ONLY_FOR_HOMING + enable_endstops(false); + #endif feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; previous_millis_cmd = millis(); -} + } +<<<<<<< HEAD static void engage_z_probe() { // Engage Z Servo endstop if enabled #ifdef SERVO_ENDSTOPS @@ -1229,6 +1237,9 @@ static void engage_z_probe() { st_synchronize(); + // If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become + // it's own unique entity, then the following logic will need to be modified + // so it only uses the Z_PROBE #if defined(Z_PROBE_AND_ENDSTOP) bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if (z_probe_endstop) @@ -1242,13 +1253,59 @@ static void engage_z_probe() { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); +======= + static void engage_z_probe() { + + #ifdef SERVO_ENDSTOPS + + // Engage Z Servo endstop if enabled + if (servo_endstops[Z_AXIS] >= 0) { + #if SERVO_LEVELING + servos[servo_endstops[Z_AXIS]].attach(0); + #endif + servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); + #if SERVO_LEVELING + delay(PROBE_SERVO_DEACTIVATION_DELAY); + servos[servo_endstops[Z_AXIS]].detach(); + #endif + } + + #elif defined(Z_PROBE_ALLEN_KEY) + + feedrate = homing_feedrate[X_AXIS]; + + // Move to the start position to initiate deployment + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z; + prepare_move_raw(); + + // Home X to touch the belt + feedrate = homing_feedrate[X_AXIS]/10; + destination[X_AXIS] = 0; + prepare_move_raw(); + + // Home Y for safety + feedrate = homing_feedrate[X_AXIS]/2; + destination[Y_AXIS] = 0; + prepare_move_raw(); + + st_synchronize(); + + bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (z_min_endstop) { + if (!Stopped) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); +>>>>>>> MarlinFirmware/Development } Stop(); - } - #endif + } -} + #endif // Z_PROBE_ALLEN_KEY +<<<<<<< HEAD static void retract_z_probe() { // Retract Z Servo endstop if enabled #ifdef SERVO_ENDSTOPS @@ -1298,6 +1355,9 @@ static void retract_z_probe() { st_synchronize(); + // If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become + // it's own unique entity, then the following logic will need to be modified + // so it only uses the Z_PROBE #if defined(Z_PROBE_AND_ENDSTOP) bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if (z_probe_endstop) @@ -1311,126 +1371,219 @@ static void retract_z_probe() { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); +======= + } + + static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) { + + #ifdef SERVO_ENDSTOPS + + // Retract Z Servo endstop if enabled + if (servo_endstops[Z_AXIS] >= 0) { + + if (z_after > 0) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after); + st_synchronize(); +>>>>>>> MarlinFirmware/Development + } + + #if SERVO_LEVELING + servos[servo_endstops[Z_AXIS]].attach(0); + #endif + + servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); + + #if SERVO_LEVELING + delay(PROBE_SERVO_DEACTIVATION_DELAY); + servos[servo_endstops[Z_AXIS]].detach(); + #endif + } + + #elif defined(Z_PROBE_ALLEN_KEY) + + // Move up for safety + feedrate = homing_feedrate[X_AXIS]; + destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; + prepare_move_raw(); + + // Move to the start position to initiate retraction + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Z; + prepare_move_raw(); + + // Move the nozzle down to push the probe into retracted position + feedrate = homing_feedrate[Z_AXIS]/10; + destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH; + prepare_move_raw(); + + // Move up for safety + feedrate = homing_feedrate[Z_AXIS]/2; + destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2; + prepare_move_raw(); + + // Home XY for safety + feedrate = homing_feedrate[X_AXIS]/2; + destination[X_AXIS] = 0; + destination[Y_AXIS] = 0; + prepare_move_raw(); + + st_synchronize(); + + // If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become + // it's own unique entity, then the following logic will need to be modified + // so it only uses the Z_PROBE + bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (!z_min_endstop) { + if (!Stopped) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); } Stop(); + } + + #endif + + } + + enum ProbeAction { + ProbeStay = 0, + ProbeEngage = BIT(0), + ProbeRetract = BIT(1), + ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) + }; + + // Probe bed height at position (x,y), returns the measured z value + static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { + // move to right place + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); + do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); + + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) + if (retract_action & ProbeEngage) engage_z_probe(); + #endif + + run_z_probe(); + float measured_z = current_position[Z_AXIS]; + + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) + if (retract_action & ProbeRetract) retract_z_probe(z_before); + #endif + + if (verbose_level > 2) { + SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM(" X: "); + SERIAL_PROTOCOL_F(x, 3); + SERIAL_PROTOCOLPGM(" Y: "); + SERIAL_PROTOCOL_F(y, 3); + SERIAL_PROTOCOLPGM(" Z: "); + SERIAL_PROTOCOL_F(measured_z, 3); + SERIAL_EOL; } - #endif - -} - -enum ProbeAction { - ProbeStay = 0, - ProbeEngage = BIT(0), - ProbeRetract = BIT(1), - ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) -}; - -/// Probe bed height at position (x,y), returns the measured z value -static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { - // move to right place - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); - do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); - - #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeEngage) engage_z_probe(); - #endif - - run_z_probe(); - float measured_z = current_position[Z_AXIS]; - - #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) retract_z_probe(); - #endif - - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(MSG_BED); - SERIAL_PROTOCOLPGM(" X: "); - SERIAL_PROTOCOL_F(x, 3); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL_F(y, 3); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z, 3); - SERIAL_EOL; + return measured_z; } - return measured_z; -} -#ifdef DELTA -static void extrapolate_one_point(int x, int y, int xdir, int ydir) { - if (bed_level[x][y] != 0.0) { - return; // Don't overwrite good values. - } - float a = 2*bed_level[x+xdir][y] - bed_level[x+xdir*2][y]; // Left to right. - float b = 2*bed_level[x][y+ydir] - bed_level[x][y+ydir*2]; // Front to back. - float c = 2*bed_level[x+xdir][y+ydir] - bed_level[x+xdir*2][y+ydir*2]; // Diagonal. - float median = c; // Median is robust (ignores outliers). - if (a < b) { - if (b < c) median = b; - if (c < a) median = a; - } else { // b <= a - if (c < b) median = b; - if (a < c) median = a; - } - bed_level[x][y] = median; -} + #ifdef DELTA -// Fill in the unprobed points (corners of circular print surface) -// using linear extrapolation, away from the center. -static void extrapolate_unprobed_bed_level() { - int half = (AUTO_BED_LEVELING_GRID_POINTS-1)/2; - for (int y = 0; y <= half; y++) { - for (int x = 0; x <= half; x++) { - if (x + y < 3) continue; - extrapolate_one_point(half-x, half-y, x>1?+1:0, y>1?+1:0); - extrapolate_one_point(half+x, half-y, x>1?-1:0, y>1?+1:0); - extrapolate_one_point(half-x, half+y, x>1?+1:0, y>1?-1:0); - extrapolate_one_point(half+x, half+y, x>1?-1:0, y>1?-1:0); + /** + * All DELTA leveling in the Marlin uses NONLINEAR_BED_LEVELING + */ + + static void extrapolate_one_point(int x, int y, int xdir, int ydir) { + if (bed_level[x][y] != 0.0) { + return; // Don't overwrite good values. + } + float a = 2*bed_level[x+xdir][y] - bed_level[x+xdir*2][y]; // Left to right. + float b = 2*bed_level[x][y+ydir] - bed_level[x][y+ydir*2]; // Front to back. + float c = 2*bed_level[x+xdir][y+ydir] - bed_level[x+xdir*2][y+ydir*2]; // Diagonal. + float median = c; // Median is robust (ignores outliers). + if (a < b) { + if (b < c) median = b; + if (c < a) median = a; + } else { // b <= a + if (c < b) median = b; + if (a < c) median = a; + } + bed_level[x][y] = median; } - } -} -// Print calibration results for plotting or manual frame adjustment. -static void print_bed_level() { - for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { - for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { - SERIAL_PROTOCOL_F(bed_level[x][y], 2); - SERIAL_PROTOCOLPGM(" "); + // Fill in the unprobed points (corners of circular print surface) + // using linear extrapolation, away from the center. + static void extrapolate_unprobed_bed_level() { + int half = (AUTO_BED_LEVELING_GRID_POINTS-1)/2; + for (int y = 0; y <= half; y++) { + for (int x = 0; x <= half; x++) { + if (x + y < 3) continue; + extrapolate_one_point(half-x, half-y, x>1?+1:0, y>1?+1:0); + extrapolate_one_point(half+x, half-y, x>1?-1:0, y>1?+1:0); + extrapolate_one_point(half-x, half+y, x>1?+1:0, y>1?-1:0); + extrapolate_one_point(half+x, half+y, x>1?-1:0, y>1?-1:0); + } + } } - SERIAL_ECHOLN(""); - } -} -// Reset calibration results to zero. -void reset_bed_level() { - for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { - for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { - bed_level[x][y] = 0.0; + // Print calibration results for plotting or manual frame adjustment. + static void print_bed_level() { + for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { + for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { + SERIAL_PROTOCOL_F(bed_level[x][y], 2); + SERIAL_PROTOCOLPGM(" "); + } + SERIAL_ECHOLN(""); + } } - } -} -#endif // DELTA + // Reset calibration results to zero. + void reset_bed_level() { + for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { + for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { + bed_level[x][y] = 0.0; + } + } + } + + #endif // DELTA #endif // ENABLE_AUTO_BED_LEVELING static void homeaxis(int axis) { -#define HOMEAXIS_DO(LETTER) \ - ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) + #define HOMEAXIS_DO(LETTER) \ + ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) - if (axis==X_AXIS ? HOMEAXIS_DO(X) : - axis==Y_AXIS ? HOMEAXIS_DO(Y) : - axis==Z_AXIS ? HOMEAXIS_DO(Z) : - 0) { - int axis_home_dir = home_dir(axis); -#ifdef DUAL_X_CARRIAGE - if (axis == X_AXIS) - axis_home_dir = x_home_dir(active_extruder); -#endif + if (axis == X_AXIS ? HOMEAXIS_DO(X) : + axis == Y_AXIS ? HOMEAXIS_DO(Y) : + axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { + + int axis_home_dir; + + #ifdef DUAL_X_CARRIAGE + if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder); + #else + axis_home_dir = home_dir(axis); + #endif current_position[axis] = 0; sync_plan_position(); + #ifndef Z_PROBE_SLED + // Engage Servo endstop if enabled + #ifdef SERVO_ENDSTOPS + #if SERVO_LEVELING + if (axis == Z_AXIS) { + engage_z_probe(); + } + else + #endif // SERVO_LEVELING + if (servo_endstops[axis] > -1) + servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); + + #endif // SERVO_ENDSTOPS + + #endif // Z_PROBE_SLED + +<<<<<<< HEAD #ifndef Z_PROBE_SLED // Engage Servo endstop if enabled and we are not using Z_PROBE_AND_ENDSTOP unless we are using Z_SAFE_HOMING #ifdef SERVO_ENDSTOPS && (defined (Z_SAFE_HOMING) || ! defined (Z_PROBE_AND_ENDSTOP)) @@ -1445,33 +1598,33 @@ static void homeaxis(int axis) { } #endif #endif // Z_PROBE_SLED +======= +>>>>>>> MarlinFirmware/Development #ifdef Z_DUAL_ENDSTOPS - if (axis==Z_AXIS) In_Homing_Process(true); + if (axis == Z_AXIS) In_Homing_Process(true); #endif + destination[axis] = 1.5 * max_length(axis) * axis_home_dir; feedrate = homing_feedrate[axis]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); current_position[axis] = 0; sync_plan_position(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); - destination[axis] = 2*home_retract_mm(axis) * axis_home_dir; + destination[axis] = 2 * home_retract_mm(axis) * axis_home_dir; if (homing_bump_divisor[axis] >= 1) - { - feedrate = homing_feedrate[axis]/homing_bump_divisor[axis]; - } - else - { - feedrate = homing_feedrate[axis]/10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; + else { + feedrate = homing_feedrate[axis] / 10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); } - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); #ifdef Z_DUAL_ENDSTOPS if (axis==Z_AXIS) @@ -1486,7 +1639,7 @@ static void homeaxis(int axis) { destination[axis] = fabs(z_endstop_adj); if (z_endstop_adj < 0) Lock_z_motor(true); else Lock_z2_motor(true); } - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); Lock_z_motor(false); Lock_z2_motor(false); @@ -1499,7 +1652,7 @@ static void homeaxis(int axis) { if (endstop_adj[axis] * axis_home_dir < 0) { sync_plan_position(); destination[axis] = endstop_adj[axis]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); } #endif @@ -1544,7 +1697,7 @@ void refresh_cmd_timeout(void) } plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate=retract_feedrate*60; + feedrate = retract_feedrate * 60; retracted[active_extruder]=true; prepare_move(); if(retract_zlift > 0.01) { @@ -1580,8 +1733,8 @@ void refresh_cmd_timeout(void) } plan_set_e_position(current_position[E_AXIS]); float oldFeedrate = feedrate; - feedrate=retract_recover_feedrate*60; - retracted[active_extruder]=false; + feedrate = retract_recover_feedrate * 60; + retracted[active_extruder] = false; prepare_move(); feedrate = oldFeedrate; } @@ -1735,17 +1888,16 @@ inline void gcode_G4() { */ inline void gcode_G28() { #ifdef ENABLE_AUTO_BED_LEVELING + plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #ifdef DELTA reset_bed_level(); - #else - plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #endif #endif #if defined(MESH_BED_LEVELING) uint8_t mbl_was_active = mbl.active; mbl.active = 0; - #endif // MESH_BED_LEVELING + #endif saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; @@ -1768,7 +1920,7 @@ inline void gcode_G28() { for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH; feedrate = 1.732 * homing_feedrate[X_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); endstops_hit_on_purpose(); @@ -1816,7 +1968,7 @@ inline void gcode_G28() { } else { feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1); } - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); st_synchronize(); axis_is_at_home(X_AXIS); @@ -1824,7 +1976,7 @@ inline void gcode_G28() { sync_plan_position(); destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); feedrate = 0.0; st_synchronize(); endstops_hit_on_purpose(); @@ -1891,7 +2043,7 @@ inline void gcode_G28() { #if defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); #endif HOMEAXIS(Z); @@ -1903,11 +2055,11 @@ inline void gcode_G28() { destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER); destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = XY_TRAVEL_SPEED / 60; + feedrate = XY_TRAVEL_SPEED; current_position[Z_AXIS] = 0; sync_plan_position(); - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); current_position[X_AXIS] = destination[X_AXIS]; current_position[Y_AXIS] = destination[Y_AXIS]; @@ -1929,7 +2081,7 @@ inline void gcode_G28() { plan_set_position(cpx, cpy, current_position[Z_AXIS], current_position[E_AXIS]); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); HOMEAXIS(Z); } @@ -1982,7 +2134,7 @@ inline void gcode_G28() { destination[Z_AXIS] = current_position[Z_AXIS]; destination[E_AXIS] = current_position[E_AXIS]; feedrate = homing_feedrate[X_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder); + line_to_destination(); st_synchronize(); current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; sync_plan_position(); @@ -1996,6 +2148,19 @@ inline void gcode_G28() { endstops_hit_on_purpose(); } +#if defined(MESH_BED_LEVELING) || defined(ENABLE_AUTO_BED_LEVELING) + + // Check for known positions in X and Y + inline bool can_run_bed_leveling() { + if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) return true; + LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); + return false; + } + +#endif // MESH_BED_LEVELING || ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING /** @@ -2010,6 +2175,10 @@ inline void gcode_G28() { * */ inline void gcode_G29() { + + // Prevent leveling without first homing in X and Y + if (!can_run_bed_leveling()) return; + static int probe_point = -1; int state = 0; if (code_seen('S') || code_seen('s')) { @@ -2126,13 +2295,8 @@ inline void gcode_G28() { */ inline void gcode_G29() { - // Prevent user from running a G29 without first homing in X and Y - if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { - LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); - return; - } + // Prevent leveling without first homing in X and Y + if (!can_run_bed_leveling()) return; int verbose_level = 1; @@ -2214,16 +2378,15 @@ inline void gcode_G28() { st_synchronize(); - if (!dryrun) - { + if (!dryrun) { + // make sure the bed_level_rotation_matrix is identity or the planner will get it wrong + plan_bed_level_matrix.set_to_identity(); + #ifdef DELTA reset_bed_level(); #else //!DELTA - - // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly //vector_3 corrected_position = plan_get_position_mm(); //corrected_position.debug("position before G29"); - plan_bed_level_matrix.set_to_identity(); vector_3 uncorrected_position = plan_get_position(); //uncorrected_position.debug("position during G29"); current_position[X_AXIS] = uncorrected_position.x; @@ -2231,7 +2394,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = uncorrected_position.z; sync_plan_position(); - #endif + #endif // !DELTA } setup_for_endstop_move(); @@ -2292,13 +2455,12 @@ inline void gcode_G28() { // raise extruder float measured_z, - z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS; + z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0); #ifdef DELTA // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe); - if (distance_from_center > DELTA_PROBABLE_RADIUS) - continue; + if (distance_from_center > DELTA_PROBABLE_RADIUS) continue; #endif //DELTA // Enhanced G29 - Do not retract servo between probes @@ -2326,6 +2488,11 @@ inline void gcode_G28() { #endif probePointCounter++; + + manage_heater(); + manage_inactivity(); + lcd_update(); + } //xProbe } //yProbe @@ -2412,16 +2579,14 @@ inline void gcode_G28() { if (verbose_level > 0) plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); - // Correct the Z height difference from z-probe position and hotend tip position. - // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. - // When the bed is uneven, this height must be corrected. - if (!dryrun) - { - float x_tmp, y_tmp, z_tmp, real_z; - real_z = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) - x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER; - y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER; - z_tmp = current_position[Z_AXIS]; + if (!dryrun) { + // Correct the Z height difference from z-probe position and hotend tip position. + // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. + // When the bed is uneven, this height must be corrected. + float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER, + y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER, + z_tmp = current_position[Z_AXIS], + real_z = (float)st_get_position(Z_AXIS) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane) apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner. @@ -2757,11 +2922,13 @@ inline void gcode_M42() { } // code_seen('S') } - +// If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become +// it's own unique entity, then the following logic will need to be modified +// so it only uses the Z_PROBE #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST) - #if Z_MIN_PIN == -1 - #error "You must have a Z_MIN endstop in order to enable calculation of Z-Probe repeatability." + #if (Z_MIN_PIN == -1) && (! defined (Z_PROBE_PIN) || Z_PROBE_PIN == -1) + #error "You must have a Z_MIN or Z_PROBE endstop in order to enable calculation of Z-Probe repeatability." #endif /** @@ -3267,7 +3434,7 @@ inline void gcode_M140() { if (code_seen('S')) setTargetBed(code_value()); } -#if HAS_POWER_SWITCH +#if defined(PS_ON_PIN) && PS_ON_PIN > -1 /** * M80: Turn on Power Supply @@ -3289,12 +3456,10 @@ inline void gcode_M140() { #endif } -#endif // HAS_POWER_SWITCH +#endif // PS_ON_PIN /** - * M81: Turn off Power, including Power Supply, if there is one. - * - * This code should ALWAYS be available for EMERGENCY SHUTDOWN! + * M81: Turn off Power Supply */ inline void gcode_M81() { disable_heater(); @@ -3309,19 +3474,16 @@ inline void gcode_M81() { #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 st_synchronize(); suicide(); - #elif HAS_POWER_SWITCH + #elif defined(PS_ON_PIN) && PS_ON_PIN > -1 OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #endif #ifdef ULTIPANEL - #if HAS_POWER_SWITCH - powersupply = false; - #endif + powersupply = false; LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); lcd_update(); #endif } - /** * M82: Set E codes absolute (default) */ @@ -3490,7 +3652,7 @@ inline void gcode_M119() { SERIAL_PROTOCOLPGM(MSG_Z2_MAX); SERIAL_PROTOCOLLN(((READ(Z2_MAX_PIN)^Z2_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Z_PROBE_PIN) && Z_PROBE_PIN >-1 + #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 SERIAL_PROTOCOLPGM(MSG_Z_PROBE); SERIAL_PROTOCOLLN(((READ(Z_PROBE_PIN)^Z_PROBE_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif @@ -3794,7 +3956,7 @@ inline void gcode_M221() { extruder_multiply[tmp_extruder] = sval; } else { - extrudemultiply = sval; + extruder_multiply[active_extruder] = sval; } } } @@ -4231,7 +4393,7 @@ inline void gcode_M400() { st_synchronize(); } //SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); //SERIAL_PROTOCOL(filament_width_meas); //SERIAL_PROTOCOLPGM("Extrusion ratio(%):"); - //SERIAL_PROTOCOL(extrudemultiply); + //SERIAL_PROTOCOL(extruder_multiply[active_extruder]); } /** @@ -4704,18 +4866,14 @@ void process_commands() { gcode_G28(); break; - #if defined(MESH_BED_LEVELING) - case 29: // G29 Handle mesh based leveling + #if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING) + case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. gcode_G29(); break; #endif #ifdef ENABLE_AUTO_BED_LEVELING - case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. - gcode_G29(); - break; - #ifndef Z_PROBE_SLED case 30: // G30 Single Z Probe @@ -4862,15 +5020,15 @@ void process_commands() { #endif //HEATER_2_PIN #endif //BARICUDA - #if HAS_POWER_SWITCH + #if defined(PS_ON_PIN) && PS_ON_PIN > -1 case 80: // M80 - Turn on Power Supply gcode_M80(); break; - #endif // HAS_POWER_SWITCH + #endif // PS_ON_PIN - case 81: // M81 - Turn off Power, including Power Supply, if possible + case 81: // M81 - Turn off Power Supply gcode_M81(); break; @@ -5410,69 +5568,72 @@ void prepare_move() #ifdef SCARA //for now same as delta-code -float difference[NUM_AXIS]; -for (int8_t i=0; i < NUM_AXIS; i++) { - difference[i] = destination[i] - current_position[i]; -} + float difference[NUM_AXIS]; + for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; -float cartesian_mm = sqrt( sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); -if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } -if (cartesian_mm < 0.000001) { return; } -float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; -int steps = max(1, int(scara_segments_per_second * seconds)); - //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); - //SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); - //SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); -for (int s = 1; s <= steps; s++) { - float fraction = float(s) / float(steps); - for(int8_t i=0; i < NUM_AXIS; i++) { - destination[i] = current_position[i] + difference[i] * fraction; - } + float cartesian_mm = sqrt( sq(difference[X_AXIS]) + + sq(difference[Y_AXIS]) + + sq(difference[Z_AXIS])); + if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } + if (cartesian_mm < 0.000001) { return; } + float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + int steps = max(1, int(scara_segments_per_second * seconds)); + //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); + //SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); + //SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); + + for (int s = 1; s <= steps; s++) { + float fraction = float(s) / float(steps); + for(int8_t i = 0; i < NUM_AXIS; i++) { + destination[i] = current_position[i] + difference[i] * fraction; + } - calculate_delta(destination); - //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); - //SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]); - //SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]); - //SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]); - //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); - //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); - - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); -} -#endif // SCARA - -#ifdef DELTA - float difference[NUM_AXIS]; - for (int8_t i=0; i < NUM_AXIS; i++) { - difference[i] = destination[i] - current_position[i]; - } - float cartesian_mm = sqrt(sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); - if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } - if (cartesian_mm < 0.000001) { return; } - float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; - int steps = max(1, int(delta_segments_per_second * seconds)); - // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); - // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); - // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); - for (int s = 1; s <= steps; s++) { - float fraction = float(s) / float(steps); - for(int8_t i=0; i < NUM_AXIS; i++) { - destination[i] = current_position[i] + difference[i] * fraction; + calculate_delta(destination); + //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); + //SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]); + //SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]); + //SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]); + //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); + //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); + + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], + destination[E_AXIS], feedrate*feedmultiply/60/100.0, + active_extruder); } - calculate_delta(destination); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); - } + + #endif // SCARA -#endif // DELTA + #ifdef DELTA + + float difference[NUM_AXIS]; + for (int8_t i=0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; + + float cartesian_mm = sqrt(sq(difference[X_AXIS]) + + sq(difference[Y_AXIS]) + + sq(difference[Z_AXIS])); + if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); + if (cartesian_mm < 0.000001) return; + float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + int steps = max(1, int(delta_segments_per_second * seconds)); + + // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); + // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds); + // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps); + + for (int s = 1; s <= steps; s++) { + float fraction = float(s) / float(steps); + for (int8_t i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i] + difference[i] * fraction; + calculate_delta(destination); + #ifdef ENABLE_AUTO_BED_LEVELING + adjust_delta(destination); + #endif + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], + destination[E_AXIS], feedrate*feedmultiply/60/100.0, + active_extruder); + } + + #endif // DELTA #ifdef DUAL_X_CARRIAGE if (active_extruder_parked) @@ -5518,13 +5679,13 @@ for (int s = 1; s <= steps; s++) { #if ! (defined DELTA || defined SCARA) // Do not use feedmultiply for E or Z only moves if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(); } else { #if defined(MESH_BED_LEVELING) - mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); + mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); return; #else - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); #endif // MESH_BED_LEVELING } #endif // !(DELTA || SCARA) @@ -5844,17 +6005,19 @@ void kill() disable_e2(); disable_e3(); - #if HAS_POWER_SWITCH - pinMode(PS_ON_PIN, INPUT); - #endif - +#if defined(PS_ON_PIN) && PS_ON_PIN > -1 + pinMode(PS_ON_PIN,INPUT); +#endif SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_KILLED); LCD_ALERTMESSAGEPGM(MSG_KILLED); // FMC small patch to update the LCD before ending sei(); // enable interrupts - for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time + for ( int i=5; i--; lcd_update()) + { + delay(200); + } cli(); // disable interrupts suicide(); while(1) { /* Intentionally left empty */ } // Wait for reset diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 1427da212..10b1d30cc 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -116,7 +116,7 @@ #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_AND_ENDSTOP #endif #ifndef SERVO_ENDSTOPS - #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 1 to use Z_PROBE_AND_ENDSTOP + #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_AND_ENDSTOP #endif #ifndef SERVO_ENDSTOP_ANGLES #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 0dbc2a297..6bd82cc68 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -76,6 +76,7 @@ volatile long endstops_stepsTotal, endstops_stepsDone; static volatile bool endstop_x_hit = false; static volatile bool endstop_y_hit = false; static volatile bool endstop_z_hit = false; +static volatile bool endstop_z_probe_hit = false; #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED bool abort_on_endstop_hit = false; @@ -258,11 +259,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; #define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A) void endstops_hit_on_purpose() { - endstop_x_hit = endstop_y_hit = endstop_z_hit = false; + endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false; } void checkHitEndstops() { - if (endstop_x_hit || endstop_y_hit || endstop_z_hit) { + if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); if (endstop_x_hit) { @@ -277,6 +278,10 @@ void checkHitEndstops() { SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); } + if (endstop_z_probe_hit) { + SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); + LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP"); + } SERIAL_EOL; endstops_hit_on_purpose(); @@ -549,7 +554,7 @@ ISR(TIMER1_COMPA_vect) { if(z_probe_endstop && old_z_probe_endstop) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit=true; + endstop_z_probe_hit=true; // if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); } @@ -596,7 +601,7 @@ ISR(TIMER1_COMPA_vect) { if(z_probe_endstop && old_z_probe_endstop) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit=true; + endstop_z_probe_hit=true; // if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); } old_z_probe_endstop = z_probe_endstop; From 571652c49b68988c728f8ef2d9856d7aa50d68ae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 01:41:24 -0700 Subject: [PATCH 139/302] Fix LCD click - Make the default LCD click sound more pleasant - Fix warnings about bed temperature runaway --- Marlin/temperature.cpp | 27 ++++++++++++++++----------- Marlin/ultralcd.cpp | 6 +++--- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index d0720c5ec..884de9401 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -83,15 +83,20 @@ unsigned char soft_pwm_bed; #ifdef FILAMENT_SENSOR int current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only #endif -#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0 -void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); -static int thermal_runaway_state_machine[4]; // = {0,0,0,0}; -static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; -static bool thermal_runaway = false; -#if TEMP_SENSOR_BED != 0 - static int thermal_runaway_bed_state_machine; - static unsigned long thermal_runaway_bed_timer; -#endif + +#define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0) +#define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0) +#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION + static bool thermal_runaway = false; + void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); + #if HAS_HEATER_THERMAL_PROTECTION + static int thermal_runaway_state_machine[4]; // = {0,0,0,0}; + static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; + #endif + #if HAS_BED_THERMAL_PROTECTION + static int thermal_runaway_bed_state_machine; + static unsigned long thermal_runaway_bed_timer; + #endif #endif //=========================================================================== @@ -650,7 +655,7 @@ void manage_heater() { #if TEMP_SENSOR_BED != 0 - #if defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 + #if HAS_BED_THERMAL_PROTECTION thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, 9, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS); #endif @@ -1008,7 +1013,7 @@ void setWatch() { #endif } -#if defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0 +#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { /* diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index dc0ba4fbb..b00cfea1d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -136,7 +136,6 @@ static void lcd_status_screen(); if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \ uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ bool wasClicked = LCD_CLICKED, itemSelected; \ - if (wasClicked) lcd_quick_feedback(); \ for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ _menuItemNr = 0; @@ -167,6 +166,7 @@ static void lcd_status_screen(); if (lcdDrawUpdate) \ lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \ if (wasClicked && itemSelected) { \ + lcd_quick_feedback(); \ menu_action_ ## type(args); \ return; \ } \ @@ -1155,10 +1155,10 @@ static void lcd_quick_feedback() { #elif defined(BEEPER) && BEEPER > -1 SET_OUTPUT(BEEPER); #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 500 + #define LCD_FEEDBACK_FREQUENCY_HZ 5000 #endif #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 #endif const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; int i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; From bb6174524f5f2382cf77ccec276d2ce7e1eb848e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 02:08:57 -0700 Subject: [PATCH 140/302] Fix EXTRUDER_OFFSET compiler error - Addressing issue #1741 --- Marlin/Marlin_main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 86138fb8f..caeb628b2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -229,18 +229,17 @@ bool axis_known_position[3] = { false }; // Extruder offset #if EXTRUDERS > 1 #ifndef EXTRUDER_OFFSET_X - #define EXTRUDER_OFFSET_X 0 + #define EXTRUDER_OFFSET_X { 0 } #endif #ifndef EXTRUDER_OFFSET_Y - #define EXTRUDER_OFFSET_Y 0 + #define EXTRUDER_OFFSET_Y { 0 } #endif #ifndef DUAL_X_CARRIAGE #define NUM_EXTRUDER_OFFSETS 2 // only in XY plane #else #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane #endif - #define _EXY { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y } - float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS] = ARRAY_BY_EXTRUDERS(_EXY, _EXY, _EXY, _EXY); + float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS]; #endif uint8_t active_extruder = 0; @@ -569,6 +568,13 @@ void servo_init() void setup() { + #if EXTRUDERS > 1 + float offset[3][EXTRUDERS] = { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y, ARRAY_BY_EXTRUDERS(0,0,0,0) }; + for (int e=0; e Date: Tue, 31 Mar 2015 02:10:49 -0700 Subject: [PATCH 141/302] Fix typo in assignment --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index caeb628b2..5c7ff37f3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -572,7 +572,7 @@ void setup() float offset[3][EXTRUDERS] = { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y, ARRAY_BY_EXTRUDERS(0,0,0,0) }; for (int e=0; e Date: Tue, 31 Mar 2015 02:49:47 -0700 Subject: [PATCH 142/302] Restore extruder_offset, init more simply --- Marlin/Configuration.h | 12 ++++----- Marlin/Marlin_main.cpp | 56 +++++++++++++++++++----------------------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bd1bff6d2..f62509e4a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -72,6 +72,12 @@ Here are some standard links for getting your machine calibrated: // This defines the number of extruders #define EXTRUDERS 1 +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) @@ -516,12 +522,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves -// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). -// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). -// For the other hotends it is their distance from the extruder 0 hotend. -// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -// #define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis - // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) #define DEFAULT_XYJERK 20.0 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5c7ff37f3..6b3589d7c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -226,7 +226,7 @@ float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; bool axis_known_position[3] = { false }; -// Extruder offset +// Extruder offsets #if EXTRUDERS > 1 #ifndef EXTRUDER_OFFSET_X #define EXTRUDER_OFFSET_X { 0 } @@ -234,12 +234,13 @@ bool axis_known_position[3] = { false }; #ifndef EXTRUDER_OFFSET_Y #define EXTRUDER_OFFSET_Y { 0 } #endif - #ifndef DUAL_X_CARRIAGE - #define NUM_EXTRUDER_OFFSETS 2 // only in XY plane - #else - #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane - #endif - float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS]; + float extruder_offset[][EXTRUDERS] = { + EXTRUDER_OFFSET_X, + EXTRUDER_OFFSET_Y + #ifdef DUAL_X_CARRIAGE + , { 0 } // supports offsets in XYZ plane + #endif + }; #endif uint8_t active_extruder = 0; @@ -568,13 +569,6 @@ void servo_init() void setup() { - #if EXTRUDERS > 1 - float offset[3][EXTRUDERS] = { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y, ARRAY_BY_EXTRUDERS(0,0,0,0) }; - for (int e=0; e 0) ? extruder_offset[1][X_AXIS] : X2_HOME_POS; + return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS; } static int x_home_dir(int extruder) { @@ -965,14 +959,14 @@ static void axis_is_at_home(int axis) { if (active_extruder != 0) { current_position[X_AXIS] = x_home_pos(active_extruder); min_pos[X_AXIS] = X2_MIN_POS; - max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS); + max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS); return; } else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { float xoff = home_offset[X_AXIS]; current_position[X_AXIS] = base_home_pos(X_AXIS) + xoff; min_pos[X_AXIS] = base_min_pos(X_AXIS) + xoff; - max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset); + max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset); return; } } @@ -3786,23 +3780,23 @@ inline void gcode_M206() { inline void gcode_M218() { if (setTargetedHotend(218)) return; - if (code_seen('X')) extruder_offset[tmp_extruder][X_AXIS] = code_value(); - if (code_seen('Y')) extruder_offset[tmp_extruder][Y_AXIS] = code_value(); + if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value(); + if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value(); #ifdef DUAL_X_CARRIAGE - if (code_seen('Z')) extruder_offset[tmp_extruder][Z_AXIS] = code_value(); + if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value(); #endif SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) { SERIAL_ECHO(" "); - SERIAL_ECHO(extruder_offset[tmp_extruder][X_AXIS]); + SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]); SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[tmp_extruder][Y_AXIS]); + SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]); #ifdef DUAL_X_CARRIAGE SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[tmp_extruder][Z_AXIS]); + SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]); #endif } SERIAL_EOL; @@ -4493,13 +4487,13 @@ inline void gcode_M503() { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); SERIAL_ECHO(" "); - SERIAL_ECHO(extruder_offset[0][X_AXIS]); + SERIAL_ECHO(extruder_offset[X_AXIS][0]); SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[0][Y_AXIS]); + SERIAL_ECHO(extruder_offset[Y_AXIS][0]); SERIAL_ECHO(" "); SERIAL_ECHO(duplicate_extruder_x_offset); SERIAL_ECHO(","); - SERIAL_ECHOLN(extruder_offset[1][Y_AXIS]); + SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]); break; case DXC_FULL_CONTROL_MODE: case DXC_AUTO_PARK_MODE: @@ -4634,11 +4628,11 @@ inline void gcode_T() { // apply Y & Z extruder offset (x offset is already used in determining home pos) current_position[Y_AXIS] = current_position[Y_AXIS] - - extruder_offset[active_extruder][Y_AXIS] + - extruder_offset[tmp_extruder][Y_AXIS]; + extruder_offset[Y_AXIS][active_extruder] + + extruder_offset[Y_AXIS][tmp_extruder]; current_position[Z_AXIS] = current_position[Z_AXIS] - - extruder_offset[active_extruder][Z_AXIS] + - extruder_offset[tmp_extruder][Z_AXIS]; + extruder_offset[Z_AXIS][active_extruder] + + extruder_offset[Z_AXIS][tmp_extruder]; active_extruder = tmp_extruder; @@ -4668,7 +4662,7 @@ inline void gcode_T() { #else // !DUAL_X_CARRIAGE // Offset extruder (only by XY) for (int i=X_AXIS; i<=Y_AXIS; i++) - current_position[i] += extruder_offset[tmp_extruder][i] - extruder_offset[active_extruder][i]; + current_position[i] += extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder]; // Set the new active extruder and position active_extruder = tmp_extruder; #endif // !DUAL_X_CARRIAGE From 935592cf6a8793e9baaed0d584b5aad84c1a3ff5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 02:50:52 -0700 Subject: [PATCH 143/302] offsets off by default --- Marlin/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f62509e4a..5412cbbea 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -75,8 +75,8 @@ Here are some standard links for getting your machine calibrated: // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX From cda4bd4ad95d3472bd6961c56bc64d57bbdfd097 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 03:20:15 -0700 Subject: [PATCH 144/302] Correct the comment about M206 --- Marlin/Configuration.h | 2 +- Marlin/configurator/config/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration_DUAL.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bd1bff6d2..56fe20089 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -696,7 +696,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 7ba259704..7868e8e81 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -740,7 +740,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4500b6c1f..1cc50246a 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -680,7 +680,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index d3509a763..956e2dc47 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -680,7 +680,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 0ecf1ed46..594295a3e 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -702,7 +702,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 97e514cd9..c17e419c7 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -708,7 +708,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 4c781a8c0..96fef00cf 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -731,7 +731,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 9b863e3dd..190270e85 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -701,7 +701,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 1c5ef0bcf..4aeb5d55f 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -755,7 +755,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 40d4e4ee2..edb7ff526 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -759,7 +759,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index e8e89234f..a3e8fd088 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -699,7 +699,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index b37489c89..7ffff3353 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -705,7 +705,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. +// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500. // //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles From 9a5a7a3f68e2c5437c1521c75355d902038478c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 03:38:03 -0700 Subject: [PATCH 145/302] Raise when not retracting Code to raise the probe before retraction is good, but the code should always raise the probe, not just when retracting --- Marlin/Marlin_main.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 86138fb8f..95bfc6bf1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1254,18 +1254,18 @@ inline void sync_plan_position() { } - static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) { + static void retract_z_probe() { #ifdef SERVO_ENDSTOPS // Retract Z Servo endstop if enabled if (servo_endstops[Z_AXIS] >= 0) { - if (z_after > 0) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after); + #if Z_RAISE_AFTER_PROBING > 0 + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); st_synchronize(); - } - + #endif + #if SERVO_LEVELING servos[servo_endstops[Z_AXIS]].attach(0); #endif @@ -1343,8 +1343,13 @@ inline void sync_plan_position() { run_z_probe(); float measured_z = current_position[Z_AXIS]; + #if Z_RAISE_AFTER_PROBING > 0 + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); + st_synchronize(); + #endif + #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) retract_z_probe(z_before); + if (retract_action & ProbeRetract) retract_z_probe(); #endif if (verbose_level > 2) { From ae89ccd2c7384d900e4cf892ce311e380889ce88 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 03:45:21 -0700 Subject: [PATCH 146/302] Use Z_RAISE_BETWEEN_PROBINGS --- Marlin/Marlin_main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 95bfc6bf1..127f02f0c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1343,9 +1343,11 @@ inline void sync_plan_position() { run_z_probe(); float measured_z = current_position[Z_AXIS]; - #if Z_RAISE_AFTER_PROBING > 0 - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); - st_synchronize(); + #if Z_RAISE_BETWEEN_PROBINGS > 0 + if (retract_action == ProbeStay) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BETWEEN_PROBINGS); + st_synchronize(); + } #endif #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) From 97a69d9b1c0db6709ead7e3914a2ceb1071a37ba Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 04:24:13 -0700 Subject: [PATCH 147/302] Correct XYZ after obtaining plan_bed_level_matrix The current position needs to be updated by using the inverse `plan_bed_level_matrix` on X, Y, and Z. All moves in the planner are transformed by the `plan_bed_level_matrix` from this point forward. --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b7c2f0dc5..7e9ac15a0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1055,7 +1055,7 @@ inline void sync_plan_position() { //corrected_position.debug("position after"); current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + current_position[Z_AXIS] = corrected_position.z; sync_plan_position(); } @@ -1084,7 +1084,7 @@ inline void sync_plan_position() { vector_3 corrected_position = plan_get_position(); current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z + current_position[Z_AXIS] = corrected_position.z; sync_plan_position(); } From d08782386b4473788a386d05d935642b0baa7293 Mon Sep 17 00:00:00 2001 From: Ivan Galvez Junquera Date: Tue, 31 Mar 2015 16:59:43 +0200 Subject: [PATCH 148/302] Added new trasnslatable labels. * Added MSG_END_HOUR and MSG_END_MINUTE labels to all language files. * Available translations: EN, FR, DE, ES, IT, PT, PT-BR. --- Marlin/Marlin_main.cpp | 2 +- Marlin/language_an.h | 2 ++ Marlin/language_ca.h | 2 ++ Marlin/language_de.h | 2 ++ Marlin/language_en.h | 6 ++++++ Marlin/language_es.h | 2 ++ Marlin/language_eu.h | 2 ++ Marlin/language_fi.h | 4 +++- Marlin/language_fr.h | 2 ++ Marlin/language_it.h | 2 ++ Marlin/language_kana.h | 2 ++ Marlin/language_kana_utf8.h | 2 ++ Marlin/language_nl.h | 2 ++ Marlin/language_pl.h | 3 +++ Marlin/language_pt-br.h | 2 ++ Marlin/language_pt.h | 2 ++ Marlin/language_ru.h | 2 ++ 17 files changed, 39 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 28c761395..a8636f982 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -843,7 +843,7 @@ void get_command() int hours, minutes; minutes=(t/60)%60; hours=t/60/60; - sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); + sprintf_P(time, PSTR("%i "MSG_END_HOUR" %i "MSG_END_MINUTE),hours, minutes); SERIAL_ECHO_START; SERIAL_ECHOLN(time); lcd_setstatus(time); diff --git a/Marlin/language_an.h b/Marlin/language_an.h index b8e83d3b3..60309d1ae 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index f25fe5789..35eb03829 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -124,6 +124,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 0f7b832a5..8c8496f02 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -122,6 +122,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop Abbr. Ein" +#define MSG_END_HOUR "Stunden" +#define MSG_END_MINUTE "Minuten" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Kalibrieren" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 2e76ed4d8..9d61167cc 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -417,6 +417,12 @@ #ifndef MSG_ERR_MAXTEMP_BED #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #endif +#ifndef MSG_END_HOUR +#define MSG_END_HOUR "hours" +#endif +#ifndef MSG_END_MINUTE +#define MSG_END_MINUTE "minutes" +#endif #ifdef DELTA_CALIBRATION_MENU #ifndef MSG_DELTA_CALIBRATE diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 143a1f457..92f903ceb 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "horas" +#define MSG_END_MINUTE "minutos" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 21cb733a1..6f6fd8b66 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop deuseztat" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index e1bfbf1af..2bb192ee6 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Kalibrointi" @@ -132,4 +134,4 @@ #define MSG_DELTA_CALIBRATE_CENTER "Kalibroi Center" #endif // DELTA_CALIBRATION_MENU -#endif // LANGUAGE_FI_H \ No newline at end of file +#endif // LANGUAGE_FI_H diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index ed65efdbd..be526a723 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -124,6 +124,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Butee abandon" +#define MSG_END_HOUR "heures" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 7fbcb46ac..752107376 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -124,6 +124,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Finecorsa abort" +#define MSG_END_HOUR "ore" +#define MSG_END_MINUTE "minuti" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Calibraz. Delta" diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 272440bac..9a05b6bbe 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -126,6 +126,8 @@ #define MSG_BABYSTEP_Y "\xcb\xde\xc4\xde\xb3 Y" // "Babystep Y" #define MSG_BABYSTEP_Z "\xcb\xde\xc4\xde\xb3 Z" // "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" /* These are from language.h. PLEASE DON'T TRANSLATE! All translatable messages can be found in language_en.h #define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3..." // "Heating..." diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 94ce69bc4..4bb58a1ed 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -130,6 +130,8 @@ #define MSG_BABYSTEP_Y "ゼドウ Y" // "Babystep Y" #define MSG_BABYSTEP_Z "ゼドウ Z" // "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index bc44dcc7e..4e1ea6de7 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystap Y" #define MSG_BABYSTEP_Z "Babystap Z" #define MSG_ENDSTOP_ABORT "Endstop afbr." +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index f654594bc..5e5d02869 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -123,6 +123,9 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Blad wyl. kranc." +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" + #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 060f3ba89..90e2ae7ec 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "horas" +#define MSG_END_MINUTE "minutos" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 9d3ff2654..f1335be8a 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort." +#define MSG_END_HOUR "horas" +#define MSG_END_MINUTE "minutos" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibracao" diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index b961be7ee..4ab618e1e 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -123,6 +123,8 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_END_HOUR "hours" +#define MSG_END_MINUTE "minutes" #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Delta Calibration" From 19b11dfdd7ff2ff3a69f6a32daf3f0cba3141ef7 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 31 Mar 2015 18:29:16 +0200 Subject: [PATCH 149/302] Fix can't enter MENU_MULTIPLIER_ITEM --- Marlin/ultralcd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b00cfea1d..d2a2e6faa 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -184,6 +184,7 @@ static void lcd_status_screen(); if (lcdDrawUpdate) \ lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \ if (wasClicked && itemSelected) { \ + lcd_quick_feedback(); \ encoderRateMultiplierEnabled = true; \ lastEncoderMovementMillis = 0; \ menu_action_ ## type(args); \ From 85f8a26ba45ea58fbafe7c6ace24e237e4196533 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 1 Apr 2015 00:48:04 +0200 Subject: [PATCH 150/302] Fix MIN&MAX temperatures again replaced GE0 with th matching GEX in the second row. added some () --- Marlin/temperature.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 884de9401..420eae6a0 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1539,8 +1539,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE0 >= #endif - if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); - if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); + if ((current_temperature_raw[0]) GE0 (maxttemp_raw[0])) max_temp_error(0); + if ((minttemp_raw[0]) GE0 (current_temperature_raw[0])) min_temp_error(0); #endif #if EXTRUDERS > 1 @@ -1549,8 +1549,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE1 >= #endif - if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1); - if (minttemp_raw[1] GE0 current_temperature_raw[1]) min_temp_error(1); + if ((current_temperature_raw[1]) GE1 (maxttemp_raw[1])) max_temp_error(1); + if ((minttemp_raw[1]) GE1 (current_temperature_raw[1])) min_temp_error(1); #if EXTRUDERS > 2 #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP @@ -1558,8 +1558,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE2 >= #endif - if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2); - if (minttemp_raw[2] GE0 current_temperature_raw[2]) min_temp_error(2); + if ((current_temperature_raw[2]) GE2 (maxttemp_raw[2])) max_temp_error(2); + if ((minttemp_raw[2]) GE2 (current_temperature_raw[2])) min_temp_error(2); #if EXTRUDERS > 3 #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP @@ -1567,8 +1567,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE3 >= #endif - if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3); - if (minttemp_raw[3] GE0 current_temperature_raw[3]) min_temp_error(3); + if ((current_temperature_raw[3]) GE3 (maxttemp_raw[3])) max_temp_error(3); + if ((minttemp_raw[3]) GE3 (current_temperature_raw[3])) min_temp_error(3); #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 From 3f2e8632069a939d6e67cdd7f105611299d0e7b1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 1 Apr 2015 02:56:14 +0200 Subject: [PATCH 151/302] Improve conditions for HAS_TEMP and use them in temperuture.h Flattened the if structure - the preprocessor is doing the work - not the Arduino. Arduino. --- Marlin/Conditionals.h | 10 +++++----- Marlin/temperature.cpp | 43 +++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 8399c4bf6..23425da86 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -345,11 +345,11 @@ /** * Shorthand for pin tests, for temperature.cpp */ - #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0) - #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0) - #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0) - #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0) - #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0) + #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0 && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2) + #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0 && TEMP_SENSOR_1 != 0) + #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0 && TEMP_SENSOR_2 != 0) + #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0 && TEMP_SENSOR_3 != 0) + #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0 && TEMP_SENSOR_BED != 0) #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0) #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0) #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 420eae6a0..10b774b68 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1543,7 +1543,7 @@ ISR(TIMER0_COMPB_vect) { if ((minttemp_raw[0]) GE0 (current_temperature_raw[0])) min_temp_error(0); #endif - #if EXTRUDERS > 1 + #if HAS_TEMP_1 #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP #define GE1 <= #else @@ -1551,30 +1551,29 @@ ISR(TIMER0_COMPB_vect) { #endif if ((current_temperature_raw[1]) GE1 (maxttemp_raw[1])) max_temp_error(1); if ((minttemp_raw[1]) GE1 (current_temperature_raw[1])) min_temp_error(1); + #endif // TEMP_SENSOR_1 - #if EXTRUDERS > 2 - #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP - #define GE2 <= - #else - #define GE2 >= - #endif - if ((current_temperature_raw[2]) GE2 (maxttemp_raw[2])) max_temp_error(2); - if ((minttemp_raw[2]) GE2 (current_temperature_raw[2])) min_temp_error(2); + #if HAS_TEMP_2 + #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP + #define GE2 <= + #else + #define GE2 >= + #endif + if ((current_temperature_raw[2]) GE2 (maxttemp_raw[2])) max_temp_error(2); + if ((minttemp_raw[2]) GE2 (current_temperature_raw[2])) min_temp_error(2); + #endif // TEMP_SENSOR_2 - #if EXTRUDERS > 3 - #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP - #define GE3 <= - #else - #define GE3 >= - #endif - if ((current_temperature_raw[3]) GE3 (maxttemp_raw[3])) max_temp_error(3); - if ((minttemp_raw[3]) GE3 (current_temperature_raw[3])) min_temp_error(3); + #if HAS_TEMP_3 + #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP + #define GE3 <= + #else + #define GE3 >= + #endif + if ((current_temperature_raw[3]) GE3 (maxttemp_raw[3])) max_temp_error(3); + if ((minttemp_raw[3]) GE3 (current_temperature_raw[3])) min_temp_error(3); + #endif // TEMP_SENSOR_3 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - #if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0) + #if HAS_TEMP_BED #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP #define GEBED <= #else From 18bb6be80ee6253f1e04c73d014534f5638718ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 18:52:19 -0700 Subject: [PATCH 152/302] Fix homing and leveling - Include the current Z when raising the axis after and between probing - Add `sync_plan_position_delta` for parity with `sync_plan_position` - Clean up and clarify `M48`, `dock_sled`, and others --- Marlin/Conditionals.h | 6 +- Marlin/Marlin.h | 2 + Marlin/Marlin_main.cpp | 292 ++++++++++++++++++++--------------------- 3 files changed, 148 insertions(+), 152 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 8399c4bf6..f98c05d4f 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -4,6 +4,10 @@ */ #ifndef CONDITIONALS_H +#ifndef M_PI + #define M_PI 3.1415926536 +#endif + #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first #define CONFIGURATION_LCD @@ -252,7 +256,7 @@ * Advance calculated values */ #ifdef ADVANCE - #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) + #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI) #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA) #endif diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 45a94e82e..e0441714b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -29,6 +29,8 @@ #define BIT(b) (1<<(b)) #define TEST(n,b) (((n)&BIT(b))!=0) +#define RADIANS(d) ((d)*M_PI/180.0) +#define DEGREES(r) ((d)*180.0/M_PI) // Arduino < 1.0.0 does not define this, so we need to do it ourselves #ifndef analogInputToDigitalPin diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7e9ac15a0..ee5f694c6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1034,6 +1034,12 @@ inline void line_to_destination() { inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } +#ifdef DELTA + inline void sync_plan_position_delta() { + calculate_delta(current_position); + plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + } +#endif #ifdef ENABLE_AUTO_BED_LEVELING @@ -1109,8 +1115,7 @@ inline void sync_plan_position() { long stop_steps = st_get_position(Z_AXIS); float mm = start_z - float(start_steps - stop_steps) / axis_steps_per_unit[Z_AXIS]; current_position[Z_AXIS] = mm; - calculate_delta(current_position); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + sync_plan_position_delta(); #else // !DELTA @@ -1262,7 +1267,7 @@ inline void sync_plan_position() { if (servo_endstops[Z_AXIS] >= 0) { #if Z_RAISE_AFTER_PROBING > 0 - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING); + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); st_synchronize(); #endif @@ -1345,7 +1350,7 @@ inline void sync_plan_position() { #if Z_RAISE_BETWEEN_PROBINGS > 0 if (retract_action == ProbeStay) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BETWEEN_PROBINGS); + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); st_synchronize(); } #endif @@ -1550,62 +1555,57 @@ void refresh_cmd_timeout(void) } #ifdef FWRETRACT + void retract(bool retracting, bool swapretract = false) { - if(retracting && !retracted[active_extruder]) { - destination[X_AXIS]=current_position[X_AXIS]; - destination[Y_AXIS]=current_position[Y_AXIS]; - destination[Z_AXIS]=current_position[Z_AXIS]; - destination[E_AXIS]=current_position[E_AXIS]; - if (swapretract) { - current_position[E_AXIS]+=retract_length_swap/volumetric_multiplier[active_extruder]; - } else { - current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder]; - } - plan_set_e_position(current_position[E_AXIS]); - float oldFeedrate = feedrate; + + if (retracting == retracted[active_extruder]) return; + + float oldFeedrate = feedrate; + + for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; + + if (retracting) { + feedrate = retract_feedrate * 60; - retracted[active_extruder]=true; - prepare_move(); - if(retract_zlift > 0.01) { - current_position[Z_AXIS]-=retract_zlift; -#ifdef DELTA - calculate_delta(current_position); // change cartesian kinematic to delta kinematic; - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); -#else - sync_plan_position(); -#endif - prepare_move(); - } - feedrate = oldFeedrate; - } else if(!retracting && retracted[active_extruder]) { - destination[X_AXIS]=current_position[X_AXIS]; - destination[Y_AXIS]=current_position[Y_AXIS]; - destination[Z_AXIS]=current_position[Z_AXIS]; - destination[E_AXIS]=current_position[E_AXIS]; - if(retract_zlift > 0.01) { - current_position[Z_AXIS]+=retract_zlift; -#ifdef DELTA - calculate_delta(current_position); // change cartesian kinematic to delta kinematic; - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); -#else - sync_plan_position(); -#endif - //prepare_move(); - } - if (swapretract) { - current_position[E_AXIS]-=(retract_length_swap+retract_recover_length_swap)/volumetric_multiplier[active_extruder]; - } else { - current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder]; - } + current_position[E_AXIS] += (swapretract ? retract_length_swap : retract_length) / volumetric_multiplier[active_extruder]; plan_set_e_position(current_position[E_AXIS]); - float oldFeedrate = feedrate; - feedrate = retract_recover_feedrate * 60; - retracted[active_extruder] = false; prepare_move(); - feedrate = oldFeedrate; + + if (retract_zlift > 0.01) { + current_position[Z_AXIS] -= retract_zlift; + #ifdef DELTA + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif + prepare_move(); + } } - } //retract -#endif //FWRETRACT + else { + + if (retract_zlift > 0.01) { + current_position[Z_AXIS] + =retract_zlift; + #ifdef DELTA + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif + //prepare_move(); + } + + feedrate = retract_recover_feedrate * 60; + float move_e = swapretract ? retract_length_swap + retract_recover_length_swap : retract_length + retract_recover_length; + current_position[E_AXIS] -= move_e / volumetric_multiplier[active_extruder]; + plan_set_e_position(current_position[E_AXIS]); + prepare_move(); + } + + feedrate = oldFeedrate; + retracted[active_extruder] = retract; + + } // retract() + +#endif // FWRETRACT #ifdef Z_PROBE_SLED @@ -1613,40 +1613,32 @@ void refresh_cmd_timeout(void) #define SLED_DOCKING_OFFSET 0 #endif -// -// Method to dock/undock a sled designed by Charles Bell. -// -// dock[in] If true, move to MAX_X and engage the electromagnet -// offset[in] The additional distance to move to adjust docking location -// -static void dock_sled(bool dock, int offset=0) { - int z_loc; - - if (!((axis_known_position[X_AXIS]) && (axis_known_position[Y_AXIS]))) { - LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); - return; - } + // + // Method to dock/undock a sled designed by Charles Bell. + // + // dock[in] If true, move to MAX_X and engage the electromagnet + // offset[in] The additional distance to move to adjust docking location + // + static void dock_sled(bool dock, int offset=0) { + if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { + LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); + return; + } - if (dock) { - do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, - current_position[Y_AXIS], - current_position[Z_AXIS]); - // turn off magnet - digitalWrite(SERVO0_PIN, LOW); - } else { - if (current_position[Z_AXIS] < (Z_RAISE_BEFORE_PROBING + 5)) - z_loc = Z_RAISE_BEFORE_PROBING; - else - z_loc = current_position[Z_AXIS]; - do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, - Y_PROBE_OFFSET_FROM_EXTRUDER, z_loc); - // turn on magnet - digitalWrite(SERVO0_PIN, HIGH); - } -} -#endif + if (dock) { + do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], current_position[Z_AXIS]); + digitalWrite(SERVO0_PIN, LOW); // turn off magnet + } else { + float z_loc = current_position[Z_AXIS]; + if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING; + do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, Y_PROBE_OFFSET_FROM_EXTRUDER, z_loc); + digitalWrite(SERVO0_PIN, HIGH); // turn on magnet + } + } + +#endif // Z_PROBE_SLED /** * @@ -1798,8 +1790,7 @@ inline void gcode_G28() { HOMEAXIS(Y); HOMEAXIS(Z); - calculate_delta(current_position); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + sync_plan_position_delta(); #else // NOT DELTA @@ -1826,7 +1817,9 @@ inline void gcode_G28() { #endif #ifdef QUICK_HOME - if (home_all_axis || (homeX && homeY)) { //first diagonal move + + if (home_all_axis || (homeX && homeY)) { // First diagonal move + current_position[X_AXIS] = current_position[Y_AXIS] = 0; #ifdef DUAL_X_CARRIAGE @@ -1837,21 +1830,20 @@ inline void gcode_G28() { #endif sync_plan_position(); - destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir; - destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS); - feedrate = homing_feedrate[X_AXIS]; - if (homing_feedrate[Y_AXIS] < feedrate) feedrate = homing_feedrate[Y_AXIS]; - if (max_length(X_AXIS) > max_length(Y_AXIS)) { - feedrate *= sqrt(pow(max_length(Y_AXIS) / max_length(X_AXIS), 2) + 1); - } else { - feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1); - } + + float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), + mlratio = mlx>mly ? mly/mlx : mlx/mly; + + destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir; + destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS); + feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1); line_to_destination(); st_synchronize(); axis_is_at_home(X_AXIS); axis_is_at_home(Y_AXIS); sync_plan_position(); + destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; line_to_destination(); @@ -1865,7 +1857,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = destination[Z_AXIS]; #endif } - #endif //QUICK_HOME + #endif // QUICK_HOME // Home X if (home_all_axis || homeX) { @@ -1947,7 +1939,7 @@ inline void gcode_G28() { && cpy >= Y_MIN_POS - Y_PROBE_OFFSET_FROM_EXTRUDER && cpy <= Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER) { current_position[Z_AXIS] = 0; - plan_set_position(cpx, cpy, current_position[Z_AXIS], current_position[E_AXIS]); + plan_set_position(cpx, cpy, 0, current_position[E_AXIS]); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed feedrate = max_feedrate[Z_AXIS]; line_to_destination(); @@ -1986,8 +1978,7 @@ inline void gcode_G28() { #endif // else DELTA #ifdef SCARA - calculate_delta(current_position); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + sync_plan_position_delta(); #endif #ifdef ENDSTOPS_ONLY_FOR_HOMING @@ -2826,9 +2817,7 @@ inline void gcode_M42() { inline void gcode_M48() { double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50]; - int verbose_level = 1, n = 0, j, n_samples = 10, n_legs = 0, engage_probe_for_each_reading = 0; - double X_current, Y_current, Z_current; - double X_probe_location, Y_probe_location, Z_start_location, ext_position; + int verbose_level = 1, j, n_samples = 10, n_legs = 0, engage_probe_for_each_reading = 0; if (code_seen('V') || code_seen('v')) { verbose_level = code_value(); @@ -2849,11 +2838,12 @@ inline void gcode_M42() { } } - X_current = X_probe_location = st_get_position_mm(X_AXIS); - Y_current = Y_probe_location = st_get_position_mm(Y_AXIS); - Z_current = st_get_position_mm(Z_AXIS); - Z_start_location = st_get_position_mm(Z_AXIS) + Z_RAISE_BEFORE_PROBING; - ext_position = st_get_position_mm(E_AXIS); + double X_probe_location, Y_probe_location, + X_current = X_probe_location = st_get_position_mm(X_AXIS), + Y_current = Y_probe_location = st_get_position_mm(Y_AXIS), + Z_current = st_get_position_mm(Z_AXIS), + Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING, + ext_position = st_get_position_mm(E_AXIS); if (code_seen('E') || code_seen('e')) engage_probe_for_each_reading++; @@ -2936,33 +2926,29 @@ inline void gcode_M42() { if (engage_probe_for_each_reading) retract_z_probe(); - for (n=0; n < n_samples; n++) { + for (uint16_t n=0; n < n_samples; n++) { - do_blocking_move_to( X_probe_location, Y_probe_location, Z_start_location); // Make sure we are at the probe location + do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // Make sure we are at the probe location if (n_legs) { - double radius=0.0, theta=0.0; - int l; - int rotational_direction = (unsigned long) millis() & 0x0001; // clockwise or counter clockwise - radius = (unsigned long)millis() % (long)(X_MAX_LENGTH / 4); // limit how far out to go - theta = (float)((unsigned long)millis() % 360L) / (360. / (2 * 3.1415926)); // turn into radians + unsigned long ms = millis(); + double radius = ms % (X_MAX_LENGTH / 4), // limit how far out to go + theta = RADIANS(ms % 360L); + float dir = (ms & 0x0001) ? 1 : -1; // clockwise or counter clockwise //SERIAL_ECHOPAIR("starting radius: ",radius); //SERIAL_ECHOPAIR(" theta: ",theta); - //SERIAL_ECHOPAIR(" direction: ",rotational_direction); + //SERIAL_ECHOPAIR(" direction: ",dir); //SERIAL_EOL; - float dir = rotational_direction ? 1 : -1; - for (l = 0; l < n_legs - 1; l++) { - theta += dir * (float)((unsigned long)millis() % 20L) / (360.0/(2*3.1415926)); // turn into radians - - radius += (float)(((long)((unsigned long) millis() % 10L)) - 5L); + for (int l = 0; l < n_legs - 1; l++) { + ms = millis(); + theta += RADIANS(dir * (ms % 20L)); + radius += (ms % 10L) - 5L; if (radius < 0.0) radius = -radius; X_current = X_probe_location + cos(theta) * radius; Y_current = Y_probe_location + sin(theta) * radius; - - // Make sure our X & Y are sane X_current = constrain(X_current, X_MIN_POS, X_MAX_POS); Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS); @@ -2972,10 +2958,13 @@ inline void gcode_M42() { SERIAL_EOL; } - do_blocking_move_to( X_current, Y_current, Z_current ); - } - do_blocking_move_to( X_probe_location, Y_probe_location, Z_start_location); // Go back to the probe location - } + do_blocking_move_to(X_current, Y_current, Z_current); + + } // n_legs loop + + do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // Go back to the probe location + + } // n_legs if (engage_probe_for_each_reading) { engage_z_probe(); @@ -2991,46 +2980,49 @@ inline void gcode_M42() { // Get the current mean for the data points we have so far // sum = 0.0; - for (j=0; j<=n; j++) sum += sample_set[j]; - mean = sum / (double (n+1)); + for (int j = 0; j <= n; j++) sum += sample_set[j]; + mean = sum / (n + 1); // // Now, use that mean to calculate the standard deviation for the // data points we have so far // sum = 0.0; - for (j=0; j<=n; j++) sum += (sample_set[j]-mean) * (sample_set[j]-mean); - sigma = sqrt( sum / (double (n+1)) ); + for (int j = 0; j <= n; j++) { + float ss = sample_set[j] - mean; + sum += ss * ss; + } + sigma = sqrt(sum / (n + 1)); if (verbose_level > 1) { SERIAL_PROTOCOL(n+1); - SERIAL_PROTOCOL(" of "); + SERIAL_PROTOCOLPGM(" of "); SERIAL_PROTOCOL(n_samples); SERIAL_PROTOCOLPGM(" z: "); SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6); - } - - if (verbose_level > 2) { - SERIAL_PROTOCOL(" mean: "); - SERIAL_PROTOCOL_F(mean,6); - SERIAL_PROTOCOL(" sigma: "); - SERIAL_PROTOCOL_F(sigma,6); + if (verbose_level > 2) { + SERIAL_PROTOCOLPGM(" mean: "); + SERIAL_PROTOCOL_F(mean,6); + SERIAL_PROTOCOLPGM(" sigma: "); + SERIAL_PROTOCOL_F(sigma,6); + } } if (verbose_level > 0) SERIAL_EOL; - plan_buffer_line(X_probe_location, Y_probe_location, Z_start_location, - current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder); + plan_buffer_line(X_probe_location, Y_probe_location, Z_start_location, current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder); st_synchronize(); if (engage_probe_for_each_reading) { - retract_z_probe(); + retract_z_probe(); delay(1000); } } - retract_z_probe(); - delay(1000); + if (!engage_probe_for_each_reading) { + retract_z_probe(); + delay(1000); + } clean_up_after_endstop_move(); @@ -4674,9 +4666,7 @@ inline void gcode_T() { active_extruder = tmp_extruder; #endif // !DUAL_X_CARRIAGE #ifdef DELTA - calculate_delta(current_position); // change cartesian kinematic to delta kinematic; - //sent position to plan_set_position(); - plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS],current_position[E_AXIS]); + sync_plan_position_delta(); #else sync_plan_position(); #endif From 1c7391717e5848d8b8cc2067ec4f1ccb11089f29 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 19:58:03 -0700 Subject: [PATCH 153/302] Include sync_plan_position_delta for SCARA also --- Marlin/Marlin_main.cpp | 200 ++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 104 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ee5f694c6..2c87bbd7f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1034,7 +1034,7 @@ inline void line_to_destination() { inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } -#ifdef DELTA +#if defined(DELTA) || defined(SCARA) inline void sync_plan_position_delta() { calculate_delta(current_position); plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); @@ -2177,8 +2177,7 @@ inline void gcode_G28() { bool do_topography_map = verbose_level > 2 || code_seen('T') || code_seen('t'); #endif - if (verbose_level > 0) - { + if (verbose_level > 0) { SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); if (dryrun) SERIAL_ECHOLN("Running in DRY-RUN mode"); } @@ -2253,10 +2252,9 @@ inline void gcode_G28() { current_position[Y_AXIS] = uncorrected_position.y; current_position[Z_AXIS] = uncorrected_position.z; sync_plan_position(); - #endif // !DELTA } - + setup_for_endstop_move(); feedrate = homing_feedrate[Z_AXIS]; @@ -2264,8 +2262,8 @@ inline void gcode_G28() { #ifdef AUTO_BED_LEVELING_GRID // probe at the points of a lattice grid - const int xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points-1); - const int yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points-1); + const int xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points - 1), + yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1); #ifdef DELTA delta_grid_spacing[0] = xGridSpacing; @@ -5255,104 +5253,99 @@ void clamp_to_software_endstops(float target[3]) } #ifdef DELTA -void recalc_delta_settings(float radius, float diagonal_rod) -{ - delta_tower1_x= -SIN_60*radius; // front left tower - delta_tower1_y= -COS_60*radius; - delta_tower2_x= SIN_60*radius; // front right tower - delta_tower2_y= -COS_60*radius; - delta_tower3_x= 0.0; // back middle tower - delta_tower3_y= radius; - delta_diagonal_rod_2= sq(diagonal_rod); -} -void calculate_delta(float cartesian[3]) -{ - delta[X_AXIS] = sqrt(delta_diagonal_rod_2 - - sq(delta_tower1_x-cartesian[X_AXIS]) - - sq(delta_tower1_y-cartesian[Y_AXIS]) - ) + cartesian[Z_AXIS]; - delta[Y_AXIS] = sqrt(delta_diagonal_rod_2 - - sq(delta_tower2_x-cartesian[X_AXIS]) - - sq(delta_tower2_y-cartesian[Y_AXIS]) - ) + cartesian[Z_AXIS]; - delta[Z_AXIS] = sqrt(delta_diagonal_rod_2 - - sq(delta_tower3_x-cartesian[X_AXIS]) - - sq(delta_tower3_y-cartesian[Y_AXIS]) - ) + cartesian[Z_AXIS]; - /* - SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]); - SERIAL_ECHOPGM(" y="); SERIAL_ECHO(cartesian[Y_AXIS]); - SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(cartesian[Z_AXIS]); - - SERIAL_ECHOPGM("delta x="); SERIAL_ECHO(delta[X_AXIS]); - SERIAL_ECHOPGM(" y="); SERIAL_ECHO(delta[Y_AXIS]); - SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(delta[Z_AXIS]); - */ -} - -#ifdef ENABLE_AUTO_BED_LEVELING -// Adjust print surface height by linear interpolation over the bed_level array. -int delta_grid_spacing[2] = { 0, 0 }; -void adjust_delta(float cartesian[3]) -{ - if (delta_grid_spacing[0] == 0 || delta_grid_spacing[1] == 0) - return; // G29 not done - - int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2; - float grid_x = max(0.001-half, min(half-0.001, cartesian[X_AXIS] / delta_grid_spacing[0])); - float grid_y = max(0.001-half, min(half-0.001, cartesian[Y_AXIS] / delta_grid_spacing[1])); - int floor_x = floor(grid_x); - int floor_y = floor(grid_y); - float ratio_x = grid_x - floor_x; - float ratio_y = grid_y - floor_y; - float z1 = bed_level[floor_x+half][floor_y+half]; - float z2 = bed_level[floor_x+half][floor_y+half+1]; - float z3 = bed_level[floor_x+half+1][floor_y+half]; - float z4 = bed_level[floor_x+half+1][floor_y+half+1]; - float left = (1-ratio_y)*z1 + ratio_y*z2; - float right = (1-ratio_y)*z3 + ratio_y*z4; - float offset = (1-ratio_x)*left + ratio_x*right; - - delta[X_AXIS] += offset; - delta[Y_AXIS] += offset; - delta[Z_AXIS] += offset; - - /* - SERIAL_ECHOPGM("grid_x="); SERIAL_ECHO(grid_x); - SERIAL_ECHOPGM(" grid_y="); SERIAL_ECHO(grid_y); - SERIAL_ECHOPGM(" floor_x="); SERIAL_ECHO(floor_x); - SERIAL_ECHOPGM(" floor_y="); SERIAL_ECHO(floor_y); - SERIAL_ECHOPGM(" ratio_x="); SERIAL_ECHO(ratio_x); - SERIAL_ECHOPGM(" ratio_y="); SERIAL_ECHO(ratio_y); - SERIAL_ECHOPGM(" z1="); SERIAL_ECHO(z1); - SERIAL_ECHOPGM(" z2="); SERIAL_ECHO(z2); - SERIAL_ECHOPGM(" z3="); SERIAL_ECHO(z3); - SERIAL_ECHOPGM(" z4="); SERIAL_ECHO(z4); - SERIAL_ECHOPGM(" left="); SERIAL_ECHO(left); - SERIAL_ECHOPGM(" right="); SERIAL_ECHO(right); - SERIAL_ECHOPGM(" offset="); SERIAL_ECHOLN(offset); - */ -} -#endif //ENABLE_AUTO_BED_LEVELING - -void prepare_move_raw() -{ - previous_millis_cmd = millis(); - calculate_delta(destination); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); - for(int8_t i=0; i < NUM_AXIS; i++) { - current_position[i] = destination[i]; + void recalc_delta_settings(float radius, float diagonal_rod) { + delta_tower1_x = -SIN_60 * radius; // front left tower + delta_tower1_y = -COS_60 * radius; + delta_tower2_x = SIN_60 * radius; // front right tower + delta_tower2_y = -COS_60 * radius; + delta_tower3_x = 0.0; // back middle tower + delta_tower3_y = radius; + delta_diagonal_rod_2 = sq(diagonal_rod); } -} -#endif //DELTA + + void calculate_delta(float cartesian[3]) { + delta[X_AXIS] = sqrt(delta_diagonal_rod_2 + - sq(delta_tower1_x-cartesian[X_AXIS]) + - sq(delta_tower1_y-cartesian[Y_AXIS]) + ) + cartesian[Z_AXIS]; + delta[Y_AXIS] = sqrt(delta_diagonal_rod_2 + - sq(delta_tower2_x-cartesian[X_AXIS]) + - sq(delta_tower2_y-cartesian[Y_AXIS]) + ) + cartesian[Z_AXIS]; + delta[Z_AXIS] = sqrt(delta_diagonal_rod_2 + - sq(delta_tower3_x-cartesian[X_AXIS]) + - sq(delta_tower3_y-cartesian[Y_AXIS]) + ) + cartesian[Z_AXIS]; + /* + SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]); + SERIAL_ECHOPGM(" y="); SERIAL_ECHO(cartesian[Y_AXIS]); + SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(cartesian[Z_AXIS]); + + SERIAL_ECHOPGM("delta x="); SERIAL_ECHO(delta[X_AXIS]); + SERIAL_ECHOPGM(" y="); SERIAL_ECHO(delta[Y_AXIS]); + SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(delta[Z_AXIS]); + */ + } + + #ifdef ENABLE_AUTO_BED_LEVELING + + // Adjust print surface height by linear interpolation over the bed_level array. + int delta_grid_spacing[2] = { 0, 0 }; + void adjust_delta(float cartesian[3]) { + if (delta_grid_spacing[0] == 0 || delta_grid_spacing[1] == 0) return; // G29 not done! + + int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2; + float h1 = 0.001 - half, h2 = half - 0.001, + grid_x = max(h1, min(h2, cartesian[X_AXIS] / delta_grid_spacing[0])), + grid_y = max(h1, min(h2, cartesian[Y_AXIS] / delta_grid_spacing[1])); + int floor_x = floor(grid_x), floor_y = floor(grid_y); + float ratio_x = grid_x - floor_x, ratio_y = grid_y - floor_y, + z1 = bed_level[floor_x + half][floor_y + half], + z2 = bed_level[floor_x + half][floor_y + half + 1], + z3 = bed_level[floor_x + half + 1][floor_y + half], + z4 = bed_level[floor_x + half + 1][floor_y + half + 1], + left = (1 - ratio_y) * z1 + ratio_y * z2, + right = (1 - ratio_y) * z3 + ratio_y * z4, + offset = (1 - ratio_x) * left + ratio_x * right; + + delta[X_AXIS] += offset; + delta[Y_AXIS] += offset; + delta[Z_AXIS] += offset; + + /* + SERIAL_ECHOPGM("grid_x="); SERIAL_ECHO(grid_x); + SERIAL_ECHOPGM(" grid_y="); SERIAL_ECHO(grid_y); + SERIAL_ECHOPGM(" floor_x="); SERIAL_ECHO(floor_x); + SERIAL_ECHOPGM(" floor_y="); SERIAL_ECHO(floor_y); + SERIAL_ECHOPGM(" ratio_x="); SERIAL_ECHO(ratio_x); + SERIAL_ECHOPGM(" ratio_y="); SERIAL_ECHO(ratio_y); + SERIAL_ECHOPGM(" z1="); SERIAL_ECHO(z1); + SERIAL_ECHOPGM(" z2="); SERIAL_ECHO(z2); + SERIAL_ECHOPGM(" z3="); SERIAL_ECHO(z3); + SERIAL_ECHOPGM(" z4="); SERIAL_ECHO(z4); + SERIAL_ECHOPGM(" left="); SERIAL_ECHO(left); + SERIAL_ECHOPGM(" right="); SERIAL_ECHO(right); + SERIAL_ECHOPGM(" offset="); SERIAL_ECHOLN(offset); + */ + } + #endif // ENABLE_AUTO_BED_LEVELING + + void prepare_move_raw() { + previous_millis_cmd = millis(); + calculate_delta(destination); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + for (int i = 0; i < NUM_AXIS; i++) current_position[i] = destination[i]; + } + +#endif // DELTA #if defined(MESH_BED_LEVELING) -#if !defined(MIN) -#define MIN(_v1, _v2) (((_v1) < (_v2)) ? (_v1) : (_v2)) -#endif // ! MIN + + #if !defined(MIN) + #define MIN(_v1, _v2) (((_v1) < (_v2)) ? (_v1) : (_v2)) + #endif // ! MIN + // This function is used to split lines on mesh borders so each segment is only part of one mesh area void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t &extruder, uint8_t x_splits=0xff, uint8_t y_splits=0xff) { @@ -5424,8 +5417,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ } #endif // MESH_BED_LEVELING -void prepare_move() -{ +void prepare_move() { clamp_to_software_endstops(destination); previous_millis_cmd = millis(); @@ -5539,7 +5531,7 @@ void prepare_move() } #endif //DUAL_X_CARRIAGE -#if ! (defined DELTA || defined SCARA) +#if !defined(DELTA) && !defined(SCARA) // Do not use feedmultiply for E or Z only moves if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { line_to_destination(); From d273c90d535900f3f87b96d7b3c11c613332cb3d Mon Sep 17 00:00:00 2001 From: atfield90 Date: Wed, 1 Apr 2015 05:15:27 +0200 Subject: [PATCH 154/302] Added support for Atmega 1281 chip --- Marlin/Sd2PinMap.h | 71 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/Marlin/Sd2PinMap.h b/Marlin/Sd2PinMap.h index a94b9b3dc..97fea8bb0 100644 --- a/Marlin/Sd2PinMap.h +++ b/Marlin/Sd2PinMap.h @@ -312,6 +312,75 @@ static const pin_map_t digitalPinMap[] = { {&DDRC, &PINC, &PORTC, 4}, // C4 18 {&DDRC, &PINC, &PORTC, 5} // C5 19 }; +#elif defined(__AVR_ATmega1281__) +// Waspmote + +// Two Wire (aka I2C) ports +uint8_t const SDA_PIN = 41; +uint8_t const SCL_PIN = 40; + + +#undef MOSI_PIN +#undef MISO_PIN +// SPI port +uint8_t const SS_PIN = 16; // B0 +uint8_t const MOSI_PIN = 11; // B2 +uint8_t const MISO_PIN = 12; // B3 +uint8_t const SCK_PIN = 10; // B1 + +static const pin_map_t digitalPinMap[] = { + {&DDRE, &PINE, &PORTE, 0}, // E0 0 + {&DDRE, &PINE, &PORTE, 1}, // E1 1 + {&DDRE, &PINE, &PORTE, 3}, // E3 2 + {&DDRE, &PINE, &PORTE, 4}, // E4 3 + {&DDRC, &PINC, &PORTC, 4}, // C4 4 + {&DDRC, &PINC, &PORTC, 5}, // C5 5 + {&DDRC, &PINC, &PORTC, 6}, // C6 6 + {&DDRC, &PINC, &PORTC, 7}, // C7 7 + {&DDRA, &PINA, &PORTA, 2}, // A2 8 + {&DDRA, &PINA, &PORTA, 3}, // A3 9 + {&DDRA, &PINA, &PORTA, 4}, // A4 10 + {&DDRD, &PIND, &PORTD, 5}, // D5 11 + {&DDRD, &PIND, &PORTD, 6}, // D6 12 + {&DDRC, &PINC, &PORTC, 1}, // C1 13 + {&DDRF, &PINF, &PORTF, 1}, // F1 14 + {&DDRF, &PINF, &PORTF, 2}, // F2 15 + {&DDRF, &PINF, &PORTF, 3}, // F3 16 + {&DDRF, &PINF, &PORTF, 4}, // F4 17 + {&DDRF, &PINF, &PORTF, 5}, // F5 18 + {&DDRF, &PINF, &PORTF, 6}, // F6 19 + {&DDRF, &PINF, &PORTF, 7}, // F7 20 + {&DDRF, &PINF, &PORTF, 0}, // F0 21 + {&DDRA, &PINA, &PORTA, 1}, // A1 22 + {&DDRD, &PIND, &PORTD, 7}, // D7 23 + {&DDRE, &PINE, &PORTE, 5}, // E5 24 + {&DDRA, &PINA, &PORTA, 6}, // A6 25 + {&DDRE, &PINE, &PORTE, 2}, // E2 26 + {&DDRA, &PINA, &PORTA, 5}, // A5 27 + {&DDRC, &PINC, &PORTC, 0}, // C0 28 + {&DDRB, &PINB, &PORTB, 0}, // B0 29 + {&DDRB, &PINB, &PORTB, 1}, // B1 30 + {&DDRB, &PINB, &PORTB, 2}, // B2 31 + {&DDRB, &PINB, &PORTB, 3}, // B3 32 + {&DDRB, &PINB, &PORTB, 4}, // B4 33 + {&DDRB, &PINB, &PORTB, 5}, // B5 34 + {&DDRA, &PINA, &PORTA, 0}, // A0 35 + {&DDRB, &PINB, &PORTB, 6}, // B6 36 + {&DDRB, &PINB, &PORTB, 7}, // B7 37 + {&DDRE, &PINE, &PORTE, 6}, // E6 38 + {&DDRE, &PINE, &PORTE, 7}, // E7 39 + {&DDRD, &PIND, &PORTD, 0}, // D0 40 + {&DDRD, &PIND, &PORTD, 1}, // D1 41 + {&DDRC, &PINC, &PORTC, 3}, // C3 42 + {&DDRD, &PIND, &PORTD, 2}, // D2 43 + {&DDRD, &PIND, &PORTD, 3}, // D3 44 + {&DDRA, &PINA, &PORTA, 7}, // A7 45 + {&DDRC, &PINC, &PORTC, 2}, // C2 46 + {&DDRD, &PIND, &PORTD, 4}, // D4 47 + {&DDRG, &PING, &PORTG, 2}, // G2 48 + {&DDRG, &PING, &PORTG, 1}, // G1 49 + {&DDRG, &PING, &PORTG, 0}, // G0 50 +}; #else // defined(__AVR_ATmega1280__) #error unknown chip #endif // defined(__AVR_ATmega1280__) @@ -364,4 +433,4 @@ static inline __attribute__((always_inline)) #endif // Sd2PinMap_h -#endif \ No newline at end of file +#endif From a508d835dbee8a180d506c85076c7671a66791fa Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 02:14:55 -0500 Subject: [PATCH 155/302] Changed Z_PROBE_AND_ENDSTOP to Z_PROBE_ENDSTOP. Updated documentation in Configuration.h. Cleaned up and commented some code relating to Z_PROBE_ENDSTOP. Separated Z_MIN_ENDSTOP and Z_PROBE_ENDSTOP completely. --- Marlin/Configuration.h | 22 ++++++++++++---------- Marlin/Marlin_main.cpp | 18 +++++++++++------- Marlin/SanityCheck.h | 31 ++++++++++++++++--------------- Marlin/pins_RAMPS_13.h | 2 +- Marlin/stepper.cpp | 16 +++++++++------- 5 files changed, 49 insertions(+), 40 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2ca9fa231..3d6bd50c2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -335,7 +335,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define DISABLE_MIN_ENDSTOPS // If you want to enable the Z Probe pin, but disable its use, uncomment the line below. // This only affects a Z Probe Endstop if you have separate Z min endstop as well and have -// activated Z_PROBE_AND_ENDSTOP below. If you are using the Z Min endstop on your Z Probe, +// activated Z_PROBE_ENDSTOP below. If you are using the Z Min endstop on your Z Probe, // this has no effect. //#define DISABLE_Z_PROBE_ENDSTOP @@ -500,17 +500,19 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif -// Support for concurrent and seperate Z Probe and Z min endstop use. -// Added by Chris Roadfeldt 3-28-2015 -// If you would like to use both a Z Probe and a Z min endstop at the same time, uncomment #define Z_PROBE_AND_ENDSTOP below -// You will want to disable Z_SAFE_HOMING above as you will still use the Z min endstop for homing. -// In order to use this, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. -// RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board for the signal. +// Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. +// If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. +// If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. +// WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. +// To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. +// If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. +// RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 +// for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. -// D32 is currently selected in the RAMPS 1.3/1.4 pin file. Update the pins.h file for your control board to make use of this. Not doing so nullifies Z_PROBE_AND_ENDSTOP -// WARNING: Setting the wrong pin may have unexpected and disastrous outcomes. Use with caution and do your homework. +// D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. +// WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. -// #define Z_PROBE_AND_ENDSTOP +// #define Z_PROBE_ENDSTOP #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d95ad8909..98a4df1a3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1240,7 +1240,7 @@ inline void sync_plan_position() { st_synchronize(); - #if defined(Z_PROBE_AND_ENDSTOP) + #if defined(Z_PROBE_ENDSTOP) bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if (z_probe_endstop) { #else @@ -1314,7 +1314,7 @@ inline void sync_plan_position() { st_synchronize(); - #if defined(Z_PROBE_AND_ENDSTOP) + #if defined(Z_PROBE_ENDSTOP) bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if (z_probe_endstop) { #else @@ -2805,13 +2805,17 @@ inline void gcode_M42() { } // code_seen('S') } -// If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become -// it's own unique entity, then the following logic will need to be modified -// so it only uses the Z_PROBE #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST) - #if (Z_MIN_PIN == -1) && (! defined (Z_PROBE_PIN) || Z_PROBE_PIN == -1) - #error "You must have a Z_MIN or Z_PROBE endstop in order to enable calculation of Z-Probe repeatability." + // This is redudant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity. + #if defined (Z_PROBE_ENDSTOP) + #if (! defined (Z_PROBE_PIN) || Z_PROBE_PIN == -1) + #error "You must have a Z_PROBE_PIN defined in order to enable calculation of Z-Probe repeatability." + #endif + #else + #if (Z_MIN_PIN == -1) && + #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability." + #endif #endif /** diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 4d4153a97..cac7c55e0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -103,26 +103,27 @@ #endif /** - * Require a Z Probe Pin if Z_PROBE_AND_ENDSTOP is enabled. + * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled. */ - #if defined(Z_PROBE_AND_ENDSTOP) + #if defined(Z_PROBE_ENDSTOP) #ifndef Z_PROBE_PIN - #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_AND_ENDSTOP + #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP #endif #if Z_PROBE_PIN == -1 - #error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_AND_ENDSTOP + #error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_ENDSTOP #endif - #ifndef NUM_SERVOS - #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_AND_ENDSTOP - #endif - #if defined(NUM_SERVOS) && NUM_SERVOS < 1 - #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_AND_ENDSTOP - #endif - #ifndef SERVO_ENDSTOPS - #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_AND_ENDSTOP - #endif - #ifndef SERVO_ENDSTOP_ANGLES - #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP +// Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment. +// #ifndef NUM_SERVOS +// #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_ENDSTOP +// #endif +// #if defined(NUM_SERVOS) && NUM_SERVOS < 1 +// #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_ENDSTOP +// #endif +// #ifndef SERVO_ENDSTOPS +// #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_ENDSTOP +// #endif +// #ifndef SERVO_ENDSTOP_ANGLES +// #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP #endif #endif /** diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 3ca12dd15..11ecddeda 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -62,7 +62,7 @@ #define FILWIDTH_PIN 5 #endif -#if defined(Z_PROBE_AND_ENDSTOP) +#if defined(Z_PROBE_ENDSTOP) // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. #define Z_PROBE_PIN 32 #endif diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 58029c8cc..0fb4d8a67 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -76,7 +76,7 @@ volatile long endstops_stepsTotal, endstops_stepsDone; static volatile bool endstop_x_hit = false; static volatile bool endstop_y_hit = false; static volatile bool endstop_z_hit = false; -static volatile bool endstop_z_probe_hit = false; +static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_PROBE_ENDSTOP isn't defined, keeps code below cleaner. #ifdef it and usage below to save space. #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED bool abort_on_endstop_hit = false; @@ -113,7 +113,7 @@ static volatile bool endstop_z_probe_hit = false; #endif #endif -#ifdef Z_PROBE_AND_ENDSTOP +#ifdef Z_PROBE_ENDSTOP // No need to check for valid pin, SanityCheck.h already does this. static bool old_z_probe_endstop = false; #endif @@ -259,11 +259,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; #define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A) void endstops_hit_on_purpose() { - endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false; + endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false; // #ifdef endstop_z_probe_hit = to save space if needed. } void checkHitEndstops() { - if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { + if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { // #ifdef || endstop_z_probe_hit to save space if needed. SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); if (endstop_x_hit) { @@ -278,10 +278,12 @@ void checkHitEndstops() { SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); } + #ifdef Z_PROBE_ENDSTOP if (endstop_z_probe_hit) { SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP"); } + #endif SERIAL_EOL; endstops_hit_on_purpose(); @@ -550,7 +552,7 @@ ISR(TIMER1_COMPA_vect) { #endif #endif - #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 + #ifdef Z_PROBE_ENDSTOP UPDATE_ENDSTOP(z, Z, probe, PROBE); z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if(z_probe_endstop && old_z_probe_endstop) @@ -597,7 +599,7 @@ ISR(TIMER1_COMPA_vect) { #endif #endif - #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 + #ifdef Z_PROBE_ENDSTOP UPDATE_ENDSTOP(z, Z, probe, PROBE); z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); if(z_probe_endstop && old_z_probe_endstop) @@ -972,7 +974,7 @@ void st_init() { #endif #endif -#if defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0 +#if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used. SET_INPUT(Z_PROBE_PIN); #ifdef ENDSTOPPULLUP_ZPROBE WRITE(Z_PROBE_PIN,HIGH); From 831016b09f753000edb69473cd013e1a79b2fdd1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 1 Apr 2015 10:17:17 +0200 Subject: [PATCH 156/302] Added new - changed entries from Fix up LCD_PROGRESS_BAR for when no LCD is defined. Fix for #1770. --- Marlin/ultralcd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index c2529d1d1..a89c26206 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -99,7 +99,8 @@ #else //no LCD FORCE_INLINE void lcd_update() {} FORCE_INLINE void lcd_init() {} - FORCE_INLINE void lcd_setstatus(const char* message) {} + FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {} + FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {} FORCE_INLINE void lcd_buttons_update() {} FORCE_INLINE void lcd_reset_alert_level() {} FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {} From 97a258b0b0ba87cbc5f36aabedcb830bdf015b3a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Apr 2015 01:44:13 -0700 Subject: [PATCH 157/302] Clean up, document home_axis --- Marlin/Marlin_main.cpp | 133 ++++++++++++++++++++++------------------- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2c87bbd7f..07439309d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1109,7 +1109,7 @@ inline void sync_plan_position() { destination[Z_AXIS] = -10; prepare_move_raw(); st_synchronize(); - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags // we have to let the planner know where we are right now as it is not where we said to go. long stop_steps = st_get_position(Z_AXIS); @@ -1135,7 +1135,7 @@ inline void sync_plan_position() { zPosition += home_retract_mm(Z_AXIS); line_to_z(zPosition); st_synchronize(); - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags // move back down slowly to find bed if (homing_bump_divisor[Z_AXIS] >= 1) @@ -1148,7 +1148,7 @@ inline void sync_plan_position() { zPosition -= home_retract_mm(Z_AXIS) * 2; line_to_z(zPosition); st_synchronize(); - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); // make sure the planner knows where we are as it may be a bit different than we last said to move to @@ -1435,13 +1435,17 @@ inline void sync_plan_position() { #endif // ENABLE_AUTO_BED_LEVELING +/** + * Home an individual axis + */ + +#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) + static void homeaxis(int axis) { #define HOMEAXIS_DO(LETTER) \ ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) - if (axis == X_AXIS ? HOMEAXIS_DO(X) : - axis == Y_AXIS ? HOMEAXIS_DO(Y) : - axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { + if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { int axis_home_dir; @@ -1451,108 +1455,112 @@ static void homeaxis(int axis) { axis_home_dir = home_dir(axis); #endif + // Set the axis position as setup for the move current_position[axis] = 0; sync_plan_position(); - #ifndef Z_PROBE_SLED - // Engage Servo endstop if enabled - #ifdef SERVO_ENDSTOPS - #if SERVO_LEVELING - if (axis == Z_AXIS) { - engage_z_probe(); - } - else - #endif // SERVO_LEVELING + // Engage Servo endstop if enabled + #ifdef SERVO_ENDSTOPS && !defined(Z_PROBE_SLED) - if (servo_endstops[axis] > -1) - servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); + #if SERVO_LEVELING + if (axis == Z_AXIS) engage_z_probe(); else + #endif + { + if (servo_endstops[axis] > -1) + servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); + } - #endif // SERVO_ENDSTOPS - - #endif // Z_PROBE_SLED + #endif // SERVO_ENDSTOPS && !Z_PROBE_SLED #ifdef Z_DUAL_ENDSTOPS if (axis == Z_AXIS) In_Homing_Process(true); #endif + // Move towards the endstop until an endstop is triggered destination[axis] = 1.5 * max_length(axis) * axis_home_dir; feedrate = homing_feedrate[axis]; line_to_destination(); st_synchronize(); + // Set the axis position as setup for the move current_position[axis] = 0; sync_plan_position(); + + // Move away from the endstop by the axis HOME_RETRACT_MM destination[axis] = -home_retract_mm(axis) * axis_home_dir; line_to_destination(); st_synchronize(); - destination[axis] = 2 * home_retract_mm(axis) * axis_home_dir; - + // Slow down the feedrate for the next move if (homing_bump_divisor[axis] >= 1) feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; else { feedrate = homing_feedrate[axis] / 10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); + SERIAL_ECHOLNPGM("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); } + // Move slowly towards the endstop until triggered + destination[axis] = 2 * home_retract_mm(axis) * axis_home_dir; line_to_destination(); st_synchronize(); + #ifdef Z_DUAL_ENDSTOPS - if (axis==Z_AXIS) - { - feedrate = homing_feedrate[axis]; - sync_plan_position(); - if (axis_home_dir > 0) - { - destination[axis] = (-1) * fabs(z_endstop_adj); - if (z_endstop_adj > 0) Lock_z_motor(true); else Lock_z2_motor(true); - } else { - destination[axis] = fabs(z_endstop_adj); - if (z_endstop_adj < 0) Lock_z_motor(true); else Lock_z2_motor(true); + if (axis == Z_AXIS) { + float adj = fabs(z_endstop_adj); + bool lockZ1; + if (axis_home_dir > 0) { + adj = -adj; + lockZ1 = (z_endstop_adj > 0); } + else + lockZ1 = (z_endstop_adj < 0); + + if (lockZ1) Lock_z_motor(true); else Lock_z2_motor(true); + sync_plan_position(); + + // Move to the adjusted endstop height + feedrate = homing_feedrate[axis]; + destination[Z_AXIS] = adj; line_to_destination(); st_synchronize(); - Lock_z_motor(false); - Lock_z2_motor(false); + + if (lockZ1) Lock_z_motor(false); else Lock_z2_motor(false); In_Homing_Process(false); + } // Z_AXIS + #endif + + #ifdef DELTA + // retrace by the amount specified in endstop_adj + if (endstop_adj[axis] * axis_home_dir < 0) { + sync_plan_position(); + destination[axis] = endstop_adj[axis]; + line_to_destination(); + st_synchronize(); } #endif -#ifdef DELTA - // retrace by the amount specified in endstop_adj - if (endstop_adj[axis] * axis_home_dir < 0) { - sync_plan_position(); - destination[axis] = endstop_adj[axis]; - line_to_destination(); - st_synchronize(); - } -#endif + // Set the axis position to its home position (plus home offsets) axis_is_at_home(axis); + destination[axis] = current_position[axis]; feedrate = 0.0; - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags axis_known_position[axis] = true; // Retract Servo endstop if enabled #ifdef SERVO_ENDSTOPS - if (servo_endstops[axis] > -1) { + if (servo_endstops[axis] > -1) servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]); - } #endif -#if SERVO_LEVELING - #ifndef Z_PROBE_SLED - if (axis==Z_AXIS) retract_z_probe(); - #endif -#endif + + #if SERVO_LEVELING && !defined(Z_PROBE_SLED) + if (axis == Z_AXIS) retract_z_probe(); + #endif } } -#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) -void refresh_cmd_timeout(void) -{ - previous_millis_cmd = millis(); -} +void refresh_cmd_timeout(void) { previous_millis_cmd = millis(); } #ifdef FWRETRACT @@ -1780,7 +1788,7 @@ inline void gcode_G28() { feedrate = 1.732 * homing_feedrate[X_AXIS]; line_to_destination(); st_synchronize(); - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags // Destination reached for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = destination[i]; @@ -1798,7 +1806,7 @@ inline void gcode_G28() { homeY = code_seen(axis_codes[Y_AXIS]), homeZ = code_seen(axis_codes[Z_AXIS]); - home_all_axis = !homeX && !homeY && !homeZ; // No parameters means home all axes + home_all_axis = !(homeX || homeY || homeZ) || (homeX && homeY && homeZ); #if Z_HOME_DIR > 0 // If homing away from BED do Z first @@ -1849,7 +1857,7 @@ inline void gcode_G28() { line_to_destination(); feedrate = 0.0; st_synchronize(); - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags current_position[X_AXIS] = destination[X_AXIS]; current_position[Y_AXIS] = destination[Y_AXIS]; @@ -1857,6 +1865,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = destination[Z_AXIS]; #endif } + #endif // QUICK_HOME // Home X @@ -2005,7 +2014,7 @@ inline void gcode_G28() { feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; previous_millis_cmd = millis(); - endstops_hit_on_purpose(); + endstops_hit_on_purpose(); // clear endstop hit flags } #if defined(MESH_BED_LEVELING) || defined(ENABLE_AUTO_BED_LEVELING) From 72c7de3570d5e7a1a49176c75d930d8b1bc036dd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Apr 2015 01:48:45 -0700 Subject: [PATCH 158/302] Cleanup M48 --- Marlin/Marlin_main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 07439309d..0e8c75f0e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2824,7 +2824,7 @@ inline void gcode_M42() { inline void gcode_M48() { double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50]; - int verbose_level = 1, j, n_samples = 10, n_legs = 0, engage_probe_for_each_reading = 0; + int verbose_level = 1, n_samples = 10, n_legs = 0; if (code_seen('V') || code_seen('v')) { verbose_level = code_value(); @@ -2852,8 +2852,7 @@ inline void gcode_M42() { Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING, ext_position = st_get_position_mm(E_AXIS); - if (code_seen('E') || code_seen('e')) - engage_probe_for_each_reading++; + bool engage_probe_for_each_reading = code_seen('E') || code_seen('e'); if (code_seen('X') || code_seen('x')) { X_probe_location = code_value() - X_PROBE_OFFSET_FROM_EXTRUDER; From 488666832bb83f2ab3764a0fda8654bd2e8e7a71 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 1 Apr 2015 13:40:05 +0200 Subject: [PATCH 159/302] Remove the previously introduced () --- Marlin/temperature.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 10b774b68..b59ff29df 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1539,8 +1539,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE0 >= #endif - if ((current_temperature_raw[0]) GE0 (maxttemp_raw[0])) max_temp_error(0); - if ((minttemp_raw[0]) GE0 (current_temperature_raw[0])) min_temp_error(0); + if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); + if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); #endif #if HAS_TEMP_1 @@ -1549,8 +1549,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE1 >= #endif - if ((current_temperature_raw[1]) GE1 (maxttemp_raw[1])) max_temp_error(1); - if ((minttemp_raw[1]) GE1 (current_temperature_raw[1])) min_temp_error(1); + if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1); + if (minttemp_raw[1] GE1 current_temperature_raw[1]) min_temp_error(1); #endif // TEMP_SENSOR_1 #if HAS_TEMP_2 @@ -1559,8 +1559,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE2 >= #endif - if ((current_temperature_raw[2]) GE2 (maxttemp_raw[2])) max_temp_error(2); - if ((minttemp_raw[2]) GE2 (current_temperature_raw[2])) min_temp_error(2); + if (current_temperature_raw[2] GE2 (maxttemp_raw[2]) max_temp_error(2); + if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2); #endif // TEMP_SENSOR_2 #if HAS_TEMP_3 @@ -1569,8 +1569,8 @@ ISR(TIMER0_COMPB_vect) { #else #define GE3 >= #endif - if ((current_temperature_raw[3]) GE3 (maxttemp_raw[3])) max_temp_error(3); - if ((minttemp_raw[3]) GE3 (current_temperature_raw[3])) min_temp_error(3); + if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3); + if (minttemp_raw[3] GE3 current_temperature_raw[3]) min_temp_error(3); #endif // TEMP_SENSOR_3 #if HAS_TEMP_BED From a57862e29f03e3a1f8dd2f8aa1ff588aa3bbf889 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 11:40:24 -0500 Subject: [PATCH 160/302] Cleaning up code in prep for merge with upstream. --- Marlin/Configuration.h | 1 - Marlin/Marlin.h | 1 - Marlin/Marlin_main.cpp | 83 +++++++------ Marlin/dogm_lcd_implementation.h | 2 +- Marlin/planner.cpp | 4 +- Marlin/stepper.cpp | 116 +++++++++++------- Marlin/ultralcd.cpp | 2 +- .../ultralcd_implementation_hitachi_HD44780.h | 16 +-- 8 files changed, 125 insertions(+), 100 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3d6bd50c2..f23b1e45b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -330,7 +330,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. - //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS // If you want to enable the Z Probe pin, but disable its use, uncomment the line below. diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 336e771fd..e0441714b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -231,7 +231,6 @@ void refresh_cmd_timeout(void); extern float homing_feedrate[]; extern bool axis_relative_modes[]; extern int feedmultiply; -extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8c463d91d..5bc239d47 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -170,10 +170,10 @@ // M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters // M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder // M406 - Turn off Filament Sensor extrusion control -// M407 - Displays measured filament diameter +// M407 - Display measured filament diameter // M500 - Store parameters in EEPROM // M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). -// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] @@ -272,7 +272,7 @@ int fanSpeed = 0; #endif // FWRETRACT -#ifdef ULTIPANEL +#if defined(ULTIPANEL) && HAS_POWER_SWITCH bool powersupply = #ifdef PS_DEFAULT_OFF false @@ -311,13 +311,13 @@ bool cancel_heatup = false; #ifdef FILAMENT_SENSOR //Variables for Filament Sensor input - float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 - bool filament_sensor=false; //M405 turns on filament_sensor control, M406 turns it off - float filament_width_meas=DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter + float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 + bool filament_sensor = false; //M405 turns on filament_sensor control, M406 turns it off + float filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter signed char measurement_delay[MAX_MEASUREMENT_DELAY+1]; //ring buffer to delay measurement store extruder factor after subtracting 100 - int delay_index1=0; //index into ring buffer - int delay_index2=-1; //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized - float delay_dist=0; //delay distance counter + int delay_index1 = 0; //index into ring buffer + int delay_index2 = -1; //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized + float delay_dist = 0; //delay distance counter int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting #endif @@ -516,8 +516,8 @@ void setup_powerhold() #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 OUT_WRITE(SUICIDE_PIN, HIGH); #endif - #if defined(PS_ON_PIN) && PS_ON_PIN > -1 - #if defined(PS_DEFAULT_OFF) + #if HAS_POWER_SWITCH + #ifdef PS_DEFAULT_OFF OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #else OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -1100,7 +1100,7 @@ inline void sync_plan_position() { static void run_z_probe() { #ifdef DELTA - + float start_z = current_position[Z_AXIS]; long start_steps = st_get_position(Z_AXIS); @@ -1153,7 +1153,7 @@ inline void sync_plan_position() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); // make sure the planner knows where we are as it may be a bit different than we last said to move to sync_plan_position(); - + #endif // !DELTA } @@ -1163,7 +1163,7 @@ inline void sync_plan_position() { #ifdef DELTA feedrate = XY_TRAVEL_SPEED; - + destination[X_AXIS] = x; destination[Y_AXIS] = y; destination[Z_AXIS] = z; @@ -1237,12 +1237,12 @@ inline void sync_plan_position() { feedrate = homing_feedrate[X_AXIS]/10; destination[X_AXIS] = 0; prepare_move_raw(); - + // Home Y for safety feedrate = homing_feedrate[X_AXIS]/2; destination[Y_AXIS] = 0; prepare_move_raw(); - + st_synchronize(); #if defined(Z_PROBE_ENDSTOP) @@ -1250,7 +1250,7 @@ inline void sync_plan_position() { if (z_probe_endstop) { #else bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) { + if (z_min_endstop) { #endif if (!Stopped) { SERIAL_ERROR_START; @@ -1261,7 +1261,7 @@ inline void sync_plan_position() { } #endif // Z_PROBE_ALLEN_KEY - + } static void retract_z_probe() { @@ -1279,9 +1279,9 @@ inline void sync_plan_position() { #if SERVO_LEVELING servos[servo_endstops[Z_AXIS]].attach(0); #endif - - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); - + + servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); + #if SERVO_LEVELING delay(PROBE_SERVO_DEACTIVATION_DELAY); servos[servo_endstops[Z_AXIS]].detach(); @@ -1305,23 +1305,23 @@ inline void sync_plan_position() { feedrate = homing_feedrate[Z_AXIS]/10; destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH; prepare_move_raw(); - + // Move up for safety feedrate = homing_feedrate[Z_AXIS]/2; destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2; prepare_move_raw(); - + // Home XY for safety feedrate = homing_feedrate[X_AXIS]/2; destination[X_AXIS] = 0; destination[Y_AXIS] = 0; prepare_move_raw(); - + st_synchronize(); #if defined(Z_PROBE_ENDSTOP) bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); - if (z_probe_endstop) { + if (!z_probe_endstop) { #else bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); if (!z_min_endstop) { @@ -3319,7 +3319,7 @@ inline void gcode_M140() { if (code_seen('S')) setTargetBed(code_value()); } -#if defined(PS_ON_PIN) && PS_ON_PIN > -1 +#if HAS_POWER_SWITCH /** * M80: Turn on Power Supply @@ -3341,10 +3341,12 @@ inline void gcode_M140() { #endif } -#endif // PS_ON_PIN +#endif // HAS_POWER_SWITCH /** - * M81: Turn off Power Supply + * M81: Turn off Power, including Power Supply, if there is one. + * + * This code should ALWAYS be available for EMERGENCY SHUTDOWN! */ inline void gcode_M81() { disable_heater(); @@ -3359,16 +3361,19 @@ inline void gcode_M81() { #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 st_synchronize(); suicide(); - #elif defined(PS_ON_PIN) && PS_ON_PIN > -1 + #elif HAS_POWER_SWITCH OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #endif #ifdef ULTIPANEL - powersupply = false; + #if HAS_POWER_SWITCH + powersupply = false; + #endif LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); lcd_update(); #endif } + /** * M82: Set E codes absolute (default) */ @@ -4903,15 +4908,15 @@ void process_commands() { #endif //HEATER_2_PIN #endif //BARICUDA - #if defined(PS_ON_PIN) && PS_ON_PIN > -1 + #if HAS_POWER_SWITCH case 80: // M80 - Turn on Power Supply gcode_M80(); break; - #endif // PS_ON_PIN + #endif // HAS_POWER_SWITCH - case 81: // M81 - Turn off Power Supply + case 81: // M81 - Turn off Power, including Power Supply, if possible gcode_M81(); break; @@ -5882,19 +5887,17 @@ void kill() disable_e2(); disable_e3(); -#if defined(PS_ON_PIN) && PS_ON_PIN > -1 - pinMode(PS_ON_PIN,INPUT); -#endif + #if HAS_POWER_SWITCH + pinMode(PS_ON_PIN, INPUT); + #endif + SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_KILLED); LCD_ALERTMESSAGEPGM(MSG_KILLED); // FMC small patch to update the LCD before ending sei(); // enable interrupts - for ( int i=5; i--; lcd_update()) - { - delay(200); - } + for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time cli(); // disable interrupts suicide(); while(1) { /* Intentionally left empty */ } // Wait for reset diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 89cd5e835..63e99bd3a 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("dia:")); lcd_print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" factor:")); - lcd_print(itostr3(extrudemultiply)); + lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM])); lcd_print('%'); } #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 786527d0d..d98ef63d4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -545,7 +545,7 @@ float junction_deviation = 0.1; block->steps[Z_AXIS] = labs(dz); block->steps[E_AXIS] = labs(de); block->steps[E_AXIS] *= volumetric_multiplier[active_extruder]; - block->steps[E_AXIS] *= extrudemultiply; + block->steps[E_AXIS] *= extruder_multiply[active_extruder]; block->steps[E_AXIS] /= 100; block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS]))); @@ -679,7 +679,7 @@ float junction_deviation = 0.1; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; #endif delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; - delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extrudemultiply / 100.0; + delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 0fb4d8a67..5c01e2f15 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -524,33 +524,43 @@ ISR(TIMER1_COMPA_vect) { } if (TEST(out_bits, Z_AXIS)) { // -direction + Z_APPLY_DIR(INVERT_Z_DIR,0); count_direction[Z_AXIS] = -1; - if (check_endstops) - { - #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 - #ifndef Z_DUAL_ENDSTOPS - UPDATE_ENDSTOP(z, Z, min, MIN); - #else - bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - #if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1 - bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING); - #else - bool z2_min_endstop=z_min_endstop; - #endif - if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0)) - { + + if (check_endstops) { + + #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 + + #ifdef Z_DUAL_ENDSTOPS + + bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING, + z2_min_endstop = + #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0 + READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING + #else + z_min_endstop + #endif + ; + + bool z_min_both = z_min_endstop && old_z_min_endstop, + z2_min_both = z2_min_endstop && old_z2_min_endstop; + if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit=true; - if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing... - { + endstop_z_hit = true; + if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing... step_events_completed = current_block->step_event_count; - } } old_z_min_endstop = z_min_endstop; old_z2_min_endstop = z2_min_endstop; - #endif - #endif + + #else // !Z_DUAL_ENDSTOPS + + UPDATE_ENDSTOP(z, Z, min, MIN); + + #endif // !Z_DUAL_ENDSTOPS + + #endif // Z_MIN_PIN #ifdef Z_PROBE_ENDSTOP UPDATE_ENDSTOP(z, Z, probe, PROBE); @@ -564,41 +574,53 @@ ISR(TIMER1_COMPA_vect) { } old_z_probe_endstop = z_probe_endstop; #endif - } + + } // check_endstops + } else { // +direction + Z_APPLY_DIR(!INVERT_Z_DIR,0); count_direction[Z_AXIS] = 1; + if (check_endstops) { + #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 - #ifndef Z_DUAL_ENDSTOPS - UPDATE_ENDSTOP(z, Z, max, MAX); - #else - bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING); - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1 - bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING); - #else - bool z2_max_endstop=z_max_endstop; - #endif - if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0)) - { + + #ifdef Z_DUAL_ENDSTOPS + + bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING, + z2_max_endstop = + #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 + READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING + #else + z_max_endstop + #endif + ; + + bool z_max_both = z_max_endstop && old_z_max_endstop, + z2_max_both = z2_max_endstop && old_z2_max_endstop; + if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_z_hit=true; + endstop_z_hit = true; -// if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true"); -// if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true"); + // if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true"); + // if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true"); - - if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing... - { + if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing... step_events_completed = current_block->step_event_count; - } } old_z_max_endstop = z_max_endstop; old_z2_max_endstop = z2_max_endstop; - #endif - #endif + #else // !Z_DUAL_ENDSTOPS + + UPDATE_ENDSTOP(z, Z, max, MAX); + + #endif // !Z_DUAL_ENDSTOPS + + #endif // Z_MAX_PIN + #ifdef Z_PROBE_ENDSTOP UPDATE_ENDSTOP(z, Z, probe, PROBE); z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); @@ -610,22 +632,24 @@ ISR(TIMER1_COMPA_vect) { } old_z_probe_endstop = z_probe_endstop; #endif - } - } + + } // check_endstops + + } // +direction #ifndef ADVANCE if (TEST(out_bits, E_AXIS)) { // -direction REV_E_DIR(); - count_direction[E_AXIS]=-1; + count_direction[E_AXIS] = -1; } else { // +direction NORM_E_DIR(); - count_direction[E_AXIS]=1; + count_direction[E_AXIS] = 1; } #endif //!ADVANCE // Take multiple steps per interrupt (For high speed moves) - for (int8_t i=0; i < step_loops; i++) { + for (int8_t i = 0; i < step_loops; i++) { #ifndef AT90USB MSerial.checkRx(); // Check for serial chars. #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a9930fc14..d2a2e6faa 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -491,7 +491,7 @@ static void lcd_tune_menu() { MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); #endif MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); - MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); + MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999); #if TEMP_SENSOR_1 != 0 MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 583cde662..4819e3e00 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -624,7 +624,7 @@ static void lcd_implementation_status_screen() static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) { char c; - uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2); + uint8_t n = LCD_WIDTH - 2; lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -633,12 +633,11 @@ static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const cha } while(n--) lcd.print(' '); lcd.print(post_char); - lcd.print(' '); } static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) { char c; - uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data); + uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -651,7 +650,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t r } static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) { char c; - uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data); + uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -688,11 +687,11 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { lcd.setCursor(1, 1); lcd_printPGM(pstr); lcd.print(':'); - lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1); + lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); lcd_print(value); } -static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) { +static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) { char c; uint8_t n = LCD_WIDTH - concat; lcd.setCursor(0, row); @@ -706,14 +705,15 @@ static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* ps filename++; } while (n--) lcd.print(' '); + lcd.print(post_char); } static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1); + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' '); } static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2); + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]); } #define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) From bb41edc2efa05160bf7e0d972b84ad7eb3de1617 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 12:13:25 -0500 Subject: [PATCH 161/302] Fixed extra #endif --- Marlin/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index cac7c55e0..6c0c9fd09 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -124,7 +124,7 @@ // #endif // #ifndef SERVO_ENDSTOP_ANGLES // #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP - #endif +// #endif #endif /** * Check if Probe_Offset * Grid Points is greater than Probing Range From 67d5e7973ef72812a87c3f1b84b605e8fbb11838 Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Wed, 1 Apr 2015 20:17:49 +0200 Subject: [PATCH 162/302] old bump_divisor for cartesian/corexy-printer some people are starting to ask why homing is so slow. this is the old standard hard-coded value. --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b81e63c8e..d689ac47f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -178,7 +178,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 2 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} From 2966ae2022c51449c02fe76eaf2a470c003d26af Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 13:32:25 -0500 Subject: [PATCH 163/302] Fix Z_PROBE_PING not declared, allows code to compile if Z_PROBE_ENDSTOP is not used. --- Marlin/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/pins.h b/Marlin/pins.h index 6db56e9f4..0d6329886 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -187,7 +187,7 @@ #define Z_MIN_PIN -1 #endif -#ifdef DISABLE_Z_PROBE_ENDSTOP +#if defined (DISABLE_Z_PROBE_ENDSTOP) || ! defined (Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting. #define Z_PROBE_PIN -1 #endif From 26dc80bf2d53409387b5915580c9f5534ed8b4c6 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 13:47:17 -0500 Subject: [PATCH 164/302] Typo fixed... --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5bc239d47..456cfb0a4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2811,7 +2811,7 @@ inline void gcode_M42() { #error "You must have a Z_PROBE_PIN defined in order to enable calculation of Z-Probe repeatability." #endif #else - #if (Z_MIN_PIN == -1) && + #if (Z_MIN_PIN == -1) #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability." #endif #endif From 6b91b7b411da3e7dfd535670d8a096a7144a0ff2 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 1 Apr 2015 21:18:51 +0200 Subject: [PATCH 165/302] Mesh bed leveling: Added G29 S3 + finer steps in manual probing. * Use "G29 S3 Xn Yn Zn.nn" to modify bad probed point manually * Changed manual Z steps from 0.05 to 0.025 and made brought it to Configuration.h --- Marlin/Configuration.h | 4 ++++ Marlin/Marlin_main.cpp | 54 +++++++++++++++++++++++++++++++++++------- Marlin/ultralcd.cpp | 4 ++-- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a984923ea..5a6d483bf 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -387,6 +387,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#if defined(MANUAL_BED_LEVELING) + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #if defined(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b41be617..a327f209d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2038,10 +2038,18 @@ inline void gcode_G28() { * * Parameters With MESH_BED_LEVELING: * - * S0 Produce a mesh report - * S1 Start probing mesh points - * S2 Probe the next mesh point + * S0 Produce a mesh report + * S1 Start probing mesh points + * S2 Probe the next mesh point + * S3 Xn Yn Zn.nn Manually modify a single point * + * The S0 report the points as below + * + * +----> X-axis + * | + * | + * v Y-axis + * */ inline void gcode_G29() { @@ -2052,13 +2060,13 @@ inline void gcode_G28() { int state = 0; if (code_seen('S') || code_seen('s')) { state = code_value_long(); - if (state < 0 || state > 2) { - SERIAL_PROTOCOLPGM("S out of range (0-2).\n"); + if (state < 0 || state > 3) { + SERIAL_PROTOCOLPGM("S out of range (0-3).\n"); return; } } - if (state == 0) { // Dump mesh_bed_leveling + if (state == 0) { // Produce a mesh report if (mbl.active) { SERIAL_PROTOCOLPGM("Num X,Y: "); SERIAL_PROTOCOL(MESH_NUM_X_POINTS); @@ -2078,14 +2086,14 @@ inline void gcode_G28() { SERIAL_PROTOCOLPGM("Mesh bed leveling not active.\n"); } - } else if (state == 1) { // Begin probing mesh points + } else if (state == 1) { // Start probing mesh points mbl.reset(); probe_point = 0; enquecommands_P(PSTR("G28")); enquecommands_P(PSTR("G29 S2")); - } else if (state == 2) { // Goto next point + } else if (state == 2) { // Probe the next mesh point if (probe_point < 0) { SERIAL_PROTOCOLPGM("Start mesh probing with \"G29 S1\" first.\n"); @@ -2119,6 +2127,36 @@ inline void gcode_G28() { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[X_AXIS]/60, active_extruder); st_synchronize(); probe_point++; + } else if (state == 3) { // Manually modify a single point + int ix, iy; + float z; + if (code_seen('X') || code_seen('x')) { + ix = code_value_long()-1; + if (ix < 0 || ix >= MESH_NUM_X_POINTS) { + SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n"); + return; + } + } else { + SERIAL_PROTOCOLPGM("X not entered.\n"); + return; + } + if (code_seen('Y') || code_seen('y')) { + iy = code_value_long()-1; + if (iy < 0 || iy >= MESH_NUM_Y_POINTS) { + SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n"); + return; + } + } else { + SERIAL_PROTOCOLPGM("Y not entered.\n"); + return; + } + if (code_seen('Z') || code_seen('z')) { + z = code_value(); + } else { + SERIAL_PROTOCOLPGM("Z not entered.\n"); + return; + } + mbl.z_values[iy][ix] = z; } } diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d2a2e6faa..e6da28e0f 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1795,14 +1795,14 @@ static void _lcd_level_bed() { if (encoderPosition != 0) { refresh_cmd_timeout(); - current_position[Z_AXIS] += float((int)encoderPosition) * 0.05; + current_position[Z_AXIS] += float((int)encoderPosition) * MBL_Z_STEP; if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) current_position[Z_AXIS] = Z_MIN_POS; if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS; encoderPosition = 0; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS]/60, active_extruder); lcdDrawUpdate = 1; } - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr32(current_position[Z_AXIS])); + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS])); static bool debounce_click = false; if (LCD_CLICKED) { if (!debounce_click) { From 6bdebede27061868def31428f54840f3696999e0 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 1 Apr 2015 21:32:28 +0200 Subject: [PATCH 166/302] Added description in the documentation for the new parts. --- Documentation/MeshBedLeveling.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/MeshBedLeveling.md b/Documentation/MeshBedLeveling.md index 21eabb6b0..7981a896c 100644 --- a/Documentation/MeshBedLeveling.md +++ b/Documentation/MeshBedLeveling.md @@ -28,6 +28,10 @@ In `Configuration.h` there are two options that can be enabled. There are also some values that can be set. +The following will set the step distance used when manually turning the display encoder. Default is 0.025 + +`MBL_Z_STEP` + Following four define the area to cover. Default 10mm from max bed size `MESH_MIN_X`
@@ -55,14 +59,14 @@ When selecting this option the printer will first do a homing, and then travel t If the EEPROM has been enable it can be good to issue a `M500` to get these points saved. -Issuing a `G29` will return the state of the mesh leveling. +Issuing a `G29` will return the state of the mesh leveling and report the probed points. Probing the bed with G-codes ---------------------------- Probing the bed by G-codes follows the sequence much like doing it with the display. -`G29` or `G29 S0` will return the state bed leveling. +`G29` or `G29 S0` will return the state of the bed leveling and report the probed points. Where X=1 Y=1 is the top-left value and X=MESH_NUM_X_POINTS Y=MESH_NUM_Y_POINTS is bottom-right value. X per column and Y per row. `G29 S1` will initiate the bed leveling, homing and traveling to the first point to probe. @@ -70,6 +74,8 @@ Then use your preferred Printer controller program, i.e. Printrun, to lower the `G29 S2` will store the point and travel to the next point until last point has been probed. +`G29 S3 Xn Yn Zn.nn` will modify a single probed point. This can be used to tweak a badly probed point. Specify probe point where `Xn` and `Yn`, where `n` in `Xn` is between 1 and `MESH_NUM_X_POINTS`. Likewise for `Yn`. `Zn.nn` is the new Z value in that probed point. + Note ---- From ae2ebc6951d0768ee5b998ad383b8b2d91a2bb8c Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Wed, 1 Apr 2015 23:18:51 +0200 Subject: [PATCH 167/302] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e281d3602..af49af011 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,6 @@ We are actively looking for testers. So please try the current development versi [![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224) [![Travis Build Status](https://travis-ci.org/MarlinFirmware/Marlin.svg)](https://travis-ci.org/MarlinFirmware/Marlin) -What bugs are we working on: [Bug Fixing Round 3](https://github.com/MarlinFirmware/Marlin/milestones/Bug%20Fixing%20Round%203) - ## Contact __IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware) From 916f59e35f1408a65b68267d0b2ec9d62ccb31b4 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 19:22:05 -0500 Subject: [PATCH 168/302] Spaces not tabs in language.h. Catch unlikely but possible error and head crash when using Z_PROBE_REPEATABILITY_TEST --- Marlin/SanityCheck.h | 2 +- Marlin/language.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 6c0c9fd09..09d1ca3b6 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -93,7 +93,7 @@ * Require a Z Min pin */ #if Z_MIN_PIN == -1 - #if Z_PROBE_PIN == -1 + #if Z_PROBE_PIN == -1 || (! defined (Z_PROBE_ENDSTOP) || defined (DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a ping for the Z Probe, but not enable it. #ifdef Z_PROBE_REPEATABILITY_TEST #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST. #else diff --git a/Marlin/language.h b/Marlin/language.h index f4a2d2610..4a4698c90 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -138,7 +138,7 @@ #define MSG_Z_MIN "z_min: " #define MSG_Z_MAX "z_max: " #define MSG_Z2_MAX "z2_max: " -#define MSG_Z_PROBE "z_probe: " +#define MSG_Z_PROBE "z_probe: " #define MSG_M119_REPORT "Reporting endstop status" #define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_OPEN "open" From 59994bd519303ad6f205229ba7d926a57833e4d2 Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Wed, 1 Apr 2015 19:24:42 -0500 Subject: [PATCH 169/302] Not doing network admin work, pin not ping... :) --- Marlin/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 09d1ca3b6..8ea9b2e3d 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -93,7 +93,7 @@ * Require a Z Min pin */ #if Z_MIN_PIN == -1 - #if Z_PROBE_PIN == -1 || (! defined (Z_PROBE_ENDSTOP) || defined (DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a ping for the Z Probe, but not enable it. + #if Z_PROBE_PIN == -1 || (! defined (Z_PROBE_ENDSTOP) || defined (DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. #ifdef Z_PROBE_REPEATABILITY_TEST #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST. #else From 93fdc2951b8f53a7f4e5a350923f6fd664cc1d5a Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Thu, 2 Apr 2015 07:22:01 +0200 Subject: [PATCH 170/302] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index af49af011..2ecb9d8e8 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,6 @@ We are actively looking for testers. So please try the current development versi __IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware) -__Mailing List:__ marlin@lists.0l.de ([Subscribe](http://lists.0l.de/mailman/listinfo/marlin), [Archive](http://lists.0l.de/pipermail/marlin/)) - ## Credits The current Marlin dev team consists of: From e96df6763048bf21dbd71ed1742e34ac0854d53e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Apr 2015 05:10:14 -0700 Subject: [PATCH 171/302] Clarify thermal_runaway_protection - Add comments documenting `thermal_runaway_protection` - Add an enum for the thermal runaway states - Add macros for temperature helper functions - Fix a glitch with the z probe sled in homeaxis --- Marlin/Marlin_main.cpp | 59 ++++++++-------- Marlin/planner.cpp | 4 +- Marlin/temperature.cpp | 152 +++++++++++++++++++---------------------- Marlin/temperature.h | 46 +++++-------- 4 files changed, 118 insertions(+), 143 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b41be617..24d9f0d47 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1460,7 +1460,7 @@ static void homeaxis(int axis) { sync_plan_position(); // Engage Servo endstop if enabled - #ifdef SERVO_ENDSTOPS && !defined(Z_PROBE_SLED) + #if defined(SERVO_ENDSTOPS) && !defined(Z_PROBE_SLED) #if SERVO_LEVELING if (axis == Z_AXIS) engage_z_probe(); else @@ -2781,7 +2781,7 @@ inline void gcode_M42() { } } - #if defined(FAN_PIN) && FAN_PIN > -1 + #if HAS_FAN if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif @@ -3067,17 +3067,17 @@ inline void gcode_M104() { inline void gcode_M105() { if (setTargetedHotend(105)) return; - #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 + #if HAS_TEMP_0 SERIAL_PROTOCOLPGM("ok T:"); SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1); - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetBed(),1); - #endif //TEMP_BED_PIN + #endif for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(cur_extruder); @@ -3108,7 +3108,7 @@ inline void gcode_M105() { #endif #ifdef SHOW_TEMP_ADC_VALUES - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" ADC B:"); SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM("C->"); @@ -3124,10 +3124,10 @@ inline void gcode_M105() { } #endif - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } -#if defined(FAN_PIN) && FAN_PIN > -1 +#if HAS_FAN /** * M106: Set Fan Speed @@ -3139,7 +3139,7 @@ inline void gcode_M105() { */ inline void gcode_M107() { fanSpeed = 0; } -#endif //FAN_PIN +#endif // HAS_FAN /** * M109: Wait for extruder(s) to reach temperature @@ -3197,10 +3197,10 @@ inline void gcode_M109() { SERIAL_PROTOCOLLN( timetemp ); } else { - SERIAL_PROTOCOLLN( "?" ); + SERIAL_PROTOCOLLNPGM("?"); } #else - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; #endif timetemp = millis(); } @@ -3223,7 +3223,7 @@ inline void gcode_M109() { starttime = previous_millis_cmd = millis(); } -#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 +#if HAS_TEMP_BED /** * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating @@ -3251,7 +3251,7 @@ inline void gcode_M109() { SERIAL_PROTOCOL((int)active_extruder); SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(degBed(), 1); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } manage_heater(); manage_inactivity(); @@ -3452,27 +3452,26 @@ inline void gcode_M114() { SERIAL_PROTOCOLPGM(" Z:"); SERIAL_PROTOCOL(float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; #ifdef SCARA SERIAL_PROTOCOLPGM("SCARA Theta:"); SERIAL_PROTOCOL(delta[X_AXIS]); SERIAL_PROTOCOLPGM(" Psi+Theta:"); SERIAL_PROTOCOL(delta[Y_AXIS]); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; SERIAL_PROTOCOLPGM("SCARA Cal - Theta:"); SERIAL_PROTOCOL(delta[X_AXIS]+home_offset[X_AXIS]); SERIAL_PROTOCOLPGM(" Psi+Theta (90):"); SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+home_offset[Y_AXIS]); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:"); SERIAL_PROTOCOL(delta[X_AXIS]/90*axis_steps_per_unit[X_AXIS]); SERIAL_PROTOCOLPGM(" Psi+Theta:"); SERIAL_PROTOCOL((delta[Y_AXIS]-delta[X_AXIS])/90*axis_steps_per_unit[Y_AXIS]); - SERIAL_PROTOCOLLN(""); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; SERIAL_EOL; #endif } @@ -3915,7 +3914,7 @@ inline void gcode_M226() { SERIAL_PROTOCOL(servo_index); SERIAL_PROTOCOL(": "); SERIAL_PROTOCOL(servos[servo_index].read()); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } } @@ -3983,7 +3982,7 @@ inline void gcode_M226() { //Kc does not have scaling applied above, or in resetting defaults SERIAL_PROTOCOL(PID_PARAM(Kc, e)); #endif - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } else { SERIAL_ECHO_START; @@ -4008,7 +4007,7 @@ inline void gcode_M226() { SERIAL_PROTOCOL(unscalePID_i(bedKi)); SERIAL_PROTOCOL(" d:"); SERIAL_PROTOCOL(unscalePID_d(bedKd)); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } #endif // PIDTEMPBED @@ -4058,7 +4057,7 @@ inline void gcode_M226() { if (code_seen('C')) lcd_setcontrast(code_value_long() & 0x3F); SERIAL_PROTOCOLPGM("lcd contrast value: "); SERIAL_PROTOCOL(lcd_contrast); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } #endif // DOGLCD @@ -4331,7 +4330,7 @@ inline void gcode_M503() { zprobe_zoffset = -value; // compare w/ line 278 of ConfigurationStore.cpp SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } else { SERIAL_ECHO_START; @@ -4340,14 +4339,14 @@ inline void gcode_M503() { SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN); SERIAL_ECHOPGM(MSG_Z_MAX); SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } } else { SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " : "); SERIAL_ECHO(-zprobe_zoffset); - SERIAL_PROTOCOLLN(""); + SERIAL_EOL; } } @@ -4852,20 +4851,20 @@ void process_commands() { gcode_M109(); break; - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED case 190: // M190 - Wait for bed heater to reach target. gcode_M190(); break; - #endif //TEMP_BED_PIN + #endif // HAS_TEMP_BED - #if defined(FAN_PIN) && FAN_PIN > -1 + #if HAS_FAN case 106: //M106 Fan On gcode_M106(); break; case 107: //M107 Fan Off gcode_M107(); break; - #endif //FAN_PIN + #endif // HAS_FAN #ifdef BARICUDA // PWM for HEATER_1_PIN @@ -5704,7 +5703,7 @@ void handle_status_leds(void) { max_temp = max(max_temp, degHotend(cur_extruder)); max_temp = max(max_temp, degTargetHotend(cur_extruder)); } - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED max_temp = max(max_temp, degTargetBed()); max_temp = max(max_temp, degBed()); #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d98ef63d4..1dcbc96af 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -427,7 +427,7 @@ void check_axes_activity() { disable_e3(); } - #if defined(FAN_PIN) && FAN_PIN > -1 // HAS_FAN + #if HAS_FAN #ifdef FAN_KICKSTART_TIME static unsigned long fan_kick_end; if (tail_fan_speed) { @@ -447,7 +447,7 @@ void check_axes_activity() { #else analogWrite(FAN_PIN, tail_fan_speed); #endif //!FAN_SOFT_PWM - #endif //FAN_PIN > -1 + #endif // HAS_FAN #ifdef AUTOTEMP getHighESpeed(); diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index b59ff29df..2442ad206 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1,5 +1,5 @@ /* - temperature.c - temperature control + temperature.cpp - temperature control Part of Marlin Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm @@ -16,18 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - */ - -/* - This firmware is a mashup between Sprinter and grbl. - (https://github.com/kliment/Sprinter) - (https://github.com/simen/grbl/tree) - - It has preliminary support for Matthew Roberts advance algorithm - http://reprap.org/pipermail/reprap-dev/2011-May/003323.html - - */ - +*/ #include "Marlin.h" #include "ultralcd.h" @@ -87,14 +76,15 @@ unsigned char soft_pwm_bed; #define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0) #define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0) #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION + enum TRState { TRInactive, TRFirstHeating, TRStable }; static bool thermal_runaway = false; - void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); + void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); #if HAS_HEATER_THERMAL_PROTECTION - static int thermal_runaway_state_machine[4]; // = {0,0,0,0}; + static TRState thermal_runaway_state_machine[4] = { TRInactive, TRInactive, TRInactive, TRInactive }; static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; #endif #if HAS_BED_THERMAL_PROTECTION - static int thermal_runaway_bed_state_machine; + static TRState thermal_runaway_bed_state_machine = { TRInactive, TRInactive, TRInactive, TRInactive }; static unsigned long thermal_runaway_bed_timer; #endif #endif @@ -238,7 +228,7 @@ void PID_autotune(float temp, int extruder, int ncycles) soft_pwm[extruder] = bias = d = PID_MAX / 2; // PID Tuning loop - for(;;) { + for (;;) { unsigned long ms = millis(); @@ -609,7 +599,7 @@ void manage_heater() { // Loop through all extruders for (int e = 0; e < EXTRUDERS; e++) { - #if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0 + #if HAS_HEATER_THERMAL_PROTECTION thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_RUNAWAY_PROTECTION_PERIOD, THERMAL_RUNAWAY_PROTECTION_HYSTERESIS); #endif @@ -637,7 +627,7 @@ void manage_heater() { disable_heater(); _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP)); } - #endif //TEMP_SENSOR_1_AS_REDUNDANT + #endif // TEMP_SENSOR_1_AS_REDUNDANT } // Extruders Loop @@ -1014,69 +1004,69 @@ void setWatch() { } #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION -void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) -{ -/* - SERIAL_ECHO_START; - SERIAL_ECHO("Thermal Thermal Runaway Running. Heater ID:"); - SERIAL_ECHO(heater_id); - SERIAL_ECHO(" ; State:"); - SERIAL_ECHO(*state); - SERIAL_ECHO(" ; Timer:"); - SERIAL_ECHO(*timer); - SERIAL_ECHO(" ; Temperature:"); - SERIAL_ECHO(temperature); - SERIAL_ECHO(" ; Target Temp:"); - SERIAL_ECHO(target_temperature); - SERIAL_ECHOLN(""); -*/ - if ((target_temperature == 0) || thermal_runaway) - { - *state = 0; - *timer = 0; - return; - } - switch (*state) - { - case 0: // "Heater Inactive" state - if (target_temperature > 0) *state = 1; - break; - case 1: // "First Heating" state - if (temperature >= target_temperature) *state = 2; - break; - case 2: // "Temperature Stable" state - { - unsigned long ms = millis(); - if (temperature >= (target_temperature - hysteresis_degc)) - { - *timer = ms; - } - else if ( (ms - *timer) > ((unsigned long) period_seconds) * 1000) - { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); - SERIAL_ERRORLN((int)heater_id); - LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); // translatable - thermal_runaway = true; - while(1) - { - disable_heater(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); - manage_heater(); - lcd_update(); - } - } - } break; - } -} -#endif //THERMAL_RUNAWAY_PROTECTION_PERIOD + void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { + /* + SERIAL_ECHO_START; + SERIAL_ECHO("Thermal Thermal Runaway Running. Heater ID:"); + SERIAL_ECHO(heater_id); + SERIAL_ECHO(" ; State:"); + SERIAL_ECHO(*state); + SERIAL_ECHO(" ; Timer:"); + SERIAL_ECHO(*timer); + SERIAL_ECHO(" ; Temperature:"); + SERIAL_ECHO(temperature); + SERIAL_ECHO(" ; Target Temp:"); + SERIAL_ECHO(target_temperature); + SERIAL_ECHOLN(""); + */ + if (target_temperature == 0 || thermal_runaway) { + *state = TRInactive; + *timer = 0; + return; + } + + switch (*state) { + // Inactive state waits for a target temperature, then + case TRInactive: + if (target_temperature > 0) *state = TRFirstHeating; + break; + // When first heating, wait for the temperature to be reached then go to Stable state + case TRFirstHeating: + if (temperature >= target_temperature) *state = TRStable; + break; + // While the temperature is stable watch for a bad temperature + case TRStable: + { + // Whenever the current temperature is over the target (-hysteresis) restart the timer + if (temperature >= target_temperature - hysteresis_degc) { + *timer = millis(); + } + // If the timer goes too long without a reset, trigger shutdown + else if (millis() > *timer + period_seconds * 1000UL) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); + SERIAL_ERRORLN((int)heater_id); + LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); + thermal_runaway = true; + for (;;) { + disable_heater(); + disable_x(); + disable_y(); + disable_z(); + disable_e0(); + disable_e1(); + disable_e2(); + disable_e3(); + manage_heater(); + lcd_update(); + } + } + } break; + } + } + +#endif // HAS_HEATER_THERMAL_PROTECTION void disable_heater() { for (int i=0; i. */ -#ifndef temperature_h -#define temperature_h +#ifndef TEMPERATURE_H +#define TEMPERATURE_H #include "Marlin.h" #include "planner.h" @@ -105,40 +105,27 @@ FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_tempe FORCE_INLINE bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; } FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } -#define degHotend0() degHotend(0) -#define degTargetHotend0() degTargetHotend(0) -#define setTargetHotend0(_celsius) setTargetHotend((_celsius), 0) -#define isHeatingHotend0() isHeatingHotend(0) -#define isCoolingHotend0() isCoolingHotend(0) +#define HOTEND_ROUTINES(NR) \ + FORCE_INLINE float degHotend##NR() { return degHotend(NR); } \ + FORCE_INLINE float degTargetHotend##NR() { return degTargetHotend(NR); } \ + FORCE_INLINE void setTargetHotend##NR(const float c) { setTargetHotend(c, NR); } \ + FORCE_INLINE bool isHeatingHotend##NR() { return isHeatingHotend(NR); } \ + FORCE_INLINE bool isCoolingHotend##NR() { return isCoolingHotend(NR); } +HOTEND_ROUTINES(0); #if EXTRUDERS > 1 - #define degHotend1() degHotend(1) - #define degTargetHotend1() degTargetHotend(1) - #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1) - #define isHeatingHotend1() isHeatingHotend(1) - #define isCoolingHotend1() isCoolingHotend(1) + HOTEND_ROUTINES(1); #else - #define setTargetHotend1(_celsius) do{}while(0) + #define setTargetHotend1(c) do{}while(0) #endif #if EXTRUDERS > 2 - #define degHotend2() degHotend(2) - #define degTargetHotend2() degTargetHotend(2) - #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2) - #define isHeatingHotend2() isHeatingHotend(2) - #define isCoolingHotend2() isCoolingHotend(2) + HOTEND_ROUTINES(2); #else - #define setTargetHotend2(_celsius) do{}while(0) + #define setTargetHotend2(c) do{}while(0) #endif #if EXTRUDERS > 3 - #define degHotend3() degHotend(3) - #define degTargetHotend3() degTargetHotend(3) - #define setTargetHotend3(_celsius) setTargetHotend((_celsius), 3) - #define isHeatingHotend3() isHeatingHotend(3) - #define isCoolingHotend3() isCoolingHotend(3) + HOTEND_ROUTINES(3); #else - #define setTargetHotend3(_celsius) do{}while(0) -#endif -#if EXTRUDERS > 4 - #error Invalid number of extruders + #define setTargetHotend3(c) do{}while(0) #endif int getHeaterPower(int heater); @@ -161,5 +148,4 @@ FORCE_INLINE void autotempShutdown() { #endif } - -#endif +#endif // TEMPERATURE_H From 23cd54755f1e4ec63d3507a990e3f37d59216729 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 2 Apr 2015 14:50:31 +0200 Subject: [PATCH 172/302] Fix typo in Marlin_main.cpp related to current_position[Z_AXIS] and retract_zlift. '+ =' -> '+=' Fix for #1786 --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b41be617..3eda50859 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1592,7 +1592,7 @@ void refresh_cmd_timeout(void) { previous_millis_cmd = millis(); } else { if (retract_zlift > 0.01) { - current_position[Z_AXIS] + =retract_zlift; + current_position[Z_AXIS] += retract_zlift; #ifdef DELTA sync_plan_position_delta(); #else From c756b4cf0798c35ee5b64c52cc0f3782cedbde44 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Apr 2015 06:11:03 -0700 Subject: [PATCH 173/302] Comment tweak --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 2442ad206..5a8da9406 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1027,7 +1027,7 @@ void setWatch() { } switch (*state) { - // Inactive state waits for a target temperature, then + // Inactive state waits for a target temperature to be set case TRInactive: if (target_temperature > 0) *state = TRFirstHeating; break; From 34c7d45879e20a0fd5d48c53ddf98f6ed342c1c5 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Fri, 6 Feb 2015 10:30:43 -0600 Subject: [PATCH 174/302] Hook for Auto-generated Build Version The automatic versioning system extracts a build version number from the SCM system That versioning information is written to the file _Version.h, a file that is NOT preserved in the SCM. If such a file will be present, we include it here to utilize the parameters that are defined therein. --- Marlin/language.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/language.h b/Marlin/language.h index 10ef445d8..690b0b11d 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -36,6 +36,10 @@ #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) #endif +#ifdef HAS_AUTOMATIC_VERSIONING + #include "_Version.h" +#endif + #define PROTOCOL_VERSION "1.0" #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" From a33e20b27d32b816e5fbad9877e6879bfa185cb2 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Fri, 6 Feb 2015 09:58:04 -0600 Subject: [PATCH 175/302] Adjust per-project .gitignore Refer to http://git-scm.com/docs/gitignore to see why this is appropriate --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index cd72efb10..380a02850 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ +// Our automatic versioning scheme generates the following file +// NEVER put it in the repository +_Version.h + +// All of the following OS, IDE and compiler generated file +// references should be moved from this file +// They are needed, but they belong in your global .gitignore +// rather than in a per-project file such as this + *.o applet/ *~ From f4599143ebdaf05d12528e1fedaf3e51f413c274 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Fri, 6 Feb 2015 10:17:17 -0600 Subject: [PATCH 176/302] Allow M115 to better reflect the build --- Marlin/language.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Marlin/language.h b/Marlin/language.h index 690b0b11d..77c4f36d4 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -41,7 +41,6 @@ #endif #define PROTOCOL_VERSION "1.0" -#define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) #undef FIRMWARE_URL @@ -69,13 +68,28 @@ #define MACHINE_NAME "HEPHESTOS" #undef FIRMWARE_URL #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" -#else // Default firmware set to Mendel - #define MACHINE_NAME "Mendel" +#else + #ifndef MACHINE_NAME + #define MACHINE_NAME "Mendel" + #endif #endif #ifdef CUSTOM_MENDEL_NAME + #warning CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME + #define CUSTOM_MACHINE_NAME CUSTOM_MENDEL_NAME +#endif + +#ifdef CUSTOM_MACHINE_NAME #undef MACHINE_NAME - #define MACHINE_NAME CUSTOM_MENDEL_NAME + #define MACHINE_NAME CUSTOM_MACHINE_NAME +#endif + +#ifndef FIRMWARE_URL + #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" +#endif + +#ifndef BUILD_VERSION + #define BUILD_VERSION "V1; Sprinter/grbl mashup for gen6" #endif #ifndef MACHINE_UUID @@ -126,7 +140,7 @@ #define MSG_HEATING_COMPLETE "Heating done." #define MSG_BED_HEATING "Bed Heating." #define MSG_BED_DONE "Bed done." -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n" +#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n" #define MSG_COUNT_X " Count X: " #define MSG_ERR_KILLED "Printer halted. kill() called!" #define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" From ccdaea51babd46fca1351affdaa8168438731fc7 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Thu, 2 Apr 2015 08:15:55 -0500 Subject: [PATCH 177/302] Add KosselPro --- Marlin/boards.h | 1 + Marlin/language.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Marlin/boards.h b/Marlin/boards.h index a8c980097..8a60f011d 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -37,6 +37,7 @@ #define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646) #define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286) #define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make +#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286) #define BOARD_GEN3_PLUS 9 // Gen3+ #define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics #define BOARD_MEGATRONICS 70 // Megatronics diff --git a/Marlin/language.h b/Marlin/language.h index 77c4f36d4..5b7c22f45 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -68,6 +68,11 @@ #define MACHINE_NAME "HEPHESTOS" #undef FIRMWARE_URL #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" +#elif MB(BRAINWAVE_PRO) + #define MACHINE_NAME "Kossel Pro" + #ifndef FIRMWARE_URL + #define FIRMWARE_URL "https://github.com/OpenBeamUSA/Marlin/" + #endif #else #ifndef MACHINE_NAME #define MACHINE_NAME "Mendel" From 8f620de0ff8e0bd07d86bd1937fb77a68b701fa1 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Wed, 11 Feb 2015 09:00:33 -0600 Subject: [PATCH 178/302] Actually activate Automatic Versioning --- .../Arduino_1.5.x/hardware/marlin/avr/platform.local.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/platform.local.txt diff --git a/ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/platform.local.txt b/ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/platform.local.txt new file mode 100644 index 000000000..ff2ad5d22 --- /dev/null +++ b/ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/platform.local.txt @@ -0,0 +1 @@ +compiler.cpp.extra_flags=-DHAS_AUTOMATIC_VERSIONING From 581b2aae043bd0c1c9e13d003739756e6305b001 Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Fri, 3 Apr 2015 16:11:32 +0200 Subject: [PATCH 179/302] fix feedrate for homing z max_feedrate is in mm/s. line_to_destination needs a feedrate in mm/min because there is feedrate/60. --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b41be617..daa78b40d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1950,7 +1950,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = 0; plan_set_position(cpx, cpy, 0, current_position[E_AXIS]); destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = max_feedrate[Z_AXIS]; + feedrate = max_feedrate[Z_AXIS] * 60; // max_feedrate is in mm/s. line_to_destination is feedrate/60. line_to_destination(); st_synchronize(); HOMEAXIS(Z); From 45565b680dce05481d4510c61e12c61b15a21457 Mon Sep 17 00:00:00 2001 From: Wurstnase Date: Fri, 3 Apr 2015 18:01:28 +0200 Subject: [PATCH 180/302] second wrong feedrate --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index daa78b40d..266812581 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1817,7 +1817,7 @@ inline void gcode_G28() { // Raise Z before homing any other axes if (home_all_axis || homeZ) { destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = max_feedrate[Z_AXIS]; + feedrate = max_feedrate[Z_AXIS] * 60; line_to_destination(); st_synchronize(); } From 0e8182bbf2f0ac2c3340b7d89e6b77fa2f55f292 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 15:31:35 -0700 Subject: [PATCH 181/302] Additional pin tests, cleanup --- Marlin/Conditionals.h | 93 +- Marlin/Configuration.h | 4 +- Marlin/ConfigurationStore.cpp | 4 +- Marlin/Configuration_adv.h | 6 +- Marlin/Marlin.h | 18 +- Marlin/Marlin_main.cpp | 802 +++++++++--------- Marlin/SanityCheck.h | 24 +- Marlin/configurator/config/Configuration.h | 2 +- .../configurator/config/Configuration_adv.h | 6 +- Marlin/dogm_lcd_implementation.h | 2 +- .../Felix/Configuration.h | 2 +- .../Felix/Configuration_DUAL.h | 2 +- .../Felix/Configuration_adv.h | 6 +- .../Hephestos/Configuration.h | 2 +- .../Hephestos/Configuration_adv.h | 6 +- .../K8200/Configuration.h | 2 +- .../K8200/Configuration_adv.h | 6 +- .../SCARA/Configuration.h | 2 +- .../SCARA/Configuration_adv.h | 6 +- .../WITBOX/Configuration.h | 2 +- .../WITBOX/Configuration_adv.h | 6 +- .../delta/generic/Configuration.h | 10 +- .../delta/generic/Configuration_adv.h | 6 +- .../delta/kossel_mini/Configuration.h | 10 +- .../delta/kossel_mini/Configuration_adv.h | 6 +- .../makibox/Configuration.h | 2 +- .../makibox/Configuration_adv.h | 6 +- .../tvrrug/Round2/Configuration.h | 2 +- .../tvrrug/Round2/Configuration_adv.h | 6 +- Marlin/mesh_bed_leveling.h | 2 +- Marlin/planner.cpp | 10 +- Marlin/stepper.cpp | 116 +-- Marlin/temperature.h | 2 +- Marlin/ultralcd.h | 16 +- 34 files changed, 612 insertions(+), 585 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c7e208472..1093e7081 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -10,6 +10,8 @@ #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first + #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0) + #define CONFIGURATION_LCD #if defined(MAKRPANEL) @@ -276,7 +278,7 @@ #define PS_ON_AWAKE HIGH #define PS_ON_ASLEEP LOW #endif - #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0) + #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON)) /** * Temp Sensor defines @@ -347,25 +349,80 @@ #endif /** - * Shorthand for pin tests, for temperature.cpp + * Shorthand for pin tests, used wherever needed */ - #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0 && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2) - #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0 && TEMP_SENSOR_1 != 0) - #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0 && TEMP_SENSOR_2 != 0) - #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0 && TEMP_SENSOR_3 != 0) - #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0 && TEMP_SENSOR_BED != 0) - #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0) - #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0) - #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0) - #define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0) - #define HAS_HEATER_3 (defined(HEATER_3_PIN) && HEATER_3_PIN >= 0) - #define HAS_HEATER_BED (defined(HEATER_BED_PIN) && HEATER_BED_PIN >= 0) - #define HAS_AUTO_FAN_0 (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN >= 0) - #define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0) - #define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0) - #define HAS_AUTO_FAN_3 (defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN >= 0) + #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2) + #define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0) + #define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0) + #define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0) + #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0) + #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) + #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) + #define HAS_HEATER_2 (PIN_EXISTS(HEATER_2)) + #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3)) + #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) + #define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN)) + #define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN)) + #define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN)) + #define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN)) #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3) - #define HAS_FAN (defined(FAN_PIN) && FAN_PIN >= 0) + #define HAS_FAN (PIN_EXISTS(FAN)) + #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN)) + #define HAS_SERVO_0 (PIN_EXISTS(SERVO0)) + #define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) + #define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) + #define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) + #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH)) + #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT)) + #define HAS_HOME (PIN_EXISTS(HOME)) + #define HAS_KILL (PIN_EXISTS(KILL)) + #define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) + #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH)) + #define HAS_X_MIN (PIN_EXISTS(X_MIN)) + #define HAS_X_MAX (PIN_EXISTS(X_MAX)) + #define HAS_Y_MIN (PIN_EXISTS(Y_MIN)) + #define HAS_Y_MAX (PIN_EXISTS(Y_MAX)) + #define HAS_Z_MIN (PIN_EXISTS(Z_MIN)) + #define HAS_Z_MAX (PIN_EXISTS(Z_MAX)) + #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) + #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) + #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) + #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) + #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) + #define HAS_MICROSTEPS (PIN_EXISTS(X_MS1)) + #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1)) + #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1)) + #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1)) + #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) + #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) + #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) + #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) + #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) + #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) + #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) + #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) + #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) + #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) + #define HAS_X_DIR (PIN_EXISTS(X_DIR)) + #define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) + #define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) + #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) + #define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) + #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) + #define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) + #define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) + #define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) + #define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) + #define HAS_X_STEP (PIN_EXISTS(X_STEP)) + #define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) + #define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) + #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) + #define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) + #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) + #define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) + #define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) + #define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) + #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) /** * Helper Macros for heaters and extruder fan diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a984923ea..748a3914c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -387,7 +387,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -670,7 +670,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ // #define PHOTOGRAPH_PIN 23 -// SF send wrong arc g-codes when using Arc Point as fillet procedure +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure //#define SF_ARC_FIX // Support for the BariCUDA Paste Extruder. diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index b1da94a30..f82e83fc4 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -78,7 +78,7 @@ #include "ultralcd.h" #include "ConfigurationStore.h" -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #include "mesh_bed_leveling.h" #endif // MESH_BED_LEVELING @@ -308,7 +308,7 @@ void Config_RetrieveSettings() { uint8_t mesh_num_x = 0; uint8_t mesh_num_y = 0; - #if defined(MESH_BED_LEVELING) + #ifdef MESH_BED_LEVELING EEPROM_READ_VAR(i, mbl.active); EEPROM_READ_VAR(i, mesh_num_x); EEPROM_READ_VAR(i, mesh_num_y); diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d689ac47f..4ed188946 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 2 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index e0441714b..1f295a65a 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -110,11 +110,10 @@ void process_commands(); void manage_inactivity(bool ignore_stepper_queue=false); -#if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \ - && defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1 +#if defined(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE #define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0) #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0) -#elif defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 +#elif HAS_X_ENABLE #define enable_x() X_ENABLE_WRITE( X_ENABLE_ON) #define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } #else @@ -122,7 +121,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_x() ; #endif -#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1 +#if HAS_Y_ENABLE #ifdef Y_DUAL_STEPPER_DRIVERS #define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); } #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; } @@ -135,7 +134,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_y() ; #endif -#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 +#if HAS_Z_ENABLE #ifdef Z_DUAL_STEPPER_DRIVERS #define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); } #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } @@ -148,7 +147,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_z() ; #endif -#if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) +#if HAS_E0_ENABLE #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON) #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) #else @@ -156,7 +155,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_e0() /* nothing */ #endif -#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1) +#if (EXTRUDERS > 1) && HAS_E1_ENABLE #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON) #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) #else @@ -164,7 +163,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_e1() /* nothing */ #endif -#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1) +#if (EXTRUDERS > 2) && HAS_E2_ENABLE #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON) #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) #else @@ -172,7 +171,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_e2() /* nothing */ #endif -#if (EXTRUDERS > 3) && defined(E3_ENABLE_PIN) && (E3_ENABLE_PIN > -1) +#if (EXTRUDERS > 3) && HAS_E3_ENABLE #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON) #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) #else @@ -194,7 +193,6 @@ void get_coordinates(); void adjust_delta(float cartesian[3]); #endif extern float delta[3]; - void prepare_move_raw(); #endif #ifdef SCARA void calculate_delta(float cartesian[3]); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b41be617..13484c986 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -36,11 +36,11 @@ #endif #endif // ENABLE_AUTO_BED_LEVELING -#define SERVO_LEVELING defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0 +#define SERVO_LEVELING (defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0) -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #include "mesh_bed_leveling.h" -#endif // MESH_BED_LEVELING +#endif #include "ultralcd.h" #include "planner.h" @@ -298,6 +298,7 @@ int fanSpeed = 0; float delta_diagonal_rod_2 = sq(delta_diagonal_rod); float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; #ifdef ENABLE_AUTO_BED_LEVELING + int delta_grid_spacing[2] = { 0, 0 }; float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; #endif #endif @@ -422,26 +423,24 @@ void serial_echopair_P(const char *s_P, unsigned long v) //Injects the next command from the pending sequence of commands, when possible //Return false if and only if no command was pending -static bool drain_queued_commands_P() -{ - char cmd[30]; - if(!queued_commands_P) - return false; +static bool drain_queued_commands_P() { + if (!queued_commands_P) return false; + // Get the next 30 chars from the sequence of gcodes to run - strncpy_P(cmd, queued_commands_P, sizeof(cmd)-1); - cmd[sizeof(cmd)-1]= 0; + char cmd[30]; + strncpy_P(cmd, queued_commands_P, sizeof(cmd) - 1); + cmd[sizeof(cmd) - 1] = '\0'; + // Look for the end of line, or the end of sequence - size_t i= 0; + size_t i = 0; char c; - while( (c= cmd[i]) && c!='\n' ) - ++i; // look for the end of this gcode command - cmd[i]= 0; - if(enquecommand(cmd)) // buffer was not full (else we will retry later) - { - if(c) - queued_commands_P+= i+1; // move to next command + while((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command + cmd[i] = '\0'; + if (enquecommand(cmd)) { // buffer was not full (else we will retry later) + if (c) + queued_commands_P += i + 1; // move to next command else - queued_commands_P= NULL; // will have no more commands in the sequence + queued_commands_P = NULL; // will have no more commands in the sequence } return true; } @@ -449,10 +448,9 @@ static bool drain_queued_commands_P() //Record one or many commands to run from program memory. //Aborts the current queue, if any. //Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards -void enquecommands_P(const char* pgcode) -{ - queued_commands_P= pgcode; - drain_queued_commands_P(); // first command exectuted asap (when possible) +void enquecommands_P(const char* pgcode) { + queued_commands_P = pgcode; + drain_queued_commands_P(); // first command executed asap (when possible) } //adds a single command to the main command buffer, from RAM @@ -478,42 +476,42 @@ bool enquecommand(const char *cmd) void setup_killpin() { - #if defined(KILL_PIN) && KILL_PIN > -1 + #if HAS_KILL SET_INPUT(KILL_PIN); - WRITE(KILL_PIN,HIGH); + WRITE(KILL_PIN, HIGH); #endif } void setup_filrunoutpin() { -#if defined(FILRUNOUT_PIN) && FILRUNOUT_PIN > -1 - pinMode(FILRUNOUT_PIN,INPUT); - #if defined(ENDSTOPPULLUP_FIL_RUNOUT) - WRITE(FILLRUNOUT_PIN,HIGH); - #endif -#endif + #if HAS_FILRUNOUT + pinMode(FILRUNOUT_PIN, INPUT); + #ifdef ENDSTOPPULLUP_FIL_RUNOUT + WRITE(FILLRUNOUT_PIN, HIGH); + #endif + #endif } // Set home pin void setup_homepin(void) { -#if defined(HOME_PIN) && HOME_PIN > -1 - SET_INPUT(HOME_PIN); - WRITE(HOME_PIN,HIGH); -#endif + #if HAS_HOME + SET_INPUT(HOME_PIN); + WRITE(HOME_PIN, HIGH); + #endif } void setup_photpin() { - #if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 + #if HAS_PHOTOGRAPH OUT_WRITE(PHOTOGRAPH_PIN, LOW); #endif } void setup_powerhold() { - #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + #if HAS_SUICIDE OUT_WRITE(SUICIDE_PIN, HIGH); #endif #if HAS_POWER_SWITCH @@ -527,37 +525,31 @@ void setup_powerhold() void suicide() { - #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + #if HAS_SUICIDE OUT_WRITE(SUICIDE_PIN, LOW); #endif } void servo_init() { - #if (NUM_SERVOS >= 1) && defined(SERVO0_PIN) && (SERVO0_PIN > -1) + #if NUM_SERVOS >= 1 && HAS_SERVO_0 servos[0].attach(SERVO0_PIN); #endif - #if (NUM_SERVOS >= 2) && defined(SERVO1_PIN) && (SERVO1_PIN > -1) + #if NUM_SERVOS >= 2 && HAS_SERVO_1 servos[1].attach(SERVO1_PIN); #endif - #if (NUM_SERVOS >= 3) && defined(SERVO2_PIN) && (SERVO2_PIN > -1) + #if NUM_SERVOS >= 3 && HAS_SERVO_2 servos[2].attach(SERVO2_PIN); #endif - #if (NUM_SERVOS >= 4) && defined(SERVO3_PIN) && (SERVO3_PIN > -1) + #if NUM_SERVOS >= 4 && HAS_SERVO_3 servos[3].attach(SERVO3_PIN); #endif - #if (NUM_SERVOS >= 5) - #error "TODO: enter initalisation code for more servos" - #endif // Set position of Servo Endstops that are defined #ifdef SERVO_ENDSTOPS - for(int8_t i = 0; i < 3; i++) - { - if(servo_endstops[i] > -1) { + for (int i = 0; i < 3; i++) + if (servo_endstops[i] >= 0) servos[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]); - } - } #endif #if SERVO_LEVELING @@ -624,7 +616,7 @@ void setup() lcd_init(); _delay_ms(1000); // wait 1sec to display the splash screen - #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 + #if HAS_CONTROLLERFAN SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan #endif @@ -648,47 +640,37 @@ void setup() } -void loop() -{ - if(buflen < (BUFSIZE-1)) - get_command(); +void loop() { + if (buflen < BUFSIZE - 1) get_command(); + #ifdef SDSUPPORT - card.checkautostart(false); + card.checkautostart(false); #endif - if(buflen) - { + + if (buflen) { #ifdef SDSUPPORT - if(card.saving) - { - if(strstr_P(cmdbuffer[bufindr], PSTR("M29")) == NULL) - { + if (card.saving) { + if (strstr_P(cmdbuffer[bufindr], PSTR("M29")) == NULL) { card.write_command(cmdbuffer[bufindr]); - if(card.logging) - { + if (card.logging) process_commands(); - } else - { SERIAL_PROTOCOLLNPGM(MSG_OK); - } } - else - { + else { card.closefile(); SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED); } } else - { process_commands(); - } #else process_commands(); - #endif //SDSUPPORT - buflen = (buflen-1); - bufindr = (bufindr + 1)%BUFSIZE; + #endif // SDSUPPORT + buflen--; + bufindr = (bufindr + 1) % BUFSIZE; } - //check heater every n milliseconds + // Check heater every n milliseconds manage_heater(); manage_inactivity(); checkHitEndstops(); @@ -697,7 +679,7 @@ void loop() void get_command() { - if(drain_queued_commands_P()) // priority is given to non-serial commands + if (drain_queued_commands_P()) // priority is given to non-serial commands return; while( MYSERIAL.available() > 0 && buflen < BUFSIZE) { @@ -916,7 +898,7 @@ XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); -XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM); +XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); #ifdef DUAL_X_CARRIAGE @@ -1019,6 +1001,8 @@ static void axis_is_at_home(int axis) { #endif } +inline void refresh_cmd_timeout() { previous_millis_cmd = millis(); } + /** * Some planner shorthand inline functions */ @@ -1043,6 +1027,18 @@ inline void sync_plan_position() { #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef DELTA + /** + * Calculate delta, start a line, and set current_position to destination + */ + void prepare_move_raw() { + refresh_cmd_timeout(); + calculate_delta(destination); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + for (int i = 0; i < NUM_AXIS; i++) current_position[i] = destination[i]; + } + #endif + #ifdef AUTO_BED_LEVELING_GRID #ifndef DELTA @@ -1132,7 +1128,7 @@ inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]); // move up the retract distance - zPosition += home_retract_mm(Z_AXIS); + zPosition += home_bump_mm(Z_AXIS); line_to_z(zPosition); st_synchronize(); endstops_hit_on_purpose(); // clear endstop hit flags @@ -1145,7 +1141,7 @@ inline void sync_plan_position() { SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); } - zPosition -= home_retract_mm(Z_AXIS) * 2; + zPosition -= home_bump_mm(Z_AXIS) * 2; line_to_z(zPosition); st_synchronize(); endstops_hit_on_purpose(); // clear endstop hit flags @@ -1157,6 +1153,9 @@ inline void sync_plan_position() { #endif // !DELTA } + /** + * + */ static void do_blocking_move_to(float x, float y, float z) { float oldFeedRate = feedrate; @@ -1194,7 +1193,7 @@ inline void sync_plan_position() { saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; feedmultiply = 100; - previous_millis_cmd = millis(); + refresh_cmd_timeout(); enable_endstops(true); } @@ -1204,10 +1203,10 @@ inline void sync_plan_position() { #endif feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; - previous_millis_cmd = millis(); + refresh_cmd_timeout(); } - static void engage_z_probe() { + static void deploy_z_probe() { #ifdef SERVO_ENDSTOPS @@ -1259,7 +1258,7 @@ inline void sync_plan_position() { } - static void retract_z_probe() { + static void stow_z_probe() { #ifdef SERVO_ENDSTOPS @@ -1291,19 +1290,19 @@ inline void sync_plan_position() { prepare_move_raw(); // Move to the start position to initiate retraction - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Z; + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Z; prepare_move_raw(); // Move the nozzle down to push the probe into retracted position feedrate = homing_feedrate[Z_AXIS]/10; - destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH; + destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_STOW_DEPTH; prepare_move_raw(); // Move up for safety feedrate = homing_feedrate[Z_AXIS]/2; - destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2; + destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_STOW_DEPTH * 2; prepare_move_raw(); // Home XY for safety @@ -1342,7 +1341,7 @@ inline void sync_plan_position() { do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeEngage) engage_z_probe(); + if (retract_action & ProbeEngage) deploy_z_probe(); #endif run_z_probe(); @@ -1356,7 +1355,7 @@ inline void sync_plan_position() { #endif #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) retract_z_probe(); + if (retract_action & ProbeRetract) stow_z_probe(); #endif if (verbose_level > 2) { @@ -1460,10 +1459,10 @@ static void homeaxis(int axis) { sync_plan_position(); // Engage Servo endstop if enabled - #ifdef SERVO_ENDSTOPS && !defined(Z_PROBE_SLED) + #if defined(SERVO_ENDSTOPS) && !defined(Z_PROBE_SLED) #if SERVO_LEVELING - if (axis == Z_AXIS) engage_z_probe(); else + if (axis == Z_AXIS) deploy_z_probe(); else #endif { if (servo_endstops[axis] > -1) @@ -1486,8 +1485,8 @@ static void homeaxis(int axis) { current_position[axis] = 0; sync_plan_position(); - // Move away from the endstop by the axis HOME_RETRACT_MM - destination[axis] = -home_retract_mm(axis) * axis_home_dir; + // Move away from the endstop by the axis HOME_BUMP_MM + destination[axis] = -home_bump_mm(axis) * axis_home_dir; line_to_destination(); st_synchronize(); @@ -1500,7 +1499,7 @@ static void homeaxis(int axis) { } // Move slowly towards the endstop until triggered - destination[axis] = 2 * home_retract_mm(axis) * axis_home_dir; + destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir; line_to_destination(); st_synchronize(); @@ -1554,14 +1553,12 @@ static void homeaxis(int axis) { #endif #if SERVO_LEVELING && !defined(Z_PROBE_SLED) - if (axis == Z_AXIS) retract_z_probe(); + if (axis == Z_AXIS) stow_z_probe(); #endif } } -void refresh_cmd_timeout(void) { previous_millis_cmd = millis(); } - #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { @@ -1701,9 +1698,9 @@ inline void gcode_G4() { if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait st_synchronize(); - previous_millis_cmd = millis(); + refresh_cmd_timeout(); codenum += previous_millis_cmd; // keep track of when we started waiting - while(millis() < codenum) { + while (millis() < codenum) { manage_heater(); manage_inactivity(); lcd_update(); @@ -1753,14 +1750,17 @@ inline void gcode_G4() { * Zn Home Z, setting Z to n + home_offset[Z_AXIS] */ inline void gcode_G28() { + + // For auto bed leveling, clear the level matrix #ifdef ENABLE_AUTO_BED_LEVELING - plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) + plan_bed_level_matrix.set_to_identity(); #ifdef DELTA reset_bed_level(); #endif #endif - #if defined(MESH_BED_LEVELING) + // For manual bed leveling deactivate the matrix temporarily + #ifdef MESH_BED_LEVELING uint8_t mbl_was_active = mbl.active; mbl.active = 0; #endif @@ -1768,7 +1768,7 @@ inline void gcode_G28() { saved_feedrate = feedrate; saved_feedmultiply = feedmultiply; feedmultiply = 100; - previous_millis_cmd = millis(); + refresh_cmd_timeout(); enable_endstops(true); @@ -1780,10 +1780,11 @@ inline void gcode_G28() { // A delta can only safely home all axis at the same time // all axis have to home at the same time - // Move all carriages up together until the first endstop is hit. + // Pretend the current position is 0,0,0 for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = 0; sync_plan_position(); + // Move all carriages up together until the first endstop is hit. for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH; feedrate = 1.732 * homing_feedrate[X_AXIS]; line_to_destination(); @@ -1994,14 +1995,12 @@ inline void gcode_G28() { enable_endstops(false); #endif - #if defined(MESH_BED_LEVELING) + // For manual leveling move back to 0,0 + #ifdef MESH_BED_LEVELING if (mbl_was_active) { current_position[X_AXIS] = mbl.get_x(0); current_position[Y_AXIS] = mbl.get_y(0); - destination[X_AXIS] = current_position[X_AXIS]; - destination[Y_AXIS] = current_position[Y_AXIS]; - destination[Z_AXIS] = current_position[Z_AXIS]; - destination[E_AXIS] = current_position[E_AXIS]; + for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; feedrate = homing_feedrate[X_AXIS]; line_to_destination(); st_synchronize(); @@ -2013,25 +2012,14 @@ inline void gcode_G28() { feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; - previous_millis_cmd = millis(); + refresh_cmd_timeout(); endstops_hit_on_purpose(); // clear endstop hit flags } -#if defined(MESH_BED_LEVELING) || defined(ENABLE_AUTO_BED_LEVELING) - - // Check for known positions in X and Y - inline bool can_run_bed_leveling() { - if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) return true; - LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); - return false; - } - -#endif // MESH_BED_LEVELING || ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING + enum MeshLevelingState { MeshReport, MeshStart, MeshNext }; + /** * G29: Mesh-based Z-Probe, probes a grid and produces a * mesh to compensate for variable bed height @@ -2045,81 +2033,82 @@ inline void gcode_G28() { */ inline void gcode_G29() { - // Prevent leveling without first homing in X and Y - if (!can_run_bed_leveling()) return; - static int probe_point = -1; - int state = 0; - if (code_seen('S') || code_seen('s')) { - state = code_value_long(); - if (state < 0 || state > 2) { - SERIAL_PROTOCOLPGM("S out of range (0-2).\n"); - return; - } + MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_long() : MeshReport; + if (state < 0 || state > 2) { + SERIAL_PROTOCOLLNPGM("S out of range (0-2)."); + return; } - if (state == 0) { // Dump mesh_bed_leveling - if (mbl.active) { - SERIAL_PROTOCOLPGM("Num X,Y: "); - SERIAL_PROTOCOL(MESH_NUM_X_POINTS); - SERIAL_PROTOCOLPGM(","); - SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); - SERIAL_PROTOCOLPGM("\nZ search height: "); - SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z); - SERIAL_PROTOCOLPGM("\nMeasured points:\n"); - for (int y=0; y 4) { - SERIAL_PROTOCOLPGM("?(V)erbose Level is implausible (0-4).\n"); - return; - } + // Don't allow auto-leveling without homing first + if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { + LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); + return; } - bool dryrun = code_seen('D') || code_seen('d'); - bool engage_probe_for_each_reading = code_seen('E') || code_seen('e'); + int verbose_level = code_seen('V') || code_seen('v') ? code_value_long() : 1; + if (verbose_level < 0 || verbose_level > 4) { + SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4)."); + return; + } + + bool dryrun = code_seen('D') || code_seen('d'), + engage_probe_for_each_reading = code_seen('E') || code_seen('e'); #ifdef AUTO_BED_LEVELING_GRID @@ -2188,7 +2178,7 @@ inline void gcode_G28() { if (verbose_level > 0) { SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); - if (dryrun) SERIAL_ECHOLN("Running in DRY-RUN mode"); + if (dryrun) SERIAL_ECHOLNPGM("Running in DRY-RUN mode"); } int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; @@ -2241,7 +2231,7 @@ inline void gcode_G28() { #ifdef Z_PROBE_SLED dock_sled(false); // engage (un-dock) the probe #elif defined(Z_PROBE_ALLEN_KEY) //|| defined(SERVO_LEVELING) - engage_z_probe(); + deploy_z_probe(); #endif st_synchronize(); @@ -2464,7 +2454,7 @@ inline void gcode_G28() { #ifdef Z_PROBE_SLED dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel #elif defined(Z_PROBE_ALLEN_KEY) //|| defined(SERVO_LEVELING) - retract_z_probe(); + stow_z_probe(); #endif #ifdef Z_PROBE_END_SCRIPT @@ -2476,7 +2466,7 @@ inline void gcode_G28() { #ifndef Z_PROBE_SLED inline void gcode_G30() { - engage_z_probe(); // Engage Z Servo endstop if available + deploy_z_probe(); // Engage Z Servo endstop if available st_synchronize(); // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly setup_for_endstop_move(); @@ -2494,7 +2484,7 @@ inline void gcode_G28() { SERIAL_EOL; clean_up_after_endstop_move(); - retract_z_probe(); // Retract Z Servo endstop if available + stow_z_probe(); // Retract Z Servo endstop if available } #endif //!Z_PROBE_SLED @@ -2554,7 +2544,7 @@ inline void gcode_G92() { lcd_ignore_click(); st_synchronize(); - previous_millis_cmd = millis(); + refresh_cmd_timeout(); if (codenum > 0) { codenum += previous_millis_cmd; // keep track of when we started waiting while(millis() < codenum && !lcd_clicked()) { @@ -2781,7 +2771,7 @@ inline void gcode_M42() { } } - #if defined(FAN_PIN) && FAN_PIN > -1 + #if HAS_FAN if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif @@ -2915,7 +2905,7 @@ inline void gcode_M42() { // Then retrace the right amount and use that in subsequent probes // - engage_z_probe(); + deploy_z_probe(); setup_for_endstop_move(); run_z_probe(); @@ -2930,7 +2920,7 @@ inline void gcode_M42() { st_synchronize(); current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS); - if (engage_probe_for_each_reading) retract_z_probe(); + if (engage_probe_for_each_reading) stow_z_probe(); for (uint16_t n=0; n < n_samples; n++) { @@ -2973,7 +2963,7 @@ inline void gcode_M42() { } // n_legs if (engage_probe_for_each_reading) { - engage_z_probe(); + deploy_z_probe(); delay(1000); } @@ -3020,13 +3010,13 @@ inline void gcode_M42() { st_synchronize(); if (engage_probe_for_each_reading) { - retract_z_probe(); + stow_z_probe(); delay(1000); } } if (!engage_probe_for_each_reading) { - retract_z_probe(); + stow_z_probe(); delay(1000); } @@ -3067,17 +3057,17 @@ inline void gcode_M104() { inline void gcode_M105() { if (setTargetedHotend(105)) return; - #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 + #if HAS_TEMP_0 SERIAL_PROTOCOLPGM("ok T:"); SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1); - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetBed(),1); - #endif //TEMP_BED_PIN + #endif // HAS_TEMP_BED for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(cur_extruder); @@ -3086,7 +3076,7 @@ inline void gcode_M105() { SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1); } - #else + #else // !HAS_TEMP_0 SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS); #endif @@ -3108,7 +3098,7 @@ inline void gcode_M105() { #endif #ifdef SHOW_TEMP_ADC_VALUES - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" ADC B:"); SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM("C->"); @@ -3127,7 +3117,7 @@ inline void gcode_M105() { SERIAL_PROTOCOLLN(""); } -#if defined(FAN_PIN) && FAN_PIN > -1 +#if HAS_FAN /** * M106: Set Fan Speed @@ -3220,10 +3210,11 @@ inline void gcode_M109() { } LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); - starttime = previous_millis_cmd = millis(); + refresh_cmd_timeout(); + starttime = previous_millis_cmd; } -#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 +#if HAS_TEMP_BED /** * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating @@ -3258,10 +3249,10 @@ inline void gcode_M109() { lcd_update(); } LCD_MESSAGEPGM(MSG_BED_DONE); - previous_millis_cmd = millis(); + refresh_cmd_timeout(); } -#endif // TEMP_BED_PIN > -1 +#endif // HAS_TEMP_BED /** * M112: Emergency Stop @@ -3272,7 +3263,7 @@ inline void gcode_M112() { #ifdef BARICUDA - #if defined(HEATER_1_PIN) && HEATER_1_PIN > -1 + #if HAS_HEATER_1 /** * M126: Heater 1 valve open */ @@ -3283,7 +3274,7 @@ inline void gcode_M112() { inline void gcode_M127() { ValvePressure = 0; } #endif - #if defined(HEATER_2_PIN) && HEATER_2_PIN > -1 + #if HAS_HEATER_2 /** * M128: Heater 2 valve open */ @@ -3314,7 +3305,7 @@ inline void gcode_M140() { // If you have a switch on suicide pin, this is useful // if you want to start another print with suicide feature after // a print without suicide... - #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + #if HAS_SUICIDE OUT_WRITE(SUICIDE_PIN, HIGH); #endif @@ -3342,7 +3333,7 @@ inline void gcode_M81() { finishAndDisableSteppers(); fanSpeed = 0; delay(1000); // Wait 1 second before switching off - #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 + #if HAS_SUICIDE st_synchronize(); suicide(); #elif HAS_POWER_SWITCH @@ -3498,31 +3489,31 @@ inline void gcode_M117() { */ inline void gcode_M119() { SERIAL_PROTOCOLLN(MSG_M119_REPORT); - #if defined(X_MIN_PIN) && X_MIN_PIN > -1 + #if HAS_X_MIN SERIAL_PROTOCOLPGM(MSG_X_MIN); SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(X_MAX_PIN) && X_MAX_PIN > -1 + #if HAS_X_MAX SERIAL_PROTOCOLPGM(MSG_X_MAX); SERIAL_PROTOCOLLN(((READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 + #if HAS_Y_MIN SERIAL_PROTOCOLPGM(MSG_Y_MIN); SERIAL_PROTOCOLLN(((READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 + #if HAS_Y_MAX SERIAL_PROTOCOLPGM(MSG_Y_MAX); SERIAL_PROTOCOLLN(((READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 + #if HAS_Z_MIN SERIAL_PROTOCOLPGM(MSG_Z_MIN); SERIAL_PROTOCOLLN(((READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 + #if HAS_Z_MAX SERIAL_PROTOCOLPGM(MSG_Z_MAX); SERIAL_PROTOCOLLN(((READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1 + #if HAS_Z2_MAX SERIAL_PROTOCOLPGM(MSG_Z2_MAX); SERIAL_PROTOCOLLN(((READ(Z2_MAX_PIN)^Z2_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif @@ -4013,7 +4004,7 @@ inline void gcode_M226() { #endif // PIDTEMPBED -#if defined(CHDK) || (defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1) +#if defined(CHDK) || HAS_PHOTOGRAPH /** * M240: Trigger a camera by emulating a Canon RC-1 @@ -4026,7 +4017,7 @@ inline void gcode_M226() { chdkHigh = millis(); chdkActive = true; - #elif defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 + #elif HAS_PHOTOGRAPH const uint8_t NUM_PULSES = 16; const float PULSE_LENGTH = 0.01524; @@ -4044,7 +4035,7 @@ inline void gcode_M226() { _delay_ms(PULSE_LENGTH); } - #endif // !CHDK && PHOTOGRAPH_PIN > -1 + #endif // !CHDK && HAS_PHOTOGRAPH } #endif // CHDK || PHOTOGRAPH_PIN @@ -4165,17 +4156,17 @@ inline void gcode_M303() { case 0: OUT_WRITE(SOL0_PIN, HIGH); break; - #if defined(SOL1_PIN) && SOL1_PIN > -1 + #if HAS_SOLENOID_1 case 1: OUT_WRITE(SOL1_PIN, HIGH); break; #endif - #if defined(SOL2_PIN) && SOL2_PIN > -1 + #if HAS_SOLENOID_2 case 2: OUT_WRITE(SOL2_PIN, HIGH); break; #endif - #if defined(SOL3_PIN) && SOL3_PIN > -1 + #if HAS_SOLENOID_3 case 3: OUT_WRITE(SOL3_PIN, HIGH); break; @@ -4218,11 +4209,11 @@ inline void gcode_M400() { st_synchronize(); } /** * M401: Engage Z Servo endstop if available */ - inline void gcode_M401() { engage_z_probe(); } + inline void gcode_M401() { deploy_z_probe(); } /** * M402: Retract Z Servo endstop if enabled */ - inline void gcode_M402() { retract_z_probe(); } + inline void gcode_M402() { stow_z_probe(); } #endif @@ -4232,7 +4223,7 @@ inline void gcode_M400() { st_synchronize(); } * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0> */ inline void gcode_M404() { - #if FILWIDTH_PIN > -1 + #if HAS_FILWIDTH if (code_seen('W')) { filament_width_nominal = code_value(); } @@ -4555,22 +4546,21 @@ inline void gcode_M907() { #endif // HAS_DIGIPOTSS -// M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. -inline void gcode_M350() { - #if defined(X_MS1_PIN) && X_MS1_PIN > -1 +#if HAS_MICROSTEPS + + // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + inline void gcode_M350() { if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value()); for(int i=0;i -1 + /** + * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B + * S# determines MS1 or MS2, X# sets the pin high/low. + */ + inline void gcode_M351() { if (code_seen('S')) switch(code_value_long()) { case 1: for(int i=0;i -1 + #if HAS_TEMP_BED case 190: // M190 - Wait for bed heater to reach target. gcode_M190(); break; - #endif //TEMP_BED_PIN + #endif // HAS_TEMP_BED - #if defined(FAN_PIN) && FAN_PIN > -1 + #if HAS_FAN case 106: //M106 Fan On gcode_M106(); break; case 107: //M107 Fan Off gcode_M107(); break; - #endif //FAN_PIN + #endif // HAS_FAN #ifdef BARICUDA // PWM for HEATER_1_PIN - #if defined(HEATER_1_PIN) && HEATER_1_PIN > -1 + #if HAS_HEATER_1 case 126: // M126 valve open gcode_M126(); break; case 127: // M127 valve closed gcode_M127(); break; - #endif //HEATER_1_PIN + #endif // HAS_HEATER_1 // PWM for HEATER_2_PIN - #if defined(HEATER_2_PIN) && HEATER_2_PIN > -1 + #if HAS_HEATER_2 case 128: // M128 valve open gcode_M128(); break; case 129: // M129 valve closed gcode_M129(); break; - #endif //HEATER_2_PIN - #endif //BARICUDA + #endif // HAS_HEATER_2 + #endif // BARICUDA #if HAS_POWER_SWITCH @@ -5035,7 +5027,7 @@ void process_commands() { break; #endif // PIDTEMPBED - #if defined(CHDK) || (defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1) + #if defined(CHDK) || HAS_PHOTOGRAPH case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ gcode_M240(); break; @@ -5153,13 +5145,17 @@ void process_commands() { break; #endif // HAS_DIGIPOTSS - case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - gcode_M350(); - break; + #if HAS_MICROSTEPS - case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. - gcode_M351(); - break; + case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + gcode_M350(); + break; + + case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. + gcode_M351(); + break; + + #endif // HAS_MICROSTEPS case 999: // M999: Restart after being Stopped gcode_M999(); @@ -5181,8 +5177,7 @@ void process_commands() { ClearToSend(); } -void FlushSerialRequestResend() -{ +void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); SERIAL_PROTOCOLPGM(MSG_RESEND); @@ -5190,13 +5185,11 @@ void FlushSerialRequestResend() ClearToSend(); } -void ClearToSend() -{ - previous_millis_cmd = millis(); +void ClearToSend() { + refresh_cmd_timeout(); #ifdef SDSUPPORT - if(fromsd[bufindr]) - return; - #endif //SDSUPPORT + if (fromsd[bufindr]) return; + #endif SERIAL_PROTOCOLLNPGM(MSG_OK); } @@ -5213,29 +5206,18 @@ void get_coordinates() { } } -void get_arc_coordinates() -{ -#ifdef SF_ARC_FIX - bool relative_mode_backup = relative_mode; - relative_mode = true; -#endif - get_coordinates(); -#ifdef SF_ARC_FIX - relative_mode=relative_mode_backup; -#endif +void get_arc_coordinates() { + #ifdef SF_ARC_FIX + bool relative_mode_backup = relative_mode; + relative_mode = true; + #endif + get_coordinates(); + #ifdef SF_ARC_FIX + relative_mode = relative_mode_backup; + #endif - if(code_seen('I')) { - offset[0] = code_value(); - } - else { - offset[0] = 0.0; - } - if(code_seen('J')) { - offset[1] = code_value(); - } - else { - offset[1] = 0.0; - } + offset[0] = code_seen('I') ? code_value() : 0; + offset[1] = code_seen('J') ? code_value() : 0; } void clamp_to_software_endstops(float target[3]) @@ -5299,7 +5281,6 @@ void clamp_to_software_endstops(float target[3]) #ifdef ENABLE_AUTO_BED_LEVELING // Adjust print surface height by linear interpolation over the bed_level array. - int delta_grid_spacing[2] = { 0, 0 }; void adjust_delta(float cartesian[3]) { if (delta_grid_spacing[0] == 0 || delta_grid_spacing[1] == 0) return; // G29 not done! @@ -5339,16 +5320,9 @@ void clamp_to_software_endstops(float target[3]) } #endif // ENABLE_AUTO_BED_LEVELING - void prepare_move_raw() { - previous_millis_cmd = millis(); - calculate_delta(destination); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); - for (int i = 0; i < NUM_AXIS; i++) current_position[i] = destination[i]; - } - #endif // DELTA -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #if !defined(MIN) #define MIN(_v1, _v2) (((_v1) < (_v2)) ? (_v1) : (_v2)) @@ -5427,7 +5401,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ void prepare_move() { clamp_to_software_endstops(destination); - previous_millis_cmd = millis(); + refresh_cmd_timeout(); #ifdef SCARA //for now same as delta-code @@ -5544,7 +5518,7 @@ void prepare_move() { if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { line_to_destination(); } else { -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); return; #else @@ -5570,16 +5544,10 @@ void prepare_arc_move(char isclockwise) { for(int8_t i=0; i < NUM_AXIS; i++) { current_position[i] = destination[i]; } - previous_millis_cmd = millis(); + refresh_cmd_timeout(); } -#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 - -#if defined(FAN_PIN) - #if CONTROLLERFAN_PIN == FAN_PIN - #error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN" - #endif -#endif +#if HAS_CONTROLLERFAN unsigned long lastMotor = 0; // Last time a motor was turned on unsigned long lastMotorCheck = 0; // Last time the state was checked @@ -5592,7 +5560,7 @@ void controllerFan() { || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled... #if EXTRUDERS > 1 || E1_ENABLE_READ == E_ENABLE_ON - #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1 + #if HAS_X2_ENABLE || X2_ENABLE_READ == X_ENABLE_ON #endif #if EXTRUDERS > 2 @@ -5704,7 +5672,7 @@ void handle_status_leds(void) { max_temp = max(max_temp, degHotend(cur_extruder)); max_temp = max(max_temp, degTargetHotend(cur_extruder)); } - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 + #if HAS_TEMP_BED max_temp = max(max_temp, degTargetBed()); max_temp = max(max_temp, degBed()); #endif @@ -5724,134 +5692,120 @@ void handle_status_leds(void) { } #endif -void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h -{ - -#if defined(KILL_PIN) && KILL_PIN > -1 - static int killCount = 0; // make the inactivity button a bit less responsive - const int KILL_DELAY = 750; -#endif +void disable_all_axes() { + disable_x(); + disable_y(); + disable_z(); + disable_e0(); + disable_e1(); + disable_e2(); + disable_e3(); +} -#if defined(FILRUNOUT_PIN) && FILRUNOUT_PIN > -1 - if(card.sdprinting) { - if(!(READ(FILRUNOUT_PIN))^FIL_RUNOUT_INVERTING) - filrunout(); } -#endif - -#if defined(HOME_PIN) && HOME_PIN > -1 - static int homeDebounceCount = 0; // poor man's debouncing count - const int HOME_DEBOUNCE_DELAY = 750; -#endif - +/** + * + */ +void manage_inactivity(bool ignore_stepper_queue/*=false*/) { - if(buflen < (BUFSIZE-1)) - get_command(); + #if HAS_KILL + static int killCount = 0; // make the inactivity button a bit less responsive + const int KILL_DELAY = 750; + #endif + + #if HAS_FILRUNOUT + if (card.sdprinting && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) + filrunout(); + #endif + + #if HAS_HOME + static int homeDebounceCount = 0; // poor man's debouncing count + const int HOME_DEBOUNCE_DELAY = 750; + #endif + + if (buflen < BUFSIZE - 1) get_command(); + + unsigned long ms = millis(); + + if (max_inactive_time && ms > previous_millis_cmd + max_inactive_time) kill(); + + if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time + && !ignore_stepper_queue && !blocks_queued()) + disable_all_axes(); - if( (millis() - previous_millis_cmd) > max_inactive_time ) - if(max_inactive_time) - kill(); - if(stepper_inactive_time) { - if( (millis() - previous_millis_cmd) > stepper_inactive_time ) - { - if(blocks_queued() == false && ignore_stepper_queue == false) { - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); - } - } - } - #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH - if (chdkActive && (millis() - chdkHigh > CHDK_DELAY)) - { + if (chdkActive && ms > chdkHigh + CHDK_DELAY) { chdkActive = false; WRITE(CHDK, LOW); } #endif - - #if defined(KILL_PIN) && KILL_PIN > -1 + + #if HAS_KILL // Check if the kill button was pressed and wait just in case it was an accidental // key kill key press // ------------------------------------------------------------------------------- - if( 0 == READ(KILL_PIN) ) - { + if (!READ(KILL_PIN)) killCount++; - } else if (killCount > 0) - { killCount--; - } + // Exceeded threshold and we can confirm that it was not accidental // KILL the machine // ---------------------------------------------------------------- - if ( killCount >= KILL_DELAY) - { - kill(); + if (killCount >= KILL_DELAY) kill(); + #endif + + #if HAS_HOME + // Check to see if we have to home, use poor man's debouncer + // --------------------------------------------------------- + if (!READ(HOME_PIN)) { + if (!homeDebounceCount) { + enquecommands_P(PSTR("G28")); + LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME); + } + if (homeDebounceCount < HOME_DEBOUNCE_DELAY) + homeDebounceCount++; + else + homeDebounceCount = 0; + } + #endif + + #if HAS_CONTROLLERFAN + controllerFan(); //Check if fan should be turned on to cool stepper drivers down + #endif + + #ifdef EXTRUDER_RUNOUT_PREVENT + if (ms > previous_millis_cmd + EXTRUDER_RUNOUT_SECONDS * 1000) + if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { + bool oldstatus = E0_ENABLE_READ; + enable_e0(); + float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS]; + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], + destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS], + EXTRUDER_RUNOUT_SPEED / 60. * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS], active_extruder); + current_position[E_AXIS] = oldepos; + destination[E_AXIS] = oldedes; + plan_set_e_position(oldepos); + previous_millis_cmd = ms; // refresh_cmd_timeout() + st_synchronize(); + E0_ENABLE_WRITE(oldstatus); } #endif -#if defined(HOME_PIN) && HOME_PIN > -1 - // Check to see if we have to home, use poor man's debouncer - // --------------------------------------------------------- - if ( 0 == READ(HOME_PIN) ) - { - if (homeDebounceCount == 0) - { - enquecommands_P((PSTR("G28"))); - homeDebounceCount++; - LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME); - } - else if (homeDebounceCount < HOME_DEBOUNCE_DELAY) - { - homeDebounceCount++; - } - else - { - homeDebounceCount = 0; - } - } -#endif - - #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 - controllerFan(); //Check if fan should be turned on to cool stepper drivers down - #endif - #ifdef EXTRUDER_RUNOUT_PREVENT - if( (millis() - previous_millis_cmd) > EXTRUDER_RUNOUT_SECONDS*1000 ) - if(degHotend(active_extruder)>EXTRUDER_RUNOUT_MINTEMP) - { - bool oldstatus=E0_ENABLE_READ; - enable_e0(); - float oldepos=current_position[E_AXIS]; - float oldedes=destination[E_AXIS]; - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], - destination[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], - EXTRUDER_RUNOUT_SPEED/60.*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], active_extruder); - current_position[E_AXIS]=oldepos; - destination[E_AXIS]=oldedes; - plan_set_e_position(oldepos); - previous_millis_cmd=millis(); - st_synchronize(); - E0_ENABLE_WRITE(oldstatus); - } - #endif - #if defined(DUAL_X_CARRIAGE) + #ifdef DUAL_X_CARRIAGE // handle delayed move timeout - if (delayed_move_time != 0 && (millis() - delayed_move_time) > 1000 && Stopped == false) - { + if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - memcpy(destination,current_position,sizeof(destination)); + memcpy(destination,current_position, sizeof(destination)); prepare_move(); } #endif + #ifdef TEMP_STAT_LEDS - handle_status_leds(); + handle_status_leds(); #endif + check_axes_activity(); } diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 8c05f83bc..e072c7d73 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -56,7 +56,7 @@ #if EXTRUDERS > 1 #if EXTRUDERS > 4 - #error The maximum number of EXTRUDERS is 4. + #error The maximum number of EXTRUDERS in Marlin is 4. #endif #ifdef TEMP_SENSOR_1_AS_REDUNDANT @@ -77,6 +77,13 @@ #endif // EXTRUDERS > 1 + /** + * Limited number of servos + */ + #if NUM_SERVOS > 4 + #error The maximum number of SERVOS in Marlin is 4. + #endif + /** * Required LCD language */ @@ -209,9 +216,9 @@ */ #ifdef DUAL_X_CARRIAGE #if EXTRUDERS == 1 || defined(COREXY) \ - || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \ + || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \ || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \ - || !defined(X_MAX_PIN) || X_MAX_PIN < 0 + || !HAS_X_MAX #error Missing or invalid definitions for DUAL_X_CARRIAGE mode. #endif #if X_HOME_DIR != -1 || X2_HOME_DIR != 1 @@ -234,6 +241,10 @@ #endif #endif + #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN + #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN + #endif + /** * Test required HEATER defines */ @@ -254,4 +265,11 @@ #error HEATER_0_PIN not defined for this board #endif + /** + * Warnings for old configurations + */ + #ifdef X_HOME_RETRACT_MM + #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM + #endif + #endif //SANITYCHECK_H diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 7868e8e81..3e1a56dc4 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -412,7 +412,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index 21b30580c..8acdeb969 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -189,9 +189,9 @@ // @section homing //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 2 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 63e99bd3a..c057e5642 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -300,7 +300,7 @@ static void lcd_implementation_status_screen() { // Fan lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(104,27); - #if defined(FAN_PIN) && FAN_PIN > -1 + #if HAS_FAN int per = ((fanSpeed + 1) * 100) / 256; if (per) { diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 1cc50246a..4c8353823 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -364,7 +364,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 956e2dc47..a0ecacd92 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -364,7 +364,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 9bbd515ca..d60eb5296 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 3 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 3 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 594295a3e..e66222346 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -387,7 +387,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index bac3b571a..0529df9be 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 2 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index c17e419c7..854367af8 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -392,7 +392,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 9bbd515ca..d60eb5296 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 3 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 3 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 96fef00cf..15fde93f8 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -416,7 +416,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 7b00532e4..5145b1668 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 3 -#define Y_HOME_RETRACT_MM 3 -#define Z_HOME_RETRACT_MM 3 +#define X_HOME_BUMP_MM 3 +#define Y_HOME_BUMP_MM 3 +#define Z_HOME_BUMP_MM 3 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 190270e85..5bccb9827 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -386,7 +386,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 965ecbf40..ab480dd63 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 2 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 4aeb5d55f..1403ddd2d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -414,7 +414,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -507,10 +507,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100 - #define Z_PROBE_ALLEN_KEY_RETRACT_X -64 - #define Z_PROBE_ALLEN_KEY_RETRACT_Y 56 - #define Z_PROBE_ALLEN_KEY_RETRACT_Z 23 - #define Z_PROBE_ALLEN_KEY_RETRACT_DEPTH 20 + #define Z_PROBE_ALLEN_KEY_STOW_X -64 + #define Z_PROBE_ALLEN_KEY_STOW_Y 56 + #define Z_PROBE_ALLEN_KEY_STOW_Z 23 + #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 #endif //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index abecacec2..501cd814d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 5 // deltas need the same for all three axis #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index edb7ff526..420dfa9e4 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -414,7 +414,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -511,10 +511,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100 - #define Z_PROBE_ALLEN_KEY_RETRACT_X -64 - #define Z_PROBE_ALLEN_KEY_RETRACT_Y 56 - #define Z_PROBE_ALLEN_KEY_RETRACT_Z 23 - #define Z_PROBE_ALLEN_KEY_RETRACT_DEPTH 20 + #define Z_PROBE_ALLEN_KEY_STOW_X -64 + #define Z_PROBE_ALLEN_KEY_STOW_Y 56 + #define Z_PROBE_ALLEN_KEY_STOW_Z 23 + #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 #endif //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index b255000bc..c402064bf 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 5 // deltas need the same for all three axis #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index a3e8fd088..55e26ebf8 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -384,7 +384,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 5e0e6ef4d..3db90efcf 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 2 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 7ffff3353..6b781b7a4 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -386,7 +386,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index bbf7dc005..2ecf75951 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -175,9 +175,9 @@ #endif //DUAL_X_CARRIAGE //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_RETRACT_MM 5 -#define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 1 +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 1 #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index b6c4ed5b0..bf7275e5c 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -1,6 +1,6 @@ #include "Marlin.h" -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #define MESH_X_DIST ((MESH_MAX_X - MESH_MIN_X)/(MESH_NUM_X_POINTS - 1)) #define MESH_Y_DIST ((MESH_MAX_Y - MESH_MIN_Y)/(MESH_NUM_Y_POINTS - 1)) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d98ef63d4..d7d33c170 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -58,7 +58,7 @@ #include "ultralcd.h" #include "language.h" -#if defined(MESH_BED_LEVELING) +#ifdef MESH_BED_LEVELING #include "mesh_bed_leveling.h" #endif // MESH_BED_LEVELING @@ -427,7 +427,7 @@ void check_axes_activity() { disable_e3(); } - #if defined(FAN_PIN) && FAN_PIN > -1 // HAS_FAN + #if HAS_FAN #ifdef FAN_KICKSTART_TIME static unsigned long fan_kick_end; if (tail_fan_speed) { @@ -447,17 +447,17 @@ void check_axes_activity() { #else analogWrite(FAN_PIN, tail_fan_speed); #endif //!FAN_SOFT_PWM - #endif //FAN_PIN > -1 + #endif // HAS_FAN #ifdef AUTOTEMP getHighESpeed(); #endif #ifdef BARICUDA - #if defined(HEATER_1_PIN) && HEATER_1_PIN > -1 // HAS_HEATER_1 + #if HAS_HEATER_1 analogWrite(HEATER_1_PIN,tail_valve_pressure); #endif - #if defined(HEATER_2_PIN) && HEATER_2_PIN > -1 // HAS_HEATER_2 + #if HAS_HEATER_2 analogWrite(HEATER_2_PIN,tail_e_to_p_pressure); #endif #endif diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index a7dba4659..a9a428c0e 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -85,29 +85,29 @@ static volatile bool endstop_z_hit = false; int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT; #endif -#if defined(X_MIN_PIN) && X_MIN_PIN >= 0 +#if HAS_X_MIN static bool old_x_min_endstop = false; #endif -#if defined(X_MAX_PIN) && X_MAX_PIN >= 0 +#if HAS_X_MAX static bool old_x_max_endstop = false; #endif -#if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 +#if HAS_Y_MIN static bool old_y_min_endstop = false; #endif -#if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 +#if HAS_Y_MAX static bool old_y_max_endstop = false; #endif -#if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 +#if HAS_Z_MIN static bool old_z_min_endstop = false; #endif -#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 +#if HAS_Z_MAX static bool old_z_max_endstop = false; #endif #ifdef Z_DUAL_ENDSTOPS - #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0 + #if HAS_Z2_MIN static bool old_z2_min_endstop = false; #endif - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 + #if HAS_Z2_MAX static bool old_z2_max_endstop = false; #endif #endif @@ -472,7 +472,7 @@ ISR(TIMER1_COMPA_vect) { if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1)) #endif { - #if defined(X_MIN_PIN) && X_MIN_PIN >= 0 + #if HAS_X_MIN UPDATE_ENDSTOP(x, X, min, MIN); #endif } @@ -483,7 +483,7 @@ ISR(TIMER1_COMPA_vect) { if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1)) #endif { - #if defined(X_MAX_PIN) && X_MAX_PIN >= 0 + #if HAS_X_MAX UPDATE_ENDSTOP(x, X, max, MAX); #endif } @@ -498,12 +498,12 @@ ISR(TIMER1_COMPA_vect) { if (TEST(out_bits, Y_AXIS)) // -direction #endif { // -direction - #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 + #if HAS_Y_MIN UPDATE_ENDSTOP(y, Y, min, MIN); #endif } else { // +direction - #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 + #if HAS_Y_MAX UPDATE_ENDSTOP(y, Y, max, MAX); #endif } @@ -519,13 +519,13 @@ ISR(TIMER1_COMPA_vect) { if (check_endstops) { - #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 + #if HAS_Z_MIN #ifdef Z_DUAL_ENDSTOPS bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING, z2_min_endstop = - #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0 + #if HAS_Z2_MIN READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING #else z_min_endstop @@ -561,13 +561,13 @@ ISR(TIMER1_COMPA_vect) { if (check_endstops) { - #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 + #if HAS_Z_MAX #ifdef Z_DUAL_ENDSTOPS bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING, z2_max_endstop = - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 + #if HAS_Z2_MAX READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING #else z_max_endstop @@ -835,127 +835,127 @@ void st_init() { #endif // Initialize Dir Pins - #if defined(X_DIR_PIN) && X_DIR_PIN >= 0 + #if HAS_X_DIR X_DIR_INIT; #endif - #if defined(X2_DIR_PIN) && X2_DIR_PIN >= 0 + #if HAS_X2_DIR X2_DIR_INIT; #endif - #if defined(Y_DIR_PIN) && Y_DIR_PIN >= 0 + #if HAS_Y_DIR Y_DIR_INIT; - #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && Y2_DIR_PIN >= 0 + #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR Y2_DIR_INIT; #endif #endif - #if defined(Z_DIR_PIN) && Z_DIR_PIN >= 0 + #if HAS_Z_DIR Z_DIR_INIT; - #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_DIR_PIN) && Z2_DIR_PIN >= 0 + #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_DIR Z2_DIR_INIT; #endif #endif - #if defined(E0_DIR_PIN) && E0_DIR_PIN >= 0 + #if HAS_E0_DIR E0_DIR_INIT; #endif - #if defined(E1_DIR_PIN) && E1_DIR_PIN >= 0 + #if HAS_E1_DIR E1_DIR_INIT; #endif - #if defined(E2_DIR_PIN) && E2_DIR_PIN >= 0 + #if HAS_E2_DIR E2_DIR_INIT; #endif - #if defined(E3_DIR_PIN) && E3_DIR_PIN >= 0 + #if HAS_E3_DIR E3_DIR_INIT; #endif //Initialize Enable Pins - steppers default to disabled. - #if defined(X_ENABLE_PIN) && X_ENABLE_PIN >= 0 + #if HAS_X_ENABLE X_ENABLE_INIT; if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); #endif - #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN >= 0 + #if HAS_X2_ENABLE X2_ENABLE_INIT; if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); #endif - #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN >= 0 + #if HAS_Y_ENABLE Y_ENABLE_INIT; if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); - #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_ENABLE_PIN) && Y2_ENABLE_PIN >= 0 + #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE Y2_ENABLE_INIT; if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); #endif #endif - #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN >= 0 + #if HAS_Z_ENABLE Z_ENABLE_INIT; if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); - #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_ENABLE_PIN) && Z2_ENABLE_PIN >= 0 + #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_ENABLE Z2_ENABLE_INIT; if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); #endif #endif - #if defined(E0_ENABLE_PIN) && E0_ENABLE_PIN >= 0 + #if HAS_E0_ENABLE E0_ENABLE_INIT; if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH); #endif - #if defined(E1_ENABLE_PIN) && E1_ENABLE_PIN >= 0 + #if HAS_E1_ENABLE E1_ENABLE_INIT; if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH); #endif - #if defined(E2_ENABLE_PIN) && E2_ENABLE_PIN >= 0 + #if HAS_E2_ENABLE E2_ENABLE_INIT; if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH); #endif - #if defined(E3_ENABLE_PIN) && E3_ENABLE_PIN >= 0 + #if HAS_E3_ENABLE E3_ENABLE_INIT; if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH); #endif //endstops and pullups - #if defined(X_MIN_PIN) && X_MIN_PIN >= 0 + #if HAS_X_MIN SET_INPUT(X_MIN_PIN); #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); #endif #endif - #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 + #if HAS_Y_MIN SET_INPUT(Y_MIN_PIN); #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); #endif #endif - #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0 + #if HAS_Z_MIN SET_INPUT(Z_MIN_PIN); #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); #endif #endif - #if defined(X_MAX_PIN) && X_MAX_PIN >= 0 + #if HAS_X_MAX SET_INPUT(X_MAX_PIN); #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); #endif #endif - #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 + #if HAS_Y_MAX SET_INPUT(Y_MAX_PIN); #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); #endif #endif - #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0 + #if HAS_Z_MAX SET_INPUT(Z_MAX_PIN); #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); #endif #endif - #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0 + #if HAS_Z2_MAX SET_INPUT(Z2_MAX_PIN); #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z2_MAX_PIN,HIGH); @@ -970,36 +970,36 @@ void st_init() { #define E_AXIS_INIT(NUM) AXIS_INIT(e## NUM, E## NUM, E) // Initialize Step Pins - #if defined(X_STEP_PIN) && X_STEP_PIN >= 0 + #if HAS_X_STEP AXIS_INIT(x, X, X); #endif - #if defined(X2_STEP_PIN) && X2_STEP_PIN >= 0 + #if HAS_X2_STEP AXIS_INIT(x, X2, X); #endif - #if defined(Y_STEP_PIN) && Y_STEP_PIN >= 0 - #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && Y2_STEP_PIN >= 0 + #if HAS_Y_STEP + #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_STEP Y2_STEP_INIT; Y2_STEP_WRITE(INVERT_Y_STEP_PIN); #endif AXIS_INIT(y, Y, Y); #endif - #if defined(Z_STEP_PIN) && Z_STEP_PIN >= 0 - #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_STEP_PIN) && Z2_STEP_PIN >= 0 + #if HAS_Z_STEP + #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_STEP Z2_STEP_INIT; Z2_STEP_WRITE(INVERT_Z_STEP_PIN); #endif AXIS_INIT(z, Z, Z); #endif - #if defined(E0_STEP_PIN) && E0_STEP_PIN >= 0 + #if HAS_E0_STEP E_AXIS_INIT(0); #endif - #if defined(E1_STEP_PIN) && E1_STEP_PIN >= 0 + #if HAS_E1_STEP E_AXIS_INIT(1); #endif - #if defined(E2_STEP_PIN) && E2_STEP_PIN >= 0 + #if HAS_E2_STEP E_AXIS_INIT(2); #endif - #if defined(E3_STEP_PIN) && E3_STEP_PIN >= 0 + #if HAS_E3_STEP E_AXIS_INIT(3); #endif @@ -1220,12 +1220,12 @@ void digipot_current(uint8_t driver, int current) { } void microstep_init() { - #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0 + #if HAS_MICROSTEPS_E1 pinMode(E1_MS1_PIN,OUTPUT); - pinMode(E1_MS2_PIN,OUTPUT); + pinMode(E1_MS2_PIN,OUTPUT); #endif - #if defined(X_MS1_PIN) && X_MS1_PIN >= 0 + #if HAS_MICROSTEPS pinMode(X_MS1_PIN,OUTPUT); pinMode(X_MS2_PIN,OUTPUT); pinMode(Y_MS1_PIN,OUTPUT); @@ -1246,7 +1246,7 @@ void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { case 1: digitalWrite(Y_MS1_PIN, ms1); break; case 2: digitalWrite(Z_MS1_PIN, ms1); break; case 3: digitalWrite(E0_MS1_PIN, ms1); break; - #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0 + #if HAS_MICROSTEPS_E1 case 4: digitalWrite(E1_MS1_PIN, ms1); break; #endif } @@ -1285,7 +1285,7 @@ void microstep_readings() { SERIAL_PROTOCOLPGM("E0: "); SERIAL_PROTOCOL(digitalRead(E0_MS1_PIN)); SERIAL_PROTOCOLLN(digitalRead(E0_MS2_PIN)); - #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0 + #if HAS_MICROSTEPS_E1 SERIAL_PROTOCOLPGM("E1: "); SERIAL_PROTOCOL(digitalRead(E1_MS1_PIN)); SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN)); diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 79146a355..a6ea1b7d1 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -53,7 +53,7 @@ extern float current_temperature_bed; extern float redundant_temperature; #endif -#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 +#if HAS_CONTROLLERFAN extern unsigned char soft_pwm_bed; #endif diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index a89c26206..fe4f59768 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -64,14 +64,14 @@ #define LCD_CLICKED (buttons&EN_C) #ifdef REPRAPWORLD_KEYPAD - #define EN_REPRAPWORLD_KEYPAD_F3 BIT(BLEN_REPRAPWORLD_KEYPAD_F3) - #define EN_REPRAPWORLD_KEYPAD_F2 BIT(BLEN_REPRAPWORLD_KEYPAD_F2) - #define EN_REPRAPWORLD_KEYPAD_F1 BIT(BLEN_REPRAPWORLD_KEYPAD_F1) - #define EN_REPRAPWORLD_KEYPAD_UP BIT(BLEN_REPRAPWORLD_KEYPAD_UP) - #define EN_REPRAPWORLD_KEYPAD_RIGHT BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT) - #define EN_REPRAPWORLD_KEYPAD_MIDDLE BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE) - #define EN_REPRAPWORLD_KEYPAD_DOWN BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN) - #define EN_REPRAPWORLD_KEYPAD_LEFT BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT) + #define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3)) + #define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2)) + #define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1)) + #define EN_REPRAPWORLD_KEYPAD_UP (BIT(BLEN_REPRAPWORLD_KEYPAD_UP)) + #define EN_REPRAPWORLD_KEYPAD_RIGHT (BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT)) + #define EN_REPRAPWORLD_KEYPAD_MIDDLE (BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE)) + #define EN_REPRAPWORLD_KEYPAD_DOWN (BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN)) + #define EN_REPRAPWORLD_KEYPAD_LEFT (BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT)) #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1)) #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2) From 6b919e14c1d2986c9d7cd884322fc1b3ad3a5efc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 15:45:41 -0700 Subject: [PATCH 182/302] Group all universal variables --- Marlin/Marlin_main.cpp | 176 +++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 102 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cc7ac87aa..f82408e5f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -202,10 +202,6 @@ #endif float homing_feedrate[] = HOMING_FEEDRATE; -#ifdef ENABLE_AUTO_BED_LEVELING - int xy_travel_speed = XY_TRAVEL_SPEED; - float zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; -#endif int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 @@ -216,15 +212,49 @@ float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS(1.0, 1.0, 1.0, 1.0); float current_position[NUM_AXIS] = { 0.0 }; float home_offset[3] = { 0 }; -#ifdef DELTA - float endstop_adj[3] = { 0 }; -#elif defined(Z_DUAL_ENDSTOPS) - float z_endstop_adj = 0; -#endif - float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; bool axis_known_position[3] = { false }; +uint8_t active_extruder = 0; +int fanSpeed = 0; +bool cancel_heatup = false; +const char errormagic[] PROGMEM = "Error:"; +const char echomagic[] PROGMEM = "echo:"; +const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; +static float destination[NUM_AXIS] = { 0 }; +static float offset[3] = { 0 }; +static float feedrate = 1500.0, next_feedrate, saved_feedrate; +static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; +static bool relative_mode = false; //Determines Absolute or Relative Coordinates +static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; +static int bufindr = 0; +static int bufindw = 0; +static int buflen = 0; +static char serial_char; +static int serial_count = 0; +static boolean comment_mode = false; +static char *strchr_pointer; ///< A pointer to find chars in the command string (X, Y, Z, E, etc.) +const char* queued_commands_P= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ +const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42 +// Inactivity shutdown +static unsigned long previous_millis_cmd = 0; +static unsigned long max_inactive_time = 0; +static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l; +unsigned long starttime = 0; ///< Print job start time +unsigned long stoptime = 0; ///< Print job stop time +static uint8_t tmp_extruder; +bool Stopped = false; +bool CooldownNoWait = true; +bool target_direction; + +#ifdef ENABLE_AUTO_BED_LEVELING + int xy_travel_speed = XY_TRAVEL_SPEED; + float zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER; +#endif + +#if defined(Z_DUAL_ENDSTOPS) && !defined(DELTA) + float z_endstop_adj = 0; +#endif // Extruder offsets #if EXTRUDERS > 1 @@ -243,9 +273,6 @@ bool axis_known_position[3] = { false }; }; #endif -uint8_t active_extruder = 0; -int fanSpeed = 0; - #ifdef SERVO_ENDSTOPS int servo_endstops[] = SERVO_ENDSTOPS; int servo_endstop_angles[] = SERVO_ENDSTOP_ANGLES; @@ -282,33 +309,36 @@ int fanSpeed = 0; ; #endif -#ifdef DELTA - float delta[3] = { 0, 0, 0 }; - #define SIN_60 0.8660254037844386 - #define COS_60 0.5 - // these are the default values, can be overriden with M665 - float delta_radius = DELTA_RADIUS; - float delta_tower1_x = -SIN_60 * delta_radius; // front left tower - float delta_tower1_y = -COS_60 * delta_radius; - float delta_tower2_x = SIN_60 * delta_radius; // front right tower - float delta_tower2_y = -COS_60 * delta_radius; - float delta_tower3_x = 0; // back middle tower - float delta_tower3_y = delta_radius; - float delta_diagonal_rod = DELTA_DIAGONAL_ROD; - float delta_diagonal_rod_2 = sq(delta_diagonal_rod); - float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; - #ifdef ENABLE_AUTO_BED_LEVELING - int delta_grid_spacing[2] = { 0, 0 }; - float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; +#if defined(DELTA) || defined(SCARA) + static float delta[3] = { 0, 0, 0 }; + #ifdef DELTA + #define SIN_60 0.8660254037844386 + #define COS_60 0.5 + float endstop_adj[3] = { 0 }; + // these are the default values, can be overriden with M665 + float delta_radius = DELTA_RADIUS; + float delta_tower1_x = -SIN_60 * delta_radius; // front left tower + float delta_tower1_y = -COS_60 * delta_radius; + float delta_tower2_x = SIN_60 * delta_radius; // front right tower + float delta_tower2_y = -COS_60 * delta_radius; + float delta_tower3_x = 0; // back middle tower + float delta_tower3_y = delta_radius; + float delta_diagonal_rod = DELTA_DIAGONAL_ROD; + float delta_diagonal_rod_2 = sq(delta_diagonal_rod); + float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; + #ifdef ENABLE_AUTO_BED_LEVELING + int delta_grid_spacing[2] = { 0, 0 }; + float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; + #endif #endif -#endif -#ifdef SCARA - float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 - static float delta[3] = { 0, 0, 0 }; -#endif + #ifdef SCARA + float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 + #endif -bool cancel_heatup = false; +#elif !defined(DELTA) + static bool home_all_axis = true; +#endif #ifdef FILAMENT_SENSOR //Variables for Filament Sensor input @@ -326,67 +356,21 @@ bool cancel_heatup = false; static bool filrunoutEnqued = false; #endif -const char errormagic[] PROGMEM = "Error:"; -const char echomagic[] PROGMEM = "echo:"; - -const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; -static float destination[NUM_AXIS] = { 0 }; - -static float offset[3] = { 0 }; - -#ifndef DELTA - static bool home_all_axis = true; -#endif - -static float feedrate = 1500.0, next_feedrate, saved_feedrate; -static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; - -static bool relative_mode = false; //Determines Absolute or Relative Coordinates - -static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; #ifdef SDSUPPORT static bool fromsd[BUFSIZE]; #endif -static int bufindr = 0; -static int bufindw = 0; -static int buflen = 0; - -static char serial_char; -static int serial_count = 0; -static boolean comment_mode = false; -static char *strchr_pointer; ///< A pointer to find chars in the command string (X, Y, Z, E, etc.) - -const char* queued_commands_P= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ - -const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42 - -// Inactivity shutdown -static unsigned long previous_millis_cmd = 0; -static unsigned long max_inactive_time = 0; -static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l; - -unsigned long starttime = 0; ///< Print job start time -unsigned long stoptime = 0; ///< Print job stop time - -static uint8_t tmp_extruder; - - -bool Stopped = false; #if NUM_SERVOS > 0 Servo servos[NUM_SERVOS]; #endif -bool CooldownNoWait = true; -bool target_direction; - #ifdef CHDK unsigned long chdkHigh = 0; boolean chdkActive = false; #endif //=========================================================================== -//=============================Routines====================================== +//================================ Functions ================================ //=========================================================================== void get_arc_coordinates(); @@ -5707,21 +5691,11 @@ void disable_all_axes() { */ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { - #if HAS_KILL - static int killCount = 0; // make the inactivity button a bit less responsive - const int KILL_DELAY = 750; - #endif - #if HAS_FILRUNOUT if (card.sdprinting && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) filrunout(); #endif - #if HAS_HOME - static int homeDebounceCount = 0; // poor man's debouncing count - const int HOME_DEBOUNCE_DELAY = 750; - #endif - if (buflen < BUFSIZE - 1) get_command(); unsigned long ms = millis(); @@ -5744,6 +5718,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { // Check if the kill button was pressed and wait just in case it was an accidental // key kill key press // ------------------------------------------------------------------------------- + static int killCount = 0; // make the inactivity button a bit less responsive + const int KILL_DELAY = 750; if (!READ(KILL_PIN)) killCount++; else if (killCount > 0) @@ -5758,6 +5734,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #if HAS_HOME // Check to see if we have to home, use poor man's debouncer // --------------------------------------------------------- + static int homeDebounceCount = 0; // poor man's debouncing count + const int HOME_DEBOUNCE_DELAY = 750; if (!READ(HOME_PIN)) { if (!homeDebounceCount) { enquecommands_P(PSTR("G28")); @@ -5797,7 +5775,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - memcpy(destination,current_position, sizeof(destination)); + memcpy(destination, current_position, sizeof(destination)); prepare_move(); } #endif @@ -5814,13 +5792,7 @@ void kill() cli(); // Stop interrupts disable_heater(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); + disable_all_axes(); #if HAS_POWER_SWITCH pinMode(PS_ON_PIN, INPUT); From 424d5495e46b7cb3f59ab631b44d8b395e7b1753 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 16:38:05 -0700 Subject: [PATCH 183/302] Add PIDTEMPBED to EEPROM --- Marlin/ConfigurationStore.cpp | 87 ++++++++++++++++++++++++++--------- Marlin/temperature.h | 2 +- 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index b1da94a30..3ed585f82 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -3,7 +3,21 @@ * * Configuration and EEPROM storage * - * V16 EEPROM Layout: + * IMPORTANT: Whenever there are changes made to the variables stored in EEPROM + * in the functions below, also increment the version number. This makes sure that + * the default values are used whenever there is a change to the data, to prevent + * wrong data being written to the variables. + * + * ALSO: Variables in the Store and Retrieve sections must be in the same order. + * If a feature is disabled, some data must still be written that, when read, + * either sets a Sane Default, or results in No Change to the existing value. + * + */ + +#define EEPROM_VERSION "V19" + +/** + * V19 EEPROM Layout: * * ver * axis_steps_per_unit (x4) @@ -47,6 +61,9 @@ * Kp[2], Ki[2], Kd[2], Kc[2] * Kp[3], Ki[3], Kd[3], Kc[3] * + * PIDTEMPBED: + * bedKp, bedKi, bedKd + * * DOGLCD: * lcd_contrast * @@ -111,15 +128,6 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { #define EEPROM_OFFSET 100 - -// IMPORTANT: Whenever there are changes made to the variables stored in EEPROM -// in the functions below, also increment the version number. This makes sure that -// the default values are used whenever there is a change to the data, to prevent -// wrong data being written to the variables. -// ALSO: always make sure the variables in the Store and retrieve sections are in the same order. - -#define EEPROM_VERSION "V18" - #ifdef EEPROM_SETTINGS void Config_StoreSettings() { @@ -194,7 +202,6 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, absPreheatHPBTemp); EEPROM_WRITE_VAR(i, absPreheatFanSpeed); - for (int e = 0; e < 4; e++) { #ifdef PIDTEMP @@ -209,12 +216,10 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, dummy); #endif } - else { - #else // !PIDTEMP - { + else #endif // !PIDTEMP - - dummy = DUMMY_PID_VALUE; + { + dummy = DUMMY_PID_VALUE; // When read, will not change the existing value EEPROM_WRITE_VAR(i, dummy); dummy = 0.0f; for (int q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); @@ -222,6 +227,14 @@ void Config_StoreSettings() { } // Extruders Loop + #ifndef PIDTEMPBED + float bedKp = DUMMY_PID_VALUE, bedKi = DUMMY_PID_VALUE, bedKd = DUMMY_PID_VALUE; + #endif + + EEPROM_WRITE_VAR(i, bedKp); + EEPROM_WRITE_VAR(i, bedKi); + EEPROM_WRITE_VAR(i, bedKd); + #ifndef DOGLCD int lcd_contrast = 32; #endif @@ -364,7 +377,7 @@ void Config_RetrieveSettings() { #ifdef PIDTEMP for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin - EEPROM_READ_VAR(i, dummy); + EEPROM_READ_VAR(i, dummy); // Kp if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) { // do not need to scale PID values as the values in EEPROM are already scaled PID_PARAM(Kp, e) = dummy; @@ -385,6 +398,20 @@ void Config_RetrieveSettings() { for (int q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc #endif // !PIDTEMP + #ifndef PIDTEMPBED + float bedKp, bedKi, bedKd; + #endif + + EEPROM_READ_VAR(i, dummy); // bedKp + if (dummy != DUMMY_PID_VALUE) { + bedKp = dummy; + EEPROM_READ_VAR(i, bedKi); + EEPROM_READ_VAR(i, bedKd); + } + else { + for (int q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd + } + #ifndef DOGLCD int lcd_contrast; #endif @@ -517,6 +544,12 @@ void Config_ResetDefault() { updatePID(); #endif // PIDTEMP + #ifdef PIDTEMPBED + bedKp = DEFAULT_bedKp; + bedKi = scalePID_i(DEFAULT_bedKi); + bedKd = scalePID_d(DEFAULT_bedKd); + #endif + #ifdef FWRETRACT autoretract_enabled = false; retract_length = RETRACT_LENGTH; @@ -660,17 +693,25 @@ void Config_PrintSettings(bool forReplay) { SERIAL_EOL; #endif // DELTA - #ifdef PIDTEMP + #if defined(PIDTEMP) || defined(PIDTEMPBED) SERIAL_ECHO_START; if (!forReplay) { SERIAL_ECHOLNPGM("PID settings:"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0 - SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0))); - SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); - SERIAL_EOL; - #endif // PIDTEMP + #ifdef PIDTEMP + SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0 + SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0))); + SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); + SERIAL_EOL; + #endif + #ifdef PIDTEMPBED + SERIAL_ECHOPAIR(" M304 P", bedKp); // for compatibility with hosts, only echos values for E0 + SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi)); + SERIAL_ECHOPAIR(" D", unscalePID_d(bedKd)); + SERIAL_EOL; + #endif + #endif #ifdef FWRETRACT diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 79146a355..eb080ea4c 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -72,11 +72,11 @@ extern float current_temperature_bed; float unscalePID_d(float d); #endif + #ifdef PIDTEMPBED extern float bedKp,bedKi,bedKd; #endif - #ifdef BABYSTEPPING extern volatile int babystepsTodo[3]; #endif From 007a4bd4217831a37bfcce3c0eb0c58c639afb2e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 16:41:58 -0700 Subject: [PATCH 184/302] Adjust spacing in view function --- Marlin/ConfigurationStore.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 3ed585f82..eacd7ea12 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -699,14 +699,17 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("PID settings:"); SERIAL_ECHO_START; } + #if defined(PIDTEMP) && defined(PIDTEMPBED) + SERIAL_EOL; + #endif #ifdef PIDTEMP - SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0 + SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0 SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0))); SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); SERIAL_EOL; #endif #ifdef PIDTEMPBED - SERIAL_ECHOPAIR(" M304 P", bedKp); // for compatibility with hosts, only echos values for E0 + SERIAL_ECHOPAIR(" M304 P", bedKp); // for compatibility with hosts, only echos values for E0 SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi)); SERIAL_ECHOPAIR(" D", unscalePID_d(bedKd)); SERIAL_EOL; @@ -720,7 +723,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M207 S", retract_length); + SERIAL_ECHOPAIR(" M207 S", retract_length); SERIAL_ECHOPAIR(" F", retract_feedrate*60); SERIAL_ECHOPAIR(" Z", retract_zlift); SERIAL_EOL; @@ -729,7 +732,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M208 S", retract_recover_length); + SERIAL_ECHOPAIR(" M208 S", retract_recover_length); SERIAL_ECHOPAIR(" F", retract_recover_feedrate*60); SERIAL_EOL; SERIAL_ECHO_START; @@ -737,7 +740,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0)); + SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0)); SERIAL_EOL; #if EXTRUDERS > 1 @@ -761,20 +764,20 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Filament settings:"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M200 D", filament_size[0]); + SERIAL_ECHOPAIR(" M200 D", filament_size[0]); SERIAL_EOL; #if EXTRUDERS > 1 SERIAL_ECHO_START; - SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]); + SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]); SERIAL_EOL; #if EXTRUDERS > 2 SERIAL_ECHO_START; - SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]); + SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]); SERIAL_EOL; #if EXTRUDERS > 3 SERIAL_ECHO_START; - SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]); + SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]); SERIAL_EOL; #endif #endif @@ -793,7 +796,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); + SERIAL_ECHOPAIR(" M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET); SERIAL_ECHOPAIR(" Z", -zprobe_zoffset); #else if (!forReplay) { From 92119d0f7d3ac8f20499585328e52d671556efca Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 16:46:56 -0700 Subject: [PATCH 185/302] Static delta[] for SCARA --- Marlin/Marlin_main.cpp | 52 ++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f82408e5f..113c06e18 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -309,37 +309,35 @@ bool target_direction; ; #endif -#if defined(DELTA) || defined(SCARA) - static float delta[3] = { 0, 0, 0 }; - #ifdef DELTA - #define SIN_60 0.8660254037844386 - #define COS_60 0.5 - float endstop_adj[3] = { 0 }; - // these are the default values, can be overriden with M665 - float delta_radius = DELTA_RADIUS; - float delta_tower1_x = -SIN_60 * delta_radius; // front left tower - float delta_tower1_y = -COS_60 * delta_radius; - float delta_tower2_x = SIN_60 * delta_radius; // front right tower - float delta_tower2_y = -COS_60 * delta_radius; - float delta_tower3_x = 0; // back middle tower - float delta_tower3_y = delta_radius; - float delta_diagonal_rod = DELTA_DIAGONAL_ROD; - float delta_diagonal_rod_2 = sq(delta_diagonal_rod); - float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; - #ifdef ENABLE_AUTO_BED_LEVELING - int delta_grid_spacing[2] = { 0, 0 }; - float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; - #endif +#ifdef DELTA + float delta[3] = { 0 }; + #define SIN_60 0.8660254037844386 + #define COS_60 0.5 + float endstop_adj[3] = { 0 }; + // these are the default values, can be overriden with M665 + float delta_radius = DELTA_RADIUS; + float delta_tower1_x = -SIN_60 * delta_radius; // front left tower + float delta_tower1_y = -COS_60 * delta_radius; + float delta_tower2_x = SIN_60 * delta_radius; // front right tower + float delta_tower2_y = -COS_60 * delta_radius; + float delta_tower3_x = 0; // back middle tower + float delta_tower3_y = delta_radius; + float delta_diagonal_rod = DELTA_DIAGONAL_ROD; + float delta_diagonal_rod_2 = sq(delta_diagonal_rod); + float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; + #ifdef ENABLE_AUTO_BED_LEVELING + int delta_grid_spacing[2] = { 0, 0 }; + float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; #endif - - #ifdef SCARA - float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 - #endif - -#elif !defined(DELTA) +#else static bool home_all_axis = true; #endif +#ifdef SCARA + static float delta[3] = { 0 }; + float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 +#endif + #ifdef FILAMENT_SENSOR //Variables for Filament Sensor input float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 From a469d796e16368beef2f5f8e5fbd1aa26e4238bd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 18:14:57 -0700 Subject: [PATCH 186/302] Add cleanups needed for #1772 --- Marlin/Conditionals.h | 1 + Marlin/Configuration.h | 24 ++++++++--------- Marlin/Marlin_main.cpp | 26 +++++++++---------- Marlin/configurator/config/Configuration.h | 14 ++++++++++ .../Felix/Configuration.h | 14 ++++++++++ .../Felix/Configuration_DUAL.h | 14 ++++++++++ .../Hephestos/Configuration.h | 14 ++++++++++ .../K8200/Configuration.h | 14 ++++++++++ .../SCARA/Configuration.h | 14 ++++++++++ .../WITBOX/Configuration.h | 14 ++++++++++ .../delta/generic/Configuration.h | 14 ++++++++++ .../delta/kossel_mini/Configuration.h | 14 ++++++++++ .../makibox/Configuration.h | 14 ++++++++++ .../tvrrug/Round2/Configuration.h | 14 ++++++++++ 14 files changed, 180 insertions(+), 25 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 8e50deee5..5d3213e0e 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -389,6 +389,7 @@ #define HAS_Z_MAX (PIN_EXISTS(Z_MAX)) #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) + #define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE)) #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4dd2d1020..321c25f97 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -499,19 +499,19 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif -// Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. -// If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. -// If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. -// WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. -// To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. -// If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. -// RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 -// for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. -// The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. -// D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. -// WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. -// #define Z_PROBE_ENDSTOP + //#define Z_PROBE_ENDSTOP #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e5261e85c..f9a1ed60b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1226,13 +1226,14 @@ inline void sync_plan_position() { st_synchronize(); - #if defined(Z_PROBE_ENDSTOP) + #ifdef Z_PROBE_ENDSTOP bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); - if (z_probe_endstop) { + if (z_probe_endstop) #else bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) { + if (z_min_endstop) #endif + { if (!Stopped) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); @@ -1300,13 +1301,14 @@ inline void sync_plan_position() { st_synchronize(); - #if defined(Z_PROBE_ENDSTOP) + #ifdef Z_PROBE_ENDSTOP bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); - if (!z_probe_endstop) { + if (!z_probe_endstop) #else bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) { + if (!z_min_endstop) #endif + { if (!Stopped) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); @@ -2778,14 +2780,12 @@ inline void gcode_M42() { #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST) // This is redudant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity. - #if defined (Z_PROBE_ENDSTOP) - #if (! defined (Z_PROBE_PIN) || Z_PROBE_PIN == -1) + #ifdef Z_PROBE_ENDSTOP + #if !HAS_Z_PROBE #error "You must have a Z_PROBE_PIN defined in order to enable calculation of Z-Probe repeatability." #endif - #else - #if (Z_MIN_PIN == -1) - #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability." - #endif + #elif !HAS_Z_MIN + #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability." #endif /** @@ -3515,7 +3515,7 @@ inline void gcode_M119() { SERIAL_PROTOCOLPGM(MSG_Z2_MAX); SERIAL_PROTOCOLLN(((READ(Z2_MAX_PIN)^Z2_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif - #if defined(Z_PROBE_PIN) && Z_PROBE_PIN > -1 + #if HAS_Z_PROBE SERIAL_PROTOCOLPGM(MSG_Z_PROBE); SERIAL_PROTOCOLLN(((READ(Z_PROBE_PIN)^Z_PROBE_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN)); #endif diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 3e1a56dc4..3d9f63424 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -519,6 +519,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4c8353823..7f0b03049 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -469,6 +469,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index a0ecacd92..fbb144514 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -469,6 +469,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index e66222346..366576021 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -492,6 +492,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 854367af8..7ddf21e2b 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -497,6 +497,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 15fde93f8..a00a7b6e9 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -521,6 +521,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 5bccb9827..902985f31 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -491,6 +491,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 1403ddd2d..699b8a3b4 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -537,6 +537,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 420dfa9e4..2e4ebb386 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -541,6 +541,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 55e26ebf8..5c8e1d87d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -489,6 +489,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 6b781b7a4..12bab57e3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -491,6 +491,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif + // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop. + // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. + // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. + // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. + // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. + // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 + // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. + // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works. + // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file. + // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework. + + //#define Z_PROBE_ENDSTOP + #endif // ENABLE_AUTO_BED_LEVELING From 1ad5fb11781a661263e789a382bdee84b41e7f8c Mon Sep 17 00:00:00 2001 From: quillford Date: Fri, 3 Apr 2015 18:36:01 -0700 Subject: [PATCH 187/302] Fixed README typos --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2ecb9d8e8..8d06c080d 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ ## Quick Information This is a firmware for reprap single-processor electronics setups. -It also works on the Ultimaker PCB. It supports printing from SD card+Folders, and look-ahead trajectory planning. -This firmware is a mashup between [Sprinter](https://github.com/kliment/Sprinter), [grbl](https://github.com/simen/grbl) and many original parts. +It also works on the Ultimaker PCB. It supports printing from SD card+Folders and look-ahead trajectory planning. +This firmware is a mashup between [Sprinter](https://github.com/kliment/Sprinter), [grbl](https://github.com/simen/grbl), and many original parts. ## Current Status: Bug Fixing @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware) +__IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware)) ## Credits @@ -41,8 +41,8 @@ The current Marlin dev team consists of: - [@daid](https://github.com/daid) Sprinters lead developers are Kliment and caru. -Grbls lead developer is Simen Svale Skogsrud. -Sonney Jeon (Chamnit) improved some parts of grbl +Grbl's lead developer is Simen Svale Skogsrud. +Sonney Jeon (Chamnit) improved some parts of grbl. A fork by bkubicek for the Ultimaker was merged. More features have been added by: From abd7fc36b68796413ca421a3e9d30bec93a7cdcf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 18:54:55 -0700 Subject: [PATCH 188/302] Fix probe height at G28 start --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f9a1ed60b..f160f07a4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2306,7 +2306,7 @@ inline void gcode_G28() { // raise extruder float measured_z, - z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0); + z_before = probePointCounter ? Z_RAISE_BETWEEN_PROBINGS + current_position[Z_AXIS] : Z_RAISE_BEFORE_PROBING; #ifdef DELTA // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. From b98ebd517ea548df393fc0617cdfba9edd16ee19 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 19:25:22 -0700 Subject: [PATCH 189/302] disable / enable_all_steppers functions --- Marlin/Marlin.h | 3 +++ Marlin/Marlin_main.cpp | 24 ++++++++++++++---------- Marlin/planner.cpp | 6 +++--- Marlin/stepper.cpp | 8 +------- Marlin/temperature.cpp | 8 +------- 5 files changed, 22 insertions(+), 27 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1f295a65a..363a5e500 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -179,6 +179,9 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_e3() /* nothing */ #endif +void enable_all_steppers(); +void disable_all_steppers(); + enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; //X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a21fcbd74..8f8e69c85 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2569,13 +2569,7 @@ inline void gcode_G92() { */ inline void gcode_M17() { LCD_MESSAGEPGM(MSG_NO_MOVE); - enable_x(); - enable_y(); - enable_z(); - enable_e0(); - enable_e1(); - enable_e2(); - enable_e3(); + enable_all_steppers(); } #ifdef SDSUPPORT @@ -5695,7 +5689,17 @@ void handle_status_leds(void) { } #endif -void disable_all_axes() { +void enable_all_steppers() { + enable_x(); + enable_y(); + enable_z(); + enable_e0(); + enable_e1(); + enable_e2(); + enable_e3(); +} + +void disable_all_steppers() { disable_x(); disable_y(); disable_z(); @@ -5723,7 +5727,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time && !ignore_stepper_queue && !blocks_queued()) - disable_all_axes(); + disable_all_steppers(); #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH if (chdkActive && ms > chdkHigh + CHDK_DELAY) { @@ -5811,7 +5815,7 @@ void kill() cli(); // Stop interrupts disable_heater(); - disable_all_axes(); + disable_all_steppers(); #if HAS_POWER_SWITCH pinMode(PS_ON_PIN, INPUT); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d7d33c170..8d8d2e3c4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -614,7 +614,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 1 case 1: enable_e1(); - g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); #if EXTRUDERS > 2 if (g_uc_extruder_last_move[2] == 0) disable_e2(); @@ -626,7 +626,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 2 case 2: enable_e2(); - g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); #if EXTRUDERS > 3 @@ -636,7 +636,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 3 case 3: enable_e3(); - g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); if (g_uc_extruder_last_move[2] == 0) disable_e2(); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 6f12bc9b2..ba4a4e967 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1127,13 +1127,7 @@ long st_get_position(uint8_t axis) { void finishAndDisableSteppers() { st_synchronize(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); + disable_all_steppers(); } void quickStop() { diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 5a8da9406..4afb8dc09 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1051,13 +1051,7 @@ void setWatch() { thermal_runaway = true; for (;;) { disable_heater(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); - disable_e3(); + disable_all_steppers(); manage_heater(); lcd_update(); } From 528e32a1d4fe035fc7d4ac239c4f3443173f1c13 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 19:34:55 -0700 Subject: [PATCH 190/302] Fix timeout in thermal_runaway when temperature is set higher --- Marlin/temperature.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 4afb8dc09..8b70ae393 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1006,6 +1006,9 @@ void setWatch() { #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { + + static int tr_target_temperature = 0; + /* SERIAL_ECHO_START; SERIAL_ECHO("Thermal Thermal Runaway Running. Heater ID:"); @@ -1029,19 +1032,27 @@ void setWatch() { switch (*state) { // Inactive state waits for a target temperature to be set case TRInactive: - if (target_temperature > 0) *state = TRFirstHeating; + if (target_temperature > 0) { + *state = TRFirstHeating; + tr_target_temperature = target_temperature; + } break; // When first heating, wait for the temperature to be reached then go to Stable state case TRFirstHeating: - if (temperature >= target_temperature) *state = TRStable; + if (temperature >= tr_target_temperature) *state = TRStable; break; // While the temperature is stable watch for a bad temperature case TRStable: { - // Whenever the current temperature is over the target (-hysteresis) restart the timer - if (temperature >= target_temperature - hysteresis_degc) { - *timer = millis(); + // If the target temperature changes, restart + if (tr_target_temperature != target_temperature) { + *state = TRInactive; + break; } + + // If the temperature is over the target (-hysteresis) restart the timer + if (temperature >= tr_target_temperature - hysteresis_degc) *timer = millis(); + // If the timer goes too long without a reset, trigger shutdown else if (millis() > *timer + period_seconds * 1000UL) { SERIAL_ERROR_START; @@ -1060,7 +1071,7 @@ void setWatch() { } } -#endif // HAS_HEATER_THERMAL_PROTECTION +#endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION void disable_heater() { for (int i=0; i Date: Fri, 3 Apr 2015 19:42:40 -0700 Subject: [PATCH 191/302] Track target temperature separately for each heater --- Marlin/temperature.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 8b70ae393..c0e427a65 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -646,7 +646,7 @@ void manage_heater() { #if TEMP_SENSOR_BED != 0 #if HAS_BED_THERMAL_PROTECTION - thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, 9, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS); + thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS); #endif #ifdef PIDTEMPBED @@ -1007,21 +1007,21 @@ void setWatch() { void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { - static int tr_target_temperature = 0; + static int tr_target_temperature[EXTRUDERS+1]; /* SERIAL_ECHO_START; - SERIAL_ECHO("Thermal Thermal Runaway Running. Heater ID:"); - SERIAL_ECHO(heater_id); - SERIAL_ECHO(" ; State:"); - SERIAL_ECHO(*state); - SERIAL_ECHO(" ; Timer:"); - SERIAL_ECHO(*timer); - SERIAL_ECHO(" ; Temperature:"); - SERIAL_ECHO(temperature); - SERIAL_ECHO(" ; Target Temp:"); - SERIAL_ECHO(target_temperature); - SERIAL_ECHOLN(""); + SERIAL_ECHOPGM("Thermal Thermal Runaway Running. Heater ID: "); + if (heater_id < 0) SERIAL_ECHOPGM("bed"); else SERIAL_ECHOPGM(heater_id); + SERIAL_ECHOPGM(" ; State:"); + SERIAL_ECHOPGM(*state); + SERIAL_ECHOPGM(" ; Timer:"); + SERIAL_ECHOPGM(*timer); + SERIAL_ECHOPGM(" ; Temperature:"); + SERIAL_ECHOPGM(temperature); + SERIAL_ECHOPGM(" ; Target Temp:"); + SERIAL_ECHOPGM(target_temperature); + SERIAL_EOL; */ if (target_temperature == 0 || thermal_runaway) { *state = TRInactive; @@ -1029,35 +1029,37 @@ void setWatch() { return; } + int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS; + switch (*state) { // Inactive state waits for a target temperature to be set case TRInactive: if (target_temperature > 0) { *state = TRFirstHeating; - tr_target_temperature = target_temperature; + tr_target_temperature[heater_index] = target_temperature; } break; // When first heating, wait for the temperature to be reached then go to Stable state case TRFirstHeating: - if (temperature >= tr_target_temperature) *state = TRStable; + if (temperature >= tr_target_temperature[heater_index]) *state = TRStable; break; // While the temperature is stable watch for a bad temperature case TRStable: { // If the target temperature changes, restart - if (tr_target_temperature != target_temperature) { + if (tr_target_temperature[heater_index] != target_temperature) { *state = TRInactive; break; } // If the temperature is over the target (-hysteresis) restart the timer - if (temperature >= tr_target_temperature - hysteresis_degc) *timer = millis(); + if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) *timer = millis(); // If the timer goes too long without a reset, trigger shutdown else if (millis() > *timer + period_seconds * 1000UL) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); - SERIAL_ERRORLN((int)heater_id); + if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id); LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); thermal_runaway = true; for (;;) { From 84e4edaea76546c250750b275cd586c1d165464f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 19:52:00 -0700 Subject: [PATCH 192/302] Add M48 comment for #1794 --- Marlin/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8f8e69c85..bc6ea3c13 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -110,6 +110,7 @@ // Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). // The '#' is necessary when calling from within sd files, as it stops buffer prereading // M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. +// M48 - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel] // M80 - Turn on Power Supply // M81 - Turn off Power Supply // M82 - Set E codes absolute (default) From e0d4368cb50730f130851729a18b4ac4b64fe7d9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 20:45:24 -0700 Subject: [PATCH 193/302] Minor code cleanup, move NUM_AXIS out of config --- Marlin/Configuration.h | 6 ++- Marlin/Marlin.h | 45 ++++++++++++------- Marlin/configurator/config/Configuration.h | 6 ++- .../Felix/Configuration.h | 6 ++- .../Felix/Configuration_DUAL.h | 6 ++- .../Hephestos/Configuration.h | 6 ++- .../K8200/Configuration.h | 6 ++- .../SCARA/Configuration.h | 6 ++- .../WITBOX/Configuration.h | 6 ++- .../delta/generic/Configuration.h | 6 ++- .../delta/kossel_mini/Configuration.h | 6 ++- .../makibox/Configuration.h | 6 ++- .../tvrrug/Round2/Configuration.h | 6 ++- Marlin/planner.cpp | 6 +-- 14 files changed, 80 insertions(+), 43 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 321c25f97..5d9586808 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -529,8 +529,10 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1f295a65a..6a0f21f3b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -93,18 +93,15 @@ void serial_echopair_P(const char *s_P, double v); void serial_echopair_P(const char *s_P, unsigned long v); -//Things to write to serial from Program memory. Saves 400 to 2k of RAM. -FORCE_INLINE void serialprintPGM(const char *str) -{ - char ch=pgm_read_byte(str); - while(ch) - { +// Things to write to serial from Program memory. Saves 400 to 2k of RAM. +FORCE_INLINE void serialprintPGM(const char *str) { + char ch = pgm_read_byte(str); + while(ch) { MYSERIAL.write(ch); - ch=pgm_read_byte(++str); + ch = pgm_read_byte(++str); } } - void get_command(); void process_commands(); @@ -148,7 +145,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if HAS_E0_ENABLE - #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e0() /* nothing */ @@ -156,7 +153,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if (EXTRUDERS > 1) && HAS_E1_ENABLE - #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e1() /* nothing */ @@ -164,7 +161,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if (EXTRUDERS > 2) && HAS_E2_ENABLE - #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e2() /* nothing */ @@ -172,15 +169,25 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if (EXTRUDERS > 3) && HAS_E3_ENABLE - #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e3() /* nothing */ #define disable_e3() /* nothing */ #endif +/** + * The axis order in all axis related arrays is X, Y, Z, E + */ +#define NUM_AXIS 4 + +/** + * Axis indices as enumerated constants + * + * A_AXIS and B_AXIS are used by COREXY printers + * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. + */ enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; -//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. void FlushSerialRequestResend(); void ClearToSend(); @@ -224,7 +231,7 @@ void refresh_cmd_timeout(void); #ifndef CRITICAL_SECTION_START #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); #define CRITICAL_SECTION_END SREG = _sreg; -#endif //CRITICAL_SECTION_START +#endif extern float homing_feedrate[]; extern bool axis_relative_modes[]; @@ -233,8 +240,9 @@ extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner -extern float current_position[NUM_AXIS] ; +extern float current_position[NUM_AXIS]; extern float home_offset[3]; + #ifdef DELTA extern float endstop_adj[3]; extern float delta_radius; @@ -242,18 +250,23 @@ extern float home_offset[3]; extern float delta_segments_per_second; void recalc_delta_settings(float radius, float diagonal_rod); #elif defined(Z_DUAL_ENDSTOPS) -extern float z_endstop_adj; + extern float z_endstop_adj; #endif + #ifdef SCARA extern float axis_scaling[3]; // Build size scaling #endif + extern float min_pos[3]; extern float max_pos[3]; extern bool axis_known_position[3]; + #ifdef ENABLE_AUTO_BED_LEVELING extern float zprobe_zoffset; #endif + extern int fanSpeed; + #ifdef BARICUDA extern int ValvePressure; extern int EtoPPressure; diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 3d9f63424..ca0b2d079 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -553,8 +553,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // @section movement -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 7f0b03049..dfd79a0d9 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index fbb144514..98dea404b 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 366576021..7eceefb98 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -522,8 +522,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {2000, 2000, 150, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 7ddf21e2b..3a6aea9b1 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -527,8 +527,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index a00a7b6e9..2616f155f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -551,8 +551,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 902985f31..d7d32d088 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 699b8a3b4..ac13788b2 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -566,8 +566,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + // delta homing speeds must be the same on xyz #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0} // set the homing speeds (mm/min) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 2e4ebb386..38f502355 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -570,8 +570,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + // delta homing speeds must be the same on xyz #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0} // set the homing speeds (mm/min) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 5c8e1d87d..24c3e5b4d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -519,8 +519,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {1500, 1500, 120, 0} // set the homing speeds (mm/min) ***** MakiBox A6 ***** // default settings diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 12bab57e3..649046b88 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d7d33c170..8d8d2e3c4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -614,7 +614,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 1 case 1: enable_e1(); - g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); #if EXTRUDERS > 2 if (g_uc_extruder_last_move[2] == 0) disable_e2(); @@ -626,7 +626,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 2 case 2: enable_e2(); - g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); #if EXTRUDERS > 3 @@ -636,7 +636,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 3 case 3: enable_e3(); - g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); if (g_uc_extruder_last_move[2] == 0) disable_e2(); From 1e5c18bb148f84f2bcb2f38bf0ce53b62148bdb3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 21:43:30 -0700 Subject: [PATCH 194/302] Add code_value_short and SERIAL_CHAR --- Marlin/Marlin.h | 22 ++--- Marlin/MarlinSerial.cpp | 3 +- Marlin/Marlin_main.cpp | 195 +++++++++++++++++++++------------------- Marlin/cardreader.cpp | 12 +-- Marlin/vector_3.cpp | 4 +- 5 files changed, 122 insertions(+), 114 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 6a0f21f3b..1ea5ba57f 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -62,31 +62,33 @@ #define MYSERIAL MSerial #endif -#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x)) -#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y)) -#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x))) -#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n')) -#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n')) +#define SERIAL_CHAR(x) MYSERIAL.write(x) +#define SERIAL_EOL SERIAL_CHAR('\n') + +#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x) +#define SERIAL_PROTOCOL(x) MYSERIAL.print(x) +#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y) +#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) +#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x),MYSERIAL.write('\n'); }while(0) +#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)),MYSERIAL.write('\n'); }while(0) extern const char errormagic[] PROGMEM; extern const char echomagic[] PROGMEM; -#define SERIAL_ERROR_START (serialprintPGM(errormagic)) +#define SERIAL_ERROR_START serialprintPGM(errormagic) #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHO_START (serialprintPGM(echomagic)) +#define SERIAL_ECHO_START serialprintPGM(echomagic) #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value))) - -#define SERIAL_EOL MYSERIAL.write('\n') +#define SERIAL_ECHOPAIR(name,value) do{ serial_echopair_P(PSTR(name),(value)); }while(0) void serial_echopair_P(const char *s_P, float v); void serial_echopair_P(const char *s_P, double v); diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index d8477b6db..fcba93256 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -268,8 +268,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits) { print(int_part); // Print the decimal point, but only if there are digits beyond - if (digits > 0) - print("."); + if (digits > 0) print('.'); // Extract digits from the remainder one at a time while (digits-- > 0) { diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f160f07a4..566f6c65f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -242,7 +242,7 @@ static unsigned long max_inactive_time = 0; static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l; unsigned long starttime = 0; ///< Print job start time unsigned long stoptime = 0; ///< Print job stop time -static uint8_t tmp_extruder; +static uint8_t target_extruder; bool Stopped = false; bool CooldownNoWait = true; bool target_direction; @@ -856,7 +856,9 @@ float code_value() { return ret; } -long code_value_long() { return (strtol(strchr_pointer + 1, NULL, 10)); } +long code_value_long() { return strtol(strchr_pointer + 1, NULL, 10); } + +int16_t code_value_short() { return (int16_t)strtol(strchr_pointer + 1, NULL, 10); } bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); @@ -1409,9 +1411,9 @@ inline void sync_plan_position() { for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { SERIAL_PROTOCOL_F(bed_level[x][y], 2); - SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOLCHAR(' '); } - SERIAL_ECHOLN(""); + SERIAL_EOL; } } @@ -1684,7 +1686,7 @@ inline void gcode_G2_G3(bool clockwise) { * G4: Dwell S or P */ inline void gcode_G4() { - unsigned long codenum=0; + unsigned long codenum = 0; LCD_MESSAGEPGM(MSG_DWELL); @@ -1710,7 +1712,7 @@ inline void gcode_G4() { inline void gcode_G10_G11(bool doRetract=false) { #if EXTRUDERS > 1 if (doRetract) { - retracted_swap[active_extruder] = (code_seen('S') && code_value_long() == 1); // checks for swap retract argument + retracted_swap[active_extruder] = (code_seen('S') && code_value_short() == 1); // checks for swap retract argument } #endif retract(doRetract @@ -2028,7 +2030,7 @@ inline void gcode_G28() { inline void gcode_G29() { static int probe_point = -1; - MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_long() : MeshReport; + MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_short() : MeshReport; if (state < 0 || state > 2) { SERIAL_PROTOCOLLNPGM("S out of range (0-2)."); return; @@ -2039,7 +2041,7 @@ inline void gcode_G28() { if (mbl.active) { SERIAL_PROTOCOLPGM("Num X,Y: "); SERIAL_PROTOCOL(MESH_NUM_X_POINTS); - SERIAL_PROTOCOLPGM(","); + SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); SERIAL_PROTOCOLPGM("\nZ search height: "); SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z); @@ -2155,7 +2157,7 @@ inline void gcode_G28() { return; } - int verbose_level = code_seen('V') || code_seen('v') ? code_value_long() : 1; + int verbose_level = code_seen('V') || code_seen('v') ? code_value_short() : 1; if (verbose_level < 0 || verbose_level > 4) { SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4)."); return; @@ -2177,19 +2179,19 @@ inline void gcode_G28() { int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; #ifndef DELTA - if (code_seen('P')) auto_bed_leveling_grid_points = code_value_long(); + if (code_seen('P')) auto_bed_leveling_grid_points = code_value_short(); if (auto_bed_leveling_grid_points < 2) { SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n"); return; } #endif - xy_travel_speed = code_seen('S') ? code_value_long() : XY_TRAVEL_SPEED; + xy_travel_speed = code_seen('S') ? code_value_short() : XY_TRAVEL_SPEED; - int left_probe_bed_position = code_seen('L') ? code_value_long() : LEFT_PROBE_BED_POSITION, - right_probe_bed_position = code_seen('R') ? code_value_long() : RIGHT_PROBE_BED_POSITION, - front_probe_bed_position = code_seen('F') ? code_value_long() : FRONT_PROBE_BED_POSITION, - back_probe_bed_position = code_seen('B') ? code_value_long() : BACK_PROBE_BED_POSITION; + int left_probe_bed_position = code_seen('L') ? code_value_short() : LEFT_PROBE_BED_POSITION, + right_probe_bed_position = code_seen('R') ? code_value_short() : RIGHT_PROBE_BED_POSITION, + front_probe_bed_position = code_seen('F') ? code_value_short() : FRONT_PROBE_BED_POSITION, + back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION; bool left_out_l = left_probe_bed_position < MIN_PROBE_X, left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE, @@ -2393,7 +2395,7 @@ inline void gcode_G28() { if (diff >= 0.0) SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment else - SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOLCHAR(' '); SERIAL_PROTOCOL_F(diff, 5); } // xx SERIAL_EOL; @@ -2517,11 +2519,11 @@ inline void gcode_G92() { unsigned long codenum = 0; bool hasP = false, hasS = false; if (code_seen('P')) { - codenum = code_value(); // milliseconds to wait + codenum = code_value_short(); // milliseconds to wait hasP = codenum > 0; } if (code_seen('S')) { - codenum = code_value() * 1000; // seconds to wait + codenum = code_value_short() * 1000UL; // seconds to wait hasS = codenum > 0; } char* starpos = strchr(src, '*'); @@ -2633,7 +2635,7 @@ inline void gcode_M17() { */ inline void gcode_M26() { if (card.cardOK && code_seen('S')) - card.setIndex(code_value_long()); + card.setIndex(code_value_short()); } /** @@ -2724,7 +2726,7 @@ inline void gcode_M31() { card.openFile(namestartpos, true, !call_procedure); if (code_seen('S') && strchr_pointer < namestartpos) // "S" (must occur _before_ the filename!) - card.setIndex(code_value_long()); + card.setIndex(code_value_short()); card.startFileprint(); if (!call_procedure) @@ -2752,11 +2754,11 @@ inline void gcode_M31() { */ inline void gcode_M42() { if (code_seen('S')) { - int pin_status = code_value(), + int pin_status = code_value_short(), pin_number = LED_PIN; if (code_seen('P') && pin_status >= 0 && pin_status <= 255) - pin_number = code_value(); + pin_number = code_value_short(); for (int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins) / sizeof(*sensitive_pins)); i++) { if (sensitive_pins[i] == pin_number) { @@ -2815,7 +2817,7 @@ inline void gcode_M42() { int verbose_level = 1, n_samples = 10, n_legs = 0; if (code_seen('V') || code_seen('v')) { - verbose_level = code_value(); + verbose_level = code_value_short(); if (verbose_level < 0 || verbose_level > 4 ) { SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); return; @@ -2826,7 +2828,7 @@ inline void gcode_M42() { SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`! - n_samples = code_value(); + n_samples = code_value_short(); if (n_samples < 4 || n_samples > 50) { SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); return; @@ -2859,7 +2861,7 @@ inline void gcode_M42() { } if (code_seen('L') || code_seen('l')) { - n_legs = code_value(); + n_legs = code_value_short(); if (n_legs == 1) n_legs = 2; if (n_legs < 0 || n_legs > 15) { SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); @@ -3041,12 +3043,15 @@ inline void gcode_M42() { inline void gcode_M104() { if (setTargetedHotend(104)) return; - if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder); - #ifdef DUAL_X_CARRIAGE - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0) - setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset); - #endif - setWatch(); + if (code_seen('S')) { + float temp = code_value(); + setTargetHotend(temp, target_extruder); + #ifdef DUAL_X_CARRIAGE + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) + setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset); + #endif + setWatch(); + } } /** @@ -3057,9 +3062,9 @@ inline void gcode_M105() { #if HAS_TEMP_0 SERIAL_PROTOCOLPGM("ok T:"); - SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1); + SERIAL_PROTOCOL_F(degHotend(target_extruder),1); SERIAL_PROTOCOLPGM(" /"); - SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1); + SERIAL_PROTOCOL_F(degTargetHotend(target_extruder),1); #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(degBed(),1); @@ -3069,7 +3074,7 @@ inline void gcode_M105() { for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(cur_extruder); - SERIAL_PROTOCOLPGM(":"); + SERIAL_PROTOCOLCHAR(':'); SERIAL_PROTOCOL_F(degHotend(cur_extruder),1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1); @@ -3081,16 +3086,16 @@ inline void gcode_M105() { SERIAL_PROTOCOLPGM(" @:"); #ifdef EXTRUDER_WATTS - SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(tmp_extruder))/127); - SERIAL_PROTOCOLPGM("W"); + SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder))/127); + SERIAL_PROTOCOLCHAR('W'); #else - SERIAL_PROTOCOL(getHeaterPower(tmp_extruder)); + SERIAL_PROTOCOL(getHeaterPower(target_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); #ifdef BED_WATTS SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127); - SERIAL_PROTOCOLPGM("W"); + SERIAL_PROTOCOLCHAR('W'); #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif @@ -3105,7 +3110,7 @@ inline void gcode_M105() { for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(cur_extruder); - SERIAL_PROTOCOLPGM(":"); + SERIAL_PROTOCOLCHAR(':'); SERIAL_PROTOCOL_F(degHotend(cur_extruder),1); SERIAL_PROTOCOLPGM("C->"); SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0); @@ -3120,7 +3125,7 @@ inline void gcode_M105() { /** * M106: Set Fan Speed */ - inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value(), 0, 255) : 255; } + inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value_short(), 0, 255) : 255; } /** * M107: Fan Off @@ -3139,10 +3144,11 @@ inline void gcode_M109() { CooldownNoWait = code_seen('S'); if (CooldownNoWait || code_seen('R')) { - setTargetHotend(code_value(), tmp_extruder); + float temp = code_value(); + setTargetHotend(temp, target_extruder); #ifdef DUAL_X_CARRIAGE - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0) - setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset); + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) + setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset); #endif } @@ -3158,7 +3164,7 @@ inline void gcode_M109() { unsigned long timetemp = millis(); /* See if we are heating up or cooling down */ - target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling + target_direction = isHeatingHotend(target_extruder); // true if heating, false if cooling cancel_heatup = false; @@ -3169,15 +3175,15 @@ inline void gcode_M109() { while((!cancel_heatup)&&((residencyStart == -1) || (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) #else - while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) ) + while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(CooldownNoWait==false)) ) #endif //TEMP_RESIDENCY_TIME { // while loop if (millis() > timetemp + 1000UL) { //Print temp & remaining time every 1s while waiting SERIAL_PROTOCOLPGM("T:"); - SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1); + SERIAL_PROTOCOL_F(degHotend(target_extruder),1); SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL((int)tmp_extruder); + SERIAL_PROTOCOL((int)target_extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { @@ -3198,9 +3204,9 @@ inline void gcode_M109() { #ifdef TEMP_RESIDENCY_TIME // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time // or when current temp falls outside the hysteresis after target temp was reached - if ((residencyStart == -1 && target_direction && (degHotend(tmp_extruder) >= (degTargetHotend(tmp_extruder)-TEMP_WINDOW))) || - (residencyStart == -1 && !target_direction && (degHotend(tmp_extruder) <= (degTargetHotend(tmp_extruder)+TEMP_WINDOW))) || - (residencyStart > -1 && labs(degHotend(tmp_extruder) - degTargetHotend(tmp_extruder)) > TEMP_HYSTERESIS) ) + if ((residencyStart == -1 && target_direction && (degHotend(target_extruder) >= (degTargetHotend(target_extruder)-TEMP_WINDOW))) || + (residencyStart == -1 && !target_direction && (degHotend(target_extruder) <= (degTargetHotend(target_extruder)+TEMP_WINDOW))) || + (residencyStart > -1 && labs(degHotend(target_extruder) - degTargetHotend(target_extruder)) > TEMP_HYSTERESIS) ) { residencyStart = millis(); } @@ -3538,9 +3544,9 @@ inline void gcode_M121() { enable_endstops(true); } */ inline void gcode_M150() { SendColors( - code_seen('R') ? (byte)code_value() : 0, - code_seen('U') ? (byte)code_value() : 0, - code_seen('B') ? (byte)code_value() : 0 + code_seen('R') ? (byte)code_value_short() : 0, + code_seen('U') ? (byte)code_value_short() : 0, + code_seen('B') ? (byte)code_value_short() : 0 ); } @@ -3552,9 +3558,9 @@ inline void gcode_M121() { enable_endstops(true); } * D */ inline void gcode_M200() { - tmp_extruder = active_extruder; + int tmp_extruder = active_extruder; if (code_seen('T')) { - tmp_extruder = code_value(); + tmp_extruder = code_value_short(); if (tmp_extruder >= EXTRUDERS) { SERIAL_ECHO_START; SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER); @@ -3625,27 +3631,23 @@ inline void gcode_M203() { * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate */ inline void gcode_M204() { - if (code_seen('S')) // Kept for legacy compatibility. Should NOT BE USED for new developments. - { + if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. acceleration = code_value(); travel_acceleration = acceleration; - SERIAL_ECHOPAIR("Setting Printing and Travelling Acceleration: ", acceleration ); + SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", acceleration ); SERIAL_EOL; } - if (code_seen('P')) - { + if (code_seen('P')) { acceleration = code_value(); - SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration ); + SERIAL_ECHOPAIR("Setting Print Acceleration: ", acceleration ); SERIAL_EOL; } - if (code_seen('R')) - { + if (code_seen('R')) { retract_acceleration = code_value(); SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration ); SERIAL_EOL; } - if (code_seen('T')) - { + if (code_seen('T')) { travel_acceleration = code_value(); SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration ); SERIAL_EOL; @@ -3748,7 +3750,7 @@ inline void gcode_M206() { */ inline void gcode_M209() { if (code_seen('S')) { - int t = code_value(); + int t = code_value_short(); switch(t) { case 0: autoretract_enabled = false; @@ -3777,23 +3779,23 @@ inline void gcode_M206() { inline void gcode_M218() { if (setTargetedHotend(218)) return; - if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value(); - if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value(); + if (code_seen('X')) extruder_offset[X_AXIS][target_extruder] = code_value(); + if (code_seen('Y')) extruder_offset[Y_AXIS][target_extruder] = code_value(); #ifdef DUAL_X_CARRIAGE - if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value(); + if (code_seen('Z')) extruder_offset[Z_AXIS][target_extruder] = code_value(); #endif SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) { - SERIAL_ECHO(" "); - SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]); - SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]); + for (int e = 0; e < EXTRUDERS; e++) { + SERIAL_CHAR(' '); + SERIAL_ECHO(extruder_offset[X_AXIS][e]); + SERIAL_CHAR(','); + SERIAL_ECHO(extruder_offset[Y_AXIS][e]); #ifdef DUAL_X_CARRIAGE - SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]); + SERIAL_CHAR(','); + SERIAL_ECHO(extruder_offset[Z_AXIS][e]); #endif } SERIAL_EOL; @@ -3816,7 +3818,7 @@ inline void gcode_M221() { int sval = code_value(); if (code_seen('T')) { if (setTargetedHotend(221)) return; - extruder_multiply[tmp_extruder] = sval; + extruder_multiply[target_extruder] = sval; } else { extruder_multiply[active_extruder] = sval; @@ -4047,7 +4049,7 @@ inline void gcode_M226() { * M250: Read and optionally set the LCD contrast */ inline void gcode_M250() { - if (code_seen('C')) lcd_setcontrast(code_value_long() & 0x3F); + if (code_seen('C')) lcd_setcontrast(code_value_short() & 0x3F); SERIAL_PROTOCOLPGM("lcd contrast value: "); SERIAL_PROTOCOL(lcd_contrast); SERIAL_PROTOCOLLN(""); @@ -4073,8 +4075,8 @@ inline void gcode_M226() { * C */ inline void gcode_M303() { - int e = code_seen('E') ? code_value_long() : 0; - int c = code_seen('C') ? code_value_long() : 5; + int e = code_seen('E') ? code_value_short() : 0; + int c = code_seen('C') ? code_value_short() : 5; float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0); PID_autotune(temp, e, c); } @@ -4483,13 +4485,13 @@ inline void gcode_M503() { if (code_seen('R')) duplicate_extruder_temp_offset = code_value(); SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - SERIAL_ECHO(" "); + SERIAL_CHAR(' '); SERIAL_ECHO(extruder_offset[X_AXIS][0]); - SERIAL_ECHO(","); + SERIAL_CHAR(','); SERIAL_ECHO(extruder_offset[Y_AXIS][0]); - SERIAL_ECHO(" "); + SERIAL_CHAR(' '); SERIAL_ECHO(duplicate_extruder_x_offset); - SERIAL_ECHO(","); + SERIAL_CHAR(','); SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]); break; case DXC_FULL_CONTROL_MODE: @@ -4562,7 +4564,7 @@ inline void gcode_M907() { * S# determines MS1 or MS2, X# sets the pin high/low. */ inline void gcode_M351() { - if (code_seen('S')) switch(code_value_long()) { + if (code_seen('S')) switch(code_value_short()) { case 1: for(int i=0;i= EXTRUDERS) { SERIAL_ECHO_START; - SERIAL_ECHO("T"); + SERIAL_CHAR('T'); SERIAL_ECHO(tmp_extruder); SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); } else { + target_extruder = tmp_extruder; + #if EXTRUDERS > 1 bool make_move = false; #endif + if (code_seen('F')) { + #if EXTRUDERS > 1 make_move = true; #endif + next_feedrate = code_value(); if (next_feedrate > 0.0) feedrate = next_feedrate; } @@ -4692,7 +4699,7 @@ inline void gcode_T() { void process_commands() { if (code_seen('G')) { - int gCode = code_value_long(); + int gCode = code_value_short(); switch(gCode) { @@ -4767,7 +4774,7 @@ void process_commands() { } else if (code_seen('M')) { - switch( code_value_long() ) { + switch(code_value_short()) { #ifdef ULTIPANEL case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD @@ -5922,10 +5929,10 @@ void setPwmFrequency(uint8_t pin, int val) #endif //FAST_PWM_FAN bool setTargetedHotend(int code){ - tmp_extruder = active_extruder; - if(code_seen('T')) { - tmp_extruder = code_value(); - if(tmp_extruder >= EXTRUDERS) { + target_extruder = active_extruder; + if (code_seen('T')) { + target_extruder = code_value_short(); + if (target_extruder >= EXTRUDERS) { SERIAL_ECHO_START; switch(code){ case 104: @@ -5944,7 +5951,7 @@ bool setTargetedHotend(int code){ SERIAL_ECHO(MSG_M221_INVALID_EXTRUDER); break; } - SERIAL_ECHOLN(tmp_extruder); + SERIAL_ECHOLN(target_extruder); return true; } } diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index fae6c1be6..877b72b92 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -249,7 +249,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) if (!myDir.open(curDir, subdirname, O_READ)) { SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(subdirname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); return; } else { @@ -287,14 +287,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) else { SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); } } else { //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); } else { saving = true; @@ -330,7 +330,7 @@ void CardReader::removeFile(char* name) { if (!myDir.open(curDir, subdirname, O_READ)) { SERIAL_PROTOCOLPGM("open failed, File: "); SERIAL_PROTOCOL(subdirname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); return; } else { @@ -360,7 +360,7 @@ void CardReader::removeFile(char* name) { else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); } } @@ -368,7 +368,7 @@ void CardReader::getStatus() { if (cardOK) { SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); SERIAL_PROTOCOL(sdpos); - SERIAL_PROTOCOLPGM("/"); + SERIAL_PROTOCOLCHAR('/'); SERIAL_PROTOCOLLN(filesize); } else { diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp index 243f0838f..9eb3465fb 100644 --- a/Marlin/vector_3.cpp +++ b/Marlin/vector_3.cpp @@ -125,9 +125,9 @@ void matrix_3x3::debug(const char title[]) { int count = 0; for(int i=0; i<3; i++) { for(int j=0; j<3; j++) { - if (matrix[count] >= 0.0) SERIAL_PROTOCOLPGM("+"); + if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+'); SERIAL_PROTOCOL_F(matrix[count], 6); - SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOLCHAR(' '); count++; } SERIAL_EOL; From fc3c76fc1641370ee76a564299592e283cbcd0c0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 22:04:42 -0700 Subject: [PATCH 195/302] Fix #1800 --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index c0e427a65..0cddd0878 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -84,7 +84,7 @@ unsigned char soft_pwm_bed; static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; #endif #if HAS_BED_THERMAL_PROTECTION - static TRState thermal_runaway_bed_state_machine = { TRInactive, TRInactive, TRInactive, TRInactive }; + static TRState thermal_runaway_bed_state_machine = TRInactive; static unsigned long thermal_runaway_bed_timer; #endif #endif From a6ba40ae487d6b204690a7ac967debb1f2c8eb1a Mon Sep 17 00:00:00 2001 From: Natealus Date: Fri, 3 Apr 2015 23:09:31 -0600 Subject: [PATCH 196/302] Compiling error temperature.cpp with multiple extruders defined It wouldn't compile because of this line in temperature.cpp it turns out it was just a stray ( that didn't line up with the previous lines so I just made it in line with the rest and it compiled fine. --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index c0e427a65..ddd9ae3b9 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1556,7 +1556,7 @@ ISR(TIMER0_COMPB_vect) { #else #define GE2 >= #endif - if (current_temperature_raw[2] GE2 (maxttemp_raw[2]) max_temp_error(2); + if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2); if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2); #endif // TEMP_SENSOR_2 From 8680b515b00ab4bccb07883ba0be65f960a06973 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 22:12:49 -0700 Subject: [PATCH 197/302] Fix missing tmp_extruder -> target_extruder --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ba37b42e9..d67f65367 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3059,9 +3059,9 @@ inline void gcode_M105() { SERIAL_PROTOCOLPGM("ok"); #if HAS_TEMP_0 SERIAL_PROTOCOLPGM(" T:"); - SERIAL_PROTOCOL_F(degHotend(tmp_extruder), 1); + SERIAL_PROTOCOL_F(degHotend(target_extruder), 1); SERIAL_PROTOCOLPGM(" /"); - SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder), 1); + SERIAL_PROTOCOL_F(degTargetHotend(target_extruder), 1); #endif #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:"); From ab11f90da0284686a1c6de5cf26357e0c53391ab Mon Sep 17 00:00:00 2001 From: Natealus Date: Fri, 3 Apr 2015 23:14:03 -0600 Subject: [PATCH 198/302] Z_PROBE_ENDSTOP Pin for Azteeg X3 Pro Just a simple #ifdef Z_PROBE_ENDSTOP to define the pin for it. Also has a couple commented lines for switching Z_MIN_PIN if needed. --- Marlin/pins_AZTEEG_X3_PRO.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 0cdc71601..d76874a09 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -34,7 +34,12 @@ #define Z_MAX_PIN 18 #endif // - + #ifdef Z_PROBE_ENDSTOP +//#undef Z_MIN_PIN +//#define Z_MIN_PIN 15 + #define Z_PROBE_PIN 19 + #endif +// #define E2_STEP_PIN 23 #define E2_DIR_PIN 25 #define E2_ENABLE_PIN 40 From c065da52ec81ea66b0d62a282474db195bc38e18 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 22:54:48 -0700 Subject: [PATCH 199/302] Spacing and spelling --- Marlin/Configuration.h | 2 +- Marlin/MarlinSerial.cpp | 5 ++--- Marlin/MarlinSerial.h | 4 ++-- Marlin/Marlin_main.cpp | 6 +++--- Marlin/SanityCheck.h | 2 +- Marlin/Servo.h | 2 +- Marlin/configurator/config/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- .../example_configurations/Felix/Configuration_DUAL.h | 2 +- .../example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- .../delta/generic/Configuration.h | 2 +- .../delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- .../tvrrug/Round2/Configuration.h | 2 +- Marlin/fastio.h | 10 +++++----- Marlin/pins.h | 9 ++++++--- Marlin/pins_RAMPS_13.h | 6 +++--- 20 files changed, 35 insertions(+), 33 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5d9586808..8d3e75dae 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -503,7 +503,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index fcba93256..dc36e14c6 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -287,7 +287,6 @@ MarlinSerial MSerial; #endif // !AT90USB // For AT90USB targets use the UART for BT interfacing -#if defined(AT90USB) && defined (BTENABLED) - HardwareSerial bt; +#if defined(AT90USB) && defined(BTENABLED) + HardwareSerial bt; #endif - diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h index b56880c23..dbad3fd76 100644 --- a/Marlin/MarlinSerial.h +++ b/Marlin/MarlinSerial.h @@ -153,8 +153,8 @@ extern MarlinSerial MSerial; #endif // !AT90USB // Use the UART for BT in AT90USB configurations -#if defined(AT90USB) && defined (BTENABLED) - extern HardwareSerial bt; +#if defined(AT90USB) && defined(BTENABLED) + extern HardwareSerial bt; #endif #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d67f65367..d0b959cd7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2776,13 +2776,13 @@ inline void gcode_M42() { #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST) - // This is redudant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity. + // This is redundant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity. #ifdef Z_PROBE_ENDSTOP #if !HAS_Z_PROBE - #error "You must have a Z_PROBE_PIN defined in order to enable calculation of Z-Probe repeatability." + #error You must define Z_PROBE_PIN to enable Z-Probe repeatability calculation. #endif #elif !HAS_Z_MIN - #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability." + #error You must define Z_MIN_PIN to enable Z-Probe repeatability calculation. #endif /** diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index c7552b9c0..d92938c1d 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -100,7 +100,7 @@ * Require a Z Min pin */ #if Z_MIN_PIN == -1 - #if Z_PROBE_PIN == -1 || (! defined (Z_PROBE_ENDSTOP) || defined (DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. + #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. #ifdef Z_PROBE_REPEATABILITY_TEST #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST. #else diff --git a/Marlin/Servo.h b/Marlin/Servo.h index bbdf6bf0a..682a3b379 100644 --- a/Marlin/Servo.h +++ b/Marlin/Servo.h @@ -123,7 +123,7 @@ class Servo { int read(); // returns current pulse width as an angle between 0 and 180 degrees int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) bool attached(); // return true if this servo is attached, otherwise false - #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) + #if defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0 int pin; // store the hardware pin of the servo #endif private: diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index ca0b2d079..5b0960fdd 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -523,7 +523,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index dfd79a0d9..72d716989 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -473,7 +473,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 98dea404b..e6683b4e8 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -473,7 +473,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 7eceefb98..ac101be4d 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -496,7 +496,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 3a6aea9b1..6d743e937 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -501,7 +501,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 2616f155f..f126ab99b 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -525,7 +525,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d7d32d088..265f73fce 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -495,7 +495,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index ac13788b2..3218d2d9d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -541,7 +541,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 38f502355..489dca6d5 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -545,7 +545,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 24c3e5b4d..45350960f 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -493,7 +493,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 649046b88..2c98a310f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -495,7 +495,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below. // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28. // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print. - // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. + // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board. // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below. // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32 // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed. diff --git a/Marlin/fastio.h b/Marlin/fastio.h index 3087e87f2..0e3b34d25 100644 --- a/Marlin/fastio.h +++ b/Marlin/fastio.h @@ -91,7 +91,7 @@ added as necessary or if I feel like it- not a comprehensive list! */ -#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__) +#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) // UART #define RXD DIO0 #define TXD DIO1 @@ -426,7 +426,7 @@ pins #define PD7_PWM NULL #endif /* _AVR_ATmega{168,328,328P}__ */ -#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined (__AVR_ATmega1284P__) +#if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) // UART #define RXD DIO8 #define TXD DIO9 @@ -929,7 +929,7 @@ pins #define PD7_PWM OCR2A #endif /* _AVR_ATmega{644,644P,644PA}__ */ -#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // UART #define RXD DIO0 #define TXD DIO1 @@ -2024,7 +2024,7 @@ pins #endif -#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) || defined (__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) +#if defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) // SPI #define SCK DIO9 #define MISO DIO11 @@ -3322,7 +3322,7 @@ Teensy 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 #endif // __AVR_AT90usbxxx__ -#if defined (__AVR_ATmega1281__) || defined (__AVR_ATmega2561__) +#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) // UART #define RXD DIO0 #define TXD DIO1 diff --git a/Marlin/pins.h b/Marlin/pins.h index 0d6329886..0d9ae221c 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -187,7 +187,7 @@ #define Z_MIN_PIN -1 #endif -#if defined (DISABLE_Z_PROBE_ENDSTOP) || ! defined (Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting. +#if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting. #define Z_PROBE_PIN -1 #endif @@ -220,8 +220,11 @@ #define Z_MIN_PIN -1 #endif -#define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, PS_ON_PIN, \ - HEATER_BED_PIN, FAN_PIN, \ +#define SENSITIVE_PINS { 0, 1, + X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \ + Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \ + Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, \ + PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, \ _E0_PINS _E1_PINS _E2_PINS _E3_PINS \ analogInputToDigitalPin(TEMP_BED_PIN) \ } diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 11ecddeda..2708117d0 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -62,12 +62,12 @@ #define FILWIDTH_PIN 5 #endif -#if defined(Z_PROBE_ENDSTOP) +#ifdef Z_PROBE_ENDSTOP // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. - #define Z_PROBE_PIN 32 + #define Z_PROBE_PIN 32 #endif -#if defined(FILAMENT_RUNOUT_SENSOR) +#ifdef FILAMENT_RUNOUT_SENSOR // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector #define FILRUNOUT_PIN 4 #endif From 09350841416fdf32c3486258242c35d703db0861 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 23:42:50 -0700 Subject: [PATCH 200/302] Fix manage_inactivity - Document `manage_inactivity` function - Allow `EXTRUDER_RUNOUT_PREVENT` to work with all extruders - Use faster `memcpy` for copying coordinates --- Marlin/Marlin_main.cpp | 195 ++++++++++++++++++++++++----------------- 1 file changed, 117 insertions(+), 78 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d0b959cd7..29ac686ef 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1009,6 +1009,8 @@ inline void sync_plan_position() { plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); } #endif +inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); } +inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } #ifdef ENABLE_AUTO_BED_LEVELING @@ -1020,7 +1022,7 @@ inline void sync_plan_position() { refresh_cmd_timeout(); calculate_delta(destination); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); - for (int i = 0; i < NUM_AXIS; i++) current_position[i] = destination[i]; + set_current_to_destination(); } #endif @@ -1564,7 +1566,7 @@ static void homeaxis(int axis) { float oldFeedrate = feedrate; - for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; + set_destination_to_current(); if (retracting) { @@ -1769,7 +1771,7 @@ inline void gcode_G28() { enable_endstops(true); - for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; // includes E_AXIS + set_destination_to_current(); feedrate = 0.0; @@ -1997,7 +1999,7 @@ inline void gcode_G28() { if (mbl_was_active) { current_position[X_AXIS] = mbl.get_x(0); current_position[Y_AXIS] = mbl.get_y(0); - for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; + set_destination_to_current(); feedrate = homing_feedrate[X_AXIS]; line_to_destination(); st_synchronize(); @@ -4613,7 +4615,7 @@ inline void gcode_T() { #if EXTRUDERS > 1 if (tmp_extruder != active_extruder) { // Save current position to return to after applying extruder offset - memcpy(destination, current_position, sizeof(destination)); + set_destination_to_current(); #ifdef DUAL_X_CARRIAGE if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false && (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder))) { @@ -5338,9 +5340,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ { if (!mbl.active) { plan_buffer_line(x, y, z, e, feed_rate, extruder); - for(int8_t i=0; i < NUM_AXIS; i++) { - current_position[i] = destination[i]; - } + set_current_to_destination(); return; } int pix = mbl.select_x_index(current_position[X_AXIS]); @@ -5354,9 +5354,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ if (pix == ix && piy == iy) { // Start and end on same mesh square plan_buffer_line(x, y, z, e, feed_rate, extruder); - for(int8_t i=0; i < NUM_AXIS; i++) { - current_position[i] = destination[i]; - } + set_current_to_destination(); return; } float nx, ny, ne, normalized_dist; @@ -5387,9 +5385,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ } else { // Already split on a border plan_buffer_line(x, y, z, e, feed_rate, extruder); - for(int8_t i=0; i < NUM_AXIS; i++) { - current_position[i] = destination[i]; - } + set_current_to_destination(); return; } // Do the split and look for more borders @@ -5477,64 +5473,58 @@ void prepare_move() { #endif // DELTA -#ifdef DUAL_X_CARRIAGE - if (active_extruder_parked) - { - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) - { - // move duplicate extruder into correct duplication position. - plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], max_feedrate[X_AXIS], 1); - sync_plan_position(); - st_synchronize(); - extruder_duplication_enabled = true; - active_extruder_parked = false; - } - else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head - { - if (current_position[E_AXIS] == destination[E_AXIS]) - { - // this is a travel move - skit it but keep track of current position (so that it can later - // be used as start of first non-travel move) - if (delayed_move_time != 0xFFFFFFFFUL) - { - memcpy(current_position, destination, sizeof(current_position)); - if (destination[Z_AXIS] > raised_parked_position[Z_AXIS]) - raised_parked_position[Z_AXIS] = destination[Z_AXIS]; - delayed_move_time = millis(); - return; - } + #ifdef DUAL_X_CARRIAGE + if (active_extruder_parked) { + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) { + // move duplicate extruder into correct duplication position. + plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], + current_position[E_AXIS], max_feedrate[X_AXIS], 1); + sync_plan_position(); + st_synchronize(); + extruder_duplication_enabled = true; + active_extruder_parked = false; + } + else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) { // handle unparking of head + if (current_position[E_AXIS] == destination[E_AXIS]) { + // this is a travel move - skit it but keep track of current position (so that it can later + // be used as start of first non-travel move) + if (delayed_move_time != 0xFFFFFFFFUL) { + set_current_to_destination(); + if (destination[Z_AXIS] > raised_parked_position[Z_AXIS]) + raised_parked_position[Z_AXIS] = destination[Z_AXIS]; + delayed_move_time = millis(); + return; + } + } + delayed_move_time = 0; + // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower + plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], + current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder); + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], + current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); + active_extruder_parked = false; } - delayed_move_time = 0; - // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], - current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); - active_extruder_parked = false; } - } -#endif //DUAL_X_CARRIAGE + #endif // DUAL_X_CARRIAGE -#if !defined(DELTA) && !defined(SCARA) - // Do not use feedmultiply for E or Z only moves - if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { - line_to_destination(); - } else { -#ifdef MESH_BED_LEVELING - mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); - return; -#else - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); -#endif // MESH_BED_LEVELING - } -#endif // !(DELTA || SCARA) + #if !defined(DELTA) && !defined(SCARA) + // Do not use feedmultiply for E or Z only moves + if ( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { + line_to_destination(); + } + else { + #ifdef MESH_BED_LEVELING + mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + return; + #else + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + #endif // MESH_BED_LEVELING + } + #endif // !(DELTA || SCARA) - for(int8_t i=0; i < NUM_AXIS; i++) { - current_position[i] = destination[i]; - } + set_current_to_destination(); } void prepare_arc_move(char isclockwise) { @@ -5546,9 +5536,7 @@ void prepare_arc_move(char isclockwise) { // As far as the parser is concerned, the position is now == target. In reality the // motion control system might still be processing the action and the real tool position // in any intermediate location. - for(int8_t i=0; i < NUM_AXIS; i++) { - current_position[i] = destination[i]; - } + set_current_to_destination(); refresh_cmd_timeout(); } @@ -5718,7 +5706,16 @@ void disable_all_steppers() { } /** - * + * Manage several activities: + * - Check for Filament Runout + * - Keep the command buffer full + * - Check for maximum inactive time between commands + * - Check for maximum inactive time between stepper commands + * - Check if pin CHDK needs to go LOW + * - Check for KILL button held down + * - Check for HOME button held down + * - Check if cooling fan needs to be switched on + * - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT) */ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { @@ -5737,7 +5734,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { && !ignore_stepper_queue && !blocks_queued()) disable_all_steppers(); - #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH + #ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH if (chdkActive && ms > chdkHigh + CHDK_DELAY) { chdkActive = false; WRITE(CHDK, LOW); @@ -5780,14 +5777,37 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif #if HAS_CONTROLLERFAN - controllerFan(); //Check if fan should be turned on to cool stepper drivers down + controllerFan(); // Check if fan should be turned on to cool stepper drivers down #endif #ifdef EXTRUDER_RUNOUT_PREVENT if (ms > previous_millis_cmd + EXTRUDER_RUNOUT_SECONDS * 1000) if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { - bool oldstatus = E0_ENABLE_READ; - enable_e0(); + bool oldstatus; + switch(active_extruder) { + case 0: + oldstatus = E0_ENABLE_READ; + enable_e0(); + break; + #if EXTRUDERS > 1 + case 1: + oldstatus = E1_ENABLE_READ; + enable_e1(); + break; + #if EXTRUDERS > 2 + case 2: + oldstatus = E2_ENABLE_READ; + enable_e2(); + break; + #if EXTRUDERS > 3 + case 3: + oldstatus = E3_ENABLE_READ; + enable_e3(); + break; + #endif + #endif + #endif + } float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS]; plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS], @@ -5797,7 +5817,26 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { plan_set_e_position(oldepos); previous_millis_cmd = ms; // refresh_cmd_timeout() st_synchronize(); - E0_ENABLE_WRITE(oldstatus); + switch(active_extruder) { + case 0: + E0_ENABLE_WRITE(oldstatus); + break; + #if EXTRUDERS > 1 + case 1: + E1_ENABLE_WRITE(oldstatus); + break; + #if EXTRUDERS > 2 + case 2: + E2_ENABLE_WRITE(oldstatus); + break; + #if EXTRUDERS > 3 + case 3: + E3_ENABLE_WRITE(oldstatus); + break; + #endif + #endif + #endif + } } #endif @@ -5806,7 +5845,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - memcpy(destination, current_position, sizeof(destination)); + set_destination_to_current(); prepare_move(); } #endif From 2d099a2c7076221670243f14a88655caf6827fcf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 03:35:16 -0700 Subject: [PATCH 201/302] Fix missing backslash in macro --- Marlin/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/pins.h b/Marlin/pins.h index 0d9ae221c..e5af0af17 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -220,7 +220,7 @@ #define Z_MIN_PIN -1 #endif -#define SENSITIVE_PINS { 0, 1, +#define SENSITIVE_PINS { 0, 1, \ X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \ Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \ Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, \ From 6f06d33be5f4812ae7e37baedb953e1adcb32504 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 03:47:25 -0700 Subject: [PATCH 202/302] Fix missing refresh_cmd_timeout function --- Marlin/Marlin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 182540bbd..55ed637f2 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -227,7 +227,7 @@ void enquecommands_P(const char *cmd); //put one or many ASCII commands at the e void prepare_arc_move(char isclockwise); void clamp_to_software_endstops(float target[3]); -void refresh_cmd_timeout(void); +void refresh_cmd_timeout(); #ifdef FAST_PWM_FAN void setPwmFrequency(uint8_t pin, int val); From 4119738e69b0bf66be570df78ebc49558ccf8861 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Sat, 4 Apr 2015 05:41:02 -0500 Subject: [PATCH 203/302] Deferring default definition made #undef unnecessary --- Marlin/language.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Marlin/language.h b/Marlin/language.h index 48daddb58..3fe7afd2e 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -43,14 +43,12 @@ #define PROTOCOL_VERSION "1.0" #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) - #undef FIRMWARE_URL #define MACHINE_NAME "Ultimaker" #define FIRMWARE_URL "http://firmware.ultimaker.com" #elif MB(RUMBA) #define MACHINE_NAME "Rumba" #elif MB(3DRAG) #define MACHINE_NAME "3Drag" - #undef FIRMWARE_URL #define FIRMWARE_URL "http://3dprint.elettronicain.it/" #elif MB(K8200) #define MACHINE_NAME "K8200" @@ -58,15 +56,12 @@ #define MACHINE_NAME "Makibox" #elif MB(SAV_MKI) #define MACHINE_NAME "SAV MkI" - #undef FIRMWARE_URL #define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" #elif MB(WITBOX) #define MACHINE_NAME "WITBOX" - #undef FIRMWARE_URL #define FIRMWARE_URL "http://www.bq.com/gb/downloads-witbox.html" #elif MB(HEPHESTOS) #define MACHINE_NAME "HEPHESTOS" - #undef FIRMWARE_URL #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" #elif MB(BRAINWAVE_PRO) #define MACHINE_NAME "Kossel Pro" From 61f839436113f0c9f9dbac4dc29039323b899009 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 05:01:16 -0700 Subject: [PATCH 204/302] Compare indices instead of floats for probe actions --- Marlin/Marlin.h | 3 ++- Marlin/Marlin_main.cpp | 49 ++++++++++++++++++++---------------------- Marlin/ultralcd.cpp | 5 ++--- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 55ed637f2..36e054eec 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -227,7 +227,8 @@ void enquecommands_P(const char *cmd); //put one or many ASCII commands at the e void prepare_arc_move(char isclockwise); void clamp_to_software_endstops(float target[3]); -void refresh_cmd_timeout(); +extern unsigned long previous_millis_cmd; +inline void refresh_cmd_timeout() { previous_millis_cmd = millis(); } #ifdef FAST_PWM_FAN void setPwmFrequency(uint8_t pin, int val); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 29ac686ef..7736acb50 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -238,7 +238,7 @@ static char *strchr_pointer; ///< A pointer to find chars in the command string const char* queued_commands_P= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42 // Inactivity shutdown -static unsigned long previous_millis_cmd = 0; +unsigned long previous_millis_cmd = 0; static unsigned long max_inactive_time = 0; static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l; unsigned long starttime = 0; ///< Print job start time @@ -986,8 +986,6 @@ static void axis_is_at_home(int axis) { #endif } -inline void refresh_cmd_timeout() { previous_millis_cmd = millis(); } - /** * Some planner shorthand inline functions */ @@ -1327,20 +1325,20 @@ inline void set_destination_to_current() { memcpy(destination, current_position, } enum ProbeAction { - ProbeStay = 0, - ProbeEngage = BIT(0), - ProbeRetract = BIT(1), - ProbeEngageAndRetract = (ProbeEngage | ProbeRetract) + ProbeStay = 0, + ProbeDeploy = BIT(0), + ProbeStow = BIT(1), + ProbeDeployAndStow = (ProbeDeploy | ProbeStow) }; // Probe bed height at position (x,y), returns the measured z value - static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) { + static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeDeployAndStow, int verbose_level=1) { // move to right place do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeEngage) deploy_z_probe(); + if (retract_action & ProbeDeploy) deploy_z_probe(); #endif run_z_probe(); @@ -1354,7 +1352,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #endif #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) - if (retract_action & ProbeRetract) stow_z_probe(); + if (retract_action & ProbeStow) stow_z_probe(); #endif if (verbose_level > 2) { @@ -2167,7 +2165,7 @@ inline void gcode_G28() { } bool dryrun = code_seen('D') || code_seen('d'), - engage_probe_for_each_reading = code_seen('E') || code_seen('e'); + deploy_probe_for_each_reading = code_seen('E') || code_seen('e'); #ifdef AUTO_BED_LEVELING_GRID @@ -2319,14 +2317,13 @@ inline void gcode_G28() { if (distance_from_center > DELTA_PROBABLE_RADIUS) continue; #endif //DELTA - // Enhanced G29 - Do not retract servo between probes ProbeAction act; - if (engage_probe_for_each_reading) - act = ProbeEngageAndRetract; - else if (yProbe == front_probe_bed_position && xCount == 0) - act = ProbeEngage; - else if (yProbe == front_probe_bed_position + (yGridSpacing * (auto_bed_leveling_grid_points - 1)) && xCount == auto_bed_leveling_grid_points - 1) - act = ProbeRetract; + if (deploy_probe_for_each_reading) // G29 E - Stow between probes + act = ProbeDeployAndStow; + else if (yCount == 0 && xCount == 0) + act = ProbeDeploy; + else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == auto_bed_leveling_grid_points - 1) + act = ProbeStow; else act = ProbeStay; @@ -2417,10 +2414,10 @@ inline void gcode_G28() { // Actions for each probe ProbeAction p1, p2, p3; - if (engage_probe_for_each_reading) - p1 = p2 = p3 = ProbeEngageAndRetract; + if (deploy_probe_for_each_reading) + p1 = p2 = p3 = ProbeDeployAndStow; else - p1 = ProbeEngage, p2 = ProbeStay, p3 = ProbeRetract; + p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow; // Probe at 3 arbitrary points float z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, p1, verbose_level), @@ -2839,7 +2836,7 @@ inline void gcode_M42() { Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING, ext_position = st_get_position_mm(E_AXIS); - bool engage_probe_for_each_reading = code_seen('E') || code_seen('e'); + bool deploy_probe_for_each_reading = code_seen('E') || code_seen('e'); if (code_seen('X') || code_seen('x')) { X_probe_location = code_value() - X_PROBE_OFFSET_FROM_EXTRUDER; @@ -2917,7 +2914,7 @@ inline void gcode_M42() { st_synchronize(); current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS); - if (engage_probe_for_each_reading) stow_z_probe(); + if (deploy_probe_for_each_reading) stow_z_probe(); for (uint16_t n=0; n < n_samples; n++) { @@ -2959,7 +2956,7 @@ inline void gcode_M42() { } // n_legs - if (engage_probe_for_each_reading) { + if (deploy_probe_for_each_reading) { deploy_z_probe(); delay(1000); } @@ -3006,13 +3003,13 @@ inline void gcode_M42() { plan_buffer_line(X_probe_location, Y_probe_location, Z_start_location, current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder); st_synchronize(); - if (engage_probe_for_each_reading) { + if (deploy_probe_for_each_reading) { stow_z_probe(); delay(1000); } } - if (!engage_probe_for_each_reading) { + if (!deploy_probe_for_each_reading) { stow_z_probe(); delay(1000); } diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d2a2e6faa..8aada85b0 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1789,7 +1789,7 @@ char *ftostr52(const float &x) { return conv; } -#if defined(MANUAL_BED_LEVELING) +#ifdef MANUAL_BED_LEVELING static int _lcd_level_bed_position; static void _lcd_level_bed() { @@ -1849,8 +1849,7 @@ static void _lcd_level_bed_homing() lcd_goto_menu(_lcd_level_bed); } } -static void lcd_level_bed() -{ +static void lcd_level_bed() { axis_known_position[X_AXIS] = false; axis_known_position[Y_AXIS] = false; axis_known_position[Z_AXIS] = false; From 1836aa2615f59fd54af7ed28750f4af113817573 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:02:58 +0200 Subject: [PATCH 205/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d06c080d..c5d3256e4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware)) +__Google Hangout:__ https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua ## Credits From 2f189be2e4773e3b8a6f9c7f55ab382cd166e1e9 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:07:20 +0200 Subject: [PATCH 206/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5d3256e4..406d96763 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua +__Google Hangout:__
## Credits From 506a42338b83047ef41f3ed6086d6ee6b5f263e9 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:07:59 +0200 Subject: [PATCH 207/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 406d96763..e65da083b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ +__Google Hangout:__ (a href="https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua" target="_blank">) ## Credits From a5e92639875ff99be969abcf760f415b444dc774 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:08:30 +0200 Subject: [PATCH 208/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e65da083b..563daaa76 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ (a href="https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua" target="_blank">) +__Google Hangout:__ () ## Credits From 20a047b8c5d8a40c78b1b38c931b38bc25af9249 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:09:39 +0200 Subject: [PATCH 209/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 563daaa76..808c23082 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ () +__Google Hangout:__ "https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua" target="_blank" ## Credits From f39e5988a32e993ab388f5e6afb7a9bc4013b153 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:09:59 +0200 Subject: [PATCH 210/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 808c23082..c5d3256e4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ "https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua" target="_blank" +__Google Hangout:__ https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua ## Credits From cabd713610830a8427433edc8ff403f18a844a01 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 14:12:36 +0200 Subject: [PATCH 211/302] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5d3256e4..9f02a90cc 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua +__Google Hangout:__ Hagnout ## Credits From f9dbd73652b79913032f4cfb4748563bb1ad7242 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 05:25:53 -0700 Subject: [PATCH 212/302] Fix tr_target_temperature type - float! --- Marlin/temperature.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 1e3c2b663..07af7ee75 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1007,7 +1007,7 @@ void setWatch() { void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { - static int tr_target_temperature[EXTRUDERS+1]; + static float tr_target_temperature[EXTRUDERS+1]; /* SERIAL_ECHO_START; @@ -1053,18 +1053,18 @@ void setWatch() { } // If the temperature is over the target (-hysteresis) restart the timer - if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) *timer = millis(); - - // If the timer goes too long without a reset, trigger shutdown + if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) { + *timer = millis(); + } // If the timer goes too long without a reset, trigger shutdown else if (millis() > *timer + period_seconds * 1000UL) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id); LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); thermal_runaway = true; + disable_heater(); + disable_all_steppers(); for (;;) { - disable_heater(); - disable_all_steppers(); manage_heater(); lcd_update(); } From 60f8e0386fef5358a51bb5dc1a9b1bad261b74cd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 05:45:36 -0700 Subject: [PATCH 213/302] More thermal runaway states --- Marlin/temperature.cpp | 61 +++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 07af7ee75..1bdb7fdbe 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -76,15 +76,14 @@ unsigned char soft_pwm_bed; #define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0) #define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0) #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION - enum TRState { TRInactive, TRFirstHeating, TRStable }; - static bool thermal_runaway = false; + enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway }; void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); #if HAS_HEATER_THERMAL_PROTECTION - static TRState thermal_runaway_state_machine[4] = { TRInactive, TRInactive, TRInactive, TRInactive }; + static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset }; static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; #endif #if HAS_BED_THERMAL_PROTECTION - static TRState thermal_runaway_bed_state_machine = TRInactive; + static TRState thermal_runaway_bed_state_machine = TRReset; static unsigned long thermal_runaway_bed_timer; #endif #endif @@ -1007,7 +1006,7 @@ void setWatch() { void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { - static float tr_target_temperature[EXTRUDERS+1]; + static float tr_target_temperature[EXTRUDERS+1] = { 0.0 }; /* SERIAL_ECHO_START; @@ -1023,20 +1022,23 @@ void setWatch() { SERIAL_ECHOPGM(target_temperature); SERIAL_EOL; */ - if (target_temperature == 0 || thermal_runaway) { - *state = TRInactive; - *timer = 0; - return; - } + + // If the target temperature changes, restart + if (tr_target_temperature[heater_index] != target_temperature) + *state = TRReset; int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS; switch (*state) { + case TRReset: + *timer = 0; + *state = TRInactive; + break; // Inactive state waits for a target temperature to be set case TRInactive: if (target_temperature > 0) { - *state = TRFirstHeating; tr_target_temperature[heater_index] = target_temperature; + *state = TRFirstHeating; } break; // When first heating, wait for the temperature to be reached then go to Stable state @@ -1045,31 +1047,24 @@ void setWatch() { break; // While the temperature is stable watch for a bad temperature case TRStable: - { - // If the target temperature changes, restart - if (tr_target_temperature[heater_index] != target_temperature) { - *state = TRInactive; - break; - } - // If the temperature is over the target (-hysteresis) restart the timer - if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) { + if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) *timer = millis(); - } // If the timer goes too long without a reset, trigger shutdown - else if (millis() > *timer + period_seconds * 1000UL) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); - if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id); - LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); - thermal_runaway = true; - disable_heater(); - disable_all_steppers(); - for (;;) { - manage_heater(); - lcd_update(); - } + // If the timer goes too long without a reset, trigger shutdown + else if (millis() > *timer + period_seconds * 1000UL) + *state = TRRunaway; + break; + case TRRunaway: + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); + if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id); + LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); + disable_heater(); + disable_all_steppers(); + for (;;) { + manage_heater(); + lcd_update(); } - } break; } } From bf5dbb90c4beb708a5f3f2d4d0985fe97733e710 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Sat, 4 Apr 2015 15:06:13 +0200 Subject: [PATCH 214/302] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f02a90cc..970a32b82 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ __Google Hangout:__ Date: Sat, 4 Apr 2015 06:18:08 -0700 Subject: [PATCH 216/302] heater_index above its use --- Marlin/temperature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 1bdb7fdbe..28e1afb7c 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1023,12 +1023,12 @@ void setWatch() { SERIAL_EOL; */ + int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS; + // If the target temperature changes, restart if (tr_target_temperature[heater_index] != target_temperature) *state = TRReset; - int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS; - switch (*state) { case TRReset: *timer = 0; From 4cb7dfc546c826c1f06555a7ed1f45b9ad7e140e Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Apr 2015 17:34:28 +0200 Subject: [PATCH 217/302] Move the 'alive dot' in every displayloop Result see: https://www.youtube.com/watch?v=tdu7J0i-c4g Loop is executed several times per display update. --- Marlin/dogm_lcd_implementation.h | 4 ++-- Marlin/ultralcd.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index c057e5642..81234c0f0 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -318,9 +318,9 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_STATUSMENU); #ifdef USE_SMALL_INFOFONT - u8g.drawBox(0,30,128,10); + u8g.drawBox(0,30,127,10); #else - u8g.drawBox(0,30,128,9); + u8g.drawBox(0,30,127,9); #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 8aada85b0..64b91f699 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1299,6 +1299,8 @@ void lcd_update() { } #endif//CARDINSERTED + static uint8_t dotcounter = 63; + uint32_t ms = millis(); if (ms > lcd_next_update_millis) { @@ -1362,11 +1364,12 @@ void lcd_update() { blink++; // Variable for fan animation and alive dot u8g.firstPage(); do { + if (!dotcounter) dotcounter = 63; lcd_setFont(FONT_MENU); u8g.setPrintPos(125, 0); - if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot - u8g.drawPixel(127, 63); // draw alive dot - u8g.setColorIndex(1); // black on white +// if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot + u8g.drawPixel(127, dotcounter--); // draw alive dot +// u8g.setColorIndex(1); // black on white (*currentMenu)(); if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next() } while( u8g.nextPage() ); From 6d4b3f0d6a668f6c038c16cf9587f424f2968778 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Apr 2015 17:49:39 +0200 Subject: [PATCH 218/302] Move the condition before the loop Result see: https://youtu.be/AEnBzdu9_tk Dot is moving not so fast -> less executed loops. --- Marlin/ultralcd.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 64b91f699..1c124a006 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1363,16 +1363,18 @@ void lcd_update() { #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display blink++; // Variable for fan animation and alive dot u8g.firstPage(); - do { - if (!dotcounter) dotcounter = 63; - lcd_setFont(FONT_MENU); - u8g.setPrintPos(125, 0); -// if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot - u8g.drawPixel(127, dotcounter--); // draw alive dot -// u8g.setColorIndex(1); // black on white - (*currentMenu)(); - if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next() - } while( u8g.nextPage() ); + (*currentMenu)(); + if (lcdDrawUpdate) { + do { + if (!dotcounter) dotcounter = 63; + lcd_setFont(FONT_MENU); + u8g.setPrintPos(125, 0); + // if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot + u8g.drawPixel(127, dotcounter--); // draw alive dot + // u8g.setColorIndex(1); // black on white + (*currentMenu)(); + } while( u8g.nextPage() ); + } #else (*currentMenu)(); #endif From 6361404b91dcf8ba657b1f1e16d9717a8e280ae6 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Apr 2015 17:56:13 +0200 Subject: [PATCH 219/302] Testloop cleanup Shifted condition should still be in. --- Marlin/dogm_lcd_implementation.h | 4 ++-- Marlin/ultralcd.cpp | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 81234c0f0..c057e5642 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -318,9 +318,9 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_STATUSMENU); #ifdef USE_SMALL_INFOFONT - u8g.drawBox(0,30,127,10); + u8g.drawBox(0,30,128,10); #else - u8g.drawBox(0,30,127,9); + u8g.drawBox(0,30,128,9); #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1c124a006..a3413bfbe 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1299,8 +1299,6 @@ void lcd_update() { } #endif//CARDINSERTED - static uint8_t dotcounter = 63; - uint32_t ms = millis(); if (ms > lcd_next_update_millis) { @@ -1366,12 +1364,11 @@ void lcd_update() { (*currentMenu)(); if (lcdDrawUpdate) { do { - if (!dotcounter) dotcounter = 63; lcd_setFont(FONT_MENU); u8g.setPrintPos(125, 0); - // if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot - u8g.drawPixel(127, dotcounter--); // draw alive dot - // u8g.setColorIndex(1); // black on white + if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot + u8g.drawPixel(127, 63); // draw alive dot + u8g.setColorIndex(1); // black on white (*currentMenu)(); } while( u8g.nextPage() ); } From 418d22d7b3d7099aa3aeea79c3e901cb0e5a7f31 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Apr 2015 18:33:36 +0200 Subject: [PATCH 220/302] Revert "Testloop cleanup" This reverts commit 6361404b91dcf8ba657b1f1e16d9717a8e280ae6. --- Marlin/dogm_lcd_implementation.h | 4 ++-- Marlin/ultralcd.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index c057e5642..81234c0f0 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -318,9 +318,9 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_STATUSMENU); #ifdef USE_SMALL_INFOFONT - u8g.drawBox(0,30,128,10); + u8g.drawBox(0,30,127,10); #else - u8g.drawBox(0,30,128,9); + u8g.drawBox(0,30,127,9); #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a3413bfbe..1c124a006 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1299,6 +1299,8 @@ void lcd_update() { } #endif//CARDINSERTED + static uint8_t dotcounter = 63; + uint32_t ms = millis(); if (ms > lcd_next_update_millis) { @@ -1364,11 +1366,12 @@ void lcd_update() { (*currentMenu)(); if (lcdDrawUpdate) { do { + if (!dotcounter) dotcounter = 63; lcd_setFont(FONT_MENU); u8g.setPrintPos(125, 0); - if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot - u8g.drawPixel(127, 63); // draw alive dot - u8g.setColorIndex(1); // black on white + // if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot + u8g.drawPixel(127, dotcounter--); // draw alive dot + // u8g.setColorIndex(1); // black on white (*currentMenu)(); } while( u8g.nextPage() ); } From 340d165a9cb87dfbfbacc680989717c79b5bdffe Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Apr 2015 22:02:24 +0200 Subject: [PATCH 221/302] Reduce display updates for dogm displays In 'if (encoderPastThreshold || LCD_CLICKED)' lcdDrawUpdate was not set. 'lcd_status_update_delay'-loop was not effective in function lcd_status_screen(). The loop prevented the update of the status screen but not the displays update. Shifted the loop into lcd_update(). --- Marlin/dogm_lcd_implementation.h | 4 ++-- Marlin/ultralcd.cpp | 37 ++++++++++++++------------------ 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 81234c0f0..c057e5642 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -318,9 +318,9 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_STATUSMENU); #ifdef USE_SMALL_INFOFONT - u8g.drawBox(0,30,127,10); + u8g.drawBox(0,30,128,10); #else - u8g.drawBox(0,30,127,9); + u8g.drawBox(0,30,128,9); #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1c124a006..034adc394 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -262,8 +262,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool } /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */ -static void lcd_status_screen() -{ +static void lcd_status_screen() { encoderRateMultiplierEnabled = false; #ifdef LCD_PROGRESS_BAR @@ -296,15 +295,7 @@ static void lcd_status_screen() #endif #endif //LCD_PROGRESS_BAR - if (lcd_status_update_delay) - lcd_status_update_delay--; - else - lcdDrawUpdate = 1; - - if (lcdDrawUpdate) { lcd_implementation_status_screen(); - lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */ - } #ifdef ULTIPANEL @@ -1298,8 +1289,6 @@ void lcd_update() { } } #endif//CARDINSERTED - - static uint8_t dotcounter = 63; uint32_t ms = millis(); if (ms > lcd_next_update_millis) { @@ -1351,27 +1340,33 @@ void lcd_update() { } // encoderRateMultiplierEnabled #endif //ENCODER_RATE_MULTIPLIER - lcdDrawUpdate = 1; encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP; encoderDiff = 0; } timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS; + lcdDrawUpdate = 1; } - #endif //ULTIPANEL + if (currentMenu == lcd_status_screen) { + if (!lcd_status_update_delay) { + lcdDrawUpdate = 1; + lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */ + } + else { + lcd_status_update_delay--; + } + } #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display - blink++; // Variable for fan animation and alive dot - u8g.firstPage(); - (*currentMenu)(); if (lcdDrawUpdate) { + blink++; // Variable for fan animation and alive dot + u8g.firstPage(); do { - if (!dotcounter) dotcounter = 63; lcd_setFont(FONT_MENU); u8g.setPrintPos(125, 0); - // if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot - u8g.drawPixel(127, dotcounter--); // draw alive dot - // u8g.setColorIndex(1); // black on white + if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot + u8g.drawPixel(127, 63); // draw alive dot + u8g.setColorIndex(1); // black on white (*currentMenu)(); } while( u8g.nextPage() ); } From b02a55e60fb95b92f61cf92db6a34ffeac061aba Mon Sep 17 00:00:00 2001 From: quillford Date: Sat, 4 Apr 2015 15:26:35 -0700 Subject: [PATCH 222/302] Fixed scara directions Config said for a delta instead of for a scara --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8d3e75dae..871d69ccb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -31,7 +31,7 @@ Here are some standard links for getting your machine calibrated: //=========================================================================== //============================= SCARA Printer =============================== //=========================================================================== -// For a Delta printer replace the configuration files with the files in the +// For a Scara printer replace the configuration files with the files in the // example_configurations/SCARA directory. // From 0e6514e7bd1adcdf582b14b45345ee5ddd8790b6 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Sun, 5 Apr 2015 04:13:34 +0200 Subject: [PATCH 223/302] Bug fix! Missed putting z value back in right slot after zigzag mod. --- Marlin/ultralcd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 42a957dca..138c60df6 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1809,6 +1809,9 @@ static void _lcd_level_bed() debounce_click = true; int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS; int iy = _lcd_level_bed_position / MESH_NUM_X_POINTS; + if (iy&1) { // Zig zag + ix = (MESH_NUM_X_POINTS - 1) - ix; + } mbl.set_z(ix, iy, current_position[Z_AXIS]); _lcd_level_bed_position++; if (_lcd_level_bed_position == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS) { From 2f0081bbb5a1adc861db3a7f9868987807618c52 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Sun, 5 Apr 2015 04:16:16 +0200 Subject: [PATCH 224/302] Compile error fix! Fix for merge artifacts. --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1b9260de5..66afad7bf 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2045,6 +2045,9 @@ inline void gcode_G28() { return; } + int ix, iy; + float z; + switch(state) { case MeshReport: if (mbl.active) { @@ -2078,7 +2081,6 @@ inline void gcode_G28() { SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first."); return; } - int ix, iy; if (probe_point == 0) { // Set Z to a positive value before recording the first Z. current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; @@ -2115,8 +2117,6 @@ inline void gcode_G28() { break; case MeshSet: - int ix, iy; - float z; if (code_seen('X') || code_seen('x')) { ix = code_value_long()-1; if (ix < 0 || ix >= MESH_NUM_X_POINTS) { From 61de6ecd54f0f256cd2f54397806e6be77520a72 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Sun, 5 Apr 2015 04:26:35 +0200 Subject: [PATCH 225/302] Added change to example Configuration.h's --- Marlin/configurator/config/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos/Configuration.h | 4 ++++ Marlin/example_configurations/K8200/Configuration.h | 4 ++++ Marlin/example_configurations/SCARA/Configuration.h | 4 ++++ Marlin/example_configurations/WITBOX/Configuration.h | 4 ++++ Marlin/example_configurations/delta/generic/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_mini/Configuration.h | 4 ++++ Marlin/example_configurations/makibox/Configuration.h | 4 ++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 4 ++++ 10 files changed, 40 insertions(+) diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 5b0960fdd..bb8125ef1 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -412,6 +412,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 72d716989..49df589dd 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -364,6 +364,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index ac101be4d..f58fd8315 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -387,6 +387,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 6d743e937..07af43647 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -392,6 +392,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index f126ab99b..8a85e8e80 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -416,6 +416,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 265f73fce..ed964304f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -386,6 +386,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3218d2d9d..acd6d9f34 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -414,6 +414,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 489dca6d5..bc0a000e0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -414,6 +414,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 45350960f..557b15fe2 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -384,6 +384,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2c98a310f..e9158b041 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -386,6 +386,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling +#ifdef MANUAL_BED_LEVELING + #define MBL_Z_STEP 0.025 +#endif // MANUAL_BED_LEVELING + #ifdef MESH_BED_LEVELING #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) From d24ea7c03f7ddbb3645a9cfb136a620dbcb6dfc3 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Sun, 5 Apr 2015 05:14:06 +0200 Subject: [PATCH 226/302] Added Comment in hope of github seeing these updates --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 7de354f88..419e010dc 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -395,7 +395,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MESH_BED_LEVELING // Enable mesh bed leveling #ifdef MANUAL_BED_LEVELING - #define MBL_Z_STEP 0.025 + #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING From 53eb662908047539307cd9730cc3621d42d58fb8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 20:19:17 -0700 Subject: [PATCH 227/302] Have the configurator read from MarlinFirmware repo --- Marlin/configurator/js/configurator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js index b9c6636d2..9330c5e7f 100644 --- a/Marlin/configurator/js/configurator.js +++ b/Marlin/configurator/js/configurator.js @@ -29,9 +29,9 @@ $(function(){ var config = { type: 'github', host: 'https://api.github.com', - owner: 'thinkyhead', + owner: 'MarlinFirmware', repo: 'Marlin', - ref: 'marlin_configurator', + ref: 'Development', path: 'Marlin/configurator/config' }; /**/ From 9865318f1c8f7b2c45a6a73e923c20a8b31b3d6e Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 5 Apr 2015 12:24:01 +0200 Subject: [PATCH 228/302] Disable splash-screen when done once Splash screen was shown with every display init. That means every time the menus where entered. Note the 2 in the initialisation. The buffer is already written in two steps a 512 byte. Without the 2 only the upper half is shown. --- Marlin/dogm_lcd_implementation.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index c057e5642..e6cfb8078 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -186,6 +186,8 @@ char lcd_printPGM(const char* str) { return n; } +static int8_t show_splashscreed = 2; + static void lcd_implementation_init() { #ifdef LCD_PIN_BL // Enable LCD backlight @@ -219,15 +221,18 @@ static void lcd_implementation_init() u8g.firstPage(); do { - u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); - lcd_setFont(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); - #else - int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; - u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); - u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); - #endif + if (show_splashscreed) { + u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); + lcd_setFont(FONT_MENU); + #ifndef STRING_SPLASH_LINE2 + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); + #else + int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); + u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); + #endif + show_splashscreed--; + } } while (u8g.nextPage()); } From bf04a92cc0046d4af04e422d9e84e027e59fb2ba Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 5 Apr 2015 12:53:20 +0200 Subject: [PATCH 229/302] Draw content in display loop only when needed Example for splash screen. --- Marlin/dogm_lcd_implementation.h | 33 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index e6cfb8078..bf9726cee 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -186,7 +186,7 @@ char lcd_printPGM(const char* str) { return n; } -static int8_t show_splashscreed = 2; +int8_t show_splashscreen = 2; static void lcd_implementation_init() { @@ -221,18 +221,25 @@ static void lcd_implementation_init() u8g.firstPage(); do { - if (show_splashscreed) { - u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); - lcd_setFont(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); - #else - int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; - u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); - u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); - #endif - show_splashscreed--; - } + switch (show_splashscreen) { + case 2 : { + u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); + break; + } + case 1 : { + lcd_setFont(FONT_MENU); + #ifndef STRING_SPLASH_LINE2 + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); + #else + int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); + u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); + #endif + break; + } + break; + } + if (show_splashscreen) show_splashscreen--; } while (u8g.nextPage()); } From 1a5293c2ce23fdc50a40b2056910540a48d6d3ce Mon Sep 17 00:00:00 2001 From: Richard Miles Date: Sun, 5 Apr 2015 22:27:14 +0100 Subject: [PATCH 230/302] Prevents MINTEMP / MAXTEMP when no heaters present This commit checks whether or not HEATER_0 is in use, and if not, skips the MIN / MAX temperature checks. --- Marlin/temperature.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 28e1afb7c..b8403f3c7 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1525,15 +1525,17 @@ ISR(TIMER0_COMPB_vect) { for (int i = 0; i < 4; i++) raw_temp_value[i] = 0; raw_temp_bed_value = 0; - #ifndef HEATER_0_USES_MAX6675 - #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP - #define GE0 <= - #else - #define GE0 >= - #endif - if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); - if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); - #endif + #if HAS_TEMP_0 + #ifndef HEATER_0_USES_MAX6675 + #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP + #define GE0 <= + #else + #define GE0 >= + #endif + if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); + if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); + #endif + #endif #if HAS_TEMP_1 #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP From cf66cb88083b5a2148c7f2bc82b2c24c399b146d Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Sat, 4 Apr 2015 05:36:35 -0500 Subject: [PATCH 231/302] Bring configurator up-to-date --- Marlin/configurator/config/Configuration.h | 61 ++++--- .../configurator/config/Configuration_adv.h | 4 +- Marlin/configurator/config/boards.h | 17 +- Marlin/configurator/config/language.h | 167 +++++++++--------- 4 files changed, 135 insertions(+), 114 deletions(-) diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 5b0960fdd..174f9e386 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -31,7 +31,7 @@ Here are some standard links for getting your machine calibrated: //=========================================================================== //============================= SCARA Printer =============================== //=========================================================================== -// For a Delta printer replace the configuration files with the files in the +// For a Scara printer replace the configuration files with the files in the // example_configurations/SCARA directory. // @@ -65,7 +65,7 @@ Here are some standard links for getting your machine calibrated: // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_ULTIMAKER + #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif // Define this to set a custom name for your generic Mendel, @@ -79,10 +79,17 @@ Here are some standard links for getting your machine calibrated: // :[1,2,3,4] #define EXTRUDERS 1 +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} + #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. @@ -131,9 +138,9 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 -// :{ 0: "Not used", 4: "10k !! do not use for a hotend. Bad resolution at high temp. !!", 1: "100k / 4.7k - EPCOS", 51: "100k / 1k - EPCOS", 6: "100k / 4.7k EPCOS - Not as accurate as Table 1", 5: "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", 7: "100k / 4.7k Honeywell 135-104LAG-J01", 71: "100k / 4.7k Honeywell 135-104LAF-J01", 8: "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", 9: "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", 10: "100k / 4.7k RS 198-961", 11: "100k / 4.7k beta 3950 1%", 12: "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", 13: "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", 60: "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", 55: "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", 2: "200k / 4.7k - ATC Semitec 204GT-2", 52: "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", 3: "Mendel-parts / 4.7k", 1047: "Pt1000 / 4.7k", 1010: "Pt1000 / 1k (non standard)", 20: "PT100 (Ultimainboard V2.x)", 147: "Pt100 / 4.7k", 110: "Pt100 / 1k (non-standard)", 998: "Dummy 1", 999: "Dummy 2" } -#define TEMP_SENSOR_0 -1 -#define TEMP_SENSOR_1 -1 + +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 @@ -327,6 +334,7 @@ your extruder heater takes 2 minutes to hit the target on heating. // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN + // #define ENDSTOPPULLUP_ZPROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). @@ -336,10 +344,16 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS // @section machine +// If you want to enable the Z Probe pin, but disable its use, uncomment the line below. +// This only affects a Z Probe Endstop if you have separate Z min endstop as well and have +// activated Z_PROBE_ENDSTOP below. If you are using the Z Min endstop on your Z Probe, +// this has no effect. +//#define DISABLE_Z_PROBE_ENDSTOP // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} @@ -361,9 +375,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true +#define INVERT_X_DIR false #define INVERT_Y_DIR false -#define INVERT_Z_DIR true +#define INVERT_Z_DIR false // @section extruder @@ -391,8 +405,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define X_MIN_POS 0 #define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 205 -#define Y_MAX_POS 205 +#define X_MAX_POS 200 +#define Y_MAX_POS 200 #define Z_MAX_POS 200 //=========================================================================== @@ -561,18 +575,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // default settings -#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,760*1.1} // default steps per unit for Ultimaker -#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 25} // (mm/sec) -#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. +#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,4000,500} // default steps per unit for Ultimaker +#define DEFAULT_MAX_FEEDRATE {300, 300, 5, 25} // (mm/sec) +#define DEFAULT_MAX_ACCELERATION {3000,3000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts - -// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). -// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). -// For the other hotends it is their distance from the extruder 0 hotend. -// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -// #define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) #define DEFAULT_XYJERK 20.0 // (mm/sec) @@ -614,11 +623,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 #define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 #define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define ABS_PREHEAT_HPB_TEMP 110 +#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 //==============================LCD and SD support============================= // @section lcd @@ -626,7 +635,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Define your display language below. Replace (en) with your language code and uncomment. // en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // See also language.h -//#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) +#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) // Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display. // To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset. @@ -730,7 +739,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ // #define PHOTOGRAPH_PIN 23 -// SF send wrong arc g-codes when using Arc Point as fillet procedure +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure //#define SF_ARC_FIX // Support for the BariCUDA Paste Extruder. @@ -784,7 +793,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code -#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially +#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //#define FILAMENT_LCD_DISPLAY diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index 8acdeb969..daf3144d9 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -192,7 +192,7 @@ #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. // @section machine @@ -335,7 +335,7 @@ #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 -#endif // ADVANCE +#endif // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 diff --git a/Marlin/configurator/config/boards.h b/Marlin/configurator/config/boards.h index 079813978..8a60f011d 100644 --- a/Marlin/configurator/config/boards.h +++ b/Marlin/configurator/config/boards.h @@ -10,10 +10,11 @@ #define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0 #define BOARD_SETHI 20 // Sethi 3D_1 #define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2 -#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 / 1.4 (Extruder, Fan, Bed) -#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Extruder0, Extruder1, Bed) -#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Extruder, Fan, Fan) -#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Extruder0, Extruder1, Fan) +#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed) +#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed) +#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan) +#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan) +#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) #define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments #define BOARD_GEN6 5 // Gen6 #define BOARD_GEN6_DELUXE 51 // Gen6 deluxe @@ -28,14 +29,15 @@ #define BOARD_ULTIMAKER 7 // Ultimaker #define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) #define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_3DRAG 77 // 3Drag -#define BOARD_K8200 78 // Vellemann K8200 (derived from 3Drag) +#define BOARD_3DRAG 77 // 3Drag Controller +#define BOARD_K8200 78 // Vellemann K8200 Controller (derived from 3Drag Controller) #define BOARD_TEENSYLU 8 // Teensylu #define BOARD_RUMBA 80 // Rumba #define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286) #define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646) #define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286) #define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make +#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286) #define BOARD_GEN3_PLUS 9 // Gen3+ #define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics #define BOARD_MEGATRONICS 70 // Megatronics @@ -50,10 +52,11 @@ #define BOARD_LEAPFROG 999 // Leapfrog #define BOARD_WITBOX 41 // bq WITBOX #define BOARD_HEPHESTOS 42 // bq Prusa i3 Hephestos +#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers +#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers #define BOARD_99 99 // This is in pins.h but...? #define MB(board) (MOTHERBOARD==BOARD_##board) -#define IS_RAMPS (MB(RAMPS_OLD) || MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF)) #endif //__BOARDS_H diff --git a/Marlin/configurator/config/language.h b/Marlin/configurator/config/language.h index f1193b924..3fe7afd2e 100644 --- a/Marlin/configurator/config/language.h +++ b/Marlin/configurator/config/language.h @@ -11,28 +11,35 @@ // // ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" // ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS +// See also documentation/LCDLanguageFont.md // Languages -// en English -// pl Polish -// fr French -// de German -// es Spanish -// ru Russian -// it Italian -// pt Portuguese -// pt-br Portuguese (Brazil) -// fi Finnish -// an Aragonese -// nl Dutch -// ca Catalan -// eu Basque-Euskera +// en English +// pl Polish +// fr French +// de German +// es Spanish +// ru Russian +// it Italian +// pt Portuguese +// pt-br Portuguese (Brazil) +// fi Finnish +// an Aragonese +// nl Dutch +// ca Catalan +// eu Basque-Euskera +// kana Japanese +// kana_utf Japanese #ifndef LANGUAGE_INCLUDE // pick your language from the list above #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) #endif +#ifdef HAS_AUTOMATIC_VERSIONING + #include "_Version.h" +#endif + #define PROTOCOL_VERSION "1.0" #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) @@ -56,18 +63,37 @@ #elif MB(HEPHESTOS) #define MACHINE_NAME "HEPHESTOS" #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" -#else // Default firmware set to Mendel - #define MACHINE_NAME "Mendel" - #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" +#elif MB(BRAINWAVE_PRO) + #define MACHINE_NAME "Kossel Pro" + #ifndef FIRMWARE_URL + #define FIRMWARE_URL "https://github.com/OpenBeamUSA/Marlin/" + #endif +#else + #ifndef MACHINE_NAME + #define MACHINE_NAME "Mendel" + #endif #endif #ifdef CUSTOM_MENDEL_NAME + #warning CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME + #define CUSTOM_MACHINE_NAME CUSTOM_MENDEL_NAME +#endif + +#ifdef CUSTOM_MACHINE_NAME #undef MACHINE_NAME - #define MACHINE_NAME CUSTOM_MENDEL_NAME + #define MACHINE_NAME CUSTOM_MACHINE_NAME +#endif + +#ifndef FIRMWARE_URL + #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin" +#endif + +#ifndef BUILD_VERSION + #define BUILD_VERSION "V1; Sprinter/grbl mashup for gen6" #endif #ifndef MACHINE_UUID - #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" #endif @@ -114,7 +140,7 @@ #define MSG_HEATING_COMPLETE "Heating done." #define MSG_BED_HEATING "Bed Heating." #define MSG_BED_DONE "Bed done." -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n" +#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n" #define MSG_COUNT_X " Count X: " #define MSG_ERR_KILLED "Printer halted. kill() called!" #define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" @@ -122,12 +148,15 @@ #define MSG_UNKNOWN_COMMAND "Unknown command: \"" #define MSG_ACTIVE_EXTRUDER "Active Extruder: " #define MSG_INVALID_EXTRUDER "Invalid extruder" +#define MSG_INVALID_SOLENOID "Invalid solenoid" #define MSG_X_MIN "x_min: " #define MSG_X_MAX "x_max: " #define MSG_Y_MIN "y_min: " #define MSG_Y_MAX "y_max: " #define MSG_Z_MIN "z_min: " #define MSG_Z_MAX "z_max: " +#define MSG_Z2_MAX "z2_max: " +#define MSG_Z_PROBE "z_probe: " #define MSG_M119_REPORT "Reporting endstop status" #define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_OPEN "open" @@ -160,68 +189,48 @@ #define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" +// temperature.cpp strings +#define MSG_PID_AUTOTUNE "PID Autotune" +#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start" +#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!" +#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" +#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" +#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" +#define MSG_BIAS " bias: " +#define MSG_D " d: " +#define MSG_T_MIN " min: " +#define MSG_T_MAX " max: " +#define MSG_KU " Ku: " +#define MSG_TU " Tu: " +#define MSG_CLASSIC_PID " Classic PID " +#define MSG_KP " Kp: " +#define MSG_KI " Ki: " +#define MSG_KD " Kd: " +#define MSG_OK_B "ok B:" +#define MSG_OK_T "ok T:" +#define MSG_AT " @:" +#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h" +#define MSG_PID_DEBUG " PID_DEBUG " +#define MSG_PID_DEBUG_INPUT ": Input " +#define MSG_PID_DEBUG_OUTPUT " Output " +#define MSG_PID_DEBUG_PTERM " pTerm " +#define MSG_PID_DEBUG_ITERM " iTerm " +#define MSG_PID_DEBUG_DTERM " dTerm " +#define MSG_HEATING_FAILED "Heating failed" +#define MSG_EXTRUDER_SWITCHED_OFF "Extruder switched off. Temperature difference between temp sensors is too high !" + +#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" +#define MSG_THERMAL_RUNAWAY_STOP "Thermal Runaway, system stopped! Heater_ID: " +#define MSG_SWITCHED_OFF_MAX " switched off. MAXTEMP triggered !!" +#define MSG_MINTEMP_EXTRUDER_OFF ": Extruder switched off. MINTEMP triggered !" +#define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX +#define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX + // LCD Menu Messages -// Add your own character. Reference: https://github.com/MarlinFirmware/Marlin/pull/1434 photos -// and https://www.sparkfun.com/datasheets/LCD/HD44780.pdf page 17-18 -#ifdef DOGLCD - #define STR_Ae "\304" // 'Ä' U8glib - #define STR_ae "\344" // 'ä' - #define STR_Oe "\326" // 'Ö' - #define STR_oe STR_Oe // 'ö' - #define STR_Ue "\334" // 'Ü' - #define STR_ue STR_Ue // 'ü' - #define STR_sz "\337" // 'ß' - #define STR_h2 "\262" // '²' - #define STR_h3 "\263" // '³' - #define STR_Deg "\260" // '°' - #define STR_THERMOMETER "\377" -#else - #ifdef DISPLAY_CHARSET_HD44780_JAPAN // HD44780 ROM Code: A00 (Japan) - #define STR_ae "\xe1" - #define STR_Ae STR_ae - #define STR_oe "\357" - #define STR_Oe STR_oe - #define STR_ue "\365" - #define STR_Ue STR_ue - #define STR_sz "\342" - #define STR_h2 "2" - #define STR_h3 "3" - #define STR_Deg "\271" - #define STR_THERMOMETER "\002" - #endif - #ifdef DISPLAY_CHARSET_HD44780_WESTERN // HD44780 ROM Code: A02 (Western) - #define STR_Ae "\216" - #define STR_ae "\204" - #define STR_Oe "\211" - #define STR_oe "\204" - #define STR_Ue "\212" - #define STR_ue "\201" - #define STR_sz "\160" - #define STR_h2 "\262" - #define STR_h3 "\263" - #define STR_Deg "\337" - #define STR_THERMOMETER "\002" - #endif +#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC )) + #define DISPLAY_CHARSET_HD44780_JAPAN #endif -/* -#define TESTSTRING000 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" -#define TESTSTRING020 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define TESTSTRING040 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" -#define TESTSTRING060 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" -#define TESTSTRING100 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" -#define TESTSTRING120 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" -#define TESTSTRING140 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" -#define TESTSTRING160 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" -#define TESTSTRING200 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" -#define TESTSTRING220 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" -#define TESTSTRING240 "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" -#define TESTSTRING260 "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" -#define TESTSTRING300 "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" -#define TESTSTRING320 "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" -#define TESTSTRING340 "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" -#define TESTSTRING360 "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" -*/ #include LANGUAGE_INCLUDE #include "language_en.h" From 46474cf2f2cc1f762ff10a2ab908d3d54f803841 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Sat, 4 Apr 2015 06:15:42 -0500 Subject: [PATCH 232/302] Incorporate @section headers from configurator --- Marlin/Configuration.h | 46 ++++++++++++++++++++++++++++++++++++++ Marlin/Configuration_adv.h | 32 ++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 871d69ccb..174f9e386 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,6 +35,8 @@ Here are some standard links for getting your machine calibrated: // example_configurations/SCARA directory. // +// @section info + // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. @@ -45,12 +47,16 @@ Here are some standard links for getting your machine calibrated: #define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1 //#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2 +// @section machine + // 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. +// :[0,1,2,3,4,5,6,7] #define SERIAL_PORT 0 // This determines the communication speed of the printer +// :[2400,9600,19200,38400,57600,115200,250000] #define BAUDRATE 250000 // This enables the serial port associated to the Bluetooth interface @@ -70,6 +76,7 @@ Here are some standard links for getting your machine calibrated: // #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // This defines the number of extruders +// :[1,2,3,4] #define EXTRUDERS 1 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). @@ -81,12 +88,15 @@ Here are some standard links for getting your machine calibrated: //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) +// :{1:'ATX',2:'X-Box 360'} #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. // #define PS_DEFAULT_OFF +// @section temperature + //=========================================================================== //============================= Thermal Settings ============================ //=========================================================================== @@ -248,6 +258,7 @@ Here are some standard links for getting your machine calibrated: // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED +// @section extruder //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit //can be software-disabled for whatever purposes by @@ -302,12 +313,16 @@ your extruder heater takes 2 minutes to hit the target on heating. //============================= Mechanical Settings ========================= //=========================================================================== +// @section machine + // Uncomment this option to enable CoreXY kinematics // #define COREXY // Enable this option for Toshiba steppers // #define CONFIG_STEPPERS_TOSHIBA +// @section homing + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -332,6 +347,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS + +// @section machine // If you want to enable the Z Probe pin, but disable its use, uncomment the line below. // This only affects a Z Probe Endstop if you have separate Z min endstop as well and have // activated Z_PROBE_ENDSTOP below. If you are using the Z Min endstop on your Z Probe, @@ -339,6 +356,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define DISABLE_Z_PROBE_ENDSTOP // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{0:'Low',1:'High'} #define X_ENABLE_ON 0 #define Y_ENABLE_ON 0 #define Z_ENABLE_ON 0 @@ -348,20 +366,32 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #define DISABLE_X false #define DISABLE_Y false #define DISABLE_Z false + +// @section extruder + #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled +// @section machine + // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false #define INVERT_Y_DIR false #define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. #define INVERT_E0_DIR false #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +// @section homing + // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 @@ -369,6 +399,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. +// @section machine + // Travel limits after homing (units are in mm) #define X_MIN_POS 0 #define Y_MIN_POS 0 @@ -408,6 +440,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //============================= Bed Auto Leveling =========================== //=========================================================================== +// @section bedlevel + //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. @@ -516,6 +550,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif // ENABLE_AUTO_BED_LEVELING +// @section homing + // The position of the homing switches //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) @@ -529,6 +565,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif +// @section movement + /** * MOVEMENT SETTINGS */ @@ -555,6 +593,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //============================= Additional Features =========================== //============================================================================= +// @section more + // Custom M code points #define CUSTOM_M_CODES #ifdef CUSTOM_M_CODES @@ -565,6 +605,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif #endif +// @section extras // EEPROM // The microcontroller can store settings in the EEPROM, e.g. max velocity... @@ -577,6 +618,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // please keep turned on if you can. //#define EEPROM_CHITCHAT +// @section temperature + // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 #define PLA_PREHEAT_HPB_TEMP 70 @@ -587,6 +630,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 //==============================LCD and SD support============================= +// @section lcd // Define your display language below. Replace (en) with your language code and uncomment. // en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test @@ -670,6 +714,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SAV_3DLCD +// @section extras + // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino //#define FAST_PWM_FAN diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4ed188946..daf3144d9 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,6 +186,8 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 @@ -181,8 +195,12 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -317,6 +343,8 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +352,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +362,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section extras // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. From d867c185350aec24419a4899254ed1f49085cd3b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Apr 2015 03:44:47 -0700 Subject: [PATCH 233/302] Fix compile error with Z_DUAL_ENDSTOPS --- Marlin/pins_RAMPS_13.h | 4 ++++ Marlin/stepper.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 2708117d0..af1d2d3bb 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -40,6 +40,10 @@ #define Y2_DIR_PIN 34 #define Y2_ENABLE_PIN 30 +#undef Z2_STEP_PIN +#undef Z2_DIR_PIN +#undef Z2_ENABLE_PIN + #define Z2_STEP_PIN 36 #define Z2_DIR_PIN 34 #define Z2_ENABLE_PIN 30 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index ba4a4e967..c53d7c0c9 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -105,16 +105,16 @@ static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_P static bool old_z_max_endstop = false; #endif #ifdef Z_DUAL_ENDSTOPS - #if HAS_Z2_MIN + // #if HAS_Z2_MIN static bool old_z2_min_endstop = false; - #endif - #if HAS_Z2_MAX + // #endif + // #if HAS_Z2_MAX static bool old_z2_max_endstop = false; - #endif + // #endif #endif #ifdef Z_PROBE_ENDSTOP // No need to check for valid pin, SanityCheck.h already does this. -static bool old_z_probe_endstop = false; + static bool old_z_probe_endstop = false; #endif static bool check_endstops = true; From b6f2bff4619546011668cfaa0bfa434f0ed1f761 Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 5 Apr 2015 23:34:56 -0600 Subject: [PATCH 234/302] Azteeg X3 Pro Pin fix ups --- Marlin/pins_AZTEEG_X3_PRO.h | 80 +++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index d76874a09..83de4520e 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -26,12 +26,12 @@ #undef Z_MIN_PIN #undef Z_MAX_PIN - #define X_MIN_PIN 2 - #define X_MAX_PIN 3 - #define Y_MIN_PIN 15 - #define Y_MAX_PIN 14 - #define Z_MIN_PIN 19 - #define Z_MAX_PIN 18 + #define X_MIN_PIN 2 + #define X_MAX_PIN 3 + #define Y_MIN_PIN 15 + #define Y_MAX_PIN 14 + #define Z_MIN_PIN 19 + #define Z_MAX_PIN 18 #endif // #ifdef Z_PROBE_ENDSTOP @@ -76,43 +76,45 @@ //on a Delta with 1 servo. Running through the Z servo endstop in code. //Physical wire attachment was done on EXT1 on the GND, 5V, and D47 pins. // -#undef SERVO0_PIN -#undef SERVO1_PIN -#undef SERVO2_PIN -#undef SERVO3_PIN + #undef SERVO0_PIN + #undef SERVO1_PIN + #undef SERVO2_PIN + #undef SERVO3_PIN -#ifdef NUM_SERVOS - #define SERVO0_PIN -1 - #if NUM_SERVOS > 1 - #define SERVO1_PIN -1 - #if NUM_SERVOS > 2 - #define SERVO2_PIN 47 - #if NUM_SERVOS > 3 - #define SERVO3_PIN -1 - #endif - #endif - #endif -#endif + #ifdef NUM_SERVOS + #define SERVO0_PIN 47 + #if NUM_SERVOS > 1 + #define SERVO1_PIN -1 + #if NUM_SERVOS > 2 + #define SERVO2_PIN -1 + #if NUM_SERVOS > 3 + #define SERVO3_PIN -1 + #endif + #endif + #endif + #endif //LCD Pins// -#if defined(VIKI2) || defined(miniVIKI) - #define BEEPER 33 + #if defined(VIKI2) || defined(miniVIKI) + #define BEEPER 33 // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - + #define DOGLCD_A0 44 + #define DOGLCD_CS 45 + #define LCD_SCREEN_ROT_180 + //The encoder and click button - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 //the click switch + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 39 //the click switch + + #define SDSS 53 + #define SDCARDDETECT 49 + + #define KILL_PIN 31 + #endif - #define SDSS 53 - #define SDCARDDETECT 49 - - #define KILL_PIN 31 - - #define STAT_LED_RED 32 - #define STAT_LED_BLUE 35 -#endif + #ifdef TEMP_STAT_LEDS + #define STAT_LED_RED 32 + #define STAT_LED_BLUE 35 + #endif From d5216936410099636a68f93ae598d4db37f43977 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 6 Apr 2015 12:31:31 +0200 Subject: [PATCH 235/302] Revert "Draw content in display loop only when needed" This reverts commit bf04a92cc0046d4af04e422d9e84e027e59fb2ba. --- Marlin/dogm_lcd_implementation.h | 33 +++++++++++++------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index bf9726cee..e6cfb8078 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -186,7 +186,7 @@ char lcd_printPGM(const char* str) { return n; } -int8_t show_splashscreen = 2; +static int8_t show_splashscreed = 2; static void lcd_implementation_init() { @@ -221,25 +221,18 @@ static void lcd_implementation_init() u8g.firstPage(); do { - switch (show_splashscreen) { - case 2 : { - u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); - break; - } - case 1 : { - lcd_setFont(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); - #else - int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; - u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); - u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); - #endif - break; - } - break; - } - if (show_splashscreen) show_splashscreen--; + if (show_splashscreed) { + u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); + lcd_setFont(FONT_MENU); + #ifndef STRING_SPLASH_LINE2 + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); + #else + int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); + u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); + #endif + show_splashscreed--; + } } while (u8g.nextPage()); } From 6ae714894e86edf48233794448559f655a5d702d Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 6 Apr 2015 12:43:38 +0200 Subject: [PATCH 236/302] Now the simplycistic solution. Just and only display splashscreen only once. --- Marlin/dogm_lcd_implementation.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index e6cfb8078..f940a8975 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -186,7 +186,7 @@ char lcd_printPGM(const char* str) { return n; } -static int8_t show_splashscreed = 2; +static bool show_splashscreen = true; static void lcd_implementation_init() { @@ -221,7 +221,7 @@ static void lcd_implementation_init() u8g.firstPage(); do { - if (show_splashscreed) { + if (show_splashscreen) { u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); lcd_setFont(FONT_MENU); #ifndef STRING_SPLASH_LINE2 @@ -231,9 +231,9 @@ static void lcd_implementation_init() u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); #endif - show_splashscreed--; } } while (u8g.nextPage()); + show_splashscreen = false; } static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop From 9a093b2e8fc780cc61d55d088f592ec44d370482 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Mon, 6 Apr 2015 19:38:59 +0200 Subject: [PATCH 237/302] Added #error + mention not to enable ABL and Mesh at the same time --- Documentation/MeshBedLeveling.md | 2 +- Marlin/Configuration.h | 4 ++++ Marlin/configurator/config/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos/Configuration.h | 4 ++++ Marlin/example_configurations/K8200/Configuration.h | 4 ++++ Marlin/example_configurations/SCARA/Configuration.h | 4 ++++ Marlin/example_configurations/WITBOX/Configuration.h | 4 ++++ Marlin/example_configurations/delta/generic/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_mini/Configuration.h | 4 ++++ Marlin/example_configurations/makibox/Configuration.h | 4 ++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 4 ++++ 12 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Documentation/MeshBedLeveling.md b/Documentation/MeshBedLeveling.md index 7981a896c..09c1ec948 100644 --- a/Documentation/MeshBedLeveling.md +++ b/Documentation/MeshBedLeveling.md @@ -7,7 +7,7 @@ Background This mesh based method of leveling/compensating can compensate for an non-flat bed. There are various opinions about doing this. It was primarily written to compensate a RigidBot BIG bed (40x30cm) that was somewhat bent. -Currently there is no automatic way to probe the bed like the Auto Bed Leveling feature. This might soon be implemented though, stay tuned. +Currently there is no automatic way to probe the bed like the Auto Bed Leveling feature. So, you can not enable `ENABLE_AUTO_BED_LEVELING` at the same time. This might soon be implemented though, stay tuned. Theory ------ diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 419e010dc..7803bdd0a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -417,6 +417,10 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index bb8125ef1..cd260bf89 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -437,6 +437,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 49df589dd..fe95e1a2e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -387,6 +387,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index f58fd8315..04a9060c2 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -410,6 +410,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 07af43647..5655219dd 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -415,6 +415,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 8a85e8e80..8e4a5ea7d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -439,6 +439,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index ed964304f..1bde59441 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -409,6 +409,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index acd6d9f34..5a25872b0 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -437,6 +437,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index bc0a000e0..a5ebffcdd 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -437,6 +437,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 557b15fe2..c3566eb57 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -407,6 +407,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index e9158b041..c88fe8128 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -409,6 +409,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING + #ifdef MESH_BED_LEVELING + #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both + #endif // MESH_BED_LEVELING + // There are 2 different ways to specify probing locations // // - "grid" mode From d27c82a4500229abdf9a3d478b981f0315cfee21 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Mon, 6 Apr 2015 23:03:06 +0200 Subject: [PATCH 238/302] Added check for Delta printers in Mesh, #error not yet supported. --- Marlin/Configuration.h | 5 +++++ Marlin/configurator/config/Configuration.h | 5 +++++ Marlin/example_configurations/Felix/Configuration.h | 5 +++++ Marlin/example_configurations/Hephestos/Configuration.h | 5 +++++ Marlin/example_configurations/K8200/Configuration.h | 5 +++++ Marlin/example_configurations/SCARA/Configuration.h | 5 +++++ Marlin/example_configurations/WITBOX/Configuration.h | 5 +++++ Marlin/example_configurations/delta/generic/Configuration.h | 5 +++++ .../example_configurations/delta/kossel_mini/Configuration.h | 5 +++++ Marlin/example_configurations/makibox/Configuration.h | 5 +++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 5 +++++ 11 files changed, 55 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 7803bdd0a..a525894a4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -399,6 +399,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index cd260bf89..fedea0d24 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -417,6 +417,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index fe95e1a2e..15546db88 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -369,6 +369,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 04a9060c2..a392e7f91 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -392,6 +392,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 5655219dd..3b16d3cab 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -397,6 +397,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 8e4a5ea7d..c35f4f21b 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -421,6 +421,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 1bde59441..9e4275785 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -391,6 +391,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 5a25872b0..9a14554c6 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -419,6 +419,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index a5ebffcdd..006d964a6 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -419,6 +419,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index c3566eb57..6498eac59 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -389,6 +389,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index c88fe8128..20545496e 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -391,6 +391,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING + + #ifdef DELTA + #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers + #endif + #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 From 6d084c017f4d5847c593a1ac92a8103f92d9f391 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Apr 2015 17:04:22 -0700 Subject: [PATCH 239/302] Fix typo in FWRETRACT handler Should be `retracting` and not `retract` --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7736acb50..440375661 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1603,7 +1603,7 @@ static void homeaxis(int axis) { } feedrate = oldFeedrate; - retracted[active_extruder] = retract; + retracted[active_extruder] = retracting; } // retract() From ac843fbf3b034be9b3f2fcabdf090bc9896e048f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 7 Apr 2015 02:33:34 +0200 Subject: [PATCH 240/302] Fix lcd_status_message Because we now can use utf8 with up to 3 bytes per symbol, lcd_status_message[] must be 3*LCD_WIDTH wide. Filling up the message, or cutting to length, are fixed to. Fix for #1832 about at the end. --- Marlin/ultralcd.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 034adc394..fc271f4e0 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -31,7 +31,7 @@ int absPreheatFanSpeed; typedef void (*menuFunc_t)(); uint8_t lcd_status_message_level; -char lcd_status_message[LCD_WIDTH+1] = WELCOME_MSG; +char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1 #ifdef DOGLCD #include "dogm_lcd_implementation.h" @@ -1402,13 +1402,6 @@ void lcd_ignore_click(bool b) { } void lcd_finishstatus(bool persist=false) { - int len = lcd_strlen(lcd_status_message); - if (len > 0) { - while (len < LCD_WIDTH) { - lcd_status_message[len++] = ' '; - } - } - lcd_status_message[LCD_WIDTH] = '\0'; #ifdef LCD_PROGRESS_BAR progressBarTick = millis(); #if PROGRESS_MSG_EXPIRE > 0 @@ -1426,15 +1419,27 @@ void lcd_finishstatus(bool persist=false) { void dontExpireStatus() { expireStatusMillis = 0; } #endif +void set_utf_strlen(char *s, uint8_t n) { + uint8_t i = 0, j = 0; + while (s[i] && (j < n)) { + if ((s[i] & 0xc0u) != 0x80u) j++; + i++; + } + while (j++ < n) s[i++] = ' '; + s[i] = 0; +} + void lcd_setstatus(const char* message, bool persist) { if (lcd_status_message_level > 0) return; - strncpy(lcd_status_message, message, LCD_WIDTH); + strncpy(lcd_status_message, message, 3*LCD_WIDTH); + set_utf_strlen(lcd_status_message, LCD_WIDTH); lcd_finishstatus(persist); } void lcd_setstatuspgm(const char* message, uint8_t level) { if (level >= lcd_status_message_level) { - strncpy_P(lcd_status_message, message, LCD_WIDTH); + strncpy_P(lcd_status_message, message, 3*LCD_WIDTH); + set_utf_strlen(lcd_status_message, LCD_WIDTH); lcd_status_message_level = level; lcd_finishstatus(level > 0); } From d20f42c883d259a3f4589a38b24517d2257dd5d3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Apr 2015 20:58:09 -0700 Subject: [PATCH 241/302] Don't stow the probe until the last grid point! - Address Issue #1682 at hash #issuecomment-89756858 --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 440375661..69aee6c60 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2322,7 +2322,7 @@ inline void gcode_G28() { act = ProbeDeployAndStow; else if (yCount == 0 && xCount == 0) act = ProbeDeploy; - else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == auto_bed_leveling_grid_points - 1) + else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc) act = ProbeStow; else act = ProbeStay; From e502144eda540d46e210069cb364a29e46dc965d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Apr 2015 21:28:14 -0700 Subject: [PATCH 242/302] Fixup formatting of last commit --- Marlin/temperature.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index b8403f3c7..aa524ac56 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1525,17 +1525,15 @@ ISR(TIMER0_COMPB_vect) { for (int i = 0; i < 4; i++) raw_temp_value[i] = 0; raw_temp_bed_value = 0; - #if HAS_TEMP_0 - #ifndef HEATER_0_USES_MAX6675 - #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP - #define GE0 <= - #else - #define GE0 >= - #endif - if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); - if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); - #endif - #endif + #if HAS_TEMP_0 && !defined(HEATER_0_USES_MAX6675) + #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP + #define GE0 <= + #else + #define GE0 >= + #endif + if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); + if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); + #endif #if HAS_TEMP_1 #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP From 967db181d0f783fe4b1183c71571e5621bd572e3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Apr 2015 21:46:18 -0700 Subject: [PATCH 243/302] Latest upstream commits --- Marlin/Configuration.h | 9 ++++++--- Marlin/configurator/config/Configuration.h | 8 +++++--- Marlin/configurator/js/configurator.js | 5 +++-- Marlin/example_configurations/Felix/Configuration.h | 8 +++++--- Marlin/example_configurations/Felix/Configuration_DUAL.h | 8 +++++--- Marlin/example_configurations/Hephestos/Configuration.h | 8 +++++--- Marlin/example_configurations/K8200/Configuration.h | 8 +++++--- Marlin/example_configurations/SCARA/Configuration.h | 8 +++++--- Marlin/example_configurations/WITBOX/Configuration.h | 8 +++++--- .../example_configurations/delta/generic/Configuration.h | 8 +++++--- .../delta/kossel_mini/Configuration.h | 8 +++++--- Marlin/example_configurations/makibox/Configuration.h | 8 +++++--- .../example_configurations/tvrrug/Round2/Configuration.h | 8 +++++--- 13 files changed, 64 insertions(+), 38 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 174f9e386..33a419b6b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -614,9 +614,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif + // @section temperature diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 174f9e386..52d0d4b85 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -614,9 +614,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // @section temperature diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js index 9330c5e7f..1088484ac 100644 --- a/Marlin/configurator/js/configurator.js +++ b/Marlin/configurator/js/configurator.js @@ -397,7 +397,7 @@ window.configuratorApp = (function(){ * .count number of items in the group */ refreshDefineGroups: function(cindex) { - var findDef = /^(|.*_)(([XYZE](MAX|MIN))|(E[0-3]|[XYZE01234])|MAX|MIN|(bed)?K[pid]|HOTEND|HPB|JAPAN|WESTERN|LEFT|RIGHT|BACK|FRONT|[XYZ]_POINT)(_.*|)$/i; + var findDef = /^(|.*_)(([XYZE](MAX|MIN))|(E[0-3]|[XYZE01234])|MAX|MIN|(bed)?K[pid]|HOTEND|HPB|JAPAN|WESTERN|CYRILLIC|LEFT|RIGHT|BACK|FRONT|[XYZ]_POINT)(_.*|)$/i; var match_prev, patt, title, nameList, groups = {}, match_section; $.each(define_list[cindex], function(i, name) { if (match_prev) { @@ -458,7 +458,8 @@ window.configuratorApp = (function(){ break; case 'JAPAN': case 'WESTERN': - patt = '(JAPAN|WESTERN)'; + case 'CYRILLIC': + patt = '(JAPAN|WESTERN|CYRILLIC)'; break; case 'XMIN': case 'XMAX': diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 72d716989..777848852 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -550,9 +550,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index e6683b4e8..0e9970941 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -550,9 +550,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index ac101be4d..bc644f8c6 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -572,9 +572,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 200 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 6d743e937..9d741d430 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -578,9 +578,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support #define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 190 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index f126ab99b..8bdb407dd 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -601,9 +601,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 265f73fce..d308fbd02 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -571,9 +571,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 200 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3218d2d9d..8bb4b3a8f 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -618,9 +618,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 489dca6d5..d594cde72 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -622,9 +622,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 45350960f..6c4bdc232 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -569,9 +569,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support #define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2c98a310f..81f4dab5d 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -575,9 +575,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. //define this to enable EEPROM support //#define EEPROM_SETTINGS -//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: -// please keep turned on if you can. -//#define EEPROM_CHITCHAT + +#ifdef EEPROM_SETTINGS + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // please keep turned on if you can. +#endif // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 From 7d2c2f179092fba5204476ad2b0bae6272e07435 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Apr 2015 23:16:01 -0700 Subject: [PATCH 244/302] Updates for the configurator - Sections in all `Configuration_adv.h` - Recognize JAPANESE/WESTERN/CYRILLIC options - Better capturing of comments for tooltips --- Marlin/Configuration_adv.h | 240 ++++++++-------- .../configurator/config/Configuration_adv.h | 240 ++++++++-------- Marlin/configurator/index.html | 20 +- Marlin/configurator/js/configurator.js | 101 ++++--- .../Felix/Configuration_adv.h | 272 ++++++++++-------- .../Hephestos/Configuration_adv.h | 272 ++++++++++-------- .../K8200/Configuration_adv.h | 272 ++++++++++-------- .../SCARA/Configuration_adv.h | 272 ++++++++++-------- .../WITBOX/Configuration_adv.h | 272 ++++++++++-------- .../delta/generic/Configuration_adv.h | 270 +++++++++-------- .../delta/kossel_mini/Configuration_adv.h | 270 +++++++++-------- .../makibox/Configuration_adv.h | 272 ++++++++++-------- .../tvrrug/Round2/Configuration_adv.h | 272 ++++++++++-------- 13 files changed, 1736 insertions(+), 1309 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index daf3144d9..6478eb923 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -312,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -322,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -337,6 +341,8 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 @@ -368,7 +374,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// @section extras +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -405,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -465,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index daf3144d9..6478eb923 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -312,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -322,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -337,6 +341,8 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 @@ -368,7 +374,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// @section extras +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -405,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -465,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/configurator/index.html b/Marlin/configurator/index.html index 93d2ae553..9fa40a105 100644 --- a/Marlin/configurator/index.html +++ b/Marlin/configurator/index.html @@ -30,6 +30,10 @@ Download Zip +
+ Info +
+
Machine @@ -84,12 +88,20 @@ Bed Leveling
-
- Extras +
+ FW Retract
-
- Info +
+ TMC +
+ +
+ L6470 +
+ +
+ Extras
diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js index 1088484ac..254e016d3 100644 --- a/Marlin/configurator/js/configurator.js +++ b/Marlin/configurator/js/configurator.js @@ -1268,56 +1268,73 @@ window.configuratorApp = (function(){ if (info.line.search(find) >= 0) eoltip = tooltip = info.line.replace(find, '$1'); - // Get all the comments immediately before the item + // Get all the comments immediately before the item, also include #define lines preceding it var s; - find = new RegExp('(([ \\t]*(//|#)[^\n]+\n){1,4})' + info.line.regEsc(), 'g'); + // find = new RegExp('(([ \\t]*(//|#)[^\n]+\n){1,4})' + info.line.regEsc(), 'g'); + find = new RegExp('(([ \\t]*//+[^\n]+\n)+([ \\t]*(//)?#define[^\n]+\n)*)' + info.line.regEsc(), 'g'); if (r = find.exec(txt)) { - // Get the text of the found comments + var temp = [], tips = []; + + // Find each line in forward order, store in reverse find = new RegExp('^[ \\t]*//+[ \\t]*(.*)[ \\t]*$', 'gm'); - while((s = find.exec(r[1])) !== null) { - var tip = s[1].replace(/[ \\t]*(={5,}|(#define[ \\t]+.*|@section[ \\t]+\w+))[ \\t]*/g, ''); - if (tip.length) { - if (tip.match(/^#define[ \\t]/) != null) tooltip = eoltip; - // JSON data? Save as select options - if (!info.options && tip.match(/:[\[{]/) != null) { - // TODO - // :[1-6] = value limits - var o; eval('o=' + tip.substr(1)); - info.options = o; - if (Object.prototype.toString.call(o) == "[object Array]" && o.length == 2 && !eval(''+o[0])) - info.type = 'toggle'; - } - else { - // Other lines added to the tooltip - tooltip += ' ' + tip + '\n'; - } + while((s = find.exec(r[1])) !== null) temp.unshift(s[1]); + + console.log(name+":\n"+temp.join('\n')); + + // Go through the reversed lines and add comment lines on + $.each(temp, function(i,v) { + // @ annotation breaks the comment chain + if (v.match(/^[ \\t]*\/\/+[ \\t]*@/)) return false; + // A #define breaks the chain, after a good tip + if (v.match(/^[ \\t]*(\/\/+)?[ \\t]*#define/)) return (tips.length < 1); + // Skip unwanted lines + if (v.match(/^[ \\t]*(={5,}|#define[ \\t]+.*)/g)) return true; + tips.unshift(v); + }); + + // Build the final tooltip, extract embedded options + $.each(tips, function(i,tip) { + // if (tip.match(/^#define[ \\t]/) != null) tooltip = eoltip; + // JSON data? Save as select options + if (!info.options && tip.match(/:[\[{]/) != null) { + // TODO + // :[1-6] = value limits + var o; eval('o=' + tip.substr(1)); + info.options = o; + if (Object.prototype.toString.call(o) == "[object Array]" && o.length == 2 && !eval(''+o[0])) + info.type = 'toggle'; } - } - } - - // Add .tooltip and .lineNum properties to the info - find = new RegExp('^'+name); // Strip the name from the tooltip - var lineNum = this.getLineNumberOfText(info.line, txt); - - // See if this define is enabled conditionally - var enable_cond = ''; - $.each(dependent_groups, function(cond,dat){ - $.each(dat, function(i,o){ - if (o.cindex == cindex && lineNum > o.start && lineNum < o.end) { - if (enable_cond != '') enable_cond += ' && '; - enable_cond += '(' + cond + ')'; + else { + // Other lines added to the tooltip + tooltip += ' ' + tip + '\n'; } }); - }); - $.extend(info, { - tooltip: ''+name+' '+tooltip.trim().replace(find,'').toHTML(), - lineNum: lineNum, - switchable: (info.type != 'switch' && info.line.match(/^[ \t]*\/\//)) || false, // Disabled? Mark as "switchable" - enabled: enable_cond ? enable_cond : 'true' - }); + // Add .tooltip and .lineNum properties to the info + find = new RegExp('^'+name); // Strip the name from the tooltip + var lineNum = this.getLineNumberOfText(info.line, txt); - } + // See if this define is enabled conditionally + var enable_cond = ''; + $.each(dependent_groups, function(cond,dat){ + $.each(dat, function(i,o){ + if (o.cindex == cindex && lineNum > o.start && lineNum < o.end) { + if (enable_cond != '') enable_cond += ' && '; + enable_cond += '(' + cond + ')'; + } + }); + }); + + $.extend(info, { + tooltip: ''+name+' '+tooltip.trim().replace(find,'').toHTML(), + lineNum: lineNum, + switchable: (info.type != 'switch' && info.line.match(/^[ \t]*\/\//)) || false, // Disabled? Mark as "switchable" + enabled: enable_cond ? enable_cond : 'true' + }); + + } // found comments + + } // if info.type else info = null; diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d60eb5296..a80790b95 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 3 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 0529df9be..84536d044 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + //#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 100.47095761381482 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 5 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index d60eb5296..a80790b95 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 3 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 5145b1668..edc2445af 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 180. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 3 #define Y_HOME_BUMP_MM 3 #define Z_HOME_BUMP_MM 3 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 10*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder #define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 1000 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index ab480dd63..15c523284 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + //#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 100.47095761381482 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 5 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 501cd814d..88b76c66e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,6 +186,8 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 @@ -181,8 +195,12 @@ #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -242,6 +264,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -274,6 +298,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -287,6 +313,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -297,12 +325,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -312,12 +342,16 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -325,6 +359,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -333,11 +369,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -374,58 +412,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -434,72 +474,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index c402064bf..9b52ede7b 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,6 +186,8 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 @@ -181,8 +195,12 @@ #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 3db90efcf..7b63732a6 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 2ecf75951..d221f080b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -3,6 +3,8 @@ #include "Conditionals.h" +// @section temperature + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -46,6 +48,8 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +// @section extruder + // extruder run-out prevention. //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT @@ -55,6 +59,8 @@ #define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 +// @section temperature + //These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. //The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" #define TEMP_SENSOR_AD595_OFFSET 0.0 @@ -72,6 +78,8 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// @section extruder + // Extruder cooling fans // Configure fan pin outputs to automatically turn on/off when the associated // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. @@ -89,8 +97,12 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// @section homing + #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// @section extras + //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. // A single Z stepper driver is usually used to drive 2 stepper motors. @@ -174,15 +186,21 @@ #endif //DUAL_X_CARRIAGE +// @section homing + //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 1 -#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// @section machine + #define AXIS_RELATIVE_MODES {false, false, false, false} +// @section machine + //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false @@ -195,11 +213,15 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 +// @section lcd + #ifdef ULTIPANEL #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif +// @section extras + // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -241,6 +263,8 @@ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +// @section lcd + #ifdef SDSUPPORT // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted @@ -273,6 +297,8 @@ #endif // SDSUPPORT +// @section more + // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -286,6 +312,8 @@ // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED +// @section lcd + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! @@ -296,12 +324,14 @@ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #endif +// @section extruder + // extruder advance constant (s2/mm3) // // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 // -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE @@ -311,12 +341,16 @@ #define STEPS_MM_E 836 #endif +// @section extras + // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// @section temperature + // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL @@ -324,6 +358,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st //=============================Buffers ============================ //=========================================================================== +// @section hidden + // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. #ifdef SDSUPPORT @@ -332,11 +368,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif +// @section more //The ASCII buffer for receiving from the serial: #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// @section fwretract // Firmware based and LCD controlled retract // M207 and M208 can be used to define parameters for the retraction. @@ -373,58 +411,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ +// @section tmc + //#define HAVE_TMCDRIVER #ifdef HAVE_TMCDRIVER -// #define X_IS_TMC - #define X_MAX_CURRENT 1000 //in mA - #define X_SENSE_RESISTOR 91 //in mOhms - #define X_MICROSTEPS 16 //number of microsteps - -// #define X2_IS_TMC - #define X2_MAX_CURRENT 1000 //in mA - #define X2_SENSE_RESISTOR 91 //in mOhms - #define X2_MICROSTEPS 16 //number of microsteps - -// #define Y_IS_TMC - #define Y_MAX_CURRENT 1000 //in mA - #define Y_SENSE_RESISTOR 91 //in mOhms - #define Y_MICROSTEPS 16 //number of microsteps - -// #define Y2_IS_TMC - #define Y2_MAX_CURRENT 1000 //in mA - #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -// #define Z_IS_TMC - #define Z_MAX_CURRENT 1000 //in mA - #define Z_SENSE_RESISTOR 91 //in mOhms - #define Z_MICROSTEPS 16 //number of microsteps - -// #define Z2_IS_TMC - #define Z2_MAX_CURRENT 1000 //in mA - #define Z2_SENSE_RESISTOR 91 //in mOhms - #define Z2_MICROSTEPS 16 //number of microsteps - -// #define E0_IS_TMC - #define E0_MAX_CURRENT 1000 //in mA - #define E0_SENSE_RESISTOR 91 //in mOhms - #define E0_MICROSTEPS 16 //number of microsteps - -// #define E1_IS_TMC - #define E1_MAX_CURRENT 1000 //in mA - #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -// #define E2_IS_TMC - #define E2_MAX_CURRENT 1000 //in mA - #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -// #define E3_IS_TMC - #define E3_MAX_CURRENT 1000 //in mA - #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps +// #define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + +// #define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + +// #define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + +// #define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + +// #define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + +// #define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + +// #define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + +// #define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + +// #define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + +// #define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps #endif @@ -433,72 +473,74 @@ const unsigned int dropsegments=5; //everything with less than this number of st * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ +// @section l6470 + //#define HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER -// #define X_IS_L6470 - #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define X2_IS_L6470 - #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y_IS_L6470 - #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z_IS_L6470 - #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define Z2_IS_L6470 - #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E0_IS_L6470 - #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -// #define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high - #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - +// #define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +// #define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + #endif #include "Conditionals.h" From c379f17117474b77277aaeea08e914373b5c20a5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Apr 2015 23:21:33 -0700 Subject: [PATCH 245/302] Encapsulate setting of homing_bump_feedrate --- Marlin/Marlin_main.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 69aee6c60..015394ca7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -203,7 +203,6 @@ #endif float homing_feedrate[] = HOMING_FEEDRATE; -int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; @@ -989,6 +988,15 @@ static void axis_is_at_home(int axis) { /** * Some planner shorthand inline functions */ +inline void set_homing_bump_feedrate(AxisEnum axis) { + const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; + if (homing_bump_divisor[axis] >= 1) + feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; + else { + feedrate = homing_feedrate[axis] / 10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); + } +} inline void line_to_current_position() { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); } @@ -1119,12 +1127,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, endstops_hit_on_purpose(); // clear endstop hit flags // move back down slowly to find bed - if (homing_bump_divisor[Z_AXIS] >= 1) - feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS]; - else { - feedrate = homing_feedrate[Z_AXIS] / 10; - SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); - } + set_homing_bump_feedrate(Z_AXIS); zPosition -= home_bump_mm(Z_AXIS) * 2; line_to_z(zPosition); @@ -1437,7 +1440,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) -static void homeaxis(int axis) { +static void homeaxis(AxisEnum axis) { #define HOMEAXIS_DO(LETTER) \ ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) @@ -1488,12 +1491,7 @@ static void homeaxis(int axis) { st_synchronize(); // Slow down the feedrate for the next move - if (homing_bump_divisor[axis] >= 1) - feedrate = homing_feedrate[axis] / homing_bump_divisor[axis]; - else { - feedrate = homing_feedrate[axis] / 10; - SERIAL_ECHOLNPGM("Warning: The Homing Bump Feedrate Divisor cannot be less than 1"); - } + set_homing_bump_feedrate(axis); // Move slowly towards the endstop until triggered destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir; From a9ed39b12dc37f71a39c36154bf9ec60bbb8ec1e Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Tue, 7 Apr 2015 22:58:08 +0200 Subject: [PATCH 246/302] Moved checks into SanityCheck.h + removed previous added checks. --- Marlin/Configuration.h | 9 --------- Marlin/SanityCheck.h | 12 ++++++++++++ Marlin/configurator/config/Configuration.h | 9 --------- Marlin/example_configurations/Felix/Configuration.h | 9 --------- .../example_configurations/Hephestos/Configuration.h | 9 --------- Marlin/example_configurations/K8200/Configuration.h | 9 --------- Marlin/example_configurations/SCARA/Configuration.h | 9 --------- Marlin/example_configurations/WITBOX/Configuration.h | 9 --------- .../delta/generic/Configuration.h | 9 --------- .../delta/kossel_mini/Configuration.h | 9 --------- .../example_configurations/makibox/Configuration.h | 9 --------- .../tvrrug/Round2/Configuration.h | 9 --------- 12 files changed, 12 insertions(+), 99 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 9234d2ce7..788ee58ff 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -431,11 +431,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -456,10 +451,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index d92938c1d..d1be7703d 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -91,6 +91,18 @@ #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN for your LCD controller. #endif + /** + * Mesh Bed Leveling + */ + #ifdef MESH_BED_LEVELING + #ifdef DELTA + #error MESH_BED_LEVELING does not yet support DELTA printers + #endif + #ifdef ENABLE_AUTO_BED_LEVELING + #error Select ENABLE_AUTO_BED_LEVELING or MESH_BED_LEVELING, not both + #endif + #endif + /** * Auto Bed Leveling */ diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 025bfea89..e5130531b 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -431,11 +431,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -456,10 +451,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 69b602502..9ed947254 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -369,11 +369,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -392,10 +387,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 39b1198d7..d320e9ea9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -392,11 +392,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -415,10 +410,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 31e6f3f4b..fdbb32a86 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -397,11 +397,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -420,10 +415,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 283922edd..96e05e656 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -421,11 +421,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -444,10 +439,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index dd00a4bc8..2bbe50938 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -391,11 +391,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -414,10 +409,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index a757ff7ab..c5ab70da2 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -419,11 +419,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -442,10 +437,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 6ac4669ae..22f4f3f39 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -419,11 +419,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -442,10 +437,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 2b6834b61..fffc81c70 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -389,11 +389,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -412,10 +407,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 7f4867890..eb0e5a290 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -391,11 +391,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #endif // MANUAL_BED_LEVELING #ifdef MESH_BED_LEVELING - - #ifdef DELTA - #error 'MESH_BED_LEVELING' does not yet support 'DELTA' printers - #endif - #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -414,10 +409,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef ENABLE_AUTO_BED_LEVELING - #ifdef MESH_BED_LEVELING - #error Select 'ENABLE_AUTO_BED_LEVELING' or 'MESH_BED_LEVELING', not both - #endif // MESH_BED_LEVELING - // There are 2 different ways to specify probing locations // // - "grid" mode From f7c4e7e19f25d128acc302cef79d9f93a8bce16e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Apr 2015 15:38:29 -0700 Subject: [PATCH 247/302] Fix G29 not deploying in some instances --- Marlin/Marlin_main.cpp | 4 ++-- Marlin/language_ru.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 015394ca7..543998273 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2140,7 +2140,7 @@ inline void gcode_G28() { * * Global Parameters: * - * E/e By default G29 will engages the probe, test the bed, then disengage. + * E/e By default G29 will engage the probe, test the bed, then disengage. * Include "E" to engage/disengage the probe for each sample. * There's no extra effect if you have a fixed probe. * Usage: "G29 E" or "G29 e" @@ -2318,7 +2318,7 @@ inline void gcode_G28() { ProbeAction act; if (deploy_probe_for_each_reading) // G29 E - Stow between probes act = ProbeDeployAndStow; - else if (yCount == 0 && xCount == 0) + else if (yCount == 0 && xCount == xStart) act = ProbeDeploy; else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc) act = ProbeStow; diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 4ab618e1e..61a3312ff 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -1,4 +1,4 @@ -/** +/** * Russian * * LCD Menu Messages From 1d291be2baa73e4e3b29bcb748a5c9c9b2316d4a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Apr 2015 20:01:08 -0700 Subject: [PATCH 248/302] Fix de after PREVENT_DANGEROUS_EXTRUDE - Set `de` to 0 when `position[E] = target[E]` - Address regression mention in #1846 --- Marlin/planner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index dcfbe674c..a0474f94a 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -511,12 +511,14 @@ float junction_deviation = 0.1; if (de) { if (degHotend(active_extruder) < extrude_min_temp) { position[E_AXIS] = target[E_AXIS]; //behave as if the move really took place, but ignore E part + de = 0; // no difference SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); } #ifdef PREVENT_LENGTHY_EXTRUDE if (labs(de) > axis_steps_per_unit[E_AXIS] * EXTRUDE_MAXLENGTH) { position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part + de = 0; // no difference SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); } From ff429cdd8a320d7fbb14d7d52f31948084159ab9 Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 7 Apr 2015 23:03:46 -0500 Subject: [PATCH 249/302] Fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2ff347d6..7cb93c7e2 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ We are actively looking for testers. So please try the current development versi ## Contact -__Google Hangout:__ Hagnout +__Google Hangout:__ Hangout ## Credits From cf9b58452c90a0bf78628ef9ad92928a1ef2a2b8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Apr 2015 20:20:30 -0700 Subject: [PATCH 250/302] Minimum delay in menu click feedback Squished #1849 --- Marlin/ultralcd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d65768235..348a9459d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1159,7 +1159,9 @@ static void lcd_quick_feedback() { delayMicroseconds(delay); WRITE(BEEPER,LOW); delayMicroseconds(delay); - } + } + const int j = max(10000 - LCD_FEEDBACK_FREQUENCY_DURATION_MS * 1000, 0); + if (j) delayMicroseconds(j); #endif } From eb6e3886f458c116bd1be364d29f30a2e003d8b0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Apr 2015 20:38:43 -0700 Subject: [PATCH 251/302] Set version to "1.0.3 dev" --- Marlin/Configuration.h | 2 +- Marlin/configurator/config/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration_DUAL.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 33a419b6b..35062d1af 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -40,7 +40,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 52d0d4b85..0b20b6570 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -40,7 +40,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 777848852..d64c6e4e9 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 0e9970941..a689fdef6 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index bc644f8c6..3a7dd2a9f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(bq Hephestos)" // Who made the changes. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 9d741d430..48e7d72f5 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(K8200, CONSULitAS)" // Who made the changes. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 8bdb407dd..00f7c662b 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -56,7 +56,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d308fbd02..0e1eb8716 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 8bb4b3a8f..f2622d326 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index d594cde72..2ac8e6f57 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6c4bdc232..7e64a931c 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 81f4dab5d..d3dcf11e3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_VERSION "1.0.2" +#define STRING_VERSION "1.0.3 dev" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. From 43773ff735efa6e83b5d0a437de032210b4b5761 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Apr 2015 21:11:03 -0700 Subject: [PATCH 252/302] Formatting and lcd contrast masking --- Marlin/dogm_lcd_implementation.h | 29 ++++++------ Marlin/ultralcd.cpp | 80 ++++++++++++++++---------------- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index f940a8975..627bbc8c5 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -198,16 +198,16 @@ static void lcd_implementation_init() u8g.setContrast(lcd_contrast); // FIXME: remove this workaround // Uncomment this if you have the first generation (V1.10) of STBs board - // pinMode(17, OUTPUT); // Enable LCD backlight - // digitalWrite(17, HIGH); - -#ifdef LCD_SCREEN_ROT_90 - u8g.setRot90(); // Rotate screen by 90° -#elif defined(LCD_SCREEN_ROT_180) - u8g.setRot180(); // Rotate screen by 180° -#elif defined(LCD_SCREEN_ROT_270) - u8g.setRot270(); // Rotate screen by 270° -#endif + // pinMode(17, OUTPUT); // Enable LCD backlight + // digitalWrite(17, HIGH); + + #ifdef LCD_SCREEN_ROT_90 + u8g.setRot90(); // Rotate screen by 90° + #elif defined(LCD_SCREEN_ROT_180) + u8g.setRot180(); // Rotate screen by 180° + #elif defined(LCD_SCREEN_ROT_270) + u8g.setRot270(); // Rotate screen by 270° + #endif // Show splashscreen int offx = (u8g.getWidth() - START_BMPWIDTH) / 2; @@ -220,7 +220,7 @@ static void lcd_implementation_init() int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1)*DOG_CHAR_WIDTH) / 2; u8g.firstPage(); - do { + do { if (show_splashscreen) { u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); lcd_setFont(FONT_MENU); @@ -232,7 +232,7 @@ static void lcd_implementation_init() u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); #endif } - } while (u8g.nextPage()); + } while (u8g.nextPage()); show_splashscreen = false; } @@ -295,20 +295,19 @@ static void lcd_implementation_status_screen() { lcd_printPGM(PSTR("--:--")); } #endif - + // Extruders for (int i=0; i 63) lcd_contrast = 63; - encoderPosition = 0; - lcdDrawUpdate = 1; - u8g.setContrast(lcd_contrast); + static void lcd_set_contrast() { + if (encoderPosition != 0) { + lcd_contrast -= encoderPosition; + lcd_contrast &= 0x3F; + encoderPosition = 0; + lcdDrawUpdate = 1; + u8g.setContrast(lcd_contrast); + } + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); + if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); } - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); - if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); -} -#endif //DOGLCD +#endif // DOGLCD #ifdef FWRETRACT -static void lcd_control_retract_menu() { - START_MENU(); - MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); - MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled); - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999); - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999); - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); - END_MENU(); -} + static void lcd_control_retract_menu() { + START_MENU(); + MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); + MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100); + #endif + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100); + #endif + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); + END_MENU(); + } -#endif //FWRETRACT +#endif // FWRETRACT #if SDCARDDETECT == -1 + static void lcd_sd_refresh() { card.initsd(); currentMenuViewOffset = 0; } + #endif static void lcd_sd_updir() { @@ -1029,13 +1030,14 @@ void lcd_sdcard_menu() { MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); } - for(uint16_t i = 0; i < fileCnt; i++) { + for (uint16_t i = 0; i < fileCnt; i++) { if (_menuItemNr == _lineNr) { - #ifndef SDCARD_RATHERRECENTFIRST - card.getfilename(i); - #else - card.getfilename(fileCnt-1-i); - #endif + card.getfilename( + #ifdef SDCARD_RATHERRECENTFIRST + fileCnt-1 - + #endif + i + ); if (card.filenameIsDir) MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); else @@ -1456,7 +1458,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #ifdef DOGLCD void lcd_setcontrast(uint8_t value) { - lcd_contrast = value & 63; + lcd_contrast = value & 0x3F; u8g.setContrast(lcd_contrast); } #endif From 756bb5e268208af6ac7b7bd8a1ca818f55850649 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Apr 2015 22:04:10 -0700 Subject: [PATCH 253/302] Cleanup formatting in hitachi & dogm lcd --- Marlin/dogm_lcd_implementation.h | 28 +-- .../ultralcd_implementation_hitachi_HD44780.h | 226 ++++++++++-------- 2 files changed, 134 insertions(+), 120 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 627bbc8c5..2a6d229b7 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -37,8 +37,8 @@ // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana -#if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) -// #define USE_BIG_EDIT_FONT +#if defined(MAPPER_C2C3) || defined(MAPPER_NON) + //#define USE_BIG_EDIT_FONT #endif // If you have spare 2300Byte of progmem and want to use a @@ -126,17 +126,17 @@ // LCD selection #ifdef U8GLIB_ST7920 -//U8GLIB_ST7920_128X64_RRD u8g(0,0,0); -U8GLIB_ST7920_128X64_RRD u8g(0); + //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); + U8GLIB_ST7920_128X64_RRD u8g(0); #elif defined(MAKRPANEL) -// The MaKrPanel display, ST7565 controller as well -U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); + // The MaKrPanel display, ST7565 controller as well + U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); #elif defined(VIKI2) || defined(miniVIKI) -// Mini Viki and Viki 2.0 LCD, ST7565 controller as well -U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); + // Mini Viki and Viki 2.0 LCD, ST7565 controller as well + U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); #else -// for regular DOGM128 display with HW-SPI -U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 + // for regular DOGM128 display with HW-SPI + U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 #endif #include "utf_mapper.h" @@ -188,8 +188,8 @@ char lcd_printPGM(const char* str) { static bool show_splashscreen = true; -static void lcd_implementation_init() -{ +static void lcd_implementation_init() { + #ifdef LCD_PIN_BL // Enable LCD backlight pinMode(LCD_PIN_BL, OUTPUT); digitalWrite(LCD_PIN_BL, HIGH); @@ -359,9 +359,9 @@ static void lcd_implementation_status_screen() { // Status line lcd_setFont(FONT_STATUSMENU); #ifdef USE_SMALL_INFOFONT - u8g.setPrintPos(0,62); + u8g.setPrintPos(0,62); #else - u8g.setPrintPos(0,63); + u8g.setPrintPos(0,63); #endif #ifndef FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 4819e3e00..5698fd94b 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -443,7 +443,7 @@ Possible status screens: 20x4 |01234567890123456789| |T000/000D B000/000D | - |X+000.0 Y+000.0 Z+000.0| + |X000 Y000 Z000.00| |F100% SD100% T--:--| |Status line.........| @@ -453,141 +453,154 @@ Possible status screens: |F100% SD100% T--:--| |Status line.........| */ -static void lcd_implementation_status_screen() -{ - int tHotend=int(degHotend(0) + 0.5); - int tTarget=int(degTargetHotend(0) + 0.5); +static void lcd_implementation_status_screen() { + int tHotend = int(degHotend(0) + 0.5); + int tTarget = int(degTargetHotend(0) + 0.5); + + #if LCD_WIDTH < 20 -#if LCD_WIDTH < 20 lcd.setCursor(0, 0); lcd.print(itostr3(tHotend)); lcd.print('/'); lcd.print(itostr3left(tTarget)); -# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 - //If we have an 2nd extruder or heated bed, show that in the top right corner - lcd.setCursor(8, 0); -# if EXTRUDERS > 1 - tHotend = int(degHotend(1) + 0.5); - tTarget = int(degTargetHotend(1) + 0.5); - lcd.print(LCD_STR_THERMOMETER[0]); -# else//Heated bed - tHotend=int(degBed() + 0.5); - tTarget=int(degTargetBed() + 0.5); - lcd.print(LCD_STR_BEDTEMP[0]); -# endif - lcd.print(itostr3(tHotend)); - lcd.print('/'); - lcd.print(itostr3left(tTarget)); -# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + + // If we have an 2nd extruder or heated bed, show that in the top right corner + lcd.setCursor(8, 0); + #if EXTRUDERS > 1 + tHotend = int(degHotend(1) + 0.5); + tTarget = int(degTargetHotend(1) + 0.5); + lcd.print(LCD_STR_THERMOMETER[0]); + #else // Heated bed + tHotend = int(degBed() + 0.5); + tTarget = int(degTargetBed() + 0.5); + lcd.print(LCD_STR_BEDTEMP[0]); + #endif + lcd.print(itostr3(tHotend)); + lcd.print('/'); + lcd.print(itostr3left(tTarget)); + + #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + + #else // LCD_WIDTH > 19 -#else//LCD_WIDTH > 19 lcd.setCursor(0, 0); lcd.print(LCD_STR_THERMOMETER[0]); lcd.print(itostr3(tHotend)); lcd.print('/'); lcd.print(itostr3left(tTarget)); lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); - if (tTarget < 10) - lcd.print(' '); + if (tTarget < 10) lcd.print(' '); -# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 - //If we have an 2nd extruder or heated bed, show that in the top right corner - lcd.setCursor(10, 0); -# if EXTRUDERS > 1 - tHotend = int(degHotend(1) + 0.5); - tTarget = int(degTargetHotend(1) + 0.5); - lcd.print(LCD_STR_THERMOMETER[0]); -# else//Heated bed - tHotend=int(degBed() + 0.5); - tTarget=int(degTargetBed() + 0.5); - lcd.print(LCD_STR_BEDTEMP[0]); -# endif - lcd.print(itostr3(tHotend)); - lcd.print('/'); - lcd.print(itostr3left(tTarget)); - lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); - if (tTarget < 10) - lcd.print(' '); -# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 -#endif//LCD_WIDTH > 19 + #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + // If we have an 2nd extruder or heated bed, show that in the top right corner + lcd.setCursor(10, 0); + #if EXTRUDERS > 1 + tHotend = int(degHotend(1) + 0.5); + tTarget = int(degTargetHotend(1) + 0.5); + lcd.print(LCD_STR_THERMOMETER[0]); + #else // Heated bed + tHotend = int(degBed() + 0.5); + tTarget = int(degTargetBed() + 0.5); + lcd.print(LCD_STR_BEDTEMP[0]); + #endif + lcd.print(itostr3(tHotend)); + lcd.print('/'); + lcd.print(itostr3left(tTarget)); + lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); + if (tTarget < 10) lcd.print(' '); -#if LCD_HEIGHT > 2 -//Lines 2 for 4 line LCD -# if LCD_WIDTH < 20 -# ifdef SDSUPPORT - lcd.setCursor(0, 2); - lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING) - lcd.print(itostr3(card.percentDone())); - else - lcd_printPGM(PSTR("---")); - lcd.print('%'); -# endif//SDSUPPORT -# else//LCD_WIDTH > 19 -# if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0 - //If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps - tHotend=int(degBed() + 0.5); - tTarget=int(degTargetBed() + 0.5); + #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + + #endif // LCD_WIDTH > 19 + + #if LCD_HEIGHT > 2 + // Lines 2 for 4 line LCD + #if LCD_WIDTH < 20 + #ifdef SDSUPPORT + lcd.setCursor(0, 2); + lcd_printPGM(PSTR("SD")); + if (IS_SD_PRINTING) + lcd.print(itostr3(card.percentDone())); + else + lcd_printPGM(PSTR("---")); + lcd.print('%'); + #endif // SDSUPPORT + + #else // LCD_WIDTH > 19 + + #if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0 + // If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps + tHotend = int(degBed() + 0.5); + tTarget = int(degTargetBed() + 0.5); + + lcd.setCursor(0, 1); + lcd.print(LCD_STR_BEDTEMP[0]); + lcd.print(itostr3(tHotend)); + lcd.print('/'); + lcd.print(itostr3left(tTarget)); + lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); + if (tTarget < 10) lcd.print(' '); + #else + lcd.setCursor(0,1); + lcd.print('X'); + lcd.print(ftostr3(current_position[X_AXIS])); + lcd_printPGM(PSTR(" Y")); + lcd.print(ftostr3(current_position[Y_AXIS])); + #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + + #endif // LCD_WIDTH > 19 - lcd.setCursor(0, 1); - lcd.print(LCD_STR_BEDTEMP[0]); - lcd.print(itostr3(tHotend)); - lcd.print('/'); - lcd.print(itostr3left(tTarget)); - lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); - if (tTarget < 10) - lcd.print(' '); -# else - lcd.setCursor(0,1); - lcd.print('X'); - lcd.print(ftostr3(current_position[X_AXIS])); - lcd_printPGM(PSTR(" Y")); - lcd.print(ftostr3(current_position[Y_AXIS])); -# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 -# endif//LCD_WIDTH > 19 lcd.setCursor(LCD_WIDTH - 8, 1); lcd.print('Z'); lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); -#endif//LCD_HEIGHT > 2 -#if LCD_HEIGHT > 3 + #endif // LCD_HEIGHT > 2 + + #if LCD_HEIGHT > 3 + lcd.setCursor(0, 2); lcd.print(LCD_STR_FEEDRATE[0]); lcd.print(itostr3(feedmultiply)); lcd.print('%'); -# if LCD_WIDTH > 19 -# ifdef SDSUPPORT - lcd.setCursor(7, 2); - lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING) + + #if LCD_WIDTH > 19 && defined(SDSUPPORT) + + lcd.setCursor(7, 2); + lcd_printPGM(PSTR("SD")); + if (IS_SD_PRINTING) lcd.print(itostr3(card.percentDone())); - else + else lcd_printPGM(PSTR("---")); - lcd.print('%'); -# endif//SDSUPPORT -# endif//LCD_WIDTH > 19 + lcd.print('%'); + + #endif // LCD_WIDTH > 19 && SDSUPPORT + lcd.setCursor(LCD_WIDTH - 6, 2); lcd.print(LCD_STR_CLOCK[0]); - if(starttime != 0) - { - uint16_t time = millis()/60000 - starttime/60000; - lcd.print(itostr2(time/60)); - lcd.print(':'); - lcd.print(itostr2(time%60)); - }else{ - lcd_printPGM(PSTR("--:--")); + if (starttime != 0) { + uint16_t time = millis()/60000 - starttime/60000; + lcd.print(itostr2(time/60)); + lcd.print(':'); + lcd.print(itostr2(time%60)); + } + else { + lcd_printPGM(PSTR("--:--")); } -#endif - // Status message line at the bottom + #endif // LCD_HEIGHT > 3 + + /** + * Display Progress Bar, Filament display, and/or Status Message on the last line + */ + lcd.setCursor(0, LCD_HEIGHT - 1); #ifdef LCD_PROGRESS_BAR if (card.isFileOpen()) { - uint16_t mil = millis(), diff = mil - progressBarTick; - if (diff >= PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) { + if (millis() >= progressBarTick + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) { // draw the progress bar int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100, cel = tix / 3, rem = tix % 3, i = LCD_WIDTH; @@ -605,11 +618,11 @@ static void lcd_implementation_status_screen() } } //card.isFileOpen - #endif //LCD_PROGRESS_BAR + #elif defined(FILAMENT_LCD_DISPLAY) - //Display both Status message line and Filament display on the last line - #ifdef FILAMENT_LCD_DISPLAY - if (message_millis + 5000 <= millis()) { //display any status for the first 5 sec after screen is initiated + // Show Filament Diameter and Volumetric Multiplier % + // After allowing lcd_status_message to show for 5 seconds + if (millis() >= message_millis + 5000) { lcd_printPGM(PSTR("Dia ")); lcd.print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" V")); @@ -617,7 +630,8 @@ static void lcd_implementation_status_screen() lcd.print('%'); return; } - #endif //FILAMENT_LCD_DISPLAY + + #endif // FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); } From 07fc2b5b70f133639321fd7c55e453b36a74d791 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 8 Apr 2015 13:18:45 +0600 Subject: [PATCH 254/302] Update language_ru.h --- Marlin/language_ru.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 61a3312ff..62cc57e39 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -45,6 +45,7 @@ #define MSG_MOVE_01MM "Move 0.1mm" #define MSG_MOVE_1MM "Move 1mm" #define MSG_MOVE_10MM "Move 10mm" +#define MSG_LEVEL_BED "Настр. уровня кровати" #define MSG_SPEED "Скорость" #define MSG_NOZZLE LCD_STR_THERMOMETER " Фильера" #define MSG_BED LCD_STR_THERMOMETER " Кровать" From 27cb90da8b2bd2438acad417af5a2663b746a435 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Apr 2015 00:56:19 -0700 Subject: [PATCH 255/302] IsStopped / IsRunning inline --- Marlin/Marlin.h | 4 +++- Marlin/Marlin_main.cpp | 46 +++++++++++++++++++++++------------------- Marlin/temperature.cpp | 2 +- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 36e054eec..9cec9dd37 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -219,7 +219,9 @@ void Stop(); void filrunout(); #endif -bool IsStopped(); +extern bool Running; +inline bool IsRunning() { return Running; } +inline bool IsStopped() { return !Running; } bool enquecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full void enquecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 132c353eb..5055d0817 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -202,6 +202,16 @@ CardReader card; #endif +bool Running = true; + +static float feedrate = 1500.0, next_feedrate, saved_feedrate; +static float current_position[NUM_AXIS] = { 0.0 }; +static float destination[NUM_AXIS] = { 0.0 }; +bool axis_known_position[3] = { false }; + +static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; +static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; + float homing_feedrate[] = HOMING_FEEDRATE; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 @@ -210,23 +220,20 @@ int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS(1.0, 1.0, 1.0, 1.0); -float current_position[NUM_AXIS] = { 0.0 }; float home_offset[3] = { 0 }; float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; -bool axis_known_position[3] = { false }; + uint8_t active_extruder = 0; int fanSpeed = 0; bool cancel_heatup = false; + const char errormagic[] PROGMEM = "Error:"; const char echomagic[] PROGMEM = "echo:"; const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; -static float destination[NUM_AXIS] = { 0 }; + static float offset[3] = { 0 }; -static float feedrate = 1500.0, next_feedrate, saved_feedrate; -static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; static bool relative_mode = false; //Determines Absolute or Relative Coordinates -static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; static int bufindr = 0; static int bufindw = 0; static int buflen = 0; @@ -243,7 +250,6 @@ static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l unsigned long starttime = 0; ///< Print job start time unsigned long stoptime = 0; ///< Print job stop time static uint8_t target_extruder; -bool Stopped = false; bool CooldownNoWait = true; bool target_direction; @@ -743,7 +749,7 @@ void get_command() case 1: case 2: case 3: - if (Stopped == true) { + if (IsStopped()) { SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); LCD_MESSAGEPGM(MSG_STOPPED); } @@ -1240,7 +1246,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, if (z_min_endstop) #endif { - if (!Stopped) { + if (IsRunning()) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); @@ -1315,7 +1321,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, if (!z_min_endstop) #endif { - if (!Stopped) { + if (IsRunning()) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); @@ -1650,7 +1656,7 @@ static void homeaxis(AxisEnum axis) { * G0, G1: Coordinated movement of X Y Z E axes */ inline void gcode_G0_G1() { - if (!Stopped) { + if (IsRunning()) { get_coordinates(); // For X Y Z E F #ifdef FWRETRACT if (autoretract_enabled) @@ -1675,7 +1681,7 @@ inline void gcode_G0_G1() { * G3: Counterclockwise Arc */ inline void gcode_G2_G3(bool clockwise) { - if (!Stopped) { + if (IsRunning()) { get_arc_coordinates(); prepare_arc_move(clockwise); } @@ -4119,7 +4125,7 @@ inline void gcode_M303() { bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) { //SoftEndsEnabled = false; // Ignore soft endstops during calibration //SERIAL_ECHOLN(" Soft endstops disabled "); - if (! Stopped) { + if (IsRunning()) { //get_coordinates(); // For X Y Z E F delta[X_AXIS] = delta_x; delta[Y_AXIS] = delta_y; @@ -4617,7 +4623,7 @@ inline void gcode_M907() { * M999: Restart after being stopped */ inline void gcode_M999() { - Stopped = false; + Running = true; lcd_reset_alert_level(); gcode_LastN = Stopped_gcode_LastN; FlushSerialRequestResend(); @@ -4652,7 +4658,7 @@ inline void gcode_T() { // Save current position to return to after applying extruder offset set_destination_to_current(); #ifdef DUAL_X_CARRIAGE - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false && + if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() && (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder))) { // Park old head: 1) raise 2) move to park position 3) lower plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, @@ -4710,7 +4716,7 @@ inline void gcode_T() { sync_plan_position(); #endif // Move to the old position if 'F' was in the parameters - if (make_move && !Stopped) prepare_move(); + if (make_move && IsRunning()) prepare_move(); } #ifdef EXT_SOLENOID @@ -5877,7 +5883,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #ifdef DUAL_X_CARRIAGE // handle delayed move timeout - if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) { + if (delayed_move_time && ms > delayed_move_time + 1000 && IsRunning()) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done set_destination_to_current(); @@ -5928,8 +5934,8 @@ void kill() void Stop() { disable_heater(); - if(Stopped == false) { - Stopped = true; + if (IsRunning()) { + Running = false; Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); @@ -5937,8 +5943,6 @@ void Stop() } } -bool IsStopped() { return Stopped; }; - #ifdef FAST_PWM_FAN void setPwmFrequency(uint8_t pin, int val) { diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index aa524ac56..b4dffbfe1 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -443,7 +443,7 @@ void checkExtruderAutoFans() // Temperature Error Handlers // inline void _temp_error(int e, const char *msg1, const char *msg2) { - if (!IsStopped()) { + if (IsRunning()) { SERIAL_ERROR_START; if (e >= 0) SERIAL_ERRORLN((int)e); serialprintPGM(msg1); From 3162971cd606e4d58c4d0760aebc06433b857266 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Apr 2015 01:05:39 -0700 Subject: [PATCH 256/302] current_position not static --- Marlin/Marlin_main.cpp | 2 +- Marlin/planner.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5055d0817..8bf090988 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -205,7 +205,7 @@ bool Running = true; static float feedrate = 1500.0, next_feedrate, saved_feedrate; -static float current_position[NUM_AXIS] = { 0.0 }; +float current_position[NUM_AXIS] = { 0.0 }; static float destination[NUM_AXIS] = { 0.0 }; bool axis_known_position[3] = { false }; diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index a0474f94a..76ec03788 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -87,7 +87,7 @@ unsigned long axis_steps_per_sqr_second[NUM_AXIS]; 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }; -#endif // #ifdef ENABLE_AUTO_BED_LEVELING +#endif // ENABLE_AUTO_BED_LEVELING // The current position of the tool in absolute steps long position[NUM_AXIS]; //rescaled from extern when axis_steps_per_unit are changed by gcode @@ -472,7 +472,7 @@ float junction_deviation = 0.1; void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder) #else void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder) -#endif //ENABLE_AUTO_BED_LEVELING +#endif // ENABLE_AUTO_BED_LEVELING { // Calculate the buffer head after we push this byte int next_buffer_head = next_block_index(block_buffer_head); @@ -487,9 +487,7 @@ float junction_deviation = 0.1; #ifdef MESH_BED_LEVELING if (mbl.active) z += mbl.get_z(x, y); - #endif - - #ifdef ENABLE_AUTO_BED_LEVELING + #elif defined(ENABLE_AUTO_BED_LEVELING) apply_rotation_xyz(plan_bed_level_matrix, x, y, z); #endif @@ -979,10 +977,10 @@ float junction_deviation = 0.1; void plan_set_position(const float &x, const float &y, const float &z, const float &e) #endif // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING { - #ifdef ENABLE_AUTO_BED_LEVELING - apply_rotation_xyz(plan_bed_level_matrix, x, y, z); - #elif defined(MESH_BED_LEVELING) + #ifdef MESH_BED_LEVELING if (mbl.active) z += mbl.get_z(x, y); + #elif defined(ENABLE_AUTO_BED_LEVELING) + apply_rotation_xyz(plan_bed_level_matrix, x, y, z); #endif float nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]); From 4788b5930045b5a550f0bbbb580616ba215a594a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Apr 2015 03:12:21 -0700 Subject: [PATCH 257/302] Thermistor values for configurator --- Marlin/Configuration.h | 2 +- Marlin/configurator/config/Configuration.h | 2 +- Marlin/configurator/js/configurator.js | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration_DUAL.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 71815cde2..b0d97f15e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -138,7 +138,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index babbe3fae..3fad14527 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -138,7 +138,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js index 254e016d3..1a0da92ab 100644 --- a/Marlin/configurator/js/configurator.js +++ b/Marlin/configurator/js/configurator.js @@ -1279,7 +1279,7 @@ window.configuratorApp = (function(){ find = new RegExp('^[ \\t]*//+[ \\t]*(.*)[ \\t]*$', 'gm'); while((s = find.exec(r[1])) !== null) temp.unshift(s[1]); - console.log(name+":\n"+temp.join('\n')); + this.log(name+":\n"+temp.join('\n'), 2); // Go through the reversed lines and add comment lines on $.each(temp, function(i,v) { diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 3eec43fea..c30547a52 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index a689fdef6..fe544ad16 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 2cfe667fb..812bfe1fc 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 8b837b7fa..b3346bdda 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index e1a056610..ca9a756eb 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -140,7 +140,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 8bd58bd6c..9ec5f506d 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3c2202e59..544492a0b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -155,7 +155,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 45cd75b77..9b292ebde 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -155,7 +155,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 7e4d45f18..5596faef3 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 9afcefafc..618243ff3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -122,7 +122,7 @@ Here are some standard links for getting your machine calibrated: // Use it for Testing or Development purposes. NEVER for production machine. // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 - +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 From bcc04192fc046b766512cde5e5ec11958205ebc2 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 12:56:38 +0200 Subject: [PATCH 258/302] Remove Contrast Menu for U8GLIB_ST7920 The other two devices we use in u8glib have more than only dummy code. Checked this in the library code. --- Marlin/Conditionals.h | 8 +++++++- Marlin/ultralcd.cpp | 16 +++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5d3213e0e..c7d2e793f 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -130,7 +130,6 @@ #define NEWPANEL #endif - #ifdef ULTIPANEL #define NEWPANEL //enable this if you have a click-encoder panel #define SDSUPPORT @@ -161,6 +160,13 @@ #define DEFAULT_LCD_CONTRAST 32 #endif + #ifdef DOGLCD + #define HAS_LCD_CONTRAST + #ifdef U8GLIB_ST7920 + #undefine HAS_LCD_CONTRAST + #endif + #endif + #else // CONFIGURATION_LCD #define CONDITIONALS_H diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index caaf55ab7..9e90d564b 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -58,7 +58,7 @@ static void lcd_status_screen(); static void lcd_control_temperature_preheat_abs_settings_menu(); static void lcd_control_motion_menu(); static void lcd_control_volumetric_menu(); - #ifdef DOGLCD + #ifdef HAS_LCD_CONTRAST static void lcd_set_contrast(); #endif #ifdef FWRETRACT @@ -739,7 +739,7 @@ static void lcd_control_menu() { MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); - #ifdef DOGLCD + #ifdef HAS_LCD_CONTRAST //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); #endif @@ -963,8 +963,7 @@ static void lcd_control_volumetric_menu() { END_MENU(); } -#ifdef DOGLCD - +#ifdef HAS_LCD_CONTRAST static void lcd_set_contrast() { if (encoderPosition != 0) { lcd_contrast -= encoderPosition; @@ -976,11 +975,9 @@ static void lcd_control_volumetric_menu() { if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); } - -#endif // DOGLCD +#endif // HAS_LCD_CONTRAST #ifdef FWRETRACT - static void lcd_control_retract_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -998,16 +995,13 @@ static void lcd_control_volumetric_menu() { MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); END_MENU(); } - #endif // FWRETRACT #if SDCARDDETECT == -1 - static void lcd_sd_refresh() { card.initsd(); currentMenuViewOffset = 0; } - #endif static void lcd_sd_updir() { @@ -1458,7 +1452,7 @@ void lcd_setalertstatuspgm(const char* message) { void lcd_reset_alert_level() { lcd_status_message_level = 0; } -#ifdef DOGLCD +#ifdef HAS_LCD_CONTRAST void lcd_setcontrast(uint8_t value) { lcd_contrast = value & 0x3F; u8g.setContrast(lcd_contrast); From 6a514f3dc96021b3057355dd20ee81abec02e291 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 13:26:29 +0200 Subject: [PATCH 259/302] Aplied HAS_LCD_CONTRAST also to Marlin_main.cpp and cleaned typo. --- Marlin/Conditionals.h | 2 +- Marlin/Marlin_main.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c7d2e793f..c0095ca8d 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -163,7 +163,7 @@ #ifdef DOGLCD #define HAS_LCD_CONTRAST #ifdef U8GLIB_ST7920 - #undefine HAS_LCD_CONTRAST + #undef HAS_LCD_CONTRAST #endif #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8bf090988..a9fb673ed 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4083,7 +4083,7 @@ inline void gcode_M226() { #endif // CHDK || PHOTOGRAPH_PIN -#ifdef DOGLCD +#ifdef HAS_LCD_CONTRAST /** * M250: Read and optionally set the LCD contrast @@ -4095,7 +4095,7 @@ inline void gcode_M226() { SERIAL_EOL; } -#endif // DOGLCD +#endif // HAS_LCD_CONTRAST #ifdef PREVENT_DANGEROUS_EXTRUDE @@ -5081,11 +5081,11 @@ void process_commands() { break; #endif // CHDK || PHOTOGRAPH_PIN - #ifdef DOGLCD + #ifdef HAS_LCD_CONTRAST case 250: // M250 Set LCD contrast value: C (value 0..63) gcode_M250(); break; - #endif // DOGLCD + #endif // HAS_LCD_CONTRAST #ifdef PREVENT_DANGEROUS_EXTRUDE case 302: // allow cold extrudes, or set the minimum extrude temperature From 7dc64efe672a1417b2aa49a72a27448e09f06d05 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 8 Apr 2015 20:52:48 +0200 Subject: [PATCH 260/302] Added sanity check for MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS --- Marlin/Configuration.h | 2 +- Marlin/SanityCheck.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b0d97f15e..b99d4f426 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -420,7 +420,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. //=========================================================================== -//============================ Manual Bed Leveling ========================== +//============================ Mesh Bed Leveling ============================ //=========================================================================== // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index d1be7703d..7aeaa81a6 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -101,6 +101,9 @@ #ifdef ENABLE_AUTO_BED_LEVELING #error Select ENABLE_AUTO_BED_LEVELING or MESH_BED_LEVELING, not both #endif + #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7 + #error MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8 + #endif #endif /** From ea897654a466d24d0511c331e6c1e6b12df1014f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 21:53:58 +0200 Subject: [PATCH 261/302] Moved the definitions of the LCD_STR_* to Conditionals.h to avoid errors in Marlin_main.cpp. #1860 In the include tree of Marlin_main.cpp the decision between the display types is not made. To include the right LCD_STR_* ether 'dogm_lcd_implementation.h' or 'ultralcd_implementation_hitachi_HD44780.h' with all their code. A 'dogm_lcd_implementation.h.h' would be a curiosity. So i moved both of the definition blocks to conditionals.h On the long term it could make sense to use the same numbering for the u8glib and the hitachi symbols. --- Marlin/Conditionals.h | 43 ++++++++++++++++--- Marlin/dogm_lcd_implementation.h | 16 ------- .../ultralcd_implementation_hitachi_HD44780.h | 12 ------ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5d3213e0e..5b1024236 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -144,16 +144,45 @@ #endif #else //no panel but just LCD #ifdef ULTRA_LCD - #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display - #define LCD_WIDTH 22 - #define LCD_HEIGHT 5 - #else - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - #endif + #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display + #define LCD_WIDTH 22 + #define LCD_HEIGHT 5 + #else + #define LCD_WIDTH 16 + #define LCD_HEIGHT 2 + #endif #endif #endif + #ifdef DOGLCD + /* Custom characters defined in font font_6x10_marlin_symbols */ + // \x00 intentionally skipped to avoid problems in strings + #define LCD_STR_REFRESH "\x01" + #define LCD_STR_FOLDER "\x02" + #define LCD_STR_ARROW_RIGHT "\x03" + #define LCD_STR_UPLEVEL "\x04" + #define LCD_STR_CLOCK "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_BEDTEMP "\x07" + #define LCD_STR_THERMOMETER "\x08" + #define LCD_STR_DEGREE "\x09" + + #define LCD_STR_SPECIAL_MAX '\x09' + // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. + // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. + #else + /* Custom characters defined in the first 8 characters of the LCD */ + #define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string! + #define LCD_STR_DEGREE "\x01" + #define LCD_STR_THERMOMETER "\x02" + #define LCD_STR_UPLEVEL "\x03" + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_CLOCK "\x07" + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ + #endif + /** * Default LCD contrast for dogm-like LCD displays */ diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 2a6d229b7..fd52d645e 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -108,22 +108,6 @@ #define START_ROW 0 -/* Custom characters defined in font font_6x10_marlin_symbols */ -// \x00 intentionally skipped to avoid problems in strings -#define LCD_STR_REFRESH "\x01" -#define LCD_STR_FOLDER "\x02" -#define LCD_STR_ARROW_RIGHT "\x03" -#define LCD_STR_UPLEVEL "\x04" -#define LCD_STR_CLOCK "\x05" -#define LCD_STR_FEEDRATE "\x06" -#define LCD_STR_BEDTEMP "\x07" -#define LCD_STR_THERMOMETER "\x08" -#define LCD_STR_DEGREE "\x09" - -#define LCD_STR_SPECIAL_MAX '\x09' -// Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. -// Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - // LCD selection #ifdef U8GLIB_ST7920 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 5698fd94b..aa348018e 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -201,18 +201,6 @@ #define LCD_STR_PROGRESS "\x03\x04\x05" #endif -/* Custom characters defined in the first 8 characters of the LCD */ -#define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string! -#define LCD_STR_DEGREE "\x01" -#define LCD_STR_THERMOMETER "\x02" -#define LCD_STR_UPLEVEL "\x03" -#define LCD_STR_REFRESH "\x04" -#define LCD_STR_FOLDER "\x05" -#define LCD_STR_FEEDRATE "\x06" -#define LCD_STR_CLOCK "\x07" -//#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set. Only available on DISPLAY_CHARSET_HD44780_JAPAN - at this place!*/ -#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ - static void lcd_set_custom_characters( #ifdef LCD_PROGRESS_BAR bool progress_bar_set=true From 14d4419e161b26cb70bd6d28101ca554f0f099fd Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 23:59:01 +0200 Subject: [PATCH 262/302] Replaced SERIAL_PROTOCOLPGM(MSG_BED) with SERIAL_PROTOCOLPGM("Bed") Resolved some warnings in Marlin_main.cpp regarding compares of signed and unsigned integers by replacing 'int' or 'uint16_t' with 'uint8_t'. --- Marlin/Marlin_main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8bf090988..b48cfd849 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2514,7 +2514,7 @@ inline void gcode_G28() { feedrate = homing_feedrate[Z_AXIS]; run_z_probe(); - SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM("Bed"); SERIAL_PROTOCOLPGM(" X: "); SERIAL_PROTOCOL(current_position[X_AXIS] + 0.0001); SERIAL_PROTOCOLPGM(" Y: "); @@ -2852,8 +2852,8 @@ inline void gcode_M42() { inline void gcode_M48() { double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50]; - int verbose_level = 1, n_samples = 10, n_legs = 0; - + uint8_t verbose_level = 1, n_samples = 10, n_legs = 0; + if (code_seen('V') || code_seen('v')) { verbose_level = code_value_short(); if (verbose_level < 0 || verbose_level > 4 ) { @@ -2960,7 +2960,7 @@ inline void gcode_M42() { if (deploy_probe_for_each_reading) stow_z_probe(); - for (uint16_t n=0; n < n_samples; n++) { + for (uint8_t n=0; n < n_samples; n++) { do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // Make sure we are at the probe location @@ -2975,7 +2975,7 @@ inline void gcode_M42() { //SERIAL_ECHOPAIR(" direction: ",dir); //SERIAL_EOL; - for (int l = 0; l < n_legs - 1; l++) { + for (uint8_t l = 0; l < n_legs - 1; l++) { ms = millis(); theta += RADIANS(dir * (ms % 20L)); radius += (ms % 10L) - 5L; @@ -3014,7 +3014,7 @@ inline void gcode_M42() { // Get the current mean for the data points we have so far // sum = 0.0; - for (int j = 0; j <= n; j++) sum += sample_set[j]; + for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; mean = sum / (n + 1); // @@ -3022,7 +3022,7 @@ inline void gcode_M42() { // data points we have so far // sum = 0.0; - for (int j = 0; j <= n; j++) { + for (uint8_t j = 0; j <= n; j++) { float ss = sample_set[j] - mean; sum += ss * ss; } From 540dbb35e2c51767120c2765ae821a7e30e207c9 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 9 Apr 2015 01:16:06 +0200 Subject: [PATCH 263/302] And an other MSG_BED in Marlin_main.cpp --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b48cfd849..b2e105809 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1365,7 +1365,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #endif if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(MSG_BED); + SERIAL_PROTOCOLPGM("Bed"); SERIAL_PROTOCOLPGM(" X: "); SERIAL_PROTOCOL_F(x, 3); SERIAL_PROTOCOLPGM(" Y: "); From 585eee6549a879fefee4cc1adb4cc200536f57bd Mon Sep 17 00:00:00 2001 From: Natealus Date: Wed, 8 Apr 2015 18:57:30 -0600 Subject: [PATCH 264/302] Z Probe inverting not present in example configs, causes error The line const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop is in the main configuration.h but wasn't present in the example configuration.h's. Causes a compiling error with Z Probe enabled. Just added it to all the configs. :) --- Marlin/example_configurations/Felix/Configuration.h | 3 ++- Marlin/example_configurations/Felix/Configuration_DUAL.h | 3 ++- Marlin/example_configurations/Hephestos/Configuration.h | 1 + Marlin/example_configurations/K8200/Configuration.h | 1 + Marlin/example_configurations/SCARA/Configuration.h | 1 + Marlin/example_configurations/WITBOX/Configuration.h | 1 + Marlin/example_configurations/delta/generic/Configuration.h | 3 ++- .../example_configurations/delta/kossel_mini/Configuration.h | 3 ++- Marlin/example_configurations/makibox/Configuration.h | 1 + Marlin/example_configurations/tvrrug/Round2/Configuration.h | 1 + 10 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index c30547a52..1efcad88c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -305,6 +305,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. #define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index fe544ad16..dd5c371c0 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -305,6 +305,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. #define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 812bfe1fc..2a331c9ec 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -328,6 +328,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index b3346bdda..5adab57f5 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -333,6 +333,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. #define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index ca9a756eb..c0032d4bb 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -357,6 +357,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 9ec5f506d..757c1628e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -327,6 +327,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 544492a0b..f1760f59e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -355,6 +355,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS #define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 9b292ebde..990c4e762 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -355,6 +355,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 5596faef3..1eea3186c 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -325,6 +325,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 618243ff3..8a3c3a854 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -327,6 +327,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS From 1269c445ab1473cfb33db4b6fa1b6b978f22cec5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 01:40:48 -0700 Subject: [PATCH 265/302] Catch dangerous extrude before trying several --- Marlin/Marlin.h | 4 ++ Marlin/Marlin_main.cpp | 84 ++++++++++++++++++++++++------------------ Marlin/planner.cpp | 9 +---- Marlin/planner.h | 6 +-- 4 files changed, 54 insertions(+), 49 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 9cec9dd37..40128de99 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -273,6 +273,10 @@ extern bool axis_known_position[3]; extern float zprobe_zoffset; #endif +#ifdef PREVENT_DANGEROUS_EXTRUDE + extern float extrude_min_temp; +#endif + extern int fanSpeed; #ifdef BARICUDA diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8bf090988..27aa58043 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -380,12 +380,13 @@ bool target_direction; void get_arc_coordinates(); bool setTargetedHotend(int code); -void serial_echopair_P(const char *s_P, float v) - { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_P(const char *s_P, double v) - { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_P(const char *s_P, unsigned long v) - { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_P(const char *s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_P(const char *s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_P(const char *s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } + +#ifdef PREVENT_DANGEROUS_EXTRUDE + float extrude_min_temp = EXTRUDE_MINTEMP; +#endif #ifdef SDSUPPORT #include "SdFatUtil.h" @@ -1009,8 +1010,11 @@ inline void line_to_current_position() { inline void line_to_z(float zPosition) { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); } +inline void line_to_destination(float mm_m) { + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m/60, active_extruder); +} inline void line_to_destination() { - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); + line_to_destination(feedrate); } inline void sync_plan_position() { plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); @@ -4099,6 +4103,8 @@ inline void gcode_M226() { #ifdef PREVENT_DANGEROUS_EXTRUDE + void set_extrude_min_temp(float temp) { extrude_min_temp = temp; } + /** * M302: Allow cold extrudes, or set the minimum extrude S. */ @@ -5444,15 +5450,31 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ void prepare_move() { clamp_to_software_endstops(destination); refresh_cmd_timeout(); - + + #ifdef PREVENT_DANGEROUS_EXTRUDE + float de = destination[E_AXIS] - current_position[E_AXIS]; + if (de) { + if (degHotend(active_extruder) < extrude_min_temp) { + current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); + } + #ifdef PREVENT_LENGTHY_EXTRUDE + if (labs(de) > EXTRUDE_MAXLENGTH) { + current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); + } + #endif + } + #endif + #ifdef SCARA //for now same as delta-code float difference[NUM_AXIS]; for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; - float cartesian_mm = sqrt( sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); + float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS])); if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } if (cartesian_mm < 0.000001) { return; } float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; @@ -5464,9 +5486,7 @@ void prepare_move() { for (int s = 1; s <= steps; s++) { float fraction = float(s) / float(steps); - for(int8_t i = 0; i < NUM_AXIS; i++) { - destination[i] = current_position[i] + difference[i] * fraction; - } + for (int8_t i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i] + difference[i] * fraction; calculate_delta(destination); //SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]); @@ -5476,9 +5496,7 @@ void prepare_move() { //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); } #endif // SCARA @@ -5488,9 +5506,7 @@ void prepare_move() { float difference[NUM_AXIS]; for (int8_t i=0; i < NUM_AXIS; i++) difference[i] = destination[i] - current_position[i]; - float cartesian_mm = sqrt(sq(difference[X_AXIS]) + - sq(difference[Y_AXIS]) + - sq(difference[Z_AXIS])); + float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS])); if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); if (cartesian_mm < 0.000001) return; float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; @@ -5507,9 +5523,7 @@ void prepare_move() { #ifdef ENABLE_AUTO_BED_LEVELING adjust_delta(destination); #endif - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], - destination[E_AXIS], feedrate*feedmultiply/60/100.0, - active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); } #endif // DELTA @@ -5519,8 +5533,8 @@ void prepare_move() { if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) { // move duplicate extruder into correct duplication position. plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], max_feedrate[X_AXIS], 1); + plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, + current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], max_feedrate[X_AXIS], 1); sync_plan_position(); st_synchronize(); extruder_duplication_enabled = true; @@ -5528,23 +5542,21 @@ void prepare_move() { } else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) { // handle unparking of head if (current_position[E_AXIS] == destination[E_AXIS]) { - // this is a travel move - skit it but keep track of current position (so that it can later - // be used as start of first non-travel move) + // This is a travel move (with no extrusion) + // Skip it, but keep track of the current position + // (so it can be used as the start of the next non-travel move) if (delayed_move_time != 0xFFFFFFFFUL) { set_current_to_destination(); - if (destination[Z_AXIS] > raised_parked_position[Z_AXIS]) - raised_parked_position[Z_AXIS] = destination[Z_AXIS]; + if (destination[Z_AXIS] > raised_parked_position[Z_AXIS]) raised_parked_position[Z_AXIS] = destination[Z_AXIS]; delayed_move_time = millis(); return; } } delayed_move_time = 0; // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], - current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); + plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], min(max_feedrate[X_AXIS], max_feedrate[Y_AXIS]), active_extruder); + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder); active_extruder_parked = false; } } @@ -5552,7 +5564,7 @@ void prepare_move() { #if !defined(DELTA) && !defined(SCARA) // Do not use feedmultiply for E or Z only moves - if ( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) { + if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) { line_to_destination(); } else { @@ -5560,7 +5572,7 @@ void prepare_move() { mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); return; #else - plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + line_to_destination(feedrate * feedmultiply / 100.0); #endif // MESH_BED_LEVELING } #endif // !(DELTA || SCARA) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 76ec03788..77af20325 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -113,9 +113,6 @@ volatile unsigned char block_buffer_tail; // Index of the block to pro //=========================================================================== //=============================private variables ============================ //=========================================================================== -#ifdef PREVENT_DANGEROUS_EXTRUDE - float extrude_min_temp = EXTRUDE_MINTEMP; -#endif #ifdef XY_FREQUENCY_LIMIT // Used for the frequency limit #define MAX_FREQ_TIME (1000000.0/XY_FREQUENCY_LIMIT) @@ -508,7 +505,7 @@ float junction_deviation = 0.1; #ifdef PREVENT_DANGEROUS_EXTRUDE if (de) { if (degHotend(active_extruder) < extrude_min_temp) { - position[E_AXIS] = target[E_AXIS]; //behave as if the move really took place, but ignore E part + position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part de = 0; // no difference SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); @@ -998,10 +995,6 @@ void plan_set_e_position(const float &e) { st_set_e_position(position[E_AXIS]); } -#ifdef PREVENT_DANGEROUS_EXTRUDE - void set_extrude_min_temp(float temp) { extrude_min_temp = temp; } -#endif - // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { for (int i = 0; i < NUM_AXIS; i++) diff --git a/Marlin/planner.h b/Marlin/planner.h index 41471a2b0..c617d6d48 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -161,10 +161,6 @@ FORCE_INLINE block_t *plan_get_current_block() { return NULL; } -#ifdef PREVENT_DANGEROUS_EXTRUDE - void set_extrude_min_temp(float temp); -#endif - void reset_acceleration_rates(); -#endif //PLANNER_H +#endif // PLANNER_H From a95544f92ac7ab15d66f12ce46616d54a7dad3b8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 02:04:06 -0700 Subject: [PATCH 266/302] Spell adjustment --- Marlin/ConfigurationStore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 56de81684..0154691de 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -669,7 +669,7 @@ void Config_PrintSettings(bool forReplay) { #ifdef DELTA SERIAL_ECHO_START; if (!forReplay) { - SERIAL_ECHOLNPGM("Endstop adjustement (mm):"); + SERIAL_ECHOLNPGM("Endstop adjustment (mm):"); SERIAL_ECHO_START; } SERIAL_ECHOPAIR(" M666 X", endstop_adj[X_AXIS] ); @@ -686,7 +686,7 @@ void Config_PrintSettings(bool forReplay) { #elif defined(Z_DUAL_ENDSTOPS) SERIAL_ECHO_START; if (!forReplay) { - SERIAL_ECHOLNPGM("Z2 Endstop adjustement (mm):"); + SERIAL_ECHOLNPGM("Z2 Endstop adjustment (mm):"); SERIAL_ECHO_START; } SERIAL_ECHOPAIR(" M666 Z", z_endstop_adj ); From df50523605e73c7d503b4e042b7eede96009112e Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 9 Apr 2015 12:26:45 +0200 Subject: [PATCH 267/302] Made encoderPosition and quick_feedback dependant on NEWPANEL where the hardware is available. Fix for #1873 --- Marlin/ultralcd.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 9e90d564b..42d150adf 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -251,9 +251,10 @@ float raw_Ki, raw_Kd; static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool feedback=true) { if (currentMenu != menu) { currentMenu = menu; - encoderPosition = encoder; - if (feedback) lcd_quick_feedback(); - + #if defined(NEWPANEL) + encoderPosition = encoder; + if (feedback) lcd_quick_feedback(); + #endif // For LCD_PROGRESS_BAR re-initialize the custom characters #ifdef LCD_PROGRESS_BAR lcd_set_custom_characters(menu == lcd_status_screen); @@ -1259,7 +1260,9 @@ int lcd_strlen_P(const char *s) { } void lcd_update() { - static unsigned long timeoutToStatus = 0; + #ifdef ULTIPANEL + static unsigned long timeoutToStatus = 0; + #endif #ifdef LCD_HAS_SLOW_BUTTONS slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context From a488445cbe89f44bb895eba2cfc874acbf4f5f60 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 03:41:31 -0700 Subject: [PATCH 268/302] Fix spelling of "too" --- Marlin/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 7aeaa81a6..857976bc3 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -186,7 +186,7 @@ #define Y_PROBE_ERROR #endif #ifdef Y_PROBE_ERROR - #error The Y axis probing range is to small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS + #error The Y axis probing range is too small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS #endif #undef PROBE_SIZE_X From 9189cc66ab3c3913c50f76a56d37f1639d2cb41c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 04:32:14 -0700 Subject: [PATCH 269/302] Fix moves for DELTA for MANUAL_BED_LEVELING - Use `line_to_current` in place of `plan_buffer_line` --- Marlin/Marlin_main.cpp | 2 +- Marlin/ultralcd.cpp | 184 ++++++++++++++++++++--------------------- 2 files changed, 93 insertions(+), 93 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2c364614a..f4f77ef63 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2929,7 +2929,7 @@ inline void gcode_M42() { // use that as a starting point for each probe. // if (verbose_level > 2) - SERIAL_PROTOCOL("Positioning the probe...\n"); + SERIAL_PROTOCOLPGM("Positioning the probe...\n"); plan_buffer_line( X_probe_location, Y_probe_location, Z_start_location, ext_position, diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 9e90d564b..4a41b6bf0 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -643,8 +643,8 @@ static void lcd_prepare_menu() { } #ifdef DELTA_CALIBRATION_MENU -static void lcd_delta_calibrate_menu() -{ + + static void lcd_delta_calibrate_menu() { START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); @@ -653,11 +653,31 @@ static void lcd_delta_calibrate_menu() MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Z, PSTR("G0 F8000 X0 Y90 Z0")); MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G0 F8000 X0 Y0 Z0")); END_MENU(); -} + } + #endif // DELTA_CALIBRATION_MENU +inline void line_to_current() { + #ifdef DELTA + calculate_delta(current_position); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder); + #else + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder); + #endif +} + float move_menu_scale; -static void lcd_move_menu_axis(); +static void lcd_move_menu_axis() { + START_MENU(); + MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); + MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); + MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); + if (move_menu_scale < 10.0) { + MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); + } + END_MENU(); +} static void _lcd_move(const char *name, int axis, int min, int max) { if (encoderPosition != 0) { @@ -666,12 +686,7 @@ static void _lcd_move(const char *name, int axis, int min, int max) { if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; if (max_software_endstops && current_position[axis] > max) current_position[axis] = max; encoderPosition = 0; - #ifdef DELTA - calculate_delta(current_position); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); - #else - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); - #endif + line_to_current(); lcdDrawUpdate = 1; } if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); @@ -685,30 +700,13 @@ static void lcd_move_e() { if (encoderPosition != 0) { current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; encoderPosition = 0; - #ifdef DELTA - calculate_delta(current_position); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder); - #else - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder); - #endif + line_to_current(); lcdDrawUpdate = 1; } if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS])); if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); } -static void lcd_move_menu_axis() { - START_MENU(); - MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); - if (move_menu_scale < 10.0) { - MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); - } - END_MENU(); -} - static void lcd_move_menu_10mm() { move_menu_scale = 10.0; lcd_move_menu_axis(); @@ -1793,76 +1791,78 @@ char *ftostr52(const float &x) { } #ifdef MANUAL_BED_LEVELING -static int _lcd_level_bed_position; -static void _lcd_level_bed() -{ - if (encoderPosition != 0) { - refresh_cmd_timeout(); - current_position[Z_AXIS] += float((int)encoderPosition) * MBL_Z_STEP; - if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) current_position[Z_AXIS] = Z_MIN_POS; - if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS; - encoderPosition = 0; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS]/60, active_extruder); - lcdDrawUpdate = 1; - } - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS])); - static bool debounce_click = false; - if (LCD_CLICKED) { - if (!debounce_click) { - debounce_click = true; - int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS; - int iy = _lcd_level_bed_position / MESH_NUM_X_POINTS; - if (iy&1) { // Zig zag - ix = (MESH_NUM_X_POINTS - 1) - ix; - } - mbl.set_z(ix, iy, current_position[Z_AXIS]); - _lcd_level_bed_position++; - if (_lcd_level_bed_position == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder); - mbl.active = 1; - enquecommands_P(PSTR("G28")); - lcd_return_to_status(); - } else { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder); - ix = _lcd_level_bed_position % MESH_NUM_X_POINTS; - iy = _lcd_level_bed_position / MESH_NUM_X_POINTS; + + static int _lcd_level_bed_position; + static void _lcd_level_bed() { + if (encoderPosition != 0) { + refresh_cmd_timeout(); + current_position[Z_AXIS] += float((int)encoderPosition) * MBL_Z_STEP; + if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) current_position[Z_AXIS] = Z_MIN_POS; + if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS; + encoderPosition = 0; + line_to_current(); + lcdDrawUpdate = 1; + } + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS])); + static bool debounce_click = false; + if (LCD_CLICKED) { + if (!debounce_click) { + debounce_click = true; + int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS; + int iy = _lcd_level_bed_position / MESH_NUM_X_POINTS; if (iy&1) { // Zig zag ix = (MESH_NUM_X_POINTS - 1) - ix; } - current_position[X_AXIS] = mbl.get_x(ix); - current_position[Y_AXIS] = mbl.get_y(iy); - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder); - lcdDrawUpdate = 1; + mbl.set_z(ix, iy, current_position[Z_AXIS]); + _lcd_level_bed_position++; + if (_lcd_level_bed_position == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS) { + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + line_to_current(); + mbl.active = 1; + enquecommands_P(PSTR("G28")); + lcd_return_to_status(); + } else { + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + line_to_current(); + ix = _lcd_level_bed_position % MESH_NUM_X_POINTS; + iy = _lcd_level_bed_position / MESH_NUM_X_POINTS; + if (iy&1) { // Zig zag + ix = (MESH_NUM_X_POINTS - 1) - ix; + } + current_position[X_AXIS] = mbl.get_x(ix); + current_position[Y_AXIS] = mbl.get_y(iy); + line_to_current(); + lcdDrawUpdate = 1; + } } + } else { + debounce_click = false; } - } else { - debounce_click = false; } -} -static void _lcd_level_bed_homing() -{ - if (axis_known_position[X_AXIS] && - axis_known_position[Y_AXIS] && - axis_known_position[Z_AXIS]) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - current_position[X_AXIS] = MESH_MIN_X; - current_position[Y_AXIS] = MESH_MIN_Y; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder); - _lcd_level_bed_position = 0; - lcd_goto_menu(_lcd_level_bed); + + static void _lcd_level_bed_homing() { + if (axis_known_position[X_AXIS] && + axis_known_position[Y_AXIS] && + axis_known_position[Z_AXIS]) { + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + current_position[X_AXIS] = MESH_MIN_X; + current_position[Y_AXIS] = MESH_MIN_Y; + line_to_current(); + _lcd_level_bed_position = 0; + lcd_goto_menu(_lcd_level_bed); + } } -} -static void lcd_level_bed() { - axis_known_position[X_AXIS] = false; - axis_known_position[Y_AXIS] = false; - axis_known_position[Z_AXIS] = false; - mbl.reset(); - enquecommands_P(PSTR("G28")); - lcd_goto_menu(_lcd_level_bed_homing); -} + + static void lcd_level_bed() { + axis_known_position[X_AXIS] = false; + axis_known_position[Y_AXIS] = false; + axis_known_position[Z_AXIS] = false; + mbl.reset(); + enquecommands_P(PSTR("G28")); + lcd_goto_menu(_lcd_level_bed_homing); + } + #endif // MANUAL_BED_LEVELING -#endif //ULTRA_LCD +#endif // ULTRA_LCD From fb4cefc91da021e57ad7058a1674bd050af2e179 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 19:33:16 -0700 Subject: [PATCH 270/302] Define lcd_move_[xyz] ahead of lcd_move_menu_axis --- Marlin/ultralcd.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4a41b6bf0..0d65ba2df 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -666,19 +666,6 @@ inline void line_to_current() { #endif } -float move_menu_scale; -static void lcd_move_menu_axis() { - START_MENU(); - MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); - if (move_menu_scale < 10.0) { - MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); - } - END_MENU(); -} - static void _lcd_move(const char *name, int axis, int min, int max) { if (encoderPosition != 0) { refresh_cmd_timeout(); @@ -696,6 +683,19 @@ static void lcd_move_x() { _lcd_move(PSTR("X"), X_AXIS, X_MIN_POS, X_MAX_POS); } static void lcd_move_y() { _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); } static void lcd_move_z() { _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); } +float move_menu_scale; +static void lcd_move_menu_axis() { + START_MENU(); + MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); + MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); + MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); + if (move_menu_scale < 10.0) { + MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); + } + END_MENU(); +} + static void lcd_move_e() { if (encoderPosition != 0) { current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; From b328c6e6b6934d178d5927763067d369ebdb5411 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 20:05:10 -0700 Subject: [PATCH 271/302] Shuffling declarations. --- Marlin/ultralcd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0d65ba2df..e3b7d2ef8 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -666,6 +666,9 @@ inline void line_to_current() { #endif } +float move_menu_scale; +static void lcd_move_menu_axis(); + static void _lcd_move(const char *name, int axis, int min, int max) { if (encoderPosition != 0) { refresh_cmd_timeout(); @@ -683,7 +686,6 @@ static void lcd_move_x() { _lcd_move(PSTR("X"), X_AXIS, X_MIN_POS, X_MAX_POS); } static void lcd_move_y() { _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); } static void lcd_move_z() { _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); } -float move_menu_scale; static void lcd_move_menu_axis() { START_MENU(); MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); From 5914d9d7def75080f97542b7e5fef8e4be05c4ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 20:21:30 -0700 Subject: [PATCH 272/302] Shuffling declarations.. --- Marlin/ultralcd.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index e3b7d2ef8..62440a3cd 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -685,6 +685,16 @@ static void _lcd_move(const char *name, int axis, int min, int max) { static void lcd_move_x() { _lcd_move(PSTR("X"), X_AXIS, X_MIN_POS, X_MAX_POS); } static void lcd_move_y() { _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); } static void lcd_move_z() { _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); } +static void lcd_move_e() { + if (encoderPosition != 0) { + current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; + encoderPosition = 0; + line_to_current(); + lcdDrawUpdate = 1; + } + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS])); + if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); +} static void lcd_move_menu_axis() { START_MENU(); @@ -698,17 +708,6 @@ static void lcd_move_menu_axis() { END_MENU(); } -static void lcd_move_e() { - if (encoderPosition != 0) { - current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; - encoderPosition = 0; - line_to_current(); - lcdDrawUpdate = 1; - } - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS])); - if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); -} - static void lcd_move_menu_10mm() { move_menu_scale = 10.0; lcd_move_menu_axis(); From 8b16ebe705e510dbad7534e55c54b1a7e8d49f22 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Apr 2015 22:40:37 -0700 Subject: [PATCH 273/302] Break out prevent_dangerous_extrude feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - It’s inline here, but could be a macro and duplicated for `planner.cpp` --- Marlin/Marlin_main.cpp | 97 +++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f4f77ef63..10958e3fa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -547,9 +547,7 @@ void servo_init() #endif } - -void setup() -{ +void setup() { setup_killpin(); setup_filrunoutpin(); setup_powerhold(); @@ -559,15 +557,16 @@ void setup() // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; - if(mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); - if(mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET); - if(mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET); - if(mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET); - if(mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET); - MCUSR=0; + if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); + if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET); + if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET); + if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET); + if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET); + MCUSR = 0; SERIAL_ECHOPGM(MSG_MARLIN); - SERIAL_ECHOLNPGM(STRING_VERSION); + SERIAL_ECHOLNPGM(" " STRING_VERSION); + #ifdef STRING_VERSION_CONFIG_H #ifdef STRING_CONFIG_H_AUTHOR SERIAL_ECHO_START; @@ -579,17 +578,16 @@ void setup() SERIAL_ECHOLNPGM(__DATE__); #endif // STRING_CONFIG_H_AUTHOR #endif // STRING_VERSION_CONFIG_H + SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_FREE_MEMORY); SERIAL_ECHO(freeMemory()); SERIAL_ECHOPGM(MSG_PLANNER_BUFFER_BYTES); SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); + #ifdef SDSUPPORT - for(int8_t i = 0; i < BUFSIZE; i++) - { - fromsd[i] = false; - } - #endif //!SDSUPPORT + for (int8_t i = 0; i < BUFSIZE; i++) fromsd[i] = false; + #endif // !SDSUPPORT // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); @@ -600,7 +598,6 @@ void setup() st_init(); // Initialize stepper, this enables interrupts! setup_photpin(); servo_init(); - lcd_init(); _delay_ms(1000); // wait 1sec to display the splash screen @@ -612,20 +609,23 @@ void setup() #ifdef DIGIPOT_I2C digipot_i2c_init(); #endif -#ifdef Z_PROBE_SLED - pinMode(SERVO0_PIN, OUTPUT); - digitalWrite(SERVO0_PIN, LOW); // turn it off -#endif // Z_PROBE_SLED + + #ifdef Z_PROBE_SLED + pinMode(SERVO0_PIN, OUTPUT); + digitalWrite(SERVO0_PIN, LOW); // turn it off + #endif // Z_PROBE_SLED + setup_homepin(); -#ifdef STAT_LED_RED - pinMode(STAT_LED_RED, OUTPUT); - digitalWrite(STAT_LED_RED, LOW); // turn it off -#endif -#ifdef STAT_LED_BLUE - pinMode(STAT_LED_BLUE, OUTPUT); - digitalWrite(STAT_LED_BLUE, LOW); // turn it off -#endif + #ifdef STAT_LED_RED + pinMode(STAT_LED_RED, OUTPUT); + digitalWrite(STAT_LED_RED, LOW); // turn it off + #endif + + #ifdef STAT_LED_BLUE + pinMode(STAT_LED_BLUE, OUTPUT); + digitalWrite(STAT_LED_BLUE, LOW); // turn it off + #endif } @@ -5447,26 +5447,37 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ } #endif // MESH_BED_LEVELING +#ifdef PREVENT_DANGEROUS_EXTRUDE + + inline float prevent_dangerous_extrude(float &curr_e, float &dest_e) { + float de = dest_e - curr_e; + if (de) { + if (degHotend(active_extruder) < extrude_min_temp) { + curr_e = dest_e; // Behave as if the move really took place, but ignore E part + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); + return 0; + } + #ifdef PREVENT_LENGTHY_EXTRUDE + if (labs(de) > EXTRUDE_MAXLENGTH) { + curr_e = dest_e; // Behave as if the move really took place, but ignore E part + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); + return 0; + } + #endif + } + return de; + } + +#endif // PREVENT_DANGEROUS_EXTRUDE + void prepare_move() { clamp_to_software_endstops(destination); refresh_cmd_timeout(); #ifdef PREVENT_DANGEROUS_EXTRUDE - float de = destination[E_AXIS] - current_position[E_AXIS]; - if (de) { - if (degHotend(active_extruder) < extrude_min_temp) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); - } - #ifdef PREVENT_LENGTHY_EXTRUDE - if (labs(de) > EXTRUDE_MAXLENGTH) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); - } - #endif - } + (void)prevent_dangerous_extrude(current_position[E_AXIS], destination[E_AXIS]); #endif #ifdef SCARA //for now same as delta-code From 907e8e98e5d547ddcb67b8447c857394eac4b10f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 14:55:21 -0700 Subject: [PATCH 274/302] Add GCodes from Marlin 1.0.3 dev, format as pre --- Documentation/GCodes.md | 227 ++++++++++++++++++++++------------------ 1 file changed, 128 insertions(+), 99 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index 57b95cdee..94756f8d9 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -2,105 +2,134 @@ ## G Codes -* G0 -> G1 -* G1 - Coordinated Movement X Y Z E -* G2 - CW ARC -* G3 - CCW ARC -* G4 - Dwell S[seconds] or P[milliseconds] -* G10 - retract filament according to settings of M207 -* G11 - retract recover filament according to settings of M208 -* G28 - Home all Axis -* G29 - Detailed Z-Probe, probes the bed at 3 points. You must be at the home position for this to work correctly. -* G30 - Single Z Probe, probes bed at current XY location. -* G31 - Dock Z Probe sled (if enabled) -* G32 - Undock Z Probe sled (if enabled) -* G90 - Use Absolute Coordinates -* G91 - Use Relative Coordinates -* G92 - Set current position to cordinates given - +``` +G0 -> G1 +G1 - Coordinated Movement X Y Z E +G2 - CW ARC +G3 - CCW ARC +G4 - Dwell S[seconds] or P[milliseconds] +G10 - retract filament according to settings of M207 +G11 - retract recover filament according to settings of M208 +G28 - Home all Axis +G29 - Detailed Z-Probe, probes the bed at 3 points. You must be at the home position for this to work correctly. +G30 - Single Z Probe, probes bed at current XY location. +G31 - Dock Z Probe sled (if enabled) +G32 - Undock Z Probe sled (if enabled) +G90 - Use Absolute Coordinates +G91 - Use Relative Coordinates +G92 - Set current position to cordinates given +``` ## M Codes -* M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) -* M1 - Same as M0 -* M17 - Enable/Power all stepper motors -* M18 - Disable all stepper motors; same as M84 -* M20 - List SD card -* M21 - Init SD card -* M22 - Release SD card -* M23 - Select SD file (M23 filename.g) -* M24 - Start/resume SD print -* M25 - Pause SD print -* M26 - Set SD position in bytes (M26 S12345) -* M27 - Report SD print status -* M28 - Start SD write (M28 filename.g) -* M29 - Stop SD write -* M30 - Delete file from SD (M30 filename.g) -* M31 - Output time since last M109 or SD card start to serial -* M32 - Select file and start SD print (Can be used when printing from SD card) -* M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. -* M80 - Turn on Power Supply -* M81 - Turn off Power Supply -* M82 - Set E codes absolute (default) -* M83 - Set E codes relative while in Absolute Coordinates (G90) mode -* M84 - Disable steppers until next move, or use S[seconds] to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. -* M85 - Set inactivity shutdown timer with parameter S[seconds]. To disable set zero (default) -* M92 - Set axis_steps_per_unit - same syntax as G92 -* M104 - Set extruder target temp -* M105 - Read current temp -* M106 - Fan on -* M107 - Fan off -* M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating -* Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling -* M112 - Emergency stop -* M114 - Output current position to serial port -* M115 - Capabilities string -* M117 - display message -* M119 - Output Endstop status to serial port -* M126 - Solenoid Air Valve Open (BariCUDA support by jmil) -* M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) -* M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) -* M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) -* M140 - Set bed target temp -* M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating -* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -* M200 - D[millimeters]- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). -* M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) -* M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! -* M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec -* M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 -* M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk -* M206 - set additional homing offset -* M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting -* M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min] -* M209 - S[1=true/0=false] enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. -* M218 - set hotend offset (in mm): T[extruder_number] X[offset_on_X] Y[offset_on_Y] -* M220 - S[factor in percent] - set speed factor override percentage -* M221 - S[factor in percent] - set extrude factor override percentage -* M240 - Trigger a camera to take a photograph -* M280 - Position an RC Servo P[index] S[angle/microseconds], ommit S to report back current angle -* M300 - Play beep sound S[frequency Hz] P[duration ms] -* M301 - Set PID parameters P I and D -* M302 - Allow cold extrudes -* M303 - PID relay autotune S[temperature] sets the target temperature. (default target temperature = 150C) -* M304 - Set bed PID parameters P I and D -* M350 - Set microstepping mode. -* M351 - Toggle MS1 MS2 pins directly. -* M400 - Finish all moves -* M401 - Lower z-probe if present -* M402 - Raise z-probe if present -* M404 - N[dia in mm] Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters -* M405 - Turn on Filament Sensor extrusion control. Optional D[delay in cm] to set delay in centimeters between sensor and extruder -* M406 - Turn off Filament Sensor extrusion control -* M407 - Displays measured filament diameter -* M500 - stores paramters in EEPROM -* M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). -* M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. -* M503 - print the current settings (from memory not from EEPROM) -* M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) -* M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] -* M907 - Set digital trimpot motor current using axis codes. -* M908 - Control digital trimpot directly. -* M928 - Start SD logging (M928 filename.g) - ended by M29 -* M999 - Restart after being stopped by error +``` +M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) +M1 - Same as M0 +M17 - Enable/Power all stepper motors +M18 - Disable all stepper motors; same as M84 +M20 - List SD card +M21 - Init SD card +M22 - Release SD card +M23 - Select SD file (M23 filename.g) +M24 - Start/resume SD print +M25 - Pause SD print +M26 - Set SD position in bytes (M26 S12345) +M27 - Report SD print status +M28 - Start SD write (M28 filename.g) +M29 - Stop SD write +M30 - Delete file from SD (M30 filename.g) +M31 - Output time since last M109 or SD card start to serial +M32 - Select file and start SD print (Can be used _while_ printing from SD card files): + syntax "M32 /path/filename#", or "M32 S !filename#" + Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). + The '#' is necessary when calling from within sd files, as it stops buffer prereading +M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. +M48 - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel] +M80 - Turn on Power Supply +M81 - Turn off Power Supply +M82 - Set E codes absolute (default) +M83 - Set E codes relative while in Absolute Coordinates (G90) mode +M84 - Disable steppers until next move, + or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. +M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) +M92 - Set axis_steps_per_unit - same syntax as G92 +M104 - Set extruder target temp +M105 - Read current temp +M106 - Fan on +M107 - Fan off +M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating + Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling + IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F +M112 - Emergency stop +M114 - Output current position to serial port +M115 - Capabilities string +M117 - display message +M119 - Output Endstop status to serial port +M120 - Enable endstop detection +M121 - Disable endstop detection +M126 - Solenoid Air Valve Open (BariCUDA support by jmil) +M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) +M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) +M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) +M140 - Set bed target temp +M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. +M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating + Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling +M200 D- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). +M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) +M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! +M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec +M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 +M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk +M206 - Set additional homing offset +M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting +M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] +M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. +M218 - Set hotend offset (in mm): T X Y +M220 S- set speed factor override percentage +M221 S- set extrude factor override percentage +M226 P S- Wait until the specified pin reaches the state required +M240 - Trigger a camera to take a photograph +M250 - Set LCD contrast C (value 0..63) +M280 - Set servo position absolute. P: servo index, S: angle or microseconds +M300 - Play beep sound S P +M301 - Set PID parameters P I and D +M302 - Allow cold extrudes, or set the minimum extrude S. +M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C) +M304 - Set bed PID parameters P I and D +M380 - Activate solenoid on active extruder +M381 - Disable all solenoids +M400 - Finish all moves +M401 - Lower z-probe if present +M402 - Raise z-probe if present +M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters +M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder +M406 - Turn off Filament Sensor extrusion control +M407 - Display measured filament diameter +M500 - Store parameters in EEPROM +M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). +M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. +M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) +M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] +M665 - Set delta configurations +M666 - Set delta endstop adjustment +M605 - Set dual x-carriage movement mode: S [ X R ] +M907 - Set digital trimpot motor current using axis codes. +M908 - Control digital trimpot directly. +M350 - Set microstepping mode. +M351 - Toggle MS1 MS2 pins directly. + +M928 - Start SD logging (M928 filename.g) - ended by M29 +M999 - Restart after being stopped by error +``` +## SCARA-specific M-Codes - May change to suit future G-code standards +``` +M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) +M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) +M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) +M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) +M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) +M365 - SCARA calibration: Scaling factor, X, Y, Z axis +``` # Comments @@ -122,4 +151,4 @@ If you need to use a literal `;` somewhere (for example within `M117`), you can M117 backslash: \\;and a comment -Please note that hosts should strip any comments before sending GCODE to the printer in order to save bandwidth. \ No newline at end of file +Please note that hosts should strip any comments before sending GCODE to the printer in order to save bandwidth. From 01654bdec1f37a36be00b44c149aca2862eca60b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 15:03:41 -0700 Subject: [PATCH 275/302] Cleanup formatting of some M codes --- Documentation/GCodes.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index 94756f8d9..f7813830d 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -73,7 +73,7 @@ M140 - Set bed target temp M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -M200 D- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). +M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).: D- M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec @@ -84,9 +84,9 @@ M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/h M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. M218 - Set hotend offset (in mm): T X Y -M220 S- set speed factor override percentage -M221 S- set extrude factor override percentage -M226 P S- Wait until the specified pin reaches the state required +M220 - Set speed factor override percentage: S +M221 - Set extrude factor override percentage: S +M226 - Wait until the specified pin reaches the state required: P S M240 - Trigger a camera to take a photograph M250 - Set LCD contrast C (value 0..63) M280 - Set servo position absolute. P: servo index, S: angle or microseconds @@ -117,9 +117,6 @@ M907 - Set digital trimpot motor current using axis codes. M908 - Control digital trimpot directly. M350 - Set microstepping mode. M351 - Toggle MS1 MS2 pins directly. - -M928 - Start SD logging (M928 filename.g) - ended by M29 -M999 - Restart after being stopped by error ``` ## SCARA-specific M-Codes - May change to suit future G-code standards ``` From 3105ebc562040c8aecf8f510a455272bde97fc12 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 15:05:00 -0700 Subject: [PATCH 276/302] Restore M928, M999 --- Documentation/GCodes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index f7813830d..e7b21b760 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -126,6 +126,8 @@ M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) M365 - SCARA calibration: Scaling factor, X, Y, Z axis +M928 - Start SD logging (M928 filename.g) - ended by M29 +M999 - Restart after being stopped by error ``` # Comments From a3b13eb5ac1ab97c8504279fe94749a9c511614e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 15:54:36 -0700 Subject: [PATCH 277/302] Organize M Codes by Category - In GCodes.md --- Documentation/GCodes.md | 156 +++++++++++++++++++++++++--------------- 1 file changed, 100 insertions(+), 56 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index e7b21b760..81d7cc390 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -8,10 +8,10 @@ G1 - Coordinated Movement X Y Z E G2 - CW ARC G3 - CCW ARC G4 - Dwell S[seconds] or P[milliseconds] -G10 - retract filament according to settings of M207 -G11 - retract recover filament according to settings of M208 +G10 - Retract filament according to settings of M207 +G11 - Retract recover filament according to settings of M208 G28 - Home all Axis -G29 - Detailed Z-Probe, probes the bed at 3 points. You must be at the home position for this to work correctly. +G29 - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29. G30 - Single Z Probe, probes bed at current XY location. G31 - Dock Z Probe sled (if enabled) G32 - Undock Z Probe sled (if enabled) @@ -19,12 +19,16 @@ G90 - Use Absolute Coordinates G91 - Use Relative Coordinates G92 - Set current position to cordinates given ``` -## M Codes +## Movement M Codes ``` -M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) +M0 - Wait for user, with optional prompt message (to press the LCD button, requires ULTRA_LCD) + M0 Click When Ready ; show "Click When Ready" until the button is pressed. M1 - Same as M0 -M17 - Enable/Power all stepper motors -M18 - Disable all stepper motors; same as M84 +M400 - Finish all moves +M999 - Restart after being stopped by error +``` +### SD Card M Codes +``` M20 - List SD card M21 - Init SD card M22 - Release SD card @@ -41,16 +45,24 @@ M32 - Select file and start SD print (Can be used _while_ printing from SD card syntax "M32 /path/filename#", or "M32 S !filename#" Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). The '#' is necessary when calling from within sd files, as it stops buffer prereading -M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. -M48 - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel] +M540 - Enable/Disable "Stop SD Print on Endstop Hit" (req. ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) + M540 S<0|1> +M928 - Start SD logging (M928 filename.g) - ended by M29 +``` +### Hardware Control +``` +M42 - Change pin status via gcode: P S. If P is omitted the onboard LED pin will be used. + M42 P9 S1 ; set PIN 9 to 1. M80 - Turn on Power Supply M81 - Turn off Power Supply -M82 - Set E codes absolute (default) -M83 - Set E codes relative while in Absolute Coordinates (G90) mode M84 - Disable steppers until next move, or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) -M92 - Set axis_steps_per_unit - same syntax as G92 +M112 - Emergency stop. Requires hardware reset!! +M226 - Wait for a pin to be in some state: P S +``` +### Temperature M Codes +``` M104 - Set extruder target temp M105 - Read current temp M106 - Fan on @@ -58,67 +70,101 @@ M107 - Fan off M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F -M112 - Emergency stop -M114 - Output current position to serial port -M115 - Capabilities string -M117 - display message -M119 - Output Endstop status to serial port -M120 - Enable endstop detection -M121 - Disable endstop detection -M126 - Solenoid Air Valve Open (BariCUDA support by jmil) -M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) -M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) -M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) M140 - Set bed target temp -M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).: D- -M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) -M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! -M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec -M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 -M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk -M206 - Set additional homing offset -M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting -M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] -M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. -M218 - Set hotend offset (in mm): T X Y -M220 - Set speed factor override percentage: S -M221 - Set extrude factor override percentage: S -M226 - Wait until the specified pin reaches the state required: P S -M240 - Trigger a camera to take a photograph -M250 - Set LCD contrast C (value 0..63) -M280 - Set servo position absolute. P: servo index, S: angle or microseconds -M300 - Play beep sound S P M301 - Set PID parameters P I and D M302 - Allow cold extrudes, or set the minimum extrude S. M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C) M304 - Set bed PID parameters P I and D +``` +### Message M Codes +``` +M114 - Output current position to serial port +M115 - Capabilities string +M117 - Display message text on the LCD +M119 - Output Endstop status to serial port +``` +### Endstops M Codes +``` +M120 - Enable endstop detection +M121 - Disable endstop detection +``` +### Special Features M Codes +``` +M126 - Solenoid Air Valve Open (BariCUDA support by jmil) +M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) +M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) +M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) +M150 - Set BlinkM Color: R U B via I2C. Range: 0-255 +M240 - Trigger a camera to take a photograph. (Add to your per-layer GCode.) +M250 - Set LCD contrast: C<0-63> +M280 - Set servo position absolute. P S +M300 - Play beep sound S P M380 - Activate solenoid on active extruder M381 - Disable all solenoids -M400 - Finish all moves -M401 - Lower z-probe if present -M402 - Raise z-probe if present -M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters -M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder +M600 - Pause for filament change X Y Z E L +``` +### Units and Measures M Codes +``` +M82 - Set E codes absolute (default) +M83 - Set E codes relative while in Absolute Coordinates (G90) mode +M92 - Set axis_steps_per_unit - same syntax as G92 +M200 - Set filament diameter and set E axis units to mm^3 (use S0 to set back to mm).: D +M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) +M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! +M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec +M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 +M205 - Advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X=maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk +M206 - Set additional homing offset +M218 - Set hotend offset (in mm): T X Y +M220 - Set speed factor override percentage: S +M221 - Set extrude factor override percentage: S +``` +### Firmware Retraction M Codes +``` +M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting +M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s] +M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction +``` +### Z Probe M Codes +``` +M48 - Measure Z_Probe repeatability: P X Y V E=engage L + As with G29, the E flag causes the probe to stow after each probe. +M401 - Lower Z-probe (if present) +M402 - Raise Z-probe (if present) +``` +### Filament Diameter M Codes +``` +M404 - Set (or display) Nominal Filament Diameter in mm: [N] (e.g., 3mm or 1.75mm) +M405 - Turn on Filament Sensor extrusion control: [D] to set distance (in cm) from sensor to extruder M406 - Turn off Filament Sensor extrusion control -M407 - Display measured filament diameter +M407 - Display measured Filament Diameter +``` +### EEPROM Settings M Codes +``` M500 - Store parameters in EEPROM M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. -M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) -M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] -M665 - Set delta configurations -M666 - Set delta endstop adjustment +``` +### Delta M Codes +``` +M665 - Set Delta configurations: L R S +M666 - Set Delta endstop adjustment: X Y Z M605 - Set dual x-carriage movement mode: S [ X R ] +``` +### Stepper Driver M Codes +``` +M17 - Enable/Power all stepper motors +M18 - Disable all stepper motors. (same as M84) M907 - Set digital trimpot motor current using axis codes. M908 - Control digital trimpot directly. M350 - Set microstepping mode. M351 - Toggle MS1 MS2 pins directly. ``` -## SCARA-specific M-Codes - May change to suit future G-code standards +### SCARA M-Codes +__May change to suit future G-code standards__ ``` M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) @@ -126,11 +172,9 @@ M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) M365 - SCARA calibration: Scaling factor, X, Y, Z axis -M928 - Start SD logging (M928 filename.g) - ended by M29 -M999 - Restart after being stopped by error ``` -# Comments +## Comments Comments start at a `;` (semicolon) and end with the end of the line: From 93eb63238f39085ffa74ea999f7c124cda3f483e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 15:57:54 -0700 Subject: [PATCH 278/302] Move G Codes into categories with M Codes --- Documentation/GCodes.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index 81d7cc390..fbf38ed68 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -1,26 +1,13 @@ # Implemented G Codes -## G Codes - +## Movement G and M Codes ``` G0 -> G1 G1 - Coordinated Movement X Y Z E G2 - CW ARC G3 - CCW ARC G4 - Dwell S[seconds] or P[milliseconds] -G10 - Retract filament according to settings of M207 -G11 - Retract recover filament according to settings of M208 -G28 - Home all Axis -G29 - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29. -G30 - Single Z Probe, probes bed at current XY location. -G31 - Dock Z Probe sled (if enabled) -G32 - Undock Z Probe sled (if enabled) -G90 - Use Absolute Coordinates -G91 - Use Relative Coordinates G92 - Set current position to cordinates given -``` -## Movement M Codes -``` M0 - Wait for user, with optional prompt message (to press the LCD button, requires ULTRA_LCD) M0 Click When Ready ; show "Click When Ready" until the button is pressed. M1 - Same as M0 @@ -105,8 +92,10 @@ M380 - Activate solenoid on active extruder M381 - Disable all solenoids M600 - Pause for filament change X Y Z E L ``` -### Units and Measures M Codes +### Units and Measures G and M Codes ``` +G90 - Use Absolute Coordinates +G91 - Use Relative Coordinates M82 - Set E codes absolute (default) M83 - Set E codes relative while in Absolute Coordinates (G90) mode M92 - Set axis_steps_per_unit - same syntax as G92 @@ -121,14 +110,21 @@ M218 - Set hotend offset (in mm): T X Y M221 - Set extrude factor override percentage: S ``` -### Firmware Retraction M Codes +### Firmware Retraction G and M Codes ``` +G10 - Retract filament according to settings of M207 +G11 - Retract recover filament according to settings of M208 M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s] M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction ``` -### Z Probe M Codes +### Z Probe G and M Codes ``` +G28 - Home all Axis +G29 - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29. +G30 - Single Z Probe, probes bed at current XY location. +G31 - Dock Z Probe sled (if enabled) +G32 - Undock Z Probe sled (if enabled) M48 - Measure Z_Probe repeatability: P X Y V E=engage L As with G29, the E flag causes the probe to stow after each probe. M401 - Lower Z-probe (if present) From fe912f44dce6118a31fda95d148380ae496d1bba Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 15:58:32 -0700 Subject: [PATCH 279/302] Smaller headings --- Documentation/GCodes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index fbf38ed68..ed16648c9 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -1,6 +1,6 @@ -# Implemented G Codes +## Implemented G Codes -## Movement G and M Codes +### Movement G and M Codes ``` G0 -> G1 G1 - Coordinated Movement X Y Z E From 652d59cd807b62082ca0a07bd52fdd88c93a2b4b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 15:59:55 -0700 Subject: [PATCH 280/302] Spacing of g-codes in GCodes.md --- Documentation/GCodes.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index ed16648c9..e2461d45d 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -2,12 +2,12 @@ ### Movement G and M Codes ``` -G0 -> G1 -G1 - Coordinated Movement X Y Z E -G2 - CW ARC -G3 - CCW ARC -G4 - Dwell S[seconds] or P[milliseconds] -G92 - Set current position to cordinates given +G0 -> G1 +G1 - Coordinated Movement X Y Z E +G2 - CW ARC +G3 - CCW ARC +G4 - Dwell S[seconds] or P[milliseconds] +G92 - Set current position to cordinates given M0 - Wait for user, with optional prompt message (to press the LCD button, requires ULTRA_LCD) M0 Click When Ready ; show "Click When Ready" until the button is pressed. M1 - Same as M0 @@ -94,8 +94,8 @@ M600 - Pause for filament change X Y Z E L ``` ### Firmware Retraction G and M Codes ``` -G10 - Retract filament according to settings of M207 -G11 - Retract recover filament according to settings of M208 +G10 - Retract filament according to settings of M207 +G11 - Retract recover filament according to settings of M208 M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s] M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction ``` ### Z Probe G and M Codes ``` -G28 - Home all Axis -G29 - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29. -G30 - Single Z Probe, probes bed at current XY location. -G31 - Dock Z Probe sled (if enabled) -G32 - Undock Z Probe sled (if enabled) +G28 - Home all Axis +G29 - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29. +G30 - Single Z Probe, probes bed at current XY location. +G31 - Dock Z Probe sled (if enabled) +G32 - Undock Z Probe sled (if enabled) M48 - Measure Z_Probe repeatability: P X Y V E=engage L As with G29, the E flag causes the probe to stow after each probe. M401 - Lower Z-probe (if present) From a327d876fe0a8a934ab045324a51d7aff6fb3bf2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 16:02:00 -0700 Subject: [PATCH 281/302] Document G92 arguments in GCodes.md --- Documentation/GCodes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index e2461d45d..311e89f29 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -7,8 +7,8 @@ G1 - Coordinated Movement X Y Z E G2 - CW ARC G3 - CCW ARC G4 - Dwell S[seconds] or P[milliseconds] -G92 - Set current position to cordinates given -M0 - Wait for user, with optional prompt message (to press the LCD button, requires ULTRA_LCD) +G92 - Set the "current position" to coordinates: X Y Z E +M0 - Wait for user, with optional prompt message (requires LCD controller) M0 Click When Ready ; show "Click When Ready" until the button is pressed. M1 - Same as M0 M400 - Finish all moves From 8f164f4c8318385d278fcf99cd09bb1f621c194c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 16:04:32 -0700 Subject: [PATCH 282/302] Clean up M85 in GCodes.md --- Documentation/GCodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/GCodes.md b/Documentation/GCodes.md index 311e89f29..c05be6198 100644 --- a/Documentation/GCodes.md +++ b/Documentation/GCodes.md @@ -44,7 +44,7 @@ M80 - Turn on Power Supply M81 - Turn off Power Supply M84 - Disable steppers until next move, or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. -M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) +M85 - Set inactivity shutdown timer with parameter S. Disable with "M85" or "M85 S0". M112 - Emergency stop. Requires hardware reset!! M226 - Wait for a pin to be in some state: P S ``` From 5fe382949bdc91d48312547b73d7e79e7ec02b8a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 16:16:13 -0700 Subject: [PATCH 283/302] Some G-Codes comment cleanup --- Marlin/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 10958e3fa..37dc7af23 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -141,7 +141,7 @@ // M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. // M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating // Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -// M200 D- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). +// M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).:D- // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! // M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec @@ -152,9 +152,9 @@ // M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. // M218 - Set hotend offset (in mm): T X Y -// M220 S- set speed factor override percentage -// M221 S- set extrude factor override percentage -// M226 P S- Wait until the specified pin reaches the state required +// M220 - Set speed factor override percentage: S +// M221 - Set extrude factor override percentage: S +// M226 - Wait until the specified pin reaches the state required: P S // M240 - Trigger a camera to take a photograph // M250 - Set LCD contrast C (value 0..63) // M280 - Set servo position absolute. P: servo index, S: angle or microseconds @@ -178,7 +178,7 @@ // M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] -// M665 - Set delta configurations +// M665 - Set delta configurations: L R S // M666 - Set delta endstop adjustment // M605 - Set dual x-carriage movement mode: S [ X R ] // M907 - Set digital trimpot motor current using axis codes. From ccbe2c4ea3a36195dce61caf097420cb64e2d653 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Apr 2015 21:29:42 -0700 Subject: [PATCH 284/302] Apply CUSTOM_MACHINE_NAME to configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace “Mendel” with “RepRap” --- Marlin/Configuration.h | 5 +++-- Marlin/configurator/config/Configuration.h | 5 +++-- Marlin/configurator/config/language.h | 2 +- Marlin/configurator/index.html | 2 +- Marlin/example_configurations/Felix/Configuration.h | 5 +++-- Marlin/example_configurations/Felix/Configuration_DUAL.h | 5 +++-- Marlin/example_configurations/Hephestos/Configuration.h | 4 ++-- Marlin/example_configurations/K8200/Configuration.h | 5 +++-- Marlin/example_configurations/SCARA/Configuration.h | 5 +++-- Marlin/example_configurations/WITBOX/Configuration.h | 5 +++-- Marlin/example_configurations/delta/generic/Configuration.h | 5 +++-- .../example_configurations/delta/kossel_mini/Configuration.h | 5 +++-- Marlin/example_configurations/makibox/Configuration.h | 5 +++-- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 5 +++-- Marlin/language.h | 2 +- 15 files changed, 38 insertions(+), 27 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b99d4f426..646dc60ae 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -68,8 +68,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 3fad14527..57f37756b 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -68,8 +68,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/configurator/config/language.h b/Marlin/configurator/config/language.h index 3fe7afd2e..5d1fd6c2f 100644 --- a/Marlin/configurator/config/language.h +++ b/Marlin/configurator/config/language.h @@ -75,7 +75,7 @@ #endif #ifdef CUSTOM_MENDEL_NAME - #warning CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME + #error CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME #define CUSTOM_MACHINE_NAME CUSTOM_MENDEL_NAME #endif diff --git a/Marlin/configurator/index.html b/Marlin/configurator/index.html index 9fa40a105..54353913d 100644 --- a/Marlin/configurator/index.html +++ b/Marlin/configurator/index.html @@ -46,7 +46,7 @@ - + diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 1efcad88c..269b8b794 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_FELIX2 #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "Felix" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index dd5c371c0..49b9f5b0b 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_FELIX2 #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "Felix Dual" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 2a331c9ec..e399ed899 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -62,8 +62,8 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_HEPHESTOS #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 5adab57f5..60e2db873 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_K8200 #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index c0032d4bb..65fccb063 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -80,8 +80,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 757c1628e..293aa7716 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_WITBOX #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index f1760f59e..2562010ea 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "Deltabot" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 990c4e762..1c6313e93 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Define this to set a custom name for your generic Mendel, -#define CUSTOM_MENDEL_NAME "Mini Kossel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "Mini Kossel" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 1eea3186c..e355a41ea 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_5DPRINT #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 8a3c3a854..06cd2ae47 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -62,8 +62,9 @@ Here are some standard links for getting your machine calibrated: #define MOTHERBOARD BOARD_OMCA #endif -// Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +// #define CUSTOM_MACHINE_NAME "This RepRap" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/language.h b/Marlin/language.h index 3fe7afd2e..5d1fd6c2f 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -75,7 +75,7 @@ #endif #ifdef CUSTOM_MENDEL_NAME - #warning CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME + #error CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME #define CUSTOM_MACHINE_NAME CUSTOM_MENDEL_NAME #endif From c6bb98abade7db4abe1e2dbf3d4ecc651b493039 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Apr 2015 01:36:24 -0700 Subject: [PATCH 285/302] machine name for hephestos too --- Marlin/example_configurations/Hephestos/Configuration.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index e399ed899..9dbbc8208 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -64,7 +64,8 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message - +// #define CUSTOM_MACHINE_NAME "This RepRap" + // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) // #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" From 388dd0cfa50b1bffab06cc2ef288e560828d7123 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Apr 2015 04:45:04 -0700 Subject: [PATCH 286/302] Fix doubled lcd_quick_feedback - MENU_ITEM causes lcd_quick_feedback to be called, so only those calls to `lcd_goto_menu` outside of the `MENU_ITEM` macro need to set the `feedback` flag when calling `lcd_goto_menu`. --- Marlin/ultralcd.cpp | 88 +++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 48 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 67801a04d..daf4a30b8 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -248,10 +248,10 @@ menuFunc_t callbackFunc; // place-holders for Ki and Kd edits float raw_Ki, raw_Kd; -static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool feedback=true) { +static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) { if (currentMenu != menu) { currentMenu = menu; - #if defined(NEWPANEL) + #ifdef NEWPANEL encoderPosition = encoder; if (feedback) lcd_quick_feedback(); #endif @@ -296,77 +296,69 @@ static void lcd_status_screen() { #endif #endif //LCD_PROGRESS_BAR - lcd_implementation_status_screen(); + lcd_implementation_status_screen(); -#ifdef ULTIPANEL + #ifdef ULTIPANEL bool current_click = LCD_CLICKED; if (ignore_click) { - if (wait_for_unclick) { - if (!current_click) { - ignore_click = wait_for_unclick = false; - } - else { - current_click = false; - } + if (wait_for_unclick) { + if (!current_click) { + ignore_click = wait_for_unclick = false; } - else if (current_click) { - lcd_quick_feedback(); - wait_for_unclick = true; - current_click = false; + else { + current_click = false; } + } + else if (current_click) { + lcd_quick_feedback(); + wait_for_unclick = true; + current_click = false; + } } - if (current_click) - { - lcd_goto_menu(lcd_main_menu); - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #ifdef LCD_PROGRESS_BAR - currentMenu == lcd_status_screen - #endif - ); - #ifdef FILAMENT_LCD_DISPLAY - message_millis = millis(); // get status message to show up for a while + if (current_click) { + lcd_goto_menu(lcd_main_menu, true); + lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. + #ifdef LCD_PROGRESS_BAR + currentMenu == lcd_status_screen #endif + ); + #ifdef FILAMENT_LCD_DISPLAY + message_millis = millis(); // get status message to show up for a while + #endif } -#ifdef ULTIPANEL_FEEDMULTIPLY - // Dead zone at 100% feedrate - if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) || - (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)) - { + #ifdef ULTIPANEL_FEEDMULTIPLY + // Dead zone at 100% feedrate + if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) || + (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)) { encoderPosition = 0; feedmultiply = 100; - } - - if (feedmultiply == 100 && int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) - { + } + if (feedmultiply == 100 && int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; - } - else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) - { + } + else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) { feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; - } - else if (feedmultiply != 100) - { + } + else if (feedmultiply != 100) { feedmultiply += int(encoderPosition); encoderPosition = 0; - } -#endif //ULTIPANEL_FEEDMULTIPLY + } + #endif // ULTIPANEL_FEEDMULTIPLY - if (feedmultiply < 10) - feedmultiply = 10; - else if (feedmultiply > 999) - feedmultiply = 999; -#endif //ULTIPANEL + feedmultiply = constrain(feedmultiply, 10, 999); + + #endif //ULTIPANEL } #ifdef ULTIPANEL -static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen, 0, false); } +static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } static void lcd_sdcard_pause() { card.pauseSDPrint(); } From 055b11814acc887ca7bfc9430c850695131c74ee Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Apr 2015 04:56:08 -0700 Subject: [PATCH 287/302] Additional cleanup of ultralcd.cpp --- Marlin/ultralcd.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index daf4a30b8..9fef9c12d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -304,12 +304,10 @@ static void lcd_status_screen() { if (ignore_click) { if (wait_for_unclick) { - if (!current_click) { + if (!current_click) ignore_click = wait_for_unclick = false; - } - else { + else current_click = false; - } } else if (current_click) { lcd_quick_feedback(); @@ -337,15 +335,17 @@ static void lcd_status_screen() { encoderPosition = 0; feedmultiply = 100; } - if (feedmultiply == 100 && int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { - feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; - encoderPosition = 0; + if (feedmultiply == 100) { + if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { + feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; + encoderPosition = 0; + } + else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) { + feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; + encoderPosition = 0; + } } - else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) { - feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; - encoderPosition = 0; - } - else if (feedmultiply != 100) { + else { feedmultiply += int(encoderPosition); encoderPosition = 0; } From ac2b23f5743a822e04296b2e7fbbb6d8fd855128 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Apr 2015 20:06:48 -0700 Subject: [PATCH 288/302] Homing fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Prevent `Z_SAFE_HOMING` from homing Z twice in some cases - Allow `G28` with XYZ values of 0 to explicitly set the position - Don’t add `home_offset` when setting XYZ explicitly in `G28` - Add `code_has_value` function to check for the presence of a numeric value (could just test for space or nul to allow other types of values) --- Marlin/Marlin_main.cpp | 159 ++++++++++++++++++++++------------------- 1 file changed, 87 insertions(+), 72 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 37dc7af23..ddf8036de 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -850,6 +850,11 @@ void get_command() } +float code_has_value() { + char c = *(strchr_pointer + 1); + return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.'; +} + float code_value() { float ret; char *e = strchr(strchr_pointer, 'E'); @@ -1814,21 +1819,24 @@ inline void gcode_G28() { home_all_axis = !(homeX || homeY || homeZ) || (homeX && homeY && homeZ); - #if Z_HOME_DIR > 0 // If homing away from BED do Z first + if (home_all_axis || homeZ) { - if (home_all_axis || homeZ) HOMEAXIS(Z); + #if Z_HOME_DIR > 0 // If homing away from BED do Z first - #elif !defined(Z_SAFE_HOMING) && defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 + HOMEAXIS(Z); - // Raise Z before homing any other axes - if (home_all_axis || homeZ) { - destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed + #elif !defined(Z_SAFE_HOMING) && defined(Z_RAISE_BEFORE_HOMING) && Z_RAISE_BEFORE_HOMING > 0 + + // Raise Z before homing any other axes + // (Does this need to be "negative home direction?" Why not just use Z_RAISE_BEFORE_HOMING?) + destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); feedrate = max_feedrate[Z_AXIS] * 60; line_to_destination(); st_synchronize(); - } - #endif + #endif + + } // home_all_axis || homeZ #ifdef QUICK_HOME @@ -1897,97 +1905,104 @@ inline void gcode_G28() { if (home_all_axis || homeY) HOMEAXIS(Y); // Set the X position, if included - // Adds the home_offset as well, which may be wrong - if (code_seen(axis_codes[X_AXIS])) { - float v = code_value(); - if (v) current_position[X_AXIS] = v - #ifndef SCARA - + home_offset[X_AXIS] - #endif - ; - } + if (code_seen(axis_codes[X_AXIS]) && code_has_value()) + current_position[X_AXIS] = code_value(); // Set the Y position, if included - // Adds the home_offset as well, which may be wrong - if (code_seen(axis_codes[Y_AXIS])) { - float v = code_value(); - if (v) current_position[Y_AXIS] = v - #ifndef SCARA - + home_offset[Y_AXIS] - #endif - ; - } + if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) + current_position[Y_AXIS] = code_value(); // Home Z last if homing towards the bed #if Z_HOME_DIR < 0 - #ifndef Z_SAFE_HOMING + if (home_all_axis || homeZ) { - if (home_all_axis || homeZ) HOMEAXIS(Z); + #ifdef Z_SAFE_HOMING - #else // Z_SAFE_HOMING + if (home_all_axis) { - if (home_all_axis) { - destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER); - destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER); - destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = XY_TRAVEL_SPEED; - current_position[Z_AXIS] = 0; + current_position[Z_AXIS] = 0; + sync_plan_position(); - sync_plan_position(); - line_to_destination(); - st_synchronize(); - current_position[X_AXIS] = destination[X_AXIS]; - current_position[Y_AXIS] = destination[Y_AXIS]; + // + // Set the probe (or just the nozzle) destination to the safe homing point + // + // NOTE: If current_position[X_AXIS] or current_position[Y_AXIS] were set above + // then this may not work as expected. + destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER); + destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER); + destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed + feedrate = XY_TRAVEL_SPEED; + // This could potentially move X, Y, Z all together + line_to_destination(); + st_synchronize(); - HOMEAXIS(Z); - } + // Set current X, Y is the Z_SAFE_HOMING_POINT minus PROBE_OFFSET_FROM_EXTRUDER + current_position[X_AXIS] = destination[X_AXIS]; + current_position[Y_AXIS] = destination[Y_AXIS]; - // Let's see if X and Y are homed and probe is inside bed area. - if (homeZ) { + // Home the Z axis + HOMEAXIS(Z); + } - if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { + else if (homeZ) { // Don't need to Home Z twice - float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; - if ( cpx >= X_MIN_POS - X_PROBE_OFFSET_FROM_EXTRUDER - && cpx <= X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER - && cpy >= Y_MIN_POS - Y_PROBE_OFFSET_FROM_EXTRUDER - && cpy <= Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER) { - current_position[Z_AXIS] = 0; - plan_set_position(cpx, cpy, 0, current_position[E_AXIS]); - destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); // Set destination away from bed - feedrate = max_feedrate[Z_AXIS] * 60; // max_feedrate is in mm/s. line_to_destination is feedrate/60. - line_to_destination(); - st_synchronize(); - HOMEAXIS(Z); - } - else { + // Let's see if X and Y are homed + if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { + + // Make sure the probe is within the physical limits + // NOTE: This doesn't necessarily ensure the probe is also within the bed! + float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; + if ( cpx >= X_MIN_POS - X_PROBE_OFFSET_FROM_EXTRUDER + && cpx <= X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER + && cpy >= Y_MIN_POS - Y_PROBE_OFFSET_FROM_EXTRUDER + && cpy <= Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER) { + // Set the plan current position to X, Y, 0 + current_position[Z_AXIS] = 0; + plan_set_position(cpx, cpy, 0, current_position[E_AXIS]); // = sync_plan_position + + // Set Z destination away from bed and raise the axis + // NOTE: This should always just be Z_RAISE_BEFORE_HOMING unless...??? + destination[Z_AXIS] = -Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS); + feedrate = max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s) + line_to_destination(); + st_synchronize(); + + // Home the Z axis + HOMEAXIS(Z); + } + else { LCD_MESSAGEPGM(MSG_ZPROBE_OUT); SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); + } + } + else { + LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); } - } - else { - LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN); - } - } - #endif // Z_SAFE_HOMING + } // !home_all_axes && homeZ + + #else // !Z_SAFE_HOMING + + HOMEAXIS(Z); + + #endif // !Z_SAFE_HOMING + + } // home_all_axis || homeZ #endif // Z_HOME_DIR < 0 // Set the Z position, if included - // Adds the home_offset as well, which may be wrong - if (code_seen(axis_codes[Z_AXIS])) { - float v = code_value(); - if (v) current_position[Z_AXIS] = v + home_offset[Z_AXIS]; - } + if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) + current_position[Z_AXIS] = code_value(); #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0) if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative) #endif + sync_plan_position(); #endif // else DELTA From a37c7ff16d239794e6e53cc30f79f98d4b3cab41 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Sun, 12 Apr 2015 16:56:17 +0200 Subject: [PATCH 289/302] Manual bed leveling menu fixes. lcdDrawUpdate = 2 helped a lot! --- Marlin/ultralcd.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 9fef9c12d..bdd15776d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1797,7 +1797,7 @@ char *ftostr52(const float &x) { if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS; encoderPosition = 0; line_to_current(); - lcdDrawUpdate = 1; + lcdDrawUpdate = 2; } if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS])); static bool debounce_click = false; @@ -1828,7 +1828,7 @@ char *ftostr52(const float &x) { current_position[X_AXIS] = mbl.get_x(ix); current_position[Y_AXIS] = mbl.get_y(iy); line_to_current(); - lcdDrawUpdate = 1; + lcdDrawUpdate = 2; } } } else { @@ -1837,6 +1837,7 @@ char *ftostr52(const float &x) { } static void _lcd_level_bed_homing() { + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), "Homing"); if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) { @@ -1848,6 +1849,7 @@ char *ftostr52(const float &x) { _lcd_level_bed_position = 0; lcd_goto_menu(_lcd_level_bed); } + lcdDrawUpdate = 2; } static void lcd_level_bed() { @@ -1856,6 +1858,7 @@ char *ftostr52(const float &x) { axis_known_position[Z_AXIS] = false; mbl.reset(); enquecommands_P(PSTR("G28")); + lcdDrawUpdate = 2; lcd_goto_menu(_lcd_level_bed_homing); } From 8857b9e921d88e9d8c8bdef3bf9d59e8622b0070 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Apr 2015 16:57:00 -0700 Subject: [PATCH 290/302] Use the extruder argument in plan_buffer_line --- Marlin/planner.cpp | 8 ++++---- Marlin/stepper.cpp | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 77af20325..49c090881 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -504,7 +504,7 @@ float junction_deviation = 0.1; #ifdef PREVENT_DANGEROUS_EXTRUDE if (de) { - if (degHotend(active_extruder) < extrude_min_temp) { + if (degHotend(extruder) < extrude_min_temp) { position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part de = 0; // no difference SERIAL_ECHO_START; @@ -541,8 +541,8 @@ float junction_deviation = 0.1; block->steps[Z_AXIS] = labs(dz); block->steps[E_AXIS] = labs(de); - block->steps[E_AXIS] *= volumetric_multiplier[active_extruder]; - block->steps[E_AXIS] *= extruder_multiply[active_extruder]; + block->steps[E_AXIS] *= volumetric_multiplier[extruder]; + block->steps[E_AXIS] *= extruder_multiply[extruder]; block->steps[E_AXIS] /= 100; block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS]))); @@ -676,7 +676,7 @@ float junction_deviation = 0.1; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; #endif delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; - delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0; + delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiply[extruder] / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index c53d7c0c9..1f28b3af9 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1072,10 +1072,7 @@ void st_init() { TCCR0A &= ~BIT(WGM01); TCCR0A &= ~BIT(WGM00); #endif - e_steps[0] = 0; - e_steps[1] = 0; - e_steps[2] = 0; - e_steps[3] = 0; + e_steps[0] = e_steps[1] = e_steps[2] = e_steps[3] = 0; TIMSK0 |= BIT(OCIE0A); #endif //ADVANCE From 74e4b42f7ece308f4f5ec1313d79b18bfaecc59c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Apr 2015 17:17:41 -0700 Subject: [PATCH 291/302] Default MACHINE_NAME to "3D Printer" --- Marlin/Configuration.h | 2 +- Marlin/configurator/config/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- Marlin/language.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 646dc60ae..f48646ac7 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -70,7 +70,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 57f37756b..2b2175cc4 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -70,7 +70,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 9dbbc8208..02504e283 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -64,7 +64,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 60e2db873..df0614b50 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -64,7 +64,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 65fccb063..1f180a53d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -82,7 +82,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 293aa7716..eaa1a8b9e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -64,7 +64,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index e355a41ea..a01bcb668 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -64,7 +64,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 06cd2ae47..423822a86 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -64,7 +64,7 @@ Here are some standard links for getting your machine calibrated: // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -// #define CUSTOM_MACHINE_NAME "This RepRap" +// #define CUSTOM_MACHINE_NAME "3D Printer" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) diff --git a/Marlin/language.h b/Marlin/language.h index 5d1fd6c2f..179a1b956 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -70,7 +70,7 @@ #endif #else #ifndef MACHINE_NAME - #define MACHINE_NAME "Mendel" + #define MACHINE_NAME "3D Printer" #endif #endif From ccddc280be7d51618ba64dee9e05a4dc782e4463 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Apr 2015 18:07:08 -0700 Subject: [PATCH 292/302] Apply three more commits --- Marlin/Marlin.h | 16 +- Marlin/Marlin_main.cpp | 439 ++++++++---------- Marlin/cardreader.cpp | 10 +- Marlin/cardreader.h | 2 +- Marlin/dogm_lcd_implementation.h | 2 +- .../Hephestos/Configuration.h | 4 +- .../WITBOX/Configuration.h | 4 +- Marlin/planner.cpp | 26 +- Marlin/planner.h | 2 +- Marlin/stepper.cpp | 6 +- Marlin/temperature.cpp | 48 +- Marlin/ultralcd.cpp | 73 +-- Marlin/ultralcd.h | 3 +- .../ultralcd_implementation_hitachi_HD44780.h | 73 ++- 14 files changed, 337 insertions(+), 371 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 40128de99..ad4f82bd1 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -31,6 +31,10 @@ #define TEST(n,b) (((n)&BIT(b))!=0) #define RADIANS(d) ((d)*M_PI/180.0) #define DEGREES(r) ((d)*180.0/M_PI) +#define NOLESS(v,n) do{ if (v < n) v = n; }while(0) +#define NOMORE(v,n) do{ if (v > n) v = n; }while(0) + +typedef unsigned long millis_t; // Arduino < 1.0.0 does not define this, so we need to do it ourselves #ifndef analogInputToDigitalPin @@ -223,14 +227,14 @@ extern bool Running; inline bool IsRunning() { return Running; } inline bool IsStopped() { return !Running; } -bool enquecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full -void enquecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash +bool enqueuecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full +void enqueuecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash void prepare_arc_move(char isclockwise); void clamp_to_software_endstops(float target[3]); -extern unsigned long previous_millis_cmd; -inline void refresh_cmd_timeout() { previous_millis_cmd = millis(); } +extern millis_t previous_cmd_ms; +inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } #ifdef FAST_PWM_FAN void setPwmFrequency(uint8_t pin, int val); @@ -305,8 +309,8 @@ extern int fanSpeed; extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate; #endif -extern unsigned long starttime; -extern unsigned long stoptime; +extern millis_t starttime; +extern millis_t stoptime; // Handling multiple extruders pins extern uint8_t active_extruder; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ddf8036de..94c4c7bd8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -244,11 +244,11 @@ static char *strchr_pointer; ///< A pointer to find chars in the command string const char* queued_commands_P= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42 // Inactivity shutdown -unsigned long previous_millis_cmd = 0; -static unsigned long max_inactive_time = 0; -static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l; -unsigned long starttime = 0; ///< Print job start time -unsigned long stoptime = 0; ///< Print job stop time +millis_t previous_cmd_ms = 0; +static millis_t max_inactive_time = 0; +static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L; +millis_t starttime = 0; ///< Print job start time +millis_t stoptime = 0; ///< Print job stop time static uint8_t target_extruder; bool CooldownNoWait = true; bool target_direction; @@ -425,7 +425,7 @@ static bool drain_queued_commands_P() { char c; while((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command cmd[i] = '\0'; - if (enquecommand(cmd)) { // buffer was not full (else we will retry later) + if (enqueuecommand(cmd)) { // buffer was not full (else we will retry later) if (c) queued_commands_P += i + 1; // move to next command else @@ -437,7 +437,7 @@ static bool drain_queued_commands_P() { //Record one or many commands to run from program memory. //Aborts the current queue, if any. //Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards -void enquecommands_P(const char* pgcode) { +void enqueuecommands_P(const char* pgcode) { queued_commands_P = pgcode; drain_queued_commands_P(); // first command executed asap (when possible) } @@ -446,7 +446,7 @@ void enquecommands_P(const char* pgcode) { //that is really done in a non-safe way. //needs overworking someday //Returns false if it failed to do so -bool enquecommand(const char *cmd) +bool enqueuecommand(const char *cmd) { if(*cmd==';') return false; @@ -666,33 +666,30 @@ void loop() { lcd_update(); } -void get_command() -{ - if (drain_queued_commands_P()) // priority is given to non-serial commands - return; +void get_command() { + + if (drain_queued_commands_P()) return; // priority is given to non-serial commands - while( MYSERIAL.available() > 0 && buflen < BUFSIZE) { + while (MYSERIAL.available() > 0 && buflen < BUFSIZE) { serial_char = MYSERIAL.read(); - if(serial_char == '\n' || - serial_char == '\r' || - serial_count >= (MAX_CMD_SIZE - 1) ) - { + if (serial_char == '\n' || serial_char == '\r' || + serial_count >= (MAX_CMD_SIZE - 1) + ) { // end of line == end of comment comment_mode = false; - if(!serial_count) { - // short cut for empty lines - return; - } - cmdbuffer[bufindw][serial_count] = 0; //terminate string + if (!serial_count) return; // shortcut for empty lines + + cmdbuffer[bufindw][serial_count] = 0; // terminate string + #ifdef SDSUPPORT - fromsd[bufindw] = false; - #endif //!SDSUPPORT - if(strchr(cmdbuffer[bufindw], 'N') != NULL) - { + fromsd[bufindw] = false; + #endif + + if (strchr(cmdbuffer[bufindw], 'N') != NULL) { strchr_pointer = strchr(cmdbuffer[bufindw], 'N'); gcode_N = (strtol(strchr_pointer + 1, NULL, 10)); - if(gcode_N != gcode_LastN+1 && (strstr_P(cmdbuffer[bufindw], PSTR("M110")) == NULL) ) { + if (gcode_N != gcode_LastN + 1 && strstr_P(cmdbuffer[bufindw], PSTR("M110")) == NULL) { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_LINE_NO); SERIAL_ERRORLN(gcode_LastN); @@ -702,14 +699,13 @@ void get_command() return; } - if(strchr(cmdbuffer[bufindw], '*') != NULL) - { + if (strchr(cmdbuffer[bufindw], '*') != NULL) { byte checksum = 0; byte count = 0; - while(cmdbuffer[bufindw][count] != '*') checksum = checksum^cmdbuffer[bufindw][count++]; + while (cmdbuffer[bufindw][count] != '*') checksum ^= cmdbuffer[bufindw][count++]; strchr_pointer = strchr(cmdbuffer[bufindw], '*'); - if(strtol(strchr_pointer + 1, NULL, 10) != checksum) { + if (strtol(strchr_pointer + 1, NULL, 10) != checksum) { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_CHECKSUM_MISMATCH); SERIAL_ERRORLN(gcode_LastN); @@ -719,8 +715,7 @@ void get_command() } //if no errors, continue parsing } - else - { + else { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_NO_CHECKSUM); SERIAL_ERRORLN(gcode_LastN); @@ -732,10 +727,8 @@ void get_command() gcode_LastN = gcode_N; //if no errors, continue parsing } - else // if we don't receive 'N' but still see '*' - { - if((strchr(cmdbuffer[bufindw], '*') != NULL)) - { + else { // if we don't receive 'N' but still see '*' + if ((strchr(cmdbuffer[bufindw], '*') != NULL)) { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM); SERIAL_ERRORLN(gcode_LastN); @@ -743,111 +736,99 @@ void get_command() return; } } - if((strchr(cmdbuffer[bufindw], 'G') != NULL)){ - strchr_pointer = strchr(cmdbuffer[bufindw], 'G'); - switch(strtol(strchr_pointer + 1, NULL, 10)){ - case 0: - case 1: - case 2: - case 3: - if (IsStopped()) { - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - } - break; - default: - break; - } + if (strchr(cmdbuffer[bufindw], 'G') != NULL) { + strchr_pointer = strchr(cmdbuffer[bufindw], 'G'); + switch (strtol(strchr_pointer + 1, NULL, 10)) { + case 0: + case 1: + case 2: + case 3: + if (IsStopped()) { + SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); + LCD_MESSAGEPGM(MSG_STOPPED); + } + break; + default: + break; + } } - //If command was e-stop process now - if(strcmp(cmdbuffer[bufindw], "M112") == 0) - kill(); + // If command was e-stop process now + if (strcmp(cmdbuffer[bufindw], "M112") == 0) kill(); - bufindw = (bufindw + 1)%BUFSIZE; + bufindw = (bufindw + 1) % BUFSIZE; buflen += 1; serial_count = 0; //clear buffer } - else if(serial_char == '\\') { //Handle escapes - - if(MYSERIAL.available() > 0 && buflen < BUFSIZE) { - // if we have one more character, copy it over - serial_char = MYSERIAL.read(); - cmdbuffer[bufindw][serial_count++] = serial_char; - } - - //otherwise do nothing + else if (serial_char == '\\') { // Handle escapes + if (MYSERIAL.available() > 0 && buflen < BUFSIZE) { + // if we have one more character, copy it over + serial_char = MYSERIAL.read(); + cmdbuffer[bufindw][serial_count++] = serial_char; + } + // otherwise do nothing } else { // its not a newline, carriage return or escape char - if(serial_char == ';') comment_mode = true; - if(!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char; + if (serial_char == ';') comment_mode = true; + if (!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char; } } + #ifdef SDSUPPORT - if(!card.sdprinting || serial_count!=0){ - return; - } - //'#' stops reading from SD to the buffer prematurely, so procedural macro calls are possible - // if it occurs, stop_buffering is triggered and the buffer is ran dry. - // this character _can_ occur in serial com, due to checksums. however, no checksums are used in SD printing + if (!card.sdprinting || serial_count) return; - static bool stop_buffering=false; - if(buflen==0) stop_buffering=false; + // '#' stops reading from SD to the buffer prematurely, so procedural macro calls are possible + // if it occurs, stop_buffering is triggered and the buffer is ran dry. + // this character _can_ occur in serial com, due to checksums. however, no checksums are used in SD printing - while( !card.eof() && buflen < BUFSIZE && !stop_buffering) { - int16_t n=card.get(); - serial_char = (char)n; - if(serial_char == '\n' || - serial_char == '\r' || - (serial_char == '#' && comment_mode == false) || - (serial_char == ':' && comment_mode == false) || - serial_count >= (MAX_CMD_SIZE - 1)||n==-1) - { - if(card.eof()){ - SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); - stoptime=millis(); - char time[30]; - unsigned long t=(stoptime-starttime)/1000; - int hours, minutes; - minutes=(t/60)%60; - hours=t/60/60; - sprintf_P(time, PSTR("%i "MSG_END_HOUR" %i "MSG_END_MINUTE),hours, minutes); - SERIAL_ECHO_START; - SERIAL_ECHOLN(time); - lcd_setstatus(time, true); - card.printingHasFinished(); - card.checkautostart(true); + static bool stop_buffering = false; + if (buflen == 0) stop_buffering = false; - } - if(serial_char=='#') - stop_buffering=true; + while (!card.eof() && buflen < BUFSIZE && !stop_buffering) { + int16_t n = card.get(); + serial_char = (char)n; + if (serial_char == '\n' || serial_char == '\r' || + ((serial_char == '#' || serial_char == ':') && !comment_mode) || + serial_count >= (MAX_CMD_SIZE - 1) || n == -1 + ) { + if (card.eof()) { + SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); + stoptime = millis(); + char time[30]; + millis_t t = (stoptime - starttime) / 1000; + int hours = t / 60 / 60, minutes = (t / 60) % 60; + sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), hours, minutes); + SERIAL_ECHO_START; + SERIAL_ECHOLN(time); + lcd_setstatus(time, true); + card.printingHasFinished(); + card.checkautostart(true); + } + if (serial_char == '#') stop_buffering = true; - if(!serial_count) - { - comment_mode = false; //for new command - return; //if empty line - } - cmdbuffer[bufindw][serial_count] = 0; //terminate string -// if(!comment_mode){ + if (!serial_count) { + comment_mode = false; //for new command + return; //if empty line + } + cmdbuffer[bufindw][serial_count] = 0; //terminate string + // if (!comment_mode) { fromsd[bufindw] = true; buflen += 1; bufindw = (bufindw + 1)%BUFSIZE; -// } - comment_mode = false; //for new command - serial_count = 0; //clear buffer + // } + comment_mode = false; //for new command + serial_count = 0; //clear buffer + } + else { + if (serial_char == ';') comment_mode = true; + if (!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char; + } } - else - { - if(serial_char == ';') comment_mode = true; - if(!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char; - } - } - - #endif //SDSUPPORT + #endif // SDSUPPORT } float code_has_value() { @@ -923,7 +904,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1 static bool active_extruder_parked = false; // used in mode 1 & 2 static float raised_parked_position[NUM_AXIS]; // used in mode 1 - static unsigned long delayed_move_time = 0; // used in mode 1 + static millis_t delayed_move_time = 0; // used in mode 1 static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 static float duplicate_extruder_temp_offset = 0; // used in mode 2 bool extruder_duplication_enabled = false; // used in mode 2 @@ -1111,7 +1092,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, // move down slowly until you find the bed feedrate = homing_feedrate[Z_AXIS] / 4; destination[Z_AXIS] = -10; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination st_synchronize(); endstops_hit_on_purpose(); // clear endstop hit flags @@ -1157,7 +1138,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position, } /** - * + * Plan a move to (X, Y, Z) and set the current_position + * The final current_position may not be the one that was requested */ static void do_blocking_move_to(float x, float y, float z) { float oldFeedRate = feedrate; @@ -1169,7 +1151,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, destination[X_AXIS] = x; destination[Y_AXIS] = y; destination[Z_AXIS] = z; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination st_synchronize(); #else @@ -1233,17 +1215,17 @@ inline void set_destination_to_current() { memcpy(destination, current_position, destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination // Home X to touch the belt feedrate = homing_feedrate[X_AXIS]/10; destination[X_AXIS] = 0; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination // Home Y for safety feedrate = homing_feedrate[X_AXIS]/2; destination[Y_AXIS] = 0; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination st_synchronize(); @@ -1275,7 +1257,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, if (servo_endstops[Z_AXIS] >= 0) { #if Z_RAISE_AFTER_PROBING > 0 - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // this also updates current_position st_synchronize(); #endif @@ -1296,29 +1278,29 @@ inline void set_destination_to_current() { memcpy(destination, current_position, // Move up for safety feedrate = homing_feedrate[X_AXIS]; destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination // Move to the start position to initiate retraction destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Z; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination // Move the nozzle down to push the probe into retracted position feedrate = homing_feedrate[Z_AXIS]/10; destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_STOW_DEPTH; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination // Move up for safety feedrate = homing_feedrate[Z_AXIS]/2; destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_STOW_DEPTH * 2; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination // Home XY for safety feedrate = homing_feedrate[X_AXIS]/2; destination[X_AXIS] = 0; destination[Y_AXIS] = 0; - prepare_move_raw(); + prepare_move_raw(); // this will also set_current_to_destination st_synchronize(); @@ -1352,8 +1334,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position, // Probe bed height at position (x,y), returns the measured z value static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeDeployAndStow, int verbose_level=1) { // move to right place - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); - do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); // this also updates current_position + do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); // this also updates current_position #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY) if (retract_action & ProbeDeploy) deploy_z_probe(); @@ -1364,7 +1346,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #if Z_RAISE_BETWEEN_PROBINGS > 0 if (retract_action == ProbeStay) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); // this also updates current_position st_synchronize(); } #endif @@ -1643,12 +1625,12 @@ static void homeaxis(AxisEnum axis) { } if (dock) { - do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], current_position[Z_AXIS]); + do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], current_position[Z_AXIS]); // this also updates current_position digitalWrite(SERVO0_PIN, LOW); // turn off magnet } else { float z_loc = current_position[Z_AXIS]; if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING; - do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, Y_PROBE_OFFSET_FROM_EXTRUDER, z_loc); + do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, Y_PROBE_OFFSET_FROM_EXTRUDER, z_loc); // this also updates current_position digitalWrite(SERVO0_PIN, HIGH); // turn on magnet } } @@ -1700,7 +1682,7 @@ inline void gcode_G2_G3(bool clockwise) { * G4: Dwell S or P */ inline void gcode_G4() { - unsigned long codenum = 0; + millis_t codenum = 0; LCD_MESSAGEPGM(MSG_DWELL); @@ -1709,7 +1691,7 @@ inline void gcode_G4() { st_synchronize(); refresh_cmd_timeout(); - codenum += previous_millis_cmd; // keep track of when we started waiting + codenum += previous_cmd_ms; // keep track of when we started waiting while (millis() < codenum) { manage_heater(); manage_inactivity(); @@ -2096,7 +2078,7 @@ inline void gcode_G28() { case MeshStart: mbl.reset(); probe_point = 0; - enquecommands_P(PSTR("G28\nG29 S2")); + enqueuecommands_P(PSTR("G28\nG29 S2")); break; case MeshNext: @@ -2135,7 +2117,7 @@ inline void gcode_G28() { SERIAL_PROTOCOLLNPGM("Mesh probing done."); probe_point = -1; mbl.active = 1; - enquecommands_P(PSTR("G28")); + enqueuecommands_P(PSTR("G28")); } break; @@ -2517,7 +2499,7 @@ inline void gcode_G28() { #endif #ifdef Z_PROBE_END_SCRIPT - enquecommands_P(PSTR(Z_PROBE_END_SCRIPT)); + enqueuecommands_P(PSTR(Z_PROBE_END_SCRIPT)); st_synchronize(); #endif } @@ -2579,7 +2561,7 @@ inline void gcode_G92() { inline void gcode_M0_M1() { char *src = strchr_pointer + 2; - unsigned long codenum = 0; + millis_t codenum = 0; bool hasP = false, hasS = false; if (code_seen('P')) { codenum = code_value_short(); // milliseconds to wait @@ -2605,7 +2587,7 @@ inline void gcode_G92() { st_synchronize(); refresh_cmd_timeout(); if (codenum > 0) { - codenum += previous_millis_cmd; // keep track of when we started waiting + codenum += previous_cmd_ms; // keep track of when we started waiting while(millis() < codenum && !lcd_clicked()) { manage_heater(); manage_inactivity(); @@ -2747,7 +2729,7 @@ inline void gcode_M17() { */ inline void gcode_M31() { stoptime = millis(); - unsigned long t = (stoptime - starttime) / 1000; + millis_t t = (stoptime - starttime) / 1000; int min = t / 60, sec = t % 60; char time[30]; sprintf_P(time, PSTR("%i min, %i sec"), min, sec); @@ -2980,11 +2962,11 @@ inline void gcode_M42() { if (deploy_probe_for_each_reading) stow_z_probe(); for (uint8_t n=0; n < n_samples; n++) { - - do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // Make sure we are at the probe location + // Make sure we are at the probe location + do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // this also updates current_position if (n_legs) { - unsigned long ms = millis(); + millis_t ms = millis(); double radius = ms % (X_MAX_LENGTH / 4), // limit how far out to go theta = RADIANS(ms % 360L); float dir = (ms & 0x0001) ? 1 : -1; // clockwise or counter clockwise @@ -3011,11 +2993,12 @@ inline void gcode_M42() { SERIAL_EOL; } - do_blocking_move_to(X_current, Y_current, Z_current); + do_blocking_move_to(X_current, Y_current, Z_current); // this also updates current_position } // n_legs loop - do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // Go back to the probe location + // Go back to the probe location + do_blocking_move_to(X_probe_location, Y_probe_location, Z_start_location); // this also updates current_position } // n_legs @@ -3221,7 +3204,7 @@ inline void gcode_M109() { setWatch(); - unsigned long timetemp = millis(); + millis_t temp_ms = millis(); /* See if we are heating up or cooling down */ target_direction = isHeatingHotend(target_extruder); // true if heating, false if cooling @@ -3229,26 +3212,26 @@ inline void gcode_M109() { cancel_heatup = false; #ifdef TEMP_RESIDENCY_TIME - long residencyStart = -1; + long residency_start_ms = -1; /* continue to loop until we have reached the target temp _and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */ - while((!cancel_heatup)&&((residencyStart == -1) || - (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) + while((!cancel_heatup)&&((residency_start_ms == -1) || + (residency_start_ms >= 0 && (((unsigned int) (millis() - residency_start_ms)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) #else while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(CooldownNoWait==false)) ) #endif //TEMP_RESIDENCY_TIME { // while loop - if (millis() > timetemp + 1000UL) { //Print temp & remaining time every 1s while waiting + if (millis() > temp_ms + 1000UL) { //Print temp & remaining time every 1s while waiting SERIAL_PROTOCOLPGM("T:"); SERIAL_PROTOCOL_F(degHotend(target_extruder),1); SERIAL_PROTOCOLPGM(" E:"); SERIAL_PROTOCOL((int)target_extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); - if (residencyStart > -1) { - timetemp = ((TEMP_RESIDENCY_TIME * 1000UL) - (millis() - residencyStart)) / 1000UL; - SERIAL_PROTOCOLLN( timetemp ); + if (residency_start_ms > -1) { + temp_ms = ((TEMP_RESIDENCY_TIME * 1000UL) - (millis() - residency_start_ms)) / 1000UL; + SERIAL_PROTOCOLLN(temp_ms); } else { SERIAL_PROTOCOLLNPGM("?"); @@ -3256,7 +3239,7 @@ inline void gcode_M109() { #else SERIAL_EOL; #endif - timetemp = millis(); + temp_ms = millis(); } manage_heater(); manage_inactivity(); @@ -3264,18 +3247,18 @@ inline void gcode_M109() { #ifdef TEMP_RESIDENCY_TIME // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time // or when current temp falls outside the hysteresis after target temp was reached - if ((residencyStart == -1 && target_direction && (degHotend(target_extruder) >= (degTargetHotend(target_extruder)-TEMP_WINDOW))) || - (residencyStart == -1 && !target_direction && (degHotend(target_extruder) <= (degTargetHotend(target_extruder)+TEMP_WINDOW))) || - (residencyStart > -1 && labs(degHotend(target_extruder) - degTargetHotend(target_extruder)) > TEMP_HYSTERESIS) ) + if ((residency_start_ms == -1 && target_direction && (degHotend(target_extruder) >= (degTargetHotend(target_extruder)-TEMP_WINDOW))) || + (residency_start_ms == -1 && !target_direction && (degHotend(target_extruder) <= (degTargetHotend(target_extruder)+TEMP_WINDOW))) || + (residency_start_ms > -1 && labs(degHotend(target_extruder) - degTargetHotend(target_extruder)) > TEMP_HYSTERESIS) ) { - residencyStart = millis(); + residency_start_ms = millis(); } #endif //TEMP_RESIDENCY_TIME } LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); refresh_cmd_timeout(); - starttime = previous_millis_cmd; + starttime = previous_cmd_ms; } #if HAS_TEMP_BED @@ -3290,15 +3273,15 @@ inline void gcode_M109() { if (CooldownNoWait || code_seen('R')) setTargetBed(code_value()); - unsigned long timetemp = millis(); + millis_t temp_ms = millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (target_direction)&&(!cancel_heatup) ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) ) { - unsigned long ms = millis(); - if (ms > timetemp + 1000UL) { //Print Temp Reading every 1 second while heating up. - timetemp = ms; + millis_t ms = millis(); + if (ms > temp_ms + 1000UL) { //Print Temp Reading every 1 second while heating up. + temp_ms = ms; float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); SERIAL_PROTOCOL(tt); @@ -3974,14 +3957,14 @@ inline void gcode_M226() { #endif // NUM_SERVOS > 0 -#if defined(LARGE_FLASH) && (BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)) +#if BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER) /** * M300: Play beep sound S P */ inline void gcode_M300() { - int beepS = code_seen('S') ? code_value() : 110; - int beepP = code_seen('P') ? code_value() : 1000; + uint16_t beepS = code_seen('S') ? code_value_short() : 110; + uint32_t beepP = code_seen('P') ? code_value_long() : 1000; if (beepS > 0) { #if BEEPER > 0 tone(BEEPER, beepS); @@ -3998,7 +3981,7 @@ inline void gcode_M226() { } } -#endif // LARGE_FLASH && (BEEPER>0 || ULTRALCD || LCD_USE_I2C_BUZZER) +#endif // BEEPER>0 || ULTRALCD || LCD_USE_I2C_BUZZER #ifdef PIDTEMP @@ -4472,24 +4455,10 @@ inline void gcode_M503() { LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE); uint8_t cnt = 0; while (!lcd_clicked()) { - cnt++; + if (++cnt == 0) lcd_quick_feedback(); // every 256th frame till the lcd is clicked manage_heater(); manage_inactivity(true); lcd_update(); - if (cnt == 0) { - #if BEEPER > 0 - OUT_WRITE(BEEPER,HIGH); - delay(3); - WRITE(BEEPER,LOW); - delay(3); - #else - #if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) - lcd_buzz(1000/6, 100); - #else - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #endif - #endif - } } // while(!lcd_clicked) //return to normal @@ -5078,11 +5047,11 @@ void process_commands() { break; #endif // NUM_SERVOS > 0 - #if defined(LARGE_FLASH) && (BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)) + #if BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER) case 300: // M300 - Play beep tone gcode_M300(); break; - #endif // LARGE_FLASH && (BEEPER>0 || ULTRALCD || LCD_USE_I2C_BUZZER) + #endif // BEEPER > 0 || ULTRALCD || LCD_USE_I2C_BUZZER #ifdef PIDTEMP case 301: // M301 @@ -5289,25 +5258,23 @@ void get_arc_coordinates() { offset[1] = code_seen('J') ? code_value() : 0; } -void clamp_to_software_endstops(float target[3]) -{ +void clamp_to_software_endstops(float target[3]) { if (min_software_endstops) { - if (target[X_AXIS] < min_pos[X_AXIS]) target[X_AXIS] = min_pos[X_AXIS]; - if (target[Y_AXIS] < min_pos[Y_AXIS]) target[Y_AXIS] = min_pos[Y_AXIS]; + NOLESS(target[X_AXIS], min_pos[X_AXIS]); + NOLESS(target[Y_AXIS], min_pos[Y_AXIS]); float negative_z_offset = 0; #ifdef ENABLE_AUTO_BED_LEVELING - if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER; - if (home_offset[Z_AXIS] < 0) negative_z_offset = negative_z_offset + home_offset[Z_AXIS]; + if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset += Z_PROBE_OFFSET_FROM_EXTRUDER; + if (home_offset[Z_AXIS] < 0) negative_z_offset += home_offset[Z_AXIS]; #endif - - if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset; + NOLESS(target[Z_AXIS], min_pos[Z_AXIS] + negative_z_offset); } if (max_software_endstops) { - if (target[X_AXIS] > max_pos[X_AXIS]) target[X_AXIS] = max_pos[X_AXIS]; - if (target[Y_AXIS] > max_pos[Y_AXIS]) target[Y_AXIS] = max_pos[Y_AXIS]; - if (target[Z_AXIS] > max_pos[Z_AXIS]) target[Z_AXIS] = max_pos[Z_AXIS]; + NOMORE(target[X_AXIS], max_pos[X_AXIS]); + NOMORE(target[Y_AXIS], max_pos[Y_AXIS]); + NOMORE(target[Z_AXIS], max_pos[Z_AXIS]); } } @@ -5522,7 +5489,7 @@ void prepare_move() { //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate/60*feedmultiply/100.0, active_extruder); } #endif // SCARA @@ -5549,7 +5516,7 @@ void prepare_move() { #ifdef ENABLE_AUTO_BED_LEVELING adjust_delta(destination); #endif - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate/60*feedmultiply/100.0, active_extruder); } #endif // DELTA @@ -5573,7 +5540,7 @@ void prepare_move() { // (so it can be used as the start of the next non-travel move) if (delayed_move_time != 0xFFFFFFFFUL) { set_current_to_destination(); - if (destination[Z_AXIS] > raised_parked_position[Z_AXIS]) raised_parked_position[Z_AXIS] = destination[Z_AXIS]; + NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]); delayed_move_time = millis(); return; } @@ -5621,11 +5588,11 @@ void prepare_arc_move(char isclockwise) { #if HAS_CONTROLLERFAN -unsigned long lastMotor = 0; // Last time a motor was turned on -unsigned long lastMotorCheck = 0; // Last time the state was checked +millis_t lastMotor = 0; // Last time a motor was turned on +millis_t lastMotorCheck = 0; // Last time the state was checked void controllerFan() { - uint32_t ms = millis(); + millis_t ms = millis(); if (ms >= lastMotorCheck + 2500) { // Not a time critical function, so we only check every 2500ms lastMotorCheck = ms; if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON || soft_pwm_bed > 0 @@ -5732,36 +5699,28 @@ void calculate_delta(float cartesian[3]){ #endif #ifdef TEMP_STAT_LEDS -static bool blue_led = false; -static bool red_led = false; -static uint32_t stat_update = 0; -void handle_status_leds(void) { - float max_temp = 0.0; - if(millis() > stat_update) { - stat_update += 500; // Update every 0.5s - for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { - max_temp = max(max_temp, degHotend(cur_extruder)); - max_temp = max(max_temp, degTargetHotend(cur_extruder)); - } - #if HAS_TEMP_BED - max_temp = max(max_temp, degTargetBed()); - max_temp = max(max_temp, degBed()); - #endif - if((max_temp > 55.0) && (red_led == false)) { - digitalWrite(STAT_LED_RED, 1); - digitalWrite(STAT_LED_BLUE, 0); - red_led = true; - blue_led = false; - } - if((max_temp < 54.0) && (blue_led == false)) { - digitalWrite(STAT_LED_RED, 0); - digitalWrite(STAT_LED_BLUE, 1); - red_led = false; - blue_led = true; + static bool red_led = false; + static millis_t next_status_led_update_ms = 0; + + void handle_status_leds(void) { + float max_temp = 0.0; + if (millis() > next_status_led_update_ms) { + next_status_led_update_ms += 500; // Update every 0.5s + for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) + max_temp = max(max(max_temp, degHotend(cur_extruder)), degTargetHotend(cur_extruder)); + #if HAS_TEMP_BED + max_temp = max(max(max_temp, degTargetBed()), degBed()); + #endif + bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led; + if (new_led != red_led) { + red_led = new_led; + digitalWrite(STAT_LED_RED, new_led ? HIGH : LOW); + digitalWrite(STAT_LED_BLUE, new_led ? LOW : HIGH); + } } } -} + #endif void enable_all_steppers() { @@ -5805,11 +5764,11 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { if (buflen < BUFSIZE - 1) get_command(); - unsigned long ms = millis(); + millis_t ms = millis(); - if (max_inactive_time && ms > previous_millis_cmd + max_inactive_time) kill(); + if (max_inactive_time && ms > previous_cmd_ms + max_inactive_time) kill(); - if (stepper_inactive_time && ms > previous_millis_cmd + stepper_inactive_time + if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time && !ignore_stepper_queue && !blocks_queued()) disable_all_steppers(); @@ -5845,7 +5804,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { const int HOME_DEBOUNCE_DELAY = 750; if (!READ(HOME_PIN)) { if (!homeDebounceCount) { - enquecommands_P(PSTR("G28")); + enqueuecommands_P(PSTR("G28")); LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME); } if (homeDebounceCount < HOME_DEBOUNCE_DELAY) @@ -5860,7 +5819,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif #ifdef EXTRUDER_RUNOUT_PREVENT - if (ms > previous_millis_cmd + EXTRUDER_RUNOUT_SECONDS * 1000) + if (ms > previous_cmd_ms + EXTRUDER_RUNOUT_SECONDS * 1000) if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { bool oldstatus; switch(active_extruder) { @@ -5894,7 +5853,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { current_position[E_AXIS] = oldepos; destination[E_AXIS] = oldedes; plan_set_e_position(oldepos); - previous_millis_cmd = ms; // refresh_cmd_timeout() + previous_cmd_ms = ms; // refresh_cmd_timeout() st_synchronize(); switch(active_extruder) { case 0: @@ -5964,7 +5923,7 @@ void kill() { if filrunoutEnqued == false { filrunoutEnqued = true; - enquecommand("M600"); + enqueuecommand("M600"); } } #endif diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 877b72b92..639b4f244 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -25,7 +25,7 @@ CardReader::CardReader() { OUT_WRITE(SDPOWER, HIGH); #endif //SDPOWER - autostart_atmillis = millis() + 5000; + next_autostart_ms = millis() + 5000; } char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters @@ -397,7 +397,7 @@ void CardReader::write_command(char *buf) { } void CardReader::checkautostart(bool force) { - if (!force && (!autostart_stilltocheck || autostart_atmillis < millis())) + if (!force && (!autostart_stilltocheck || next_autostart_ms < millis())) return; autostart_stilltocheck = false; @@ -421,8 +421,8 @@ void CardReader::checkautostart(bool force) { if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { char cmd[30]; sprintf_P(cmd, PSTR("M23 %s"), autoname); - enquecommand(cmd); - enquecommands_P(PSTR("M24")); + enqueuecommand(cmd); + enqueuecommands_P(PSTR("M24")); found = true; } } @@ -508,7 +508,7 @@ void CardReader::printingHasFinished() { sdprinting = false; if (SD_FINISHED_STEPPERRELEASE) { //finishAndDisableSteppers(); - enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + enqueuecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); } autotempShutdown(); } diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h index b55d09a65..03d4303e3 100644 --- a/Marlin/cardreader.h +++ b/Marlin/cardreader.h @@ -62,7 +62,7 @@ private: uint32_t filespos[SD_PROCEDURE_DEPTH]; char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; uint32_t filesize; - unsigned long autostart_atmillis; + millis_t next_autostart_ms; uint32_t sdpos; bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware. diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index fd52d645e..546703bfb 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -350,7 +350,7 @@ static void lcd_implementation_status_screen() { #ifndef FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); #else - if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line + if (millis() < previous_lcd_status_ms + 5000) { //Display both Status message line and Filament display on the last line lcd_print(lcd_status_message); } else { diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 02504e283..a83c6e911 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -58,9 +58,7 @@ Here are some standard links for getting your machine calibrated: // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup -#ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_HEPHESTOS -#endif +#define MOTHERBOARD BOARD_HEPHESTOS // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index eaa1a8b9e..dda21b775 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -58,9 +58,7 @@ Here are some standard links for getting your machine calibrated: // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup -#ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_WITBOX -#endif +#define MOTHERBOARD BOARD_WITBOX // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 49c090881..a452428d7 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -60,13 +60,13 @@ #ifdef MESH_BED_LEVELING #include "mesh_bed_leveling.h" -#endif // MESH_BED_LEVELING +#endif //=========================================================================== //============================= public variables ============================ //=========================================================================== -unsigned long minsegmenttime; +millis_t minsegmenttime; float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute float axis_steps_per_unit[NUM_AXIS]; unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software @@ -159,8 +159,8 @@ void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exi unsigned long final_rate = ceil(block->nominal_rate * exit_factor); // (step/min) // Limit minimal step rate (Otherwise the timer will overflow.) - if (initial_rate < 120) initial_rate = 120; - if (final_rate < 120) final_rate = 120; + NOLESS(initial_rate, 120); + NOLESS(final_rate, 120); long acceleration = block->acceleration_st; int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, acceleration)); @@ -382,9 +382,11 @@ void plan_init() { } float t = autotemp_min + high * autotemp_factor; - if (t < autotemp_min) t = autotemp_min; - if (t > autotemp_max) t = autotemp_max; - if (oldt > t) t = AUTOTEMP_OLDWEIGHT * oldt + (1 - AUTOTEMP_OLDWEIGHT) * t; + t = constrain(t, autotemp_min, autotemp_max); + if (oldt > t) { + t *= (1 - AUTOTEMP_OLDWEIGHT); + t += AUTOTEMP_OLDWEIGHT * oldt; + } oldt = t; setTargetHotend0(t); } @@ -426,7 +428,7 @@ void check_axes_activity() { #if HAS_FAN #ifdef FAN_KICKSTART_TIME - static unsigned long fan_kick_end; + static millis_t fan_kick_end; if (tail_fan_speed) { if (fan_kick_end == 0) { // Just starting up fan - run at full power. @@ -651,10 +653,10 @@ float junction_deviation = 0.1; } } - if (block->steps[E_AXIS]) { - if (feed_rate < minimumfeedrate) feed_rate = minimumfeedrate; - } - else if (feed_rate < mintravelfeedrate) feed_rate = mintravelfeedrate; + if (block->steps[E_AXIS]) + NOLESS(feed_rate, minimumfeedrate); + else + NOLESS(feed_rate, mintravelfeedrate); /** * This part of the code calculates the total length of the movement. diff --git a/Marlin/planner.h b/Marlin/planner.h index c617d6d48..d96aa8c11 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -115,7 +115,7 @@ FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block void plan_set_e_position(const float &e); -extern unsigned long minsegmenttime; +extern millis_t minsegmenttime; extern float max_feedrate[NUM_AXIS]; // set the max speeds extern float axis_steps_per_unit[NUM_AXIS]; extern unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 1f28b3af9..2ad555327 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -400,7 +400,7 @@ ISR(TIMER1_COMPA_vect) { current_block = NULL; plan_discard_current_block(); #ifdef SD_FINISHED_RELEASECOMMAND - if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enqueuecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); #endif cleaning_buffer_counter--; OCR1A = 200; @@ -718,7 +718,7 @@ ISR(TIMER1_COMPA_vect) { // Calculate new timer value unsigned short timer; unsigned short step_rate; - if (step_events_completed <= (unsigned long int)current_block->accelerate_until) { + if (step_events_completed <= (unsigned long)current_block->accelerate_until) { MultiU24X24toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate); acc_step_rate += current_block->initial_rate; @@ -742,7 +742,7 @@ ISR(TIMER1_COMPA_vect) { #endif } - else if (step_events_completed > (unsigned long int)current_block->decelerate_after) { + else if (step_events_completed > (unsigned long)current_block->decelerate_after) { MultiU24X24toH16(step_rate, deceleration_time, current_block->acceleration_rate); if (step_rate > acc_step_rate) { // Check step_rate stays positive diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index b4dffbfe1..f494edecf 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -77,14 +77,14 @@ unsigned char soft_pwm_bed; #define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0) #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway }; - void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); + void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); #if HAS_HEATER_THERMAL_PROTECTION static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset }; - static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; + static millis_t thermal_runaway_timer[4]; // = {0,0,0,0}; #endif #if HAS_BED_THERMAL_PROTECTION static TRState thermal_runaway_bed_state_machine = TRReset; - static unsigned long thermal_runaway_bed_timer; + static millis_t thermal_runaway_bed_timer; #endif #endif @@ -118,7 +118,7 @@ static volatile bool temp_meas_ready = false; static float temp_iState_min_bed; static float temp_iState_max_bed; #else //PIDTEMPBED - static unsigned long previous_millis_bed_heater; + static millis_t previous_bed_check_ms; #endif //PIDTEMPBED static unsigned char soft_pwm[EXTRUDERS]; @@ -126,7 +126,7 @@ static volatile bool temp_meas_ready = false; static unsigned char soft_pwm_fan; #endif #if HAS_AUTO_FAN - static unsigned long extruder_autofan_last_check; + static millis_t previous_auto_fan_check_ms; #endif #ifdef PIDTEMP @@ -171,7 +171,7 @@ static void updateTemperaturesFromRawValues(); #ifdef WATCH_TEMP_PERIOD int watch_start_temp[EXTRUDERS] = { 0 }; - unsigned long watchmillis[EXTRUDERS] = { 0 }; + millis_t watchmillis[EXTRUDERS] = { 0 }; #endif //WATCH_TEMP_PERIOD #ifndef SOFT_PWM_SCALE @@ -196,7 +196,7 @@ void PID_autotune(float temp, int extruder, int ncycles) int cycles = 0; bool heating = true; - unsigned long temp_millis = millis(), t1 = temp_millis, t2 = temp_millis; + millis_t temp_ms = millis(), t1 = temp_ms, t2 = temp_ms; long t_high = 0, t_low = 0; long bias, d; @@ -205,7 +205,7 @@ void PID_autotune(float temp, int extruder, int ncycles) float max = 0, min = 10000; #if HAS_AUTO_FAN - unsigned long extruder_autofan_last_check = temp_millis; + millis_t previous_auto_fan_check_ms = temp_ms; #endif if (extruder >= EXTRUDERS @@ -229,7 +229,7 @@ void PID_autotune(float temp, int extruder, int ncycles) // PID Tuning loop for (;;) { - unsigned long ms = millis(); + millis_t ms = millis(); if (temp_meas_ready) { // temp sample ready updateTemperaturesFromRawValues(); @@ -240,9 +240,9 @@ void PID_autotune(float temp, int extruder, int ncycles) min = min(min, input); #if HAS_AUTO_FAN - if (ms > extruder_autofan_last_check + 2500) { + if (ms > previous_auto_fan_check_ms + 2500) { checkExtruderAutoFans(); - extruder_autofan_last_check = ms; + previous_auto_fan_check_ms = ms; } #endif @@ -317,7 +317,7 @@ void PID_autotune(float temp, int extruder, int ncycles) return; } // Every 2 seconds... - if (ms > temp_millis + 2000) { + if (ms > temp_ms + 2000) { int p; if (extruder < 0) { p = soft_pwm_bed; @@ -332,7 +332,7 @@ void PID_autotune(float temp, int extruder, int ncycles) SERIAL_PROTOCOLPGM(MSG_AT); SERIAL_PROTOCOLLN(p); - temp_millis = ms; + temp_ms = ms; } // every 2 seconds // Over 2 minutes? if (((ms - t1) + (ms - t2)) > (10L*60L*1000L*2L)) { @@ -592,7 +592,7 @@ void manage_heater() { #endif //HEATER_0_USES_MAX6675 #if defined(WATCH_TEMP_PERIOD) || !defined(PIDTEMPBED) || HAS_AUTO_FAN - unsigned long ms = millis(); + millis_t ms = millis(); #endif // Loop through all extruders @@ -631,15 +631,15 @@ void manage_heater() { } // Extruders Loop #if HAS_AUTO_FAN - if (ms > extruder_autofan_last_check + 2500) { // only need to check fan state very infrequently + if (ms > previous_auto_fan_check_ms + 2500) { // only need to check fan state very infrequently checkExtruderAutoFans(); - extruder_autofan_last_check = ms; + previous_auto_fan_check_ms = ms; } #endif #ifndef PIDTEMPBED - if (ms < previous_millis_bed_heater + BED_CHECK_INTERVAL) return; - previous_millis_bed_heater = ms; + if (ms < previous_bed_check_ms + BED_CHECK_INTERVAL) return; + previous_bed_check_ms = ms; #endif //PIDTEMPBED #if TEMP_SENSOR_BED != 0 @@ -992,7 +992,7 @@ void tp_init() void setWatch() { #ifdef WATCH_TEMP_PERIOD - unsigned long ms = millis(); + millis_t ms = millis(); for (int e = 0; e < EXTRUDERS; e++) { if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) { watch_start_temp[e] = degHotend(e); @@ -1004,7 +1004,7 @@ void setWatch() { #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION - void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { + void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { static float tr_target_temperature[EXTRUDERS+1] = { 0.0 }; @@ -1109,16 +1109,16 @@ void disable_heater() { #ifdef HEATER_0_USES_MAX6675 #define MAX6675_HEAT_INTERVAL 250u - unsigned long max6675_previous_millis = MAX6675_HEAT_INTERVAL; + millis_t previous_max6675_ms = MAX6675_HEAT_INTERVAL; int max6675_temp = 2000; static int read_max6675() { - unsigned long ms = millis(); - if (ms < max6675_previous_millis + MAX6675_HEAT_INTERVAL) + millis_t ms = millis(); + if (ms < previous_max6675_ms + MAX6675_HEAT_INTERVAL) return max6675_temp; - max6675_previous_millis = ms; + previous_max6675_ms = ms; max6675_temp = 0; #ifdef PRR diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 9fef9c12d..293f819c9 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -22,7 +22,7 @@ int absPreheatHPBTemp; int absPreheatFanSpeed; #ifdef FILAMENT_LCD_DISPLAY - unsigned long message_millis = 0; + millis_t previous_lcd_status_ms = 0; #endif /* !Configuration settings */ @@ -77,8 +77,6 @@ static void lcd_status_screen(); static void lcd_level_bed(); #endif - static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visual or audible feedback that something has happened - /* Different types of actions that can be used in menu items. */ static void menu_action_back(menuFunc_t data); static void menu_action_submenu(menuFunc_t data); @@ -220,7 +218,7 @@ static void lcd_status_screen(); volatile uint8_t slow_buttons; // Bits of the pressed buttons. #endif uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ - uint32_t blocking_enc; + millis_t next_button_update_ms; uint8_t lastEncoderBits; uint32_t encoderPosition; #if (SDCARDDETECT > 0) @@ -230,7 +228,7 @@ static void lcd_status_screen(); #endif // ULTIPANEL menuFunc_t currentMenu = lcd_status_screen; /* function pointer to the currently active menu */ -uint32_t lcd_next_update_millis; +millis_t next_lcd_update_ms; uint8_t lcd_status_update_delay; bool ignore_click = false; bool wait_for_unclick; @@ -267,7 +265,7 @@ static void lcd_status_screen() { encoderRateMultiplierEnabled = false; #ifdef LCD_PROGRESS_BAR - unsigned long ms = millis(); + millis_t ms = millis(); #ifndef PROGRESS_MSG_ONCE if (ms > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { progressBarTick = ms; @@ -324,7 +322,7 @@ static void lcd_status_screen() { #endif ); #ifdef FILAMENT_LCD_DISPLAY - message_millis = millis(); // get status message to show up for a while + previous_lcd_status_ms = millis(); // get status message to show up for a while #endif } @@ -433,7 +431,7 @@ void lcd_set_home_offsets() { plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]); // Audio feedback - enquecommands_P(PSTR("M300 S659 P200\nM300 S698 P200")); + enqueuecommands_P(PSTR("M300 S659 P200\nM300 S698 P200")); lcd_return_to_status(); } @@ -1114,15 +1112,15 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) lcd_move_y(); } static void reprapworld_keypad_move_home() { - enquecommands_P((PSTR("G28"))); // move all axis home + enqueuecommands_P((PSTR("G28"))); // move all axis home } #endif //REPRAPWORLD_KEYPAD /** End of menus **/ -static void lcd_quick_feedback() { +void lcd_quick_feedback() { lcdDrawUpdate = 2; - blocking_enc = millis() + 500; + next_button_update_ms = millis() + 500; #ifdef LCD_USE_I2C_BUZZER #ifndef LCD_FEEDBACK_FREQUENCY_HZ @@ -1140,15 +1138,15 @@ static void lcd_quick_feedback() { #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 #endif - const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; - int i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; + const uint16_t delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; + uint16_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; while (i--) { WRITE(BEEPER,HIGH); delayMicroseconds(delay); WRITE(BEEPER,LOW); delayMicroseconds(delay); } - const int j = max(10000 - LCD_FEEDBACK_FREQUENCY_DURATION_MS * 1000, 0); + const uint16_t j = max(10000 - LCD_FEEDBACK_FREQUENCY_DURATION_MS * 1000, 0); if (j) delayMicroseconds(j); #endif } @@ -1156,15 +1154,15 @@ static void lcd_quick_feedback() { /** Menu action functions **/ static void menu_action_back(menuFunc_t data) { lcd_goto_menu(data); } static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); } -static void menu_action_gcode(const char* pgcode) { enquecommands_P(pgcode); } +static void menu_action_gcode(const char* pgcode) { enqueuecommands_P(pgcode); } static void menu_action_function(menuFunc_t data) { (*data)(); } static void menu_action_sdfile(const char* filename, char* longFilename) { char cmd[30]; char* c; sprintf_P(cmd, PSTR("M23 %s"), filename); for(c = &cmd[4]; *c; c++) *c = tolower(*c); - enquecommand(cmd); - enquecommands_P(PSTR("M24")); + enqueuecommand(cmd); + enqueuecommands_P(PSTR("M24")); lcd_return_to_status(); } static void menu_action_sddirectory(const char* filename, char* longFilename) { @@ -1252,7 +1250,7 @@ int lcd_strlen_P(const char *s) { void lcd_update() { #ifdef ULTIPANEL - static unsigned long timeoutToStatus = 0; + static millis_t return_to_status_ms = 0; #endif #ifdef LCD_HAS_SLOW_BUTTONS @@ -1282,8 +1280,8 @@ void lcd_update() { } #endif//CARDINSERTED - uint32_t ms = millis(); - if (ms > lcd_next_update_millis) { + millis_t ms = millis(); + if (ms > next_lcd_update_ms) { #ifdef ULTIPANEL @@ -1335,7 +1333,7 @@ void lcd_update() { encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP; encoderDiff = 0; } - timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS; + return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; lcdDrawUpdate = 1; } #endif //ULTIPANEL @@ -1371,20 +1369,24 @@ void lcd_update() { #endif #ifdef ULTIPANEL + + // Return to Status Screen after a timeout if (currentMenu != lcd_status_screen && - #if defined(MANUAL_BED_LEVELING) - currentMenu != _lcd_level_bed && - currentMenu != _lcd_level_bed_homing && - #endif // MANUAL_BED_LEVELING - millis() > timeoutToStatus) { + #ifdef MANUAL_BED_LEVELING + currentMenu != _lcd_level_bed && + currentMenu != _lcd_level_bed_homing && + #endif + millis() > return_to_status_ms + ) { lcd_return_to_status(); lcdDrawUpdate = 2; } - #endif //ULTIPANEL + + #endif // ULTIPANEL if (lcdDrawUpdate == 2) lcd_implementation_clear(); if (lcdDrawUpdate) lcdDrawUpdate--; - lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL; + next_lcd_update_ms = millis() + LCD_UPDATE_INTERVAL; } } @@ -1403,7 +1405,7 @@ void lcd_finishstatus(bool persist=false) { lcdDrawUpdate = 2; #ifdef FILAMENT_LCD_DISPLAY - message_millis = millis(); //get status message to show up for a while + previous_lcd_status_ms = millis(); //get status message to show up for a while #endif } @@ -1473,7 +1475,7 @@ void lcd_buttons_update() { if (READ(BTN_EN1) == 0) newbutton |= EN_A; if (READ(BTN_EN2) == 0) newbutton |= EN_B; #if BTN_ENC > 0 - if (millis() > blocking_enc && READ(BTN_ENC) == 0) newbutton |= EN_C; + if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C; #endif buttons = newbutton; #ifdef LCD_HAS_SLOW_BUTTONS @@ -1797,7 +1799,7 @@ char *ftostr52(const float &x) { if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS; encoderPosition = 0; line_to_current(); - lcdDrawUpdate = 1; + lcdDrawUpdate = 2; } if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS])); static bool debounce_click = false; @@ -1815,7 +1817,7 @@ char *ftostr52(const float &x) { current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; line_to_current(); mbl.active = 1; - enquecommands_P(PSTR("G28")); + enqueuecommands_P(PSTR("G28")); lcd_return_to_status(); } else { current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; @@ -1828,7 +1830,7 @@ char *ftostr52(const float &x) { current_position[X_AXIS] = mbl.get_x(ix); current_position[Y_AXIS] = mbl.get_y(iy); line_to_current(); - lcdDrawUpdate = 1; + lcdDrawUpdate = 2; } } } else { @@ -1837,6 +1839,7 @@ char *ftostr52(const float &x) { } static void _lcd_level_bed_homing() { + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), "Homing"); if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) { @@ -1848,6 +1851,7 @@ char *ftostr52(const float &x) { _lcd_level_bed_position = 0; lcd_goto_menu(_lcd_level_bed); } + lcdDrawUpdate = 2; } static void lcd_level_bed() { @@ -1855,7 +1859,8 @@ char *ftostr52(const float &x) { axis_known_position[Y_AXIS] = false; axis_known_position[Z_AXIS] = false; mbl.reset(); - enquecommands_P(PSTR("G28")); + enqueuecommands_P(PSTR("G28")); + lcdDrawUpdate = 2; lcd_goto_menu(_lcd_level_bed_homing); } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index fe4f59768..b8d5cba8a 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -49,10 +49,11 @@ extern bool cancel_heatup; #ifdef FILAMENT_LCD_DISPLAY - extern unsigned long message_millis; + extern millis_t previous_lcd_status_ms; #endif void lcd_buzz(long duration,uint16_t freq); + void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual bool lcd_clicked(); void lcd_ignore_click(bool b=true); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index aa348018e..2601575e3 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -610,7 +610,7 @@ static void lcd_implementation_status_screen() { // Show Filament Diameter and Volumetric Multiplier % // After allowing lcd_status_message to show for 5 seconds - if (millis() >= message_millis + 5000) { + if (millis() >= previous_lcd_status_ms + 5000) { lcd_printPGM(PSTR("Dia ")); lcd.print(ftostr12ns(filament_width_meas)); lcd_printPGM(PSTR(" V")); @@ -724,46 +724,45 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') #ifdef LCD_HAS_STATUS_INDICATORS -static void lcd_implementation_update_indicators() -{ - #if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI) - //set the LEDS - referred to as backlights by the LiquidTWI2 library - static uint8_t ledsprev = 0; - uint8_t leds = 0; - if (target_temperature_bed > 0) leds |= LED_A; - if (target_temperature[0] > 0) leds |= LED_B; - if (fanSpeed) leds |= LED_C; - #if EXTRUDERS > 1 - if (target_temperature[1] > 0) leds |= LED_C; + + static void lcd_implementation_update_indicators() { + #if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI) + //set the LEDS - referred to as backlights by the LiquidTWI2 library + static uint8_t ledsprev = 0; + uint8_t leds = 0; + if (target_temperature_bed > 0) leds |= LED_A; + if (target_temperature[0] > 0) leds |= LED_B; + if (fanSpeed) leds |= LED_C; + #if EXTRUDERS > 1 + if (target_temperature[1] > 0) leds |= LED_C; + #endif + if (leds != ledsprev) { + lcd.setBacklight(leds); + ledsprev = leds; + } #endif - if (leds != ledsprev) { - lcd.setBacklight(leds); - ledsprev = leds; - } - #endif -} -#endif + } + +#endif // LCD_HAS_STATUS_INDICATORS #ifdef LCD_HAS_SLOW_BUTTONS -extern uint32_t blocking_enc; -static uint8_t lcd_implementation_read_slow_buttons() -{ - #ifdef LCD_I2C_TYPE_MCP23017 - uint8_t slow_buttons; - // Reading these buttons this is likely to be too slow to call inside interrupt context - // so they are called during normal lcd_update - slow_buttons = lcd.readButtons() << B_I2C_BTN_OFFSET; - #if defined(LCD_I2C_VIKI) - if(slow_buttons & (B_MI|B_RI)) { //LCD clicked - if(blocking_enc > millis()) { - slow_buttons &= ~(B_MI|B_RI); // Disable LCD clicked buttons if screen is updated - } - } + extern millis_t next_button_update_ms; + + static uint8_t lcd_implementation_read_slow_buttons() { + #ifdef LCD_I2C_TYPE_MCP23017 + uint8_t slow_buttons; + // Reading these buttons this is likely to be too slow to call inside interrupt context + // so they are called during normal lcd_update + slow_buttons = lcd.readButtons() << B_I2C_BTN_OFFSET; + #ifdef LCD_I2C_VIKI + if ((slow_buttons & (B_MI|B_RI)) && millis() < next_button_update_ms) // LCD clicked + slow_buttons &= ~(B_MI|B_RI); // Disable LCD clicked buttons if screen is updated + #endif + return slow_buttons; #endif - return slow_buttons; - #endif -} -#endif + } + +#endif // LCD_HAS_SLOW_BUTTONS #endif //__ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H From e4b1e8651bdc0f96603e6a18d525df7f452d6432 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Apr 2015 23:06:50 -0700 Subject: [PATCH 293/302] next_ vars faster than previous_ - Change some `previous_` time vars to `next_` so an add only happens at intervals - Fix `HEATER_0_USES_MAX6675` polling too frequently, or not at all --- Marlin/temperature.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index f494edecf..179023de6 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -118,7 +118,7 @@ static volatile bool temp_meas_ready = false; static float temp_iState_min_bed; static float temp_iState_max_bed; #else //PIDTEMPBED - static millis_t previous_bed_check_ms; + static millis_t next_bed_check_ms; #endif //PIDTEMPBED static unsigned char soft_pwm[EXTRUDERS]; @@ -126,7 +126,7 @@ static volatile bool temp_meas_ready = false; static unsigned char soft_pwm_fan; #endif #if HAS_AUTO_FAN - static millis_t previous_auto_fan_check_ms; + static millis_t next_auto_fan_check_ms; #endif #ifdef PIDTEMP @@ -205,7 +205,7 @@ void PID_autotune(float temp, int extruder, int ncycles) float max = 0, min = 10000; #if HAS_AUTO_FAN - millis_t previous_auto_fan_check_ms = temp_ms; + millis_t next_auto_fan_check_ms = temp_ms + 2500; #endif if (extruder >= EXTRUDERS @@ -240,9 +240,9 @@ void PID_autotune(float temp, int extruder, int ncycles) min = min(min, input); #if HAS_AUTO_FAN - if (ms > previous_auto_fan_check_ms + 2500) { + if (ms > next_auto_fan_check_ms) { checkExtruderAutoFans(); - previous_auto_fan_check_ms = ms; + next_auto_fan_check_ms = ms + 2500; } #endif @@ -631,16 +631,16 @@ void manage_heater() { } // Extruders Loop #if HAS_AUTO_FAN - if (ms > previous_auto_fan_check_ms + 2500) { // only need to check fan state very infrequently + if (ms > next_auto_fan_check_ms) { // only need to check fan state very infrequently checkExtruderAutoFans(); - previous_auto_fan_check_ms = ms; + next_auto_fan_check_ms = ms + 2500; } #endif #ifndef PIDTEMPBED - if (ms < previous_bed_check_ms + BED_CHECK_INTERVAL) return; - previous_bed_check_ms = ms; - #endif //PIDTEMPBED + if (ms < previous_bed_check_ms) return; + next_bed_check_ms = ms + BED_CHECK_INTERVAL; + #endif #if TEMP_SENSOR_BED != 0 @@ -1109,16 +1109,18 @@ void disable_heater() { #ifdef HEATER_0_USES_MAX6675 #define MAX6675_HEAT_INTERVAL 250u - millis_t previous_max6675_ms = MAX6675_HEAT_INTERVAL; + static millis_t next_max6675_ms = 0; int max6675_temp = 2000; static int read_max6675() { millis_t ms = millis(); - if (ms < previous_max6675_ms + MAX6675_HEAT_INTERVAL) + + if (ms < next_max6675_ms) return max6675_temp; - previous_max6675_ms = ms; + next_max6675_ms = ms + MAX6675_HEAT_INTERVAL; + max6675_temp = 0; #ifdef PRR From 257a907456071e67f5b4d7aa3e85fbc6f6746d75 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Apr 2015 23:17:28 -0700 Subject: [PATCH 294/302] Fix typo in next_bed_check_ms --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 179023de6..9c9d6c5e0 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -638,7 +638,7 @@ void manage_heater() { #endif #ifndef PIDTEMPBED - if (ms < previous_bed_check_ms) return; + if (ms < next_bed_check_ms) return; next_bed_check_ms = ms + BED_CHECK_INTERVAL; #endif From 5a9e45cc4a5db0242a82843f10434582ef32485f Mon Sep 17 00:00:00 2001 From: Mehmet Sutas Date: Mon, 13 Apr 2015 22:37:18 +0300 Subject: [PATCH 295/302] Fix Syntax Error Filament Runout Statement --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 94c4c7bd8..1f0269528 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5921,7 +5921,7 @@ void kill() #ifdef FILAMENT_RUNOUT_SENSOR void filrunout() { - if filrunoutEnqued == false { + if (filrunoutEnqued == false) { filrunoutEnqued = true; enqueuecommand("M600"); } From 09d60e01280f622b75a098182fe3bb41d212fba8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Apr 2015 17:17:36 -0700 Subject: [PATCH 296/302] Naming and code comments --- Marlin/Marlin.h | 6 +- Marlin/Marlin_main.cpp | 613 ++++++++++-------- Marlin/configurator/config/language.h | 2 +- Marlin/dogm_lcd_implementation.h | 6 +- Marlin/language.h | 2 +- Marlin/temperature.cpp | 140 ++-- Marlin/temperature.h | 2 +- Marlin/ultralcd.cpp | 26 +- .../ultralcd_implementation_hitachi_HD44780.h | 6 +- 9 files changed, 436 insertions(+), 367 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index ad4f82bd1..0158a1d71 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -247,7 +247,7 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } extern float homing_feedrate[]; extern bool axis_relative_modes[]; -extern int feedmultiply; +extern int feedrate_multiplier; extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. @@ -309,8 +309,8 @@ extern int fanSpeed; extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate; #endif -extern millis_t starttime; -extern millis_t stoptime; +extern millis_t print_job_start_ms; +extern millis_t print_job_stop_ms; // Handling multiple extruders pins extern uint8_t active_extruder; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1f0269528..236b2be32 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -67,136 +67,149 @@ #include #endif -// look here for descriptions of G-codes: http://linuxcnc.org/handbook/gcode/g-code.html -// http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes +/** + * Look here for descriptions of G-codes: + * - http://linuxcnc.org/handbook/gcode/g-code.html + * - http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes + * + * Help us document these G-codes online: + * - http://reprap.org/wiki/G-code + * - https://github.com/MarlinFirmware/Marlin/wiki/Marlin-G-Code + */ -//Implemented Codes -//------------------- -// G0 -> G1 -// G1 - Coordinated Movement X Y Z E -// G2 - CW ARC -// G3 - CCW ARC -// G4 - Dwell S or P -// G10 - retract filament according to settings of M207 -// G11 - retract recover filament according to settings of M208 -// G28 - Home one or more axes -// G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. -// G30 - Single Z Probe, probes bed at current XY location. -// G31 - Dock sled (Z_PROBE_SLED only) -// G32 - Undock sled (Z_PROBE_SLED only) -// G90 - Use Absolute Coordinates -// G91 - Use Relative Coordinates -// G92 - Set current position to coordinates given - -// M Codes -// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) -// M1 - Same as M0 -// M17 - Enable/Power all stepper motors -// M18 - Disable all stepper motors; same as M84 -// M20 - List SD card -// M21 - Init SD card -// M22 - Release SD card -// M23 - Select SD file (M23 filename.g) -// M24 - Start/resume SD print -// M25 - Pause SD print -// M26 - Set SD position in bytes (M26 S12345) -// M27 - Report SD print status -// M28 - Start SD write (M28 filename.g) -// M29 - Stop SD write -// M30 - Delete file from SD (M30 filename.g) -// M31 - Output time since last M109 or SD card start to serial -// M32 - Select file and start SD print (Can be used _while_ printing from SD card files): -// syntax "M32 /path/filename#", or "M32 S !filename#" -// Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). -// The '#' is necessary when calling from within sd files, as it stops buffer prereading -// M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. -// M48 - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel] -// M80 - Turn on Power Supply -// M81 - Turn off Power Supply -// M82 - Set E codes absolute (default) -// M83 - Set E codes relative while in Absolute Coordinates (G90) mode -// M84 - Disable steppers until next move, -// or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. -// M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) -// M92 - Set axis_steps_per_unit - same syntax as G92 -// M104 - Set extruder target temp -// M105 - Read current temp -// M106 - Fan on -// M107 - Fan off -// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating -// Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling -// IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F -// M112 - Emergency stop -// M114 - Output current position to serial port -// M115 - Capabilities string -// M117 - display message -// M119 - Output Endstop status to serial port -// M120 - Enable endstop detection -// M121 - Disable endstop detection -// M126 - Solenoid Air Valve Open (BariCUDA support by jmil) -// M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) -// M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) -// M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) -// M140 - Set bed target temp -// M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. -// M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating -// Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -// M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).:D- -// M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) -// M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! -// M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec -// M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 -// M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk -// M206 - Set additional homing offset -// M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting -// M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] -// M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. -// M218 - Set hotend offset (in mm): T X Y -// M220 - Set speed factor override percentage: S -// M221 - Set extrude factor override percentage: S -// M226 - Wait until the specified pin reaches the state required: P S -// M240 - Trigger a camera to take a photograph -// M250 - Set LCD contrast C (value 0..63) -// M280 - Set servo position absolute. P: servo index, S: angle or microseconds -// M300 - Play beep sound S P -// M301 - Set PID parameters P I and D -// M302 - Allow cold extrudes, or set the minimum extrude S. -// M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C) -// M304 - Set bed PID parameters P I and D -// M380 - Activate solenoid on active extruder -// M381 - Disable all solenoids -// M400 - Finish all moves -// M401 - Lower z-probe if present -// M402 - Raise z-probe if present -// M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters -// M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder -// M406 - Turn off Filament Sensor extrusion control -// M407 - Display measured filament diameter -// M500 - Store parameters in EEPROM -// M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). -// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. -// M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. -// M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) -// M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] -// M665 - Set delta configurations: L R S -// M666 - Set delta endstop adjustment -// M605 - Set dual x-carriage movement mode: S [ X R ] -// M907 - Set digital trimpot motor current using axis codes. -// M908 - Control digital trimpot directly. -// M350 - Set microstepping mode. -// M351 - Toggle MS1 MS2 pins directly. - -// ************ SCARA Specific - This can change to suit future G-code regulations -// M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) -// M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) -// M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) -// M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) -// M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) -// M365 - SCARA calibration: Scaling factor, X, Y, Z axis -//************* SCARA End *************** - -// M928 - Start SD logging (M928 filename.g) - ended by M29 -// M999 - Restart after being stopped by error +/** + * Implemented Codes + * ------------------- + * + * "G" Codes + * + * G0 -> G1 + * G1 - Coordinated Movement X Y Z E + * G2 - CW ARC + * G3 - CCW ARC + * G4 - Dwell S or P + * G10 - retract filament according to settings of M207 + * G11 - retract recover filament according to settings of M208 + * G28 - Home one or more axes + * G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. + * G30 - Single Z Probe, probes bed at current XY location. + * G31 - Dock sled (Z_PROBE_SLED only) + * G32 - Undock sled (Z_PROBE_SLED only) + * G90 - Use Absolute Coordinates + * G91 - Use Relative Coordinates + * G92 - Set current position to coordinates given + * + * "M" Codes + * + * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) + * M1 - Same as M0 + * M17 - Enable/Power all stepper motors + * M18 - Disable all stepper motors; same as M84 + * M20 - List SD card + * M21 - Init SD card + * M22 - Release SD card + * M23 - Select SD file (M23 filename.g) + * M24 - Start/resume SD print + * M25 - Pause SD print + * M26 - Set SD position in bytes (M26 S12345) + * M27 - Report SD print status + * M28 - Start SD write (M28 filename.g) + * M29 - Stop SD write + * M30 - Delete file from SD (M30 filename.g) + * M31 - Output time since last M109 or SD card start to serial + * M32 - Select file and start SD print (Can be used _while_ printing from SD card files): + * syntax "M32 /path/filename#", or "M32 S !filename#" + * Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). + * The '#' is necessary when calling from within sd files, as it stops buffer prereading + * M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. + * M48 - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel] + * M80 - Turn on Power Supply + * M81 - Turn off Power Supply + * M82 - Set E codes absolute (default) + * M83 - Set E codes relative while in Absolute Coordinates (G90) mode + * M84 - Disable steppers until next move, + * or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. + * M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) + * M92 - Set axis_steps_per_unit - same syntax as G92 + * M104 - Set extruder target temp + * M105 - Read current temp + * M106 - Fan on + * M107 - Fan off + * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating + * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling + * IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F + * M112 - Emergency stop + * M114 - Output current position to serial port + * M115 - Capabilities string + * M117 - display message + * M119 - Output Endstop status to serial port + * M120 - Enable endstop detection + * M121 - Disable endstop detection + * M126 - Solenoid Air Valve Open (BariCUDA support by jmil) + * M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) + * M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) + * M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) + * M140 - Set bed target temp + * M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. + * M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating + * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling + * M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).:D- + * M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) + * M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! + * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec + * M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 + * M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk + * M206 - Set additional homing offset + * M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting + * M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] + * M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. + * M218 - Set hotend offset (in mm): T X Y + * M220 - Set speed factor override percentage: S + * M221 - Set extrude factor override percentage: S + * M226 - Wait until the specified pin reaches the state required: P S + * M240 - Trigger a camera to take a photograph + * M250 - Set LCD contrast C (value 0..63) + * M280 - Set servo position absolute. P: servo index, S: angle or microseconds + * M300 - Play beep sound S P + * M301 - Set PID parameters P I and D + * M302 - Allow cold extrudes, or set the minimum extrude S. + * M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C) + * M304 - Set bed PID parameters P I and D + * M380 - Activate solenoid on active extruder + * M381 - Disable all solenoids + * M400 - Finish all moves + * M401 - Lower z-probe if present + * M402 - Raise z-probe if present + * M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters + * M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder + * M406 - Turn off Filament Sensor extrusion control + * M407 - Display measured filament diameter + * M500 - Store parameters in EEPROM + * M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). + * M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. + * M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings. + * M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) + * M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] + * M665 - Set delta configurations: L R S + * M666 - Set delta endstop adjustment + * M605 - Set dual x-carriage movement mode: S [ X R ] + * M907 - Set digital trimpot motor current using axis codes. + * M908 - Control digital trimpot directly. + * M350 - Set microstepping mode. + * M351 - Toggle MS1 MS2 pins directly. + * + * ************ SCARA Specific - This can change to suit future G-code regulations + * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) + * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) + * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) + * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) + * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) + * M365 - SCARA calibration: Scaling factor, X, Y, Z axis + * ************* SCARA End *************** + * + * M928 - Start SD logging (M928 filename.g) - ended by M29 + * M999 - Restart after being stopped by error + */ #ifdef SDSUPPORT CardReader card; @@ -210,12 +223,16 @@ static float destination[NUM_AXIS] = { 0.0 }; bool axis_known_position[3] = { false }; static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; -static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; + +static int cmd_queue_index_r = 0; +static int cmd_queue_index_w = 0; +static int commands_in_queue = 0; +static char command_queue[BUFSIZE][MAX_CMD_SIZE]; float homing_feedrate[] = HOMING_FEEDRATE; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; -int feedmultiply = 100; //100->1 200->2 -int saved_feedmultiply; +int feedrate_multiplier = 100; //100->1 200->2 +int saved_feedrate_multiplier; int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); @@ -234,9 +251,6 @@ const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; static float offset[3] = { 0 }; static bool relative_mode = false; //Determines Absolute or Relative Coordinates -static int bufindr = 0; -static int bufindw = 0; -static int buflen = 0; static char serial_char; static int serial_count = 0; static boolean comment_mode = false; @@ -247,10 +261,10 @@ const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42 millis_t previous_cmd_ms = 0; static millis_t max_inactive_time = 0; static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L; -millis_t starttime = 0; ///< Print job start time -millis_t stoptime = 0; ///< Print job stop time +millis_t print_job_start_ms = 0; ///< Print job start time +millis_t print_job_stop_ms = 0; ///< Print job stop time static uint8_t target_extruder; -bool CooldownNoWait = true; +bool no_wait_for_cooling = true; bool target_direction; #ifdef ENABLE_AUTO_BED_LEVELING @@ -357,7 +371,7 @@ bool target_direction; #endif #ifdef FILAMENT_RUNOUT_SENSOR - static bool filrunoutEnqued = false; + static bool filrunoutEnqueued = false; #endif #ifdef SDSUPPORT @@ -410,8 +424,10 @@ void serial_echopair_P(const char *s_P, unsigned long v) { serialprintPGM(s_P); } #endif //!SDSUPPORT -//Injects the next command from the pending sequence of commands, when possible -//Return false if and only if no command was pending +/** + * Inject the next command from the command queue, when possible + * Return false only if no command was pending + */ static bool drain_queued_commands_P() { if (!queued_commands_P) return false; @@ -425,7 +441,7 @@ static bool drain_queued_commands_P() { char c; while((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command cmd[i] = '\0'; - if (enqueuecommand(cmd)) { // buffer was not full (else we will retry later) + if (enqueuecommand(cmd)) { // buffer was not full (else we will retry later) if (c) queued_commands_P += i + 1; // move to next command else @@ -434,45 +450,46 @@ static bool drain_queued_commands_P() { return true; } -//Record one or many commands to run from program memory. -//Aborts the current queue, if any. -//Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards +/** + * Record one or many commands to run from program memory. + * Aborts the current queue, if any. + * Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards + */ void enqueuecommands_P(const char* pgcode) { - queued_commands_P = pgcode; - drain_queued_commands_P(); // first command executed asap (when possible) + queued_commands_P = pgcode; + drain_queued_commands_P(); // first command executed asap (when possible) } -//adds a single command to the main command buffer, from RAM -//that is really done in a non-safe way. -//needs overworking someday -//Returns false if it failed to do so -bool enqueuecommand(const char *cmd) -{ - if(*cmd==';') - return false; - if(buflen >= BUFSIZE) - return false; - //this is dangerous if a mixing of serial and this happens - strcpy(&(cmdbuffer[bufindw][0]),cmd); +/** + * Copy a command directly into the main command buffer, from RAM. + * + * This is done in a non-safe way and needs a rework someday. + * Returns false if it doesn't add any command + */ +bool enqueuecommand(const char *cmd) { + + if (*cmd == ';' || commands_in_queue >= BUFSIZE) return false; + + // This is dangerous if a mixing of serial and this happens + char *command = command_queue[cmd_queue_index_w]; + strcpy(command, cmd); SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_Enqueing); - SERIAL_ECHO(cmdbuffer[bufindw]); + SERIAL_ECHOPGM(MSG_Enqueueing); + SERIAL_ECHO(command); SERIAL_ECHOLNPGM("\""); - bufindw= (bufindw + 1)%BUFSIZE; - buflen += 1; + cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE; + commands_in_queue++; return true; } -void setup_killpin() -{ +void setup_killpin() { #if HAS_KILL SET_INPUT(KILL_PIN); WRITE(KILL_PIN, HIGH); #endif } -void setup_filrunoutpin() -{ +void setup_filrunoutpin() { #if HAS_FILRUNOUT pinMode(FILRUNOUT_PIN, INPUT); #ifdef ENDSTOPPULLUP_FIL_RUNOUT @@ -482,8 +499,7 @@ void setup_filrunoutpin() } // Set home pin -void setup_homepin(void) -{ +void setup_homepin(void) { #if HAS_HOME SET_INPUT(HOME_PIN); WRITE(HOME_PIN, HIGH); @@ -491,15 +507,13 @@ void setup_homepin(void) } -void setup_photpin() -{ +void setup_photpin() { #if HAS_PHOTOGRAPH OUT_WRITE(PHOTOGRAPH_PIN, LOW); #endif } -void setup_powerhold() -{ +void setup_powerhold() { #if HAS_SUICIDE OUT_WRITE(SUICIDE_PIN, HIGH); #endif @@ -512,15 +526,13 @@ void setup_powerhold() #endif } -void suicide() -{ +void suicide() { #if HAS_SUICIDE OUT_WRITE(SUICIDE_PIN, LOW); #endif } -void servo_init() -{ +void servo_init() { #if NUM_SERVOS >= 1 && HAS_SERVO_0 servos[0].attach(SERVO0_PIN); #endif @@ -547,6 +559,24 @@ void servo_init() #endif } +/** + * Marlin entry-point: Set up before the program loop + * - Set up the kill pin, filament runout, power hold + * - Start the serial port + * - Print startup messages and diagnostics + * - Get EEPROM or default settings + * - Initialize managers for: + * • temperature + * • planner + * • watchdog + * • stepper + * • photo pin + * • servos + * • LCD controller + * • Digipot I2C + * • Z probe sled + * • status LEDs + */ void setup() { setup_killpin(); setup_filrunoutpin(); @@ -587,7 +617,7 @@ void setup() { #ifdef SDSUPPORT for (int8_t i = 0; i < BUFSIZE; i++) fromsd[i] = false; - #endif // !SDSUPPORT + #endif // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); @@ -628,36 +658,54 @@ void setup() { #endif } - +/** + * The main Marlin program loop + * + * - Save or log commands to SD + * - Process available commands (if not saving) + * - Call heater manager + * - Call inactivity manager + * - Call endstop manager + * - Call LCD update + */ void loop() { - if (buflen < BUFSIZE - 1) get_command(); + if (commands_in_queue < BUFSIZE - 1) get_command(); #ifdef SDSUPPORT card.checkautostart(false); #endif - if (buflen) { + if (commands_in_queue) { + #ifdef SDSUPPORT + if (card.saving) { - if (strstr_P(cmdbuffer[bufindr], PSTR("M29")) == NULL) { - card.write_command(cmdbuffer[bufindr]); - if (card.logging) - process_commands(); - else - SERIAL_PROTOCOLLNPGM(MSG_OK); - } - else { + char *command = command_queue[cmd_queue_index_r]; + if (strstr_P(command, PSTR("M29"))) { + // M29 closes the file card.closefile(); SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED); } + else { + // Write the string from the read buffer to SD + card.write_command(command); + if (card.logging) + process_commands(); // The card is saving because it's logging + else + SERIAL_PROTOCOLLNPGM(MSG_OK); + } } else process_commands(); + #else + process_commands(); + #endif // SDSUPPORT - buflen--; - bufindr = (bufindr + 1) % BUFSIZE; + + commands_in_queue--; + cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE; } // Check heater every n milliseconds manage_heater(); @@ -666,12 +714,20 @@ void loop() { lcd_update(); } +/** + * Add to the circular command queue the next command from: + * - The command-injection queue (queued_commands_P) + * - The active serial input (usually USB) + * - The SD card file being actively printed + */ void get_command() { if (drain_queued_commands_P()) return; // priority is given to non-serial commands - while (MYSERIAL.available() > 0 && buflen < BUFSIZE) { + while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) { + serial_char = MYSERIAL.read(); + if (serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { @@ -680,16 +736,17 @@ void get_command() { if (!serial_count) return; // shortcut for empty lines - cmdbuffer[bufindw][serial_count] = 0; // terminate string + char *command = command_queue[cmd_queue_index_w]; + command[serial_count] = 0; // terminate string #ifdef SDSUPPORT - fromsd[bufindw] = false; + fromsd[cmd_queue_index_w] = false; #endif - if (strchr(cmdbuffer[bufindw], 'N') != NULL) { - strchr_pointer = strchr(cmdbuffer[bufindw], 'N'); + if (strchr(command, 'N') != NULL) { + strchr_pointer = strchr(command, 'N'); gcode_N = (strtol(strchr_pointer + 1, NULL, 10)); - if (gcode_N != gcode_LastN + 1 && strstr_P(cmdbuffer[bufindw], PSTR("M110")) == NULL) { + if (gcode_N != gcode_LastN + 1 && strstr_P(command, PSTR("M110")) == NULL) { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_LINE_NO); SERIAL_ERRORLN(gcode_LastN); @@ -699,11 +756,11 @@ void get_command() { return; } - if (strchr(cmdbuffer[bufindw], '*') != NULL) { + if (strchr(command, '*') != NULL) { byte checksum = 0; byte count = 0; - while (cmdbuffer[bufindw][count] != '*') checksum ^= cmdbuffer[bufindw][count++]; - strchr_pointer = strchr(cmdbuffer[bufindw], '*'); + while (command[count] != '*') checksum ^= command[count++]; + strchr_pointer = strchr(command, '*'); if (strtol(strchr_pointer + 1, NULL, 10) != checksum) { SERIAL_ERROR_START; @@ -728,7 +785,7 @@ void get_command() { //if no errors, continue parsing } else { // if we don't receive 'N' but still see '*' - if ((strchr(cmdbuffer[bufindw], '*') != NULL)) { + if ((strchr(command, '*') != NULL)) { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM); SERIAL_ERRORLN(gcode_LastN); @@ -737,8 +794,8 @@ void get_command() { } } - if (strchr(cmdbuffer[bufindw], 'G') != NULL) { - strchr_pointer = strchr(cmdbuffer[bufindw], 'G'); + if (strchr(command, 'G') != NULL) { + strchr_pointer = strchr(command, 'G'); switch (strtol(strchr_pointer + 1, NULL, 10)) { case 0: case 1: @@ -755,24 +812,24 @@ void get_command() { } // If command was e-stop process now - if (strcmp(cmdbuffer[bufindw], "M112") == 0) kill(); + if (strcmp(command, "M112") == 0) kill(); - bufindw = (bufindw + 1) % BUFSIZE; - buflen += 1; + cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE; + commands_in_queue += 1; serial_count = 0; //clear buffer } else if (serial_char == '\\') { // Handle escapes - if (MYSERIAL.available() > 0 && buflen < BUFSIZE) { + if (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) { // if we have one more character, copy it over serial_char = MYSERIAL.read(); - cmdbuffer[bufindw][serial_count++] = serial_char; + command_queue[cmd_queue_index_w][serial_count++] = serial_char; } // otherwise do nothing } else { // its not a newline, carriage return or escape char if (serial_char == ';') comment_mode = true; - if (!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char; + if (!comment_mode) command_queue[cmd_queue_index_w][serial_count++] = serial_char; } } @@ -785,9 +842,9 @@ void get_command() { // this character _can_ occur in serial com, due to checksums. however, no checksums are used in SD printing static bool stop_buffering = false; - if (buflen == 0) stop_buffering = false; + if (commands_in_queue == 0) stop_buffering = false; - while (!card.eof() && buflen < BUFSIZE && !stop_buffering) { + while (!card.eof() && commands_in_queue < BUFSIZE && !stop_buffering) { int16_t n = card.get(); serial_char = (char)n; if (serial_char == '\n' || serial_char == '\r' || @@ -796,9 +853,9 @@ void get_command() { ) { if (card.eof()) { SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); - stoptime = millis(); + print_job_stop_ms = millis(); char time[30]; - millis_t t = (stoptime - starttime) / 1000; + millis_t t = (print_job_stop_ms - print_job_start_ms) / 1000; int hours = t / 60 / 60, minutes = (t / 60) % 60; sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), hours, minutes); SERIAL_ECHO_START; @@ -813,18 +870,18 @@ void get_command() { comment_mode = false; //for new command return; //if empty line } - cmdbuffer[bufindw][serial_count] = 0; //terminate string + command_queue[cmd_queue_index_w][serial_count] = 0; //terminate string // if (!comment_mode) { - fromsd[bufindw] = true; - buflen += 1; - bufindw = (bufindw + 1)%BUFSIZE; + fromsd[cmd_queue_index_w] = true; + commands_in_queue += 1; + cmd_queue_index_w = (cmd_queue_index_w + 1) % BUFSIZE; // } comment_mode = false; //for new command serial_count = 0; //clear buffer } else { if (serial_char == ';') comment_mode = true; - if (!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char; + if (!comment_mode) command_queue[cmd_queue_index_w][serial_count++] = serial_char; } } @@ -854,7 +911,7 @@ long code_value_long() { return strtol(strchr_pointer + 1, NULL, 10); } int16_t code_value_short() { return (int16_t)strtol(strchr_pointer + 1, NULL, 10); } bool code_seen(char code) { - strchr_pointer = strchr(cmdbuffer[bufindr], code); + strchr_pointer = strchr(command_queue[cmd_queue_index_r], code); return (strchr_pointer != NULL); //Return True if a character was found } @@ -1023,7 +1080,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, void prepare_move_raw() { refresh_cmd_timeout(); calculate_delta(destination); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedrate_multiplier/100.0), active_extruder); set_current_to_destination(); } #endif @@ -1176,8 +1233,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position, static void setup_for_endstop_move() { saved_feedrate = feedrate; - saved_feedmultiply = feedmultiply; - feedmultiply = 100; + saved_feedrate_multiplier = feedrate_multiplier; + feedrate_multiplier = 100; refresh_cmd_timeout(); enable_endstops(true); } @@ -1187,7 +1244,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, enable_endstops(false); #endif feedrate = saved_feedrate; - feedmultiply = saved_feedmultiply; + feedrate_multiplier = saved_feedrate_multiplier; refresh_cmd_timeout(); } @@ -1610,12 +1667,12 @@ static void homeaxis(AxisEnum axis) { #define SLED_DOCKING_OFFSET 0 #endif - // - // Method to dock/undock a sled designed by Charles Bell. - // - // dock[in] If true, move to MAX_X and engage the electromagnet - // offset[in] The additional distance to move to adjust docking location - // + /** + * Method to dock/undock a sled designed by Charles Bell. + * + * dock[in] If true, move to MAX_X and engage the electromagnet + * offset[in] The additional distance to move to adjust docking location + */ static void dock_sled(bool dock, int offset=0) { if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN); @@ -1649,9 +1706,10 @@ static void homeaxis(AxisEnum axis) { inline void gcode_G0_G1() { if (IsRunning()) { get_coordinates(); // For X Y Z E F + #ifdef FWRETRACT - if (autoretract_enabled) - if (!(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { + + if (autoretract_enabled && !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { float echange = destination[E_AXIS] - current_position[E_AXIS]; // Is this move an attempt to retract or recover? if ((echange < -MIN_RETRACT && !retracted[active_extruder]) || (echange > MIN_RETRACT && retracted[active_extruder])) { @@ -1661,7 +1719,9 @@ inline void gcode_G0_G1() { return; } } + #endif //FWRETRACT + prepare_move(); //ClearToSend(); } @@ -1758,8 +1818,8 @@ inline void gcode_G28() { #endif saved_feedrate = feedrate; - saved_feedmultiply = feedmultiply; - feedmultiply = 100; + saved_feedrate_multiplier = feedrate_multiplier; + feedrate_multiplier = 100; refresh_cmd_timeout(); enable_endstops(true); @@ -2013,7 +2073,7 @@ inline void gcode_G28() { #endif feedrate = saved_feedrate; - feedmultiply = saved_feedmultiply; + feedrate_multiplier = saved_feedrate_multiplier; refresh_cmd_timeout(); endstops_hit_on_purpose(); // clear endstop hit flags } @@ -2659,7 +2719,7 @@ inline void gcode_M17() { */ inline void gcode_M24() { card.startFileprint(); - starttime = millis(); + print_job_start_ms = millis(); } /** @@ -2691,7 +2751,7 @@ inline void gcode_M17() { char* codepos = strchr_pointer + 4; char* starpos = strchr(codepos, '*'); if (starpos) { - char* npos = strchr(cmdbuffer[bufindr], 'N'); + char* npos = strchr(command_queue[cmd_queue_index_r], 'N'); strchr_pointer = strchr(npos, ' ') + 1; *(starpos) = '\0'; } @@ -2714,7 +2774,7 @@ inline void gcode_M17() { card.closefile(); char* starpos = strchr(strchr_pointer + 4, '*'); if (starpos) { - char* npos = strchr(cmdbuffer[bufindr], 'N'); + char* npos = strchr(command_queue[cmd_queue_index_r], 'N'); strchr_pointer = strchr(npos, ' ') + 1; *(starpos) = '\0'; } @@ -2728,8 +2788,8 @@ inline void gcode_M17() { * M31: Get the time since the start of SD Print (or last M109) */ inline void gcode_M31() { - stoptime = millis(); - millis_t t = (stoptime - starttime) / 1000; + print_job_stop_ms = millis(); + millis_t t = (print_job_stop_ms - print_job_start_ms) / 1000; int min = t / 60, sec = t % 60; char time[30]; sprintf_P(time, PSTR("%i min, %i sec"), min, sec); @@ -2769,7 +2829,7 @@ inline void gcode_M31() { card.startFileprint(); if (!call_procedure) - starttime = millis(); //procedure calls count as normal print time. + print_job_start_ms = millis(); //procedure calls count as normal print time. } } @@ -2779,7 +2839,7 @@ inline void gcode_M31() { inline void gcode_M928() { char* starpos = strchr(strchr_pointer + 5, '*'); if (starpos) { - char* npos = strchr(cmdbuffer[bufindr], 'N'); + char* npos = strchr(command_queue[cmd_queue_index_r], 'N'); strchr_pointer = strchr(npos, ' ') + 1; *(starpos) = '\0'; } @@ -3185,8 +3245,8 @@ inline void gcode_M109() { LCD_MESSAGEPGM(MSG_HEATING); - CooldownNoWait = code_seen('S'); - if (CooldownNoWait || code_seen('R')) { + no_wait_for_cooling = code_seen('S'); + if (no_wait_for_cooling || code_seen('R')) { float temp = code_value(); setTargetHotend(temp, target_extruder); #ifdef DUAL_X_CARRIAGE @@ -3218,7 +3278,7 @@ inline void gcode_M109() { while((!cancel_heatup)&&((residency_start_ms == -1) || (residency_start_ms >= 0 && (((unsigned int) (millis() - residency_start_ms)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) #else - while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(CooldownNoWait==false)) ) + while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(no_wait_for_cooling==false)) ) #endif //TEMP_RESIDENCY_TIME { // while loop @@ -3258,7 +3318,7 @@ inline void gcode_M109() { LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); refresh_cmd_timeout(); - starttime = previous_cmd_ms; + print_job_start_ms = previous_cmd_ms; } #if HAS_TEMP_BED @@ -3269,8 +3329,8 @@ inline void gcode_M109() { */ inline void gcode_M190() { LCD_MESSAGEPGM(MSG_BED_HEATING); - CooldownNoWait = code_seen('S'); - if (CooldownNoWait || code_seen('R')) + no_wait_for_cooling = code_seen('S'); + if (no_wait_for_cooling || code_seen('R')) setTargetBed(code_value()); millis_t temp_ms = millis(); @@ -3278,7 +3338,7 @@ inline void gcode_M109() { cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling - while ( (target_direction)&&(!cancel_heatup) ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) ) { + while ((target_direction && !cancel_heatup) ? isHeatingBed() : isCoolingBed() && !no_wait_for_cooling) { millis_t ms = millis(); if (ms > temp_ms + 1000UL) { //Print Temp Reading every 1 second while heating up. temp_ms = ms; @@ -3371,7 +3431,7 @@ inline void gcode_M140() { * This code should ALWAYS be available for EMERGENCY SHUTDOWN! */ inline void gcode_M81() { - disable_heater(); + disable_all_heaters(); st_synchronize(); disable_e0(); disable_e1(); @@ -3803,7 +3863,7 @@ inline void gcode_M206() { default: SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND); - SERIAL_ECHO(cmdbuffer[bufindr]); + SERIAL_ECHO(command_queue[cmd_queue_index_r]); SERIAL_ECHOLNPGM("\""); return; } @@ -3849,7 +3909,7 @@ inline void gcode_M206() { * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) */ inline void gcode_M220() { - if (code_seen('S')) feedmultiply = code_value(); + if (code_seen('S')) feedrate_multiplier = code_value(); } /** @@ -4485,7 +4545,7 @@ inline void gcode_M503() { #endif #ifdef FILAMENT_RUNOUT_SENSOR - filrunoutEnqued = false; + filrunoutEnqueued = false; #endif } @@ -4619,6 +4679,9 @@ inline void gcode_M999() { FlushSerialRequestResend(); } +/** + * T0-T3: Switch tool, usually switching extruders + */ inline void gcode_T() { int tmp_extruder = code_value(); if (tmp_extruder >= EXTRUDERS) { @@ -5208,7 +5271,7 @@ void process_commands() { else { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND); - SERIAL_ECHO(cmdbuffer[bufindr]); + SERIAL_ECHO(command_queue[cmd_queue_index_r]); SERIAL_ECHOLNPGM("\""); } @@ -5216,7 +5279,7 @@ void process_commands() { } void FlushSerialRequestResend() { - //char cmdbuffer[bufindr][100]="Resend:"; + //char command_queue[cmd_queue_index_r][100]="Resend:"; MYSERIAL.flush(); SERIAL_PROTOCOLPGM(MSG_RESEND); SERIAL_PROTOCOLLN(gcode_LastN + 1); @@ -5226,7 +5289,7 @@ void FlushSerialRequestResend() { void ClearToSend() { refresh_cmd_timeout(); #ifdef SDSUPPORT - if (fromsd[bufindr]) return; + if (fromsd[cmd_queue_index_r]) return; #endif SERIAL_PROTOCOLLNPGM(MSG_OK); } @@ -5470,7 +5533,7 @@ void prepare_move() { float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS])); if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); } if (cartesian_mm < 0.000001) { return; } - float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + float seconds = 6000 * cartesian_mm / feedrate / feedrate_multiplier; int steps = max(1, int(scara_segments_per_second * seconds)); //SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); @@ -5489,7 +5552,7 @@ void prepare_move() { //SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); //SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]); - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate/60*feedmultiply/100.0, active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate/60*feedrate_multiplier/100.0, active_extruder); } #endif // SCARA @@ -5502,7 +5565,7 @@ void prepare_move() { float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS])); if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); if (cartesian_mm < 0.000001) return; - float seconds = 6000 * cartesian_mm / feedrate / feedmultiply; + float seconds = 6000 * cartesian_mm / feedrate / feedrate_multiplier; int steps = max(1, int(delta_segments_per_second * seconds)); // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm); @@ -5516,7 +5579,7 @@ void prepare_move() { #ifdef ENABLE_AUTO_BED_LEVELING adjust_delta(destination); #endif - plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate/60*feedmultiply/100.0, active_extruder); + plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], feedrate/60*feedrate_multiplier/100.0, active_extruder); } #endif // DELTA @@ -5556,16 +5619,16 @@ void prepare_move() { #endif // DUAL_X_CARRIAGE #if !defined(DELTA) && !defined(SCARA) - // Do not use feedmultiply for E or Z only moves + // Do not use feedrate_multiplier for E or Z only moves if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) { line_to_destination(); } else { #ifdef MESH_BED_LEVELING - mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder); + mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedrate_multiplier/100.0), active_extruder); return; #else - line_to_destination(feedrate * feedmultiply / 100.0); + line_to_destination(feedrate * feedrate_multiplier / 100.0); #endif // MESH_BED_LEVELING } #endif // !(DELTA || SCARA) @@ -5577,7 +5640,7 @@ void prepare_arc_move(char isclockwise) { float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc // Trace the arc - mc_arc(current_position, destination, offset, X_AXIS, Y_AXIS, Z_AXIS, feedrate*feedmultiply/60/100.0, r, isclockwise, active_extruder); + mc_arc(current_position, destination, offset, X_AXIS, Y_AXIS, Z_AXIS, feedrate*feedrate_multiplier/60/100.0, r, isclockwise, active_extruder); // As far as the parser is concerned, the position is now == target. In reality the // motion control system might still be processing the action and the real tool position @@ -5762,7 +5825,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { filrunout(); #endif - if (buflen < BUFSIZE - 1) get_command(); + if (commands_in_queue < BUFSIZE - 1) get_command(); millis_t ms = millis(); @@ -5898,7 +5961,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { void kill() { cli(); // Stop interrupts - disable_heater(); + disable_all_heaters(); disable_all_steppers(); @@ -5919,18 +5982,18 @@ void kill() } #ifdef FILAMENT_RUNOUT_SENSOR - void filrunout() - { - if (filrunoutEnqued == false) { - filrunoutEnqued = true; - enqueuecommand("M600"); - } - } + + void filrunout() { + if (!filrunoutEnqueued) { + filrunoutEnqueued = true; + enqueuecommand("M600"); + } + } + #endif -void Stop() -{ - disable_heater(); +void Stop() { + disable_all_heaters(); if (IsRunning()) { Running = false; Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart diff --git a/Marlin/configurator/config/language.h b/Marlin/configurator/config/language.h index 5d1fd6c2f..eb0ef8c0a 100644 --- a/Marlin/configurator/config/language.h +++ b/Marlin/configurator/config/language.h @@ -110,7 +110,7 @@ // Serial Console Messages (do not translate those!) -#define MSG_Enqueing "enqueing \"" +#define MSG_Enqueueing "enqueueing \"" #define MSG_POWERUP "PowerUp" #define MSG_EXTERNAL_RESET " External Reset" #define MSG_BROWNOUT_RESET " Brown out Reset" diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 546703bfb..3ab18af75 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -269,8 +269,8 @@ static void lcd_implementation_status_screen() { } u8g.setPrintPos(80,48); - if (starttime != 0) { - uint16_t time = (millis() - starttime) / 60000; + if (print_job_start_ms != 0) { + uint16_t time = (millis() - print_job_start_ms) / 60000; lcd_print(itostr2(time/60)); lcd_print(':'); lcd_print(itostr2(time%60)); @@ -337,7 +337,7 @@ static void lcd_implementation_status_screen() { lcd_print(LCD_STR_FEEDRATE[0]); lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(12,49); - lcd_print(itostr3(feedmultiply)); + lcd_print(itostr3(feedrate_multiplier)); lcd_print('%'); // Status line diff --git a/Marlin/language.h b/Marlin/language.h index 179a1b956..ba5f3f700 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -110,7 +110,7 @@ // Serial Console Messages (do not translate those!) -#define MSG_Enqueing "enqueing \"" +#define MSG_Enqueueing "enqueueing \"" #define MSG_POWERUP "PowerUp" #define MSG_EXTERNAL_RESET " External Reset" #define MSG_BROWNOUT_RESET " Brown out Reset" diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 9c9d6c5e0..69a2877e7 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -219,7 +219,7 @@ void PID_autotune(float temp, int extruder, int ncycles) SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START); - disable_heater(); // switch off all heaters. + disable_all_heaters(); // switch off all heaters. if (extruder < 0) soft_pwm_bed = bias = d = MAX_BED_POWER / 2; @@ -458,11 +458,11 @@ inline void _temp_error(int e, const char *msg1, const char *msg2) { } void max_temp_error(uint8_t e) { - disable_heater(); + disable_all_heaters(); _temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP)); } void min_temp_error(uint8_t e) { - disable_heater(); + disable_all_heaters(); _temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP)); } void bed_max_temp_error(void) { @@ -579,6 +579,14 @@ float get_pid_output(int e) { } #endif +/** + * Manage heating activities for extruder hot-ends and a heated bed + * - Acquire updated temperature readings + * - Invoke thermal runaway protection + * - Manage extruder auto-fan + * - Apply filament width to the extrusion rate (may move) + * - Update the heated bed PID output value + */ void manage_heater() { if (!temp_meas_ready) return; @@ -623,7 +631,7 @@ void manage_heater() { #ifdef TEMP_SENSOR_1_AS_REDUNDANT if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) { - disable_heater(); + disable_all_heaters(); _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP)); } #endif // TEMP_SENSOR_1_AS_REDUNDANT @@ -636,7 +644,22 @@ void manage_heater() { next_auto_fan_check_ms = ms + 2500; } #endif - + + // Control the extruder rate based on the width sensor + #ifdef FILAMENT_SENSOR + if (filament_sensor) { + meas_shift_index = delay_index1 - meas_delay_cm; + if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1; //loop around buffer if needed + + // Get the delayed info and add 100 to reconstitute to a percent of + // the nominal filament diameter then square it to get an area + meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); + float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2); + if (vm < 0.01) vm = 0.01; + volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm; + } + #endif //FILAMENT_SENSOR + #ifndef PIDTEMPBED if (ms < next_bed_check_ms) return; next_bed_check_ms = ms + BED_CHECK_INTERVAL; @@ -653,16 +676,7 @@ void manage_heater() { soft_pwm_bed = current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP ? (int)pid_output >> 1 : 0; - #elif !defined(BED_LIMIT_SWITCHING) - // Check if temperature is within the correct range - if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) { - soft_pwm_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0; - } - else { - soft_pwm_bed = 0; - WRITE_HEATER_BED(LOW); - } - #else //#ifdef BED_LIMIT_SWITCHING + #elif defined(BED_LIMIT_SWITCHING) // Check if temperature is within the correct band if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) { if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS) @@ -674,58 +688,47 @@ void manage_heater() { soft_pwm_bed = 0; WRITE_HEATER_BED(LOW); } + #else // BED_LIMIT_SWITCHING + // Check if temperature is within the correct range + if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) { + soft_pwm_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0; + } + else { + soft_pwm_bed = 0; + WRITE_HEATER_BED(LOW); + } #endif #endif //TEMP_SENSOR_BED != 0 - - // Control the extruder rate based on the width sensor - #ifdef FILAMENT_SENSOR - if (filament_sensor) { - meas_shift_index = delay_index1 - meas_delay_cm; - if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1; //loop around buffer if needed - - // Get the delayed info and add 100 to reconstitute to a percent of - // the nominal filament diameter then square it to get an area - meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); - float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2); - if (vm < 0.01) vm = 0.01; - volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm; - } - #endif //FILAMENT_SENSOR } #define PGM_RD_W(x) (short)pgm_read_word(&x) // Derived from RepRap FiveD extruder::getTemperature() // For hot end temperature measurement. static float analog2temp(int raw, uint8_t e) { -#ifdef TEMP_SENSOR_1_AS_REDUNDANT - if (e > EXTRUDERS) -#else - if (e >= EXTRUDERS) -#endif - { + #ifdef TEMP_SENSOR_1_AS_REDUNDANT + if (e > EXTRUDERS) + #else + if (e >= EXTRUDERS) + #endif + { SERIAL_ERROR_START; SERIAL_ERROR((int)e); SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM); kill(); return 0.0; - } + } + #ifdef HEATER_0_USES_MAX6675 - if (e == 0) - { - return 0.25 * raw; - } + if (e == 0) return 0.25 * raw; #endif - if(heater_ttbl_map[e] != NULL) - { + if (heater_ttbl_map[e] != NULL) { float celsius = 0; uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); - for (i=1; i raw) - { + for (i = 1; i < heater_ttbllen_map[e]; i++) { + if (PGM_RD_W((*tt)[i][0]) > raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + (raw - PGM_RD_W((*tt)[i-1][0])) * (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / @@ -749,10 +752,8 @@ static float analog2tempBed(int raw) { float celsius = 0; byte i; - for (i=1; i raw) - { + for (i = 1; i < BEDTEMPTABLE_LEN; i++) { + if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / @@ -816,11 +817,11 @@ static void updateTemperaturesFromRawValues() { #endif - - - -void tp_init() -{ +/** + * Initialize the temperature manager + * The manager is implemented by periodic calls to manage_heater() + */ +void tp_init() { #if MB(RUMBA) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1)) //disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector MCUCR=BIT(JTD); @@ -1059,7 +1060,7 @@ void setWatch() { SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id); LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); - disable_heater(); + disable_all_heaters(); disable_all_steppers(); for (;;) { manage_heater(); @@ -1070,7 +1071,7 @@ void setWatch() { #endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION -void disable_heater() { +void disable_all_heaters() { for (int i=0; i= OVERSAMPLENR #ifdef BABYSTEPPING - for (uint8_t axis=X_AXIS; axis<=Z_AXIS; axis++) { - int curTodo=babystepsTodo[axis]; //get rid of volatile for performance + for (uint8_t axis = X_AXIS; axis <= Z_AXIS; axis++) { + int curTodo = babystepsTodo[axis]; //get rid of volatile for performance if (curTodo > 0) { babystep(axis,/*fwd*/true); - babystepsTodo[axis]--; //less to do next time + babystepsTodo[axis]--; //fewer to do next time } - else if(curTodo < 0) { + else if (curTodo < 0) { babystep(axis,/*fwd*/false); - babystepsTodo[axis]++; //less to do next time + babystepsTodo[axis]++; //fewer to do next time } } #endif //BABYSTEPPING diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 847c41b00..f9effaa9e 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -129,7 +129,7 @@ HOTEND_ROUTINES(0); #endif int getHeaterPower(int heater); -void disable_heater(); +void disable_all_heaters(); void setWatch(); void updatePID(); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 293f819c9..d0fe358ac 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -152,10 +152,10 @@ static void lcd_status_screen(); * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) * menu_action_function(lcd_sdcard_pause) * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999) - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedmultiply, 10, 999) - * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedmultiply, 10, 999) - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedmultiply, 10, 999) + * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999) + * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) * */ #define MENU_ITEM(type, label, args...) do { \ @@ -328,28 +328,28 @@ static void lcd_status_screen() { #ifdef ULTIPANEL_FEEDMULTIPLY // Dead zone at 100% feedrate - if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) || - (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)) { + if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) || + (feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) { encoderPosition = 0; - feedmultiply = 100; + feedrate_multiplier = 100; } - if (feedmultiply == 100) { + if (feedrate_multiplier == 100) { if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { - feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; + feedrate_multiplier += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) { - feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; + feedrate_multiplier += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } } else { - feedmultiply += int(encoderPosition); + feedrate_multiplier += int(encoderPosition); encoderPosition = 0; } #endif // ULTIPANEL_FEEDMULTIPLY - feedmultiply = constrain(feedmultiply, 10, 999); + feedrate_multiplier = constrain(feedrate_multiplier, 10, 999); #endif //ULTIPANEL } @@ -456,7 +456,7 @@ void lcd_set_home_offsets() { static void lcd_tune_menu() { START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999); + MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999); #if TEMP_SENSOR_0 != 0 MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); #endif diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 2601575e3..f9ed56a7d 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -550,7 +550,7 @@ static void lcd_implementation_status_screen() { lcd.setCursor(0, 2); lcd.print(LCD_STR_FEEDRATE[0]); - lcd.print(itostr3(feedmultiply)); + lcd.print(itostr3(feedrate_multiplier)); lcd.print('%'); #if LCD_WIDTH > 19 && defined(SDSUPPORT) @@ -567,8 +567,8 @@ static void lcd_implementation_status_screen() { lcd.setCursor(LCD_WIDTH - 6, 2); lcd.print(LCD_STR_CLOCK[0]); - if (starttime != 0) { - uint16_t time = millis()/60000 - starttime/60000; + if (print_job_start_ms != 0) { + uint16_t time = millis()/60000 - print_job_start_ms/60000; lcd.print(itostr2(time/60)); lcd.print(':'); lcd.print(itostr2(time%60)); From 17ad80c1e10254434323cb983862108bce33ca08 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Apr 2015 17:58:47 -0700 Subject: [PATCH 297/302] Spacing in XYZ_CONSTS --- Marlin/Marlin_main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 236b2be32..1f6a0a163 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -928,12 +928,12 @@ static const PROGMEM type array##_P[3] = \ static inline type array(int axis) \ { return pgm_read_any(&array##_P[axis]); } -XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); -XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); -XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); -XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); -XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM); -XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); +XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); +XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); +XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); +XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); +XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM); +XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); #ifdef DUAL_X_CARRIAGE From 642f6a92bc9f1a2a80c5cff581ef6923ba8f2891 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Apr 2015 18:02:17 -0700 Subject: [PATCH 298/302] fix type of code_has_value --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1f6a0a163..c65d88395 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -888,7 +888,7 @@ void get_command() { #endif // SDSUPPORT } -float code_has_value() { +bool code_has_value() { char c = *(strchr_pointer + 1); return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.'; } From e0e68c5cbc9f92d48f3c1f6e46f7151f2ea9f179 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Apr 2015 03:13:25 -0700 Subject: [PATCH 299/302] Rename servos[] array in Marlin to servo[] --- Marlin/Marlin_main.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c65d88395..475362f2c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -379,7 +379,7 @@ bool target_direction; #endif #if NUM_SERVOS > 0 - Servo servos[NUM_SERVOS]; + Servo servo[NUM_SERVOS]; #endif #ifdef CHDK @@ -534,28 +534,28 @@ void suicide() { void servo_init() { #if NUM_SERVOS >= 1 && HAS_SERVO_0 - servos[0].attach(SERVO0_PIN); + servo[0].attach(SERVO0_PIN); #endif #if NUM_SERVOS >= 2 && HAS_SERVO_1 - servos[1].attach(SERVO1_PIN); + servo[1].attach(SERVO1_PIN); #endif #if NUM_SERVOS >= 3 && HAS_SERVO_2 - servos[2].attach(SERVO2_PIN); + servo[2].attach(SERVO2_PIN); #endif #if NUM_SERVOS >= 4 && HAS_SERVO_3 - servos[3].attach(SERVO3_PIN); + servo[3].attach(SERVO3_PIN); #endif // Set position of Servo Endstops that are defined #ifdef SERVO_ENDSTOPS for (int i = 0; i < 3; i++) if (servo_endstops[i] >= 0) - servos[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]); + servo[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]); #endif #if SERVO_LEVELING delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); + servo[servo_endstops[Z_AXIS]].detach(); #endif } @@ -889,7 +889,7 @@ void get_command() { } bool code_has_value() { - char c = *(strchr_pointer + 1); + char c = strchr_pointer[1]; return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.'; } @@ -1255,12 +1255,12 @@ inline void set_destination_to_current() { memcpy(destination, current_position, // Engage Z Servo endstop if enabled if (servo_endstops[Z_AXIS] >= 0) { #if SERVO_LEVELING - servos[servo_endstops[Z_AXIS]].attach(0); + servo[servo_endstops[Z_AXIS]].attach(0); #endif - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); + servo[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); #if SERVO_LEVELING delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); + servo[servo_endstops[Z_AXIS]].detach(); #endif } @@ -1319,14 +1319,14 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #endif #if SERVO_LEVELING - servos[servo_endstops[Z_AXIS]].attach(0); + servo[servo_endstops[Z_AXIS]].attach(0); #endif - servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); + servo[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]); #if SERVO_LEVELING delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_endstops[Z_AXIS]].detach(); + servo[servo_endstops[Z_AXIS]].detach(); #endif } @@ -1520,7 +1520,7 @@ static void homeaxis(AxisEnum axis) { #endif { if (servo_endstops[axis] > -1) - servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); + servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); } #endif // SERVO_ENDSTOPS && !Z_PROBE_SLED @@ -1598,7 +1598,7 @@ static void homeaxis(AxisEnum axis) { // Retract Servo endstop if enabled #ifdef SERVO_ENDSTOPS if (servo_endstops[axis] > -1) - servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]); + servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]); #endif #if SERVO_LEVELING && !defined(Z_PROBE_SLED) @@ -3990,12 +3990,12 @@ inline void gcode_M226() { servo_position = code_value(); if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) { #if SERVO_LEVELING - servos[servo_index].attach(0); + servo[servo_index].attach(0); #endif - servos[servo_index].write(servo_position); + servo[servo_index].write(servo_position); #if SERVO_LEVELING delay(PROBE_SERVO_DEACTIVATION_DELAY); - servos[servo_index].detach(); + servo[servo_index].detach(); #endif } else { @@ -4010,7 +4010,7 @@ inline void gcode_M226() { SERIAL_PROTOCOL(" Servo "); SERIAL_PROTOCOL(servo_index); SERIAL_PROTOCOL(": "); - SERIAL_PROTOCOL(servos[servo_index].read()); + SERIAL_PROTOCOL(servo[servo_index].read()); SERIAL_EOL; } } From 3f02da646c88ec0a8a332f59cede0d1901e1e251 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Apr 2015 03:41:37 -0700 Subject: [PATCH 300/302] Make sure axis_active is cleared for #1908 --- Marlin/planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index a452428d7..060be3007 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -393,7 +393,7 @@ void plan_init() { #endif void check_axes_activity() { - unsigned char axis_active[NUM_AXIS], + unsigned char axis_active[NUM_AXIS] = { 0 }, tail_fan_speed = fanSpeed; #ifdef BARICUDA unsigned char tail_valve_pressure = ValvePressure, From 5dd87d2e740b2f7096e6869ae67e250adfdd92f9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Apr 2015 04:05:51 -0700 Subject: [PATCH 301/302] Enable all old_z_*_endstop vars for Z_DUAL_ENDSTOPS - Potentially addressing #1911 --- Marlin/stepper.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 2ad555327..9a243caab 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -98,19 +98,12 @@ static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_P #if HAS_Y_MAX static bool old_y_max_endstop = false; #endif -#if HAS_Z_MIN - static bool old_z_min_endstop = false; -#endif -#if HAS_Z_MAX - static bool old_z_max_endstop = false; -#endif + #ifdef Z_DUAL_ENDSTOPS - // #if HAS_Z2_MIN - static bool old_z2_min_endstop = false; - // #endif - // #if HAS_Z2_MAX - static bool old_z2_max_endstop = false; - // #endif + static bool old_z_min_endstop = false; + static bool old_z_max_endstop = false; + static bool old_z2_min_endstop = false; + static bool old_z2_max_endstop = false; #endif #ifdef Z_PROBE_ENDSTOP // No need to check for valid pin, SanityCheck.h already does this. From 7336e6df070a2f20e5f2cb9b3ac2d40c9da0c8c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Apr 2015 04:55:20 -0700 Subject: [PATCH 302/302] Always define old_z, not always z2 --- Marlin/stepper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 9a243caab..f11cc0430 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -99,9 +99,10 @@ static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_P static bool old_y_max_endstop = false; #endif +static bool old_z_min_endstop = false; +static bool old_z_max_endstop = false; + #ifdef Z_DUAL_ENDSTOPS - static bool old_z_min_endstop = false; - static bool old_z_max_endstop = false; static bool old_z2_min_endstop = false; static bool old_z2_max_endstop = false; #endif