Skip to content →

Month: September 2015

Electric Vehicles and Infinite Torque

I’ve seen/heard a couple of references to electric vehicles having “infinite torque” and something seems to be lost in translation. What they are referring to is that electric motors have “peak torque” available at 0 RPM. Essentially their torque curve is flat unlike internal combustion engines.

clip_image002_001

Image courtesy of evdrive.com

Note that the torque curve doesn’t stay flat forever, eventually the limitations of physics prevent that.

Below is a comparison of a Tesla Roadster and Chevy Camero from automobilemag.com

0911_10_z+camaro_rs_vs_tesla_roadster+dyno_results

The following graph shows the torque each car’s rear wheels experience during an all-out run from a stop. The dips in the Camaro’s torque are the shifts between gears, which happen quite quickly and are among the smoothest you’ll see. Note that the Tesla has no interruptions. Between 0 and 55 mph, the Tesla is the clear winner, even though by 40 mph, the Tesla’s AC motor output begins diminishing.

Comments closed

Windows Services Running as Local System and Environment Variables

As sometimes happens I installed an application on a Windows server and several days later another program stopped working.

I did my research and was able to determine that the installer for this new program had altered my PATH variable such that a specific DLL was now loading from the wrong place with an incompatible version causing the old program to stop working. Fix the path – everything works. All in a day’s work.

Except…

While I was able to successfully run the program from the command prompt the actual use was different. In fact this program was called from an Apache module that was shelling out to it. In this context the program was still failing. After checking to see if there was some Apache setting that was controlling the PATH variable and finding out that you can’t actually change environment variables in Apache on Windows I was able to confirm that the PATH value in the Apache context was different than the system PATH.

Now I knew that if you change the system PATH you need to close and reopen your command windows to reinitialize the environment variables so I assumed that restarting the Apache service would cause the same thing to happen. Not so much.

As it turns out my Apache service was running as Local System and evidently all the environment variables are set at startup time. That meant I needed to reboot the server. Unfortunately I can’t do that until our maintenance window several days from now and people need the function to work today.
Luckily there were several layers of code between Apache and the actual program that was failing. One layer was a C# application, so making use of the Environment.SetEnvironmentVariable("PATH", newPath, EnvironmentVariableTarget.Process) and then shelling out I was able to temporarily change the PATH to something that will work.

Now I just need to remember I did this 2 years from now when something else changes…

Comments closed