Page 1 of 1

Data logging

Posted: Sat Mar 24, 2018 2:59 pm
by nr
Not entirely sure where to put this - tech tips? General bike talk? Track days? Dunno really! Anyway, seeing as this is peripherally TRX related, I thought it worth posting here. I've been playing recently with some home-brew data logging stuff, and although it's not yet finished, it's all looking pretty positive so far: https://nronketti.wordpress.com/2018/03 ... y-numbers/

If there are any electronics doods here on the forum, I'm all ears with regard to the circuitry for regulating and cleaning up the TPS input. And I do really have my doubts as to whether the lean angle sensor thingie will actually produce sensible figures once it gets plugged into a bouncy old TRX. We'll see!

Anyway - thought it could be of interest here.

Ta,

Re: Data logging

Posted: Sun Mar 25, 2018 1:14 am
by dicky
Have a read of this thread... http://www.trx850.com/phpBB_forum/viewt ... 64#p104664
He's been busy building a MT09 engined TRX lately, get in touch to see how the data logging ended up.

Re: Data logging

Posted: Wed Mar 28, 2018 10:18 am
by coxylaad
Yo!

yes I am looking into it myself.

I have looked at a few different options but I have settled on the following plan of action:

The most difficult part of loggind data is actually interpreting it, so I have decided to utilise an app on my phone called Racechrono.
Its well used in racing and has a lot of features for analysis, and most importantly the specs are available for data input from a diy datalogger.

My datalogger is going contain the following hardware:

* Arudino Mega (I think I could have used an Uno for this but I have a mega sat on my desk so why the hell not)
* Arduino Bluetooth breakoutboard (for establishing the bluetooth interface with the phone)
* Adafruit Ultimate GPS module (10hz, which is important for data logging. most phone gps modules have a max refresh rate of 1hz, thats 1 update per second. At 140mph I will be covering 62 meters in between data pings. you may as well not bother with that resolution!)
* MPU6050 6 axis accelerometer and gyroscope.

As the phone app is actually doing the datalogging then that makes the coding of the DAC (Data Acquisition Controller for its technical term) a lot easier. all I have to is collate the data 10 times per second from all the sensors, put it in the correct format string and send it down the serial port for the racechrono app to pick up.

Once its setup I will be recording the following information:
* GPS position (10 times per second)
* Speed
* Acceleration in x, y coordinates (good for calculating how hard you are braking without having to install a brake pressure sender)
* Throttle position
* Engine Speed
* Brake switch
* lean angle (this might be a little difficult)
* In addition to this my bike has a traction control system, so I will be T-ing into that to pick up the front and rear wheel speed sensor data.

So from the information provided I will be able to see what I am doing eg when I brake, and let off the brakes, when I apply the throttle and how hard and what gear I am in (calculated field), against what the bike is doing - speed, acceleration, lean angle, percentage wheel slip.

As you can imagine I am awesome at parties :lol: :lol: :lol:

Re: Data logging

Posted: Wed Mar 28, 2018 7:47 pm
by nr
Very cool! If I was to start again, I'd probably use a Mega rather than an Uno too - purely for the extra serial port. Having a single serial port is a bit of a pain for debugging - so I've worked out an elaborate system of flashing the onboard LED to tell me what's wrong, and dumping variables to SD card. That, and being so limited in memory, reminds me very much of my early days coding 6502 assembler. I know, I could use the softserial library to put the GPS on another port while I'm debugging, but then I need to maintain two versions of the code, and anyway - it's not as much fun :)

The idea of using an ADXL335 for lean angle was never going to work, of course. In a static system, it's perfectly OK. But of course, even at my speed, a motorcycle isn't static. So that idea goes in the bin. I'll find something else to do with the accelerometer. I may well take a look at the MPU6050 instead - looks just the ticket.

Still a way to go with mine - I really need to pull my finger out this weekend and finish soldering the taps into the brake and TPS circuits. Everything else is pretty much done now. I can log at 5Hz easily - the GPS will take the commands to log at 10Hz, but I'm not sure if that's just extrapolating, rather than taking genuine readings. Have a good idea now how to measure RPM using the FreqCounter library and a feed from one of the phases of the alternator. That may well appear in v0.2.

I'm not going to call it version 1.0 until I've got a better case to put it in than an old Tupperware box with a hole cut in the lid :)

Re: Data logging

Posted: Thu Jul 12, 2018 10:50 pm
by coxylaad
how are you getting on with this?

Now that mechanical work on my bike has finished until the winter my focus is back on this.

Re: Data logging

Posted: Sat Jul 14, 2018 12:42 am
by nr
It's kind of on the shelf for now. The lean angle sensor idea was dumped, as I don't have NASA level maths to do the extrapolation. Everything else worked OK, but logging the same data, in a straight line at 70mph on the A505/A1 every day was pretty dull. I mean, I like data. But when you're faced with three hours of sampling at 5Hz, all showing essentially the same thing, well, I think I'd rather get on with riding the bike than reading the numbers.

I'm up to Cadwell in a couple of weeks - I may nail it back on the bike to see if I get anything useful out of it. If nothing else, at 5Hz I should get a reasonably accurate map of the circuit.

Re: Data logging

Posted: Tue Jun 11, 2019 11:00 pm
by coxylaad
did this get permanently shelved?

I am testing my version at Croft in a fortnight. The first prototype is purely gps, phase 2 will add more telemetry data.

Re: Data logging

Posted: Thu Jun 13, 2019 9:04 am
by nr
coxylaad wrote:did this get permanently shelved?

I am testing my version at Croft in a fortnight. The first prototype is purely gps, phase 2 will add more telemetry data.
Not permanently - but I took it apart to use the Arduino to control a pair of fans to keep my shed cool. Currently all the bits are kicking around, and it just needs putting back in the bike. I'll probably pick it up again once I've finished with the SV650. Or then again, I have a plan involving a Guzzi V65.

Definitely interested in resurrecting the datalogging stuff though. I managed to put a great bug in the first version of the code that I wrote. It stored the longitude as an unsigned value - which worked all the time I was riding around home, as I live just East of the meridian. As soon as I went West of that line, all sorts of strange things happened with the location data. I'll try to dig up the trace it logged.

I'll keep updating things here and on my blog as I play with it though.

Re: Data logging

Posted: Thu Jun 13, 2019 1:06 pm
by coxylaad
haha quality.

I'll let you know how I get on next week.

Re: Data logging

Posted: Fri Jun 14, 2019 8:35 am
by Tarwetijger
Image

:lol:
Nice work lads. :)