自学内容网 自学内容网

电机线电流与转差率曲线的工程测量

1.电机T型等效电路模型

1.1 Python代码 - 考虑转差率为负

import numpy as np
import matplotlib.pyplot as plt
# 设置已知参数值
rm = 11.421
lm = 553.9e-3
r2 = 7.553
l2 = 42.90e-3
freq_in = 50

# 设置频率值范围和步长
s = np.linspace(-0.05, 0.05, 1000)
im = 380/(rm+(lm+l2)*2*np.pi*freq_in*1j)/np.sqrt(3);

# 计算并绘制曲线
curr_in = (im + im*(rm+(lm+l2)*2*np.pi*freq_in*1j)/(r2 + l2*2*np.pi*freq_in*1j + (1-s)/s*r2))
plt.plot(np.abs(curr_in), s)
plt.xlabel('Absolute value of curr_in')
plt.ylabel('Power out')
plt.title('s of rated power is 2A, the max Y-axis = 5%(but engine''s rated s = 2%, I think it is wrong.)')
# 绘制横线
horiz_line = plt.axhline(y=0.05, color='r', linestyle='--', label='"s" == rated power of engine')
horiz_line = plt.axhline(y=0, color='r', linestyle='--', label='"s" == 0')
# 添加图例
plt.legend()

plt.show()

1.2 I-s曲线

8734698c34b84c3591617606a7f78f34.png

注意在s = 0附近:

184ea17193a949dc9cf9f995503667c8.png

你会发现输出电流最小的位置,并不在转差率 = 0是,而是在转差率达到某个负值的时候——转差率为负,意味着此时电机的负载等效电阻是个负值,在中和掉整个电路的视在等效电阻后,此时的电路转为纯感性电路,此时,电流才会出现极小值,越过这条线,转差率继续向负半周偏移——此时,电机并不是在做功,而是作为一台发电机在工作。就是此时电机正转,但是反拉,提供的力矩与旋转方向相反,克服掉重物的力矩,匀速下滑。

2.不同负载,上下行时的线电流差异

2.1 Python代码

import numpy as np
import matplotlib.pyplot as plt

# 设置已知参数值
rm = 11.421
lm = 553.9e-3
r2 = 7.553
l2 = 42.90e-3
freq_in = 50
im = 380/(rm+(lm+l2)*2*np.pi*freq_in*1j)/np.sqrt(3);

s = np.linspace(0, -0.05, 1000)
curr_in_download = (im + im*(rm+(lm+l2)*2*np.pi*freq_in*1j)/(r2 + l2*2*np.pi*freq_in*1j + (1-s)/s*r2))


# 设置频率值范围和步长
s = np.linspace(0, 0.05, 1000)
# 计算并绘制曲线
curr_in_upword = (im + im*(rm+(lm+l2)*2*np.pi*freq_in*1j)/(r2 + l2*2*np.pi*freq_in*1j + (1-s)/s*r2))


curr_diff_of_updown = curr_in_upword - curr_in_download

plt.plot(np.abs(curr_in_upword), s)
plt.plot(np.abs(curr_diff_of_updown), s)
plt.xlabel('Absolute value of curr_in')
plt.ylabel('Power out')
plt.title('s of rated power is 2A, the max Y-axis = 5%(but engine''s rated s = 2%, I think it is wrong.)')
# 绘制横线
horiz_line = plt.axhline(y=0.05, color='r', linestyle='--', label='"s" == rated power of engine')
horiz_line = plt.axhline(y=0, color='r', linestyle='--', label='"s" == 0')

# 添加图例
plt.legend()

plt.show()

2.2 dI_of(up2down)-s曲线

一个奇迹出现了——转差率和上下行电流差之间呈现出线性关系:(当然,它要考虑到电机的运行方向),此时电流的值是有正负号的。

3bab0b1409634ca4b8ecda0cfec6000c.png

3 代入实际数据校验dI(up&down) -s 的线性特征

3.1 数据筛选:

