|
Post by woutersp on Dec 29, 2017 11:45:25 GMT
Hi Matt, I am an automotive engineering student from Belgium. My main interest is developing a stand-alone ECU for MG Rover cars. Now I looked at your source code for the Arduino Due Rabbit ECU, but I can't seem to figure out how to program a trigger decoder. More info about the trigger I want to implement: rusefi.com//forum/viewtopic.php?f=5&t=968&sid=25e6dd3c1dbfb7d911d3f818da744d27Could you give me some hints in programming it please? Later on I would like to add a cam signal too. Thank you in advance, Wouter from Belgium
|
|
|
Post by Admin on Dec 30, 2017 8:34:51 GMT
Hi Wouter, The repository you looked at might just contain application code. I will update the repositories in the next few days so you can get started if you would like. At this point the Rabbit ECU is 360 crank degrees oriented. So batch fire wasted spark for the next few months. To set up the trigger pattern you just need to pass in an array of 'teeth event times' that represent your trigger. The pattern is just ratiometric to fit within the range 0 - 0x10000 (0 - 65536). For example your Rover pattern would be: {0,1820,3640,5461,7281,9102,10922,12743,14563,16384,18204,21845,23665,27306,29127,30947,32768,34588,36408,38229,40049,41870,43690,45511,47331,49152,50972,54613,56433,58254,61895,63715} A 6 degree 'gap' is 1820 'ticks'. So in the array you should mostly see deltas of 1820 with the odd 3640 'gap tick' where the missing teeth are. The array is stored in the user setting "Primary Trigger Table", declared uint16 aUserPrimaryTriggerTable[80] in usercal.h. To make the setup call use the service call: USER_vSVC(SYSAPI_enSetupCrankTriggerEdgePattern, (void*)&USERCAL_stRAMCAL.aUserPrimaryTriggerTable[0], (void*)&boFirstRising, (void*)&enEdgePolarity); When this call is made the array is parsed and stored in the CEM module and a phase lock algorithm will run to determine the crank position. There is a similar sync points array that controls at which points timing events will occur. So you would select 4 points (recommended) from the above array that are 90 crank degrees apart where you wish a timing callback to occur. Hope this helps please look out for the code updates shortly at this URL github.com/RabbitECUProject/RabbitECUOpenHALTrunk. Matthew
|
|
|
Post by woutersp on Jan 5, 2018 19:50:20 GMT
Hi Matt, Hope you had a nice new year! In the meantime I had some time to dig further in the source code and inner workings of the RabbitECU. Now I think I know how the trigger is programmed. Is it correct that the array is programmed using the MDAC calibration tool and or with the array in the code? However, I have some more questions: -If I try to compile the code with Atmel Studio 7 I get some errors. -If I open the Calibration tool I get this error: Translation: The index is out of range. It cannot be negative and must be smaller than the size of the array.After this I get a blank calibration tool window. - Can I also connect my arduino Due trough USB with the tool? I can only see the Wifi option. -Where can I find the A2L Parser? I would need to add some tables for my application. Thank you very much for your time and effort! Kind regards, Wouter.
|
|
|
Post by Admin on Jan 11, 2018 14:05:09 GMT
Hi Wouter, The latest Calibration Tool setup V1.0.1.3 is a USB only connection build and can be found here: mdac.com.au/support-documents/The tool now includes folder c:\MDAC\ECUHOST\Dev Tools which includes the A2L parser. You can edit the ASAM tool ini file to point to your project folder, map file location if you like. The Due should appear in your device manager as a CDC Class Virtual Comm Port and allow a connection to the Calibration Tool. Please email me matthew@mdac.com.au to receive the latest building ATMEL Studio project. Yes for the trigger array I recommend building into the source code as you say. The plan is for the Calibration Tool to be able to edit it also but that is going to take a little bit more work. The build usercal structure becomes the default calibration as you have seen in the source code. Glad you are making some progress and understanding the code. Nice work since there aren't too many comments yet :-) BR Matthew
|
|