Change font size


Post a new topicPost a reply Page 1 of 2   [ 18 posts ]
Go to page 1, 2  Next
Author Message
 Post subject: Arduino project to scale Steering Angle Sensor output
PostPosted: Sun Apr 02, 2017 12:14 am 
User avatar

Vehicle: MY12 S-Edition Marine Blue

Posts: 87
Location: Sydney, NSW
Some of us who have installed 2015 STI steering racks in to SH Foresters, there is an issue where the VDC kicks in, applying the brakes during tight turns.

I spoke to Subaru Aus and they told me that SH Foz's and the 2015 STI use the same angle sensor part number. I've heard conflicting reports about this from other sources but the official word I got was they are the same.
The steering angle sensor tells the VDC unit what angle the STEERING WHEEL is currently at. The VDC unit must then apply a ratio to this angle to determine where the wheels are pointing. The VDC unit uses this information to determine when the car is out of control by comparing the G/Yaw sensors with the wheel angle and individual wheel speeds. If the car is changing direction faster than the VDC unit expects it should be able to with the current wheel angle, it applies brakes and does its other magic things to try and correct it.

This is a problem is due to the VDC unit having a fixed steering ratio built in but we are now using a faster rack. I haven't seen or heard of a way of modifying this ratio through software or flashing.
One option I considered was swapping the SH Forester VDC unit to the 2015 STI VDC unit, matching it with the rack. I decided against following this due to a few factors, the first being the prices quoted from wreckers for VDC units were $350-$400, plus the uncertainty over if it would be compatible with the rest of the Forester sensors and systems. I couldn't find anyone who had done this swap.

I found this post on NASIOC which describes the solution I ultimately used, using an Arduino to intercept and scale the steering angle sensor output.
The information available was severely limited to just the concept itself, no details on his device were available and I wasn't able to get a response from him so I had to recreate it from scratch.

------------------------------------------------
Please note, if you're not comfortable with a soldering iron or are absolutely clueless with computers(specifically programming), this project may not be for you. Don't let this dissuade you though as the build does not need to be as complex as what I've done. Use your own judgement on your capabilities before you try this project (call in a few favours?)
I also provide no Guarantee that this project will suit any car and/or steering rack other than my own. If you choose to create this for yourself, I am willing to assist but I'd prefer not to be blamed if things don't work the same as I experienced.
I'm not an electrical engineer nor a software developer, just a hobbyist, so any of you out there that meet those definitions are free to improve on what I've done.
------------------------------------------------

Here is a brief description of my Arduino unit:
An Arduino Uno R3 board with 2 CAN bus shields, one shield hooked into the car CAN bus and the other hooked to the steering angle sensor, which has been disconnected from the car CAN bus. The Arduino takes CAN bus messages sent by the sensor and scales it up before transmitting the message to the car.

Here is the unit on the desk, waiting to be installed: http://tinypic.com/m/jjwobr/3
Here it is installed in the car, under the dash: http://tinypic.com/m/jjwoec/3 - Note the grey enclosure in the top left corner. That's the OBD-II connector dead middle of the picture.

For more images of the project, check this tinypic album: http://tinypic.com/a/fk5mvb/3

Tools used:
    1. Soldering Iron
    2. Desoldering Pump
    3. SMD Rework hot air blower
    4. Screwdrivers/wire cutters/strippers/pliers, standard hand tools
    5. Dremel for modifying the enclosure
    6. Multimeter for identifying car circuits and testing
    7. Hot glue gun for some part assembly

This is the list of materials and approx cost of what I used.

Mandatory components:
    1x Arduino Uno R3 - $40 from Core Electronics
    2x DFRobot CAN-BUS Shield V2.0 - $80 from Core Electronics
    1x Shield stacking headers for Arduino (R3 Compatible) - $3 from Core Electronics - You need this for the 3x2 header
Using just these, you can assemble and use this project if you wire/tap everything you need. This would be similar to what the NASIOC post looks like.

