Page 1 of 3

AEM Infinity CAN channel mapping script

Posted: Wed Aug 09, 2017 10:40 pm
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!

Posted: Sun Aug 13, 2017 7:06 pm
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!

Posted: Mon Aug 14, 2017 3:48 pm
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?

Posted: Mon Aug 14, 2017 5:34 pm
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!

Posted: Mon Aug 14, 2017 6:38 pm
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!

Posted: Tue Aug 15, 2017 7:09 pm
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!

Posted: Wed Aug 16, 2017 2:08 am
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!

Posted: Wed Aug 16, 2017 2:05 pm
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

Posted: Wed Aug 16, 2017 5:00 pm
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?

Posted: Wed Aug 16, 2017 5:36 pm
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.

Posted: Wed Aug 16, 2017 6:19 pm
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!

Posted: Wed Aug 16, 2017 6:26 pm
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.

Posted: Wed Aug 16, 2017 8:29 pm
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!

Posted: Wed Aug 16, 2017 9:56 pm
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!

Posted: Fri Aug 18, 2017 12:28 am
by brentp
What CAN bus is your AEM connected to?