Login Register

WIP: Heads up display for P80

Help, Advice and DIY Tutorials on Volvo's P80 platform cars -- Volvo's 1990s "bread and butter" cars -- powered by the ubiquitous and durable Volvo inline 5-cylinder engine.

1992 - 1997 850, including 850 R, 850 T-5R, 850 T-5, 850 GLT
1997 - 2000 S70, S70 AWD
1997 - 2000 V70, V70 AWD
1997 - 2000 V70-XC
1997 - 2004 C70

Post Reply
User avatar
xanthefin
Posts: 444
Joined: 4 May 2019
Year and Model: 1997 850
Location: Pluto
Has thanked: 106 times
Been thanked: 130 times

Re: WIP: Heads up display for P80

Post by xanthefin »

When there is pulses and Atmel i love to use interrupts routines for them.
For that parallel processing.. my 'CNC' Atmega168 i need move to ARM as after measuring volts, amps, and 1000 pulse rotary encoder for y axis to measure depth and show all in oled screen with good refresh rate it mostly runs okay still but as it would need still add motor controls my memory is hitting the roofs already.. worst problem then is 8bits chips can't do maths with decimal place without hacking around due bit limits as they loses precision when dividing some values.

For that 12V conversion you can use too a NPN signal transistors and or if really rough like i did on Radio communication then high value resistor with zener diode. Surely not so good silicone protection then but..?

:)

yanga001
Posts: 787
Joined: 24 March 2019
Year and Model: 98/99/00 v/s70’s
Location: Ontario
Has thanked: 59 times
Been thanked: 110 times

Post by yanga001 »

xanthefin wrote: 30 May 2021, 05:51 When there is pulses and Atmel i love to use interrupts routines for them.
For that parallel processing.. my 'CNC' Atmega168 i need move to ARM as after measuring volts, amps, and 1000 pulse rotary encoder for y axis to measure depth and show all in oled screen with good refresh rate it mostly runs okay still but as it would need still add motor controls my memory is hitting the roofs already.. worst problem then is 8bits chips can't do maths with decimal place without hacking around due bit limits as they loses precision when dividing some values.

For that 12V conversion you can use too a NPN signal transistors and or if really rough like i did on Radio communication then high value resistor with zener diode. Surely not so good silicone protection then but..?

:)
I completely forgot about the floating point calculation limitations thanks for that! I am not too worried on the time floating point math would take as i should max out at roughly 400-500 pulses per second and am more worried about how long the SPI comms will take for the crystal display.

I will test it with some boards i have kicking around and worst case will just use two boards one for SPI and one to preprocess the pulses. Cost wise is 2.73$ canadian pesos per chip + power which is shared amongst the chips.

I think it will be a matter of test first, see what issues come, and then go. I imagine for CNC's its far faster and had a friend who switched to teensies as they use the cortex M chips. Something i am a bit more familiar with and may end up switching too.

