当前位置:网站首页>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做超出它能力的事情。
电机的实际使用范围非常广泛,不管是消费领域、工业领域、军工领域,都发挥着巨大的作用。控制好电机只是第一步,最主要的还是用上位系统生成控制指令,发送给电机,让它来正常工作满足我们的需求,这才是学习电机的根本目的,不能仅仅是为了学习电机而学习电机。不同的场景,控制的要求也不同,比如有的要求更快,有的要求更准,有的要求成本更低,每一种场景都有自己特定的约束条件,这些只能在工作中不断练习和感受了。
边栏推荐
- UE4 night lighting notes
- 2021-10-04
- 测试--面试题总结
- Junit4 runs MVN test test suite upgrade scheme
- 【Unity3D】制作进度条——让Image同时具有Filled和Sliced的功能
- Understand the composition of building energy-saving system
- Blender stone carving
- Blender model import UE, collision settings
- Edge computing accelerates live video scenes: clearer, smoother, and more real-time
- [jetbrain rider] an exception occurred in the construction project: the imported project "d:\visualstudio2017\ide\msbuild\15.0\bin\roslyn\microsoft.csh" was not found
猜你喜欢

Introduction and prevention of penetration test

Aiphacode is not a substitute for programmers, but a tool for developers

Blender volume fog

Vscode set JSON file to format automatically after saving

Alibaba cloud ack introduction

Application of rxjs operator withlatestfrom in Spartacus UI of SAP e-commerce cloud

【Visual Studio】每次打开一个Unity3D的脚本,都会自动重新打开一个新的VS2017

Sil/pil test of matlab code generation

【Unity3D】嵌套使用Layout Group制作拥有动态子物体高度的Scroll View

Ctrip starts mixed office. How can small and medium-sized enterprises achieve mixed office?
随机推荐
Vscode set JSON file to format automatically after saving
【Unity3D】制作进度条——让Image同时具有Filled和Sliced的功能
Network communication learning
Configuration programmée du générateur de plantes du moteur illusoire UE - - Comment générer rapidement une grande forêt
Alibaba cloud Prometheus monitoring service
【虚幻4】从U3D到UE4的转型之路
[unity3d] production progress bar - make image have the functions of filled and sliced at the same time
[Fantasy 4] the transformation from U3D to UE4
2021-09-12
Delivery mode design of Spartacus UI of SAP e-commerce cloud
2837xd code generation module learning (3) -- IIC, ECAN, SCI, watchdog, ECAP modules
Brief analysis of edgedb architecture
ue虚幻引擎程序化植物生成器设置——如何快速生成大片森林
[unity3d] nested use layout group to make scroll view with dynamic sub object height
It is the most difficult to teach AI to play iron fist frame by frame. Now arcade game lovers have something
测试--面试题总结
ICLR 2022: how does AI recognize "things I haven't seen"?
Alibaba cloud ack introduction
[visual studio] every time you open a script of unity3d, a new vs2017 will be automatically reopened
Following nym, the new project Galaxy token announced by coinlist is gal