# Steering Angle CANBUS

**URL:** <https://forum.realdash.net/t/steering-angle-canbus/3816>\
**Category:** RealDash CAN\
**Created:** [September 23, 2023, 5:07am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816 "2023-09-23T05:07:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [September 23, 2023, 5:07am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/1 "2023-09-23T05:07:39Z")

</div>

Hi I am trying to figure out how to extract the steering angle from the following two-byte sequence, where:

Full Left – B0=1 B1=3D

Centre – B0=0 B1=0

Full Right – B0=0E B1=CE

Any suggestions most welcome.

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [September 25, 2023, 5:49am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/2 "2023-09-25T05:49:49Z")

</div>

Center is quite obvious 0  
Full Left is 0x3D01 which is 15617 decimal  
Full Right is 0xCE0E which is -12786 as signed decimal

CAN XML supports attribute signed=“true” to interpret value as signed.

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [September 27, 2023, 11:07am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/3 "2023-09-27T11:07:30Z")

</div>

@realdashdev I am struggling to come up with the xml for this frame 0x25 entry, can you kindly advise

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [September 28, 2023, 10:59am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/4 "2023-09-28T10:59:31Z")

</div>

My best guess with this very limited info would be:

```auto
<frame id="0x25" endianess="big">
  <value targetId="229" offset="0" length="2" signed="true" conversion="V/100*2"></value> <!-- Steering wheel angle -->
</frame>

```

Don’t know amount of degrees your steering wheel on full turns, but you can play with conversion to get it match actual degrees.

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 7, 2023, 7:52am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/6 "2023-10-07T07:52:36Z")

</div>

value targetId=“229” startbit=“3” bitcount=“12” units=“deg” endianess=“big” signed=“true” rangeMin=“-500” rangeMax=“500” conversion=“V\*1.5”\>\</value

I ended up honing in on this 2-bit value, which at centre is 0, and turning left increments positively from 1, but turning right decrements negatively from 767, not sure how I can get this to show as -1 onwards?

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [October 9, 2023, 5:55am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/7 "2023-10-09T05:55:01Z")

</div>

What was wrong with my proposal?

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 9, 2023, 2:07pm UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/8 "2023-10-09T14:07:13Z")

</div>

Yours does exactly the same, except it increments from 1 turning left and decrements from 82 turning right. I believe only 12-bits are used, hence mine eliminated the unused bits.

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [October 9, 2023, 2:21pm UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/9 "2023-10-09T14:21:48Z")

</div>

Discarding first two bits only degrades the precision of the value. I think you are in wrong track.

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 9, 2023, 3:41pm UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/10 "2023-10-09T15:41:07Z")

</div>

I am eliminating 4 bits, which if I look at some of the Toyota DBC’s I have found suggest these bits are used for something else, SSA below is the 12 bit steering angle

BO\_ 37 STR1S01: 8 CGW  
SG\_ STS3 : 7|1@0+ (1,0) [0|0] “” AFS,BSR,DS1,FCM,MAV  
SG\_ STS2 : 6|1@0+ (1,0) [0|0] “” AFS,DS1,FCM,KSS,MAV,SCS  
SG\_ STS1 : 5|1@0+ (1,0) [0|0] “” AFS,BSR,DS1,FCM,KSS,MAV,SCS  
SG\_ STS0 : 4|1@0+ (1,0) [0|0] “” Vector\_\_XXX  
SG\_ SSA : 3|12@0- (1.5,0) [0|0] “deg” AFS,BSR,DS1,FCM,KSS,MAV,SCS

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [October 9, 2023, 3:44pm UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/11 "2023-10-09T15:44:16Z")

</div>

I don’t think signed=“true” does anything when you are working on individual bits. You’d be better to read the full 2 bytes as signed, then mask and bitshift as needed on ‘conversion’.

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 10, 2023, 2:36am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/12 "2023-10-10T02:36:50Z")

</div>

value targetId=“229” offset=“0” length=“2” signed=“true” conversion=“V\<\<2”

I believe this would in effect centre the 12-bit value within the 2 bytes, but not sure how to mask?

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [October 10, 2023, 12:50pm UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/13 "2023-10-10T12:50:07Z")

