Trying to add new MS2 feature - Upshift ignition retard

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

Post Reply
cmcraeslo
MS/Extra Newbie
Posts: 3
Joined: Thu Mar 26, 2015 1:56 am

Trying to add new MS2 feature - Upshift ignition retard

Post by cmcraeslo »

Hello all,

this is my first post as I'm beginning to develop something custom with the MS2. I've used the MS2 successfully over the years, but never got to developing any custom feature, because there was no need. Recently I have worked on few cars that had Motec ECU installed and noticed that it has great feature that instead of cutting the spark on upshift, it retards the ignition resulting in much faster and smoother shifts. I believe some version of this feature is also available on MS3, correct? .. but I need it a little bit more advanced.

What I would like to add to my MS2 is:
1) a map where I can set different ignition aim with different load. For example:
On 0-15% load my target would be 20 deg.
On 15-50% load my target would be 25 deg
on 50-100% load my target would be 30 deg.

2) ramp up & ramp down speed in deg/s. How fast does the ignition change.

3) input that would activate the ignition change procedure: when switch is pressed (wired externally) I would start ramping down the ignition to my ignition aim (depending on the load) and then as long as the switch is pressed, hold the ignition on these degrees. When the switch is released it would start to ramp up and return to normal.

I know this is a lot to do for my first custom development. To this moment I successfully compiled MS2 source code and uploaded it to the ECU. I Checked the code a little but I find it very confusing :) Is there some quick description of the files and main loop and how everything actually connects & runs? It would be very helpful :) I don't expect developing-for-dummies pdf with 1000 pages, just few quick notes ;)

Also, how can I debug the ECU? - I'm guessing there's a way to enable some output over the serial port?

I'd like to add these maps & settings to TunerStudio - are there any guidelines & quick startups on how to do this? Again, I'm not expecting 1000 page pdf :)

Thanks!
cmcraeslo
MS/Extra Newbie
Posts: 3
Joined: Thu Mar 26, 2015 1:56 am

Re: Trying to add new MS2 feature - Upshift ignition retard

Post by cmcraeslo »

Hello.

While waiting for my post to be published I kinda solved 80% of the problems already. I now have a 90% working version of ignition retard with ramp up/down (with built-in map). How would one put these settings to tunerstudio?

Also, I have a question about CAN inputs. I'd like to turn on an input via external ecu over CAN bus. I got lost in the CAN BUS protocol for Megasqurit. I don't quite get the examples:

Outbound:
id=0x18b838, DLC=3, Data = 0x07 0x00 0x42
From id = 7, To id = 0, Table = 7, message type = 1 (MSG_REQ), offset = 6, my varblk = 6, my varoff =2, varbyt = 2
Remote replies with:
id=0x903b8, DLC=2, Data = 0x14 0xfe (5374 RPM)
From id = 0, To id = 7, Table = 7, message type = 2 (MSG_RSP), offset = 2
Local device then stores this into table 7 at offset 2.

I tried to send this and I got the RPM value but I have no idea how to calculate the address & data.

Would someone be so nice and tell me what I need to send to a master device (can id 0) that master would put data on the remote port 1/2/3 so I can trigger flatshift for example.

Another, off topic question - how are you guys uploading this code? Are you sending this through the loader every time? It gets a little boring with such slow upload to the ECU.. it takes ages :) Is it possible to specify the file & port & all parameters so I don't need to press enter so many times when uploading.

That's all for today.. thanks! :)
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Trying to add new MS2 feature - Upshift ignition retard

Post by jsmcortina »

Define "ages" ? It should be under a minute if your serial is configured correctly on your computer.

Try ms2loader_XXX -h for commandline options.

e.g. ms2loader_win32 -j -f megasquirt2.s19 -c 1

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
cmcraeslo
MS/Extra Newbie
Posts: 3
Joined: Thu Mar 26, 2015 1:56 am

Re: Trying to add new MS2 feature - Upshift ignition retard

Post by cmcraeslo »

Hello,

Thanks for the commandline usage.

Yes, it's under a minute, but with 100 compiles/uploads x 1 minute it adds up ..

I have to say that the code is very easy to read and very well documented. I know how hard it is to make readable/well documented code. Good work there, really.

Do you maybe know what to send on canbus & how to setup ms2 to get external switches via remote port, without the gpio board?

Thanks!
Post Reply