当前位置:网站首页>Sensor 调试流程
Sensor 调试流程
2022-07-03 18:06:00 【一只特例独行的猪。。。】
“ 日常工作中, 我们拿到一款新 sensor,一般都是先点亮,再接着调试效果。但点亮及调试也是有流程的,需按流程一步步去完成才可以,此文总结一下 ,关于 sensor 从点亮出图到效果调试的一个大致流程 。如觉得文中哪里有问题,或者不清楚的地方,欢迎联系指出。”
1、Sensor 调试流程

2、准备材料
确认主芯片规格
支持的最大分辨率、mclk、mipi 速率上限、支持的lane数、 支持的raw图像位深、支持的raw图像类型(mono/rgb/rgbir)
硬件原理图
客户主板上调试,则需要客户提供主板原理图;平台公板上调试,则需要提供模组转接板原理图、相应公板的原理图。
Sensor datasheet
确认曝光时间、增益如何设置,帧率如何修改;确认 WDR 输出模式( 是否是dol模式/ dol_virtual channel/ dol_lineinfo)。
Initialize setting
向 sensor 原厂申请所需规格的 sensor setting ,包含信息有:mclk、mipi速率上限、分辨率、mipi_lane数、帧率、输出raw图像位宽、出图模式 (linera/wdr) 。
3、配置驱动
配置好i2c地址、sensor setting、sensor chip_id;
根据主板原理图,在 dts 中配置 mclk、reset、pwrdn、i2c 的引脚控制,在驱动中配置 sensor pwrdn,reset 的拉高拉低、上电时序;
其他配置,需根据不同平台去具体配置,一般完成上述配置硬件没问题的话,就可以点亮出图了。
4、Sensor 出图
步骤 3 完成后,硬件没问题的话,一般就可以出图了
若I2C不通,就要排查下板子的硬件相关问题:
1)、确认AVDD DOVDD DVDD 硬件电压
2)、根据原理图确认reset、pwrdn、i2c、mclk 引脚控制及电压值
3)、确认 mclk 频率
4)、确认 sensor 上电时序
若出图异常(图像分屏、错位、显示不完整 ....);
1)、拍raw图,确认 raw 图是否正常。
2)、若raw 图也异常,输指令排查下mipi 传输是否有报错、示波器量一下mipi 波形,如果都正常的话,那一般就是 sensor setting 有问题,要找sensor 原厂去看了。
3)、但若raw 图正常,那就应该是驱动或者ISP的配置哪里还有问题,要继续排查 。
具体也可参考这篇文章:Sensor bringup 中的一些问题总结
5、AE配置
如上图所示,AE分为算法模块和统计模块,算法模块是纯软件模块。所以有很多品牌厂商,虽然用同样的平台,但为了做出差异化的产品,都是用自己开发的 3A 算法。AE 统计模块是和硬件相关的,包含在 ISP pipeline 里。
AE的整个控制流程,如上示意图所示,AE 算法控制一组曝光参数(曝光时间、sensor 模拟增益、sensor 数字增益、isp 数字增益),通过配置的sensor 驱动写入到 sensor 寄存器中(isp dgain 是直接写入相应的 isp 寄存器中的,不通过 sensor 驱动来控制),输出图像数据。
数据经过 AE 统计模块,将亮度统计信息给到 AE 算法模块,再次实时计算得出一组曝光参数,直到曝光正确,循环才结束。首次上电启动时,是从sensor 驱动开始加载的,驱动中包含一组默认的初始化参数,可以点亮出图 。
那sensor 驱动中如何配置 AE ?
1>、首先配置曝光时间
根据 sensor datasheet 配置好最大最小积分时间,然后将 AE 计算出的曝光行,写入到相应控制曝光时间的寄存器就可以了。这里说的是逐行曝光的 sensor,它是按行进行曝光的,积分时间是相对时间,exposure_time = integration_time * line_time(一行时间)。
2>、配置sensor 模拟增益、数字增益
一般我们只需配置 sensor 模拟增益就可以了,不用数字增益,但会用到isp 数字增益,它是 AE 算法控制的,不用在 sensor 驱动中去配置。总结一下,关于sensor 模拟增益的控制,一般分为3种形式。
一种是写入 sensor again 寄存器的值有具体要求,会有一个 again_table,配置好平台与 Sensor 的匹配精度(对应好几倍增益,应该写什么值),通过查 again_table 写入。一般思特威和格科微的 again 配置,都是要查表写入,如下是 sc230ai datasheet 中的 again_table 。
另一种是,写入 sensor again 寄存器的值是连续的,配置好平台与 Sensor 的匹配精度,将平台 AE 计算的 again 值写入sensor 即可。如下是ov08a10的again 配置,0x3503[2]=0 ,real_gain=Gain[12:0]/128,精度是128,[0-7]是配置小数位,[8-12] 是配置整数位;0x3503[2]=1, Gain[12:0],只有整数位1x,2x,4x,8x 。

