Author Topic: Average car contains 100 million lines of code, The State of Autosoftware  (Read 7062 times)

0 Members and 1 Guest are viewing this topic.

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #50 on: January 27, 2023, 07:27:25 am »
Yep a lot of people just completely freeze in emergency situations. They are not sure what to do in the stress of it all, so they end up doing nothing, or doing one thing over and over and over.

Because of this quite a few unintended acceleration events can be attributed to the driver simply mixing up the brake and throttle pedals. Something happens like an obstacle or taping the accelerator while thinking they are on the break, they panic and as the default response slam on the brake pedal as hard as they can...however there foot ends up being above the accelerator pedal. The car starts going faster they panic even more and press the pedal even harder, up until they end up crashing into a wall.

In the event of an bug in the ECU making the car go full throttle can indeed be stopped in a whole range of ways. Like you can turn the key (tho this doesn't directly kill power to everyiyng, ECUs shut down with a delay to have time to safely save data), you can press in the clutch, if you have an automatic you can shift it into neutral. stomping on the brakes hard will bring a car to a stop even if its hurtling down the highway at full throttle...etc But the driver has to think of one of those and do it, yet most people have no idea how a car actually works, so they have no idea what to even do. As far as they are concerned the car is actively trying to kill them and they can't do anything because the car is not acting normal.

Handbrake probably can't stop a engine at full throttle, but even this thing is now electronic. You press a button and a little motor does its whirly business back there to actually apply the 'handbrake'. It is not even a hardwired switch that gives it power directly, it is soft button that tells electronics to do it. Cars also don't have keys anymore, but the ones with a start button typically have a safety feature that it will do an emergency shutdown if you hold the button or press it 3 times quickly or something while the car is on. Id prefer to have the oldschool key and mechanical handbrake.

Because everyone has a car these days, there will always be dumb drivers that do dumb things.
« Last Edit: January 27, 2023, 07:30:08 am by Berni »
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3707
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #51 on: January 27, 2023, 07:45:33 am »
... Cars also don't have keys anymore, but the ones with a start button typically have a safety feature that it will do an emergency shutdown if you hold the button or press it 3 times quickly or something while the car is on. Id prefer to have the oldschool key and mechanical handbrake.

Our new car does indeed have a start/stop button, but the handbrake seems to be old fashion mechanical. There is a lever for it.

It took a bit of time to get used to the start/stop button. The act of sticking the key in the lock was burnt into muscle memory  :-DD

Because everyone has a car these days, there will always be dumb drivers that do dumb things.

Yep, certainly true.

Offline MadScientist

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: 00
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #52 on: January 27, 2023, 09:19:45 am »
Some people seem to find adapting to slightly different systems very difficult !!
EE's: We use silicon to make things  smaller!
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #53 on: January 27, 2023, 11:42:20 am »
Oh yes, but it isn't really compatible with the agile methods in general, which have plagued the industry.
This is less obvious in heavily regulated fields (such as automotive, medical), but still has some impact at many places.
Depends on the way Agile is practiced but yes I have seen manager driven SAFe trains that were forced to deliver a lot fast and quality second. The whole SAFe basis is that the teams are enforced to say no esp. when quality is compromised. The teams should be empowered.
So I would say that esp. companies that claim they work SAFe but actually are doing management driven forced waterfall way of working are just bullsh*tting themselves. It is up to the teams to fight back or quit.


Well, software programming has gone downhil too IMHO in general.
I agree, no wonder since the general thought of hiring managers still seems to be that every smart educated person can be a good software engineer. "Hey I am a chemist but have programmed some python interface at home for Home Assistent" "You're hired!"
As if they would do this for airplane pilots? "Hey I used MS Flightsim at home" "You're hired!"
So no wonder SW engineers in general are seen as monkeys, there are a lot of them. But there are real skills and trainings for a good SWE and many fields of experience. You can not generalize the same as digital fpga engineers are different from MW power electronic engineers, there are many many specializations in software as well.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #54 on: January 27, 2023, 12:09:46 pm »
Yeah i also find that it is easy to find someone who can program, but very difficult to find someone who is actually properly good at it.

They also hire software developers depending on if they can invert a binary tree (that they did many times in school) or use some web framework that is trendy that particular month. They might know how to use a C++ class, but not how to set up the architecture of there code using classes in a clean well done way.
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6707
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #55 on: January 27, 2023, 03:06:44 pm »
I see that 1996 Corolla did have a key (as expected in that day and age) so I wonder why didn't he use it to turn it off or maybe it was so quick when it accelerated that he didn't have a chance despite pushing the breaks.

A lot of people freeze in an emergency situation and the only response is the foot on the break or no response at all. My response in car emergency situations is the handbrake, which I believe still to be fully mechanical on most cars. Might not do a lot when full throttle drive is on the wheels, but it did help us a while back when the wife responded a bit late on the highway and traffic in front was coming to a halt. As a passenger I tend stay alert and in driving mode  :-DD

See also: accelerator/brake confusion is common in automatic cars.  If a driver presses what they think is the brake and the car goes faster, an instinctive reaction might be to press the 'brake' harder.  In a panic, it's very easy to make a mistake, and not everyone thinks rationally.
 
The following users thanked this post: tooki

Online David Hess

  • Super Contributor
  • ***
  • Posts: 16617
  • Country: us
  • DavidH
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #56 on: January 27, 2023, 11:04:35 pm »
See also: accelerator/brake confusion is common in automatic cars.  If a driver presses what they think is the brake and the car goes faster, an instinctive reaction might be to press the 'brake' harder.  In a panic, it's very easy to make a mistake, and not everyone thinks rationally.

I have occasionally made that mistake after getting used to driving a manual.  I go to push in the clutch and my left foot catches the edge of the wide brake pedal.  The car brakes, which makes me think I have not pushed the clutch pedal in far enough, so I push harder, and harder, and come to a screeching stop.
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6707
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #57 on: January 27, 2023, 11:16:16 pm »
See also: accelerator/brake confusion is common in automatic cars.  If a driver presses what they think is the brake and the car goes faster, an instinctive reaction might be to press the 'brake' harder.  In a panic, it's very easy to make a mistake, and not everyone thinks rationally.

I have occasionally made that mistake after getting used to driving a manual.  I go to push in the clutch and my left foot catches the edge of the wide brake pedal.  The car brakes, which makes me think I have not pushed the clutch pedal in far enough, so I push harder, and harder, and come to a screeching stop.

At least one advantage of a manual is there's an instinct to declutch and downshift to start slowing, so if you aren't slowing enough while pressing the 'brake', you might just go for the clutch by instinct. Also you need to be a lot more aware of your foot positions to drive a manual, as you use both feet, usually left foot for the clutch and right foot for brake and accelerator.  In an automatic you usually just rest your left foot.

I still like driving automatic, though.  I don't miss the clutch one bit, I know some drivers who say they love manuals, but I reckon a city drive in a good, modern automatic car (or electric/hybrid) would convince them otherwise.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14475
  • Country: fr
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #58 on: January 27, 2023, 11:34:04 pm »
Oh yes, but it isn't really compatible with the agile methods in general, which have plagued the industry.
This is less obvious in heavily regulated fields (such as automotive, medical), but still has some impact at many places.
Depends on the way Agile is practiced but yes I have seen manager driven SAFe trains that were forced to deliver a lot fast and quality second. The whole SAFe basis is that the teams are enforced to say no esp. when quality is compromised. The teams should be empowered.
So I would say that esp. companies that claim they work SAFe but actually are doing management driven forced waterfall way of working are just bullsh*tting themselves. It is up to the teams to fight back or quit.

While some of the agile principles were defined by software developers a long time ago already, mostly to fight against bad management, it quickly turned against them and has been used as a management tool for at least a decade now - more like almost 15 years, I'd say.

As to teams fighting back, from what I've seen, it just doesn't happen.
And for the young developers out there, they don't know any better usually, so they don't even see the problem. Until they burn out, for some of them. The rest will take the cash and move on.

But methods are just means to an end. The end has been to provide increasingly complex systems, at an increasingly fast pace, for the lowest cost possible and at the expense of reliability.
And leaders have seen software as an enabler of all this, due to its apparent extreme flexibility.
Basic rules of physics still apply though. The more flexible something is and the less structure it has, and past a certain point, it will just collapse.
 

Offline josuah

  • Regular Contributor
  • *
  • Posts: 119
  • Country: fr
    • josuah.net
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #59 on: January 28, 2023, 12:28:46 am »
That sounds like a case of making the unexpected even less likely -vs- correctly handling unexpected conditions:

My impression is pointing the programming language is relevant, but the spontaneous conclusion "replace the language" does not cover the full problem:

1. Non-software problems (power electronics, motor control algorithms in any language, ASIC design) have at least as many footguns as risky programming languages. Is there a Rust for Electrical Engineering, Rust for manufacturing?

2. The real solution might not be a language, but an architecture: having a failure (memory safety among many others) less likely to happen (i.e. through language safety) would not replace blocking the propagation of any failure. i.e. a hypervisor, watchdog timers, redundancy, or simply observing the possible affected parts. Although language safety might contribute in favor of this too

Some topical analogy would be saying that to take a passenger safely from point A to point B, more safety mechanisms help, but do not replace careful driving. :-)
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3707
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #60 on: January 28, 2023, 05:11:48 am »
See also: accelerator/brake confusion is common in automatic cars.  If a driver presses what they think is the brake and the car goes faster, an instinctive reaction might be to press the 'brake' harder.  In a panic, it's very easy to make a mistake, and not everyone thinks rationally.

