• Tech
    • Tech Category
      • Engine
      • Bottom End
      • Rods and Pistons
      • Head and Headwork
      • Cams and Valvetrain
      • Cooling and Heat Management
      • Intake
      • Headers and Exhaust
      • Rotary
      • Engine Management and Tuning
      • Drivetrain
      • Transmission
      • Clutch and Flywheel
      • Differential and Final Drive
      • Driveshaft and Axle
      • Axles
    • Tech Category
      • Suspension
      • Shocks and Coilovers
      • Springs
      • Swaybars
      • Arms and Links
      • Bushings
      • Steering
      • Geometry Correction
      • Suspension Setup and Tuning
      • Brakes
      • Wheels and Tires
      • Fueling
      • Forced Induction and NOS
      • Aerodynamics
    • Tech Cat
      • Electrical
      • Battery and Power Distribution
      • Electronics
      • Wiring
      • Electrical System Education and Troubleshooting
      • Lubrication
      • Interior and Controls
      • Exterior
      • Paint and Bodywork
      • Wraps and Film Protection
      • Exterior Care and Maintenance
      • Data Acquisition and Tuning
      • Fabrication and Safety
      • Tips and How-To
  • Projects
    • Make A-D
      • Acura
      • Integra (DC2)
      • NSX
      • CSF RSX (DC5)
      • BMW
      • E30 (SR20 Powered)
      • E36 323is
      • E36 M3 (Black)
      • E36 M3 (Silver)
      • E39 M5
      • E46 M3
      • E90 M3
      • E46 Racecar
      • Yost Auto E92 M3
      • Yost Auto F82 M4
      • Chevrolet
      • Camaro Gen5
      • Corvette Stingray (C7 Z51)
      • Corvette Stingray (C8 Z51)
      • GMC Canyon
      • Dodge
      • Viper GTS
    • Make E-I
      • Ford
      • E350 Tow Rig
      • F150 EcoBoost
      • Fiesta ST
      • Focus ST
      • Mustang 5.0 (Grey)
      • Mustang 5.0 (White)
      • Mustang S197 (Budget Track Car)
      • Mustang S550 GT
      • Honda
      • Civic EF Racecar
      • Civic Si (Coupe)
      • Civic Si (EP3)
      • Civic Si (Saloon)
      • EJ Civic
      • Polystrand CRX
      • S2000 (AP1)
      • S2000 (AP2)
      • Infiniti
      • G20 Racecar
      • G20 (P10 AWD Turbo)
      • G35
      • G37S
    • Make J-M
      • Isuzu
      • Vehicross
      • Lexus
      • ISF
      • SC300
      • Mazda
      • V8 RX7 (3rd Gen)
      • RX-7 (3rd Gen)
      • RX-7 Restomod (3rd Gen)
      • Skyactiv 3
      • Frankenmiata
      • Miatabusa
      • My Girlfriend’s Miata
      • Mitsubishi
      • EVO VIII
      • EVO IX
      • EVO X
      • CSF EVO X Racecar
      • Professional Awesome EVO VIII
    • Make N-P
      • Nissan
      • 200SX
      • 200SX SE-R
      • 240SX Land Speed Racer
      • 300ZXTT
      • 350Z
      • 350Z Drift Car
      • 370Z
      • GT-R (R33)
      • GT-R (R35)
      • GT-R (Team America BNR32)
      • LS S13
      • NX GTi-R
      • Pathfinder
      • S13 Drift/Grip Do-it-All Mega 240
      • Sentra SE-R
      • Sentra Spec V
      • Silvia
      • STurdteen Drift Car
      • Porsche
      • 991 GT3RS
      • Cayman (987)
      • Cayman T
      • Cayman GTS 4.0
    • Make S-Z
      • Scion
      • FR-S
      • Scion Tuner Challenge FR-S
      • TC
      • Subaru
      • Autocross BRZ
      • Legacy GT
      • STI (gen 2)
      • STI (gen 3)
      • WRX (GD)
      • WRX (VA)
      • Toyota
      • 4Runner
      • AE86 Corolla
      • GR Corolla
      • Starletabusa
      • Supra Mark IV
      • Tacoma
      • Tundra
      • Volkswagen
      • MKIV Jetta TDI
      • MKVI Golf TDI
      • MKVII Golf R
      • Sipster (Rabbit)
    • Other Projects
      • Powersports
      • Aprilia RS50
      • Aprilia SR50
      • Doodlebug
      • Ducati 998
      • Ducati Hypermotard
      • Honda Ruckus
      • Husqvarna TE610
      • Go Karts
      • Other
      • Sim Racer
      • Aurora Cobra
      • Garage
      • NP01 Prototype
  • Features
    • Features
      • Feature Cars
      • Drag Race Cars
      • Drift Cars
      • Land Speed Cars
      • Open-Wheel Cars
      • Rally Cars
      • Road Race Cars
      • Street Cars
      • Time Attack Cars
      • Drag Racing
    • Features
      • Events
      • Drifting
      • Land Speed Racing
      • Open-Wheel Racing
      • Time Attack Racing
      • Rally Racing
      • Road Racing
      • Car Shows
      • Columns
      • SlipAngle Podcast
  • Video
  • Shop *NEW*
  • MotoIQ Garage Services
  • About
  • Shop *NEW*
  • MotoIQ Garage Services
  • About
