19
Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: [email protected] Sales and commercial support: [email protected]

Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: [email protected]

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 2: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Table of contents:

1 Introduction 3

2 Wiring Connection to Pixhawk 3 2.1 TeraRanger wiring connection - Pixhawk 2.1 3

2.1.1 TeraRanger Evo wiring connection 3 2.1.1 TeraRanger One wiring connection 5

2.2 TeraRanger wiring connection - Pixhawk 1 7 2.2.1 TeraRanger Evo wiring connection 7 2.2 .2 TeraRanger One wiring connection 9

3 Setup the onboard firmware 12 3.1 PX4 - QGroundControl 12 3.2 ArduCopter - QGroundControl 14 3.3 ArduCopter - APM Planner 2 15 3.4 ArduCopter - Mission Planner 17

4 Compatibility table 19

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

2/19

Page 3: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

1 Introduction The purpose of this document is to explain how to connect a TeraRanger sensor to a Pixhawk board through the I2C interface and how to setup PX4 or ArduPilot firmware to enable TeraRanger sensor use.

2 Wiring Connection to Pixhawk

2.1 TeraRanger wiring connection - Pixhawk 2.1

2.1.1 TeraRanger Evo wiring connection For brevity we will refer to TeraRanger Evo as TR-Evo. To connect a TeraRanger Evo sensor module to Pixhawk please make sure you have a TeraRanger Evo I2C version, composed of:

1. TR-Evo sensor 2. TR-I2C/UART backboard 3. DF13 9P to open-ended cable

To connect the sensor to the Pixhawk, please use the open-ended cable and make your connection as shown below:

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

3/19

Page 4: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Pixhawk I2C connector ref is : JST-GH 4pins

Evo I2C backboard pins Pixhawk 2.1 I2C port pins Color

1 Tx 2 Rx

3 GND 4 SDA 3 SDA Blue 5 SCL 2 SCL Green

6 7 VCC 1 VCC Orange 8 GND 4 GND Black

9

Then connect the cable to the Pixhawk I2C port:

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

4/19

Page 5: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Please note that Pixhawk 2 has multiple I2C buses. Support for handling these has only been added to ArduCopter. Therefore this connection does not currently work for PX4 firmware.

2.1.1 TeraRanger One wiring connection For brevity we will refer to the TeraRanger One distance sensor module as TR-One. Please make sure you have a TR-One and a TR-I2C adapter :

1. TR-One sensor 2. TR-I2C adapter

To connect the sensor to the Pixhawk, please solder the power cable to the I2C adapter as described below:

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

5/19

Page 6: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Take the I2C cable included in the Pixhawk 2.1 box and make your own connection as described below:

TR-I2C Adapter pins Pixhawk 2.1 I2C port pins Color 1 VCC 1 VCC Orange 2 SCL 2 SCL Green 3 SDA 3 SDA Blue 4 GND 4 GND Black

Now connect the I2C adaptor to the Pixhawk and the TR-One to the I2C Adaptor:

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

6/19

Page 7: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

2.2 TeraRanger wiring connection - Pixhawk 1

2.2.1 TeraRanger Evo wiring connection For brevity we will refer to TeraRanger Evo as TR-Evo. To connect a TeraRanger Evo sensor module to Pixhawk please make sure you have a TeraRanger Evo I2C version, composed of:

4. TR-Evo sensor 5. TR-I2C/UART backboard 6. DF13 9P to open-ended cable

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

7/19

Page 8: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

To connect the sensor to the Pixhawk, please use the open-ended cable and make your connection as shown below:

Pixhawk I2C connector ref is : DF13 4pins

Evo I2C backboard pins Pixhawk I2C port pins Color 1 Tx 2 Rx

3 GND 4 SDA 3 SDA Blue 5 SCL 2 SCL Green

6 7 VCC 1 VCC Orange 8 GND 4 GND Black

9

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

8/19

Page 9: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Then connect the cable to the Pixhawk I2C port:

2.2 .2 TeraRanger One wiring connection For brevity we will refer to the TeraRanger One distance sensor module as TR-One. Please make sure you have a TR-One and a TR-I2C adapter :

3. TR-One sensor 4. TR-I2C adapter

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

9/19

Page 10: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

To connect the sensor to the Pixhawk, please solder the power cable to the I2C adapter as described below:

Now connect the I2C adaptor to the Pixhawk via a DF13 4S cable (included in the Pixhawk box) and the TR-One to the I2C Adaptor:

TR-I2C Adapter pins Pixhawk I2C port pins

1 VCC 1 VCC 2 SCL 2 SCL 3 SDA 3 SDA 4 GND 4 GND

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

10/19

Page 11: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

11/19

Page 12: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

3 Setup the onboard firmware

3.1 PX4 - QGroundControl Note: Please always use the latest QGroundControl version, available from: https://docs.qgroundcontrol.com/en/getting_started/download_and_install.html

1. Launch QGroundControl software

2. Open Vehicle setup menu and go into the Firmware tab (unplug and replug autopilot

if needed).