I have occasionally made that mistake after getting used to driving a manual.  I go to push in the clutch and my left foot catches the edge of the wide brake pedal.  The car brakes, which makes me think I have not pushed the clutch pedal in far enough, so I push harder, and harder, and come to a screeching stop.

This reminds me of our first holiday we had in the states. We hired a car and it was an automatic. Driven only manuals up to that point, so the leaving of the parking lot was a bit shaky me trying to push the clutch that was not there but hitting the brake with force. This because your left foot is used to push with force straight down, where as your right foot is gentle in applying pressure to the brake  :-DD

Offline jonovid

  • Super Contributor
  • ***
  • Posts: 1436
  • Country: au
    • JONOVID
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #61 on: January 28, 2023, 05:26:10 am »
having seen the video. a lot of this is about assumptions. that everybody has your best interest at heart.
the HAL 9000 is integrated software at work.
Hobbyist with a basic knowledge of electronics
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3707
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #62 on: January 28, 2023, 05:42:19 am »
That sounds like a case of making the unexpected even less likely -vs- correctly handling unexpected conditions:

It takes thorough analysis of the underlying problems to come up with proper solutions and it might be that the analysis phase is skipped more often. You can't catch every condition because otherwise there would be no unexpected, but with cars being in existence for many years most should be known.

