基于MATLAB的霍尔传感器特性实验报告

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
基于 MATLAB 的霍尔传感器特性实验 一.V-X 关系曲线、线性度
拟合关系式: y = −4.1x − 0.024
所以其灵敏度
kn
=
y x
=
4.1
二. 重复性
三. 迟滞性
重复性误差 eR
=
max yFS
= 0.0059
et
=
max yFS
=
0.0301
四.MATLAB 程序
%% 要求:线性、重复性、灵敏度、迟滞曲线
%% 绘图
figure
plot(x(:,1:6),z(:,1:6),'LineWidth',2,'Color',[0 0 1]);
hold on
plot(x(:,1:6),f(:,1:6),'DisplayName','反行程','LineWidth',2,'Color',[0 1 0]);
plot(x(:,6:10),z(:,6:10),'LineWidth',2,'Color',[1 0 0]);
close all
clear all
clc
%% 数据导入
x=0:0.5:4.5;
%% 霍尔效应
z1=[0.00 10.19 ];
-2.10 -4.06 -6.14 -8.28 -10.15 -10.19 -10.19 -10.19 -
f1=[-0.23 10.19 ];
-2.18 -4.25 -6.46 -8.72 -10.17 -10.19 -10.19 -10.19 -
plot(x(:,1:6),z1(:,1:6),'LineWidth',1,'Color',[0 0 1]); hold on plot(x(:,1:6),f1(:,1:6),'DisplayName','反行程','LineWidth',1,'Color',[0 1 0]);
plot(x(:,1:6),z2(:,1:6),'LineWidth',1,'Color',[0 0 1]); hold on plot(x(:,1:6),f2(:,1:6),'DisplayName','反行程','LineWidth',1,'Color',[0 1 0]);
%% 霍尔传感器实验,要求:线性、重复性、灵敏度、迟滞 close all clear all clc
%% 数据导入 x=0:0.5:4.5;
z1=[0.00 10.19 ];
-2.10 -4.06 -6.14 -8.28 -10.15 -10.19 -10.19 -10.19 -
f1=[-0.23 10.19 ];
plot(x(:,6:10),z2(:,6:10),'LineWidth',1,'Color',[1 0 0]);
plot(x(:,6:10),f2(:,6:10),'LineWidth',1);
plot(x(:,6:10),z3(:,6:10),'LineWidth',1,'Color',[1 0 0]); plot(x(:,6:10),f3(:,6:10),'LineWidth',1); %% 标注 title('霍尔传感器特性实验 V-X 曲线(重复性)') grid on xlabel('位移(mm)') ylabel('输出电压(mv)') legend('正行程第 1 组','反行程第 1 组','正行程第 2 组','反行程第 2 组',...
'正行程第 3 组','反行程第 3 组','正行程第 1 组极限','反行程第 1 组极限',... '正行程第 2 组极限','反行程第 2 组极限','正行程第 3 组极限','反行程第 3 组极限') axis([0 4.6 -12 0]) %% 计算最大不重复误差\delta_MAX z_a=abs(z1(:,1:6)-z2(:,1:6)); z_b=abs(z1(:,1:6)-z3(:,1:6));
-2.07 -4.12 -6.12 -8.28 -10.16 -10.19 -10.19 -10.19 -
f3=[0.00 10.19 ];
-1.95 -4.06 -6.25 -8.56 -10.17 -10.19 -10.19 -10.19 -
%% 求平均值
z=(z1+z2+z3)/3;
Hale Waihona Puke f=(f1+f2+f3)/3;
z3=[0.00 10.19 ];
-2.07 -4.12 -6.12 -8.28 -10.16 -10.19 -10.19 -10.19 -
f3=[0.00 10.19 ];
-1.95 -4.06 -6.25 -8.56 -10.17 -10.19 -10.19 -10.19 -
%% 绘图
figure
plot(x(:,1:6),z3(:,1:6),'LineWidth',1,'Color',[0 0 1]); hold on plot(x(:,1:6),f3(:,1:6),'DisplayName','反行程','LineWidth',1,'Color',[0 1 0]);
plot(x(:,6:10),z1(:,6:10),'LineWidth',1,'Color',[1 0 0]); plot(x(:,6:10),f1(:,6:10),'LineWidth',1);
plot(x(:,6:10),f(:,6:10),'LineWidth',2);
%% 标注
title('霍尔传感器特性实验 V-X 曲线(线性)')
xlabel('位移(mm)') ylabel('输出电压(mv)') grid on legend('正行程','反行程','正行程极限','反行程极限') axis([0 4.6 -12 0]) %% 计算迟滞 delta_MAX=max(abs(z-f)) et=delta_MAX/abs(min(z1))
z2=[0.00 10.20 ];
-2.09 -4.10 -6.14 -8.30 -10.16 -10.20 -10.20 -10.20 -
f2=[0.01 10.20 ];
-1.96 -4.03 -6.26 -8.50 -10.17 -10.20 -10.20 -10.20 -
z3=[0.00 10.19 ];
-2.18 -4.25 -6.46 -8.72 -10.17 -10.19 -10.19 -10.19 -
z2=[0.00 10.20 ];
-2.09 -4.10 -6.14 -8.30 -10.16 -10.20 -10.20 -10.20 -
f2=[0.01 10.20 ];
-1.96 -4.03 -6.26 -8.50 -10.17 -10.20 -10.20 -10.20 -
相关文档
最新文档