AIM SmartyCam CAN: Difference between revisions

No edit summary
 
(36 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Introduction=
=Introduction=
This CAN bus integration maps CAN bus data from AIM systems normally directed to AIM's SmartyCam camera system.  
'''Note:  This is the old way using Lua Script.  Please see the new way to [[AIM_Integration_CAN_Mapping|integrate with your AIM Data Logging system using CAN mapping]].'''


Since the SmartyCam protocol is standard across AIM products, connecting RaceCapture/Pro to the CAN interface of an AIM product compatible with SmartyCam, communications can be intercepted and data can be mapped to RaceCapture/Pro telemetry channels.
This CAN bus integration maps CAN bus data from AIM systems using the CAN protocol used for the SmartyCam camera system.


=Pictures=
=Connecting to the AIM system=
[[Image:AIM_RCP_pinout mapping.png]]


=Connections=
{| class="wikitable"
!colspan="7"|AIM cable connection mapping
|-
!Connection
!AIM Pin (Binder 702)
!RaceCapture/Pro Pin (EIA-T568B Ethernet cable)
|-
|CAN High
|1 (White)
|2 (Orange)
|-
|CAN Low
|4 (Blue)
|3 (Green / White)
|-
|Ground
|2 (Brown)
|1 (Orange / White)
|-
|VBExt
|3
|N/C (Do not connect)
|}


=CAN database=
====Note====
* RaceCapture/Pro provides a 12v input pin (Pin 8) on the RJ45 connector, which has a common connection to the 12v input of the RaceCapture/Pro terminal block.
* This pin is rated at 1A max. We do not recommend using this pin to supply power to the AIM Smarty CAM.


[[CAN_database#AIM_Smarty_CAM_CAN_protocol|AIM SmartyCAM CAN protocol]]
=Available Channels=
This integration enables the following channels.


=Integration Script=
This assumes the AIM channels 1-5 are defined with the following configuration. You can customize this mapping based on your particular AIM configuration.


<pre>
{| class="wikitable"
--AIM Smarty Cam Stream For Race Capture
!colspan="7"|BMW E46 (including M3)
|-
!AIM Channel Name
!RaceCapture channel name
|-
|RPM
|RPM
|-
|Gear
|Gear
|-
|WaterTemp
|EngineTemp
|-
|Oil Press
|OilPress
|-
|Oil Temp
|OilTemp
|-
|Throttle Position
|TPS
|-
|Head Temp
|HeadTemp
|-
|Exhaust Temp
|EGT
|-
|Brake Pos (channel 1)
|BrakePos
|-
|Clutch Pos (channel 2)
|Clutch
|-
|Brake Press (channel 3)
|Brake
|-
|Steer Position (channel 4)
|Steering
|-
|Lambda (channel 5)
|Lambda
|-
|FuelLevel
|FuelLevel
|-


--how frequently we poll for CAN messages
|}
tickRate = 30
--the CAN baud rate
CAN_baud = 1000000
--CAN channel to listen on. 0=first CAN channel, 1=second
CAN_chan = 0
--1 for Big Endian (MSB) mode; 0 for Little Endian mode (LSB)
be_mode = 0


--add your virtual channels here
=Integration Cable=
tpsId = addChannel("TPS", 10, 0, 0, 100, "%")
==Build your own==
tempId = addChannel("EngineTemp", 1, 0, 0, 200, 'C')
AIM uses a Binder 5-pin series 702 connector - you can modify an existing compatible cable, or make a custom cable with the appropriate connectors and splice it with an RJ45 network cable.
oilTempId = addChannel("OilTemp", 1, 0, 0, 200, 'C')
rpmId = addChannel("RPM", 10, 0, 0, 10000, 'RPM')
fuelId = addChannel("Fuel", 1, 0, 0, 60, "L")
oilPresId = addChannel("OilPressure", 10, 0, 0, 10, 'Bar')


--customize here for CAN channel mapping
==Get a pre-made cable==
--format is: [CAN Id] = function(data) map_chan(<channel id>, data, <CAN offset>, <CAN length>, <multiplier>, <adder>)
We have [https://www.autosportlabs.com/product/aim-dashboard-telemetry-cable/ AIM integration cables available in our online store]:
CAN_map = {
[1056] = function(data) map_chan(rpmId, data, 0, 2, 1, 0) map_chan(tempId, data, 6, 2, 0.1, 0) end,
[1057] = function(data) map_chan(oilTempId, data, 4, 2, 0.1, 0) map_chan(OilPresId, data, 6, 2, 0.01, 0) end,
[1058] = function(data) map_chan(tpsId, data, 2, 1, 1, 0) end ,
[1070] = function(data) map_chan(fuelId, data, 0, 1, 1, 0) end
}


function onTick()
[[Image:AIM_RCP_integration_cable.jpg|500px]]
processCAN(CAN_chan)
end


--===========do not edit below===========
[[Image:add_to_cart.png|link=https://www.autosportlabs.com/product/aim-dashboard-telemetry-cable/]]
function processCAN(chan)
    repeat
        local id, e, data = rxCAN(chan)
        if id ~= nil then
            local map = CAN_map[id]
            if map ~= nil then
                map(data)       
            end
        end
    until id == nil
end


--Map CAN channel, little endian format
=AIM Integration configuration=
function map_chan_le(cid, data, offset, len, mult, add)
    offset = offset + 1
    local value = 0
    local shift = 1
    while len > 0 do
        value = value + (data[offset] * shift)
        shift = shift * 256
        offset = offset + 1
        len = len - 1
    end
    setChannel(cid, (value * mult) + add)
end


--Map CAN channel, big endian format
==Direct CAN channel Mapping==
function map_chan_be(cid, data, offset, len, mult, add)
    offset = offset + 1
    local value = 0
    while len > 0 do
        value = (value * 256) + data[offset]
        offset = offset + 1
        len = len - 1
    end
    setChannel(cid, (value * mult) + add)
end


map_chan = (be_mode == 1) and map_chan_be or map_chan_le
[[file:RaceCapture_AIM_channel_mapping.png|640px]]
initCAN(CAN_chan, CAN_baud)
 
setTickRate(tickRate)
[https://wiki.autosportlabs.com/images/1/1a/AIM_smartycam_mapping_v3.rcp.zip Download this starter configuration] to instantly import 16 pre-configured channels mapped to your AIM Smarty Cam data. 
</pre>
 
Instructions:
* Save any existing channel configuration, such as your analog sensors, as this starter configuration will overwrite your current configuration.
* Unzip the downloaded AIM SmartyCAM configuration and extract the .rcp file.
* Connect the RaceCapture app to your RaceCapture system
* Go to Setup, and press '''Open''' to open the unzipped configuration file.
* Press '''Write''' to write the configuration to your RaceCapture system.
* Switch to the Dashboard view to monitor and verify the AIM SmartyCAM channels.
 
'''Important Note'''
* If you are converting from the Lua script integration to direct CAN mapping, be sure to completely remove your Lua script mapping by erasing the Lua scripting window and writing the configuration back to RaceCapture.
* Full guide on [[AIM_Integration_CAN_Mapping|CAN Mapping here]].

Latest revision as of 14:55, 21 June 2019

Introduction

Note: This is the old way using Lua Script. Please see the new way to integrate with your AIM Data Logging system using CAN mapping.

This CAN bus integration maps CAN bus data from AIM systems using the CAN protocol used for the SmartyCam camera system.

Connecting to the AIM system

AIM RCP pinout mapping.png

AIM cable connection mapping
Connection AIM Pin (Binder 702) RaceCapture/Pro Pin (EIA-T568B Ethernet cable)
CAN High 1 (White) 2 (Orange)
CAN Low 4 (Blue) 3 (Green / White)
Ground 2 (Brown) 1 (Orange / White)
VBExt 3 N/C (Do not connect)

Note

  • RaceCapture/Pro provides a 12v input pin (Pin 8) on the RJ45 connector, which has a common connection to the 12v input of the RaceCapture/Pro terminal block.
  • This pin is rated at 1A max. We do not recommend using this pin to supply power to the AIM Smarty CAM.

Available Channels

This integration enables the following channels.

This assumes the AIM channels 1-5 are defined with the following configuration. You can customize this mapping based on your particular AIM configuration.

BMW E46 (including M3)
AIM Channel Name RaceCapture channel name
RPM RPM
Gear Gear
WaterTemp EngineTemp
Oil Press OilPress
Oil Temp OilTemp
Throttle Position TPS
Head Temp HeadTemp
Exhaust Temp EGT
Brake Pos (channel 1) BrakePos
Clutch Pos (channel 2) Clutch
Brake Press (channel 3) Brake
Steer Position (channel 4) Steering
Lambda (channel 5) Lambda
FuelLevel FuelLevel

Integration Cable

Build your own

AIM uses a Binder 5-pin series 702 connector - you can modify an existing compatible cable, or make a custom cable with the appropriate connectors and splice it with an RJ45 network cable.

Get a pre-made cable

We have AIM integration cables available in our online store:

AIM RCP integration cable.jpg

Add to cart.png

AIM Integration configuration

Direct CAN channel Mapping

RaceCapture AIM channel mapping.png

Download this starter configuration to instantly import 16 pre-configured channels mapped to your AIM Smarty Cam data.

Instructions:

  • Save any existing channel configuration, such as your analog sensors, as this starter configuration will overwrite your current configuration.
  • Unzip the downloaded AIM SmartyCAM configuration and extract the .rcp file.
  • Connect the RaceCapture app to your RaceCapture system
  • Go to Setup, and press Open to open the unzipped configuration file.
  • Press Write to write the configuration to your RaceCapture system.
  • Switch to the Dashboard view to monitor and verify the AIM SmartyCAM channels.

Important Note

  • If you are converting from the Lua script integration to direct CAN mapping, be sure to completely remove your Lua script mapping by erasing the Lua scripting window and writing the configuration back to RaceCapture.
  • Full guide on CAN Mapping here.