Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YDLidar X4 no serial comunication #2

Open
GuyCoast opened this issue Jan 6, 2019 · 12 comments
Open

YDLidar X4 no serial comunication #2

GuyCoast opened this issue Jan 6, 2019 · 12 comments

Comments

@GuyCoast
Copy link

GuyCoast commented Jan 6, 2019

Hi all,

I spent a lot of my time, to let Arduino communicate with ydlidar X4, without success. Although the command is sent, Arduino can not read the answer from the lidar.
With a logic analyzer on the rx tx serial lines, I see that the 'deviceinfo' command is sent and the lidar responds with the correct package, but Arduino does not receive anything and the receive buffer is empty.

Please help me
thanks in advance

@robotfpv
Copy link

robotfpv commented Oct 8, 2019

Hi, did you manage to get working the library?

Im using arduino UNO and i get this error:

"YDLIDAR get DeviceInfo Error!!!"

help meeee

@EmileDqy
Copy link

Hi, I managed to send the device info command from my Arduino UNO to the Ydlidar X4 and to get a response:

image

In the beginning, I used 2 transistors so as to step down from 5V to 3.3V. I did that because the documentation I found on the website of Ydlidar said that it can only take 3.3V as input.

But when I found this library, I had to simplify my circuit so as to have it follow the one shown inside the "YDLIDAR ARDUINO.docx" file.

image

I also had to solder my cables to jumpers in order to get rid of the noise I had. Now I can get the device's info and proceed to the scan.
But my problem now is that my Arduino UNO says: "YDLIDAR get Scandata failed!!"

I don't know if any of you encountered this problem and managed to solve it?
Anyway, I will do my best to fix this issue and I'll get back to you if I find something.

@GuyCoast
Copy link
Author

Hi, same problem for me, I fix this with code modification in connectydlidar.ino.
Check this link: https://github.com/EAIBOT/ydlidar_arduino/pull/4/files

@EmileDqy
Copy link

EmileDqy commented Dec 21, 2019

Hi, thank you for your quick reply.

I just tried your modification and but I get this:
image

@GuyCoast
Copy link
Author

GuyCoast commented Dec 21, 2019

try to disconnect SCTP pin (pwm signal)

Code work for me, look:

current angle:8.4843750000
current distance:2508.0000000000
current angle:9.0625000000
current distance:2513.0000000000
current angle:9.6406250000
current distance:2519.0000000000
current angle:10.2343750000
current distance:2524.0000000000
current angle:10.8125000000
current distance:2532.0000000000
current angle:11.4062500000
current distance:2540.0000000000

@EmileDqy
Copy link

I managed to make it work but now it drains too much amps from my Arduino UNO. I need to find a reliable 350mA -5V power supply and it should work for more than 5 secondes.

My problem was the noise generated by the breadboard.

@Enes73728
Copy link

I managed to make it work but now it drains too much amps from my Arduino UNO. I need to find a reliable 350mA -5V power supply and it should work for more than 5 secondes.

My problem was the noise generated by the breadboard.

How did you manage the noise generated by the breadboard ? I don't really get how you solved you issue tbh

@doro516
Copy link

doro516 commented May 29, 2020

I have a ydlidar X4,a apparently works but the angles samples are not continue, sometimes jump for, example from angle 10 to angle 70, from angle 80 to 320. have you seen the same?

@dduddaddidda
Copy link

Hi, did you manage to get working the library?

Im using arduino UNO and i get this error:

"YDLIDAR get DeviceInfo Error!!!"

help meeee

Hi, did you fix that problem? now I have same one

@rkammela
Copy link

I have the same error, able to get device info, it says the health status is well and it's scanning. I can see LIDAR is spinning but getting the "YDLIDAR get Scandata failed!!" error. Which is the same issue described in this post. Did anyone resolve this issue?

Serial:2022110301111111
[YDLIDAR INFO] Current Sampling Rate:4K
[YDLIDAR INFO] Current Scan Frequency:7.0000000000Hz
[YDLIDAR INFO] YDLIDAR running correctly! The health status: well
Now YDLIDAR is scanning ......
YDLIDAR get Scandata fialed!!

@urmamafavthans
Copy link

Hi, same problem for me, I fix this with code modification in connectydlidar.ino. Check this link: https://github.com/EAIBOT/ydlidar_arduino/pull/4/files

Hi may I ask the wiring plan between the YDlidar and Arudino?

@urmamafavthans
Copy link

I have the same error, able to get device info, it says the health status is well and it's scanning. I can see LIDAR is spinning but getting the "YDLIDAR get Scandata failed!!" error. Which is the same issue described in this post. Did anyone resolve this issue?

Serial:2022110301111111 [YDLIDAR INFO] Current Sampling Rate:4K [YDLIDAR INFO] Current Scan Frequency:7.0000000000Hz [YDLIDAR INFO] YDLIDAR running correctly! The health status: well Now YDLIDAR is scanning ...... YDLIDAR get Scandata fialed!!

Hi have you fix it afterwards?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants