foreign
[Music]
Tish is an independent
consultant assisting all sort of
businesses from manufacturing to early
stage startup today's talk is about
Hardware design to measure the distance
between bicycles and passing cars in the
hope of increasing safety for oral users
please welcome Tish
thanks yeah
welcome everyone I'll start with an
uh just a minute kidding have you sorted
cool
back
I'll start with an acknowledgment to the
country so today we are gathered in the
traditional lands of the original people
of the culin nation I acknowledge their
deep ties to the land and Waters of the
region and I pay my respects to the
elders past present and emerging most of
the work here was done in Adelaide so
I'm coming over from Adelaide which is
the Ghana Nation
so just um like a sort of a project
management style outline of what the
talk will be about this is a sort of a
full stack project uh in uh
about riding bikes they're just keeping
moving things moving
building Hardware building firmware for
that Hardware uh putting it in a case
recording the data from that hardware
and uh sort of uh
call to action to become part of this
study which is called the velograph it's
using open source tooling all of this
tooling is open source for putting uh
putting their devices together for more
people to participate in the study in
road safety and gather more data or to
build the hardware themselves so it can
be deployed in other other parts of the
world or other parts of our country
so this sort of work began with the
center for automative Safety Research
which is part of Adelaide University
a previous study that was done in act
with around yeah 11 000 passing events
being recorded with different
separations there are laws are in
Australia for bike riders to car
separation but you can legislate
something unless you monitor it you
don't know if it's actually being you
know being effective uh you can't record
videos everywhere it's being passed or
you don't have accurate separation
measurement record records
so the differences in passing distance
is sort of associated with road
classification bike land presence and
speed limits was sort of the overall
response so I just got some numbers
around the number of passing events that
was in the previous study and it has in
2019 also and the new study that we are
going to talk about today has already
passed that number of passing events
since it was launched uh like a month or
so ago
so there are Publications around the
previous work this was done and the
hardware there used Ultrasonics to
measure the separation and sort of I'm
wearing this French t-shirt about lasers
on sharks because this time we're using
uh like lasers to measure the separation
which is more accurate it's faster
rate of capture of data and so on
so this is sort of the amount of data
that was captured in Canberra uh around
the main CBD areas various commute areas
that people usually write to work
typically and the different separation
distances that were encountered ready
sort of bad to close passing blue is on
the good side
so the sort of this is a pretty busy
dense slide but it was sort of the specs
I inherited to build this sort of stuff
my involvement was being doing overall
systems architecture for this as an
independent consultant working out which
pieces could be done what was out of
scope for the targets budget size of the
hardware I'll start passing these around
uh these are some of the hardware that
was put together various iterations of
where you can pass them around I have a
few of them
so this was sort of that Target Hardware
sizing that was put together this is the
docking unit
on which the
which is attached to the bike near the
front and it has a couple of laser
distance sensors
and I'll keep this one this is the main
unit on which the CPU sits and it has
got connectors and stuff we'll talk
about more about that so yeah so a lot
of the target features were essentially
to allow cyclists to recharge the device
make it a bit robust handle vibration
improve the frequency of data capture
and also some sort of enhanced platform
capabilities to view the data
automatically send the data that sort of
brings a bit of a network constraint
this is not an iot device you're talking
about it's actually a logger more like a
Data Logger rather than an iot connected
device
and sort of process the data
so yeah so I swear sort of uh I started
working with Jamie so I did this work I
talked about Dr Jimmy McKenzie is the
Project Lead he sort of did a lot of the
uh wrangling all of the supporters
together
conceptualizing he worked mostly on the
previous study and set this up so I have
done work with the lab previously
modeling vehicles uh using cameras and
sort of 3D modeling Technologies uh to
for creating soft cars which is what
they call for testing detection of cars
by automated Driving Systems so if you
have a collision with this soft car it's
not damaging so they just put a make a
foam car and put it on a platform and
then drive this around in a test range
and see how automated Driving Systems
detect this soft car so I worked on a
rid of that I have presented at the
conference previously about energy
monitors so gme has one of them so he
was familiar with my work around that so
sort of got in involved with this
project so excluding myself and Jamie
that other people involved in doing the
website that analysis and the hardest
part is obviously device deployment
every bike is slightly different and
that requires custom fitting of the
cabling and the device to the bike where
it will go so each fitting takes about
20 minutes to a half an hour so that's
the sort of the challenge in rolling
this sort of measuring device out to
lots and lots of users other than
designing and making them of course
so those are sort of the wrangling the
supporting Network to get the project
offline was obviously Jamie works for
the University of Adelaide and I
contracted with them to get most of the
work done uh this was supported by the
Australian government office of road
safety a city government
various bicycle Network and Pedal Power
are bicycle Alpha advocacy groups
encouraging more people to ride and
making sure the environment is safe for
riding and the website and data
processing pipelines were done by inside
via artificial intelligence
foreign
so that new study uh other than just
doing SCT Canberra and to cover multiple
cities run over longer periods include
more and diverse participants have
aggregated anonymized data available for
researchers for further work or and also
develop open source
friendly generic Hardware that other
cities can adopt build their own and
produce more of these devices for
logging for themselves
so the sort of Designing a piece of
Hardware designing any technology is
sort of a series of choices and when you
make those choices you stick yourself to
a path that you may sort of cannot come
back from or the project gets delayed
sort of deal so the the first choice we
had to make was what was the host CPU to
use or host bold to use so you're not
working at a very low level we are not
designing complex high-speed boards
we're just taking an off-the-shelf
fairly integrated board and building a
larger device around it
so that we did like a decision Matrix
called that I found out these are called
the Pew matrices with little uh scores
on various features we wanted on the
board and how these different things
rated so top of the list was the tinsi
which you see there and the pi board
which is a micropython board
so I tried to get the 10c was obviously
top of the list with its high speed and
built-in microSD card support and lots
of stuff
that was good about it but I tried to
get one from Mauser and Mouser
repeatedly rejected sending it to me due
to itar regulations so we dropped it I'm
on some list somewhere
so they I we had to drop down to the pie
board which was sort of in done mostly
in Melbourne and we reached out to
Damian on slack and we ended up getting
the last 140 Pi boards around in the
world so so if you are trying to get a
micro python Pi board and you're
wondering where they went they are all
attached to bikes
um the other piece of core Hardware in
this is essentially the lidar or the
laser distance measurement sensor
so the the lidar modules have become
pretty commonplace now compared to you
know a few even a few years ago to three
years ago and it had we tried first to
take a hardware device and build our own
lidar module but that proved yeah too
hard because we had to put out a
secondary CPU to read the lidar itself
and so that was a more involved design
exercise so I chose to pick up something
off the shelf this TF Mini Plus which is
probably other than the CPU most
expensive part of this kit
um so this uh so it's sort of that two
TF mini pluses on the system which are
mounted at the front and back of the
bike and they measure of the passing
event also when a car comes past it
passes the back sensor first and then
the front sensor so you can see that it
was a forward passing event so expect a
bit of a gap there based on the speeds
at which the cars travel let's say 60 or
80k's uh you that's why you need the
very high sampling speed compared to
Ultrasonics and other other systems in
order to make sure you get The Passing
was forward sort of event
um and also it's indicates a velocity of
the vehicle as well in a way you get a
speed measurement
so the other bit of Hardware or third
mode most expensive component of the kit
is the GPS
so choosing the GPS is sort of uh again
an exercise in cost and complexity
management and sort of Hardware
integration management you can on the
one side we have like an rtk capable GPS
rtk stands for real-time kinematics so
they give very high accurate post
process GPS but they produce lots of
data that you need to sort of correct
afterwards and other side you have basic
not so accurate GPS that will give you
an indication of a time and
approximately within 10 meters where the
bike was
so just for reducing data volume and
cost reasons we chose the not so
accurate GPS and chose to fix it in post
because the assumption is we don't need
to accurately know whether cyclist is we
will align it to the known Road vectors
which is data quite commonly available
so a bit of our show and tell so that
open source component of the electronics
design was essentially we took mostly
easily available Hardware Open Source
Hardware
or some integrated piece of Hardware
like the TF Mini Plus and put it
together using fairly simplistic
boards in calcad so kai-cad for those
who don't know is a leading open source
ecad Electronics design tool it came
from originally from CERN because they
were designing huge amounts of
electronics for themselves and it also
makes this design when it's public
reproducible for others because you
don't need to license a separate ecat
tool to do iterations on the design if
you need to
so I'll quickly bring up the board so
this is one of the main boards just a
bunch of connectors and Amazon iron
board on which the pi board sits and the
cool thing with this one is you can
actually add step models to each
component on this board so that becomes
so I'm jumping ahead
so that it becomes like this in kite so
you can actually see the 3D model parts
of the board
and that becomes important when you're
designing enclosures and other bits so
gives you an idea of the stack up the
battery the different connectors
um
So Jamie did a lot of this 3D STL stuff
is a mechatronics vht so he's much
better at these things than me
so it looks really cool
just hop back to the presentation
so yeah so they're making the
electronics consists of four separate
boards it's a board stack and they're
designed [ __ ] doesn't do a project with
multiple boards in it you have to design
each board separately but you can
generate 3D models out of them so the
main ones are the sort of connecting the
sensors on having a user interface just
buttons and LEDs no screen it's very
basic it's designed for outdoor usage
you don't want to make it too
complicated the bike will have spills on
their bikes and stuff you don't want to
mess out there
um and uh Amazon board to break out the
pi board
and something to host the battery and
the GPS and other things rather than
building custom Hardware this sort of
thing could be done using an app or
something Riders usually have their
phone in that thing so in their backbone
riding jacket but then you'd need
Bluetooth or similar things to stream
the data that may be a feature iteration
where you have a Bluetooth enabled
device getting accurate GPS from the
phone and just focusing on the lidar and
the distance measurement aspects of it
so from sort of uh it was a from here it
was a jump into either I go into the
enclosure and the mechanical engineering
aspects or I just talk a little bit
about the firmware on the software
aspects so I'll just talk a little bit
about the firmware aspects of it so the
firmware is fairly simple high level
because we chose a micropython board
most of their engineering team are
mechatronics Engineers Automotive Safety
Engineers who don't want to do low level
embedded coding in a custom
microcontroller you just want to be able
to maintain and iterate it most of my
input on this was to make sure that the
maintenance team had sufficient skill to
continue working on this project after
the initial design was done you didn't
need low level assembly skills to make
make it keep working and other bikes and
enthusiasts could use it in somewhere
else in the world without learning
difficult things
setting up their own compiler tool
chains or whatnot
so yeah so that was sort of the
micropython was an easy choice for that
and multiple CPUs these days support
micro python and a fairly easily
available so if in the future if you
choose to move to an ESP risk 5 based
different architecture other than the
stm32 pi board you could move to those
ones
uh and redesign the electronics inside
the enclosure to fit
uh so the firmware the the fun part of
the firmware is that micropython has is
the sort of uh lots of sensor reading at
different speeds so GPS is red at one
Hertz the fastest thing is the lidar
which is right at 50 hertz the
temperature is right at one Hertz and
the other thing is how long can you keep
logging so the battery and the power
management is quite important so the
battery levels are red and if the
battery goes too low then it goes to
sleep sort of deal to keep all the logs
in place we also need to write a flash
to a Micro SD card all of the logs which
micro python provides a cool way to
appear as a storage device when you plug
in so you can offload the device by just
plugging it in and making the MicroSD
card look as a USB drive so it makes it
really easy for people to without a
custom client to get the log files off
and upload them into the web service
so the hardware versions will go up
probably and a logging format has to
change as we include so that's the other
bit of thing I had to sort out was
essentially getting a logging format I
sort of badly just invented another
standard I guess for saving the logs
I looked at various libraries for uh
saving things like parquet and other
file formats to save the logs in a
standard form but that none more
available for micropython so I just
invented like a bit packed binary struct
style library with a CRC where you can
batch and write to the micro SD in the
future may go back to a more standard
way of saving all of the data
so
yes that's sort of the consideration
here we came up with a custom format
called dot Velo where the files are
written
and
the fun part with micropython was uh we
could do that instead of doing uh when
this is time or this load this uh sensor
or a timer disk write this out in an
infinite loop with micropython we could
do like a sort of a more abstract
approach and Implement some core
routines where you could have
independent functions which would read
the sensors and just sleep and then the
single threader scheduler and
micropython will wake up the right core
routine and do do the uh do the
appropriate function making it much more
abstractable
so I'm just going to quickly show the
sort of the core routine part of it
so there's not too much code in this
presentation it's mostly just pictures
of Hardware stuff this is the Data
Logger part of it which has got this
little async infinite Loops for writing
logs
another another read distance and it's
just a sync infinite Loop and most of
the time is just sleeping and waiting
for doing the next one so it has got the
reading of the distance sensor
updating of the GPS
buffer reading the GPS buffer from the
uart
reading temperature
reading voltages from the batteries and
then a little heartbeat LED so
everything is implemented as a Cinco
core routine style stuff in this high
level way and then you just create this
outside Loop and make all of the subcore
routines run underneath it it's in the
future if you add more sensors or
something else you can just create new
core routines and hopefully they are not
thrashing over each other
so yeah so that was like a really cool
way to use micropython and use those
core routines to have just gradually
build up different sensors and make sure
they all work
and also the user input for pressing the
power switch and anything else was
detected
so now I'll go back to the hardware bits
around the casing and design so most of
the
mechanical design was done in freecad so
free pad is a parametric modeling solid
engineering CAD tool
Jamie honestly did most of the work here
being a mechatronics mechanical engineer
he just picked up all of the ecad stuff
exported it out to STL which I was
showing is what you can do out of
kai-cad and you can then take it into a
mechanical design tool put it in and
start putting casings around the
electronics assemblies and sort of have
pretty good confidence that they will
fit so one of the gotchas I got from
previously designing it is that in
addition to working making sure it will
fit you need to make sure that you can
slide the electronics assembly into into
the Mechanicals we have to have a little
bit of clear
for rotation so that things can slide in
so 3D printing really helped with doing
lots and lots of iterations of the
enclosure making sure you got the right
size before you go went and got lots of
them made so the project never really
did injection molding or anything so all
of the enclosures you see floating
around and this one this is the
enclosure in the diagram that is
actually printed by pcbway it's pretty
solid high density and you can hardly
see the layering in there it's pretty
thin layers so it's pretty solid
and then there is a mount for the lidar
sensors and stuff with vinyl that you
put onto the bike and any amount of
cable ties to make sure nothing falls
off when it actually goes on
so uh freecad had a problem called
topological naming problem so when
whenever you have a stacked up assembly
tree and you changed one part down in
the ecad in the cad the entire thing
will fall and crash so they're they're
still looking for help in fixing the
topological naming problem
so I'll just go over freecad a little
bit just to show all the open source
tooling we are using so this is I as I
was saying the STL exported from kai-cad
can be seen here is sort of the same
step file with the different parts of it
and you can turn on the
different parts of the cap so that's the
cap there
then actual Extrusion of the tube
on a recap
and then there's the the actual main
board there which is imported from cacad
so yeah so all of the STL files are
available or for printing and other
people to build a similar device
yeah
so the other big part of building these
things is the connectors and the screws
and all of the stuff so uh any any
device that that's sort of uh
out there is subjected to vibration and
stuff they live a rough life and so that
this is where it will most likely fail
so most of the connected choices made
for even for pcbs were through holes so
that they had more mechanical strength
in them and uh that there's one external
facing thing in here which is
essentially this button so it's sort of
outdoor rated and we try to keep
everything else on the inside so this
USB connector is also outdoor rated but
it's not designed to be sort of exposed
to rain so it doesn't have a cover and
such so so the way it fits in the boards
you have there it slots on and this is
on the inside and so the only thing
Exposed on the outside is um is the
switch
so a fair amount of time was spent
assembling all of the pcbs Adler
University got their own Reflow oven
got a bunch of postdocs and grad
students to put put the boxes together
so overall around
140 units were built
so the the unit also has uh different
modes basically logging and programming
based on how it goes into the dock and
it detects the pins that are in and that
acts as a sensor and then when you take
it off it becomes like a storage device
and goes off logging mode
and that's sort of putting it in the
dock and pulling out acts as a
sort of as a switching mode as well
uh the most of the equipment and battery
is just housed in here
so setting up the bulk as you can see
like I almost looks like you are
planning to do some Bitcoin mining or
something with USB hubs a lot
a big USB hub with lots of your things
to charge up all of the units in the
mass assembly line
and the charging should be monitored
because even though it's 1860 or 50s are
relatively stable they're still far
hazards uh hopefully there will be no
leaks or accidents
and this is the sort of we are now going
to the last part of the presentation
where it's not what's out what comes out
of it this is the
bad custom format I invented to pack the
different uh values into it
um uh and make it easier to on the
memory and storing on the SD card not
that the SD card Runs Out of Space it's
just easier to flush the smaller binary
files on
this is like a will take up longer than
I have talked this is a sort of a sample
of a passing event
so one of the compromises we had to make
during the design of the device was to
not include cameras because we would
need a higher level device with UVC
video capability to have the cameras on
and then put this together so this was
this is a synthetic video with the
device logging distance and the rider
having cameras on the side and then it's
stitched together again in the post to
demonstrate what it looks like
so this is a relatively safe ride with
most of the passing distances more than
one and a half meters
uh but you can see the yellow Edge where
the car is first seen on the red Edge
when the car passes by and the sort of
the changing distance between the rider
and the rider on the vehicle on the
outside you can sort of get an idea of
the far for this distance the laser
sensors see up to three meters away
and legislation says the car passing
distance is one and a half meters and
then one meter on a
so most of the passing here is
relatively safe
uh the rider is indicating out because
there's a parked vehicle they're coming
out onto the road
cars are still making space for
and then back onto the bike lane
so the passing Behavior shifts based on
whether there is a bike lane or not so
we'll see what the study comes out but
typically if there is a bike lane
passing distances are actually smaller
then if there isn't
uh so I've got
seriously I've got a sample here of
closer pass
so a lot of the passes in this
particular video are closer much closer
than the other one
scroll forward a bit
so you can see here the one and a half
meter passing distance is not there
so these videos are up on YouTube and I
will make the slide tag public and more
data will come up probably not with
video but more aggregated data
of
students
let me run the slideshow
so yeah so the recordings are uploaded
in this sort of web UI so there's a site
project.fellowcraft.app and once you
sign up you get a custom code
and the devices are usually passed
around between people by the bicycle
advice groups or the castle lab where
they're fitted and you get a custom code
with which to upload your data you don't
have to share any of your details other
than what's here
when we were fitting one of the bikes
one of the people just made a comment
that all of my stuff is logged in Strava
anyway
but you know the Privacy stuff is
interesting and university has to abide
by those what what people share publicly
is sort of a matter of opinion and
comfort with that sort of data uh you
just have to say how far you are so that
that measurement can be taken from the
edge of the bike to the outside
yeah so uh and then this is sort of a
sample uh that as I was saying we fixed
the GPS in post uh because it's a pretty
cheap and nasty GPS
and the GPS is automatically snapped
into the roadway or where appropriate uh
in post-processing
uh the passing events are identified and
displayed so uh the user whoever
uploaded the data has access to their
passing events
and they can come back and check on that
because every user gets a custom code to
upload that out of it
and symbols are sort of colored in based
on the distance so green means good
pale green means not closer and then red
orange means getting yeah red means it's
less than the legal limit
so yeah so project dot fellow graph.app
is sort of the sign-in page you can log
in and upload your data there you can
sign up Melbourne is one of the sites
where volunteers are being requested for
uh participation in the study
uh registration is open uh so until June
is the plan but it can be extended if
the supporting bodies can provide the
sort of the installation
and then as more partner organizations
are found in other cities they can also
set up the devices as long as the
devices don't break we can keep circling
them around
so this is sort of uh the invitation not
so public invitation to uh Jamie has a
still on his private GitHub to build and
Remax remix so all of the data is there
it has been worked on for a while this
is I took the screenshot a while ago uh
we're sort of waiting University UA
University of Adelaide permission to
make it public
uh yeah and that's the end of my talk
the device looks really cool when it's
all wrapped up in vinyl
and the study has been running and has
5046 users yeah 23 000 passing events
have been detected Jamie just sent me
the stats earlier to me which is sort of
already more than the previous study
that took place in Canberra in just a
month or so so that it will keep running
and will hopefully gather more data
across multiple cities thank you
foreign
[Applause]
ambient temperature I presume outside
temperature what we're going to do with
that data
so the temperature is being recorded are
ambient temperature and Road surface
temperature uh so uh so that sort of is
another it's not related to the
separation but it's the other part of
the research around the traction that
the bike gets and riding conditions and
so on
when you get a close
when you get a close passing event by
how much can you boost the laser power
to be safe it's only a measuring device
right so it's an outdoor measuring
device it's not a laser weapon so
it's it's not power it's not bursted
does the project plan on doing any
computer vision on the data from the
camera it's like you know make and model
of course
[Laughter]
so that that brings another sort of
challenge around privacy and recording
the number plates the currently that
project doesn't have cameras integrated
in it because it's using a very low
level microprocessor right so it doesn't
have my stem32 mic Pi board doesn't have
support for video and cameras so if you
move up the stack to a like a Raspberry
Pi or some other Linux capable device
which has a VC video and you can put the
cameras on uh but there you could do it
there was a study done uh in first sort
of road safety area with cameras mounted
in intersections which is one of the
areas where most of the collisions occur
that uh the cars turn without looking at
cyclists
um and that that's used computer vision
to identify cyclists and cars coming
past that intersection this was a fixed
camera study
how long did you spend developing the
hardware
uh
the it went in bits and pieces so at
least six months
uh doing the mechanical engineering the
hardware the electronics engineering
parts of it different iterations of it
I was wondering is UV issue with
degrading the 3D printed bits or
they are covered they have got vinyl
covering on them similar to vinyl
covering people apply on their cars and
stuff
so uh there we will find out how the
casing goes out in the world
I'm wondering um like failure modes of
the like commercial Hardware that you're
using like the boards and that have you
found them standing up to the task of
this or yeah so some some of them like
in the bring up fail like this is a
failed unit
uh the
the the connections and stuff hasn't
failed yet so it has been going for a
month and there have been no unit
failure so there have been 46 minutes
out there uh they haven't failed in a
month so the study only has to last
three months or so
and after that we'll have to probably do
new versions and such
thank you um do you have the uh the the
unit cost of the the each unit you yeah
yeah so the because this was a sort of a
government-funded project there was a
fixed budget to which you are working to
so that was the cost was the 500 a unit
the most expensive parts are the lasers
which uh retail around 70 each
and the pi board obviously as the other
most expensive part of it and then lots
of Labor and stuff in putting it in
a lot of questions more about the the
research with uh with the the data the
users have to put in and they need to
provide those measurements from their
bikes will there be
um statistical sort of checks to to look
at the accuracy of that data entry
um you know if a user got put the wrong
entry wrong data wrong measurements in
that could affect the passing distance
yeah there would be a bit off check so
the UI actually has like min max sort of
sensible limits on it uh when you
actually got to use it uh and uh
definitely will affect the stats but
it's just approximate numbers are fine
for the passing distance you have an
actual distance from the sensor
okay so I think
um that's about all the questions that
we have
so
thank you so much
for sharing with us and I think you'll
be still around right yes yes so please
talk to him
yes and um some of the units are still
here don't worry yeah we'll get them
back somewhere yeah
they're not in production
thank you
[Applause]