| ??? 03/09/06 17:50 Read: times |
#111772 - gonna get a PhD, or a lobotomy Responding to: ???'s previous message |
Erik Malund said:
I have had the "pleasure" of inyetviewing/working with recent Phd graduates, and, in all cases, I would rather work with a techical school graduate with 25 years of experience. I had the misfortune of having to fix an 8051-based temperature-control board designed and programmed by a guy with a Ph.D. in controls. Very simple PID loop with a 9600 bps RS-232 connection to a host computer. The host could send ASCII commands (like temperature setpoint, enable/disable) and get status back (current temperature, loop error, etc). Basically, a timer set the interval at which temperature samples were taken (12-bit ADC), the loop was updated and a new heater value was written to a 12-bit DAC. The first problem was the communication seemed to fail. Characters would get dropped, etc. The PhD said, "it must be line noise or something." Yeah, right: the serial cable was about two feet long. Delving into his code, some things became apparent. First, whenever he got the timer-tick interrupt, he completely recalculated the loop variables. Then, as part of this, he was converting the 12-bit ADC values to some long fixed-point representation of temperature in degrees Celsius! His loop worked on this value, and the result was a heater power in watts, which then had to get converted to a 12-bit value for the DAC. All in the ISR! So, no wonder he was dropping characters at the serial port--he was spending too much time in the ISR! So I asked what's with all the conversions, and he said, "well, it wouldn't work with doubles, it seemed to crash, so I had to create this fixed-point representation ..." Yep, you guessed it. He'd tried to take his Matlab/Simulink model, which of course used floating-point values and worked in the natural units of temperature and power, and spit out a C program that probably ran fine on a PC, and execute it on the micro. He ran into the issue with floating-point libraries being non-reentrant but didn't realize what that meant. Then he ran into execution-time issues because he was an idiot. Too much theory, no practical experience, and worse, an arrogant attitude. Needless to say, I re-wrote the whole thing. The loop itself was model in integer ADUs instead of degrees, no ridiculous conversions necessary. The timer-tick ISR read the ADC and set a "got new temperature reading" flag which the main program recognized, and then updated the loop and wrote a new heater value to the DAC. Ran fine. (The whole thing should have never been built in the first place .. just buy a Lakeshore box and be done with it.) -a PS: one former colleague got his PhD. We did a bunch of projects, where he did the theoretical stuff and I actually built the hardware. He wasn't allowed to touch a soldering iron. This arrangement worked well. |
| Topic | Author | Date |
| i suggest you read | 01/01/70 00:00 | |
| Flawed article | 01/01/70 00:00 | |
| men only | 01/01/70 00:00 | |
| you don;'t know Jack | 01/01/70 00:00 | |
| you want a laugh? | 01/01/70 00:00 | |
| Tar with the same brush | 01/01/70 00:00 | |
| i dont think so | 01/01/70 00:00 | |
| grades??? | 01/01/70 00:00 | |
| Snobbery | 01/01/70 00:00 | |
| re grades | 01/01/70 00:00 | |
| Graduates | 01/01/70 00:00 | |
| yes, but | 01/01/70 00:00 | |
| Value of Education | 01/01/70 00:00 | |
| It is sad, but | 01/01/70 00:00 | |
| Cost of Education | 01/01/70 00:00 | |
| gonna get a PhD, or a lobotomy | 01/01/70 00:00 | |
| lobotomy? do you like the idea? | 01/01/70 00:00 | |
| just to clerify | 01/01/70 00:00 | |
I'm glad you said that ... | 01/01/70 00:00 | |
| Likewise ... | 01/01/70 00:00 | |
| Correct by construction | 01/01/70 00:00 | |
| i do, follow much of it | 01/01/70 00:00 |



