当前位置:网站首页>stm32和电机开发(上位系统)
stm32和电机开发(上位系统)
2022-07-02 06:36:00 【嵌入式-老费】
【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】
电机本身的开发一般都是用PID或者FOC完成的。但是,作为一个系统来说,在stm32之前,一般还会有一个主机系统,这个主机系统一般跑linux系统或者是windows系统。如果是linux系统,那么一般是各种各样的soc;如果是windows系统,一般就是pc电脑了。

为了说明电机控制系统和上层是怎么交互的,我们可以拿写字机做一个说明。写字机一般是拿pc当作主机进行处理,对图像进行预处理后,生成一条一条的控制命令。这些命令,通过串口发送给stm32,经过串口解析、插值、速度规划、x/y/z控制之后,就可以把对应的图像通过笔的书写打印出来。类似的方法还可以用于雕刻、3d打印等场合。
有了上面的说明,我们可以尝试理解下,一个主机系统需要做哪些动作;
a)扫描图像;
b)灰度处理;
c)生成控制指令;
d)通过串口将这些指令发送给mcu;
e)接收执行结果,将进展反馈到屏幕上面。
上面说的是写字机。我们可以换一种场景,比如说机器人。假设有这么一个三只轮子的机器人,前面是主动轮,它可以前进、后退、左右旋转,后面是从动轮,没有任何控制。如果设计目标是让这个机器人从A点走到B点,那么它应该怎么做呢?一般来说,可以分解成这么几个步骤来完成,
a)利用搜路算法,搜索一条没有障碍的路;
b)依据最小转弯半径要求将这条路进行分段处理,有最小段距离要求;
c)再根据速度限制条件规划出每一段的入口速度、出口速度、入口角度、出口角度;
d)将路径信息、转弯半径信息、速度信息、角度信息、分段信息发送mcu;
e)循环接收执行结果,将进展实时通过log打印出来。
通过上面的两个系统,我们发现上位系统更偏重于算法的整体布局。等算法这部分做好了,再全部交给mcu来执行。因此,控制才是mcu的强项,算法不是。毕竟,mcu的频率和性能都在那放着,不能指望mcu做超出它能力的事情。
电机的实际使用范围非常广泛,不管是消费领域、工业领域、军工领域,都发挥着巨大的作用。控制好电机只是第一步,最主要的还是用上位系统生成控制指令,发送给电机,让它来正常工作满足我们的需求,这才是学习电机的根本目的,不能仅仅是为了学习电机而学习电机。不同的场景,控制的要求也不同,比如有的要求更快,有的要求更准,有的要求成本更低,每一种场景都有自己特定的约束条件,这些只能在工作中不断练习和感受了。
边栏推荐
- [200 Shengxin literatures] 95 multiomics exploration TNBC
- Basic usage of mock server
- Blender石头雕刻
- [ue5] two implementation methods of AI random roaming blueprint (role blueprint and behavior tree)
- 【MySQL】连接MySQL时出现异常:Connection must be valid and open
- 【避坑指南】使用UGUI遇到的坑:Text组件无法首行缩进两格
- Junit4 runs MVN test test suite upgrade scheme
- 【UE5】AI随机漫游蓝图两种实现方法(角色蓝图、行为树)
- 网络通信学习
- 合并有序数列
猜你喜欢

Introduction and Principle notes of UE4 material

Sum the two numbers to find the target value

Alibaba cloud Prometheus monitoring service

UE4夜间打光笔记

Notes de base sur les plans illusoires d'IA (triés en 10 000 mots)
![[pit avoidance guide] pit encountered using ugui: the text component cannot indent the first line by two spaces](/img/6f/e5a30dae824ccb22d1157818be58be.png)
[pit avoidance guide] pit encountered using ugui: the text component cannot indent the first line by two spaces

【MySQL】连接MySQL时出现异常:Connection must be valid and open

Blender stone carving

Eslint reports an error

pytest学习--base
随机推荐
How to achieve the top progress bar effect in background management projects
webUI自动化学习
Tee command usage example
Ue5 - AI pursuit (blueprint, behavior tree)
Pycaret | a few lines of code to solve machine learning modeling
2837xd code generation module learning (2) -- ADC, epwm module, timer0
【MySQL】连接MySQL时出现异常:Connection must be valid and open
Project practice, redis cluster technology learning (16)
Applet development summary
Blender模型导入ue、碰撞设置
Alibaba cloud ack introduction
【虚幻】自动门蓝图笔记
Post disaster reconstruction -- Floyd thought
Test -- Summary of interview questions
ue虛幻引擎程序化植物生成器設置——如何快速生成大片森林
[pit avoidance guide] pit encountered by unity3d project when accessing Tencent bugly tool
【避坑指南】使用UGUI遇到的坑:Text组件无法首行缩进两格
[IDL] Research
Vscode set JSON file to format automatically after saving
It is the most difficult to teach AI to play iron fist frame by frame. Now arcade game lovers have something