My impression is pointing the programming language is relevant, but the spontaneous conclusion "replace the language" does not cover the full problem:

Relying on a programming language to make your code safe is grounds in itself for errors. It should not matter which language you use to write your program, you have to be aware of the logic and perform proper tests to catch the errors and possible unforeseen results. This refers back to proper analysis.

1. Non-software problems (power electronics, motor control algorithms in any language, ASIC design) have at least as many footguns as risky programming languages. Is there a Rust for Electrical Engineering, Rust for manufacturing?

2. The real solution might not be a language, but an architecture: having a failure (memory safety among many others) less likely to happen (i.e. through language safety) would not replace blocking the propagation of any failure. i.e. a hypervisor, watchdog timers, redundancy, or simply observing the possible affected parts. Although language safety might contribute in favor of this too

I know little about how modern car control systems are set up architecturally, but wonder if they have redundant processors like I have seen in early digital phone switching systems. These used three separate control systems with an arbitrator to select the leading answer.

So yes it is not just software that should be analyzed  when it comes to safety. Hardware is as much a part of it all. To create something truly safe a proper design of all facets is needed, including a full plan for testing those aspects, both hardware and software. This also means designing tests to test the safety features like the watchdog timers.

And this takes times which is where the problem lies, because that costs money.

Some topical analogy would be saying that to take a passenger safely from point A to point B, more safety mechanisms help, but do not replace careful driving. :-)

The one big problem in this is the human factor. There are so many that think they are the best drivers in the world, but in reality are not. Just look on youtube at the videos about idiot drivers. In 40 years of driving I never had an accident, but avoided quite a few with fast reacting to stupid moves from others.

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #63 on: January 28, 2023, 02:23:58 pm »
I have occasionally made that mistake after getting used to driving a manual.  I go to push in the clutch and my left foot catches the edge of the wide brake pedal.  The car brakes, which makes me think I have not pushed the clutch pedal in far enough, so I push harder, and harder, and come to a screeching stop.

