New serial protocol / MS3 pre1.1 alpha codes 12+

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

New serial protocol / MS3 pre1.1 alpha codes 12+

Post by jsmcortina »

EDIT: jump to alpha12 release here: http://www.msextra.com/forums/viewtopic ... 74#p290770

For a while now we have been working on a new error checked serial system for communication between TunerStudio and MS3. PhilT has made the additions to TS and I've added the firmware side.

Now that alpha11 has been released, it is the intention to focus on just this "newserial" for the next alpha release. (Unless any show-stopping bugs crop up.)

The serial changes should be totally behind the scenes to most users but should improve the robustness of the protocol, however, in the process a lot of code has changed so there is a lot to test. The end result will be good, but there are likely a few icebergs on the way.

We'll likely want some "super-alpha" testers in the near future once Ken and I have tried this on our cars.

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".
ashford
Super MS/Extra'er
Posts: 1603
Joined: Sun Apr 27, 2008 4:29 pm

Re: New serial protocol

Post by ashford »

i have a ms3 with a dead battery voltage circuit (ad4) and a known noisy, problem car/mainboard. if you can turn off batt v checks i don't care if i fry the processor or not.
prof315
Super MS/Extra'er
Posts: 3748
Joined: Sun Jan 18, 2009 3:13 am
Location: Melbourne, FL

Re: New serial protocol

Post by prof315 »

Count me in James. I'll step up to alpha 11 today. I was planning on working on the car all weekend anyhow getting my water injection up an running.

Jeff
Linfert Performance/321 Motorsports
SCCA 2019 SM National Champion Crew Chief
SCCA 2023 FP National Champion Tuner/electrical engineer
100s of MS systems built installed and tuned
Support the developers!
y8s
Master MS/Extra'er
Posts: 478
Joined: Wed Jan 07, 2009 3:21 pm

Re: New serial protocol

Post by y8s »

I wont get a chance to load up alpha 11 until after the 4th but am happy to test that and the upcoming stuff.
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Re: New serial protocol

Post by UnaClocker »

My Monday-Friday spare time has evaporated with my new job, but if you need testing on a weekend, I DEFINITELY have a problematic serial connection in my car. I'd be more than happy to do some testing, I can do both PL2303 serial adapter and the onboard USB.
I was getting ready to take some drastic measures to fix my problem, like buying a new MS harness and rewiring the whole thing from scratch, as well as removing the IGBT's and injector drivers from inside the MS completely.
Any chance you're going to turn up the serial speed? I've been told that you can go up to 230k or even 500ish? That'd definitely be a way to test the robustness of your new protocols and methods. Might not normally need that kind of speed, but with an ADC heavy CAN device, it seems to overwhelm the 115k connection when you have both INI's enabled.
Brian
'84 Dodge Rampage
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: New serial protocol

Post by jsmcortina »

Nearly there... the "new serial" release should be out in a few days all being well.

Una, increasing the serial speed could be problematic though - the CPU has this other task of actually running an engine to contend with as well. But if you want to test it you MUST have been on alpha11 first.

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".
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: New serial protocol

Post by MWPau »

Details on the new protocol?
How are you adding CRC (i gather its CRC) while keeping backwards compatibility?
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Re: New serial protocol

Post by UnaClocker »

MS3 is already not backwards compatible. You must be using TunerStudio. MegaTune ran into a wall before the MS3 project even started.

James, I'll make a point to get the car up on Alpha 11 between rain showers this weekend. I hadn't moved up to 11 because it didn't seem to change anything relevant to my setup, but I'll give it a whirl and make sure it's still working for me. And for the record, I gave up on sequential and COP. It's nice having it just fire up when I turn the key, not worth the hassle my screwball cam signal was causing.
Brian
'84 Dodge Rampage
racingmini_mtl
Super MS/Extra'er
Posts: 9127
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: New serial protocol

Post by racingmini_mtl »

The lack of compatibility is not in the serial protocol but in the ini format. That's a different issue.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Re: New serial protocol

Post by UnaClocker »

