BMW NineT Forum banner
  • Hey Everyone! Enter your bike HERE to be a part of this months Bike of the Month Challenge!
1 - 12 of 12 Posts

·
Registered
22 Cosmic Scrambler (K23)
Joined
·
109 Posts
Discussion Starter · #1 ·
Disclaimer: I am not a programmer nor an electrical engineer. My educational background is in mechanical engineering and by day job is enterprise telephony systems.

I think I'm serious about this. I just bought a benchtop oscilloscope to analyze the bike's signaling.


Now on to the show.

First thing first. I reached out to translogic to see if they had any plans to do this work for us. Here is the reply.
Rectangle Grey Font Pattern Logo


If I had to guess why nobody plans to offer it, probably due to lack of clutchplate speed sensor. I admit, it would make the whole thing soooooooo easy. When in the business of making a profit, easy matters a lot.

Goals:
  • Utilize existing translogic shift linkage pull output
  • Monitor engine RPM from coils, grip throttle position, and gear selection to calculate new RPM on rising output (for 'pull') from strain gauge
  • Base project around Adafruit HUZZAH32 board to allow dual core scheduling of tasks
  • Integrate regulated 5v stepdown into 'main' PCB onto which the Huzzah32 can be soldered (so it is easy to build)
  • Avoid any signal passthru so a failed MCU will only result in OE function
  • 100% reversible
  • Open source the whole thing
  • Try to design within commonly available components so anybody could order a PCB pre-populated with SMD devices if they so desire.
  • Make all code available via arduino sketch so that modification and upload is easy.
  • Have adjustable trimpots for sensitivity and blip duration to accommodate different riders.
  • Integrate safety bounce monitoring on strain gauge so the bike cannot be accelerated with just a downward press on the shifter.

Fallback Goal:
- If I fail to make anything fancy, at least design a simple circuit to blip the throttle when the clutch lever is pulled and the shift strain gauge sees a 'pull' (downshift) signal.

Preliminary research:
  • Throttle grip is listed as a 5.5-Ohm part on the 2021 pure parts fiche.
  • Gear position sensor is a 3-wire device, so likely a potentiometer.
  • Throttle grip repair cable lists 6 pin and is also listed in S1000RR parts fiche. Cross-referencing throttle sub-harness images on ebay leads me to believe this uses a Bosch DBW 6-pin or 8-pin connector. The connector bears the TE Connectivity logo and part number 0-1718830-1. Searching 1718830 on TE's site just returns "restricted part" so this seems promising.
  • Throttle contains a double potentiometer, so two analog outputs and two analog inputs will be required to emulate throttle blip. This is employed as a failsafe/sanity check and has been the same in all BMW RBW/DBW systems.
  • Gear position sensor will also require an analog input.
  • RPM can be derived from coils OR preferably from output on (ideally) a PWM signal sent to the tachometer cable. This is where the oscilloscope becomes mandatory.
  • RTOS (Realtime Operating system/kernel) is available for the ESP32 which would allow one core dedicated to monitoring and one to calculation / execution.
  • I am in too deep.



What this is NOT / Limitations:
  • This will not replace an existing quick shifter. It may be trivial to add that functionality, but I have no real goal of doing so at this time.
  • This will not use the IMU to give you the same functionality of the Aprilia V4 fancy stuff with lean sensitivity. I am not clever enough to do that.
  • RPM target point at shift / throttle opening will be based on owners manual published ratios.
  • All development will be based on 'Road' ride mode. I cannot override input shaping from the ECU to throttle body and also manipulate the TPS feedback.
  • Hard cutoff at 7k RPM.
  • I need somebody without heated grips to tell me if they still have 6 wires going to the throttle grip, or if it is just 4.
  • I work slow. This whole project is to kill downtime.



Anyway, that's about it. I'm still figuring out how I want to isolate and connect everything without damaging the original harness. I need to research the various connectors and find more availability for terminations, try to get a sense of how electrically noisy the wire runs are, etc etc. Here's a real quick snapshot of what the circuitry looks like so far. It still needs analog interpolation on GPS and push sensor inputs since all levels must be 3.3V at the controller and 12V at the bike. Probably need to establish voltage across the strain push side but perhaps that will also cone from the existing translogic upshift control in which case I may need to translate that to a 3V3 scale (or it might already be there, which would be nice). The coil input markers are old.
Rectangle Slope Font Line Parallel


I am wholly open to feedback/criticism/suggestion. Like I said, I am no EE. Pixie wrangling and bit bashing is not my strong suit. I figured I would get this idea out there while it is still developing so I could leverage any wisdom from those more experienced.
 

·
Registered
2016 RnineT Classic
Joined
·
39 Posts
I have absolutely no interest in auto rev matching downshifts on my 9T but I am subbing to this thread after reading your write up alone!

