Browse Source

update

master
zhaohe 1 year ago
parent
commit
7597f331ad
  1. 2
      a8000_protocol
  2. 2
      sdk
  3. 4
      usrc/main.cpp
  4. 58
      usrc/subboards/subboard10_hbot/pri_board.h
  5. 117
      usrc/subboards/subboard10_hbot/subboard10_hbot.cpp
  6. 25
      usrc/subboards/subboard10_hbot/subboard10_hbot.hpp
  7. 41
      usrc/subboards/subboard10_hbot/subboard10_hbot_board.c
  8. 12
      usrc/subboards/subboard10_hbot/subboard10_hbot_board.h
  9. 60
      usrc/subboards/subboard10_hbot_v2/pri_board.h
  10. 101
      usrc/subboards/subboard10_hbot_v2/subboard10_hbot_v2.cpp

2
a8000_protocol

@ -1 +1 @@
Subproject commit e4a80570d108c0a711401236f95bbc95b4ae7ecf
Subproject commit 044d6a286e8a6e7298cc15e5f5746f401ad68b7a

2
sdk

@ -1 +1 @@
Subproject commit e5ce8da2008bafe1ec519432807a1dfbfd12f17e
Subproject commit 0f185e7634bc9edb53206e3219a7021bca3abd9f

4
usrc/main.cpp

