Harley Requirements

Hardware inside and outside of the ECU
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Harley Requirements

Post by nmstec »

Will update as I remember more things

Software side:
Support 45* firing angle
Automatic Compression Release (Activates two solenoids upon crank, until minimum engine RPM is reached)
Enable/Disable support for Traction control
Emulation of CAN data
Boost by Gear
Play nice with OEM immobilizer

Hardware side:
PnP to two different types (3 connector & 1 Connector)
Built in igniter, with option to bypass to regular coil (common upgrade)
Dual Wideband (must be built in, and have external wires for it. Original bikes do not come with it. See picture below)
Additional connector with 2hi & 2lo outputs, and 4 Analogue inputs. (For boost control for example, and ride height)
Attachments
tmax.png
tmax.png (735.74 KiB) Viewed 1279 times
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

45:
we have
image.png
image.png (24.63 KiB) Viewed 1255 times
but we need same for injection phase https://github.com/rusefi/rusefi/issues/3441

compression: https://github.com/rusefi/rusefi/issues/3442

Emulation of CAN data, Play nice with OEM immobilizer: need way more data :) open Q if Play nice with OEM immobilizer is even possible

Boost by Gear: what kind of gear sensor do you have? https://github.com/rusefi/rusefi/issues/3007
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

I'll work on the Can-bus stuff.

The Boost by gear can be calculated the usual way most bikes, including harleys do, RPM & VSS.
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Making progress on small test board for 18 pin connector.

Need help: can you please take a picture of the front of ECU and mark which pin is "1" and which one is "9"? Do they go 1 to 18 or A to R or what convention does HD use on wiring diagrams?

Do you by any chance have a picture of a naked PCB without case? No worries if you do not have it.
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

<3
Attachments
IMG_20211105_123257.jpg
IMG_20211105_123257.jpg (2.7 MiB) Viewed 950 times
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

<3 2
Attachments
IMG_20211105_124512.jpg
IMG_20211105_124512.jpg (2.51 MiB) Viewed 948 times
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

3 pin ECU cut apart. Literally. Nice of them to leave jtag header on it.

This is OEM ecu, and not ThunderMax

Also single pin 81, OEM.

Also close ups on the 3 connector ECU. All photos taken in the same orientation with the connector on the left side.

https://github.com/rusefi/rusefi_documentation/tree/master/OEM-Docs/Harley/photos
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Injection phase https://github.com/rusefi/rusefi/issues/3441 not critical for first start
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

HD 32-2Known applications include:•Harley Davidson with 32-2 crank triggerA VR sensor is used on the crank trigger. As standard there is no cam sensor. Phase detection is possible using
the MAP sensor.Typical settings:Spark mode = HD 32-2Trigger angle/offset = 0 (adjust with strobe)Ignition input capture = Set according to whichever edge gives the most stable signal. (If timing advances with
RPM, try flipping it.)Spark output = Going highCam sensor = MAPThe front cylinder is considered cyl#1 and therefore connects to SpkA. Sequential fuel is allowed.
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Compression Release is now done in Lua

See https://github.com/rusefi/rusefi/issues/3442 for script
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Shall we tell Mark that Harley shares 81 pin connector with Lada Samara? Really hope there is not a single overlapping pin in the pinout :)
Attachments
20211120_151857.jpg
20211120_151857.jpg (637.61 KiB) Viewed 497 times
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Will need internal IGBT driver. Much importance. Very importance.
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Needs proper power in constant to drive IGBTs, oxygen sensor heaters, and decently high current solenoids.
The way motorcycles usually work is they have an ignition switch to power up all the electronics, and then a kill switch as well, to power up injectors and fuel pump.

In harleys case, kill switch is canbus controlled. no biggy as BCm also supplies a "ign" signal to the ecu and injectors. however on harleys the BCM also wants to hear the ECU talking. Not possible if kill switch is on.
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Fucking harley also uses PWM controlled fans... depending on model, some have no fan, some have oil fan, some have oil & coolant fan... Fucking stupidity.


