Deploying to gh-pages from @ Klipper3d/klipper@d725dfd309 🚀
This commit is contained in:
@@ -1216,6 +1216,13 @@
|
||||
USB转CAN总线桥接模式
|
||||
</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总线桥接模式
|
||||
</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">¶</a></h1>
|
||||
<p>本文档描述了 Klipper 的 CAN 总线支持。</p>
|
||||
<h2 id="_1">硬件设备<a class="headerlink" href="#_1" title="Permanent link">¶</a></h2>
|
||||
<p>Klipper目前支持在stm32、same5x和rp2040芯片上使用CAN总线。此外,微控制器芯片必须和一个CAN收发器相连。</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">¶</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">¶</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">¶</a></h2>
|
||||
<p>CAN 总线上的每个微控制器都根据编码到每个微控制器中的工厂芯片标识符分配了一个唯一的 ID。要查找每个微控制器设备 ID,请确保硬件已正确供电和接线,然后运行:</p>
|
||||
@@ -1416,20 +1425,31 @@ canbus_uuid: 11aa22bb33cc
|
||||
</code></pre></div>
|
||||
|
||||
<h2 id="usbcan">USB转CAN总线桥接模式<a class="headerlink" href="#usbcan" title="Permanent link">¶</a></h2>
|
||||
<p>一些微控制器支持在 "make menuconfig "中选择 "USB 转 CAN 总线桥接"模式。这种模式可以把微控制器作为 "USB到CAN总线适配器"的同时作为Klipper节点使用。</p>
|
||||
<p>当Klipper使用这种模式时,微控制器在 Linux 下会显示为一个 "USB CAN总线适配器"。“Klipper 桥接 mcu "本身将出现在这个CAN总线上--它可以通过<code>canbus_query.py</code> ,并像其他CAN总线Klipper节点一样被配置。它将与其他实际在CAN总线上的设备一起出现。</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总线上。传入和传出的消息不会占用CAN总线上的带宽。因此位于CAN总线上的其他适配器无法看到MCU。</li>
|
||||
<li>有必要在Linux中配置<code>can0</code> (或类似)接口,以便与总线通信。然而,Klipper 会忽略 Linux的CAN总线速度和 CAN 总线bit-timing选项。目前,CAN总线的频率需要在 "make menuconfig "中指定。Linux中指定的总线速度会被忽略。</li>
|
||||
<li>每当 "bridge mcu "被重置时,Linux 将禁用相应的<code>can0</code> 接口。为了确保正确处理 FIRMWARE_RESTART 和 RESTART 命令,建议在<code>/etc/network/interfaces.d/can0</code> 文件中用<code>allow-hotplug</code> 替换<code>auto</code> 。例如:</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">¶</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">
|
||||
|
||||
Reference in New Issue
Block a user