# Thread: RRFusion- My Fusion Brain plugin for RR

1. i will double check see what the problem is. Perhaps i have a parenthesis in the wrong place or something.

2. Originally Posted by Sonicxtacy02
My mistake.. they arent in the code currently. If i can find the functions he provided i will add it this week
Thanks Sonic, if its of any help i got the information for the FB from this post in the FB section: http://www.mp3car.com/vbulletin/fb-d...ml#post1187598

Hope that helps
Ken

3. LASAL- I've looked at this for an hour and there's no difference in the code between ports. I thought this was the case because i remember literally copying/pasting it and only changing variable and array indexes. My code for calculating converted values is very simple there's practically no room for error. AnalogIn() is an integer, Analog#Opt is an integer, and AnalogDecimalPlaces() is an integer. Here are is the code for the first 4 ports for the voltage option (6)

Code:
```<ANALOG 0 CODE>

ElseIf Analog0Opt = 6 Then
ReturnLabel = ((AnalogIn(0) * (5 / 1023) / analogCorrection(0)))
ReturnLabel = Math.Round(CDec(ReturnLabel), CInt(analogDecimalPlaces(0)))
ReturnLabel = ReturnLabel + "V"
End If

<ANALOG 1 CODE>

ElseIf Analog1Opt = 6 Then
ReturnLabel = ((AnalogIn(1) * (5 / 1023) / analogCorrection(1)))
ReturnLabel = Math.Round(CDec(ReturnLabel), CInt(analogDecimalPlaces(1)))
ReturnLabel = ReturnLabel + "V"
End If

<ANALOG 2 CODE>

ElseIf Analog2Opt = 6 Then
ReturnLabel = ((AnalogIn(2) * (5 / 1023) / analogCorrection(2)))
ReturnLabel = Math.Round(CDec(ReturnLabel), CInt(analogDecimalPlaces(2)))
ReturnLabel = ReturnLabel + "V"
End If

<ANALOG 3 CODE>

ElseIf Analog3Opt = 6 Then
ReturnLabel = ((AnalogIn(3) * (5 / 1023) / analogCorrection(3)))
ReturnLabel = Math.Round(CDec(ReturnLabel), CInt(analogDecimalPlaces(3)))
ReturnLabel = ReturnLabel + "V"
End If```
I'm honestly baffled as to why the same raw values change to different converted values. I'm not giving up on it.. but i dont know what avenue to venture next. Did you say that MDX doesnt have the same issue? If thats the case i'll search their source to see if any special handling is done on those ports.

4. Originally Posted by lasal
This is what I said
With the temperature sensors do not have any problem.
If you connect ΑΑ batteries then you see the problem
PS.
I like rrfusion very much and just want to help in debugging
Originally Posted by Sonicxtacy02
LASAL- I've looked at this for an hour and there's no difference in the code between ports. I thought this was the case because i remember literally copying/pasting it and only changing variable and array indexes. My code for calculating converted values is very simple there's practically no room for error. AnalogIn() is an integer, Analog#Opt is an integer, and AnalogDecimalPlaces() is an integer. Here are is the code for the first 4 ports for the voltage option (6)

I'm honestly baffled as to why the same raw values change to different converted values. I'm not giving up on it.. but i dont know what avenue to venture next. Did you say that MDX doesnt have the same issue? If thats the case i'll search their source to see if any special handling is done on those ports.
Two things spring to mind.

In the screen shot, the second set of three have formatted as true as opposed to false, would that be relevant.

Secondly the user is using comma seperated as opposed to decimal point seperated, not sure why that would make a difference between the two but I know it can cause weird things.

5. KennyKen- I looked in my PMs and no i dont have a function for PSI. I also looked at the air suspension thread and dont see a function not built around MDX architecture. I've never used MDX, and my whole purpose in creating RRFusion was i simply dont understand MDX lol. If someone can provide me a function that converts the FB raw value to PSI i'll throw it in the plugin no problem.

6. Originally Posted by Sonicxtacy02
KennyKen- I looked in my PMs and no i dont have a function for PSI. I also looked at the air suspension thread and dont see a function not built around MDX architecture. I've never used MDX, and my whole purpose in creating RRFusion was i simply dont understand MDX lol. If someone can provide me a function that converts the FB raw value to PSI i'll throw it in the plugin no problem.
You're gonna need two equations - one for the 150PSI sensor and one for the 400PSI sensor cause they're not the same.

7. thats no prob i can use the ANALOG#CORRECTION flag to specify which type it is

8. Originally Posted by GizmoQ
You're gonna need two equations - one for the 150PSI sensor and one for the 400PSI sensor cause they're not the same.
Thanks Gizmo, i will be using a 400psi sensor as well the 150.
So are you saying the formula for the 400 is: y = 0.0035x^2 + 1.4409x - 14.099
Do you happen to know the one for the 150 or should i ask Greenman to see if he still has it?

9. Originally Posted by KennyKen
Thanks Gizmo, i will be using a 400psi sensor as well the 150.
So are you saying the formula for the 400 is: y = 0.0035x^2 + 1.4409x - 14.099
Do you happen to know the one for the 150 or should i ask Greenman to see if he still has it?
i saw that one, but as i read it X is voltage not the raw data from the FB. Is that correct?

10. Originally Posted by KennyKen
Thanks Gizmo, i will be using a 400psi sensor as well the 150.
So are you saying the formula for the 400 is: y = 0.0035x^2 + 1.4409x - 14.099
Do you happen to know the one for the 150 or should i ask Greenman to see if he still has it?
Yes that is the polynomial equation that I came up with. I probably should have taken it out to the fourth polynomial, but the accuracy of the sensor above 150 is atrocious so why bother.

The same pressure function that 2kToaster built for the 150 is here:

5v gives you 600+ psi.
using a 100ohm resistor for R1 of a voltage divider, you get:
FB Voltage = 5 * (sensor/(sensor + 100))
The pressure function models this: y = 8.4879x^3 - 27.568x^2 + 49.943x - 18.313 where y is in pressure and x is in volts.
150psi ~= 3.29v

Originally Posted by Sonicxtacy02
i saw that one, but as i read it X is voltage not the raw data from the FB. Is that correct?
Yes, that is correct.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•