Some models... also have a water pump... because a few models have... water cooling heads.... Jesus.
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Damn is official wiring diagram unreadable for everyone or just me?
I've clicked at https://serviceinfo.harley-davidson.com/sip/content/document/view?id=1463966551648382215 and selected police model.
Main harness ECM pinouts is blurry or jpeg?
image.png
image.png (235.85 KiB) Viewed 452 times
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Click on "view interactive image".
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Limited RE so far:
500kbaud
ALL PACKETS IN THIS POST ARE FROM ECU ONLY.

543 - zz xx yy ww ss tt qq rr
zz - 13
xx - stays at 57 on no APP, then increases slightly till 10% and stays at 61 (57 58 59 .. 61)
yy - 13
ww -46-47
ss - APP position 00 - 0% c7 - 100%
tt - e8
qq- counter 40 -> 7f
rr - checksum (j1850 SAE crc8) http://www.sunshine2k.de/coding/javascript/crc/crc_js.html
15ms

542 - zz xx yy ww ss tt qq rr
zz 20 CC off - 60 CC ON
xx - a2 kill, 82 unkill,c2 crank, c0 run - e0 - a0 "kill while running" / 40 RUN WITH NO MIL? / 42 CRANK WITH NO errors?
yy - 81
ww - d9
ss -00
tt - 00
qq - 00
rr - 00
50ms

541
zz - RPM
xx - RPM
yy - 00
ww - 00
ss - 00
tt - temp? looks like in plain hex to C* - 0x45 = 45C?
qq - 00
rr -ff
15ms

544
0e ca 40 ff ca 00 00 00 static
50ms

540
zz - 00
xx - 00
yy - 5a
ww - 4c
ss - ff
tt - 00
qq - COUNTER TIME? low
rr -COUNTER TIME? high (resets upon ign off. Runs only when engine running. 1 byte per every 250ms it seems? will have to confirm later with timing)
200ms

502
01 (keep alive WHEN AWAKE) 00 (Tell rest of bike you about to sleep. Then go to sleep)
1000ms

546
35 48 44 31 46 48 (1-6 vin)
1000ms

547
50 41 31 4b 42 36 (7-12 vin)
1000ms

548
33 34 38 32 32 00 (13 -17 vin)
1000ms
Last edited by nmstec on Wed Nov 24, 2021 12:50 am, edited 6 times in total.
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

logs.
Attachments
Initial on log 1.log
(706.53 KiB) Downloaded 14 times
Initial on log 1 ECU ONLY.log
(198.62 KiB) Downloaded 12 times
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Code: Select all

outputIndex = 0
startPwm(outputIndex, 100, 0)

rpmLimitSetting = findSetting("compReleaseRpm", 300)
compReleaseDulationLimit = findSetting("compReleaseDur", 6000)

every200msTimer = Timer.new();
everySecondTimer = Timer.new();
every50msTimer = Timer.new();
offCounter = 0
-- cranking!
packet542 = {0x20, 0x82, 0x81, 0xd9, 0x00, 0x00, 0x00, 0x00}
packet543 = {0x13, 0x57, 0x13, 0x45, 0x00, 0xe8, 0x00, 0x00}
packet541 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0xFF}

-- every 200ms
packet540 = {0x00, 0x00, 0x5a, 0x4c, 0xff, 0x00, 0x00, 0x00}

-- every 1000ms
packet502 = {0x01}
packet546 = {0x35, 0x48, 0x44, 0x31, 0x46, 0x48}
packet547 = {0x50, 0x41, 0x31, 0x4b, 0x42, 0x36}
packet548 = {0x33, 0x34, 0x38, 0x32, 0x32, 0x00}

counter543 = 0;
setTickRate(66);


canRxAdd(0x570)
canRxAdd(0x500)

function onCanRx(bus, id, dlc, data)
  --print('got CAN id=' .. id .. ' dlc='  .. dlc)
  id11=id%2048

if id11 == 0x500 then --Check can state of BCM
    canState = data[1]
if canState == 01 then
    packet502[1] = 0x01
