ChrisKelly
Posts: 6
Joined: Mon May 09, 2016 12:15 am

Interfacing Raspberry Pi with Scanner

Mon May 09, 2016 2:53 am

Hi All,

First time poster, long time trawler. Massive apologies for the long post too!

Background

We are attempting to time-sync to a Laser scanner (Velodyne VLP-16). The laser scanner comes with an interface box (image attached). There is a GPS connection available to do this, however for testing, we are wired directly into the “GPS Receive’ and “GPS Pulse” terminals. We are using a Raspberry Pi 2 and Python to emulate the GPS sentence and PPS using GPIO18 and the UART TX pin. The scanner and interface box is self-power via a dedicated 12v power supply.

The documentation describes the requirement for a Pulse Per Second (PPS) and NMEA Sentence to be issues consecutively (timings and structure attached) over two dedicated wires. The document says to use TTL, but that anything above 3v will be recognised. Currently, we can confirm the PPS is successfully being received by the scanner, as the web interface for the scanner shows that we are locked and synchronised. However, the NMEA sentence is not being received for some reason. It should show the coordinate and Time on the web interface, from the NMEA sentence. The required serial settings for transmission are said to be 8-N-1 at 9600. I believe the sentence needs to be ASCII terminated with ‘\r\n’ (carriage return line feed). I have used basic loop timing inside our Python code and we also believe we are close to on-the-money with our timing.

Just to be sure we pump out the signal at the correct voltage, I have tried two different Logic Level Converters (LLC). The LLC is powered on BOTH SIDES (High side and Low Side) from the Raspberry Pi’s 3.3v and 5v pin. I pass the Ground from the Pi through the LLC and onto the interface box for the scanner. I pass the UART TX through the Low side (3v) of the LLC to the high side (5v). The only thing I have not passed through the LLC, is the PPS signal from GPIO18, I send that directly to the interface box. I have also tried transmitting the serial directly to the interface box, without the use of an LLC.

LLC’s I’ve used:

http://www.jaycar.com.au/Kits,-Science- ... e/p/XC4464

http://www.jaycar.com.au/Kits,-Science- ... o/p/XC4238


Issue:

1) Given the wiring diagram of the interface box, am I even supplying the scanner with everything it needs from the Pi (1 UART TX line, 1 Pulse line from GPIO and a ground from the GPIO)? Or,
2) Is the LLC and voltage supply likely my issue?:
a. When measuring the output serial signal on the high side of the LLC, it is only 2.6v. Shouldn’t it be 5v or close when using the LLC?
b. The first LLC in the above link managed to boost to 3.4v on the high side, but isn’t that still too low?
c. Interestingly, when measuring the voltage on the interface box GPS connections, without anything connected from the Raspberry Pi or LLC, I measure small amounts of mV. Is this normal?

…….am I using my voltmeter incorrectly hahahah??!!!

Happy to supply any more info to help you, help me!

Thanks so much guys,

Chris
Attachments
PPS_NMEA_Timing.JPG
Serial and Pulse Timing
PPS_NMEA_Timing.JPG (60.81 KiB) Viewed 4679 times
Interface_Wiring.JPG
Wiring Diagram
Interface_Wiring.JPG (52.74 KiB) Viewed 4679 times
Interface_A.JPG
Interface Box
Interface_A.JPG (58.46 KiB) Viewed 4679 times

ChrisKelly
Posts: 6
Joined: Mon May 09, 2016 12:15 am

Re: Interfacing Raspberry Pi with Scanner

Mon May 09, 2016 7:12 am

I might also add, that I have tested my serial sending script by passing it directly back to the USB port on the RPi via a TTL to USB adapter. So, out of ttyAMA0 and into ttyUSB0, and the serial send script works.

julienlharidon
Posts: 2
Joined: Tue May 10, 2016 5:37 am

Re: Interfacing Raspberry Pi with Scanner

Tue May 10, 2016 6:40 am

Dear Chris,

Funny we are doing virtually the same thing these very days : syncing a VLP16 with a arduino (though we are not opposed to RPI !).
Pulse is detected just fine. NMEA seems not to be detected.
We investigated the same thing about signal levels. Arduino output 0-3.3v (CMOS logic level), VLP requires TTL 0-5v but it appears it should work (the other way around - sending 5V TTL to the arduino - could damage the board). It works anyway for the PPS.
I am pretty sure my nmea sentences are correct (checked it with various methods : the NMEA specs, websites apps, ...).
Last move yesterday was to contact the Velodyn support.

Not helping now, but in case we found a solution, we'll let you know!

Regards,

Julien

ChrisKelly
Posts: 6
Joined: Mon May 09, 2016 12:15 am

Re: Interfacing Raspberry Pi with Scanner

Tue May 10, 2016 12:40 pm

Hi Julien!

Unbelievably excited to know someone is doing the same thing hahaha! :D

I have also contacted velodyne for support! I will definitely report back on any progress, perhaps we can work this out between us.

I have just purchased a dedicated GPS plug for that tiny 6 pin pcb connector on the interface box, as I have this strange feeling bypassing that and wiring into the interface terminal blocks may be bypassing "something" important. For example, I think 5v supply comes out of the GPS connector designed to perhaps power the Garmin GPS receiver. So, my next trial will be to use the dedicated GPS plug, pass 5v out into logic level converter hi side. Therefor, out of Pi with 3v and serial, I to logic level converter, out of logic level converter and into GPS connector.

Also, as the GPS connector I am trying has an RX line from the scanner, I can now hook that back up through to the raspberry Pi and see if that helps. Perhaps it needs that two way communication for serial?

