今天介绍步进马达,疑?昨天不是才说过马达吗?昨天的是伺服马达,今天的则是伺服马达
这两者有甚麽不一样吗?伺服马达能转到指定的角度,但是步进马达则是转过指定的角度,甚麽意思呢?
伺服马达控制转到75°位置,可是步进马达是以目前为初始方向连续转75°,步进马达没有像伺服马达限制角度范围所以可以一直转。
伺服马达 | 步进马达 |
---|---|
转到指定角度 | 转过指定角度 |
3条线 | 4~6条线 |
步进马达采用脉冲信号驱动,每次以一定角度逐步转动,可简单实现精准的定位运转,在机器人领域上也得到广泛的应用。
步进马达因为需要足够多的电流供给,所以通常会搭配 IC ULN2003驱动作使用。
我们可以透过控制1~4脚输出不同的变化让马达连续运转,如下表刚好是一个循环,一个循环大约旋转0.7度
step | A | B | C | D |
---|---|---|---|---|
1 | 1 | 0 | 0 | 0 |
2 | 0 | 1 | 0 | 0 |
3 | 0 | 0 | 1 | 0 |
4 | 0 | 0 | 0 | 1 |
基本设定:
RCC → HSE、LSE → Crystal/Ceramic Resonator✅
SYS → Debug Serial Wire ✅
额外设定:
GPIOA → PA0 ~ PA3 → GPIO_Output
最快32MHz
// 正转
while(1)
{
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_0 , GPIO_PIN_SET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_1 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_2 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_3 , GPIO_PIN_RESET );
HAL_Delay(1);
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_0 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_1 , GPIO_PIN_SET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_2 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_3 , GPIO_PIN_RESET );
HAL_Delay(1);
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_0 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_1 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_2 , GPIO_PIN_SET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_3 , GPIO_PIN_RESET );
HAL_Delay(1);
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_0 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_1 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_2 , GPIO_PIN_RESET );
HAL_GPIO_WritePin (GPIOA , GPIO_PIN_3 , GPIO_PIN_SET );
HAL_Delay(1);
}
- STM32 Nucleo-64 boards (MB1136)资料手册
https://www.st.com/resource/en/user_manual/dm00105823-stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf- STM32L053R8 datasheet
https://www.st.com/resource/en/datasheet/stm32l053r8.pdf- RM0367 Reference manual Ultra-low-power STM32L0x3 advanced Arm®-based 32-bit MCUs
https://www.st.com/resource/en/reference_manual/dm00095744-ultra-low-power-stm32l0x3-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf- ARM Mbed官网介绍 - NUCLEO-L053R8
https://os.mbed.com/platforms/ST-Nucleo-L053R8/- STM32 官网介绍 - STM32L053R8
https://www.st.com/en/microcontrollers-microprocessors/stm32l053r8.html#overview
- 此开发板售价在台币1000元以下,读者可於以下网站购得:
https://www.mouser.tw/
https://www.digikey.tw/
30天好快
<<: [3D地图-CesiumJS系列] 三、车辆废气排放地图 - 以粒子系统(Particle system)实作
>>: [Day 29] - Gatsby v.s. Next
join 利用栏位的关联性,将不同的资料表串连起来。 students 资料表 s_id name ...
今天继续来练习阴影~ 因为要方便练习~ 所以选一个简单的圆形怪物 我就选了瓦斯弹~ 用他来练习阴影 ...
Hashicorp Nomad: Inspect a job 当一套工具有一个好的Web UI可以使...
这期要介绍抬头显示器(HUD)的一些功能和种类,让我们马上开始。 抬头显示器可用於汽车上。它将讯息投...
现在有一些还不错的网站有在蒐集各校段考考古题 例如:全国中小学题库网、昌爸工作坊 等等 由於我国着作...