Its running on a STM32 blackpill but could be ported to esp32.
Flight controller RX pin connects to Uart 2 Tx pin A2,
Lidar motor driver /transistor to B1
Lidar Data connects to A10
The Lidar board takes 3.3v or 5v depeding on the version so check first, I killed my first one lol
on the flight controller:
set SERIALx_BAUD = 1500
Set SERIALx_PROTOCOL = 2
Set PRX1_TYPE = 2 for MAVLINK
Set PRX1_ORIENT =1 or it will be upside down.
Im using one of these mosfes to drive the motor but you could just use a transistor.
Im trying to make a 3d printed case for it so it looks good, you can buy cases for the original XV lidar but those are hard to come by now, but there are a lot of versions of this lidar in a lot of different machines so thats how i found the Xiaomi version thats a lot cheaper but unfortunately its a slightly different shape so none of the mounts or cases i can find on thingverse fit.
its not a time if flight sensor, its basically using a camera to look for the laser dot and calculating the distance based on the angle its at. the A2 lidar works the same way, you need to spend closer to 500 to get a time of flight sensor. Realistic range on this is probably 4-5 meters, i believe the protocol is limited to 6.5m
I have tweaked the code and its now getting 6-8hz update rate
To the high resolution display you need to select the proximity device then open the proximity viewer, you can open it twice, one will be the high resolution display for path planning and the other will be for proximity.
Where i live sunshine is a rare thing so I will probably be able to use it ok. I will try and get some outdoor testing done in the next week or so.
I have found another lidar, its a 3irobotix Delta 2A from what I can find it should have slightly better range 8m vs 6m, be slightly faster and cheaper.
geofrancis, is this a correct representation of your connections?
The XV Lidar page you link on your github (about the Neato XV-11 modules), describing how to check the voltage version does not seam to be valid for the Xiaomi modules. (At least I can’t find any markings in my Xiaomi modules). Any tips on how to figure out what voltage the Xiaomi modules wants?
Edit! or maybe maybe…there is a connection from the 3v3 pad of the RP2040zero module to the motor… or? (I guess that your modules are 3.3V ? )
I bought “Original LDS Laser Distance Sensor for Xiaomi Mi Robot 1s 1st SDJQR01RR SDJQR02RR SDJQR03RR Robot Vacuum Cleaner Spare Parts” from AliExpress… so this would be the 3.3V version then… And i should move the red wire from the 5V pin to the 3v3 tab on the RP2040zero… (I wounder if the zero module can supply the motor current with its internal regulator)
the only difference in the wiring between on the 5v version I have and the 3.3v version is that you would connect the lidar board VCC pin to the 3.3v pad and the motor positive to the 5v pad rather than bridging them. The lidar only uses around 150ma so it should have no problem running it.
you don’t technically need the RX wire from the flight controller as we are just sending data. I use a servo cable to connect it. for 5v, Ground and TX.