Question about can vss

A forum for discussing applications and implementations of the MegaShift transmission controller code for the GPIO from B&G. This can control up to 8-speeds and 6 shift solenoids (plus a 16x9 table for controlling a PWM line pressure valve). It has manual and fully automatic modes (16x9 load x speed table), with under and over rev-limit protection, and full data logging of all inputs and outputs (among many other abilities). A TransStim to test your completed board is also available.
Post Reply
Vesku
Posts: 8
Joined: Thu Jul 26, 2012 1:31 am

Question about can vss

Post by Vesku »

I try to send vss1 from MS3 to GPIO but have no luck yet. I try to modify .ini file as told...

Code: Select all
[OutputChannels]
deadValue = { 0 } ; Convenient unchanging value.

ochBlockSize = 112
ochGetCommand = "a\x00\x06" ; Lower case so we don't get confused.

seconds = scalar, U16, 0, "s", 1.000, 0.0
secl = { seconds % 256 }, "s" ; For runtime screen.
pulseWidth1 = scalar, U16, 2, "s", 0.001, 0.0
pulseWidth2 = scalar, U16, 4, "s", 0.001, 0.0
...
VSS = scalar, U16, %%, "mph", 0.100, 0.0
...

I found that MS3 have vss1 in offset 336?
vss1 = scalar, U16, 336, "kph", 0.16093, 0.0

and GPIO have max offset in "CANbus Conficuration" 255. Have I understand everything right or have I missed something?

I get speedo working with mat stimulator value when use mat offset (20) and found that gear shift worked and ignition retard also during shifting. :) But can not get vss1 from MS3. Try change vss1 offset from 336 to something else from 5006.ini but that have to modify from monitor_5006.abs? Also should I need ms3 ini and s19 files modification?
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Question about can vss

Post by Bernard Fife »

Vesku,

The MS2 outpc structure is just 112 bytes long, so the offset is an unsigned char, which can run from 0 to 255. Putting 336 in MShift rolls-over, and actually gets you the value at offset at 81 (= 336 % 255).

At a cursory glance, it looks like the CANbus code can handle up to 2048 bytes in the outpc (= 8*256 bytes), because the CANbus sends 8 bytes at a time and the counter is an unsigned char.

So I'll try making the offset an unsigned int (0-65535), and limiting this to 0-2048 in the INI. I'll post code here for that shortly, and you can give it a try (I don't have an MS3).

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Question about can vss

Post by Bernard Fife »

Vesku,

Thanks for testing that function. Here is some 4.133 test code. It allows you to set the offset up to 512 (limited to 512 for test purposes, we can expand this if needed). You also have to set the outpc size as well (it can be up to 512 bytes). If the outpc is larger than 512 bytes, you can try setting it so that it includes the relevant variable (i.e. 336 in your case).

To use these new limits, you'll need the new INI that is attached.
Monitor_4133.abs.s19
(72.21 KiB) Downloaded 523 times
GPIO_MShift_4133.ini
(217.45 KiB) Downloaded 547 times
I don't know if this will work (it does work fine with B&G code, but then it always did). If it doesn't, I will talk with Al Grippo, who writes the CANbus code modules.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Vesku
Posts: 8
Joined: Thu Jul 26, 2012 1:31 am

Re: Question about can vss

Post by Vesku »

Thanks to You Lance!

I get fever yesterday but have to try this! I load code to gpio and TS, but get still that "canVSSofset value too high" note. I try to change that "MS-II outpc size" higher but that wound´t help. Might this 255 limit be in TS?

BR
Vesku
Attachments
gpio_3.JPG
gpio_3.JPG (87.29 KiB) Viewed 10969 times
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Question about can vss

Post by Bernard Fife »

Vesku,

Whoops, sorry! I just had a look at the INI, and it has a 255 limit (I must have uploaded the INI before I fixed that in my local version). The INI below *should* fix this:
GPIO_MShift_4133.ini
(217.45 KiB) Downloaded 547 times
You need to activate it under project properties, of course.

If it doesn't fix it, let us know and we will dig deeper.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Vesku
Posts: 8
Joined: Thu Jul 26, 2012 1:31 am

Re: Question about can vss

Post by Vesku »

Congratulations Lance and co! It´s working now!!! I send to ms3 0-5V singal input as vss from stimulator spare 0-5V output and get it to GPIO as speed!!

There is few issues with gear shifting and "Hyst clean" indicator is broken, but now we can get vss from ms3 to GPIO :mrgreen: When I get better I will continue testing and make proper conficurations to GPIO. I think that we should test next that can we send all (?!) values to from ms3 to GPIO via canbus and use them for desired purposes?

Thaks to You Lance!!
Vesku
Posts: 8
Joined: Thu Jul 26, 2012 1:31 am

Re: Question about can vss

Post by Vesku »

I can´t stay in bed now... :D

I notice that when we accept wider canbus offsets there should not be same offsets in use that in ms3. That will cause troubles. I dropped ms-II outpc size to 338 to avoid that. But at least small step forword :)

Edit: I get gear detection work in ms3 with JaccoF guide (Gear detection CAN works offset 12 CAN table 7) from ms3 forum. Now I can make boost table/gear. Also idle ignition advance works fine and ignition retard during shifts. Looking very promising to me for the future!
Vesku
Posts: 8
Joined: Thu Jul 26, 2012 1:31 am

Re: Question about can vss

Post by Vesku »

After few hours adjusting and learning this code feels to be quite stable! My shifting problem seems to be that I have shift table 2 in use. I was wondering why table 1 adjusting didn´t work :D And I go back to ms-II outpc size to 512 and nothing wrong with that also. I haven´t noticed any strange behavior. Just little bit slower responce in TS screen.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Question about can vss

Post by Bernard Fife »

Vesku,

Thanks for testing this, and it's cool that it seems to work for you!

I'm not sure about the table 1/2 issue. If you have a log we could have a look.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Vesku
Posts: 8
Joined: Thu Jul 26, 2012 1:31 am

Re: Question about can vss

Post by Vesku »

Lots of smileys today...

I when I changed GPI1 input usage to "log ony" it goes to table 1.
Post Reply