@ -9,8 +9,6 @@
//
#include "subboards/subboard100_idcard_reader/subboard100_id_card_reader.hpp"
#include "subboards/subboard100_idcard_reader/subboard100_id_card_reader_board.h"
#include "subboards/subboard10_hbot/subboard10_hbot.hpp"
#include "subboards/subboard10_hbot/subboard10_hbot_board.h"
#include "subboards/subboard10_hbot_v2/subboard10_hbot_board_v2.h"
#include "subboards/subboard10_hbot_v2/subboard10_hbot_v2.hpp"
#include "subboards/subboard200_ext_tmc5160/subboard200_ext_tmc5160.hpp"
@ -46,7 +44,6 @@ int32_t deviceId = 0;
static void board_init() {
switch (deviceId) {
case 10:
// subboard10_hbot_board_init();
subboard10v2_hbot_board_init();
break;
case 20: // 板夹仓
@ -88,7 +85,6 @@ static void board_post_init() {
GService::inst()->initialize();
switch (deviceId) {
case 10:
// Subboard10Hbot::ins()->initialize();
Subboard10HbotV2::ins()->initialize();
break;
case 20:

58
usrc/subboards/subboard10_hbot/pri_board.h

@ -1,58 +0,0 @@
#pragma once
/***********************************************************************************************************************
* IO *
***********************************************************************************************************************/
#define EXT_INPUT_IO0 PD4, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO1 PD5, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO2 PD6, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO3 PD7, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO4 PinNull, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO5 PinNull, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO6 PinNull, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO7 PinNull, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO8 PinNull, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_INPUT_IO9 PinNull, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true
#define EXT_OUTPUT_IO0 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO1 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO2 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO3 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO4 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO5 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO6 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO7 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO8 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define EXT_OUTPUT_IO9 PinNull, ZGPIO::kMode_nopull, false /*mirror*/, true /*init val*/
#define TMC_MOTOR_SPI hspi1
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
// MOTOR1
#define TMC_MOTOR1_CHANNEL 1
#define TMC_MOTOR1_SPI_SELECT1_IO PA4
#define TMC_MOTOR1_nFREEZE_IO PC2
#define TMC_MOTOR1_nRESET_IO PB3
#define TMC_MOTOR1_SUB_IC_ENN_IO PC3
#define TMC_MOTOR1_ENN_IO // unused
// MOTOR2
#define TMC_MOTOR2_CHANNEL 2
#define TMC_MOTOR2_SPI_SELECT1_IO PA8
#define TMC_MOTOR2_nFREEZE_IO PC6
#define TMC_MOTOR2_nRESET_IO PB2
#define TMC_MOTOR2_SUB_IC_ENN_IO PC7
#define TMC_MOTOR2_ENN_IO // unused
#define ARM_X_ZERO PD0
#define ARM_X_LIMIT PD1
#define ARM_Y_ZERO PD2
#define ARM_Y_LIMIT PD3
#define ARM_SENSOR5_GPIO PD4
#define ARM_SENSOR6_GPIO PD5
#define ARM_SENSOR7_GPIO PD6
#define ARM_SENSOR8_GPIO PD7

117
usrc/subboards/subboard10_hbot/subboard10_hbot.cpp

@ -1,117 +0,0 @@
#include "subboard10_hbot.hpp"
extern "C" {
#include "subboard10_hbot_board.h"
}
#include "pri_board.h"
#include "public_service/instance_init.hpp"
#include "public_service/public_service.hpp"
#include "sdk/components/mini_servo_motor/feite_servo_motor.hpp"
#include "sdk/components/mini_servo_motor/mini_servo_motor_ctrl_module.hpp"
#include "sdk/components/sensors/m3078/m3078_code_scaner.hpp"
#include "sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp"
#include "sdk/components/tmc/ic/ztmc4361A.hpp"
#include "sdk\components\pipette_module\pipette_ctrl_module_v2.hpp"
#include "sdk\components\xy_robot_ctrl_module\xy_robot_ctrl_module.hpp"
#define TAG "Subboard10Hbot"
using namespace iflytop;
/***********************************************************************************************************************
* IMPL *
***********************************************************************************************************************/
void Subboard10Hbot::initialize() {
IO_INIT();
GService::inst()->getZCanProtocolParser()->registerModule(this);
#if 1
/***********************************************************************************************************************
* ID1 *
***********************************************************************************************************************/
static XYRobotCtrlModule xyRobotCtrlModule;
static TMC4361A motora; // 1
static TMC4361A motorb; // 2
{
TMC4361A::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
.csgpio = TMC_MOTOR1_SPI_SELECT1_IO, //
.resetPin = TMC_MOTOR1_nRESET_IO, //
.fREEZEPin = TMC_MOTOR1_nFREEZE_IO, //
.ennPin = PinNull, //
.driverIC_ennPin = TMC_MOTOR1_SUB_IC_ENN_IO, //
.driverIC_resetPin = PinNull, //
};
motora.initialize(&cfg);
motora.setMotorShaft(false);
motora.setGlobalScale(31);
ZLOGI(TAG, "motora initialize TMC4361A:%x DriverIC:%x", motora.readICVersion(), motora.driverIC_readICVersion());
}
{
TMC4361A::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
.csgpio = TMC_MOTOR2_SPI_SELECT1_IO, //
.resetPin = TMC_MOTOR2_nRESET_IO, //
.fREEZEPin = TMC_MOTOR2_nFREEZE_IO, //
.ennPin = PinNull, //
.driverIC_ennPin = TMC_MOTOR2_SUB_IC_ENN_IO, //
.driverIC_resetPin = PinNull, //
};
motorb.initialize(&cfg);
motorb.setMotorShaft(false);
motorb.setGlobalScale(31);
ZLOGI(TAG, "motorb initialize TMC4361A:%x DriverIC:%x", motorb.readICVersion(), motorb.driverIC_readICVersion());
}
motora.setAcceleration(300);
motora.setDeceleration(300);
motora.setIHOLD_IRUN(0, 4, 10);
motorb.setAcceleration(300);
motorb.setDeceleration(300);
motorb.setIHOLD_IRUN(0, 4, 10);
motora.rotate(0);
motorb.rotate(0);
/*******************************************************************************
* zcanXYRobotCtrlModule *
*******************************************************************************/
static ZGPIO input[4];
input[0].initAsInput(ARM_X_ZERO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[1].initAsInput(ARM_Y_ZERO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[2].initAsInput(ARM_X_LIMIT, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[3].initAsInput(ARM_Y_LIMIT, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
static XYRobotCtrlModule::config_t xy_defaultcfg;
XYRobotCtrlModule::create_default_cfg(xy_defaultcfg);
xy_defaultcfg.configInited = true;
xy_defaultcfg.robot_type = 1;
xy_defaultcfg.robot_type = XYRobotCtrlModule::khbot;
xy_defaultcfg.x_shaft = 0;
xy_defaultcfg.y_shaft = 1;
xy_defaultcfg.ihold = 3;
xy_defaultcfg.irun = 31;
xy_defaultcfg.iholddelay = 100;
xy_defaultcfg.distance_scale = 7344;
xy_defaultcfg.shift_x = 0;
xy_defaultcfg.shift_y = 0;
// limit
xy_defaultcfg.acc = 400;
xy_defaultcfg.dec = 400;
xy_defaultcfg.min_x = 0;
xy_defaultcfg.max_x = 0;
xy_defaultcfg.min_y = 0;
xy_defaultcfg.max_y = 0;
xy_defaultcfg.default_velocity = 300;
xy_defaultcfg.run_to_zero_speed = 40;
xy_defaultcfg.look_zero_edge_speed = 10;
xyRobotCtrlModule.initialize(getmoduleId(1), &motora, &motorb, &input[0], 4, xy_defaultcfg);
GService::inst()->registerModule(&xyRobotCtrlModule);
#endif
}

25
usrc/subboards/subboard10_hbot/subboard10_hbot.hpp

@ -1,25 +0,0 @@
#include <stddef.h>
#include <stdio.h>
//
#include "configs/device_id_mgr.hpp"
#include "sdk/chip/chip.hpp"
#include "sdk/os/zos.hpp"
//
#include "sdk\components\step_motor_ctrl_module\step_motor_ctrl_module.hpp"
#include "sdk\components\tmc\ic\ztmc5130.hpp"
#include "public_service/public_service.hpp"
namespace iflytop {
class Subboard10Hbot : public ExtBoardImpl {
public:
static Subboard10Hbot *ins() {
static Subboard10Hbot instance;
return &instance;
}
void initialize();
};
} // namespace iflytop

41
usrc/subboards/subboard10_hbot/subboard10_hbot_board.c

@ -1,41 +0,0 @@
#include "main.h"
#include "public_service/public_service.h"
/* SPI1 init function */
static void MX_SPI1_Init(void) {
__HAL_RCC_SPI1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER;
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi1.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi1) != HAL_OK) {
Error_Handler();
}
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
hspi1_enable = true;
}
/**
* @brief
*/
void subboard10_hbot_board_init() {
common_hardware_init();
MX_SPI1_Init();
}

12
usrc/subboards/subboard10_hbot/subboard10_hbot_board.h

@ -1,12 +0,0 @@
#pragma once
#include "main.h"
#ifdef __cplusplus
extern "C" {
#endif
void subboard10_hbot_board_init();
#ifdef __cplusplus
}
#endif

60
usrc/subboards/subboard10_hbot_v2/pri_board.h

@ -32,66 +32,14 @@
#define MOTOR1_CSN PA4
#define MOTOR1_ENN PB7
#define MOTOR2_CSN PC4
#define MOTOR2_ENN PE13
#define MOTOR1_REFL PD0
#define MOTOR1_REFR PinNull
#define MOTOR1_REFL_MIRROR true
#define MOTOR1_REFR_MIRROR true
#define MOTOR1_MOTOR_SHAFT true
#define MOTOR1_MOTOR_ONE_CIRCLE_PULSE 60
#define MOTOR1_MOTOR_ONE_CIRCLE_PULSE_DENOMINATOR 1
#define MOTOR1_STEPMOTOR_IHOLD 1
#define MOTOR1_STEPMOTOR_IRUN 30
#define MOTOR1_STEPMOTOR_IHOLDDELAY 100
#define MOTOR1_STEPMOTOR_IGLOBALSCALER 32
#define MOTOR1_MOTOR_DEFAULT_VELOCITY 1000
#define MOTOR1_MIN_D 0
#define MOTOR1_MAX_D 0
#define MOTOR1_MOTOR_RUN_TO_ZERO_SPEED 400
#define MOTOR1_MOTOR_LOOK_ZERO_EDGE_SPEED 50
#define MOTOR1_MOTOR_VSTART TMC5130_DEFAULT__MOTOR_VSTART
#define MOTOR1_MOTOR_A1 TMC5130_DEFAULT__MOTOR_A1
#define MOTOR1_MOTOR_AMAX 300
#define MOTOR1_MOTOR_V1 TMC5130_DEFAULT__MOTOR_V1
#define MOTOR1_MOTOR_DMAX 300
#define MOTOR1_MOTOR_D1 TMC5130_DEFAULT__MOTOR_D1
#define MOTOR1_MOTOR_VSTOP TMC5130_DEFAULT__MOTOR_VSTOP
#define MOTOR1_MOTOR_TZEROWAIT TMC5130_DEFAULT__MOTOR_TZEROWAIT
#define MOTOR1_ENC_RESOLUTION 0
#define MOTOR1_ENABLE_ENC_RESOLUTION 0
/***********************************************************************************************************************
* 2 *
***********************************************************************************************************************/
#define MOTOR2_CSN PC4
#define MOTOR2_ENN PE13
#define MOTOR2_REFL PinNull
#define MOTOR2_REFR PinNull
#define MOTOR2_REFL_MIRROR true
#define MOTOR2_REFR_MIRROR true
#define MOTOR2_MOTOR_SHAFT true
#define MOTOR2_MOTOR_ONE_CIRCLE_PULSE 80
#define MOTOR2_MOTOR_ONE_CIRCLE_PULSE_DENOMINATOR 1
#define MOTOR2_STEPMOTOR_IHOLD 1
#define MOTOR2_STEPMOTOR_IRUN 30
#define MOTOR2_STEPMOTOR_IHOLDDELAY 100
#define MOTOR2_STEPMOTOR_IGLOBALSCALER 32
#define MOTOR2_MOTOR_DEFAULT_VELOCITY 1000
#define MOTOR2_MIN_D 0
#define MOTOR2_MAX_D 0
#define MOTOR2_MOTOR_RUN_TO_ZERO_SPEED 300
#define MOTOR2_MOTOR_LOOK_ZERO_EDGE_SPEED 50
#define MOTOR2_MOTOR_VSTART TMC5130_DEFAULT__MOTOR_VSTART
#define MOTOR2_MOTOR_A1 TMC5130_DEFAULT__MOTOR_A1
#define MOTOR2_MOTOR_AMAX 300
#define MOTOR2_MOTOR_V1 TMC5130_DEFAULT__MOTOR_V1
#define MOTOR2_MOTOR_DMAX 300
#define MOTOR2_MOTOR_D1 TMC5130_DEFAULT__MOTOR_D1
#define MOTOR2_MOTOR_VSTOP TMC5130_DEFAULT__MOTOR_VSTOP
#define MOTOR2_MOTOR_TZEROWAIT TMC5130_DEFAULT__MOTOR_TZEROWAIT
#define MOTOR2_ENC_RESOLUTION 0
#define MOTOR2_ENABLE_ENC_RESOLUTION 0

101
usrc/subboards/subboard10_hbot_v2/subboard10_hbot_v2.cpp

@ -43,46 +43,38 @@ void Subboard10HbotV2::initialize() {
osDelay(10);
motorPowerEnPin.initAsOutput(PB12, iflytop::ZGPIO::kMode_nopull, true, true);
TMC5130_MOTOR_INITER(/*motorid*/ 1, /*moduleid*/ 1);
TMC5130_MOTOR_INITER(/*motorid*/ 2, /*moduleid*/ 2);
// TMC5130_MOTOR_INITER(/*motorid*/ 1, /*moduleid*/ 1);
// TMC5130_MOTOR_INITER(/*motorid*/ 2, /*moduleid*/ 2);
#if 0
#if 1
/***********************************************************************************************************************
* ID1 *
***********************************************************************************************************************/
static XYRobotCtrlModule xyRobotCtrlModule;
static TMC4361A motora; // 1
static TMC4361A motorb; // 2
static TMC51X0 motora; // 1
static TMC51X0 motorb; // 2
{
TMC4361A::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
.csgpio = TMC_MOTOR1_SPI_SELECT1_IO, //
.resetPin = TMC_MOTOR1_nRESET_IO, //
.fREEZEPin = TMC_MOTOR1_nFREEZE_IO, //
.ennPin = PinNull, //
.driverIC_ennPin = TMC_MOTOR1_SUB_IC_ENN_IO, //
.driverIC_resetPin = PinNull, //
TMC51X0::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
.csgpio = MOTOR1_CSN, //
.ennPin = MOTOR1_ENN, //
};
motora.initialize(&cfg);
motora.setMotorShaft(false);
motora.setGlobalScale(31);
ZLOGI(TAG, "motora initialize TMC4361A:%x DriverIC:%x", motora.readICVersion(), motora.driverIC_readICVersion());
ZLOGI(TAG, "motora initialize TMC51X0:%x", motora.readICVersion());
}
{
TMC4361A::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
.csgpio = TMC_MOTOR2_SPI_SELECT1_IO, //
.resetPin = TMC_MOTOR2_nRESET_IO, //
.fREEZEPin = TMC_MOTOR2_nFREEZE_IO, //
.ennPin = PinNull, //
.driverIC_ennPin = TMC_MOTOR2_SUB_IC_ENN_IO, //
.driverIC_resetPin = PinNull, //
TMC51X0::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
.csgpio = MOTOR2_CSN, //
.ennPin = MOTOR2_ENN, //
};
motorb.initialize(&cfg);
motorb.setMotorShaft(false);
motorb.setGlobalScale(31);
ZLOGI(TAG, "motorb initialize TMC4361A:%x DriverIC:%x", motorb.readICVersion(), motorb.driverIC_readICVersion());
ZLOGI(TAG, "motorb initialize TMC51X0:%x", motora.readICVersion());
}
motora.setAcceleration(300);
@ -100,37 +92,44 @@ void Subboard10HbotV2::initialize() {
* zcanXYRobotCtrlModule *
*******************************************************************************/
static ZGPIO input[4];
input[0].initAsInput(ARM_X_ZERO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[1].initAsInput(ARM_Y_ZERO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[2].initAsInput(ARM_X_LIMIT, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[3].initAsInput(ARM_Y_LIMIT, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[0].initAsInput(EXT_INPUT_IO0);
input[1].initAsInput(EXT_INPUT_IO1);
input[2].initAsInput(EXT_INPUT_IO2);
input[3].initAsInput(EXT_INPUT_IO3);
static XYRobotCtrlModule::config_t xy_defaultcfg;
XYRobotCtrlModule::create_default_cfg(xy_defaultcfg);
xy_defaultcfg.configInited = true;
xy_defaultcfg.robot_type = 1;
xy_defaultcfg.robot_type = XYRobotCtrlModule::khbot;
xy_defaultcfg.x_shaft = 0;
xy_defaultcfg.y_shaft = 1;
xy_defaultcfg.ihold = 3;
xy_defaultcfg.irun = 31;
xy_defaultcfg.iholddelay = 100;
xy_defaultcfg.distance_scale = 7344;
xy_defaultcfg.shift_x = 0;
xy_defaultcfg.shift_y = 0;
// limit
xy_defaultcfg.acc = 400;
xy_defaultcfg.dec = 400;
xy_defaultcfg.min_x = 0;
xy_defaultcfg.max_x = 0;
xy_defaultcfg.min_y = 0;
xy_defaultcfg.max_y = 0;
xy_defaultcfg.default_velocity = 300;
xy_defaultcfg.run_to_zero_speed = 40;
xy_defaultcfg.look_zero_edge_speed = 10;
xy_defaultcfg.robot_type = XYRobotCtrlModule::khbot;
xy_defaultcfg.one_circle_pulse = 7344;
xy_defaultcfg.one_circle_pulse_denominator = 1;
xy_defaultcfg.ihold = 1;
xy_defaultcfg.irun = 31;
xy_defaultcfg.iholddelay = 100;
xy_defaultcfg.iglobalscaler = 32;
xy_defaultcfg.vstart = TMC5130_DEFAULT__MOTOR_VSTART;
xy_defaultcfg.a1 = TMC5130_DEFAULT__MOTOR_A1;
xy_defaultcfg.amax = TMC5130_DEFAULT__MOTOR_AMAX;
xy_defaultcfg.v1 = TMC5130_DEFAULT__MOTOR_V1;
xy_defaultcfg.dmax = TMC5130_DEFAULT__MOTOR_DMAX;
xy_defaultcfg.d1 = TMC5130_DEFAULT__MOTOR_D1;
xy_defaultcfg.vstop = TMC5130_DEFAULT__MOTOR_VSTOP;
xy_defaultcfg.tzerowait = TMC5130_DEFAULT__MOTOR_TZEROWAIT;
xy_defaultcfg.enc_resolution = 1000;
xy_defaultcfg.enable_enc = 1;
xy_defaultcfg.x_shaft = 0;
xy_defaultcfg.y_shaft = 1;
xy_defaultcfg.default_velocity = 300;
xy_defaultcfg.shift_x = 0;
xy_defaultcfg.shift_y = 0;
xy_defaultcfg.min_x = 0;
xy_defaultcfg.min_y = 0;
xy_defaultcfg.max_x = 0;
xy_defaultcfg.max_y = 0;
xy_defaultcfg.run_to_zero_speed = 40;
xy_defaultcfg.look_zero_edge_speed = 10;
xyRobotCtrlModule.initialize(getmoduleId(1), &motora, &motorb, &input[0], 4, xy_defaultcfg);

Loading…
Cancel
Save