Select PX4 Flight Stack and through Advanced settings, Developer Build. (Warning: Developer Build is experimental state software. Use at your own risk!)

3. Go to Parameters/Sensor Enable In the field SENS_EN_TRANGER select your TeraRanger sensor type:

● TR-Evo ● TR-One

Press Save to confirm.

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

12/19

Page 13: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

4. After making sure the sensor is connected to the Pixhawk I2C port, reboot the autopilot.

5. To verify that the sensor is operational open an Analyze Widget (Widgets/Analyze).

From the list on the left hand side select; M1:DISTANCE_SENSOR.current_distance. The plot showing distance measurements should indicate that the sensor is working correctly.

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

13/19

Page 14: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

3.2 ArduCopter - QGroundControl

1. Go to the Firmware tab on QGroundControl (reconnect autopilot in order to flash a new firmware). Select ArduPilot Flight Stack. In the dropdown menu select MultiRotor - APM:Copter. Check Advanced settings and select Developer Build (master) (Warning: This is test firmware. Fly at your own risk!). Press OK to flash the updated firmware.

2. Go to Parameters/RNGFND and update the following fields: ● RNGFND_TYPE : 14 / TrOneI2c / TeraRangerI2C

(each of these values should work, but they might appear differently based on the GCS software version.)

● RNGFND_ADDR: ○ TR-Evo : 49 ○ TR-One : 48

● RNGFND_MIN_CM: ○ TR-Evo : 50 ○ TR-One : 20

● RNGFND_MAX_CM: ○ TR-Evo : 6000 ○ TR-One : 1400

After setting the values in these fields, please reboot the autopilot.

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

14/19

Page 15: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

3. To verify that the sensor is operational open an Analyze Widget (Widgets/Analyze).

From the list on the left hand side select; M1:DISTANCE_SENSOR.current_distance. The plot showing distance measurements should indicate that the sensor is working correctly.

3.3 ArduCopter - APM Planner 2 Please make sure you are running the latest version of APM Planner 2, available here: http://firmware.ardupilot.org/Tools/APMPlanner/

1. Open APM Planner. Go to Initial Setup, Instal Firmware and flash the latest firmware of ArduPilot.

2. Click on USB device name on the right hand side

and select the appropriate Serial Port and Baud Rate for your device and press the Connect button.

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

15/19

Page 16: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

3. Go to Parameters/RNGFND and update the following fields:

● RNGFND_TYPE : 14 / TrOneI2c / TeraRangerI2C (each of these values should work, but they might appear differently based on GCS software version.)

● RNGFND_ADDR: ○ TR-One : 48

● RNGFND_MIN_CM: ○ TR-One : 20

● RNGFND_MAX_CM: ○ TR-One : 1400

4. Reboot the autopilot and select the GRAPHS tab. On the right hand side you should

see the messages from the autopilot. From the list select; DISTANCE_SENSOR/current_distance:

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

16/19

Page 17: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

3.4 ArduCopter - Mission Planner Please ensure you are running the latest version of Mission Planner, available here: http://firmware.ardupilot.org/Tools/MissionPlanner/

1. Open Mission Planner. Go to Initial Setup, Instal Firmware and flash the latest firmware.

2. Click on USB device name on the right hand side and select appropriate Serial Port

and Baud Rate for your device and press the Connect button.

3. Go to Parameters/RNGFND and update the following fields: ● RNGFND_TYPE : 14 / TrOneI2c / TeraRangerI2C (each of these values

should work, but they might appear differently based on GCS software version.)

● RNGFND_ADDR: ○ TR-One : 48

● RNGFND_MIN_CM: ○ TR-One : 20

● RNGFND_MAX_CM: ○ TR-One : 1400

4. Reboot the autopilot and select the Flight Data tab. On the left window you should

see a quick tab with displayed value. Double click on one and check SonarRange. The distance is now displayed on the Quick flight data menu.

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

17/19

Page 18: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

18/19

Page 19: Home - 3DXR - Unmanned Aerial Systems & …...Instruction Manual for: TeraRanger Sensor Connection to Pixhawk Autopilots Published October 2017 Technical support: support@teraranger.com

4 Compatibility table At the time of writing, to make the TeraRanger Evo sensor work you must use the developer build version of PX4 or Arducopter. QGroundControl makes it easy to flash the required firmware through the advanced settings. For APM 2 software, see here: http://firmware.ardupilot.org/. Refer to the table below for compatibility.

Sensor Version

Firmware Version TR-One TR-Evo

PX4-Dev APM:CopterV3.6-dev Yes Yes

PX4 Flight Stack v1.6.5 (Stable Release)

APM:CopterV3.5.3 Yes No

Software

Firmware Version QGroundControl

APM 2 Mission Planner

PX4-Dev APM:CopterV3.6-dev Yes No No

PX4 Flight Stack v1.6.5 Stable Release

APM:CopterV3.5.3 Yes Yes Yes

Copyright © Terabee 2017 Terabee, 90 Rue Henri Fabre, 01630, St Genis-Pouilly, France

19/19