当前位置:网站首页>基于Labview上位机的51单片机步进电机控制系统(上位机代码+下位机源码+ad原理图+51完整开发环境)
基于Labview上位机的51单片机步进电机控制系统(上位机代码+下位机源码+ad原理图+51完整开发环境)
2022-04-23 06:14:00 【锦官城外w】
功能说明:
1.步进电机运行状态通过VISA串口实时传输至上位机,上位机以曲线显示,并可存储数据。
2.上位机可发送步进电机运行角度、速度指令至下位机,控制步进电机。
3.按键控制电机正反转以及调速。
4.labview可以excel或txt格式存储电机运行数据,并读取复现运行曲线(数据回放功能)。
注意事项:
下位机处理器:STC89C51/STC89C52
上位机:Labview2018+VISA串口
按键控制步进电机
相关引脚连线中文注释:
#include<reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define MotorData P0 //步进电机控制接口定义
uchar phasecw[4] ={
0x08,0x04,0x02,0x01};//正转 电机导通相序 D-C-B-A
uchar phaseccw[4]={
0x01,0x02,0x04,0x08};//反转 电机导通相序 A-B-C-D
uchar motor_state=0; //0 停 1正转 2反转
uchar motor_speed=5; //5-25 快-慢
sbit key1=P1^1; //正转按键
sbit key2=P1^2; //反转按键
sbit key3=P1^0; //调速按键
主函数程序:
void
main(void)
{
Delay_xms(50); //等待系统稳定
Timer_Init(); //初始化定时器
while(1)
{
key_scan(); //扫描按键
if(motor_state==0) MotorStop(); //停止转动
else if(motor_state==1)MotorCW(motor_speed); //顺时针转动角度
else if(motor_state==2)MotorCCW(motor_speed);//逆时针转动角度
}
}
包含资料如下所示:

上位机运行截图:

全部资料链接见评论区,有问题请留言~
作者:amusen
时间:2022.4
祝好!
版权声明
本文为[锦官城外w]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_41740659/article/details/124329331
边栏推荐
- 安装 pycuda 出现 PEP517 的错误
- PyTorch 9. 优化器
- Infrared sensor control switch
- 第4章 Pytorch数据处理工具箱
- GIS实战应用案例100篇(三十四)-拼接2020globeland30
- AUTOSAR从入门到精通100讲(五十一)-AUTOSAR网络管理
- pth 转 onnx 时出现的 gather、unsqueeze 等算子
- unhandled system error, NCCL version 2.7.8
- Computer shutdown program
- torch.mm() torch.sparse.mm() torch.bmm() torch.mul() torch.matmul()的区别
猜你喜欢

1.1 pytorch and neural network

1.2 preliminary pytorch neural network

rearrange 和 einsum 真的优雅吗

机器学习——PCA与LDA
![[point cloud series] pnp-3d: a plug and play for 3D point clouds](/img/83/3662bc668602110236e43ee0b9d7ac.png)
[point cloud series] pnp-3d: a plug and play for 3D point clouds

AUTOSAR从入门到精通100讲(八十一)-AUTOSAR基础篇之FiM

Modifying a column with the 'identity' pattern is not supported

Systrace 解析
Raspberry Pie: two color LED lamp experiment

Chapter 2 pytoch foundation 1
随机推荐
AUTOSAR从入门到精通100讲(五十)-AUTOSAR 内存管理系列- ECU 抽象层和 MCAL 层
【点云系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation
【点云系列】Multi-view Neural Human Rendering (NHR)
【点云系列】 A Rotation-Invariant Framework for Deep Point Cloud Analysis
Chapter 8 generative deep learning
Device Tree 详解
torch. mm() torch. sparse. mm() torch. bmm() torch. Mul () torch The difference between matmul()
torch.where能否传递梯度
pth 转 onnx 时出现的 gather、unsqueeze 等算子
Thanos. SH kill bully script, easily delete half of the files in the system at random
[3D shape reconstruction series] implicit functions in feature space for 3D shape reconstruction and completion
LPDDR4笔记
MySQL数据库安装与配置详解
Visual studio 2019 installation and use
【点云系列】Fully-Convolutional geometric features
[8] Assertion failed: dims.nbDims == 4 || dims.nbDims == 5
【点云系列】SO-Net:Self-Organizing Network for Point Cloud Analysis
面试总结之特征工程
EasyUI combobox determines whether the input item exists in the drop-down list
[Point Cloud Series] SG - Gan: Adversarial Self - attachment GCN for Point Cloud Topological parts Generation