Tuesday 26 November 2019

GPS & IMU Data Expansion

Following on from the DIY CAN-Bus data logger, I wanted to continue and build the next module in the data-logging chain. I wanted to add a module which could acquire GPS data at high data rates so that it would be useable for track data analysis. The GPS data logged via my mobile phone on previous trackdays had shown promise but the update rate (1 Hz) was too slow and the accuaracy to low to really make the data useful for track use.

I decided to use a GPS breakout board that is capable of 50Hz update rates.
I also added an IMU module to the board to try and see if any useful data on accelerations, pitch & roll angles could be extracted. If not, the module could be disabled or removed in a future revision.

Similar to the datalogger module, the GPS/IMU module uses a Teensy 3.2 controller for the data processing. No data is stored in the GPS/IMU module. The data is collected from the sensors, assembled into CAN messages & transmitted on the bus to be picked up and recorded by the datalogger module.

The module is a bit larger than the datalogger as I have used breakout boards for the GPS & IMU rather than mount the chips directly. A 3v coin cell battery is included to allow 1s hot starts of the GPS module. That way a fix can be acquired very soon after the module is powered on.




Data is currently polled at 20Hz and passed directly to the CAN Bus. This is to simplify the software & prove out the concept. If everything works and the data looks useful I would like to add a Kalman filter to the data.

The pillion seat replacement cover currently installed on the bike makes an ideal mounting point for the GPS antenna. The antenna is mounted on the base plate but underneath the outer fairing. This way the antenna is hidden from view but has a direct line of sight to the sky for optimum reception.



Having tested the unit, the GPS works very well. Even without filtering, the data rate seems fast enough to get relatively stable position & speed data. With the hot start function, position data is available as soon as the datalogger is ready to start.

The IMU module has not been quite as useful. The unit is a Bosch BNO055. While standing still the orientation looks quite good. However, once the bike is moving, accelerating, turning, the unit seems to lose track of which way is up and so the pitch, roll & yaw angles don't make any sense. There is a possibility that I may need to mount the module more securely so that it is held in a stable position but is isolated from spikes in acceleration caused by bumps in the road.

Front End Conversion

It was recently brought to my attention that I have not provided any detail on the front end conversion that I have carried out on the bike.

I may have skipped this topic due to the nature of the blog but at this stage it has become more of a project blog than a pure EFI conversion blog so it seems fitting to include it.

I had planned on doing a front end conversion for a while to improve the stability of the bike. I had spent a bit of time collecting the parts for it and then sometime before starting the bike on injectors, I installed most of it together.

I had grabbed a full K4/K5 GSXR600 front end for decent money. 

I wanted to modify as little as possible in keeping with my "100% reversibility" motto I had at the time. I figured the GSXR steering stem could work in the CBR headstock with a different sized top bearing. The size ended up being pretty non standard but I managed to find one to suit in the US.

I also wanted to keep the smaller front wheel from the CBR rather than use the GSXR wheel. The GSXR axle is bigger than the CBR axle but I could again just swap the bearing size and dust seals to make it work. I did need to make new spacers to put the wheel in the right position. 

The CBR brake disks were too small to fit the GSXR calipers but I couldn't use the GSXR disks with the CBR wheel as some disk offset was required to get the disks lined up in the GSXR calipers. A bit of measuring and research pointed me towards CBR900RR disks. These had the same ID & bolt PCD to fit the CBR wheel while having a large enough OD & offset to put the disk between the GSXR calipers.

First, off came the stock front end.


Then out with the old headstock bearing races.


Move to the new steering stem and insert a new lower bearing on OEM CBR250 dust seal.


The new steering stem required a 30mm ID upper bearing but that made standard tapered roller bearing sizes too big for the 47mm ID CBR250 headstock upper bearing seat. Luckily I found a suspension reseller in the USA that could supply a bearing kit especially for these types of swaps including an oddball size tapered roller bearing 30x47x12 and a 3mm spacer to bring the assembly up to the 15mm stock bearing height and dust seal.




Forks in place.


The throttle tube housing and starter/kill switch assy needed the placement lugs removed in order to fit onto the new clipon.


First impressions were good


Moving onto the front wheel, first out came the old bearings & seals and off with the original brake disks


The new wheel axle is 25mm OD so the original wheel spacers and bearings would not work. To combat that issue I designed new spacers to suit.

New Centre Spacer

Different size bearings (6905) allowed the wheel to fit straight on the axle and 32x42x7 oil/dust seals to fit. The bearing/seal stack is smaller than standard but that got swept up with the difference in wheel positioning on the GSXR axle.


 A pair of new CBR900RR disks. The photo below gives an indication of the size difference from the standard CBR250RR disks.


The wheel spacers were built into the new axle and nut but as the CBR250 wheel is narrower and includes an offset from centre, I needed additional spacers. These also compensated for the smaller bearing stack.


Everything on and looking fairly well!

Once the main part was fitted it was time to figure out what else needed changing. 

The CBR ignition barrel did fit the GSXR top clamp but the steering lock did not work so I removed the lug from the frame. That may have been the first irreversible action of the project!

The steering damper mounting lug needed to be removed from the GSXR lower clamp to clear the false air inlet ducts.

