由于行业中最先进的步进电机驱动器,体验绝对无噪音的电机运行,同时实现最大效率和最佳电机转矩。
A
A
硬件概览
它是如何工作的?
Silent Step 4 Click基于Analog Devices的TMC2240,这是一款智能集成步进驱动器。它高度集成,高效率,并具有一流的性能步进驱动器。每个H桥的最大输出电流为3A,由板载电阻器设置。但是,您可以通过软件将其设置为较低水平。步进驱动器还具有丰富的诊断和保护功能,如短路保护/OCP、热关断和欠压锁定。它可以测量驱动器温度,估算电机温度等。一个很酷的功能是将旋转编码器接口直接集成到步进驱动器中。外部增量编码器可以通过ENC连接器连接。编码
器可用于在编码器位置和外部斜坡发生器位置之间动态一致性检查。提供32位编码器计数器。StallGuard2是检测电机堵转的一个很好的功能,并且是步进驱动器的诊断系统的一部分。Silent Step 4 Click使用4线SPI串行接口与主机MCU通信,支持最大频率高达10MHz。电机通过STP和DIR引脚上的步进和方向输入来控制。每个步进可以是完整步进或微步进。附加功能是通过NXP的8位I/O端口PCA9538提供的。PCA9538使用I2C接口与主机MCU通信。I2C地址可以通过
ADDR SEL跳线设置。它提供了对DIAG输出和过压指示器的监视。它还控制步进驱动器的使能和休眠输入。主机MCU可以通过RST引脚重置PCA9538,并通过INT引脚接收中断。该Click板™可以通过VCC SEL跳线选择3.3V或5V逻辑电压级别。这样,既支持3.3V又支持5V的MCU可以正常使用通信线路。此外,该Click板™配备了一个包含易于使用的功能和示例代码的库,可用作进一步开发的参考。
功能概述
开发板
Curiosity PIC32 MZ EF 开发板是一个完全集成的 32 位开发平台,特点是高性能的 PIC32MZ EF 系列(PIC32MZ2048EFM),该系列具有 2MB Flash、512KB RAM、集成的浮点单元(FPU)、加密加速器和出色的连接选项。它包括一个集成的程序员和调试器,无需额外硬件。用户可以通过 MIKROE
mikroBUS™ Click™ 适配器板扩展功能,通过 Microchip PHY 女儿板添加以太网连接功能,使用 Microchip 扩展板添加 WiFi 连接能力,并通过 Microchip 音频女儿板添加音频输入和输出功能。这些板完全集成到 PIC32 强大的软件框架 MPLAB Harmony 中,该框架提供了一个灵活且模块化的接口
来应用开发、一套丰富的互操作软件堆栈(TCP-IP、USB)和易于使用的功能。Curiosity PIC32 MZ EF 开发板提供了扩展能力,使其成为连接性、物联网和通用应用中快速原型设计的绝佳选择。
微控制器概述
MCU卡片 / MCU

建筑
PIC32
MCU 内存 (KB)
2048
硅供应商
Microchip
引脚数
100
RAM (字节)
524288
你完善了我!
配件
使用的MCU引脚
mikroBUS™映射器
“仔细看看!”
Click board™ 原理图

一步一步来
项目组装
实时跟踪您的结果
应用程序输出
1. 应用程序输出 - 在调试模式下,“应用程序输出”窗口支持实时数据监控,直接提供执行结果的可视化。请按照提供的教程正确配置环境,以确保数据正确显示。

2. UART 终端 - 使用UART Terminal通过USB to UART converter监视数据传输,实现Click board™与开发系统之间的直接通信。请根据项目需求配置波特率和其他串行设置,以确保正常运行。有关分步设置说明,请参考提供的教程。

3. Plot 输出 - Plot功能提供了一种强大的方式来可视化实时传感器数据,使趋势分析、调试和多个数据点的对比变得更加直观。要正确设置,请按照提供的教程,其中包含使用Plot功能显示Click board™读数的分步示例。在代码中使用Plot功能时,请使用以下函数:plot(insert_graph_name, variable_name);。这是一个通用格式,用户需要将“insert_graph_name”替换为实际图表名称,并将“variable_name”替换为要显示的参数。

软件支持
库描述
该库包含 Silent Step 4 Click 驱动程序的 API。
关键功能:
silentstep4_set_direction
- 该函数通过设置DIR引脚的逻辑状态来设置电机方向。silentstep4_set_step_res
- 该函数在CHOPCONF寄存器中设置微步分辨率位。silentstep4_drive_motor
- 该函数以所选速度驱动电机进行特定数量的步进。
开源
代码示例
完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio。 应用程序代码也可以在MIKROE的GitHub账户中找到。
/*!
* @file main.c
* @brief Silent Step 4 Click example
*
* # Description
* This example demonstrates the use of the Silent Step 4 click board by driving the
* motor in both directions for a desired number of steps.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the click default configuration.
*
* ## Application Task
* Drives the motor clockwise for 200 full steps and then counter-clockiwse for 200 half
* steps and 400 quarter steps with 2 seconds delay on driving mode change. All data is
* being logged on the USB UART where you can track the program flow.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "silentstep4.h"
static silentstep4_t silentstep4;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
silentstep4_cfg_t silentstep4_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
silentstep4_cfg_setup( &silentstep4_cfg );
SILENTSTEP4_MAP_MIKROBUS( silentstep4_cfg, MIKROBUS_1 );
err_t init_flag = silentstep4_init( &silentstep4, &silentstep4_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( SILENTSTEP4_ERROR == silentstep4_default_cfg ( &silentstep4 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
log_printf ( &logger, " Move 200 full steps clockwise, speed: slow\r\n\n" );
silentstep4_set_direction ( &silentstep4, SILENTSTEP4_DIR_CW );
silentstep4_set_step_res ( &silentstep4, SILENTSTEP4_MRES_FULLSTEP );
silentstep4_drive_motor ( &silentstep4, 200, SILENTSTEP4_SPEED_SLOW );
Delay_ms ( 2000 );
log_printf ( &logger, " Move 200 half steps counter-clockwise, speed: medium\r\n\n" );
silentstep4_set_direction ( &silentstep4, SILENTSTEP4_DIR_CCW );
silentstep4_set_step_res ( &silentstep4, SILENTSTEP4_MRES_2 );
silentstep4_drive_motor ( &silentstep4, 200, SILENTSTEP4_SPEED_MEDIUM );
Delay_ms ( 2000 );
log_printf ( &logger, " Move 400 quarter steps counter-clockwise, speed: fast\r\n\n" );
silentstep4_set_direction ( &silentstep4, SILENTSTEP4_DIR_CCW );
silentstep4_set_step_res ( &silentstep4, SILENTSTEP4_MRES_4 );
silentstep4_drive_motor ( &silentstep4, 400, SILENTSTEP4_SPEED_FAST );
Delay_ms ( 2000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END