后一种是如下imx335 所示,写入 sensor again 寄存器的值,是要求转换成dB写入,不是增益倍数的方式写入,它是非线性的,将平台 AE 计算的 gain 值转换成 dB 形式写入 sensor 寄存器;
3>、验证曝光及模拟增益的配置是否正确
最后要通过调试工具手动去控制积分时间、模拟增益的写入,然后通过读 sensor 相应的寄存器的值,来判断写入的数据是否正确,以此来检查驱动中的相关配置是否正确。
6、图像验证
拉高增益和曝光,验证是否有电源噪声/FPN:如下图所示,有横条纹则一般和硬件相关,竖条纹是和 sensor 相关,要找硬件和 sensor 原厂的人去看。
确认镜头品质:拍摄 ISO22233 解析力卡的raw 图,若图卡对焦对不清晰,四周模糊,或者单独某一边模糊,则镜头品质有问题,需更换镜头。
7、图像质量调优
可参考此篇文章:ISP调试流程概述
边栏推荐
- This diversion
- A. Berland Poker &1000【简单数学思维】
- PHP MySQL inserts multiple pieces of data
- link preload prefetch
- As soon as we enter "remote", we will never regret, and several people will be happy and several people will be sad| Community essay solicitation
- Codeforces Round #803 (Div. 2) C. 3SUM Closure
- Deops入门
- Managing multiple selections with MVVM - managing multiple selections with MVVM
- Redis core technology and practice - learning notes (VI) how to achieve data consistency between master and slave Libraries
- Research Report on investment trends and development planning of China's thermal insulation material industry, 2022-2028
猜你喜欢
Valentine's day, send you a little red flower~
Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028
Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
Codeforces Round #803 (Div. 2) C. 3SUM Closure
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
(8) HS corner detection
Records of long objects and long judgments in the stream of list
聊聊支付流程的设计与实现逻辑
BFS - topology sort
随机推荐
Applet with multiple tabs and Swipers + paging of each tab
PHP processing - watermark images (text, etc.)
Investigation on the operation prospect of the global and Chinese Anti enkephalinase market and analysis report on the investment strategy of the 14th five year plan 2022-2028
Lesson 13 of the Blue Bridge Cup -- tree array and line segment tree [exercise]
[combinatorics] generating function (use generating function to solve the number of solutions of indefinite equation)
ES6类的继承
远程办公工具分享|社区征文
[untitled]
Implementation of Tetris in C language
Brief introduction to the core functions of automatic penetration testing tool
Inheritance of ES6 class
Class exercises
基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition
[教程]在 CoreOS 上构建你的第一个应用
AcWing 271. 杨老师的照相排列【多维DP】
Write a program to process a list container of string type. Find a special value in the container 9.27: and delete it if found. Rewrite the above procedure with deque container.
Discussion sur la logique de conception et de mise en oeuvre du processus de paiement
Kotlin的协程:上下文
link preload prefetch
聊聊支付流程的设计与实现逻辑