....stay in touch Julien!

LionelATTY
Posts: 1
Joined: Thu May 12, 2016 6:29 pm

Re: Interfacing Raspberry Pi with Scanner

Thu May 12, 2016 6:45 pm

Hi Chris !
I'm working with Julien on this project.

With one guy in our institut (IGN France), we think we have understood a/the problem.
We use a Arduino (Uno) to produce NMEA sentences.
After seeing the electrical impulse with a oscilloscope, we have found a problem with the low state of serial produced by the Arduino.
That's not really a problem but a incompatibility with Velodyne.
Arduino produced a standard Serial IDLE output with a HIGH state.
Velodyne Lidar seems to wait a LOW for idle state.
After switching the idle state (HIGH -> LOW), GPS positions sent have been recognized by our VLP-16.

Maybe your problem is similar to our, check your state IDLE electrical signal :-)

Hope that's can help you,
Lionel.

julienlharidon
Posts: 2
Joined: Tue May 10, 2016 5:37 am

Re: Interfacing Raspberry Pi with Scanner

Fri May 13, 2016 6:09 am

Dear Chris,

My colleagues found a solution :)
First Arduino output 5V TTL. That is something we do not have to work on, while you need it (raspberry only output 3.3V).
Second, it appeared, looking from a picture of a signal on a scope that Velodyn provided to us, that logic is inverted.
We followed instruction found here : http://arduino.stackexchange.com/questi ... ctive-high

Our VLP is synchronized now!

Best regards,

Julien

ChrisKelly
Posts: 6
Joined: Mon May 09, 2016 12:15 am

Re: Interfacing Raspberry Pi with Scanner

Sat May 14, 2016 10:58 pm

Hi Lionel and Julien!

Very honored to be speaking with a team from the IGN :D

This issue is quite annoying, as the documentation for the scanner isn't really clear on this! :evil:

I would like to say thanks very much for getting back to me with your solution. I am very appreciative, as there is no way i would have found this issue on my own! .....I was actually just out today buying an oscilloscope so i could test the signals too!!!.... But i doubt i would have found the issue.

I have found a few forums talking about a small chip to invert the UART logic levels for the raspberry pi. Something like the 74HC04 in case you ever wish to explore a Raspberry Pi.

I wish you all the best with your project, Lionel and Julien. Please stay in touch (chris.kelly@aerospatial.com.au)

Chris

ChrisKelly
Posts: 6
Joined: Mon May 09, 2016 12:15 am

Re: Interfacing Raspberry Pi with Scanner

Sun May 15, 2016 3:14 am

Hi Lionel and Julien,

It's ALIVE!!!! :mrgreen:

Thank you very much for your help, I have successfully time-synced the scanner and the raspberry pi!

All the best,

Chris

User avatar
JrPi
Posts: 1
Joined: Wed Jan 01, 2014 7:04 pm
Location: Moose Jaw, SK, Canada
Contact: Website

Re: Interfacing Raspberry Pi with Scanner

Tue Mar 14, 2017 8:09 pm

Hi Chris,

I was wondering if you could post a quick summary of the final solution to your problem? I am waiting on some parts to be delivered but will be facing this same VLP-16 timing challenge very soon.

Thanks,

Ryan
Junior Pi School
Computers and Electronics Club for Kids
www.jrpi.ca

skohlbr
Posts: 1
Joined: Wed May 10, 2017 8:47 pm

Re: Interfacing Raspberry Pi with Scanner

Wed May 10, 2017 8:50 pm

I'm also looking into time-syncing the VLP-16 via simulated PPS/NMEA GPS data. If anybody has open source code or further information that would be greatly appreciated.

ChrisKelly
Posts: 6
Joined: Mon May 09, 2016 12:15 am

Re: Interfacing Raspberry Pi with Scanner

Mon May 22, 2017 10:05 am

Hi Guys,

So sorry about the late reply. This thing does not notify me when someone has posted for some reason.

In my case, in order to get the synchronisation working I had to pass my GPS NMEA sentence through a serial-to-RS232 converter. This changed the logic levels from +5 volt to +-5 volt (I think). So, I hade my USB port connected to an RS232 converter, then out of the converter into the scanner GPS input. I used GPIO18 to output a pulse every second. In pseudo code, it went something like:

Construct GPS NMEA sentence
Calculate check sum of NMEA sentence and append to end of NMEA sentence (following the NMEA protocol)
Deliver sentence to scanner using python serial.
Deliver PPS to scanner using python GPIO (GPIO.high then GPIO.low)
Control the speed of the loop using time.sleep() in python. i.e. pause a total of 1 second within one loop.

If I remember tomorrow, I'll post the code for you guys...and anyone else who is keen.

Hekav
Posts: 2
Joined: Wed Oct 16, 2019 3:19 pm

Re: Interfacing Raspberry Pi with Scanner

Wed Oct 16, 2019 3:31 pm

Hello Chris,

I was wondering if you can share information about your Project, drawings and advices. I am tryin to do something like with a velodyne. Email me to spilmit@gmail.com.

Regards,

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Interfacing Raspberry Pi with Scanner

Wed Oct 16, 2019 6:38 pm

Hekav wrote:
Wed Oct 16, 2019 3:31 pm
Hello Chris,

I was wondering if you can share information about your Project, drawings and advices. I am tryin to do something like with a velodyne. Email me to spilmit@gmail.com.

Regards,
Chris Kelly

Joined:Mon May 09, 2016 1:15 am
Last active:Mon May 22, 2017 11:05 am
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

Return to “Interfacing (DSI, CSI, I2C, etc.)”