MotoIQ
MotoIQ
  • Tech
    • Tech Category
      • Engine
      • Bottom End
      • Rods and Pistons
      • Head and Headwork
      • Cams and Valvetrain
      • Cooling and Heat Management
      • Intake
      • Headers and Exhaust
      • Rotary
      • Engine Management and Tuning
      • Drivetrain
      • Transmission
      • Clutch and Flywheel
      • Differential and Final Drive
      • Driveshaft and Axle
      • Axles
    • Tech Category
      • Suspension
      • Shocks and Coilovers
      • Springs
      • Swaybars
      • Arms and Links
      • Bushings
      • Steering
      • Geometry Correction
      • Suspension Setup and Tuning
      • Brakes
      • Wheels and Tires
      • Fueling
      • Forced Induction and NOS
      • Aerodynamics
    • Tech Cat
      • Electrical
      • Battery and Power Distribution
      • Electronics
      • Wiring
      • Electrical System Education and Troubleshooting
      • Lubrication
      • Interior and Controls
      • Exterior
      • Paint and Bodywork
      • Wraps and Film Protection
      • Exterior Care and Maintenance
      • Data Acquisition and Tuning
      • Fabrication and Safety
      • Tips and How-To
  • Projects
    • Make A-D
      • Acura
      • Integra (DC2)
      • NSX
      • CSF RSX (DC5)
      • BMW
      • E30 (SR20 Powered)
      • E36 323is
      • E36 M3 (Black)
      • E36 M3 (Silver)
      • E39 M5
      • E46 M3
      • E90 M3
      • E46 Racecar
      • Yost Auto E92 M3
      • Yost Auto F82 M4
      • Chevrolet
      • Camaro Gen5
      • Corvette Stingray (C7 Z51)
      • Corvette Stingray (C8 Z51)
      • GMC Canyon
      • Dodge
      • Viper GTS
    • Make E-I
      • Ford
      • E350 Tow Rig
      • F150 EcoBoost
      • Fiesta ST
      • Focus ST
      • Mustang 5.0 (Grey)
      • Mustang 5.0 (White)
      • Mustang S197 (Budget Track Car)
      • Mustang S550 GT
      • Honda
      • Civic EF Racecar
      • Civic Si (Coupe)
      • Civic Si (EP3)
      • Civic Si (Saloon)
      • EJ Civic
      • Polystrand CRX
      • S2000 (AP1)
      • S2000 (AP2)
      • Infiniti
      • G20 Racecar
      • G20 (P10 AWD Turbo)
      • G35
      • G37S
    • Make J-M
      • Isuzu
      • Vehicross
      • Lexus
      • ISF
      • SC300
      • Mazda
      • V8 RX7 (3rd Gen)
      • RX-7 (3rd Gen)
      • RX-7 Restomod (3rd Gen)
      • Skyactiv 3
      • Frankenmiata
      • Miatabusa
      • My Girlfriend’s Miata
      • Mitsubishi
      • EVO VIII
      • EVO IX
      • EVO X
      • CSF EVO X Racecar
      • Professional Awesome EVO VIII
    • Make N-P
      • Nissan
      • 200SX
      • 200SX SE-R
      • 240SX Land Speed Racer
      • 300ZXTT
      • 350Z
      • 350Z Drift Car
      • 370Z
      • GT-R (R33)
      • GT-R (R35)
      • GT-R (Team America BNR32)
      • LS S13
      • NX GTi-R
      • Pathfinder
      • S13 Drift/Grip Do-it-All Mega 240
      • Sentra SE-R
      • Sentra Spec V
      • Silvia
      • STurdteen Drift Car
      • Porsche
      • 991 GT3RS
      • Cayman (987)
      • Cayman T
      • Cayman GTS 4.0
    • Make S-Z
      • Scion
      • FR-S
      • Scion Tuner Challenge FR-S
      • TC
      • Subaru
      • Autocross BRZ
      • Legacy GT
      • STI (gen 2)
      • STI (gen 3)
      • WRX (GD)
      • WRX (VA)
      • Toyota
      • 4Runner
      • AE86 Corolla
      • GR Corolla
      • Starletabusa
      • Supra Mark IV
      • Tacoma
      • Tundra
      • Volkswagen
      • MKIV Jetta TDI
      • MKVI Golf TDI
      • MKVII Golf R
      • Sipster (Rabbit)
    • Other Projects
      • Powersports
      • Aprilia RS50
      • Aprilia SR50
      • Doodlebug
      • Ducati 998
      • Ducati Hypermotard
      • Honda Ruckus
      • Husqvarna TE610
      • Go Karts
      • Other
      • Sim Racer
      • Aurora Cobra
      • Garage
      • NP01 Prototype
  • Features
    • Features
      • Feature Cars
      • Drag Race Cars
      • Drift Cars
      • Land Speed Cars
      • Open-Wheel Cars
      • Rally Cars
      • Road Race Cars
      • Street Cars
      • Time Attack Cars
      • Drag Racing
    • Features
      • Events
      • Drifting
      • Land Speed Racing
      • Open-Wheel Racing
      • Time Attack Racing
      • Rally Racing
      • Road Racing
      • Car Shows
      • Columns
      • SlipAngle Podcast
  • Video
  • SC300
  • Projects
  • Lexus

