Part 2/2 How to setup Pixhawk with two rangefinder sensors, object avoidance and height estimation.

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024
  • Make sure you also watch the first part of the video (link below) so you avoid any knowledge gaps.
    • Part 1/2 Benewake TF m...
    This video explains what parameters need to be changed so that Pixhawk recognizes two rangefinder sensors.
    Get the items I used here:
    All in one Drone kit:
    www.banggood.c...
    TF Mini Lidar Module:
    www.banggood.c...
    Pixhawk Flight Controller:
    www.banggood.c...
    S500 Frame:
    www.banggood.c...
    Frsky r-xsr Receiver:
    www.banggood.c...
    Frsky Qx7 Transmitter:
    www.banggood.c...
    ISDT Battery Charger (strongly recomended!):
    www.banggood.c...
    Get a coupon from Bangood!
    Hey friends! I am a VIP5 who has been enjoying Banggood for over 979 days. I have found lots of high-quality and low-cost products. Come on! Join now to get $20.
    www.banggood.c...
    Usefull websites to read for more in depth understanding:
    ardupilot.org/c...
    ardupilot.org/d...
    ardupilot.org/c...
    en.benewake.com...
    Pixhawk is the upgrade of APM and PX4, of which APM uses conventional 8-bit SCM with limited arithmetic capability. While the PX4 is a transitional product starting to use STM32F4. Pixhawk is more refined and reliable flight control system developed from PX4. For the details of this series of the open source flight control system, refer to ardupilot.org/. This website reliably introduces Pixhawk in details, and thus it is much helpful for the user to learn and familiarize himself with the flight control system.
    TFmini can be connected with Pixhawk for use. By selecting Pixhawk data output format, the TFmini can directly be connected with the serial port of Pixhawk, and also it can connect with other communication interfaces (e.g. IC²) of Pixhawk via appropriate adaptors. TFmini can be used in flight device for altitude holding. It is recommended that Pixhawk adopts ArduCopter V3.4.9-V3.5.5 firmware.
    The parameters are listed below:
    follow the normal instructions for setting up rangefinders.
    set the RNGFNDx_ORIENT parameters (i.e. RNGFND_ORIENT, RNGFND2_ORIENT) to specify the direction the range finder is pointing in (i.e. 0=Forward, 2=Right, 4=Back, 6=Left, 24=Up, 25=Down)
    set PRX_TYPE = “4” to enable using range finders as “proximity sensors”.
    set AVOID_ENABLE to “7” to enable avoidance using proximity sensors (and fences)
    a) TFmini for Mission Planner configuration description for pixhawk in altitude hold mode
    Connect the flight control board to MP, Select [Full Parameter List] in the left from the below bar- [CONFIG/TUNING] . Find and modify the following parameters:
    AVOID_MARGIN=1
    SERIAL2_PROTOCOL = 9 (Lidar)
    SERIAL2_BAUD = 115
    RNGFND_TYPE = 8 (LightWareSerial) or 20 (benewaketf mini)
    RNGFND_SCALING = 1
    RNGFND_MIN_CM = 30
    RNGFND_MAX_CM = 1000 for indoor use OR 600 for outdoors. This is the distance in centimeters that the rangefinder can reliably read.
    RNGFND_GNDCLEAR = 15 (expressed in cm, depending upon mounting height of the module)
    RNGFND_ORIENF=25
    PRX_TYPE=4
    PRX_YAW_CORE=22
    Upon setting of these parameters, click [Write Params] on the right of the software to finish.
    If the error message “Bad Lidar Health” appears, please check if the connection is correct and the power supply is normal.
    b)TFmini for Mission Planner Configuration Instructions for Pixhawk in Obstacle Avoidance Mode
    Connect the flight control board to MP, Select [Full Parameter List] in the left from the below bar- [CONFIG/TUNING] . Find and modify the following parameters:
    AVOID_MARGIN=1(Unit: m, set obstacle avoidance distance as required)
    SERIAL2_PROTOCOL = 9 (Lidar)
    SERIAL2_BAUD = 115
    RNGFND_TYPE = 8 (LightWareSerial)
    RNGFND_SCALING = 1
    RNGFND_MIN_CM = 30
    RNGFND_MAX_CM = 600 (Unit: cm, can be set according to the needs of measuring distance, outdoor TFmini recommended setting distance ≤ 600)
    RNGFND_GNDCLEAR = 15(Unit: cm, depending upon mounting height of the module)
    RNGFND_GAIN=0.8
    RNGFND_ORIENF=0
    PRX_TYPE=4
    PRX_YAW_CORE=0
    Upon setting of these parameters, click [Write Params] on the right of the software to finish.

Комментарии • 77

  • @leonripa8028
    @leonripa8028 Год назад +1

    after changing RNGFND1_TYPE to 20. i had to save before the other parameters showed up. confused me for a few miniutes. FYI

  • @fergusongodachaab6179
    @fergusongodachaab6179 9 месяцев назад

    Thanks. How about using more than 1 sensors left, right and front all for obstacle avoidance? Some says I2C but how does it tell the positions? Thanks

  • @kakemboluide
    @kakemboluide 5 лет назад +1

    Great video! Could you kindly do a flight video that shows how the quad behaves on the different flight modes with the two lidar sensors installed?

    • @kakemboluide
      @kakemboluide 5 лет назад +1

      @@maixechrys6264 thanks for this info. What about guided RTL? Like terrain following and obstacle avoidance?

    • @rizkigumilar6554
      @rizkigumilar6554 5 лет назад

      the same question that i was looking for

    • @maixechrys6264
      @maixechrys6264  5 лет назад

      @@kakemboluide​ After some searching, I believe this is the info you are looking for, ardupilot.org/copter/docs/terrain-following-manual-modes.html ardupilot.org/copter/docs/terrain-following.html#terrain-following

  • @praptipakkala7654
    @praptipakkala7654 6 месяцев назад

    Sir I had a question can we use the same setup for testing my lidar underwater for non gps navigation

    • @maixechrys6264
      @maixechrys6264  6 месяцев назад

      Asuming the gear can work underwater I would say yes..

  • @yk2494
    @yk2494 3 года назад

    I have a question about setting Obstacle Avoidance Mode.
    When the parameter "RNGFND_ORIENF" is set to "25: down", the displayed number moves, but when it is switched to "0: front", the display becomes "0" and it is not measured.
    The other parameter settings are the same.

  • @jeetbhalani2407
    @jeetbhalani2407 3 года назад

    Hello could you also make a video for object avoidance in car with motors and how to use TFmini with it

  • @simenscott
    @simenscott 4 года назад

    Thanks for the Video. I have been trying to set up tfmini plus for object avoidance, unsuccessful. I m using serial 5 as rangefinder2, that it did not detect. I tried serial 2, but rangefinder1 jumped to serial2 as rangefinder1. Any suggestions will be helpful. Thank you.

    • @maixechrys6264
      @maixechrys6264  4 года назад +1

      That is weird, sometimes you have to do it one by one and restart when making changes. Use another cable and connect it to the back of the computer, sensors may not work with the battery unpluged.

  • @PirinikoS85
    @PirinikoS85 4 года назад +1

    hi this sensor can i use for opstacle avoidance?

  • @shivprasadyadav4208
    @shivprasadyadav4208 4 года назад

    Well, thanks I am also trying to do it, with the help of TF MINI, I have done all the steps you have mentioned, but after that how to check if it is working ?
    As I tried practically and it didn't worked

    • @GabriGlider
      @GabriGlider Год назад

      Did you solved it? I have to build one

  • @dicle2127
    @dicle2127 2 года назад

    hello sir, I have 3 question and i didn't find right answer :( please help me. How can we connect external sensors (leakage, ping sonar, temperature-humidity sensors) to Pixhawk PX4? Can we connect multiple sensors if we can how do we do it? Can we connect 3 Distance sensors to Pixhawk if we can, how we can do it?

    • @maixechrys6264
      @maixechrys6264  2 года назад +1

      Hello, first up you need to identify what protocol the sensors use, for example are they using telemetry ports or i2c?

    • @dicle2127
      @dicle2127 2 года назад

      @@maixechrys6264 --> DHT22 humidity & temperature sensor (DHT22 also named as AM2302)
      • Output signal: digital signal via single-bus
      What protocol does DHT22 use?
      • Single wire protocol (single wire/bus for communication)
      -->A02YYUW Waterproof Ultrasonic Sensor
      • Output: UART
      • RX: Processed Value/Real-time Value Output Selection
      • TX: UART Output
      --> BlueRobotics SOS Leak Sensor
      • I did not find any information about its protocol.
      --> BlueRobotics Ping Sonar Altimeter and Echosounder
      • The Ping sonar communicates with a serial UART using a binary communication protocol called Ping Protocol
      • Signal Protocol: TTL Serial (UART)
      • I found that we can connect it to pixhawk’s SERIAL2 port (Serial/UART port). Is it ok?
      --> DFRobot Gravity: Analog Water Pressure Sensor
      • Integrated Circuit (IC) engineering technology.

    • @maixechrys6264
      @maixechrys6264  2 года назад

      Uart is a telemetry port, so you have to connect it to one of the 4/5 telemetry ports and go to the advanced settings and change the number that corresponds to your sensor maybe the manual has this information.
      Uart or telemetry ports are unfortunately limited and Telem_1 is reserved for the usb connection to pc.
      On the other hand I2C port can connect many sensors using an I2C splitter.

  • @victorgalvez927
    @victorgalvez927 4 года назад

    it's posible to connect 4 One-way Lidar Range Finder Sensor to the pixhawk or cube? awesome vid!

    • @maixechrys6264
      @maixechrys6264  4 года назад

      You can connect as many as spare telemetry ports allow, if you have i2c sensors and not Mavlink there is no limitation within reason. Best you can do is connect 2 mavlink and 2 i2c. Thanks!

  • @GabriGlider
    @GabriGlider Год назад

    Hello Maixe. In february I start my last university year project. Im making a drone that flight inside a greenhouse and collect data. But also I need to implement a object avoidance. Im gonna use the pixhawk and as you do, this lidar sensor. My question is. Once you have done all the process you do in your video, the drone automatically correct its possition when an object is detected by the lidar? Or do i need to do something else apart from this video? thanks

    • @maixechrys6264
      @maixechrys6264  Год назад

      This will work, the only thing you might want to is to play with the settings on how the craft will react.

    • @GabriGlider
      @GabriGlider Год назад

      @@maixechrys6264 Nice. Im forced to fly in althold mode. Does obstacle avoidance works in that mode.
      Also, is there a minimun of distance the lidar can detect and the drone react? I mean, as im flying inside, I will need to set the lidar probably at 30-50cm

  • @jiwankumre1052
    @jiwankumre1052 5 лет назад

    I have followed all the instructions as mentioned but I am getting Bad lidar health. I am using only 1 Tfmini sensor for obstacle avoidance. Any suggestions?

    • @maixechrys6264
      @maixechrys6264  5 лет назад

      Please be aware that the tutorial is for two sensors, have you read the manual from benewake page?
      Have you seen part 1 of the tutorial?
      ruclips.net/video/I1F_ac4Uous/видео.html
      b)TFmini for Mission Planner Configuration Instructions for Pixhawk in Obstacle Avoidance Mode
      Connect the flight control board to MP, Select [Full Parameter List] in the left from the below bar-
      [CONFIG/TUNING] . Find and modify the following parameters:
      AVOID_MARGIN=3(Unit: m, set obstacle avoidance distance as required)
      SERIAL2_PROTOCOL = 9 (Lidar)
      SERIAL2_BAUD = 115
      RNGFND_TYPE = 8 (LightWareSerial)
      RNGFND_SCALING = 1
      RNGFND_MIN_CM = 30
      RNGFND_MAX_CM = 600 (Unit: cm, can be set according to the needs of measuring distance, outdoor
      TFmini recommended setting distance ≤ 600)
      RNGFND_GNDCLEAR = 15(Unit: cm, depending upon mounting height of the module)
      RNGFND_GAIN=0.8
      RNGFND_ORIENF=0
      PRX_TYPE=4
      PRX_YAW_CORE=0
      Upon setting of these parameters, click [Write Params] on the right of the software to finish.
      SJ-PM-TFmini-T-01 A03 Benewake (Beijing) Co. Ltd.
      Page30
      If the error message “Bad Lidar Health” appears, please check if the connection is correct and the power
      supply is normal.

  • @autodot7830
    @autodot7830 4 года назад

    I can see the TFmini used as the object avoidance sensor. I missed what sensor you used for height sensor. Can you please provide a link for that. Thanks.

    • @autodot7830
      @autodot7830 4 года назад +1

      ok, I see it. Two TFmins.....

  • @lhzav
    @lhzav 4 года назад

    My goal is to create a sensor that can detect a wall/surface within a foot, and lock off horizontal travel, essentially terrain follow but for vertical terrain. Would you advise using LiDAR sensors and programs that are made for terrain follow but mount them horizontally on my drone? Or should I go with something else or a different sensor?

    • @maixechrys6264
      @maixechrys6264  4 года назад

      Thanks for commenting, yes i think the sensors are capable of doing that. Lidars sometimes have limitations in very bright light in that case you might want to go with camera style avoidace (like the dji drones) but I do not think is nesessary.

    • @lhzav
      @lhzav 4 года назад

      Maixe Chrys awesome thanks, as I am quite new to this could you advise me for places to look, I’d rather not program my own system I’m sure it already exists.

  • @ashishlal1996
    @ashishlal1996 4 года назад

    Hello, i wanted to know what all modes are best for the collision avoidance, is it possible to test in indoor flight
    Your reply will be highly appreciated
    Thanks

    • @maixechrys6264
      @maixechrys6264  4 года назад

      It is not good practice to use sensors indoors even DJI products suggest that you switch off the sensors the technology isnt there yet. For indoor flying you will need the sensors to cover a 360 field around the copter. Please check with ardupilot to see what modes support collision avoidance, it definatelly supports AltHold and Loiter ever RTL.

  • @pirunthankeerthinathan4286
    @pirunthankeerthinathan4286 5 лет назад

    Thanks for the Video.I need a help. Im using analog for range finder. i can able to see the data in status too. But still the mission planner shows the barometer reading in altitude.I need to fly the drone one meter above the ground in guided mode .will pixhawk use baro altitude or the range finder data? is there any changes in parameter list?

    • @maixechrys6264
      @maixechrys6264  5 лет назад

      Pixhawk will mainly use barometer altitude above set max altitude of sensor, are you using the benewake tf mini or another sensor? If so the parameters are irrelevant. I do not recomend setting the lidar as the main instrument for height if you want to see what the sensor reads you need to enable sonar_range in the user items.

    • @pirunthankeerthinathan4286
      @pirunthankeerthinathan4286 5 лет назад

      @@maixechrys6264 thanks for the reply. yh im using benewake.but im not worrying about the sensor readings. readings are pretty good. but i coudnt fly with that data. pixhawk ask to disable the gps when using range finder as main altitude source. can u suggest me a way to do terrain following using rangefinder with pixhawk using dronekit?

  • @pavanshetty9117
    @pavanshetty9117 4 года назад

    Hello, I noticed that when I set PRX_TYPE=4, the sonarrange becomes zero. But on the proximity console I am able to see the objects detected. Any suggestion?

    • @maixechrys6264
      @maixechrys6264  4 года назад

      There must be another problem as the prx_type is always 4 for this kind of sensor. Check that every other paramerer is correct and that you have rebooted the vehicle. Are you using 2 sensors?

    • @pavanshetty9117
      @pavanshetty9117 4 года назад

      @@maixechrys6264 using just one sensor for obstacle avoidance. The other parameters seems to be correct. Should the Rngfnd1_type be 8 or 20 ?

    • @maixechrys6264
      @maixechrys6264  4 года назад

      @@pavanshetty9117 it works both ways, rerun the setup if the tf mini and its programming you have to set it up to work with pixhawk. Also watch the first part of the video.

  • @djitastic2502
    @djitastic2502 4 года назад

    hello sir i connected it to flight controler and i also have connected leds and gps..the problem is that the gps and the leds went off during flight..is it possible that the power consuption is to big to handle ?may i use a 5v beck to power the sensor?

    • @maixechrys6264
      @maixechrys6264  4 года назад

      Ya sou Giorgo, Im going to need a bit more info on that, for instance where the led's get their power from? Is it through the servo rail of the pixhawk?

    • @djitastic2502
      @djitastic2502 4 года назад

      @@maixechrys6264 yes my friend

    • @maixechrys6264
      @maixechrys6264  4 года назад

      @@djitastic2502 well assuming that you use some kind of power supply (maybe the current sensor style) that plugs on the power connector on the pixhawk, then the servo rail and the power supply is completely seperate from each other if you think your ubec is not supplying enough power check with another. Also check the zener diode/capacitor mod for the pixhawk. You may need to add a capacitor to the servo rail.

  • @wrathfulfpvboyz4481
    @wrathfulfpvboyz4481 4 года назад

    hi i follow all instraction and says only check proximity sensor

    • @maixechrys6264
      @maixechrys6264  4 года назад

      Hello, have you been able to check that the sensor is working through the benewake provided software?

    • @wrathfulfpvboyz4481
      @wrathfulfpvboyz4481 4 года назад

      @@maixechrys6264 hi rngfnd to get 8 and not working
      If get 20 working what the different?

    • @simenscott
      @simenscott 4 года назад

      @@wrathfulfpvboyz4481 well, use 20 if it works.

  • @RajPatel-vc6mg
    @RajPatel-vc6mg 2 года назад

    Hi, great video. This was just what I was looking for. I have a doubt. I am using the same two sensors that you are using for the same purpose ( height estimation and object avoidance ). Can we configure the forward sensor for object avoidance and downward sensor for height estimation only( no object avoidance ). I have this doubt because parameters like Avoid_enable,avoid_margin,prx_type are global and not specific to that particular range finder. Please correct me if I am wrong. So how can we set avoidance and avoidance margin individually for each range finder

    • @maixechrys6264
      @maixechrys6264  2 года назад +1

      Thank you very much for your kind words.
      Check the video after 7:00 where I switch to the avoidance sensor.
      Rangefinder2 in my case .
      Avoid parameter only refers to the horizontal sensor(s) for object avoidance, so it really is specific for that purpose.
      The setup you are trying to make is exactly what the video discribes so make sure you dont miss a step!

    • @RajPatel-vc6mg
      @RajPatel-vc6mg 2 года назад

      @@maixechrys6264 got it …. So there is no obstacle avoidance for downward sensors. Only surface tracking. The avoid parameters are for horizontal sensors

    • @maixechrys6264
      @maixechrys6264  2 года назад +1

      @@RajPatel-vc6mg yes that is right, unless you start messing with its orientation that is how it works. Surface tracking kind of works like avoidance though.

    • @RajPatel-vc6mg
      @RajPatel-vc6mg 2 года назад

      @@maixechrys6264 Thank you, I got both the sensors working. I just have one more doubt. I can’t see the sensor distances on my mission planner hud. I can see them in my proximity tab by pressing clt f . How can I see the distances on the hud like you have set them up. Thank you

    • @maixechrys6264
      @maixechrys6264  2 года назад +1

      @@RajPatel-vc6mg you right click the hud screen and there is an option to show aditional sensor readings, I dont remember by heart though.

  • @RETROGAME-FIX
    @RETROGAME-FIX 3 года назад

    hi sir can you please explain how many sensor i can attach to a pixhawk. can i attach 4-6 sensors?? thank you

    • @maixechrys6264
      @maixechrys6264  3 года назад +1

      You are limited by the telemetry I/O of the controller. In this case we can have a maximum of four, if you want more or if you dont have any other serial ports available you can opt for an I2C based sensor witch can be a lot more than 4.

    • @RETROGAME-FIX
      @RETROGAME-FIX 3 года назад

      @@maixechrys6264 m kinda new to all this. And there is no proper tutorial that shows how to install. You said it can take 4. 2 i saw how you did it. What about the other 2? Actually i m using ultrasonic sensors. I do have tfminis too.

    • @maixechrys6264
      @maixechrys6264  3 года назад

      @@RETROGAME-FIX Do you use gps? Osd? If yes then i am afraid you do not have any serial ports available. Maybe you can fit one more but you have to see how many teletry ports are available to you.

    • @RETROGAME-FIX
      @RETROGAME-FIX 3 года назад

      @@maixechrys6264 the project is to build an obstacle avoidance drone all 4 directions and if possible, add 2 more sensors for up and down. There are tons of video and pages but for some reason its not working for me. Maybe m broken or my electronics are broken. I can compensate the telemetry and osd for the sensors. I saw the I2c option too but again i am not able to use the tfmini with i2c maybe m missing something in mission planner parameters.

  • @RETROGAME-FIX
    @RETROGAME-FIX 5 лет назад

    i have followed your tutorial, but for some reason i am not able to get the Red line with distance.. dont know what i did wrong.

    • @maixechrys6264
      @maixechrys6264  5 лет назад +1

      Have you watched part one of the tutorial, I fear you might havent set up the lidar to talk to pixhawk. You have to enter programming mode and enter a command line to the lidar so that it sends signals compatible with pixhawk and ardupilot.

    • @RETROGAME-FIX
      @RETROGAME-FIX 5 лет назад

      @@maixechrys6264 i did not before, but i did and followed the tutorial. And it worked well for a while. But now it is stuck on 2.5m red line. Its knid bouncing from 2.2m - 2.8m. Although my quad is facing a wall with 30cm.

    • @maixechrys6264
      @maixechrys6264  5 лет назад

      @@RETROGAME-FIX I will point something obvious that you must have done already, but never the less have you updated the firmware on the lidar and pixhawk aswell? Have you restarted the pixhawk after any change and checked afterwards? Follow the instructions provided in the tutorial as I suspect any deviation is likely to result in failure. I remember having this sort of problems when doing something different that the parameters I present here (exept the distance that is up to the application of the final user).

    • @RETROGAME-FIX
      @RETROGAME-FIX 5 лет назад

      @@maixechrys6264 thanks a million sir for the quick response. I did updated the firmware on pixhawk but wasnt able to update the lidar, when clicked the update nothing was happening. And I have found out that when the FC is connected to pc via usb the lidar sensor has some power surge and does not response well. But when i connect it to the battery it starts working. My second question is that the obstacle avoidance is constantly in on position or do i have to assign to a mode. Coz i jave seen the option in modes. M using MP 1.3.66 and i dont have seen AVOID_ENABLE in the parameters list.

    • @maixechrys6264
      @maixechrys6264  5 лет назад

      @@RETROGAME-FIX Ok first things first, it is the pixhawk firmware that is responsible for showing the parameter required. If it is not implemented in the stable build maybe you have to download a Beta firmware to make the required parameter appear. As for the lidar it should work with usb, provided that the usb port is directly connected(no hub). Tell me what you need more specific and I might make a video about it.

  • @yehudabenaim9263
    @yehudabenaim9263 3 года назад

    VERY GOOD MY FRIEND

  • @jackbrimstone1004
    @jackbrimstone1004 3 года назад

    Hey can i use 5 of these on a drone 1 for each direction and 1 for heigh estimation??

    • @maixechrys6264
      @maixechrys6264  3 года назад

      I think is better to use I2c sensor like the Maxbotic for that application, as I am afraid there are not enough telemetry ports for 5 sensors but I2c can be much more.

    • @jackbrimstone1004
      @jackbrimstone1004 3 года назад

      @@maixechrys6264 can you provide a link to this sensor?

    • @jackbrimstone1004
      @jackbrimstone1004 3 года назад

      @@maixechrys6264 better yet is it possible to make a splitter like you made in the video but for 5 instead? Or maybe a circuit that connects 5 to 1 and plug it into the pixhawk?

  • @rcbuildmaster6192
    @rcbuildmaster6192 5 лет назад

    Can I use only on lidar facing front ?

    • @maixechrys6264
      @maixechrys6264  5 лет назад +2

      Yes of course you just skip the steps for the secondary, follow the instructions provided by benewake.

    • @rcbuildmaster6192
      @rcbuildmaster6192 5 лет назад +2

      Ok

    • @jiwankumre1052
      @jiwankumre1052 5 лет назад

      Can you please provide parameter file for latest pixhawk firmware for Quadcopter?

  • @franciscourena5636
    @franciscourena5636 3 года назад

    *** Excellent ****