else
    packet502[1] = 0x00
end
if id11 == 0x570 then
    curState = data[1]

if curState == 06 then -- Cranking TODO: MUST ONLY DO THIS ON RPM TILL STARt
packet542[2] =  0x82
end

if curState == 04 then -- Kill off
packet542[2] =  0x82
end

if curState == 01 then -- Kill
packet542[2] =  0xA2
end
end
end
	


end
function onTick()
 
    if packet502[1] == 01 then
    offCounter = 0
 counter543 = (counter543 + 1) % 64
    packet543[7] = 64 + counter543
    packet543[8] = crc8_j1850(packet543, 7)
    APP = getSensor("AcceleratorPedal") 
    if APP == nil then
        packet543[5] = 0
    
else
    packet543[5] = APP *2
end
 
    txCan(1, 0x543, 0, packet543)
	txCan(1, 0x541, 0, packet541)
   
    if every200msTimer:getElapsedSeconds() > 0.2 then
       every200msTimer:reset();
       txCan(1, 0x540, 0, packet540)
    end

    if every50msTimer:getElapsedSeconds() > 0.05 then
       every50msTimer:reset();
	txCan(1, 0x542, 0, packet542)
end
	
    if everySecondTimer:getElapsedSeconds() > 1 then
       everySecondTimer:reset();
       txCan(1, 0x502, 0, packet502)
       txCan(1, 0x546, 0, packet546)
       txCan(1, 0x547, 0, packet547)
       txCan(1, 0x548, 0, packet548)
    end


	rpm = getSensor("RPM")
	rpm = (rpm == nil and 0 or rpm)
    --print('Rpm ' .. rpm)
	--print('getTimeSinceTriggerEventMs ' .. getTimeSinceTriggerEventMs())
	enableCompressionReleaseSolenoid = getTimeSinceTriggerEventMs() < compReleaseDulationLimit and rpm < rpmLimitSetting
    duty = enableCompressionReleaseSolenoid and 100 or 0
    print("Compression release solenoid " .. duty)
    setPwmDuty(outputIndex, duty)
else
    if offCounter == 0 then --goodbye sweet love, and fuck you
    txCan(1, 0x502, 0, packet502) --goodbye
    offCounter = 1 --One shot 
    end

end
end
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Mark, I've formatted the code manually and I think you have a bug in can handler - it becomes obvious once you format the code.

Code: Select all

  if id11 == 0x500 then --Check can state of BCM
    canState = data[1]
    if canState == 01 then
      packet502[1] = 0x01
    else
      packet502[1] = 0x00
    end
    if id11 == 0x570 then
      curState = data[1]
      if curState == 06 then -- Cranking TODO: MUST ONLY DO THIS ON RPM TILL STARt
        packet542[2] =  0x82
      end
note how id11 == 0x570 check is within id11 == 0x500, so it's never executing? I could be wrong

Full script with formatting:

Code: Select all

outputIndex = 0
startPwm(outputIndex, 100, 0)

rpmLimitSetting = findSetting("compReleaseRpm", 300)
compReleaseDulationLimit = findSetting("compReleaseDur", 6000)

every200msTimer = Timer.new();
everySecondTimer = Timer.new();
every50msTimer = Timer.new();
offCounter = 0
-- cranking!
packet542 = {0x20, 0x82, 0x81, 0xd9, 0x00, 0x00, 0x00, 0x00}
packet543 = {0x13, 0x57, 0x13, 0x45, 0x00, 0xe8, 0x00, 0x00}
packet541 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0xFF}

-- every 200ms
packet540 = {0x00, 0x00, 0x5a, 0x4c, 0xff, 0x00, 0x00, 0x00}

-- every 1000ms
packet502 = {0x01}
packet546 = {0x35, 0x48, 0x44, 0x31, 0x46, 0x48}
packet547 = {0x50, 0x41, 0x31, 0x4b, 0x42, 0x36}
packet548 = {0x33, 0x34, 0x38, 0x32, 0x32, 0x00}

counter543 = 0;
setTickRate(66);