</div>

As I understand you’d like to lose 3 least significant bits, so conversion would be:

```auto
conversion="(V>>3) &amp; 0xfff"

```

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 10, 2023, 1:33pm UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/14 "2023-10-10T13:33:13Z")

</div>

![bitpos](https://forum.realdash.net/uploads/default/original/1X/840d155c41f872a5d4eb9824220e9c9410e38a97.png)

I am attaching screenshot of bits needed, this is the 4 most significant bits I need to mask?

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [October 11, 2023, 5:18am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/15 "2023-10-11T05:18:13Z")

</div>

If it really is like that, you need to take second byte and bitwise or the 4 LSB from the first byte:

```auto
conversion="B1 | ((B0 &amp; 0xf) << 8)"

```

---

<div class="post-metadata">

**Author:** ![Aleks111](https://forum.realdash.net/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@Aleks111](https://forum.realdash.net/u/Aleks111)\
**Post date:** [October 13, 2023, 6:00am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/16 "2023-10-13T06:00:29Z")

</div>

Hello. Help with XML.

---

<div class="post-metadata">

**Author:** ![realdashdev](https://forum.realdash.net/user_avatar/forum.realdash.net/realdashdev/32/6_2.png) [@realdashdev](https://forum.realdash.net/u/realdashdev)\
**Post date:** [October 13, 2023, 6:01am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/17 "2023-10-13T06:01:41Z")

</div>

What kind of help would you require?

---

<div class="post-metadata">

**Author:** ![Aleks111](https://forum.realdash.net/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@Aleks111](https://forum.realdash.net/u/Aleks111)\
**Post date:** [October 20, 2023, 6:58am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/18 "2023-10-20T06:58:19Z")

</div>

Hello. Help with the XML setup . Code from kanbus to come 00000191: 02 00 00 00 00 00 00 00. The panel does not see the signal .

```
<frame id="0xF191">	 
	<value targetId="93" offset="0" length="1" conversion="V" ></value> <!-- Button 1 Dummy 01 -->
	<value targetId="94" offset="1" length="1" conversion="V" ></value> <!-- Button 2 Dummy 02 -->
	<value name="OilpresU" offset="3" length="1" conversion="V" ></value>
	<value name="Brake_Fluid" offset="2" length="1" conversion="V" ></value>
	<value targetId="178" offset="2" length="1" conversion="V" ></value> <!-- Brake Fluid Level -->
	<value name="FrontFogLightU" offset="4" length="1" conversion="v" ></value>
	<value name="GasBenzU" offset="5" length="1" conversion="v" ></value>
	<value name="WaterLevelU" offset="4" length="1" conversion="v" ></value>
	<value name="CNT" offset="7" length="1" conversion="v" ></value>
 </frame>

```

---

<div class="post-metadata">

**Author:** ![Aleks111](https://forum.realdash.net/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@Aleks111](https://forum.realdash.net/u/Aleks111)\
**Post date:** [October 20, 2023, 7:01am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/19 "2023-10-20T07:01:34Z")

</div>

line. WetetLeveIU , which is needed.

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 20, 2023, 8:56am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/20 "2023-10-20T08:56:51Z")

</div>

Could be the F in the frame id? Surely this should just be “0x191”

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [July 20, 2024, 9:52am UTC](https://forum.realdash.net/t/steering-angle-canbus/3816/21 "2024-07-20T09:52:42Z")

</div>

Inspired by @Cl_eav posting on this subject, I finally got around to resolving the steering angle for my Toyota FJ with following entries:

```auto
<value targetId="93" offset="0" length="1" signed="true" conversion="(V>>3)*2-1"></value>
			<!--Comment = Steering Wheel Direction (Dummy 01) -1 = straight / left counterclockwise and 1 = right clockwise-->
			<value targetId="229" offset="0" length="2" units="deg" signed="true" conversion="180*(ID93) + 180 - (V &amp; 4095) * 0.087891"></value>
			<!--Comment = Steering Angle (-30 degrees to + 30 degrees)-->

```

This gives -30 degrees for full left and +30 degrees for full right
