• aditya mehrotra.

OpenVS - solar car vehicle sensing project [new things]

So we got an interesting idea amongst the team the other day and that was to put some sensors on the car to gather data on how our dynamics are from year-to-year as we make new vehicles. This includes things like the following:

  • Forces on each wheel as we corner

  • Braking deceleration (what's the actual values we are achieving)

  • Force on the entire vehicle in the x-y-z directions at any given moment

  • Theoretically we'd like to know if we're skidding or not

Here are some preliminary notes and ideas on that, and if it works we can make it a project called OpenVS (Vehicle Sensing) and make a document that allows anyone to use it!

The first note is some initial conceptual ideas about the system:

Note Jan 17, 2021
Download PDF • 3.07MB

The second note is some ideas about sensors and mechanics:

Note Jan 19, 2021 (4)
Download PDF • 2.56MB

Today/this week we want to briefly test the workflow of logging data to a CSV file and then opening it and mapping it in ArcGIS Pro (or similar software). What we're going to do first though is build something where we can mount our sensors to the car w/o them sliding around!

We started with the old CHIPv2 actuation controller which is no longer being used because the box is really nice so we gutted that completely but left the wiring in-tact for later use.

The next step was to take the Ardupilot/GPS combo and secure it inside the casing. We used simple velcro and used foam below the Ardupilot as "vibration damping."

Then we closed up the box and routed the GPS wire through the slits in the side. We used velcro to secure the GPS to the top of the casing so it has the "clearest view" of the Sky.

And now we have a nice little completed box! Now for the next set of tests for the day, actually logging the data and saving to a CSV file!

Use this as a reference for messages: https://mavlink.io/en/messages/common.html

Here's the initial test code that writes things to CSV files, and it's in python so there's no platform dependency except for setting the serial port of your ARDUPILOT. We're going to stick this in the car today and run a few tests and see if we can't get the data mapped on ArcGIS Pro or something like that. We don't have ground telemetry right now but we will in the future.


Now we're going to get in the car and go take some data from the road.


So typically I would personally use ArcGIS Pro or something for mapping purposes but because we want other people to be able to use this and because it's an open source project, we will use QGIS. QGIS also has a python plugin called PyQGIS which we can look into as well. Maybe making a OpenVS python plugin that takes the data and automatically maps it or something. Or use something other than python to do that.

NOTE: We also want to save a parameter file for the current Ardupilot so that when people setup the system they don't need to change parameters manually.

Now let's try it!!! We went out and collected the following CSV data file w/ the Honda Accord:

log_2021-01-20 11:55:26.672083
Download CSV • 758KB

Also we noticed we forgot to transform the units of dege7 to deg for lat/lon! So we fixed that in the actual code and fixed the file.

Download CSV • 929KB

Now let's open GIS and start logging it!

First we upload the CSV file using "x/y" as "lon/lat" which gives us the correct GPS coordinates.

Now we can see the route on the map as the above, no other information has been added to it just the coordinates. We'll add the following:

  • Map background data (for visualization purposes)

  • Markers for acceleration in the x and y directions separately

  • Markers for the velocity of the vehicle

We're using WGS 84 coordinates for now. That's the relatively standard one. https://www.latlong.net here we can find our LAT and LON to make sure the GPS is working correctly. Also and important note from QGIS here:

Now onto actually graphing this whole thing.

There's some data!!!! And it's looking really cute. So what we're going to do is start

Now we want to set the layer symbology. All we're going to do for now is graph accelerations and velocities individually. Let's start with the y acceleration (centripetal/turning acceleration).

We can see the circles get LARGER at "turn areas" meaning the lateral acceleration is higher in the turns which makes sense! I think it's graphing magnitude right now but we should check.

Now this is the graph of the x-velocity of the vehicle and we can see where our speeds were high and low!

And now finally, this is our x-acceleration which is the forward/reverse acceleration of the vehicle. We can see where we sped up/slowed down, and etc!

This is actually really cool!

Here's a close-up of a stretch of road, and we're plotting yacc (radial) we can see the size of the points increase with the turn. We just want to change the color now to account for direction.

Red is NEGATIVE in this case and Blue is POSITIVE. This indicates that right turns are (+) and left turns are (-).

The data is also very very consistent with the exception of this one area over here. The GPS data seems to just randomly trail off but the data is still more than usable.

Here's the re-graphed data but this time with "x" acceleration. We can use this to visualize vehicle acceleration and braking!

In conclusion, this method seems like it'll work really really well for measuring car accelerations and things. We also just need to add force sensing on each of the four shocks and then we'll get somewhere! The only thing to be careful about is matching the coordinate systems. We're using the following:

For the GPS Data: WGS 84/EPSG:4326
For the Map: OpenStreetMap w/ WGS 84/Pseudo-Mercator EPSG:3857

These are very important to keep in mind if we want the data to match! Here's the main differences between the projections: https://lyzidiamond.com/posts/4326-vs-3857

  • Basically, they just take different types of data and "project" them onto an Earth-Map. The EPSG:3857 is the standard for most web-maps while the EPSG:4326 is used by GPS sensors.

But here's the main idea: we have the beginnings of a super cool project that can plot the acceleration of a vehicle! We were driving at around 40mph for this and still got pretty high resolution data! The system has a max sampling rate of 10Hz which should be more than enough for most vehicles.

Soooo, I guess OpenVS coming soon?

#updates #omgrobots #sensing #GIS #data

9 views0 comments
© copyright 2019 | aditya mehrotra