{"id":125,"date":"2023-09-13T09:31:57","date_gmt":"2023-09-13T09:31:57","guid":{"rendered":"http:\/\/doc.yjuav.net\/en\/?page_id=125"},"modified":"2023-09-15T05:55:01","modified_gmt":"2023-09-15T05:55:01","slug":"can-module-interface-configuration","status":"publish","type":"page","link":"https:\/\/doc.yjuav.net\/en\/index.php\/device\/can-module-interface-configuration\/","title":{"rendered":"CAN module interface configuration"},"content":{"rendered":"\n<h2 id='overview'  id=\"boomdevs_1\" class=\"wp-block-heading\" >Overview<\/h2>\n\n\n\n<p>Flight controller needs to set CAN interface parameters to identify external CAN module devices.<\/p>\n\n\n\n<p>Some CAN modules have internal parameters that configure the functions of the CAN module.<\/p>\n\n\n\n<h2 id='ardupilot-flight-controller'  id=\"boomdevs_2\" class=\"wp-block-heading\" >Ardupilot Flight Controller<\/h2>\n\n\n\n<p>The <a rel=\"noreferrer noopener\" href=\"https:\/\/ardupilot.org\/planner\/docs\/mission-planner-installation.html#install-mission-planner\" target=\"_blank\">Mission Planner<\/a> PC software was used for parameter setting.<\/p>\n\n\n\n<h3 id='set-flight-controller-parameters'  id=\"boomdevs_3\" class=\"wp-block-heading\" >Set flight controller parameters<\/h3>\n\n\n\n<p>Connect to the flight controller and open the host computer software page(CONFIG->Full Parameter Tree).<\/p>\n\n\n\n<p>Search for and set the following parameters and restart the flight controller after prompting for successful writing of the parameters.<\/p>\n\n\n\n<p>Generally, flight controllers have two CAN buses, CAN1 or CAN2. Connect the CAN module device according to the corresponding CAN interface of the flight controller, and set the corresponding parameters to communicate normally with the peripheral CAN device.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/CAN1 Interface\r\nCAN_P1_DRIVER = 1\r\nCAN_D1_PROTOCOL = 1\r\n\/\/CAN2 Interface \r\nCAN_P2_DRIVER = 1\r\nCAN_D2_PROTOCOL = 1<\/code><\/pre>\n\n\n\n<h3 id='set-can-module-parameters'  id=\"boomdevs_4\" class=\"wp-block-heading\" >Set CAN module parameters<\/h3>\n\n\n\n<p>If you do not need to modify the internal parameters of the CAN module or view the data of the CAN module, you do not need to perform the following operations.<\/p>\n\n\n\n<h4 id='connect-the-can-module'  id=\"boomdevs_5\" class=\"wp-block-heading\" >Connect the CAN module<\/h4>\n\n\n\n<p>Connect the host computer by USB, set the following parameters, and turn on the SLCAN function to map the CAN1\/CAN2 interface to a USB port.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Maps the CAN1 interface\nCAN_SLCAN_CPORT = 1\nSERIAL7_PROTOCOL = 22\n\/\/Maps the CAN2 interface\nCAN_SLCAN_CPORT = 2\nSERIAL7_PROTOCOL = 22<\/code><\/pre>\n\n\n\n<p>After the flight controller is powered off and restarted, when reconnecting the host computer software, you need to select the serial port containing SLCAN characters, and you do not need to click <strong>\u201cCONNECT\u201d<\/strong> at this time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"372\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-1-1024x372.png\" alt=\"\" class=\"wp-image-167\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-1-1024x372.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-1-300x109.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-1-768x279.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-1.png 1028w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Open the host computer software page(SETUP->Optional Hardware->DroneCAN\/UAVCAN),click the <strong>&#8220;SLCan Direct&#8221;<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"252\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-3-1024x252.png\" alt=\"\" class=\"wp-image-171\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-3-1024x252.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-3-300x74.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-3-768x189.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-3-1536x377.png 1536w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-3-2048x503.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The flight controller will automatically scan the module device on the corresponding CAN bus, the scan result will present a list of devices, click the corresponding device Menu button, you can view data, view parameter, parameter modification, firmware upgrade and other operations.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"219\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-4-1024x219.png\" alt=\"\" class=\"wp-image-174\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-4-1024x219.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-4-300x64.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-4-768x164.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-4.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Mission planner host computer software version 1.3.8 or later, you can also choose to use MAVlink to view the peripheral list of DroneCAN without setting flight control parameters.<\/p>\n\n\n\n<p>Connect to the host computer software via USB or telemetry,open the page (SETUP->Optional Hardware->DroneCAN\/UAVCAN).<\/p>\n\n\n\n<p>Select <strong>&#8220;MAVlink-CAN1&#8221;<\/strong> or <strong>&#8220;MAVlink-CAN2&#8221;<\/strong> to view the module devices mounted on the corresponding CAN bus.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"183\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-5-1024x183.png\" alt=\"\" class=\"wp-image-179\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-5-1024x183.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-5-300x54.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-5-768x137.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-5.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 id='parameter-setting'  id=\"boomdevs_6\" class=\"wp-block-heading\" >Parameter setting<\/h4>\n\n\n\n<p>Find the corresponding CAN module device in the device list and click <strong>&#8220;Menu->Parameters&#8221;<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"361\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-6-1024x361.png\" alt=\"\" class=\"wp-image-183\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-6-1024x361.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-6-300x106.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-6-768x271.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-6.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After opening the parameter setting window, you can set the internal parameters of the CAN module here, and after modifying the parameters, you should click <strong>&#8220;Write Params&#8221;<\/strong> to save the parameters.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"579\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-7-1024x579.png\" alt=\"\" class=\"wp-image-186\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-7-1024x579.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-7-300x170.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-7-768x434.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-7-1536x869.png 1536w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-7.png 1558w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 id='view-data'  id=\"boomdevs_7\" class=\"wp-block-heading\" >View data<\/h4>\n\n\n\n<p>Click the <strong>&#8220;Inspector&#8221;<\/strong> button in the page to view real-time data for each device on the CAN bus.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-8-1024x567.png\" alt=\"\" class=\"wp-image-188\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-8-1024x567.png 1024w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-8-300x166.png 300w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-8-768x425.png 768w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-8.png 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 id='px4-flight-controller'  id=\"boomdevs_8\" class=\"wp-block-heading\" >PX4 Flight Controller<\/h2>\n\n\n\n<p>Use <a href=\"https:\/\/docs.qgroundcontrol.com\/master\/en\/getting_started\/download_and_install.html\" target=\"_blank\" rel=\"noreferrer noopener\">QGoundControl<\/a> host computer software for parameter setting.<\/p>\n\n\n\n<h3 id='set-flight-controller-parameters-1'  id=\"boomdevs_9\" class=\"wp-block-heading\" >Set flight controller parameters<\/h3>\n\n\n\n<p>Connect to the flight controller, set the following parameters and restart.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UAVCAN_ENABLE = Sensors Automatic Config<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"856\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-9.png\" alt=\"\" class=\"wp-image-194\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-9.png 834w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-9-292x300.png 292w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-9-768x788.png 768w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/figure>\n\n\n\n<h3 id='set-can-module-parameters-1'  id=\"boomdevs_10\" class=\"wp-block-heading\" >Set CAN module parameters<\/h3>\n\n\n\n<p>Open the host computer page(Vehicle Setup -> Parameters),swipe the page to the very bottom position and you can see the CAN device.<\/p>\n\n\n\n<p>For example, in the figure below, the CAN device is \u201cComponent 125\u201d, click to expand to see the parameters of the device, and then you can directly modify the parameters of the CAN device here,remember to save the parameters after modification.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"851\" src=\"http:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-10.png\" alt=\"\" class=\"wp-image-199\" srcset=\"https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-10.png 755w, https:\/\/doc.yjuav.net\/en\/wp-content\/uploads\/2023\/09\/image-10-266x300.png 266w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Note: At present, in the PX4 firmware, the internal parameters of the CAN device can only be modified through the CAN1 interface, and this cannot be done if the CAN device is connected to the CAN2 port.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Overview Flight controller needs to set CAN interface p &#8230; <a title=\"CAN module interface configuration\" class=\"read-more\" href=\"https:\/\/doc.yjuav.net\/en\/index.php\/device\/can-module-interface-configuration\/\" aria-label=\"\u7ee7\u7eed\u9605\u8bfbCAN module interface configuration\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":21,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-125","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/pages\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":33,"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/pages\/125\/revisions"}],"predecessor-version":[{"id":202,"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/pages\/125\/revisions\/202"}],"up":[{"embeddable":true,"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/pages\/21"}],"wp:attachment":[{"href":"https:\/\/doc.yjuav.net\/en\/index.php\/wp-json\/wp\/v2\/media?parent=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}