Yep did the mistake of pressing the 'clutch' in an automatic before. It gets you stopped real quick indeed.

Part of it is also that you never press the clutch pedal gently. You always just stomp down all the way on it. As a result you don't actually have the muscle memory of being gentle on pedal using the left foot. Go ahead and try to use the left foot to intentionally press the brake pedal. Even if you try to press it slowly gently, you end up pressing it quite a bit harder than you intend., not making for a smooth deceleration at all.

After actually owning an automatic transmission car the clutch problem never happened again. Driving a manual again is no problem (apart from forgetting to down shift  here or there until the engine reminds me to with being unhappy about its low RPM). But yeah driving in the city is so much nicer with an automatic once you experience both sides of the coin. (And it helps when you have the transmissions computer figured out, so that you avoid doing things that confuse it about what gear it thinks it should be in)
 

Offline MadScientist

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: 00
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #64 on: January 28, 2023, 02:40:57 pm »
Given I’ve owned several new cars , I don’t see the problem people are eluding too. Most worked as I expected then including some with elaborate driver aids.

In reality new cars are extremely reliable certainly compared to the rubbish around in my dads time where th engine needed a re-bore after 200,000km  and the body rusted away in a few years

Today I get 7 year warranties ( Kia) and very reliable long lived modern cars despite considerable more complexity etc.

EE's: We use silicon to make things  smaller!
 
The following users thanked this post: tooki

Offline MadScientist

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: 00
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #65 on: January 28, 2023, 03:05:38 pm »
Yeah I bet you don't run the factory battery in that Kia though. My neighbour bought a Kia about 7 years ago and shes had to replace the battery twice and call out the mechanic twice until I mentioned to her that she should get an AC Delco or Bosch battery for it.

Its been solid ever since.

Can’t say what battery it is but it’s on its original
EE's: We use silicon to make things  smaller!
 

Offline MTTopic starter

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: aq
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #66 on: January 28, 2023, 03:53:18 pm »
Yep a lot of people just completely freeze in emergency situations. They are not sure what to do in the stress of it all, so they end up doing nothing, or doing one thing over and over and over.

Because of this quite a few unintended acceleration events can be attributed to the driver simply mixing up the brake and throttle pedals. Something happens like an obstacle or taping the accelerator while thinking they are on the break, they panic and as the default response slam on the brake pedal as hard as they can...however there foot ends up being above the accelerator pedal. The car starts going faster they panic even more and press the pedal even harder, up until they end up crashing into a wall.