canRxAdd(0x570)
canRxAdd(0x500)

function onCanRx(bus, id, dlc, data)
  --print('got CAN id=' .. id .. ' dlc='  .. dlc)
  id11 = id % 2048

  if id11 == 0x500 then --Check can state of BCM
    canState = data[1]
    if canState == 01 then
      packet502[1] = 0x01
    else
      packet502[1] = 0x00
    end
    if id11 == 0x570 then
      curState = data[1]
      if curState == 06 then -- Cranking TODO: MUST ONLY DO THIS ON RPM TILL STARt
        packet542[2] =  0x82
      end
      if curState == 04 then -- Kill off
        packet542[2] =  0x82
      end
      if curState == 01 then -- Kill
        packet542[2] =  0xA2
      end
    end
  end
end


function onTick()
 
  if packet502[1] == 01 then
    offCounter = 0
    counter543 = (counter543 + 1) % 64
    packet543[7] = 64 + counter543
    packet543[8] = crc8_j1850(packet543, 7)
    APP = getSensor("AcceleratorPedal") 
    if APP == nil then
      packet543[5] = 0
    else
      packet543[5] = APP *2
    end
 
    txCan(1, 0x543, 0, packet543)
	txCan(1, 0x541, 0, packet541)
   
    if every200msTimer:getElapsedSeconds() > 0.2 then
       every200msTimer:reset();
       txCan(1, 0x540, 0, packet540)
    end

    if every50msTimer:getElapsedSeconds() > 0.05 then
       every50msTimer:reset();
	   txCan(1, 0x542, 0, packet542)
    end
	
    if everySecondTimer:getElapsedSeconds() > 1 then
       everySecondTimer:reset();
       txCan(1, 0x502, 0, packet502)
       txCan(1, 0x546, 0, packet546)
       txCan(1, 0x547, 0, packet547)
       txCan(1, 0x548, 0, packet548)
    end


	rpm = getSensor("RPM")
	rpm = (rpm == nil and 0 or rpm)
    --print('Rpm ' .. rpm)
	--print('getTimeSinceTriggerEventMs ' .. getTimeSinceTriggerEventMs())
	enableCompressionReleaseSolenoid = getTimeSinceTriggerEventMs() < compReleaseDulationLimit and rpm < rpmLimitSetting
    duty = enableCompressionReleaseSolenoid and 100 or 0
    print("Compression release solenoid " .. duty)
    setPwmDuty(outputIndex, duty)
  else
    if offCounter == 0 then --goodbye sweet love
      txCan(1, 0x502, 0, packet502) --goodbye
      offCounter = 1 --One shot 
    end
  end
end
I've pushed it to git as is with what I suspect is the defect
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Heh, yeah that does help. Oddly enough, not sure wtf, but 570 still works...
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

So will need in tuner studio, a separate VE and timing map for both cylinders. One runs way hotter than the other.
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

would like to know if we can build something to translate other Standalone tunes into regular our tunes. They have 100s of base maps that are fantastic.

and as mentioned in my forum post, LATER ON (making capitals so andrey doesnt think right this second), we will need seperate timing and VE maps for both cylinders. They run differently when hot.
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

New update. Harley wiring diagram makers are on both crack as well as meth. Knock sensor wires wrong, VR sensors swapped, dicks are tiny and in general plenty of other deficiencies.
nmstec
contributor
contributor
Posts: 35
Joined: Tue Oct 05, 2021 9:02 pm

Re: Harley Requirements

Post by nmstec »

Well, I fried low 12 output I think. ACR took up to 5amps... Fuck. gonna relay it on low 11 this time, and see if LUA works or not for pwm. If not, then LUA problem.
mck1117
running engine in first post
running engine in first post
Posts: 1116
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Harley Requirements

Post by mck1117 »

It proooobably shouldn't have killed it. I've PWM'd in to a dead short with those before and haven't killed one.
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
User avatar
AndreyB
Site Admin
Posts: 12185
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Harley Requirements

Post by AndreyB »

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
Post Reply