BMW NineT Forum banner

PROJECT: Auto-Blip for 2021+ Bikes

1606 Views 18 Replies 4 Participants Last post by  deadwood83
2
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.
See less See more
  • Like
Reactions: 4
1 - 19 of 19 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.
2
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.
See less See more
Remind me never to play Chess with you. :)
  • Like
Reactions: 1
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
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.
  • Like
Reactions: 1
7
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
See less See more
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
5
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.
See less See more
  • Like
Reactions: 3
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 🫡❤
See less See more
  • Like
  • Love
Reactions: 2
3
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.....
See less See more
  • Like
Reactions: 1
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
See less See more
2
Hohohohohohohoho. I am dumb!

I just realized I can use an adding circuit with an opamp to provide both back-current protection on the hall sensors in the twist grip as well as the 'blip' output to DME. This completely eliminates the need to monitor the twist grip at all and eliminated the need to switch between blip output and grip output. Since the hall sensors in the twist grip are proportional, I can just change the channel 1 and 2 output scaling on the DAC in the firmware and bing bang presto.

Organism Slope Line Font Parallel


That simplifies the firmware and the hardware.

So then from CAN we would only need the RPM, clutch switch, and the current gear. Clutch switch is definitely on CAN because it is used to disable cruise control at the 'soft' setpoint (30%).

Full canbus:
White Light Rectangle Circuit component Line


DWA is bottom middle, DME is the large block in the lower left, and OBD is bottom left small skinny block. Depending on how fast the CAN reacts, it could be simplified even further to just take current engine RPM and apply full throttle until desired RPM is reached on trigger from the QS sensor and hold that speed until it returns to nominal.

Probably have 4-5 total redesigns left before I settle on something.
See less See more
I’ve read that the best engineered devices are also most always the simplest as well …. Iterations of design are exactly the same thing but better each time. Go Deadwood ! Bringing an idea to fruition is more about knowing where to go to get the data as what to do with it after you have it. Tally-Ho ….! ……Blitz
2
So RaceChrono said it could dump raw CAN data. I bought the app and tried. This might be raw CAN data, but it is not presented in any way I can comprehend decoding. I thought about duck paddling the bike where I have all my test equipment because the oscilloscope says it can read CAN frames as well, but the cylinders are too wide for my 32.5" doors.

I'm trying to get to here: Motorrad CANbus

And so far I'm here:
Font Electric blue Pattern Space Rectangle


It might be time to rig up a test cart with a mini PC, touchscreen, o-scope, etc. then throw an extension cord out the window.(condo liiiiiiiife!)


ETA: Attaching the file if anybody else wants to have a go and share how they got to hex frames from this. This is a cold start sequence. Engine RPM never went below ~1100 per the tach.

Attachments

See less See more
3
So.... TE COnnectivity makes the throttle connector wiring harness side plug. But they make exactly 0 parts that mate with it. Well, none that they will list, are searchable, or with catalogued part numbers.

It seems BMW is jealous of Deere John's consumer-abusive practices. Naturally they specify test cables which have male connectors, but those are controlled dealer-leased parts. So naturally I found some design resources and now I am also designing a male connector. S1000RR 2020+ sub-harnesses are available online for less money than the MOQ (minimum order quantity) for any female connectors from distributors. So commonly-available connectors ("Bosch DBW" which coincidentally is a TE Connectivity MQS 6-pin) can be used for outbound from controller and only one fancy custom part will be required on the connector front to interface with the DME-side harness. I am finalizing how I want to implement sealing. The part is small enough it will probably need to be printed on a stratasys polyjet system using their 'ABS Plus' formula. HP MJF only has a +/- 0.3mm tolerance and some of the inner features are below this size.

Rectangle Font Engineering Diagram Urban design