Oh, I get it.. He's thinking of something like the Megaview or something along those lines? Eh, those things should have been using the CAN bus.. Maybe someone can add CAN support to the Megaview, or a new version could be created.
Brian
'84 Dodge Rampage
xrattiracer
Experienced MS/Extra'er
Posts: 301
Joined: Fri Aug 01, 2008 2:25 pm

Re: New serial protocol

Post by xrattiracer »

ive been running alpha 11 on mine, but have only done one autocross event with it so far. did some minor tweaks to the tune and took a couple small datalogs without issue, but otherwise have not done much that required serial comms.
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: New serial protocol

Post by jsmcortina »

Megaview doesn't work with the new serial yet (but I will make it.)

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".
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: New serial protocol

Post by jsmcortina »

New serial / alpha12 release

Requirements:
You must have been running alpha11 successfully before trying alpha12
Tunerstudio beta >= 1.074 is needed.
( http://www.efianalytics.com/TunerStudio/beta/ )

Major changes since alpha 11
New serial protocol.
All transactions to/from the MS3 are sent in CRC checked packets. The aim here is to eliminate the uncertainty that was present in the existing serial system. This involved almost a complete re-write of the serial system. A full transaction is read into memory and then processed if the packet passes size and CRC checks. (Previously the serial was handled on-the-fly with no checking.) This has removed most of the interrupt-side serial code and it is now handled in the mainloop.
Testing by JSM/KC/PT so far seems to be positive, but wider field testing could easily reveal unexpected issues - be careful !

Small changes:
Add option to only correct in EGO between a specific threshold.
Add CLT lower threshold, below which wastegate is held open.
Add option to turn on fan with AC button or not.
ini tweaks per PT
V3 board injector testmode 'all'
Firmware loader allows tune to be refreshed while preserving sensors and is more verbose about what it preserved.

Known issues
The firmware loader isn't 100% perfect at detecting between old and new serial formats, more work required.
Megaview will not work yet.
SDcard serial utility programmes will not work yet.
JBperf IO-Extender time-set utility will likely not work. (untested)
Any other utilities, loggers or dashes that use old serial will not work.

The alpha release is available from:
http://www.msextra.com/doc/ms3/files/alpha/

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".
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: New serial protocol

Post by jsmcortina »

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".
racingmini_mtl
Super MS/Extra'er
Posts: 9127
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: New serial protocol

Post by racingmini_mtl »

Is there a way for some CAN passthrough applications, such a the IOx utilities, to detect that it is connecting to an MS3 with the new protocol? That would be very useful to be able to do that without requiring the user to know about it. So if the old format commands such as 'Q' or 'S' are still there and can return something that would identify the code is using the new format then that would be a good way to do it.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: New serial protocol

Post by jsmcortina »

I need to add more to that doc...
The old style 'Q' and 'S' are supported both as before and in newserial mode. I also added a command 'F' that returns 001 for newserial and times out returning nothing on oldserial. You could also send an unsupported command 'N' perhaps and newserial will return with an error message.

If you have any thoughts on better ways of handling this, I'm happy to consider adding some else to the new firmware.

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".
racingmini_mtl
Super MS/Extra'er
Posts: 9127
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: New serial protocol

Post by racingmini_mtl »

Should we add the 'F' command to MS2/Extra for future release? I assume it could return 000 which could speed things up a bit when using CAN passthrough. By the way, is the 001 three bytes with 0, 0 and 1 or 3 bytes with ASCII values so 48, 48, 49 or something else?

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
jsmcortina
Site Admin
Posts: 39569
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: New serial protocol

Post by jsmcortina »

ASCII '0','0','1'
Yes we could add this to MS2/Extra and MS3 release. As I said, I'm open to any better ideas?

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".
racingmini_mtl
Super MS/Extra'er
Posts: 9127
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: New serial protocol

Post by racingmini_mtl »

Actually, that's the type of thing I would have done so it's fine with me.

One thing I would change is the header of the new protocol. Since you will likely not be using 16 bits for the packet size, you could reserve 4 bits for the format number. That way the ECU is certain that the PC is actually sending the format it is expecting. Of course that limits the format numbers to 16 and the packet size to 4K but that should be acceptable.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
Posts: 9127
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: New serial protocol

Post by racingmini_mtl »

One more question. Does the CRC32 include the payload size or not?

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Post Reply