Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Old Capp777 post re: Compass

Pages: [1] 2
Author Topic: Old Capp777 post re: Compass
Boznian2
Member
Posts: 22
Post Old Capp777 post re: Compass
on: March 27, 2019 (GMT)

I can’t find the original link to the post now but here was the text that I saved from it:
Hello would it be possible to add a digital compass? Such as N, NE, E, SE, S, SW, W, NW. Thanks
End Quote.
I have created my own using a digital display
and a custom pid with the following:
Long Name: Compass Bearing
Short Name: Compass
Mode/Pid: Leave blank.
Equation: Closest(Val{GPS Bearing}::0=’N’:45=’NE’:90=’E’:135=’SE’:180=’S’:225=’SW’:270=’W’:315=’NW’:360=’N’)
Units: Bearing
Scale: x1
Min: 0.0
Max: 360.0
Diagnostic Start/Stop Command: Leave blank.
Note:
Beta version 1.8.190 or greater required to use
Closest function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When I do this, I only get the numbers displayed, eg. 45, 225, etc. not “NE”, “SW”. Am I doing something wrong or does this not work anymore?

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: March 27, 2019 (GMT)

I am using 1.8.205 Torque Pro and it still
works for me using equation…

Closest(Val{GPS Bearing}::0=’N’:45=’NE’:90=’E’:135=’SE’:180=’S’:225=’SW’:270=’W’:315=’NW’:360=’N’)

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: March 27, 2019 (GMT)

Torque is picky about the single quote
character value so you might edit using
phone just in case.

Boznian2
Member
Posts: 22
Post Re: Old Capp777 post re: Compass
on: March 27, 2019 (GMT)

Yep, that was it! Even though I copied your original post directly to the phone’s formula section (via Vysor) it somehow interpreted the single quote differently. Retyped them all directly on the phone and it fixed the problem. Thanks once again! NOW, WHAT WOULD REALLY BE COOL is if you could come up with a way to make it read “- -” (instead of defaulting to “N”) when the GPS speed = 0 or falls below a given point…

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: March 29, 2019 (GMT)

Create pids with the following
equations…

Pid1

Closest(Val{GPS Bearing}+Val{Pid2}::0=’N’:45=’NE’:90=’E’:135=’SE’:180=’S’:225=’SW’:270=’W’:315=’NW’:360=’N’:-999=’–‘)

Pid2

Lookup(Val{Speed (GPS)}::0~3=-999:3~180=0)

Notes:

Edit pid2 speed ranges 0~3 and 3~180 to desired
trigger points.

Using a second pid prevents a display issue of
-999 showing intermitently.

Edited.

Boznian2
Member
Posts: 22
Post Re: Old Capp777 post re: Compass
on: April 1, 2019 (GMT)

