WIP: snapshot before repo migration
This commit is contained in:
22
jxbeye/lib/FTServo/examples/HLSCL/WritePos/WritePos.ino
Normal file
22
jxbeye/lib/FTServo/examples/HLSCL/WritePos/WritePos.ino
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <SCServo.h>
|
||||
|
||||
HLSCL hlscl;
|
||||
|
||||
void setup()
|
||||
{
|
||||
//Serial1.begin(1000000, SERIAL_8N1, 18, 17);//esp32-s3
|
||||
Serial1.begin(1000000);//mega2560
|
||||
hlscl.pSerial = &Serial1;
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
//舵机(ID1)以最高速度V=60*0.732=43.92rpm,加速度A=50*8.7deg/s^2,最大扭矩电流T=500*6.5=3250mA,运行至P1=4095位置
|
||||
hlscl.WritePosEx(1, 4095, 60, 50, 500);
|
||||
delay((4095-0)*1000/(60*50) + (60*50)*10/(50) + 50);//[(P1-P0)/(V*50)]*1000+[(V*50)/(A*100)]*1000 + 50(误差)
|
||||
|
||||
//舵机(ID1)以最高速度V=60*0.732=43.92rpm,加速度A=50*8.7deg/s^2,最大扭矩电流T=500*6.5=3250mA,运行至P0=0位置
|
||||
hlscl.WritePosEx(1, 0, 60, 50, 500);
|
||||
delay((4095-0)*1000/(60*50) + (60*50)*10/(50) + 50);//[(P1-P0)/(V*50)]*1000+[(V*50)/(A*100)]*1000 + 50(误差)
|
||||
}
|
||||
Reference in New Issue
Block a user