Deploying to gh-pages from @ Klipper3d/klipper@d725dfd309 🚀

This commit is contained in:
KevinOConnor
2023-07-28 00:04:14 +00:00
parent 035fe8eafd
commit f970b964d2
283 changed files with 11604 additions and 2400 deletions

View File

@@ -1216,6 +1216,13 @@
USB轉CAN bus橋接模式
</a>
</li>
<li class="md-nav__item">
<a href="#tips-for-troubleshooting" class="md-nav__link">
Tips for troubleshooting
</a>
</li>
</ul>
@@ -1233,8 +1240,8 @@
<li class="md-nav__item">
<a href="CANBUS_Troubleshooting.md" class="md-nav__link">
None
<a href="CANBUS_Troubleshooting.html" class="md-nav__link">
CANBUS Troubleshooting
</a>
</li>
@@ -1356,6 +1363,13 @@
USB轉CAN bus橋接模式
</a>
</li>
<li class="md-nav__item">
<a href="#tips-for-troubleshooting" class="md-nav__link">
Tips for troubleshooting
</a>
</li>
</ul>
@@ -1378,25 +1392,20 @@
<h1 id="can">CAN 匯流排<a class="headerlink" href="#can" title="Permanent link">&para;</a></h1>
<p>本文件描述了 Klipper 的 CAN 匯流排支援。</p>
<h2 id="_1">裝置硬體<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h2>
<p>Klipper currently supports CAN on stm32, same5x, and rp2040 chips. In addition, the micro-controller chip must be on a board that has a CAN transceiver.</p>
<p>Klipper currently supports CAN on stm32, SAME5x, and rp2040 chips. In addition, the micro-controller chip must be on a board that has a CAN transceiver.</p>
<p>要針對 CAN 進行編譯,請執行 <code>make menuconfig</code>並選擇"CAN Bus"作為通訊介面。最後,編譯微控制器程式碼並將其刷寫到目標控制版上。</p>
<h2 id="_2">主機硬體<a class="headerlink" href="#_2" title="Permanent link">&para;</a></h2>
<p>爲了使用 CAN 匯流排,主機需要一個適配器。目前有兩種常見的選擇:</p>
<ol>
<li>使用<a href="https://www.waveshare.com/rs485-can-hat.htm">Waveshare Raspberry Pi CAN hat</a>或其眾多克隆中的一個。</li>
<li>使用一個USB CAN適配器例如<a href="https://hacker-gadgets.com/product/cantact-usb-can-adapter/">https://hacker-gadgets.com/product/cantact-usb-can-adapter/</a>。有許多不同的USB到CAN適配器—當選擇時我們建議驗證它是否能執行<a href="https://github.com/candle-usb/candleLight_fw">candlelight 韌體</a>。(不幸的是我們發現一些USB適配器執行有缺陷的韌體並被鎖死所以在購買前要進行覈實。</li>
</ol>
<p>In order to use a CAN bus, it is necessary to have a host adapter. It is recommended to use a "USB to CAN adapter". There are many different USB to CAN adapters available from different manufacturers. When choosing one, we recommend verifying that the firmware can be updated on it. (Unfortunately, we've found some USB adapters run defective firmware and are locked down, so verify before purchasing.) Look for adapters that can run Klipper directly (in its "USB to CAN bridge mode") or that run the <a href="https://github.com/candle-usb/candleLight_fw">candlelight firmware</a>.</p>
<p>還需要將主機操作系統配置為使用適配器。通常可以通過建立一個名為 <code>/etc/network/interfaces.d/can0</code> 的新檔案來實現,該檔案包含以下內容:</p>
<div class="highlight"><pre><span></span><code>auto can0
<div class="highlight"><pre><span></span><code>allow-hotplug can0
iface can0 can static
bitrate 500000
bitrate 1000000
up ifconfig $IFACE txqueuelen 128
</code></pre></div>
<p>注意,"Raspberry Pi CAN hat" 需要額外<a href="https://www.waveshare.com/wiki/RS485_CAN_HAT">對 config.txt 進行修改</a></p>
<h2 id="_3">終端電阻<a class="headerlink" href="#_3" title="Permanent link">&para;</a></h2>
<p>CAN匯流排在 CANH 和 CANL 導線之間必須兩個 120 歐姆的電阻。理想情況下,匯流排的兩端各有一個電阻。</p>
<p>請注意有些裝置有一個內建的120歐姆電阻例如"Waveshare Raspberry Pi CAN hat"有一個難以拆除的貼片電阻)。有些裝置根本不帶有一個電阻。其他裝置有一個選擇電阻的機制(通常是一個跳線)。一定要檢查 CAN 匯流排上所有裝置的原理圖以確認匯流排上有兩個而且只有兩個120歐姆的電阻。</p>
<p>Note that some devices have a builtin 120 ohm resistor that can not be easily removed. Some devices do not include a resistor at all. Other devices have a mechanism to select the resistor (typically by connecting a "pin jumper"). Be sure to check the schematics of all devices on the CAN bus to verify that there are two and only two 120 Ohm resistors on the bus.</p>
<p>要測試電阻是否正確,先切斷印表機的電源,並用多用表檢查 CANH 和 CANL 線之間的阻值—在正確接線的 CAN 匯流排上它應該報告大約60 歐姆。</p>
<h2 id="canbus_uuid">尋找新微控制器的 canbus_uuid<a class="headerlink" href="#canbus_uuid" title="Permanent link">&para;</a></h2>
<p>CAN 匯流排上的每個微控制器都根據編碼到每個微控制器中的工廠晶片識別符號分配了一個唯一的 ID。要查詢每個微控制器裝置 ID請確保硬體已正確供電和接線然後執行</p>
@@ -1416,20 +1425,31 @@ canbus_uuid: 11aa22bb33cc
</code></pre></div>
<h2 id="usbcan-bus">USB轉CAN bus橋接模式<a class="headerlink" href="#usbcan-bus" title="Permanent link">&para;</a></h2>
<p>一些微控制器支持在“make menuconfig”期間選擇“USB CAN bus 橋接模式”。這種模式可以允許將微控制器用作“USB CAN bus適配器”和 Klipper 節點。</p>
<p> Klipper 使用此模式時,微控制器在 Linux 下顯示為“USB CAN bus適配器”。 “Klipper 橋接單片機”本身將出現在此 CAN bus - 它可以通過<code>canbus_query.py</code>識別並像其他 CAN bus Klipper 節點一樣配置。它將與實際位於 CAN bus上的其他設備一起出現。</p>
<p>Some micro-controllers support selecting "USB to CAN bus bridge" mode during Klipper's "make menuconfig". This mode may allow one to use a micro-controller as both a "USB to CAN bus adapter" and as a Klipper node.</p>
<p>When Klipper uses this mode the micro-controller appears as a "USB CAN bus adapter" under Linux. The "Klipper bridge mcu" itself will appear as if it was on this CAN bus - it can be identified via <code>canbus_query.py</code> and it must be configured like other CAN bus Klipper nodes.</p>
<p>使用此模式時的一些重要注意事項:</p>
<ul>
<li>"橋接MCU”實際上不在 CAN bus上。消息進出不會消耗 CAN bus上的帶寬。可能在 CAN bus上的其他適配器無法看到該 mcu。</li>
<li>為了與總線通信,必須在 Linux 中配置 <code>can0</code>或類似的接口。但是Klipper 忽略了 Linux CAN 總線速度和 CAN 總線位定時選項。目前CAN 總線頻率在“make menuconfig”期間指定Linux 中指定的總線速度被忽略。</li>
<li>Whenever the "bridge mcu" is reset, Linux will disable the corresponding <code>can0</code> interface. To ensure proper handling of FIRMWARE_RESTART and RESTART commands, it is recommended to replace <code>auto</code> with <code>allow-hotplug</code> in the <code>/etc/network/interfaces.d/can0</code> file. For example:</li>
<li>Whenever the "bridge mcu" is reset, Linux will disable the corresponding <code>can0</code> interface. To ensure proper handling of FIRMWARE_RESTART and RESTART commands, it is recommended to use <code>allow-hotplug</code> in the <code>/etc/network/interfaces.d/can0</code> file. For example:</li>
</ul>
<div class="highlight"><pre><span></span><code>allow-hotplug can0
iface can0 can static
bitrate 500000
bitrate 1000000
up ifconfig $IFACE txqueuelen 128
</code></pre></div>
<ul>
<li>
<p>The "bridge mcu" is not actually on the CAN bus. Messages to and from the bridge mcu will not be seen by other adapters that may be on the CAN bus.</p>
<ul>
<li>The available bandwidth to both the "bridge mcu" itself and all devices on the CAN bus is effectively limited by the CAN bus frequency. As a result, it is recommended to use a CAN bus frequency of 1000000 when using "USB to CAN bus bridge mode".Even at a CAN bus frequency of 1000000, there may not be sufficient bandwidth to run a <code>SHAPER_CALIBRATE</code> test if both the XY steppers and the accelerometer all communicate via a single "USB to CAN bus" interface.</li>
<li>A USB to CAN bridge board will not appear as a USB serial device, it will not show up when running <code>ls /dev/serial/by-id</code>, and it can not be configured in Klipper's printer.cfg file with a <code>serial:</code> parameter. The bridge board appears as a "USB CAN adapter" and it is configured in the printer.cfg as a <a href="#configuring-klipper">CAN node</a>.</li>
</ul>
</li>
</ul>
<h2 id="tips-for-troubleshooting">Tips for troubleshooting<a class="headerlink" href="#tips-for-troubleshooting" title="Permanent link">&para;</a></h2>
<p>See the <a href="CANBUS_Troubleshooting.html">CAN bus troubleshooting</a> document.</p>
</article>
</div>
@@ -1463,13 +1483,13 @@ iface can0 can static
<a href="TSL1401CL_Filament_Width_Sensor.html" class="md-footer__link md-footer__link--next" aria-label="下一頁: TSL1401CL 耗材寬度感測器" rel="next">
<a href="CANBUS_Troubleshooting.html" class="md-footer__link md-footer__link--next" aria-label="下一頁: CANBUS Troubleshooting" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
下一頁
</span>
TSL1401CL 耗材寬度感測器
CANBUS Troubleshooting
</div>
</div>
<div class="md-footer__button md-icon">