Page 1 of 1

spare adc dot

Posted: Fri Feb 01, 2013 4:57 pm
by apex
I would like to use the spare acd 6 for my front shock position. I can do that but i would like to have the DOT position . How i can do that.

Thank

Re: spare adc dot

Posted: Mon Feb 04, 2013 5:57 am
by LT401Vette
It really depends on your MS version and firmware version.
If your firmware supports bring the adc 6 value to TunerStudio in any form, you can transform it into a meaningful value with a custom.ini

Re: spare adc dot

Posted: Tue Feb 12, 2013 7:54 pm
by apex
I use the ms2 extra 3.2.1 firware. Now, i use the spare adc6 for my shock position (0 inche to 4 inches). But i don't know the code and syntax for convert in positionDot. I'm not a programmer !!!!

Thank

Re: spare adc dot

Posted: Tue Feb 12, 2013 9:24 pm
by smokeysevin
I have no input but shock position is a cool function to log.

Sean

Re: spare adc dot

Posted: Tue Feb 12, 2013 10:55 pm
by LT401Vette
So what would you like to convert the output into?
What normally comes from ADC6 is an ADC, 0-1023 10 bit value representing 0-5v.
I a custom.ini file you can turn that int pretty much anything it needs to be as a real world number, but you do need to know what the conversion is.

Re: spare adc dot

Posted: Wed Feb 13, 2013 9:29 am
by pit_celica
As I understand it, the OP already has a sensor connected to ADC6 that is giving the stroke of the front shock from 0 to 4 in. He now wants the derivate over time of this signal. It's maybe not the good syntax, but here's the idea taht can be done in MLV :

strokeDOT = (stroke - (stroke-1))/(time-(time-1))

This will give a variable in "in/s" (assuming the ADC6 is already converted from 0-1023 to 0-4 inch).

Sam

Re: spare adc dot

Posted: Wed Feb 13, 2013 9:38 am
by LT401Vette
Here is the MLV syntax of that for a custom field assuming you have the "stroke" field logged:

Field Name: strokeDOT
Formula: ([stroke] - [stroke-1])/([time]-[time-1])

Re: spare adc dot

Posted: Wed Feb 13, 2013 3:51 pm
by apex
Thank you guys for yours answer. Yes, i put a linear sensor to my left front shock. In my custom.ini file, i convert my count with a factor and a offset ( count adc6 x factor - (offset)) = shock position

I create a new gage in tuner studio from my custom.ini file and i add this new data in MLV. The only thing i was not able is to introduce the derivate. :yeah!:

Thank a lot guys.

Re: spare adc dot

Posted: Fri Jul 14, 2017 12:28 am
by econ
Hello!
I know this is old post, but anyhow:
I would like to calculate spare adc_dot at Microsquirt ECU (MS2Extra comms340vU ) and send the value to TunerStudio MS over serial communication.
Do I neet to modify and recompile ECU files and what more?

I'm familiar of mathematics of this and have some programming experience, mainly in Python.

Re: spare adc dot

Posted: Fri Jul 14, 2017 7:25 am
by LT401Vette
You can do all the calcs in your custom.ini or using the Custom Channel Editor in TunerStudio MS Ultra.

adc6 / adc7 will give you the raw 10 bit adc, from there you can do what ever you need in TS.

Re: spare adc dot

Posted: Thu Jul 27, 2017 4:25 am
by econ
I am logging suspension positions with ShadowDash MS.
I can get the channels work using calculation below:

Code: Select all

[GaugeConfigurations]
RearSuspGauge     = rearTravel,      "SuspRear",   "mm",       0,   120,     -1,     1,   110,  115, 0, 0

[OutputChannels]
rearTravel       = { 145.6 - 26502.7/adc7 }    

[Datalog]
entry = rearTravel,      "RearTravel", float,  "%.1f"


But because nonlinearity of the position sensors, I would like to use INC-files instead.
However I cannot get INC-files to work, so what I'm doing wrong here:

Code: Select all

[OutputChannels]
rearTravel       = { table( adc7, 'rearSusp.inc')  }

rearSusp.inc

Code: Select all

; Kirjoitettu WriteINC.py -python-koodilla
0	0.00
2	0.00
.
.
.
184	0.00
186	0.11
188	1.63
190	3.11
192	4.57
194	5.99
196	7.38
198	8.75
200	10.09
202	11.40
204	12.68
206	13.95
208	15.18
210	16.40
212	17.59
214	18.76
216	19.90
218	21.03
.
.
.
1024	116.72
Code is written to mainController.ini file and INC-files are in inc-folder (Edit: written to mainController.ini, not firmware.ini)

Re: spare adc dot

Posted: Thu Jul 27, 2017 6:25 am
by LT401Vette
It is best to put your ini updates in custom.ini in that same projectCfg folder. That way your stuff stays separate and won't get stompted when you upgrade firmware.

The format of your inc file looks like it should be ok for format 1 if that is a \t between ADC and the value.

Seeing that it looks as though you have all 1024 lookups, you could use format 2 instead and replace the ADC numbers with DB

http://www.tunerstudio.com/index.php/ma ... le-formats

Re: spare adc dot

Posted: Thu Jul 27, 2017 9:02 am
by econ
I made a custom.ini and channels work now.

Thanks :)