Thanks for the help! Hoping to bang out a system level design today.
1998 S70 N/A Auto (Parts car)(planned to be harvested)
1998 V70 N/A Auto New full restoration project (Water pump thrown at 404K Km)
1998 V70 N/A Auto (Workhorse) (Tree to driver B pillar :( )
1999 S70 T5 Auto(Project) (planned to be fixed)
2000 S70 SE M Learning platform (planned to be driven one day)
2008 S60 2.5T Auto (Sold)
2012 Honda Pilot AWD Touring (Daily)

yanga001
Posts: 787
Joined: 24 March 2019
Year and Model: 98/99/00 v/s70’s
Location: Ontario
Has thanked: 59 times
Been thanked: 110 times

Post by yanga001 »

I just realized, i do not need floating point division. I will not be looking at fractions of a kmh and will just scale up all my calculations to be a nice integer multiplication and division. Worst case i will lose accuracy of 1 kmh so i will take it as a win!
1998 S70 N/A Auto (Parts car)(planned to be harvested)
1998 V70 N/A Auto New full restoration project (Water pump thrown at 404K Km)
1998 V70 N/A Auto (Workhorse) (Tree to driver B pillar :( )
1999 S70 T5 Auto(Project) (planned to be fixed)
2000 S70 SE M Learning platform (planned to be driven one day)
2008 S60 2.5T Auto (Sold)
2012 Honda Pilot AWD Touring (Daily)

yanga001
Posts: 787
Joined: 24 March 2019
Year and Model: 98/99/00 v/s70’s
Location: Ontario
Has thanked: 59 times
Been thanked: 110 times

Post by yanga001 »

image.jpg
Pulled out my reference unit for checks. I’ll probably pull power off the spare accessory connector below the dash. I think I finalized the components and will start on the board design this week
Attachments
image.jpg
1998 S70 N/A Auto (Parts car)(planned to be harvested)
1998 V70 N/A Auto New full restoration project (Water pump thrown at 404K Km)
1998 V70 N/A Auto (Workhorse) (Tree to driver B pillar :( )
1999 S70 T5 Auto(Project) (planned to be fixed)
2000 S70 SE M Learning platform (planned to be driven one day)
2008 S60 2.5T Auto (Sold)
2012 Honda Pilot AWD Touring (Daily)

yanga001
Posts: 787
Joined: 24 March 2019
Year and Model: 98/99/00 v/s70’s
Location: Ontario
Has thanked: 59 times
Been thanked: 110 times

Post by yanga001 »

Started laying out the board today, am thinking of adding some redundant I/O and maybe 1-2 I2C ADC's for later additions.

Decided to breakout the LED's onto another board via a 28 pin header such that different colours of 7 segment displays could be used. The limiting factor in this case is the 2.5V feed required for the selected green 7 segment displays. Going to see if i can find a few more compatible 7 segment displays for this design.

Designed for an ATMEGA328 but will switch to 168 as the pinouts are identical and i do not forsee memory issues.

Aside from that i have the power laid out in a manner i think works and am working on the signal outputs.
1998 S70 N/A Auto (Parts car)(planned to be harvested)
1998 V70 N/A Auto New full restoration project (Water pump thrown at 404K Km)
1998 V70 N/A Auto (Workhorse) (Tree to driver B pillar :( )
1999 S70 T5 Auto(Project) (planned to be fixed)
2000 S70 SE M Learning platform (planned to be driven one day)
2008 S60 2.5T Auto (Sold)
2012 Honda Pilot AWD Touring (Daily)

User avatar
Clemens
Posts: 1932
Joined: 3 September 2015
Year and Model: 96 855 R + 94 855 T5
Location: Austria
Has thanked: 473 times
Been thanked: 219 times

Post by Clemens »

I'm bewildered and amazed by what I read. Good luck with this project!
Summer: 1996 855 R
Winter: 1994 855 T5M
Donor: 1995 854 10V

yanga001
Posts: 787
Joined: 24 March 2019
Year and Model: 98/99/00 v/s70’s
Location: Ontario
Has thanked: 59 times
Been thanked: 110 times

Post by yanga001 »

Got some time to work on the HUD again.

Wrote some pseudo code such that i know how to calculate the speed based on the pulse out. The plan is to use an 8 bit timer to count 10 input pulses and couple that with a 16 bit timer which calculates the time between 10 pulses. I chose 10 as 3 km/h on 205/16/R15 with 12 pulses per rev comes to roughly 5892 pulses/km. For 3km/h it approximates to 4.91 pulses per second. If i use a 1024 prescaler on 16mhz chip then i get a clock of roughly 15625 Hz which has a period of 64 microseconds. When doing the maximum possible speed (250 KM/H for a turbo sedan) then i get roughly 409 pulses per second or a time of 24.4 miliseconds. Between each km/h i have atleast a 4-5 count difference on the 16 bit timer which means that i can reliably round to a km/h for both high and low speed.

In terms of programming i will trigger an interrupt on the 10th pulse of the 8 bit counter which will check the count on the 16 bit counter. Then it will do the conversion to get KM/h from the pulse count and then reset both counters. I should not run into any overflow issues going by this method, and keeping a single reset interrupt should eliminate any race conditions.

The math was all done in a notebook and was roughly translated over to here.

In terms of the wiring, i am doing 2 boards; one board which will contains the logic conversion and controller, and a second board with the displays. This was done to allow for multiple LCD colours and sizes.

Will post more coming this week, hoping to finish the board and order it soon.

Another feature to be added will be a tire size selector to allow for use on both winter/summers/R design rubber bands.
1998 S70 N/A Auto (Parts car)(planned to be harvested)
1998 V70 N/A Auto New full restoration project (Water pump thrown at 404K Km)
1998 V70 N/A Auto (Workhorse) (Tree to driver B pillar :( )
1999 S70 T5 Auto(Project) (planned to be fixed)
2000 S70 SE M Learning platform (planned to be driven one day)
2008 S60 2.5T Auto (Sold)
2012 Honda Pilot AWD Touring (Daily)

User avatar
abscate
MVS Moderator
Posts: 35284
Joined: 17 February 2013
Year and Model: 99: V70s S70s,05 V70
Location: Port Jefferson Long Island NY
Has thanked: 1502 times
Been thanked: 3817 times

Post by abscate »

Another feature to be added will be a tire size selector to allow for use on both winter/summers/R design rubber bands.
That’s excellent for those of us who swap winter/summer
Empty Nester
A Captain in a Sea of Estrogen
1999-V70-T5M56 2005-V70-M56 1999-S70 VW T4 XC90-in-Red
Link to Maintenance record thread

User avatar
ZionXIX
Posts: 1310
Joined: 11 August 2014
Year and Model: 1996 850 Turbo S/W
Location: Texas
Has thanked: 64 times
Been thanked: 194 times

Post by ZionXIX »

I think what you're doing here is awesome. Your project inspires me to pickup my own volvo project that have been placed on indefinite hold.
Scarlett: 1996 850 Turbo Wagon in Reagent Red Pearl ~210K mi
Norman: 2012 F150 XLT Crew Cab in Oxford White ~110K mi
Ember: 2005 XC90 2.5T FWD in Ruby Red Metallic ~83K mi *Newest addition to the fleet*
Ruby: 1997 850 Turbo Wagon in Reagent Red Pearl - parts car
Rose: 2020 Ram 1500 in Delmonico Red Pearl - SWMBO's Vehicle

yanga001
Posts: 787
Joined: 24 March 2019
Year and Model: 98/99/00 v/s70’s
Location: Ontario
Has thanked: 59 times
Been thanked: 110 times

Post by yanga001 »

Reviving this with the first progress in a long while. Decided to switch to a lumisil IS31FL3239 as they are in stock. Also dumbed it down a bit and may try to code this in the arduino IDE to ease my way into it. Later iterations will be coded in AVR but for now i want to do this one step at a time to make sure it actually gets done.

The lumisil chip does not support external voltage setting of the output voltage like the PCA chip and the 7 segment displays i want run at a bit of an awkward voltage. Therefore, i will use a regulator prior to the input to the chip to simply step down the voltage to one that is supported by the 7 segment display. I need to write the pseudo code and verify i can do the necessary tasks on a normal arduino uno (328{ is the same on it). Gotta fire up the function generator and feed out pulse trains similar to the lowest speed, medium speed, and highest speeds. If i can get the device to read the input train, translate the speed, and fire it to serial monitor all at once then i will count it as a great win. I will still put in the button selectors using a table for the appropriate wheel diameters or encodings. I will also add in another 4 microswitches to select for the brightness of the device. It is a bit butchered of an implementation at the moment however i want to stay away from things that will reset when the car is turned on and off.

Today i got back into it by making the PCB library for the lumisil chip and placing it in the schematic. Finishing the design will be a later task given the modified coding strategy.

The plan of attack is the following:
-write the pseudo code
-test pulse counting with a normal arduino and a function generator
-test translation of pulses counted
-test outputs in said manner
-test sending data across and timing
-test with outputs, and data timings and translation
-develop matrix for the tire sizing and for brightness
-if this works continue to the next step
-finish board bringup with new buttons and requirements for basic implementation
-order board
-build board
-test boards 2-3 weeks of testing required
-write a manual
-write assembly instructions

I give it a few months given how delayed this project has already been, however I believe the more realistic timeline, coding requirements, and parts selection should ensure it will get done. I previously got stuck on AVR coding semantics and implementation before dropping it.
1998 S70 N/A Auto (Parts car)(planned to be harvested)
1998 V70 N/A Auto New full restoration project (Water pump thrown at 404K Km)
1998 V70 N/A Auto (Workhorse) (Tree to driver B pillar :( )
1999 S70 T5 Auto(Project) (planned to be fixed)
2000 S70 SE M Learning platform (planned to be driven one day)
2008 S60 2.5T Auto (Sold)
2012 Honda Pilot AWD Touring (Daily)

Post Reply
  • Similar Topics
    Replies
    Views
    Last post