In the event of an bug in the ECU making the car go full throttle can indeed be stopped in a whole range of ways. Like you can turn the key (tho this doesn't directly kill power to everyiyng, ECUs shut down with a delay to have time to safely save data), you can press in the clutch, if you have an automatic you can shift it into neutral. stomping on the brakes hard will bring a car to a stop even if its hurtling down the highway at full throttle...etc But the driver has to think of one of those and do it, yet most people have no idea how a car actually works, so they have no idea what to even do. As far as they are concerned the car is actively trying to kill them and they can't do anything because the car is not acting normal.

Handbrake probably can't stop a engine at full throttle, but even this thing is now electronic. You press a button and a little motor does its whirly business back there to actually apply the 'handbrake'. It is not even a hardwired switch that gives it power directly, it is soft button that tells electronics to do it. Cars also don't have keys anymore, but the ones with a start button typically have a safety feature that it will do an emergency shutdown if you hold the button or press it 3 times quickly or something while the car is on. Id prefer to have the oldschool key and mechanical handbrake.

Because everyone has a car these days, there will always be dumb drivers that do dumb things.

Some potentially deadly dangerous machines are required to have an emergency stop switch. In a car it could also cause an accident, so to override or not override could be a question.


 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7388
  • Country: nl
  • Current job: ATEX product design
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #67 on: January 31, 2023, 10:28:40 am »
Yep a lot of people just completely freeze in emergency situations. They are not sure what to do in the stress of it all, so they end up doing nothing, or doing one thing over and over and over.

Because of this quite a few unintended acceleration events can be attributed to the driver simply mixing up the brake and throttle pedals.
I had a situation like that. Throttle was stuck underneath the floor mat. Stepped on the break, car slowed down, put it in neutral and got it unstuck.
I had also the other situation, where I pressed accidently the throttle instead of the break for a fraction of a second because something unexpected happened.
You don't know how you would react in an emergency situation, it depends on your state of mind, and so many other things. It's really like rolling a dice. Or more like playing russian roulette.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #68 on: January 31, 2023, 11:31:00 am »
Yep i have mixed up the brake and accelerator pedal before too, luckily without any accident as a result since i quickly figured out that something felt very wrong.

The issue is the people who react to this situation by pressing the wrong pedal even harder and continuing to do so for multiple seconds while screaming in panic, making the car continue to build more and more speed until they crash into something at a dangerous amount of speed.

Getting a drivers license involves getting the hang of a lot of car related skills. However they don't tend to teach how to react in emergency situations. So when such an emergency happens they have seen it for the first time and have to figure out what to do on the spot. While being trained on how to respond in such a situation will make them already subconsciously react to it. This is why pilots are put trough a wide range of simulated aircraft failures. Something similar should be part of getting a drivers license.

Here in Slovenia, about 10 years ago they have have introduced a new requirement for getting a drivers license. It is going trough the safe driving testing grounds where they can simulate various road hazards. They use a smooth plastic coated road surface to simulate slippery/icy conditions. Then they have you drive a slalom between cones on it, brake hard with just half of the wheels on a slippery surface, drive around a corner that transitions to slippery half way, drive down a hill on it, evade a random appearing obstacle in the form of a water curtain, knock your rear out on it using a hydraulic platform...etc. This is excellent training to show drivers how the car reacts when it is not fully under control, so that when they get into a hairy situation on the road they know what to do and what to expect.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 6844
  • Country: va
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #69 on: January 31, 2023, 12:07:22 pm »
I quite fancy going to Slovenia just to get a license :)
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6707
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #70 on: January 31, 2023, 12:14:48 pm »
Can’t say what battery it is but it’s on its original

When I scrapped my 14 year old Peugeot 206 diesel it was still using the original battery from the factory. 
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #71 on: January 31, 2023, 12:15:34 pm »
I think most countries have locations where you can join a day course in car skidding / slipping practices ?
Indeed absolutely recommended to get an idea what happens with a car when the conditions are not optimal.

Esp. driving on a slippery driveway with 30 - 50 - 80 km/hour and then see what happens when you need an emergency stop.
So glad there were no trees on the side during that course  ;)

Also never had the wish to drive over 130km/hour on the german highway anymore when other traffic is present.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #72 on: January 31, 2023, 01:17:28 pm »
I think the place also offers an independent class that anyone can take.

Years before this was made an requirement, i got to go there trough through the insurance company. I was classified as a young driver back then and could get a nice insurance discount on my car if i take the class. It was a very fun afternoon for sure, would recommend. The skills from there have certainly come in useful. Like for example going around a curve on the highway at 100+ km/h and it suddenly turns into a icy skid.

Don't think i heard of any other country having this as a requirement, but they really should. If anyone is from a country where they do, do tell us about it.
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6707
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #73 on: January 31, 2023, 01:40:16 pm »
We have 'Pass Plus' in the UK which is endorsed by insurance companies to help provide a discount to younger drivers, but in reality it usually only offers around a 5% discount.  On a £1,000 insurance premium it rarely pays for the cost of the course.

The approach for a discount here is to get a telematics unit which monitors your driving; acceleration, braking, time of day.  But I've never liked the idea. 
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6707
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #74 on: January 31, 2023, 01:52:56 pm »
ABS definitely improves safety.  The biggest benefit though is that it gives you the ability to steer away from a possibly inevitable collision.  You can't do that if the wheels lock.   And modern vehicles can detect the quality of the road surface and alter how the ABS works, or offer a user-selectable surface setting (more common in 4WD vehicles.) 

ESP is another good feature.  The computer compares steering angle with actual angle of the vehicle and applies light braking to keep the vehicle stable.  It means you get much better grip if one wheel loses traction and enables the 'moose test' to be passed at faster speeds.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf