Live data from Hacker News

E.P.A. Finds More VW Cheating Software, Including in Porsches

nytimes.com

81–90 of 160 posts

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#81
post #62
post #53

Earlier quoted context omitted.

> One thing that all of the designs have in common is poor performance and piss-poor fuel economy. At what point does it become economical to just run gasoline instead of diesel then (that is, manufacturers selling gasoline models)? If we are talking about diesel still being economical instead of gasoline, but just not as economical as when it was allowed to be more polluting, I'm not sure I can muster much sympathy…

> At what point does it become economical to just run gasoline instead of diesel then (that is, manufacturers selling gasoline models)? If we are talking about diesel still being economical instead of gasoline, but just not as economical as when it was allowed to be more polluting, I'm not sure I can muster much sympathy (but I'm fairly uneducated on the subject, so it may just a matter of not knowing enough). People…

I don't think people / companies really have a 'right' to pollute, so as long as the standards are possible to meet at reasonable costs I don't see a problem.

PS: Low end torque is really just a transmission problem. X(1) power at Y(1) RPM > X(2) power at Y(2) RPM.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#82
post #76

Earlier quoted context omitted.

That's why I'd like to get it tested. I think they may have gone with the 2016 since that's what is currently on the lot, but I am very skeptical it is new to the 2016 model year when the required standards and engine did not change.

Why would you want to get it tested? Why not just wait for the EPA to test another 2015? I'm not sure what information benefit you'd get from commissioning your own test that would offset the time and money it would take to execute such a test.

The original tests that broke the scandal open were some grad students who borrowed cars to test them. I'd be happy to help in such an effort.

I'd also like to know if I purchased a fraudulent vehicle ASAP so that I can figure out next steps.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#83
post #25

Earlier quoted context omitted.

Good points. I sort of touched on this in another comment, but perhaps the emission standard on these vehicles is what's unreasonable. We have a more-or-less arbitrarily set maximum allowed tailpipe emissions for a given class of vehicles. Is it fair to apply this arbitrary standard uniformly across all vehicles in the same class? If vehicle A and vehicle B both meet the same emissions standards, but vehicle B is cap…

That is a good point. You may very well be correct. I think that from an economic perspective, reduced fuel economy is also beneficial to the environment because the driver is less likely to spend money traveling (keeping the vehicle's engine running, producing pollution) when the cost is higher. However if the vehicles in question were part of a fleet whose behavior would not change much based on fuel costs, there w…

It is unlikely that a reduction in fuel economy of X% would incent a reduction in driven miles of more than X%. Fuel cost is a minority component of total lifetime cost of the vehicle.

Most people have a (perceived) fixed distance of driving they need to drive. A 10% reduction in mileage won't have drivers biking 1 day every other week.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#84

Clearly it's the fault of those pesky engineers again, how else could you explain the same type of cheating across multiple divisions of the company. They only other explanation would involve Management, and obviously that's not it. Though the fact that none of the other manufacturers spoke up about the violation of emissions standards when when they must have done their own tests to see how VW managed to get emissio…

My impression is that the process was structured in a way to give higher levels deniability. I highly doubt direct orders were given from the top to cheat; instead it was made clear that the performance numbers would come out right AND the emissions standards would be met, or heads would roll. And lo and behold! The numbers and sales targets were met. And management can say "well, we don't know how they did it. We never asked!"

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#85
Background: I used to be an automotive software engineer. I speak for myself only here.

Whenever the topic of automotive software comes up on HN there are comments alongs the lines of "global variables bad", but not much construtive feedback.

I want to explain some of the tradeoffs that lead to the architecture used in automotive software to get a better discussion going with HN readers about that architecture.

tl;dr Given the hardware restrictions, real-time requirements and measurement capabilities required in automotive software, shared global variables without locks is a fast and safe way to share state between different software components as long as each variable is only written in one place in the program.

The microprocessor has to run for 10+ years in a wide range of temperatures and be dirt cheap, so you end up with specs like 180 MHz, 4 MB of flash and 128 KB of RAM.

The program must run deterministicly with respect to memory. There is no malloc/new in the code. All variables are statically allocated.

Because the physical world doesn't pause, no code is allowed to block while waiting for resources, especially synchronization primitives like mutexes.

The software architecture is in 2 main parts: basic software containing the real-time OS and hardware drivers, and the application layer which has the domain-specific code for controlling the engine, brakes, etc.

The basic software is implemented using usual C programming techniques. It has an API provided by function calls and structs to hide implementation details of each microcontroller.

The application software is where the programming model is different.

To understand why, you need to know where automotive software comes from and what it is trying to acheive.

Originally all controllers were mechanical: a valve opens proportionally to the vacuum in a part of the system. Then some controllers were implemented in analog electronics: take multiple voltages, feed them through an op-amp and use the output to control a valve.

So automotive software reproduces this: get some inputs, compute the same physical equations at a regular rate and generate outputs.

This is dataflow programming. Blocks of code have inputs and outputs. They are executed at a fixed rate that depends on the physical phenomena (air flow changes fast, temperature changes slowly). Different blocks are conneceted together in a hierachical way to form subsystems. Encapsulation is acheived by viewing these blocks as black boxes: you don't need to care how the block works if you are only interested in knowing which inputs it uses and outputs it produces.

Here's an example component to control a gizmo.

It might be implemented in a visual environment like Simulink by MathWorks, or it implemented by hand from a spec.

  #include "GizmoController_data.h"
  
  void GizmoController_100ms() {
    Gizmo_Gain = interpolate2d(Gizmo_Gain_MAP, EngineSpeed, CoolantTemp);
  }
  
  void GizmoController_10ms() {
    Gizmo_Error = Gizmo_PositionDesired - Gizmo_Position;
    Gizmo_DutyCycle = limit(Gizmo_Gain * Gizmo_Error + Gizmo_Offset_VAL, 0, 100);
  }
It takes some inputs (EngineSpeed, CoolantTemp, Gizmo_PositionDesired, Gizmo_Position), has some intermediate values (Gizmo_Error), and outputs (Gizmo_DutyCycle). Those are implemented as global variables. It also uses some constants (Gizmo_Gain_MAP, Gizmo_Offset_VAL). It has 2 processes, running every 100ms and 10ms. All this information would be specified in an XML file.

The header GizmoController_data.h is auto-generated at compile time by a tool from the XML file mentioned above. It will contain global variable definitions for the inputs, intermediates and outputs with the appropriate volatile, const, static and extern storage classes/type qualifiers. This ensures that the compiler will enforce that inputs can't be written to, intermediate values are private to the component and outputs can be read by other modules.

Note that no explicit synchronization is needed to access inter-process variables like Gizmo_Gain or inter-component variables like Gizmo_Position. It's shared memory between 2 processes scheduled in OS tasks that can potentially interrupt each other, but since the write is atomic and happens only in one place, there is no data race. This is huge! Concurrent programming, without locks, with the best efficiency possible, using a simple technique anybody can understand: only one place in the program is allowed to write to any global memory location.

Calibration is another aspect of automotive software. In most software the constants either never change or can be set in some kind of configuration file. For an automotive controller, the value of constants (gains, offsets, limits, etc) depend on the vehicle so they must be configurable at run time during development. This is implemented in the C code by putting all constants in a memory area that is ROM in production units, but RAM in development units. The compiler enforces that application software cannot change constants, but the basic software includes code so that constants can be changed from the outside in development. This process is called calibration and is done by calibration engineers who are usually not the ones who wrote the software. Note that calibration can drastically affect the behavior of the software. What would happen if Gizmo_Gain_MAP is set to all zeros?

Measurement of variables is essential to understanding what's going on inside the embedded controller. Having all that state available in global variables makes it possible for the calibration tool request the value of any variable in the software at a fixed rate and display it in a virtual oscilloscope.

The measurement and calibration tool needs to know how to access the variables and constants. It uses a file that maps from names to addresses for a particular version of software. That file can easily be generated a compile time since all allocations are static.

Going back to the architecture of the application software, let's look at where our gizmo controller fits. It is not the only component needed to make the gizmo work. You also need components to calculate the gizmo position from some external signal (let's say an analog voltage), to route the output signal to the powerstage driver on the PCB, to determine which position the gizmo should currently occupy. These would form the gizmo subsystem package.

When the supplier releases gizmo 2.0 (TM) they upgrade the input signal to be a PWM input instead of an analog input. Modularity in the software allows the software team to simply replace the gizmo position component with one that reads a PWM instead of an analog voltage and keep the rest of the gizmo subsystem the same. In the future, projects that use gizmo 1.0 use one version of the gizmo subsystem and projects that use 2.0 use another.

This is true at any level in the hierarchy: as long as the inputs and outputs are the same, a component or subystem package can be replaced by another.

Version control in automotive software reflects this. Instead of having one tree of versions and releases like a typical software project, each component, subsystem package and software project has its own tree of versions. Each software project will reference the subsystem packages required for their engine type, vehicle platform, sensors and actuators, etc. This is how code reuse is acheived.

Testing is a mix of simulation (the sensor/actuator is simulated in Simulink and connected to Simulink block diagram of the software component), hardware-in-the-loop (a computer simulates the vehicle, but the real electronic control unit is used) and vehicle testing.

Thanks for reading. I hope this improves your understanding of how automotive software is structured.

I'm hoping the discussion will bring examples from other fields like robotics, drones and aeronautics that have similar real-time requirements on how they architect their software.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#86
post #60

I'd love to get my car tested... Anyone know how I could do that? I have a 2015 Q5 TDI which while not specifically mentioned has the same size engine as several of the ones that are mentioned (3.0-liter). I would be shocked if they just started using the defeat device in the 2016 model year for the Q5 considering they were already getting pushback from the EPA before the 2016 models even got announced. I bought the…

You bought a Q5 3.0 Diesel for clean emmisions? Wait... What? I'm surely not going to defend VW or any of the associated companies for cheating. But it should be kind of obvious that a car with such an engine does all but clean emmisions.

I don't know much about the auto market, but it seems that until this year, "clean diesel" was something people said with a straight face.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#87
post #78

Earlier quoted context omitted.

Wut? What does this have to do with vehicle manufacturers programming their ECUs to defeat emissions tests? There isn't a single diesel truck that 'rolls coal' from the factory. Also, diesel trucks that emit black smoke do fail emissions test - in counties that actually have emissions tests.

Apparently a lot of people who make these sorts of modifications can pass emission tests. They hook up a settings swapper to the ECU, and when they need it to be clean, they put it into factory default mode. It is essentially the same sort of cheating as VW.

On a scale that isn't even remotely as large as what VW has done. The scale matters, a lot.

You're talking about something affecting maybe tens of thousands of trucks, versus 11+ million vehicles including Porsche. It doesn't make sense to make the comparison.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#88
I definitely think management was involved here. However, its entirely possible that some management was not aware of the details. I doubt that more than some couple tens of people at VW group know intimate details of the VW diesel ECU. With badge engineering/platform sharing, its possible that Porsche/Audi/VW or whoever was not directly responsible for delivering the code could be in the dark about it. Im sure they even want it that way so there is plausible deniability. There are plenty of things that go on in the company I work for that I have no knowledge of. There are plenty of things in the software I customize/implement that I do not know about.

Bottom line- VW group cheated, was caught, and Im sure has a few dozen scapegoats lined up in accordance with automotive scandal rules and regulations. People will use this as a platform to get their names in the spotlight as a crusader for the people, the managers that made the decision will go largely unpunished, and the world will move on. I think its crappy behavior, but in the scheme of things they did not directly murder anyone and people willingly participate in much more dangerous activities than breathing excessive NOX fumes... I think that they should just fine them make VW say "We are truly deeply heartfeltly sorry" and then we can worry about the bigger problems in life.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#89
post #8

Why doesn't the EPA simply ban the sale of any car manufactured by VW until they start passing the new emissions tests? Even better, begin requiring previously purchased VW cars pass these emissions tests. If the cars don't pass the new emissions tests then VW is required to reimburse the blue book value of the car for false advertising, fraud, and acting in bad faith.

I want VW to be held accountable, but I don't want them to decimate the company. While I want clean air, and believe in global warming; I'm afraid that the EPA will use VW as a reason to tighten emmission standards to to point where we will need to buy new vechicles in order to drive. I can't afford, nor really want a new vechicle. I'm at the point now that I pray my vechicles passes smog checks. I'm not working as a…

There is little or no history of emissions standards forcing existing vehicles off the road.

There is some chance that better testing will result in lower emissions standards, if the better tests reveal the existing standards to be unrealistic.

Re: E.P.A. Finds More VW Cheating Software, Including in Porsches

#90

Background: I used to be an automotive software engineer. I speak for myself only here. Whenever the topic of automotive software comes up on HN there are comments alongs the lines of "global variables bad", but not much construtive feedback. I want to explain some of the tradeoffs that lead to the architecture used in automotive software to get a better discussion going with HN readers about that architecture. tl;dr…

Quality post. Thanks for sharing.

If some of these timers are implemented as separate OS tasks that can interrupt each others, what's to stop one from taking a bit too much time and throwing off the timing of another?

Post reply on HN