{
    "engine":"231015062",
    "date":"2024/07/06",
    "curr":[
    {
        "up":21.97,
        "down":21.84
    },
    {
        "up":22.06,
        "down":21.63
    },
    {
        "up":22.12,
        "down":21.67
    },
    {
        "up":21.97,
        "down":21.80
    },
    {
        "up":23.87,
        "down":21.52
    }
    ]
}

3.1.1 数据筛选过程 

a7e2ece083c946e882b2e015a0c3aa17.png

上面这台电机,6日13:10分的最前面这笔数据看起来很像是先空钩下降,然后上升。这是一组完整的数据点,一对儿空钩的电流:

di1 = (21.84a -21.97a)    di = 0.13a,空钩

9d0f69f3b73943c492577efa80c2ee9d.png
 

6日 13:20似乎连续做了两次上下操作:
di2 = (22.06, 21.63) di = 0.43 ...
di3 = (22.12, 21.67) di = 0.45 

ee23fb0ef5624d6baf6779ecf09e25ff.png

di4,这里似乎是又一组:

di4 = (21.97, 21.80) di = 0.17a

找个电流大一点的:

d8c5885f17b84a0594aa711cae5f3ff2.png di5 = (23.87, 21.52) , di = 2.35a

现在把上述5个点,打印出来: 

3.2 数据呈现:

da10176853394bb6ab6b97c4759340b4.png

看起来能看到那个电机曲线的样子对吧?此时这几个数据点似乎还没有达到那个电流极值。 那个蝴蝶结可能无关紧要,仅仅是误差,或者原始数据读取错误。

3.2.1 源码:

import numpy as np
import matplotlib.pyplot as plt
import json
from datetime import datetime

dbFile = "engine_curr.json"

# 读取原始数据文件
with open(dbFile, 'r', encoding='utf-8') as f:
    data = json.load(f)

# 选择id为10到20的数据,并提取需要的字段
ardt = []
armax = []
armin = []
for record in data["curr"]:
     armax.append(float(record["up"]))
     armin.append(float(record["down"]))
     ardt.append(armax[-1] - armin[-1])

ardt_neg = [element * -1.0 for element in ardt]

#绘制:
plt.plot(armax, ardt)
plt.plot(armin, ardt_neg)
plt.ylabel(f's * unknowRatio')
plt.xlabel('current (rms)')
plt.title(f'plc_{data["engine"]}_at{data["date"]}')
# 绘制横线
#horiz_line = plt.axhline(y=0.05, color='r', linestyle='--', label='"s" == rated power of engine')
#horiz_line = plt.axhline(y=0, color='r', linestyle='--', label='"s" == 0')
# 添加图例
plt.legend()
plt.show()

3.3修正显示 - 添加数据点之间的关系

3.3.1 源码(数据同2.3.1)

import numpy as np
import matplotlib.pyplot as plt
import json
from datetime import datetime

dbFile = "engine_curr.json"

# 读取原始数据文件
with open(dbFile, 'r', encoding='utf-8') as f:
    data = json.load(f)

# 选择id为10到20的数据,并提取需要的字段
ardt = []
armax = []
armin = []
pt_of_up = []
pt_of_down = []
for record in data["curr"]:
     armax.append(float(record["up"]))
     armin.append(float(record["down"]))
     ardt.append(armax[-1] - armin[-1])
     pt_of_up.append([armax[-1], ardt[-1]])
     pt_of_down.append([armin[-1], ardt[-1]*-1])
ardt_neg = [element * -1.0 for element in ardt]

#绘制:
for pt in pt_of_up:
    plt.scatter(pt[0], pt[1], color='red', marker='+')
for pt in pt_of_down:
    plt.scatter(pt[0], pt[1], color='blue', marker='x')
for i in np.arange(len(ardt)):
    x1 = pt_of_up[i][0], pt_of_down[i][0]
    y1 = pt_of_up[i][1], pt_of_down[i][1]
    plt.plot(x1, y1, color='lightgrey')
    
