mirror of
https://gitee.com/peng_zhihui/Dummy-Robot
synced 2025-09-27 02:09:12 +08:00
[Hw] Add Step-Motor driver PCB.
This commit is contained in:
parent
52c8328f51
commit
d8710adb96
4
1.Hardware/MotorDriver-42/.gitignore
vendored
Normal file
4
1.Hardware/MotorDriver-42/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
History
|
||||
Project Logs for*
|
||||
Project Outputs for*
|
||||
__Previews
|
BIN
1.Hardware/MotorDriver-42/Drive.SchDoc
Normal file
BIN
1.Hardware/MotorDriver-42/Drive.SchDoc
Normal file
Binary file not shown.
BIN
1.Hardware/MotorDriver-42/Interface.SchDoc
Normal file
BIN
1.Hardware/MotorDriver-42/Interface.SchDoc
Normal file
Binary file not shown.
BIN
1.Hardware/MotorDriver-42/MCU.SchDoc
Normal file
BIN
1.Hardware/MotorDriver-42/MCU.SchDoc
Normal file
Binary file not shown.
BIN
1.Hardware/MotorDriver-42/Motor-42.PcbDoc
Normal file
BIN
1.Hardware/MotorDriver-42/Motor-42.PcbDoc
Normal file
Binary file not shown.
1194
1.Hardware/MotorDriver-42/Motor-42.PrjPCB
Normal file
1194
1.Hardware/MotorDriver-42/Motor-42.PrjPCB
Normal file
File diff suppressed because it is too large
Load Diff
5
1.Hardware/MotorDriver-42/Motor-42.PrjPCBStructure
Normal file
5
1.Hardware/MotorDriver-42/Motor-42.PrjPCBStructure
Normal file
@ -0,0 +1,5 @@
|
||||
Record=TopLevelDocument|FileName=Drive.SchDoc|SheetNumber=1
|
||||
Record=NoMainPathDocument|SourceDocument=Drive.SchDoc|FileName=Interface.SchDoc|SheetNumber=1
|
||||
Record=NoMainPathDocument|SourceDocument=Drive.SchDoc|FileName=MCU.SchDoc|SheetNumber=1
|
||||
Record=NoMainPathDocument|SourceDocument=Drive.SchDoc|FileName=Port.SchDoc|SheetNumber=1
|
||||
Record=NoMainPathDocument|SourceDocument=Drive.SchDoc|FileName=Power.SchDoc|SheetNumber=1
|
BIN
1.Hardware/MotorDriver-42/Port.SchDoc
Normal file
BIN
1.Hardware/MotorDriver-42/Port.SchDoc
Normal file
Binary file not shown.
BIN
1.Hardware/MotorDriver-42/Power.SchDoc
Normal file
BIN
1.Hardware/MotorDriver-42/Power.SchDoc
Normal file
Binary file not shown.
@ -134,8 +134,6 @@ DOF6Kinematic::SolveFK(const DOF6Kinematic::Joint6D_t &_inputJoint6D, DOF6Kinema
|
||||
sinq = sinf(q[i]);
|
||||
cosa = cosf(DH_matrix[i][3]);
|
||||
sina = sinf(DH_matrix[i][3]);
|
||||
d = DH_matrix[i][1];
|
||||
a = DH_matrix[i][2];
|
||||
|
||||
R[i][0] = cosq;
|
||||
R[i][1] = -cosa * sinq;
|
||||
|
@ -277,3 +277,11 @@ void DummyHand::SetEnable(bool _enable)
|
||||
else
|
||||
SetMaxCurrent(0);
|
||||
}
|
||||
|
||||
float DummyHand::GetAngle()
|
||||
{
|
||||
uint8_t mode = 0x33;
|
||||
txHeader.StdId = nodeID << 7 | mode;
|
||||
|
||||
CanSendMessage(get_can_ctx(hcan), canBuf, &txHeader);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
void SetAngle(float _angle);
|
||||
void SetMaxCurrent(float _val);
|
||||
void SetEnable(bool _enable);
|
||||
float GetAngle();
|
||||
|
||||
// Communication protocol definitions
|
||||
auto MakeProtocolDefinitions()
|
||||
|
@ -35,8 +35,6 @@ void ThreadControlLoop(void* argument)
|
||||
mpu6050.Update(true);
|
||||
|
||||
dummy.UpdateJointPos();
|
||||
|
||||
// motorJ1.SetSpeedSetPoint(mpu6050.data.gz * 10000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
* 已添加REF的硬件设计文件
|
||||
* 已添加DummyStudio上位机
|
||||
* 已添加Dummy核心控制器的固件代码(使用说明见后文)
|
||||
* 已添加步进电机驱动器硬件工程(固件每个关节电机有一些区别,会以多个hex形式发布,源码可以直接去XDrive的仓库查看)
|
||||
|
||||
## 关于结构设计
|
||||
|
||||
@ -82,6 +83,8 @@ Peak基于X-Track项目,大家可以去Peak仓库查看。
|
||||
|
||||
然后关节角到电机驱动器输入信号的转换这一块,我使用的是梯形加减速曲线进行速度位置规划。举个例子在MoveJ指令中,当收到一个关节角运动指令,控制器会进行运动角度差分计算,得到6个运动差分角度,然后取6个差分角中最大的角θ,同时根据设置的JointSpeed参数计算运动θ角需要的时间(考虑上加减速),把这一时间作为其余5个电机的运动参数计算各自的加减速度&最高速度,然后6个电机根据计算的参数同步运动,就可以保证其同步性和流畅性了。
|
||||
|
||||
另外六个电机使用CAN总线连接,每个电机接受两个ID号的信息(自己的ID、0号ID),0号ID作为信息广播和同步用。电机接收到运动指令后将信息储存在影子寄存器中,待收到广播的同步信号后开始运动,这样能进一步保证电机同步性。
|
||||
|
||||
最后,动力学部分还在开发中,这块暂时没有完全实现。上**述的运动学和动力学算法都强烈建议去看一下《机器人学导论》这本书**,里面写得非常详细。
|
||||
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user