Optional/Tidying components:
    1x Set of Steering Angle Sensor Male and Female plugs - I had a broken steering angle sensor (replacement bought with clock spring from Pick'N'Payless for $75) and cut the plugs off - means I didn't have to tap anything for the sensor.
    1x LM2596 Voltage Regulator DC-DC Buck Converter Adjustable Step Down Module - $12 for 5 on eBay
    1x ABS SEAL BOX 115X65X55 WITH FLANGE G308MF - $11 from Jaycar
    1x 5VDC 30mm Thin 2 Wire Fan - $14 from Jaycar
    1x 6 Pin Miniature Nylon MOLEX-Type Connector - $4 from Jaycar
    1x Self-closing Braided Wire Wrap - 6mm x 2m - $7 from Jaycar
    1x Piezo Buzzer from an old PC Motherboard (Similar to "Mini PC Mount Buzzer 9-14V" from Jaycar except works fine at 3v[Jaycar one might even work, don't know]) - salvaged
    2x Posi-Tap EX-110M - bought from eBay in bulk ages ago, quick search shows $13 for a pack of 6
    Various lengths of coloured wire and heat shrink. Main wire used is "13x 0.12mm hookup wire" from Jaycar - had these on hand already
    Foam tape for the back of the enclosure to prevent rattling - random single sided foam tape I had in a drawer
    Large cable tie to secure the enclosure to the car - had these on hand already
    39 ohm resistor to limit the fan's speed
    2x 1N5822 Schottky Diodes - $7 from Jaycar (for 10) - used to tap 2 power sources and prevent backflow

Optional component tips:
    1. Fan in enclosure. I put this in just to make myself feel special, might not be necessary if you just cut some slots to ventilate the enclosure. If you choose a different enclosure or forego one entirely you also may not need one.
    2. Buzzer. I installed a piezo buzzer and set the Arduino to beep when it had finished booting. One of the important things when powering up the car is to wait a moment at ACC power before turning the ignition to ON or START. If the Arduino hasn't completed booting when you swap to ON, VDC will be disabled until you shut off the car and let it start up properly. Only takes a second but you might sometimes jam the key in and turn straight to start.
    3. Power supply. My solution draws power from both ACC and ON power sources. I wasn't able to find an ACC power source that didn't cut when cranking so I used 2 diodes to draw from both wires. I'm tapping the ACC power to head unit and the power window supply. Both taps can be seen in the image album, I got my cable colours around the wrong way, yellow lead tap is ON/power windows, red lead tap is ACC/head unit. If anyone knows of an ACC-switched power source that doesn't cut when cranking this could be an alternate solution. I also considered using a relay and capacitors to bridge the crank power gap.

The Arduino sketch I'm using will be freely available once I've done a bit more final testing and cleaned it up a bit.

I've chosen not to do a step by step build due to there being many different ways of achieving this same goal and that I made up a lot of this as I went. A lot of things I did on a whim and I had to re-do a few things later on (wish I could un-shrink heat shrink then re-shrink...)
I modified the CAN bus boards by removing the serial ports and repositioning the CAN bus wire inputs, as well as using the top CAN bus board to hold the fan power plug and piezo buzzer. This isn't absolutely necessary but it let me fit it all in to the enclosure.

Let me know if you guys have any questions.

_________________
MY12 S-Edition - Gallery thread hopefully coming soon


Last edited by hired-goon on Sat Nov 17, 2018 8:35 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Sun Apr 02, 2017 1:31 am 
User avatar

I Say: Car mods are like OddBodz, you got to collect them all! -------------------------------------
Vehicle: MY05 STi swapped sled

Posts: 17786
Location: Spearwood Perth WA
Sounds impressive. I think you will be getting an influx of PMs from SH members over the next few days.

Forgive my ignorance. But what about the programming of the Arduino? Programming that surely is a pretty major undertaking?

_________________
>>>My Ride<<<


Image


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Sun Apr 02, 2017 1:33 am 
User avatar

I Say: Car mods are like OddBodz, you got to collect them all! -------------------------------------
Vehicle: MY05 STi swapped sled

Posts: 17786
Location: Spearwood Perth WA
On a side note. Totoally unrelated to this. Can you build a Aurduino box that can intercept the VSS signal from CAN-BUS, and output it as a conventional VSS digital signal? (On Ford rangers) if so i could be very interested in knowing how to do this.

_________________
>>>My Ride<<<


Image


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Sun Apr 02, 2017 1:46 am 
User avatar

Vehicle: MY12 S-Edition Marine Blue

Posts: 87
Location: Sydney, NSW
The programming for the Arduino is something I'll make available for those that want it shortly, just need to clean it up a bit.
I've written it to be usable by most people without needing to understand everything that's going on.

Regarding making an Arduino to convert a CAN VSS message to a digital format, it should be possible but it's not something I'd know how to do without properly researching. This project was my first voyage through Arduino/CAN territory.

_________________
MY12 S-Edition - Gallery thread hopefully coming soon


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Mon Apr 10, 2017 7:15 pm 
User avatar

Vehicle: MY12 S-Edition Marine Blue

Posts: 87
Location: Sydney, NSW
I've upload the Arduino sketch to pastebin: https://pastebin.com/GQy640Vn

_________________
MY12 S-Edition - Gallery thread hopefully coming soon


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Sat Apr 15, 2017 10:55 am 
User avatar

I Say: Stop BSL. Breed Specific Legislation. Bull Sh!t Law
Vehicle: MY10 XT/STi partial swap

Posts: 4061
Location: Melburn
nice work mate. :thumbs:

_________________
the build

My Tonka Truck

My 2-door STi racecar

Breed Specific Legislation (BSL) kills innocent dogs, stop this Bull Sh!t Law. Punish the deed, not the breed!!!


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Mon Apr 17, 2017 1:45 am 
User avatar

Vehicle: JDM SF STi Pure White

Posts: 154
Location: Germany
@hired-goon: Would you mind if i pushed the code to github under my username? Pastebin is not the best place for a well done job like that.

Of course, if you're willing to create or already have a github account, it'd be better if you'd upload it yourself.


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Mon Apr 17, 2017 2:21 am 
User avatar

Vehicle: MY12 S-Edition Marine Blue

Posts: 87
Location: Sydney, NSW
Phrewfuf, go ahead.
I don't have a github account nor currently have any intention of creating one.

_________________
MY12 S-Edition - Gallery thread hopefully coming soon


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Mon Apr 17, 2017 2:59 am 
User avatar

Vehicle: JDM SF STi Pure White

Posts: 154
Location: Germany
Awesome, here you go:

https://github.com/Phrewfuf/sas-scaler


Top
 Profile  
 
 Post subject: Re: Arduino project to scale Steering Angle Sensor output
PostPosted: Wed Jul 19, 2017 12:51 am 
User avatar

Vehicle: MY12 S-Edition Marine Blue

Posts: 87
Location: Sydney, NSW
So this has been running in my car full time for 3 months with no issues.

A side benefit of this is the on-demand VDC disable by starting the engine without pausing on ACC for a moment. No need to unplug anything so makes it great if you're taking your daily to any events.

_________________
MY12 S-Edition - Gallery thread hopefully coming soon


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 2   [ 18 posts ]
Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
"Takka LE" for phpBB3