Browse Source

v1003 | change can baudrate to 1M

master
zhaohe 4 months ago
parent
commit
ece6d88be9
  1. 2
      a8000_protocol
  2. 13
      sdk/components/pipette_module/pipette_ctrl_module_v2.cpp
  3. 3
      sdk/components/pipette_module/pipette_ctrl_module_v2.hpp
  4. 2
      usrc/project_configs.h
  5. 2
      usrc/public_service/common_hardware_init.c
  6. 2
      usrc/version.h

2
a8000_protocol

@ -1 +1 @@
Subproject commit 74042ce3f342868ca2bfdb51a09fddd68ab396c1
Subproject commit de705d4df1deff279fa9547365f34f22a65c2904

13
sdk/components/pipette_module/pipette_ctrl_module_v2.cpp

@ -153,6 +153,8 @@ int32_t PipetteModuleV2::module_xxx_reg_impl(int32_t param_id, bool read, int32_
XXX_STATE_REG(kreg_pipette_zm_pos, assign_int32(&val, zm_get_now_pos()));
XXX_STATE_REG(kreg_pipette_zm_is_enable, REG_GET(m_state.enable));
XXX_STATE_REG(kreg_pipette_zm_dpos, REG_GET(m_state.dpos));
XXX_STATE_REG(kreg_pipette_zm_has_move_zero, REG_GET(m_state.zm_has_move_zero));
/***********************************************************************************************************************
* CFG *
@ -184,6 +186,7 @@ int32_t PipetteModuleV2::module_xxx_reg_impl(int32_t param_id, bool read, int32_
XXX_CFG_REG(zm_pos_devi_tolerance);
XXX_CFG_REG(zm_io_trigger_append_distance);
default:
return err::kmodule_not_find_reg;
break;
@ -210,7 +213,7 @@ int32_t PipetteModuleV2::pipette_zmotor_enable(int32_t enable) {
m_zm->enable(enable);
m_state.enable = enable;
if (enable == 0 && m_cfg.zm_enable_enc == 0) {
m_state.has_move_to_zero = 0;
m_state.zm_has_move_zero = 0;
}
return 0;
}
@ -224,7 +227,7 @@ int32_t PipetteModuleV2::pipette_zmotor_move_zero() { //
thread_start_work(__FUNCTION__, [this]() {
do_zm_move_0p(); // 移动到零点
zm_set_now_pos(0 + m_cfg.zm_dzero - m_cfg.zm_io_trigger_append_distance);
m_state.has_move_to_zero = 1;
m_state.zm_has_move_zero = 1;
});
return 0;
}
@ -241,7 +244,7 @@ int32_t PipetteModuleV2::pipette_zmotor_measure_distance() {
int32_t dpos = zm_get_now_pos() - startpos;
zm_set_now_pos(0 + m_cfg.zm_dzero - m_cfg.zm_io_trigger_append_distance);
m_state.has_move_to_zero = 1;
m_state.zm_has_move_zero = 1;
m_asynchronous_result.result0 = 0 + m_cfg.zm_dzero - m_cfg.zm_io_trigger_append_distance - dpos;
});
@ -635,7 +638,7 @@ void PipetteModuleV2::do_pipette_zmotor_move_to_zero_point_quick() {
int32_t dpos = zm_get_now_pos() - startpos;
// 设置零点
zm_set_now_pos(0 + m_cfg.zm_dzero - m_cfg.zm_io_trigger_append_distance);
m_state.has_move_to_zero = 1;
m_state.zm_has_move_zero = 1;
if (m_cfg.zm_pos_devi_tolerance != 0 && (abs(expectation_dpos - dpos) > m_cfg.zm_pos_devi_tolerance)) {
throw zapp_exception(err::kstep_motor_lost_step);
@ -837,7 +840,7 @@ check_motor_is_enable:
check_motor_has_moveto_zero:
if (m_state.enable == 0) return err::kstep_motor_not_enable;
if (m_state.has_move_to_zero == 0) return err::kstep_motor_not_move_to_zero;
if (m_state.zm_has_move_zero == 0) return err::kstep_motor_not_move_to_zero;
goto check;
check:

3
sdk/components/pipette_module/pipette_ctrl_module_v2.hpp

@ -79,6 +79,7 @@ class PipetteModuleV2 : public ZIModule {
int32_t zm_dzero; // 零点偏移
int32_t zm_io_trigger_append_distance;
int32_t zm_pos_devi_tolerance;
} config_t;
typedef struct {
@ -106,7 +107,7 @@ class PipetteModuleV2 : public ZIModule {
int32_t aspirate_cfg_eigen_time; // 吸液操作验证,特征时间,用来检测气泡,吸空检测
int32_t aspirate_cfg_tolerance; // 容差
int32_t has_move_to_zero;
int32_t zm_has_move_zero;
} state_t;
struct {

2
usrc/project_configs.h

@ -1,5 +1,5 @@
#pragma once
#define PC_VERSION 1002
#include "version.h"
#define PC_MANUFACTURER "http://www.iflytop.com/"
#define PC_PROJECT_NAME "a8000_subboard"
#define PC_IFLYTOP_ENABLE_OS 1

2
usrc/public_service/common_hardware_init.c

@ -140,7 +140,7 @@ static void can1_init() {
HAL_NVIC_EnableIRQ(CAN1_SCE_IRQn);
hcan1.Instance = CAN1;
hcan1.Init.Prescaler = 4;
hcan1.Init.Prescaler = 2;
hcan1.Init.Mode = CAN_MODE_NORMAL;
hcan1.Init.SyncJumpWidth = CAN_SJW_3TQ;
hcan1.Init.TimeSeg1 = CAN_BS1_14TQ;

2
usrc/version.h

@ -0,0 +1,2 @@
#pragma once
#define PC_VERSION 1003
Loading…
Cancel
Save