Rplidar C1 has different results in firmware Copter 4.5 and Copter 4.4

Hello everyone,

I’ve recently conducted tests with two different versions of Pixhawk: 2.4.8 and 6X. It turns out you were right! The Pixhawk 6X performs well.

I’ve just completed a few tests, and in the photo, you can see the box positioned 0.50 meters from the lidar with the Pixhawk 6X:

And here’s the radar view:

Here are the results with Pixhawk 2.4.8:

And the radar view for this setup:

So, for some reason, it appears that the RPLIDAR C1 is compatible with the Pixhawk 6X but not with the Pixhawk 2.4.8.

Hope this information is helpful!

I seen something similar to this when using my lidars, some serial ports on some f4 controller just can’t handle high speed lidars.

1 Like

My apologies for the confusion earlier. I had some reservations, so I decided to test the Pixhawk 2.4.8 on a rover using the copter firmware, and surprisingly, it worked!

Encouraged by this, I then tested the Pixhawk 6X with the rover firmware, only to encounter the same issue:

image

Therefore, it appears that the issue does not stem from the Pixhawk hardware version but rather from the differences in the software between the rover and copter firmware.

Firstly, I will investigate whether there is a difference between the Telem2 ports in the rover and copter firmware. Secondly, I will examine the software architecture to understand how the “rover task” and “copter task” access lidar data within the AP_Proximity_RPLidarA2 files.

Does anybody have an idea?

Thanks!

Hi @potcha,

One of the largest differences between Copter and Rover is that the Rover firmware only runs at 50hz by default while Copter runs at 400hz. It may help to set SCHED_LOOP_RATE to 400 on the Rover.

This may not be enough though because that will increase the main estimation and control loops but it might not increase the speed of everything.

We should be able to get it working though.

Hi rmackay9,

You were right!!
I changed the SCHED_LOOP_RATE value from 50Hz to 400Hz, but that wasn’t enough. So, I also modified the rover.cpp file by changing:
#if HAL_PROXIMITY_ENABLED SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 50, 200, 27),
to
#if HAL_PROXIMITY_ENABLED SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 200, 50, 36),.
These two changes made the RPLIDARC1 work with the rover firmware.
image

Now, there surely is a reason why the scheduling values are not the same between the Rover and Copter firmware. And i’m not sure modify scheduling values will resolve the problem because changing scheduling values like this must impact the soft and should create bug elsewhere. Anyway, thanks for your help :slight_smile:

3 Likes

Hello, thanks for all the work you guys do. I was glad to see that support was possibly available for RPLidar C1 in copter 4.5. Just wondering if the changes discussed above made it to v4.5.5 (or do I need to compile my own code with the suggested changes)? EDIT: I can see the changes were all added to the latest release. Not sure why I’m still having issues, if anyone can provide any insight, I’d appreciate it, errors detailed below:

I’m currently seeing the message: ‘RPLidar C1 hw:18 fw:1.1’ but then the repeated message: PreArm: PRX1:Not Connected’. The Lidar is spinning up, but I don’t seem to be able to access the range finder window (as shown by the screenshots in previous messages by others).

RF: RPLidar C1, HW: 18, FW: 1.1
FC: Cube Orange+, Quadcopter FW: 4.5.5
SETTING CHANGES (on TELEM 2)

  • SERIAL2_BAUD: 460
  • SERIAL2_PROTOCOL: 5
  • PRX2_MAX: 12
  • PRX2_MIN: 1
  • PRX2_TYPE: 5
  • BRD_SER2_RTSCTS: 0

I am powering the Lidar with a Power Distribution Board (PDB). I see noisy data on Lidar TX line and RX line set HIGH.

Thank you.

1 Like

Hope you get a solution, I will be trying to test the same soon, so I’m curious of your progress.

Tristan.

I found my error, below are the correct settings to enable the LiDAR. (I associated Serial2 with PRX2, and so I didn’t set PRX1 correctly). I still haven’t figured how to pull up that range finder display window that people posted above. (Update: How-to listed below.)

RF: RPLidar C1, HW: 18, FW: 1.1
FC: Cube Orange+, Quadcopter FW: 4.5.5
SETTING CHANGES (on TELEM 2)

  • SERIAL2_BAUD: 460
  • SERIAL2_PROTOCOL: 11
  • SERIAL2_OPTIONS: 0
  • PRX1_ORIENT: 1 (upside down)
  • PRX1_MAX: 12
  • PRX1_MIN: 1
  • PRX1_TYPE: 5
  • BRD_SER2_RTSCTS: 0

Range Finder Window
CTRL+F —> Proximity

yes its part of one of the hidden menus

Press CTRL-F then click on the proximity button to open the window.

1 Like

I tried the RPLidar C1 and the Okdo LD06, with the settings shown below. But the quadcopter seems to be unstable when I have the feature enabled (PRX1: set to 5 or 16). When I disable it (PRX1: 0) I regain control of my drone. I’m testing in a large courtyard so there are no obstacle within 3 m all the way around. Not sure if maybe some of the settings are conflicting with each other. Both units seem to be operating ok.

RF: RPLidar C1, HW: 18, FW: 1.1 / Okdo LD06
FC: Cube Orange+, Quadcopter FW: 4.5.5
SETTING CHANGES (on TELEM 2)

  • SERIAL2_BAUD: 460/230
  • SERIAL2_PROTOCOL: 11
  • SERIAL2_OPTIONS: 0
  • PRX1_ORIENT: 1
  • PRX1_MAX: 12
  • PRX1_MIN: 1
  • PRX1_TYPE: 5/16
  • BRD_SER2_RTSCTS: 0

AVOIDANCE BEHAVIOUR

  • AVOID_ACCEL_MAX: 1
  • AVOID_BACKUP_SPD: 0.5
  • AVOID_BEHAVE: 1
  • AVOID_DIST_MAX: 1
  • AVOID_ENABLE: 7
  • AVOID_MARGIN: 1
  • FENCE_MARGIN: 1
  • WPNAV_SPEED: 300

NOTE: screenshot was taken indoors.

Hello everyone,
I’m using ArduRover with a Pixhawk 2.4.8, and a RPLIDAR C1. I’m having notable issues when trying to use ACRO mode. there seems to be a software issue that when the LiDar is working, ACRO mode is inputting random parameters on throttle (Visualized via PID tuning). When ACRO mode behaves properly, the LiDar is working, but the Pixhawk is recieving incorrect data as per shown in this post. This can be tuned via SCHED_LOOP_RATE, we can make work ACRO mode or the LiDar, but not both.
This issue seems to be similar as the one mentioned by @leadwellworks .
We’ve tuned the A2 library to make it work, by changing the parameters shown in &rover.g2.proximity. I was wondering if anyone has had this issue also, or if it is known by @rmackay9 , as I haven’t found any fix online, or any mentions about the issue at all.