AEM Infinity CAN channel mapping script

Discussions on CAN mapping for ECUs, sensors, PDMs, and more.
kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

AEM Infinity CAN channel mapping script

Post by kijones »

Hey guys!

first of all, thanks for the amazing piece of hardware! Finally got it all wired up and powered on!

My question is, I found your script for adding the CAN channels for the AEM infinity, and it seems like the box is sseeing the data because it can display it on the dashboard, but there are no channels listed under the CAN Mapping Tab, which is i assume how SoloStorm can then see the info.

IS there a script that you have that can add these channels for me or do I need to do that manually?

Thanks again!

PS: I confirmed with AEM engineers that all version of the Infinity ECU output CAN data the same way, so the sccript you have will work for every version for the given channels. I also asked them for a complete channel CAN guide and they were kind enough to provide me the PDF link.

http://aemelectronics.com/files/pdf/AEM ... Public.pdf

Just in case you guys wanted it!

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi, thanks for your note.

Great you got the AEM data working with the Lua script. A bit of explanation of history is needed.

Originally, we supported CAN channel mapping via Lua scripting. Recently, we added a new way to directly map CAN channels, directly in the firmware, with a configuration UI.

So, there are two different ways to map channels: using Lua scripting, and the direct CAN mapping. That's why you don't see the channels defined under the CAN mapping section.

These two links describe it all in detail:
https://www.autosportlabs.com/racecaptu ... -released/
https://wiki.autosportlabs.com/CAN_Bus_Integration

For integration with SoloStorm, please contact them on how to achieve that integration.

Thanks!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

Thanks Brent!

That makes total sense. Can you help me understand/digest the tech sheet from AEM and what are the values I need out of that to make the CAN channels via the custom setup section? Or if it is missing key info that I would need to make those channels that would be helpful too so I can ask them.

Thanks!

Got to use the setup for the first time this weekend, loved all the gyro data! Random additional question, does race capture apply any correction for GPS drift in the output data to solo storm?

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

Think I figured it out. Comparing the script:
CAN_map = {
[32546816] = function(data)
map_chan(rpmId, data, 0, 2, 0.39063, 0)
map_chan(tpsId, data, 4, 2, 0.0015259, 0)
map_chan(atsId, data, 6, 1, 1, 0)
map_chan(ctsId, data, 7, 1, 1, 0)
end,


Shows CAN ID as 32546816, this aligns with the first table on the PDF from AEM which contains the loaction for all those sensors in the CAN data. By numbering the tables in the PDF increasing by 1, the CANID's lign up for the remaining sensors that are known.

That was the piece of info the PDF was missing for me to be able to just make the channels easily in the CAN mapping!

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi,

We strongly recommend mapping using the direct CAN mapping method we now have - it's driven by a GUI and you don't have to type script.

Full instructions are here:
https://wiki.autosportlabs.com/CAN_Bus_ ... AN_mapping

The Lua scripting is there for the 1% of cases where our CAN mapping script can't handle a special circumstance.

Compared to the scripting approach, it's really easy to use and you should be able to map a channel very quickly.

Let us know how it goes, or if you need any help getting going. Thanks!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

Thanks Brent!

Yeah now that I know the CANID + Info in the AEM PDF it makes it super easy to add all the channels via the CAN Mapping tab. The script that you guys made before just helped me associate the can ID with the table in the PDF because it gave me known good values to start. I am going to update firmware to reset the box, then I will apply all the CAN channels via the mapping GUI.

Thanks for the help!
Attachments
CAN Map.JPG
CAN Map.JPG (127.65 KiB) Viewed 4304 times

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

Brent these values don't seem to be working.

Any tips on setting up the AEM in the CAN Mapping tab?

Is that the right CAN ID? is anything else non standard? like Endian or source type?

Thanks!

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

I'm stumped.

I have gone through all the AEM PDF, used a hex decimal converter to confirm the CAN ID is correct.
Using the offset and lengths that are used in the script and known to work. I have gone through and assigned big and litte Edian based on PDF, and signed/unsigned. But I am getting nothing on any of these channels.

an thoughts would be appreciated!

Here is the link for AEM PDF:
http://aemelectronics.com/files/pdf/AEM ... Public.pdf
Attachments
Capture.JPG
Capture.JPG (134.62 KiB) Viewed 4295 times

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi,

What I would recommend doing is to first turn off your CAN channels and then try (re-try?) the CAN bus logger here to verify the CAN baud rate and CAN bus you're connected to.

https://wiki.autosportlabs.com/CAN_Bus_logger

Make sure you replace any existing script with the logger script.

Do you see the AEM data pouring into the log window?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

I have cleared the script, but when I Initially set it up i used the script for the AEM that you have published and tt worked and I could see the virtual channels it st up with good data. The baud Rate is 500k, which is what i have it set to. To make sure that didn't impact it i updated firmware to reset, and then loaded the saved config that only had the CAN Mapping done. They are all mapped for CAN1 which is where the data is, that is also confirmed


I will try the logger again, i tried it last night with no success but I'm guessing that it was something i was doing/not doing since I know the CAN is working.

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

When you do the direct CAN mapping, you have to make sure the baud rate is set correctly in the GUI configuration, important to check. Your lua script might be overriding the baud rate at the top of the script, so check for that.

Also, if you're not on the 2.12.0 firmware I'd recommend upgrading to that before testing further.

Will watch for updates!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

It is on the 2.12.0 firmware for sure.

Is there a way to hard reset all setting and scripts to make sure that there is no possible interference?

I have confirmed that the CAN is enabled and the Baud rate is selected and 500k, does termination need to be turned on? I have it on.
Attachments
Capture.JPG
Capture.JPG (91.31 KiB) Viewed 4284 times

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

If you erase the script (after running the CAN bus logger script again) then you won't have interference, guaranteed.

Run the CAN bus logger, post the output here and we'll take a look.

Thanks!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

kijones
Posts: 32
Joined: Thu Jul 27, 2017 3:21 pm
Location: Colorado

Post by kijones »

ran the script and got the output pictured:

also turned the CAN on and off and got this:
[CAN device] Initializing CAN0 with baud rate 500000
[CAN device] CAN init success!
[CAN device] Initializing CAN1 with baud rate 500000
[CAN device] CAN init success!
Attachments
Capture.JPG
Capture.JPG (122.38 KiB) Viewed 4281 times

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

What CAN bus is your AEM connected to?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply