I just got up and running again, I have uploaded the latest verison to github incase i have uploaded an older version or something by mistake.
Ok, uploaded the code, but now the lidar won’t spin, it tries too, but it has too low speed to spin, (i understand that it is supposed to spin slowly at the start, and then speed up?). After i helped it spin with hand, it sped up, and it looked like it worked properly (i suppose when the green LED is on that means it sends data) but the issue is that the green light won’t always light up, and it spins but doesnt send any data (It maybe is the power issue because im powering it off of a USB cable, which could not provide enough current to the motor; I will try powering it with FC tommorow)
I plugged it into my FC. It won’t start by itself (too low motor power to spin by itself in the beggining), so it needs a little push by hand to make it gain speed. After it speeds up it holds constant speed, but it won’t send any data at all (green LED won’t light up). So i plugged the lidar back to my PC, and it was behaving the same, until i turned on serial monitor. Every time i have it plugged to my PC, it won’t work until i turn on Serial Monitor (after entering it, the green LED lights up and the lidar sends data; the data shows up on the serial monitor) but the LED won’t turn on when plugged into my FC. Any idea?
I have uploaded some changes, I had the motor pid in the second loop, I moved it back to the main one with the lidar.
yes, i have seen the change on the github, i already uploaded it. this is what happens with the latest code
so 2 issues:
- The lidar won’t spin by itself at the startup (needs a hand push to start)
- Lidar won’t post data unless i connect it to my PC and turn on Serial Monitor.
I wont be able to look at it again until next week, i have done some changes but i have a lot to catch up on. the origional code is still there, i havent touched it so you should be able to use it still.
I have updated the dualcore code, there was a few silly mistakes like = instead of ==, and i added a line to set it to full speed on startup then bring the speed down rather than it slowly speeding up, the lidar was starting up the motor ok it was just taking around 10 seconds but now its immediate by setting the output to 255 on startup.
Awesome! Can’t wait to finally see it working! Right now I’m changing my chassis to a skid steering (tank) platform, so you might need to wait a week or so until i build it and mount ardupilot on it.
i have left the Lidar untouched, so i decided to upload the updated code to it, but while trying to compile the code, error pops up…
exit status 1
'newscan' was not declared in this scope
Is the code compiling correctly on your end?
Its working for me, I have uploaded it all again in case i missed something.
downloaded it and it uploaded succesfully, but now the lidar won’t post data at all, no data on serial monitor on IDE, and no data on the mission planner… the LED Flashes blue and green, and the lidar spins up correctly now, and that’s about it; no data…
did you change the serial port baudrate to 115200?
Yes, it is set correctly, i have checked multiple times.
are you getting anything from serial when you uncomment serialprintdiag();? I flashed mine and its working fine.
yes, uncommented the serialprintdiag line and now it is posting to the serial monitor! although there is still no data on Mission Planner (no proximity device on Mavlink Inspector and PreArm: PRX1: No Data error on the artificial horizon). I’ve checked my wiring, and continuity of the wires, but everything seems ok, same as for parameters on SERIAL1, where the Lidar is connected.
I have no idea…
I asked you if you had changed the baud to 115200…set this to 115
oh god, i thought you meant the baud rate on the arduino IDE, i’m sorry man, let me change that and see if it works
changed the SERIAL1_BAUD to 115, but the lidar is still not posting data, even after power cycling the FC.
Here is the mavlink inspector screenshot:
Also i am sending my full parameter list file if you want to take a look at it:
parameters.param (17.5 KB)