Just to make sure my head figuring wasn't crazy, I made an excel table in increments of 100RPM and correlated my results with the speedometer. Gear ratios are nice. Just take new RPM = RPM in current gear * (Current gear speed / lower gear gear speed). This is most easily understood by looking at a motorcycle (sequential) gearbox. There are two shafts. The driven shaft and the output shaft. When you change gears, you need to match the gear shaft speed to avoid damaging the dogs. We can't change the driven shaft speed because we're not MotoGP (their transmissions are literally built differently) so we get close by 'blipping' the throttle and engaging the clutch again at somewhere near the right RPM (but a free-revving engine is forgiving). In this module, the output shaft speed is matched by modulating the engine speed so that output is unloaded on shift while input is counter-loaded by rev. It's not as smooth as MotoGP and it never will be (again, totally different transmission construction) but it's rather close. Close enough that OEMs will use the same idea on factory-warrantied bikes.

Rectangle Font Slope Screenshot Parallel


I reached out to translogic to vet out my thinking on their existing product and they're nice chaps! They also seem interested in my process. Maybe people will see a translogic shift assist for 2021+? (probably upshift only, I shared some schematics but.... yeah).

Font Rectangle Screenshot Parallel Number


Anyway, they shared exactly how the sensor works so I can now design for it properly. It is not as fancy as I dreamed, but it does make my life easier.

After getting lost in the mail, my microcontroller also arrived. I was never very good with coding, but I think I understand how ST implemented hardware semaphores and how I can code with them. I need to write a firmware for each core and designate a block of shared memory. I keep putting the coding part off, but I guess there's no avoiding it at this point. Though I'm sure I could spend time on PCB layout and enclosure design to delay it further.
See less See more
  • Love
Reactions: 1
Oh! And I uh.... did more circuit redesign and finalized a transceiver for CAN communication. It's a lot nicer now. The four op-amps are actually a quad op-amp chip which has all four on the same part so it;s just a few resistors and caps next to it.
Rectangle Slope Font Line Parallel
See less See more
2
Well, I guess it's time to do this part. I'll see you in two months with 80% less hair.

Computer Font Screenshot Software Technology


Did a final sanity check to see the full output range when the bike is at idle. WOT is 4V and 2V (two sensors). Just did a sine sweep. Light blue is the MCU DAC output, the two greens are the two throttle voltages and the two blue.purple lines are a constant idle voltage.

Rectangle Slope Triangle Plot Line


The opamp does have internal backfeed diodes so there is a wee little bit of ugliness right as it goes past .1V but there's no scenario where such a tiny blip would be suitable.

ADC is set at 12-bit continuous conversion so I can sample on a hardware timer. The DAC also happens to be 12-bit so I can just reverse-map the input to the output which saves a few microseconds per shift. The shift itself is no faster, but it;s a few less microseconds where you could destroy the gear dogs.
See less See more
  • Like
Reactions: 1
Woohoo! I avoided programming for longer!

Still needs:
  • 12V power and bike ground.
  • Ground planes with segregation.
  • 4x holes to fasten the board stack (2 boards) on the Hirose 80P connectors.
  • CANbus breakout header for CAN-H and CAN-L.


Features added:
  • Redesigned PSU again. This time the 5V rail can hold 3.5A with 5.1A peaks.
  • Implemented 500mA load 3.3V supply and an instrument-grade 3.0V reference for ADC measurements
  • CANbus AND CANbus-FD support.
  • 6-Pin header on board edge to expand out in future for potential code and add-on module upgrade to make this an AIO transmission control unit.
  • Entire PCB stack is about 39mm wide. Entire module should be about the size of a credit card.

Colorfulness Rectangle Slope Font Line


CAN connection will be on DWA header. Aftermarket options are already superior to DWA. Switched power will come from GPS header or that can be cut and connected wherever people want.

Harness will sit in-line with throttle grip. There should be less effort (post-build) than even installing the initial Translogic kit.
See less See more
  • Like
Reactions: 4
1 - 19 of 19 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top