Project SC300 Road Racer: Part 17 – Get out there! Or not…

  • Erik Jacobs

Figuring out how to map the CAN channels can be a little tricky. Here’s a few points to take note of, some of which is in the protocol documentation:

  • The Haltech CAN documentation specifies the channel IDs in hexadecimal. The RCP wants them in decimal. Most operating systems’ built in calculators will happily translate hexadecimal (eg: 36C) to decimal (876)
  • Haltech sends pressures as kilopascals (kPa) and “and it is necessary to subtract 101.3 kPa from the final result if gauge pressure is desired”.
  • Haltech’s CAN protocol deals with integers that are then converted at the other end. This means that you will be working with interesting units.
  • Each CAN channel has 8 bytes and Haltech divides them up into different values.
  • Values are signed integers using two’s complement and Big Endian (this has to do with the order of the bits in the bytes)

We configured the Haltech to measure oil pressure, so here’s an example mapping for oil pressure read via CAN:

  • Haltech says oil pressure is on channel 0x361 (Hex 361 -> decimal 865)
  • Oil pressure is on bytes 2-3
  • Oil pressure is measured in 0.1 kPa

So, in the RaceCapture app, we would configure:

  • Channel named OilPress
  • CAN Bus 1
  • CAN ID 865
  • Offset 2 (starts at 2nd byte)
  • Length 2 (2 bytes long — #2 and #3)
  • Signed
  • Big Endian

The last thing to do is set the formula for the channel. If you did nothing, you would see a number like 2750, which would be very confusing.

  • The unit for the channel is actually 0.1 kPa, so 2750 is actually 2750 * 0.1 or 275 kPa
  • 1 PSI is 0.1450377 kPa

To convert the CAN value to PSI, your formula in the RaceCapture app would be:

  • Times 0.0145
  • Divided by 1.0
  • Plus 0

2750 * 0.0145 / 1 + 0 = 39.875

We would expect ECU Manager to show a value of ~40PSI for the oil pressure, assuming we had told it to use imperial units.

Similarly, temperatures are measured in 0.1 Kelvins, which is slightly more annoying to convert. If you’re an imperial guy (I am), you can find a formula for Kelvin to Fahrenheit conversion that looks like:

T(°F) = T(K) × 9/5 – 459.67

Since you can’t enter “9/5” in the formula box, you would use 1.8. However, the Haltech is outputting 0.1Kelvin, so you actually want to use 0.18.

  • Times 0.18
  • Divided by 1.0
  • Plus -459.67

Take some time to figure out which channels you want to log or pay attention to, and go through and map them all. In the ECU manager software, be sure to configure which CAN output you’re using (in our case we ended up using the top / auxillary CAN port instead of the original hardwired port).

 


Power everything up and switch the RaceCapture app to the data overview page.

The overview page will show all of the values that the RaceCapture knows about and in real-time. It’s similar to ECU Manager’s diagnostic page. A great way to figure out if you have the initial CAN wiring and programming figured out is to simply manipulate the gas pedal and watch the TPS value change. If it works, you’ve got the CAN settings all correct. If it doesn’t, you either forgot to set the CAN baud rate correctly, you didn’t fully power cycle the RaceCapture, or you have your CAN Hi/Lo wires backwards. The RaceCapture has an internal termination resistor, so make sure that it is the last device on your Haltech CAN hub and that you’ve wired it as a “black” connector (with the termination loop on the HUB side).

Now things really start to get tricky. You have to write a script.

 


The scripting interface in the RaceCapture app.

The RaceCapture uses a scripting language called Lua which is actually a very common one. If you have zero experience programming in any language at all, this is all going to be way over your head, and I don’t intend to give you a primer in this article series. Autosport Labs has an active forum, which includes a Lua scripting subsection, where you can ask questions and find example scripts. There’s also a wiki with a Lua scripting guide as well as a page full of Lua script examples, too.

While the syntax of Lua is very simple and writing basic things is not hard, it took me a while to figure out exactly what I needed to do with respect to the script. It needed to do a few different things:

  • It needed to retransmit (mirror) all of the Haltech information to the CD-7 dash CAN bus
  • It needed to transmit the GPS information to the CD-7 dash CAN bus

That’s it. While this seems trivial on the surface, it proved to be rather complicated. This link is the final version of the script I ended up with. I used all of the aforementioned resources to come to this. Here’s some details on what’s inside:

  • Some copied and pasted functions that generate CAN messages for the GPS (speed, lat, lon, altitude) and IMU (yaw, pitch roll) which will be read by the AEM CD-7 dashboard
  • Some copied and pasted functions (from the same place) that properly break down 16- and 32-bit values into multiple bytes
  • A special loop that will read data off the #1 CAN bus for 10 milliseconds and retransmit it on the #2 bus
  • Optional settings to print information to the RaceCapture App script log

The reality is that it took us quite some time to figure this all out, with quite a bit of trial and error, and a number of forum posts back and forth between myself and the Autosport Labs folks. And, as stated before, we decided not to bother with the retransmit in the end, and are going to wire one of the AEM CD-7’s two CAN channels directly into the Haltech bus. We still need to send GPS data to the dash, though, so that the dash can do predictive timing for us.

But, if we wanted, we could also use the RaceCapture/Pro MK2’s predictive lap time information and send that to the dash. Either way.

Previous page 1 2 3 4 5 6 7 8Next page
Related Topics
  • Electrical System Education and Troubleshooting
  • Data Acquisition and Tuning
  • Wiring
  • Electrical
  • Electronics
  • Battery and Power Distribution
Previous Article
  • Projects
  • NX GTi-R

Controlling the Heat: Koyorad Radiator

  • Frank Ewald
View Post
Next Article
SR20 compression test
  • Tech

Ultimate SR20 Rebuild Guide: Part 1 – The Teardown

  • Nikita Rushmanov
View Post
5 comments
  1. John Michael Hurley Jr says:
    July 8, 2018 at 6:06 pm

    CD006!

    Love the build, check out my similar build at https://www.facebook.com/pg/Danger-Racing-Group-1997107470615292/about/

    John

    Reply
    1. Erik Jacobs says:
      July 9, 2018 at 3:04 pm

      I think my buddy Jay took a photo of your car and sent it to me! I was supposed to reach out to you but never got around to it. Small world!

      Reply
  2. John Michael Hurley Jr says:
    July 9, 2018 at 5:17 pm

    Small world indeed. I have been keeping up with your build for a while. Very envious of the wiring job. The CD-7 is a great product but it is so new that there isn’t much guidance on how to customize. We may be swapping to an AIM product.

    Reply
    1. Erik Jacobs says:
      July 10, 2018 at 5:38 am

      If you need any help with your CD-7 just let me know. Happy to dig into it. AEM tech support is also super helpful. Let me know next time you come through Atlanta!

      Reply
  3. John says:
    October 30, 2018 at 12:33 pm

    Erik,

    Double Win at AMP.

    https://m.facebook.com/story.php?story_fbid=10156740661797346&id=102985012345

    Hope you are doing well with your build. Think we are dropping the CD7 in favor of AIM product.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

MotoIQ Proudly Presents Our Partners:

Input your search keywords and press Enter.