Wow, thanks! It does work however it seems to be overwhelming my old phone as now the GPS functions are all updating slowly and in large jumps. Probably the constant evaluation of speed in Pid2? (fwiw, all this phone does is GPS speed, altitude, compass, bearing, # satellites.)

Boznian2
Member
Posts: 22
Post Re: Old Capp777 post re: Compass
on: April 3, 2019 (GMT)

Sorry to bother again but I was wondering if there is any way to slow down the speed check interval to maybe once per second? Or is there something else that is now causing the instability/delay in the other sensors?

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: April 3, 2019 (GMT)

I am not aware of a way to slow down pid
read speed. When I tested formula offline
I used Val{Tilt(z)} which seemed to work
okay when I changed the tilt.

What happens if you put pid1 on a page by
itself. Pid2 doesn’t need to be displayed.

Since the data comes from your phone and
not the vehicle’s network, I would have
thought phone could easily handle.

Val{Speed (OBD)} might be worth testing
as well.

Boznian2
Member
Posts: 22
Post Re: Old Capp777 post re: Compass
on: April 3, 2019 (GMT)

PID 1 is the only one being displayed. (Along with GPS speed, GPS altitude, GPS compass, # GPS satellites, nothing else.) GPS altitude now often reads negative numbers, but slowly, in jerks and jumps starts to come up to numbers in the hundreds of feet. (I am at ~900 ft.) GPS speed seems to update slowly, and often reads 2-5 MPH even when sitting still but eventually comes to 0.
Val{Speed (OBD)} won’t work because this phone is not connected to the OBD port as I have never been able to get Torque Repeater to work.

JtotheC11
Member
Posts: 40
Post Re: Old Capp777 post re: Compass
on: April 4, 2019 (GMT)

Quote from Capp777 on March 29, 2019
Create pids with the following
equations…

Pid1

Closest(Val{GPS Bearing}+Val{Pid2}::-999=’–‘:0=’N’:45=’NE’:90=’E’:135=’SE’:180=’S’:225=’SW’:270=’W’:315=’NW’:360=’N’)

Pid2

Lookup(Val{Speed (GPS)}::0~3=-999:3~180=0)

Notes:

Edit pid2 speed ranges 0~3 and 3~180 to desired

trigger points.

Using a second pid prevents a display issue of
-999 showing intermitently.

i was the original poster, i too would like the “–” display but im having problems. where do i input the 2nd Pid and where is the edit for the speed range and trigger points?

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: April 4, 2019 (GMT)

You will need to create Pid2 using the pid
editor the same way you created the original
Compass Bearing pid.

The equation for Pid2 has the trigger points
in it… just need to change 0~3 and 3~180 to
whatever values you prefer. The current values
will display “–” when GPS Speed is below 3.
Greater than 3 will show current bearing in
theory.

You should be able to edit Compass Bearing
equation to equal the equation given in Pid1.

JtotheC11
Member
Posts: 40
Post Re: Old Capp777 post re: Compass
on: April 4, 2019 (GMT)

i see wat u mean on the 0-3 3-180 (i dont have the curved line on my keyboard) i tried putting the pid2 in the same pid edit with the original compass bearing, didnt work. i then put the pid2 in another custom pid, didnt work either. im still seeing the “N”

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: April 4, 2019 (GMT)

The ~ tilde character is used by the lookup
function for ranges. Maybe you can cut and
paste?

You need to add Pid2 as a new pid.

The Compass Bearing pid equation can be
edited to match Pid1’s equation given above.

JtotheC11
Member
Posts: 40
Post Re: Old Capp777 post re: Compass
on: April 4, 2019 (GMT)

well, i still cant get it to work. ive type everything that as given. doest it affect that that i use torque on a tablet?, it does have GPS speed reading without internet.

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: April 4, 2019 (GMT)

Tablet or phone with latest version of Torque Pro
should work if your equations exactly match
those I provided and Speed (GPS) pid returns
a value.

I tested offline using Val{Tilt(z)} since I drive an
OBDI Jeep MY1995.

JtotheC11
Member
Posts: 40
Post Re: Old Capp777 post re: Compass
on: April 5, 2019 (GMT)

ive been trying to get it to work for an hour, nothing. in the Pid1 equation
i inputed +Val{pid2}. nothing. i then inputed +Val{Speed (GPS)} nothing. i dont where i did wrong. i wish i could send a screenshot but adding images here is really difficult.

JtotheC11
Member
Posts: 40
Post Re: Old Capp777 post re: Compass
on: April 5, 2019 (GMT)

nevermind i got it lol i didnt input the word “pid2” as the Long name (used in menus)

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: April 5, 2019 (GMT)

Glad you figured out issue. The long names
used in Val{} must match exactly to work.

I am curious if you are seeing the performance
issues mentioned by the OP.

JtotheC11
Member
Posts: 40
Post Re: Old Capp777 post re: Compass
on: April 5, 2019 (GMT)

in my 3 mile trip for the 1st time with this new display, i only notice when i turn from North to East normally it would display N..NE..E smoothly. well with this new display it displays NE for less than a fraction of a second then E. im assuming its lagging a bit.
as far as the OP, no it worked perfectly

Capp777
Member
Posts: 2862
Post Re: Old Capp777 post re: Compass
on: April 6, 2019 (GMT)

Moving -999=’–‘ to the end may help
with the lag. See my edited post above.

Pages: [1] 2
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.458 seconds.

  Follow me on twitter