Notices

data sampling suspension on the can bus?

Thread Tools
 
Search this Thread
 
Old 09-25-2023 | 06:16 AM
  #16  
edub's Avatar
edub
Thread Starter
Pro
 
Joined: Feb 2021
Posts: 731
Likes: 352
Default

Alright so a setback of sorts.

I did a bunch of research into the wheel sensors on the car - the short version is they send a 800Hz PWM (pulse width modulation) signal to a system on chip (SOC) in the PASM (or DSC) controller. I think the SOC performs sampling at a high enough rate to smooth out the square wave from the PWM and interpret it as a voltage, or it can register a PWM duty cycle, and converts that to a math channel of millimeters of movement and mm/s of velocity.

So my problem is I need to find a way to interpret the PWM signal as a duty cycle reading or convert it to a voltage that I can map to suspension movement. Another option is to modify the DSC controller so that it outputs it's math channels either over CANbus or maybe a serial port. CANbus seems like a bad idea simply because of the bandwidth requirements I looked at previously, and for serial port I have similar concerns.

Slightly frustrating that there is a perfectly good quality signal there I just lack the means to utilize it.
Old 10-23-2023 | 01:07 AM
  #17  
Squeaky's Avatar
Squeaky
Instructor
 
Joined: May 2018
Posts: 236
Likes: 38
Default

following
Old 10-27-2023 | 08:53 PM
  #18  
edub's Avatar
edub
Thread Starter
Pro
 
Joined: Feb 2021
Posts: 731
Likes: 352
Default

Right now I'm exploring using an Arduino with PWM capture to tap the inputs on the PASM computer (or DSC controller).
Spoiler
 
some POC code for capturing the PWM signal on digital pin 9 at 800Hz may work. Each wheel sensor would need a digital pin input, there are quite a few example Arduino boards that can work, I currently have a Beetle (Leonardo model) but it only accepts 3 PWM inputs. Easily solved with by getting a board with more inputs.

Anyway - I will try to set this board up with my wheel sensors when I get back to the car and see if I can sample the signal. If that works the next step would be to output it to either a GPIO analogue signal or dump the signal to CANbus and just read it with the data logger. Both methods may have issues with bandwidth or timing.

I really didn't want to go the path of adding more hardware, but for the price it might be the right way to capture this. Reversing compiled code without symbols and function names from the microcontrollers is completely possible but likely to be a lot of work.
The following users liked this post:
Josh_357 (11-02-2023)
Old 11-11-2023 | 05:31 AM
  #19  
edub's Avatar
edub
Thread Starter
Pro
 
Joined: Feb 2021
Posts: 731
Likes: 352
Default

I believe I've captured the suspension sensor using an Arduino.

&

I need to hookup to the PIWIS or DSC and map the position against the duty cycle I capture in the Arduino.

There are a few more things to validate before I have a working solution:
  • map the pwm duty cycle against PIWIS suspension sensor output and DSC wheel sensor output
  • double check my math for sensor sampling and sample rate is correct (I assume its based on the Arduino micros() function timing which is 1000 samples a second)
  • determine the effective sample frequency that the Arduino can monitor suspension sensors. My rough estimate (really rough) was ~636 samples a second on average. Fast enough for suspension logging.
  • determine how to output the sampling to CANbus, or analogue voltage for the data logger
  • calculate the effective bandwidth impact of putting this on CANbus (it might be too noisy to put on a shared gateway with other vehicle services)

I'm a little concerned that the range in which I moved the sensor does not generate enough data points. It feels like 400-800 is the effective range I the suspension may be able to move in the wheel well. That's not very many steps to measure with


Last edited by edub; 11-11-2023 at 08:01 PM.



Quick Reply: data sampling suspension on the can bus?



All times are GMT -3. The time now is 03:29 PM.