plt.ylabel(f's * unknowRatio')
plt.xlabel('current (rms)')
plt.title(f'plc_{data["engine"]}_at{data["date"]}')
# 绘制横线
#horiz_line = plt.axhline(y=0.05, color='r', linestyle='--', label='"s" == rated power of engine')
#horiz_line = plt.axhline(y=0, color='r', linestyle='--', label='"s" == 0')
# 添加图例
plt.legend()
plt.show()

4 拟合 

4.1 源码:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 获取当前脚本文件所在目录的父目录,并构建相对路径
import os
import sys
current_dir = os.path.dirname(os.path.abspath(__file__))
project_path = os.path.join(current_dir, '.')
sys.path.append(project_path)
sys.path.append(current_dir)
os.chdir(current_dir)

import numpy as np
import matplotlib.pyplot as plt
import json
from datetime import datetime


def get_curr_of_engine(dbFile):
    print(os.getcwd())
    # 读取原始数据文件
    with open(dbFile, 'r', encoding='utf-8') as f:
        data = json.load(f)

    # 选择id为10到20的数据,并提取需要的字段
    ardt = []
    armax = []
    armin = []
    pt_of_up = []
    pt_of_down = []
    for record in data["curr"]:
         armax.append(float(record["up"]))
         armin.append(float(record["down"]))
         ardt.append(armax[-1] - armin[-1])
         pt_of_up.append([armax[-1], ardt[-1]])
         pt_of_down.append([armin[-1], ardt[-1]*-1])
    ardt_neg = [element * -1.0 for element in ardt]
    return (pt_of_up, pt_of_down, ardt, data)

def pot_raw_data(pt_of_up, pt_of_down, ardt, data):
    #绘制:
    ptall=[]
    for pt in pt_of_up:
        plt.scatter(pt[0], pt[1], color='red', marker='+')
        ptall.append(pt)
    for pt in pt_of_down:
        plt.scatter(pt[0], pt[1], color='blue', marker='x')
        ptall.append(pt)
    for i in np.arange(len(ardt)):
        x1 = pt_of_up[i][0], pt_of_down[i][0]
        y1 = pt_of_up[i][1], pt_of_down[i][1]
        plt.plot(x1, y1, color='lightgrey')
    
    # 绘制拟合曲线
    (xp, yp) = gen_polyfit_data(ptall, -5, +5)    
    plt.plot(xp, yp, color='grey', label='Fit curve')

    plt.ylabel(f's * unknowRatio')
    plt.xlabel('current (rms)')
    plt.title(f'plc_{data["engine"]}_at{data["date"]}')
    # 绘制横线
    #horiz_line = plt.axhline(y=0.05, color='r', linestyle='--', label='"s" == rated power of engine')
    #horiz_line = plt.axhline(y=0, color='r', linestyle='--', label='"s" == 0')
    # 添加图例
    plt.legend()
    plt.show()

def gen_polyfit_data(ptall, ymin, ymax):
    #拟合前需要按y排序
    ar = np.array(ptall)
    sorted_pt = ar[ar[:,1].argsort()]
    sorted_pt = sorted_pt.tolist()
    x = []
    y = []
    for pt in sorted_pt:
        y.append(pt[1])
        x.append(pt[0])

    # 进行多项式拟合,假设拟合为二阶多项式
    z = np.polyfit(y, x, 2)  # 使用二阶多项式拟合

    # 生成拟合曲线的数据
    yp = np.linspace(ymin, ymax, 100)
    xp = np.polyval(z, yp)

    return (xp, yp)


if __name__ == "__main__":
   dbFile = "./engine_curr.json"    
   #get data
   (pt_of_up, pt_of_down, ardt, data) = get_curr_of_engine(dbFile)
   #raw raw data
   pot_raw_data(pt_of_up, pt_of_down, ardt, data)

可以对比1.2的理论曲线,理论和实验数据似乎是吻合的。

5.后记

本文暂时关闭。2.2节那个线性关系的理论推导,以及3节绘制的图表中,更多的实验数据汇入验证,稍后另起一篇文章进行。 我从去年开始,大概在电机的工程测量上投入了800+小时。


原文地址:https://blog.csdn.net/twicave/article/details/140518979

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!