研发无小事——记一次偷懒浪费的两周时间 by susiejob

View this thread on steempeak.com
· @susiejob ·
$18.72
研发无小事——记一次偷懒浪费的两周时间
## 事件概述:
最近,工作中出现了一个问题,耗费了我无数的脑细胞和时间精力,浪费了好几天,最终才找出原因。整个破案过程惊心动魄,心情像是在坐过山车,振幅达到几十公里,差点碎掉。

既然如此费心,不记录下来,对不起自己,保存一下,时不时看看,也算引以为戒吧。

前段时间做了个简单的项目,真的很简单,就有点麻痹大意了。几年前我做过一款仪表,是4个通道的热电偶温度测量仪表,热电偶的种类是K型。

这是一款很成功的仪表,测量精度较高,功能很多,品质稳定,连最龟毛的客户都很喜欢,算是畅销品。前几个月,应客户要求,说想要知道新的机型,保留2通道的K型热电偶测温,另外两通道使用热敏电阻测温,其余功能保持不变。

热敏电阻测温是所有测温方式中最简单的,相当于研发中的幼儿园级别,我当然很开心,原有项目简单改动一下就能卖出量,很有成就感呢!

***

## 测量原理:
测量热电偶要比测量热电阻麻烦得多,像热电偶测量,前级滤波线路就是一堆元件:
![image.png](https://ipfs.busy.org/ipfs/Qmcsb4beBVnL7Q9D5e2VkxXFsYEiMjJbCzoQ7P9hFzWSAe)
中间级还得使用运算放大器进行信号放大,因为热电偶测温的基本原理是两种不同成份的材质导体组成闭合回路,当两端存在温度梯度时,回路中就会有电流通过,此时两端之间就存在电动势——热电动势。这个热电动势很小,就K型热电偶来说,整个量程范围平均一摄氏度的温度变化,对应的电压变化只有15uV左右,这就一定要使用运算放大器了。

热电偶整个测量电路很复杂,有些半导体公司为了简化热电偶的测量线路,还专门推出有专用的测量IC,只需要极少的外围元件就能完成测量。只是,这样的专用IC成本很高,有的价格能有十几美金,所以一般中低档的测量仪表还是使用分立元件,自己搭建线路进行测量。

而热敏电阻测温,特别是NTC型的应用,就非常简单了,只需要简单使用电阻分压,其分压信号直接使用AD测量即可:
![image.png](https://ipfs.busy.org/ipfs/Qmb2vLxTfQZDC8NgNaqTZNSimLRTNMwU4WBMNxqgCE1tAi)


现在是去掉2路测量,线路简化不少,相当于是造惯了航空母舰,现在要用纸折一艘小舢板,so easy,所以,我直接在原有项目的基础上进行简化修改。

## 新旧对比:
这是原来项目的PCB layout图:
![image.png](https://ipfs.busy.org/ipfs/QmS4tCMMes33M3qPynFkC4as9XAmPpC4HdEKwGissLwx3e)

这是新项目的PCB layout图:
![image.png](https://ipfs.busy.org/ipfs/QmeeVq9f2EDdtoeUicbeqciLEzcZwp1AxG7XjhhCgRKPEg)

可以看出layout几乎没有变化,只是在PCB的下方中间部分删去了很多元件,增加了几个接插件而已。

只花了2周就完成了所有项目的设计,转给工厂进行试产了。第一批试产是20台,因为项目太简单,我也没有去工厂追踪,预测应该很顺利。

## 问题出现:
可是事与愿违,20台出来,经过校正检测,足足有18台仪表,其热电偶测量精度都达不到原来的设计精度要求。原来测量,从-200~1375℃,误差都在1℃以内,且测量值比较稳定,跳动顶多是0.1~0.2℃。可是这次的18台不良品,误差基本在1.5~2℃,还不太稳定,数值跳动最大可达1℃。

我收到样品实际测试了一下,碰到的情况是时好时坏,没什么规律,但是虽然跳动状况一样,但是整体精度还在可接受的范围内,和工厂几乎全部超标还不一样。我让产线同时检查一下原有的旧机型,20台,全部合格。这就很奇怪了,热电偶的测量线路完全没有改变,相关的测量程序也和原来一模一样,似乎没有理由这样。

## 过程分析:
我第一个就想到是干扰。状况时好时坏且有跳动,这基本符合外界干扰的情况。再加上这个项目本就是一个很小的项目,所有的软硬件也只进行了极少量的修改,因此我让工厂第二天趁着厂里还没上班的时候,再次验证一下测量结果,因为那时各种机器还没开机,会少很多干扰。工厂照做了,可是情况依旧。

没办法,硬件线路和程序我都已经对比了快10遍了,没啥不同,以我十几年的经验来说,PCB上微小的差异,不可能对外界干扰有如此大的差别。实在是想不出招了,只能亲自到工厂看看,强烈怀疑是。我们的工厂和研发办公室在两个城市,距离一千多公里,坐飞机光来回就得浪费2天,因此选择了坐晚上的火车,睡一觉就到了,这样不浪费时间。

到了工厂,看到了产线所说的情况,确实 都超标了,也有跳动。不过如果看平均值的话,还挺一致,在及格的边缘。因为我做的部分已经反复检查过n遍了,我就把疑点放到了标准产生器上。

具体原理就不赘述了,总之一会电压输出,一会温度输出,又是 冰水混合物又是铜线K线,折腾了一天,情况还是老样子。
![image.png](https://ipfs.busy.org/ipfs/QmZxzX7EEog5kynGttVtgoWJbpZFGSF4RHcaL5xEFuCgXF)

搞了2天,没什么进展,只能一切从头来,先重烧程序,进入debug模式看看,死马当活马医吧。连上电脑,插上仿真器,重烧程序:
![image.png](https://ipfs.busy.org/ipfs/Qmc9KFcuMpL9TjzJpnHSqRmf98RVkbzWEDwnEog3uoGp8F)

输入各种温度看看,最后,在几乎绝望的时候,出现了转机。输入0℃时,显示还正常,输入-150℃时,显示是-4.7℃,输入1000℃时,显示238℃。
![image.png](https://ipfs.busy.org/ipfs/QmRYRTKWhiMGMkV9458b7Ys8X8U81iWdsrZhcojfznFSvp)


![image.png](https://ipfs.busy.org/ipfs/Qmdjbttti8MBSaA7F1cLGj6GKBHamW1rBvg2KnHgGiFV11)


虽说每一台仪表都要经过校正测量值才能准确,但是,相差这么大,绝对不是正常的元器件误差造成的,所以,一定是线路的放大倍数出错了

运算放大线路如下:
![image.png](https://ipfs.busy.org/ipfs/QmXXjURY4fdjokXg4tTrX37uyb6nbbxw137UpMbu44Eesy)
放大倍数由R46和R47决定:
Vo = 1+R47/R46。

用万用表先检查这两个电阻,发现,R47只有10k欧姆,比原来小了5倍。所以整个放大倍数从48.5狂降成了9.3倍,虽然差了这么多,但是程序在进行校正的时候,硬生生的用程序补足了差值,原来AD几乎是满量程测量的,现在AD只用了9.3/48.5,约为19%的full scale。校正过后,显示值还基本正常,就是跳动被程序放大了5倍多,才出现了上述的种种情况。

将R47换成51K,问题立即得到了解决。

赶紧先检查自己给出的BOM list,发现没错,我心里恼火啊!!!

到底这个错误是如何发生的呢?生产贴片时搞错了料?想想还是挺有可能的。贴片机生产时这样的:
首先,将原件(一卷)放上搁架:
![image.png](https://ipfs.busy.org/ipfs/QmW1rgVX73HD1fA3fqZ5wrGh2UAzYMm4dVydvYEtUFvmHr)

然后,在进料口排好,贴片机根据编制好的程序,自动取件贴片:
![image.png](https://ipfs.busy.org/ipfs/Qma866k2m5hx1n7oSnxTDkjs3J8tg42aj8i7kuennvtgeW)

这中间,如果是领料员或是当班的插件员搞错了一个元件的话,整批产品都会出错。所以我立即去产线了解情况,得知这个过程其实是非常严谨的,至少要2个人确认物料后才会开工,以免生产出废品,几乎不可能错在这个环节。

生管调出ERP系统里的BOM表,发现,是BOM错了,里面R47就是10k。

我给出的bom没错,但是被人输入ERP的版本是错误的,这归根结底还是我的责任,因为最终输入系统之前,我是要检查并签名的。正确的做法是我需要按照BOM,对照着线路图一个一个再检查一遍才能签名,可是因为这个产品过于简单,我就偷了个懒,直接签名了,后来生产校正出来的结果也差不多,所以一直没有怀疑到用错料上来,结果花了我将近2周的时间,这都是浪费掉的啊!!

## 经验教训:

所以,在此再次提醒各位RDer:
- 设计无小事,不能掉以轻心
- 再简单的产品也必须按照ISO流程来做,因为ISO的初衷就是为了帮助人们规范流程,少出错,如果把ISO看成累赘,迟早会得到教训
- 产品debug时,一定要从原式的状态开始,不能经过中间校正,处理后再看,因为中间工序极有可能会掩盖住问题,使人难以发现。

祝各位RDer都能设计出无bug的产品,开开心心工作,顺顺利利偷懒~~

***
以上内容均由 @susiejob原创,未经许可,请勿引用,谢谢!!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 650 others
properties (23)
post_id77,160,052
authorsusiejob
permlinkezu0tz63at
categorycn
json_metadata{"community":"steempress","app":"steempress\/1.4","tags":["cn","steempress","cn-stem","engineering","palnet"],"original_link":"http:\/\/cnstm.org\/blog\/2019\/06\/28\/%e7%a0%94%e5%8f%91%e6%97%a0%e5%b0%8f%e4%ba%8b-%e8%ae%b0%e4%b8%80%e6%ac%a1%e5%81%b7%e6%87%92%e6%b5%aa%e8%b4%b9%e7%9a%84%e4%b8%a4%e5%91%a8%e6%97%b6%e9%97%b4\/"}
created2019-06-28 07:08:15
last_update2019-06-28 07:08:15
depth0
children4
net_rshares42,377,950,043,294
last_payout2019-07-05 07:08:15
cashout_time1969-12-31 23:59:59
total_payout_value13.477 SBD
curator_payout_value5.238 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,954
author_reputation7,097,593,315,428
root_title研发无小事——记一次偷懒浪费的两周时间
beneficiaries
0.
accountsteempress
weight1,500
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (714)
@steemstem ·
re-susiejob-ezu0tz63at-20190630t064514805z
<div class='text-justify'> <div class='pull-left'> <center> <br /> <img width='200' src='https://res.cloudinary.com/drrz8xekm/image/upload/v1553698283/weenlqbrqvvczjy6dayw.jpg'> </center>  <br/> <br /> </div>

This post has been voted on by the **SteemSTEM** curation team and voting trail. It is elligible for support from <b><a href='https://www.steemstem.io/#!/@curie'>@curie</a></b> and <b><a href='https://www.steemstem.io/#!/@utopian-io'>@utopian-io</a></b>.<br /> 

If you appreciate the work we are doing, then consider supporting our witness [**stem.witness**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=stem.witness). Additional witness support to the [**curie witness**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=curie) and [**utopian-io witness**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=utopian-io) would be appreciated as well.<br /> 

For additional information please join us on the [**SteemSTEM discord**]( https://discord.gg/BPARaqn) and to get to know the rest of the community!<br />

Please consider setting <b><a href='https://www.steemstem.io/#!/@steemstem'>@steemstem</a></b> as a beneficiary to your post to get a stronger support.<br />

Please consider using the <b><a href='https://www.steemstem.io'>steemstem.io</a></b> app to get a stronger support.</div>
properties (22)
post_id77,261,739
authorsteemstem
permlinkre-susiejob-ezu0tz63at-20190630t064514805z
categorycn
json_metadata{"app":"bloguable-bot"}
created2019-06-30 06:45:18
last_update2019-06-30 06:45:18
depth1
children0
net_rshares0
last_payout2019-07-07 06:45:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,367
author_reputation229,673,617,633,863
root_title研发无小事——记一次偷懒浪费的两周时间
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steemitboard ·
Congratulations @susiejob! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@susiejob/voted.png?201906300736"></td><td>You received more than 1000 upvotes. Your next target is to reach 2000 upvotes.</td></tr>
</table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@susiejob) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=susiejob)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
post_id77,263,543
authorsteemitboard
permlinksteemitboard-notify-susiejob-20190630t081429000z
categorycn
json_metadata{"image":["https:\/\/steemitboard.com\/img\/notify.png"]}
created2019-06-30 08:14:30
last_update2019-06-30 08:14:30
depth1
children0
net_rshares0
last_payout2019-07-07 08:14:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length845
author_reputation38,705,954,145,809
root_title研发无小事——记一次偷懒浪费的两周时间
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
#### Hi @susiejob!

Your post was upvoted by Utopian.io in cooperation with @steemstem - supporting knowledge, innovation and technological advancement on the Steem Blockchain.

#### Contribute to Open Source with utopian.io
Learn how to contribute on <a href='https://join.utopian.io'>our website</a> and join the new open source economy.

**Want to chat? Join the Utopian Community on Discord https://discord.gg/h52nFrV**
properties (22)
post_id77,264,453
authorutopian-io
permlinkre-ezu0tz63at-20190630t090501z
categorycn
json_metadata{"app":"beem\/0.20.17"}
created2019-06-30 09:05:06
last_update2019-06-30 09:05:06
depth1
children0
net_rshares0
last_payout2019-07-07 09:05:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length423
author_reputation152,913,012,544,965
root_title研发无小事——记一次偷懒浪费的两周时间
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@crypto.talk ·
Hello susiejob, welcome to Partiko, an amazing community for crypto lovers! Here, you will find cool people to connect with, and interesting articles to read!

You can also earn Partiko Points by engaging with people and bringing new people in. And you can convert them into crypto! How cool is that!

Hopefully you will have a lot of fun using Partiko! And never hesitate to reach out to me when you have questions!

Cheers,
crypto.talk
Creator of Partiko
properties (22)
post_id77,813,253
authorcrypto.talk
permlinkcrypto-talk-re-susiejob-ezu0tz63at-20190711t121006574z
categorycn
json_metadata{"app":"partiko","client":"android"}
created2019-07-11 12:10:06
last_update2019-07-11 12:10:06
depth1
children0
net_rshares0
last_payout2019-07-18 12:10:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length456
author_reputation5,666,740,605,819
root_title研发无小事——记一次偷懒浪费的两周时间
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000