As the GSXR forks were wider, they fouled the front fairing and false air ducts. Removing a small amount of material from the ducts and fairing fixed that. The fuse box was also removed and replaced with 4off sealed individual fuse holders to make room. 

The brake setup took the longest to get right. I am very particular how I want my brakes to feel and I found the stock CBR brakes felt close to perfect for my liking. 

I was using a post-recall GSXR master cylinder with the standard GSXR600 calipers but I found that combination too soft for my liking although the braking power was excellent. 
I had at one point acquired a set of K2 GSXR1000 calipers by accident which had 2off smaller pistons per caliper than the GSXR600 units so I tried these on the bike and found a massive improvement.

I had a bit of a clearance issue with the post-recall GSXR master cylinder though. The top entry fluid hose fouled on the mirror stay bracket & nose fairing of the CBR so I had to find an alternative. I scoured eBay for radial master cylinders that had either side or bottom entry fluid feed hoses. One attractive option was the Brembo unit from a B14 Yamaha R1. 

Before spending money on yet another part, I did some calculations on all the combinations of all the parts I had to hand to try and quantify the differences in feel and braking power and map the results out to find the best solution.



It turned out the R1 master cylinder coupled with the K2 GSXR1000 calipers worked very well. Subsequent testing proved that so that has become my final setup.

Clearance under the nose fairing was also tight enough to foul most fluid reservoirs so I had originally employed a HRC style hose fluid reservoir. This worked well until one day after a session of heavy braking I felt excessive drag on the front wheel. There was not enough room in the hose reservoir to allow expansion of the heated fluid. I needed to find a proper reservoir to fit. 
After more trawling through eBay the Triumph 675 Daytona reservoir looked suitable so I took a chance on it. It fit perfectly under the nose fairing!



It took some time to get to the optimum setup but the result is worth it. Between the upgraded front end and the new rear shock the bike handles great! Final front end configuration as follows.

Forks Axle & Triple Tree:  K4 GSXR600
Calipers:                             K2 GSXR1000
Wheel:                                CBR250RR
Disks:                                 CBR900RR
Master Cylinder:                B14 R1
Reservoir:                           675 Daytona

Wheel Speed Sensor Bracket

Way back in 2014 when I had mostly completed the front end conversion and installed the Koso dash, I did not pay a huge amount of attention to the dash wheel speed sensor installation. I simply used the supplied sensor & L-bracket and used a longer fairing bolt to fix it inside the front fender and keep it out of sight.

There were obvious issues with this installation. Because the fairing bolt was M6 and the L-bracket was designed to accept an M8 bolt, the fit was very sloppy. I was also tightening the bracket onto the back face of the cast fork lower which was never meant to have anything seated on it and so was not finished flat. I was able to improve the situation using 2off DIN 9021 washers either side of the bracket but the installation was then very awkward to fit and adjust having many parts that needed to be held in place and barely having enough space to get a hand in between the fender & wheel.
Also, every time the fender or forks needed to be removed, the sensor position needed to be manually set again on assembly.

Recently I have acquired an FDM 3D printer and so it presented a good opportunity to make a nicer and more user friendly bracket to hold the wheel speed sensor in the correct position and make removal & installation much easier.
I also decided to replace the supplied Koso sensor with another, smaller sensor which would help to make the installation tidier.

My idea was to design a one-piece bracket that would be sandwiched between the front fender and the cast fork lower. The bracket would need to be located using both fairing bolts which would ensure the sensor would always be installed in the correct position.
Replacing the standard Koso sensor with the smaller unit also had the advantage that the smaller sensor has a threaded body and therefore can be installed by sandwiching the bracket between 2off lock nuts. This makes the installation tidier and makes gap adjustment relatively easy.

The Koso sensor is a simple hall effect sensor fed by 5V and whose signal is pulled high when a magnetic object passes by. The sensor I chose to replace it is one from RS Components (stock #304-172). The below image shows the size difference between the sensors.

Sensor Comparison


The basic design of the bracket is straightforward. The "ears" which are clamped between the fender & fork leg were kept as thin as possible while still having enough stiffness to keep the sensor in position. Steel compression limiters were also added to the mounting holes to allow the fairing bolts to be torqued down properly without risking damaging the plastic bracket.
The sensor is located inside a round bore which incorporates a recessed internal hex for one of the sensor lock nuts. The second lock nut is then tightened onto a flat at the nose of the bracket.

Bracket & Sensor CAD

The bracket was printed in ABS plastic. This may be exchanged for ASA to increase environmental resistance in the near future depending on how the ABS copes with general use. The stainless steel compression limiters were pressed into the printed part.



The bracket was then installed on the bike and the sensor gap adjusted to c.0.8mm.

Installed Sensor

The new sensor installation is much tidier and makes the front end easier to work on.

The observant among readers may have noticed that the bracket in the CAD model does not match the printed bracket in the photos. That is because the CAD represents a later design revision. The bracket was originally designed to centre the sensor on the low head cap screws used as "teeth". However when I tested it, I found the smaller sensor tip was sometimes detecting the hex recess in the head of the bolt and so provided either unreliable or double frequency pulses to the dash.
The issue was fixed by moving the sensor position radially outwards by 3mm. This made sure the sensor tip would only see a single solid "tooth" at each cap screw, resulting in reliable signal.