All the best on the project.
 

·
Registered
22 Cosmic Scrambler (K23)
Joined
·
109 Posts
Discussion Starter · #3 ·
I have absolutely no interest in auto rev matching downshifts on my 9T but I am subbing to this thread after reading your write up alone!

All the best on the project.
Thanks! I know this is sort of a novelty and the 9T is pretty easy to rev match as long as you aren't trying to manually do it in the last 20m before an intersection hahahahaha.

Yesterday I spent some time learning different SPICE software. Analog devices bought LTSPICE and so it was used to model a few different opamp options from them. TI has their own program, TI-TINA which is definitely not quite as nice for analysis, but the tools look fancier.

I guess what I'm saying is it took a few hours to confirm my choice of op-amp for the throttle. This is still not final because I need to confirm how much current the throttle grip sinks. These TI LM7332 OpAmps are automotive rated but have a typical 90mA output. The S1000RR forums seem to indicate that the PowerCommander V installs show a throttle grip voltage range of 0.630-4.340V so I tried to find a linear translator setup to hardware re-map a 3.3V analog signal range to a 5V range with more current capability. Looking simply at V=IR shows the grip sinking 675mA, but I have a hunch it is much lower since that much current would in no way, shape, or form be safe for the tiny wires BMW uses in the grip. That's a long way of saying I think a single LM7332 will be more than enough for the throttle output.

Rectangle Product Azure Font Slope



But then there was a problem.

Further research on the ESP32 shows that its ADC (Analog to Digital Converter) is really, really suspect. Documented tests I found seem to indicate up to a 7-10% error as standard, but it's a non-linear error. It can be compensated by using some multisampling and uint16 long math to fit a parabola on each loop; but that takes a lot of CPU cycles when you are also reading and averaging RPM, GPS, Throttle, mapping, and potentially sending an interrupt at a specific RPM. Plus the ESP32, depite having 240MHz cores, is a rather weak processor.

Rectangle Slope Font Plot Parallel


So..... enter the STM32H747! This is found on the Arduino Portenta H7. It is about 5x more expensive than the Huzzah32 and the multicore code is nowhere near as easy but the ADC readings are fast and accurate; and the DAC is also significantly more accurate. Another nice feature is OTA firmware (code) updates. So in theory, using Arduino Cloud, the whole device could be reprogrammed / updated using a cell phone while standing next to the bike.

The Portenta has 5GHz memory and per arduino forum test results, it looks like an integer can be alternatively incremented by both cores about 1 million times in 1-2 microseconds. What also makes it more flexible for this application is execution speed of double floating point math.

However, this change in design might necessitate some extra component math because the internal analog reference on the Portenta is 3.1V instead of 3.3V. A small SPICE re-eval of the input throttle op-amp shows that at a max voltage of 4.34V the output is <3V; so the scope readings of the e-throttle grip might reveal that no change is required.

I think I can reduce the BOM cost further by finding a smaller OpAmp arrangement for the inputs since the least amount of mA sink to the MCU is desired. The LM7332's are "safe" for more or less any condition, but they have a price in whole dollars whereas other choices are tens of cents.


So current thinking is that the functional breakdown should be as such:
M7 core (480MHz):
  • Execution of blip routine
  • Interrupt from strain gauge + safety routine
  • Math to convert pulse frequency to RPM
  • (Potential) clutch switch monitor (boolean at execution start)

M4 Core (240 MHz):
  • Throttle analog logging to shared memory
  • GPS logging to shared memory
  • RPM logging to shared memory
  • Sensitivity adjuster logging (on startup)
  • Duration adjuster logging (on startup)


One obstacle is passing through the throttle voltage during 99% of riding and then cutting curing blip so as not to backfeed current to the throttle. As long as the max voltage out does not exceed the upstream this should not be an issue, but my risk-averse thinking says I should probably figure out a diode-transistor network or something just to be safe.
 

·
Premium Member
Joined
·
2,450 Posts
Wow … such a mind, I love it … I know if you are in competition or perhaps make a living in the race world just how important it is to master and use every means available to you and get every ounce of torque to the ground any way you can …. So …. The computer and it’s ability to use every micro-second to your advantage is awesome… I’m caught up in the challenge you face and will follow your efforts closely …
Just an old school suggestion (in the mean time) I use my clutch while stopped and for 1st and second gear …. That’s it ! All other shifts up and down are made by “Ear” listening to the engine and knowing the perfect time to press or pull the shifter … there’s a learning curve but now it’s as smooth as butter… I’m sure when you perfect your adaptation you’ll leave me in your dust but for now yours is on paper and mine is on the track ..(roads mostly) ….. StayUpOn2 Mate ….. can’t wait to read about your progress …….Blitz
 

·
Registered
22 Cosmic Scrambler (K23)
Joined
·
109 Posts
Discussion Starter · #6 ·
Hahahaha the only race I compete in is against my waistline. I've been clutchless upshifting for a while (but mostly unintentionally) because my old UJM had a bad dog on the 2->3 change. It also had a muuuuch longer throw and heavier effort so the 9T changes take me a bit my surprise still. When people say the 9T has an 'agrarian' transmission the only thing I can think is they must ride DCT sportbikes all the time; or perhaps I just got lucky and somebody took a lot of pride in assembling the linkage on my bike.

To execute clutchless downshifts you've probably got more muscle memory than I have life memory. I normally prefer CAD, welding, and machining... but on a brand new bike there's not a whole lot to machine. So this seemed fun instead.

We'll see if it's still fun when nothing works and I have a rat's nest of wires to tame, or after I have torn out all my hair because my stupid/newbie code isn't working.
 

·
Registered
22 Cosmic Scrambler (K23)
Joined
·
109 Posts
Discussion Starter · #7 · (Edited)
So, everything before with my circuit except the OpAmps was sort of mediocre. I also found this random .png laying around which just so happens to detail the throttle grip wiring..... My voltage guess was correct. SO perhaps not potentiometers but hall effect sensors.
Rectangle Product Font Parallel Slope


Version 1.00000001 Of the circuit schematic! Now with more GPIO thanks to the arduino and with even more discrete device solutions! And specific mfg code part names.... and a partial potential solution to a throttle interrupt/switch using opposing polarity transistors like a railroad switch.


Rectangle Slope Line Font Parallel


BMW also decided that we do not deserve common injectors any more! The injectors are also way closer to the intake port. And by closer, I mean they sit in the head.
Motor vehicle Automotive design Automotive tire Automotive exterior Steering wheel


Remember those Bosch EV1 connectors that we all know and love and which allowed aftermarket things and injector replacements to be easy? Nope! Gone.
All hail TE Connectivity MCON 1.2 LL, your new lord.
Hand Automotive tire Finger Gesture Thumb


Luckily these are available from Mouser, but It means I need to rebuild the injector section of the translogic harness. In all fairness, they do say their kit only works on 2014-2020.
Rectangle Font Material property Screenshot Parallel


I got some extra tabs, pins, and wire seals because, you know... losing/dropping/ruining.

In other news, I started setting up the HAL (Hardware Abstraction Layer) for the MCU.

Rectangle Product Azure Font Screenshot




It all looks more complex than it really is. That said, I do not fully understand it to the extent I would like. I like to know exactly why/how something works. So just knowing the general gist of what it takes to make something work is a little... frustrating. How am I supposed to know whether or not I am right?! :eek:


ETA: Oh BMW, you are too good to me. Even providing oscilloscope settings.
Rectangle Font Slope Line Plot
 

·
Premium Member
Joined
·
2,450 Posts
I love computers and the creative way men apply them to everything …. I watched an interview with an F1 driver after he did some trial laps testing his vehicle. The question put to him was, “How’s the car running?”
He pointed to a booth where his team was reviewing the data and said, “I don’t know, ask those engineers in the booth, I just drive the car” …. OldSchool ….Racing used to be man and machine against man and machine. Soon…the only thing man will be doing is holding on ………….Blitz
 

·
Registered
22 Cosmic Scrambler (K23)
Joined
·
109 Posts
Discussion Starter · #9 ·
Data dump time!

Gear position sensor:

Rectangle Slope Plot Font Parallel


Crank Signal:
Rectangle Slope Font Parallel Pattern


5V sensors available in group 3:

Font Number Screenshot Circle


Looks like the angular rate sensor (IMU) speaks in CAN. It just so happens this board has a whole section dedicated to CAN..... Now coding for CAN.... hmmmmmmmmm. Maybe not.
Product Font Parallel Rectangle Motor vehicle

Hair Head Smile Facial expression Rectangle





@BlitzSchnell I will be the devil's advocate. It is still just man and machine. The only difference is the amount of customization available. Some things are definitely hidden behind proprietary parts and protocols, but that allows mere mortals like us to use them instead of being relegated to racing teams where a corporate overseer dictates who can look under what cowling. It's the difference between riding a horse you have trained versus just riding a horse. Plus, I have decided this whole thing will have a kill switch, which is the clutch lever. Use clutch and receive 0 assistance.
 

·
Premium Member
Joined
·
2,450 Posts
Data dump time!

Gear position sensor:

View attachment 155439

Crank Signal:
View attachment 155440

5V sensors available in group 3:

View attachment 155441

Looks like the angular rate sensor (IMU) speaks in CAN. It just so happens this board has a whole section dedicated to CAN..... Now coding for CAN.... hmmmmmmmmm. Maybe not.
View attachment 155442
View attachment 155443




@BlitzSchnell I will be the devil's advocate. It is still just man and machine. The only difference is the amount of customization available. Some things are definitely hidden behind proprietary parts and protocols, but that allows mere mortals like us to use them instead of being relegated to racing teams where a corporate overseer dictates who can look under what cowling. It's the difference between riding a horse you have trained versus just riding a horse. Plus, I have decided this whole thing will have a kill switch, which is the clutch lever. Use clutch and receive 0 assistance.
Oh PLEASE don’t think I’m against any of what your up to …… the opposite my friend, I’m in AWE ! I love watching the deductive mind of man create machines with an understanding of the most minute deficiency in the process of getting horsepower to the ground and then developing unique computer controlled systems to make that transfer more efficient. It’s fascinating. I’m mesmerized and smiling not disappointed in the least. My thoughts move towards wondering what it will be like in another hundred years and celebrate my good fortune at being here at all to witness the advancements I have. Hell, ..I think simple fuel injection is a miracle. I salute you Sir. You take on a task worthy of your intelligence merely for the challenge and joy and not with capital gain as your motivation. There is honor in your effort to excel, you take pleasure in the accomplishment of bringing your thought into reality. That’s the heart of a creative mind …which in my world is a much greater reward. Can you imagine what this planet would be like if everyone had your curiosity and intelligence. What a world that would be. Tally-Ho deadwood ! I wish I had something to contribute towards your effort besides my applause and respect….. StayUpOn2 Sir ………..Blitz 🫡❤
 
  • Love
Reactions: deadwood83

·
Registered
22 Cosmic Scrambler (K23)
Joined
·
109 Posts
Discussion Starter · #11 ·
Looks like Mouser is going to get more of my money.

The CPS (crankshaft position sensor) is pretty easy to access, so it would be a good spot for an easily reversible harness.
Automotive tire Motor vehicle Automotive design Font Automotive wheel system


And that connector is.......

What looks like a TE-Connectivity AMP MCON 1.2 LL 3-pin.... again. -_-
Nose Eyebrow Mouth Product Jaw


Onnly, there are two entries for crankshaft sensor test procedure. One of them shows the square wave I displayed before. The other shows an inductive sensor wave displaying a 2-tooth gap for TDC. The test plans also show a measurement on one pin and a measurement on two pins. But the wiring diagram shows three connections and there is an alternate crank sensor with two pins and body ground.

Hall output:

Rectangle Slope Font Parallel Plot


This all begs the question..... do I just bite the bullet and tap into CANBUS to get the data? The DWA connector is right under the seat. It will make programming more difficult, but the other option is to generate a ton of fault codes while scoping out the bike.

Though my scope does have a can protocol decoder.....
 

·
Premium Member
Joined
·
2,450 Posts
Looks like Mouser is going to get more of my money.

The CPS (crankshaft position sensor) is pretty easy to access, so it would be a good spot for an easily reversible harness.
View attachment 155509

And that connector is.......

What looks like a TE-Connectivity AMP MCON 1.2 LL 3-pin.... again. -_-
View attachment 155510

Onnly, there are two entries for crankshaft sensor test procedure. One of them shows the square wave I displayed before. The other shows an inductive sensor wave displaying a 2-tooth gap for TDC. The test plans also show a measurement on one pin and a measurement on two pins. But the wiring diagram shows three connections and there is an alternate crank sensor with two pins and body ground.

Hall output:

View attachment 155512

This all begs the question..... do I just bite the bullet and tap into CANBUS to get the data? The DWA connector is right under the seat. It will make programming more difficult, but the other option is to generate a ton of fault codes while scoping out the bike.

Though my scope does have a can protocol decoder.....
Wow, the game is a-foot, the chase is on and the thrill continues to build. Seems the logical course would be to go straight to the source, the CanBus. Primarily because the focus would be on mental logic and firmware adjustments rather than the physical assembly of a pretty complicated wiring harness when the connections already exists. You’re going to have to tap the thoughts of the original engineers and get into their head….
Man I’d love to sit, watch you work and hear your thoughts … I could learn so much more about the genius of my motorcycle. Getting to know that much more about how she works … it seems intimate in a way. When I push her performance to the edge.. where it gets scary in a tight high speed turn, the kind where I know if I go down right now … I’m dead! It allows me to blend my spirit into hers and my body becomes one with the machine … she carry’s me so confidently my worries and fears leave me and I pop out the other side going faster than I ever thought possible… this huge tight grin come over my face and in that moment I know the true reason I ride …. She, Blitz … is my joy. She reminds me about what it is to be alive and not just living.
I therefore thank you Deadwood for showing me just what a sophisticated lady she really is ……….Blitz
 
1 - 12 of 12 Posts
Top