当前位置:网站首页>A4988 and 42 stepper motors
A4988 and 42 stepper motors
2022-07-02 18:09:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
A4988 Motor drive board pin
VMOT: Power supply positive (8~35V), Supply motor GND: Motor grounding 2B,2A: Motor windings 2 Control pin 1A.1B: Motor windings 1 Control pin VDD: The power supply of the drive board is (3~5V) GND: Drive plate ENABLE: Pin low level ,A4988 Only then can the motor drive work ( Hanging is the default state , It works ), High level ,A4988 It will not be driven by the traveling motor MS1,MS2,MS3: It is used to change the driving mode, as shown in the figure REST: Low level active ,A4988 Reset the meridian line , The default is high , It works SLEEP: Low level operation and low energy consumption sleep state , It can be used with REST Connect , It will keep working normally and will not enter the state of low energy consumption . STEP: Step pin , Act according to the pulse DIR: Direction pin , low : Clockwise , high : Anti-clockwise
A46988 The voltage should be adjusted before use
voltage = Maximum current ( Motor current )X A4988 resistance X8( This case v=1.50.18=1.2) The general resistance is 0.05 o ,0.1 o ,0.2 o The potentiometer adjusts the voltage : Turn it up clockwise , Turn it down counterclockwise ( Use a multimeter to measure the potentiometer and the grounding terminal )
For this test arduino Development board
Procedure 1 : Rotate clockwise , Rotate quickly counterclockwise 2 circle
// Define constants for motor control
// A4988 Connect Arduino Pin number
const int dirPin = 2; // Direction pin
const int stepPin = 3; // Step pin
// Motor steps per revolution
const int STEPS_PER_REV = 200;
void setup() {
// Arduino control A4988 The step and direction pins are in output mode
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
// Set the motor to rotate clockwise
digitalWrite(dirPin,LOW);
// The motor rotates slowly
for(int x = 0; x < STEPS_PER_REV; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000); // Delay 2000 Microsecond delayMicroseconds most 16383
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
}
// Wait a second
delay(1000);
// Set the motor to rotate counterclockwise
digitalWrite(dirPin,HIGH);
// The motor rotates rapidly
for(int x = 0; x < (STEPS_PER_REV * 2); x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin,LOW);
delayMicroseconds(1000);
}
// Wait a second
delay(1000);
}Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148253.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢

Wechat nucleic acid detection and appointment applet system graduation design (3) background function

In Linux, MySQL sets the job task to start automatically

Embedded ~ introduction

Asemi rectifier bridge umb10f parameters, umb10f specifications, umb10f package

微信核酸检测预约小程序系统毕业设计毕设(1)开发概要

Customize a loading instruction

finally详解

Two pieces of nature a day! Duan Fengfeng, an alumnus of the University of science and technology of China, was the third Chinese winner of the belby medal

MySQL advanced - transaction and index

Explain kubernetes network model in detail
随机推荐
MySQL安装与配置
怎么可以省去大量的switch语句,省去switch语句
Explain kubernetes network model in detail
Songhan sn8p2511 sop8 single chip microcomputer can be used for burning, providing single chip microcomputer scheme development and single chip microcomputer decryption
Deep understanding of ThreadLocal
Graduation summary
Redisson high performance redis distributed lock source code analysis
微信核酸检测预约小程序系统毕业设计毕设(1)开发概要
Yingguang single chip microcomputer development specification pmc131 with AD chip to detect battery voltage single chip microcomputer sop8/14
面试,关于线程池的那些事
如何开启IDEA的Run Dashboard功能
切换变换的时候记得使用三元表达式
深入理解ThreadLocal
自定义一个loading指令
Enter a valid user name and password in the Microsoft LDAP configuration page, and enter a valid user name in the Microsoft LDAP configuration page
vi/vim 删除:一行, 一个字符, 单词, 每行第一个字符 命令
Embedded development board ~ description
如何下载微信支付证书(API证书)
读写 XML/JSON/INI 和 UBJSON 等格式的数据文件的统一接口
Huimang micro IO MCU ft60f010a-urt