mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-18 13:31:20 +00:00
* Cleanup registry to be easy-understanding (#76) * delete deprecated mock devices * rename categories * combine chromatographic devices * rename rviz simulation nodes * organic virtual devices * parse vessel_id * run registry completion before merge --------- Co-authored-by: Xuwznln <18435084+Xuwznln@users.noreply.github.com> * fix: workstation handlers and vessel_id parsing * fix: working dir error when input config path feat: report publish topic when error * modify default discovery_interval to 15s * feat: add trace log level * feat: 添加ChinWe设备控制类,支持串口通信和电机控制功能 (#79) * fix: drop_tips not using auto resource select * fix: discard_tips error * fix: discard_tips * fix: prcxi_res * add: prcxi res fix: startup slow * feat: workstation example * fix pumps and liquid_handler handle * feat: 优化protocol node节点运行日志 * fix all protocol_compilers and remove deprecated devices * feat: 新增use_remote_resource参数 * fix and remove redundant info * bugfixes on organic protocols * fix filter protocol * fix protocol node * 临时兼容错误的driver写法 * fix: prcxi import error * use call_async in all service to avoid deadlock * fix: figure_resource * Update recipe.yaml * add workstation template and battery example * feat: add sk & ak * update workstation base * Create workstation_architecture.md * refactor: workstation_base 重构为仅含业务逻辑,通信和子设备管理交给 ProtocolNode * refactor: ProtocolNode→WorkstationNode * Add:msgs.action (#83) * update: Workstation dev 将版本号从 0.10.3 更新为 0.10.4 (#84) * Add:msgs.action * update: 将版本号从 0.10.3 更新为 0.10.4 * simplify resource system * uncompleted refactor * example for use WorkstationBase * feat: websocket * feat: websocket test * feat: workstation example * feat: action status * fix: station自己的方法注册错误 * fix: 还原protocol node处理方法 * fix: build * fix: missing job_id key * ws test version 1 * ws test version 2 * ws protocol * 增加物料关系上传日志 * 增加物料关系上传日志 * 修正物料关系上传 * 修复工站的tracker实例追踪失效问题 * 增加handle检测,增加material edge关系上传 * 修复event loop错误 * 修复edge上报错误 * 修复async错误 * 更新schema的title字段 * 主机节点信息等支持自动刷新 * 注册表编辑器 * 修复status密集发送时,消息出错 * 增加addr参数 * fix: addr param * fix: addr param * 取消labid 和 强制config输入 * Add action definitions for LiquidHandlerSetGroup and LiquidHandlerTransferGroup - Created LiquidHandlerSetGroup.action with fields for group name, wells, and volumes. - Created LiquidHandlerTransferGroup.action with fields for source and target group names and unit volume. - Both actions include response fields for return information and success status. * Add LiquidHandlerSetGroup and LiquidHandlerTransferGroup actions to CMakeLists * Add set_group and transfer_group methods to PRCXI9300Handler and update liquid_handler.yaml * result_info改为字典类型 * 新增uat的地址替换 * runze multiple pump support (cherry picked from commit49354fcf39) * remove runze multiple software obtainer (cherry picked from commit8bcc92a394) * support multiple backbone (cherry picked from commit4771ff2347) * Update runze pump format * Correct runze multiple backbone * Update runze_multiple_backbone * Correct runze pump multiple receive method. * Correct runze pump multiple receive method. * 对于PRCXI9320的transfer_group,一对多和多对多 * 移除MQTT,更新launch文档,提供注册表示例文件,更新到0.10.5 * fix import error * fix dupe upload registry * refactor ws client * add server timeout * Fix: run-column with correct vessel id (#86) * fix run_column * Update run_column_protocol.py (cherry picked from commite5aa4d940a) * resource_update use resource_add * 新增版位推荐功能 * 重新规定了版位推荐的入参 * update registry with nested obj * fix protocol node log_message, added create_resource return value * fix protocol node log_message, added create_resource return value * try fix add protocol * fix resource_add * 修复移液站错误的aspirate注册表 * Feature/xprbalance-zhida (#80) * feat(devices): add Zhida GC/MS pretreatment automation workstation * feat(devices): add mettler_toledo xpr balance * balance * 重新补全zhida注册表 * PRCXI9320 json * PRCXI9320 json * PRCXI9320 json * fix resource download * remove class for resource * bump version to 0.10.6 * 更新所有注册表 * 修复protocolnode的兼容性 * 修复protocolnode的兼容性 * Update install md * Add Defaultlayout * 更新物料接口 * fix dict to tree/nested-dict converter * coin_cell_station draft * refactor: rename "station_resource" to "deck" * add standardized BIOYOND resources: bottle_carrier, bottle * refactor and add BIOYOND resources tests * add BIOYOND deck assignment and pass all tests * fix: update resource with correct structure; remove deprecated liquid_handler set_group action * feat: 将新威电池测试系统驱动与配置文件并入 workstation_dev_YB2 (#92) * feat: 新威电池测试系统驱动与注册文件 * feat: bring neware driver & battery.json into workstation_dev_YB2 * add bioyond studio draft * bioyond station with communication init and resource sync * fix bioyond station and registry * fix: update resource with correct structure; remove deprecated liquid_handler set_group action * frontend_docs * create/update resources with POST/PUT for big amount/ small amount data * create/update resources with POST/PUT for big amount/ small amount data * refactor: add itemized_carrier instead of carrier consists of ResourceHolder * create warehouse by factory func * update bioyond launch json * add child_size for itemized_carrier * fix bioyond resource io * Workstation templates: Resources and its CRUD, and workstation tasks (#95) * coin_cell_station draft * refactor: rename "station_resource" to "deck" * add standardized BIOYOND resources: bottle_carrier, bottle * refactor and add BIOYOND resources tests * add BIOYOND deck assignment and pass all tests * fix: update resource with correct structure; remove deprecated liquid_handler set_group action * feat: 将新威电池测试系统驱动与配置文件并入 workstation_dev_YB2 (#92) * feat: 新威电池测试系统驱动与注册文件 * feat: bring neware driver & battery.json into workstation_dev_YB2 * add bioyond studio draft * bioyond station with communication init and resource sync * fix bioyond station and registry * create/update resources with POST/PUT for big amount/ small amount data * refactor: add itemized_carrier instead of carrier consists of ResourceHolder * create warehouse by factory func * update bioyond launch json * add child_size for itemized_carrier * fix bioyond resource io --------- Co-authored-by: h840473807 <47357934+h840473807@users.noreply.github.com> Co-authored-by: Xie Qiming <97236197+Andy6M@users.noreply.github.com> * 更新物料接口 * Workstation dev yb2 (#100) * Refactor and extend reaction station action messages * Refactor dispensing station tasks to enhance parameter clarity and add batch processing capabilities - Updated `create_90_10_vial_feeding_task` to include detailed parameters for 90%/10% vial feeding, improving clarity and usability. - Introduced `create_batch_90_10_vial_feeding_task` for batch processing of 90%/10% vial feeding tasks with JSON formatted input. - Added `create_batch_diamine_solution_task` for batch preparation of diamine solution, also utilizing JSON formatted input. - Refined `create_diamine_solution_task` to include additional parameters for better task configuration. - Enhanced schema descriptions and default values for improved user guidance. * 修复to_plr_resources * add update remove * 支持选择器注册表自动生成 支持转运物料 * 修复资源添加 * 修复transfer_resource_to_another生成 * 更新transfer_resource_to_another参数,支持spot入参 * 新增test_resource动作 * fix host_node error * fix host_node test_resource error * fix host_node test_resource error * 过滤本地动作 * 移动内部action以兼容host node * 修复同步任务报错不显示的bug * feat: 允许返回非本节点物料,后面可以通过decoration进行区分,就不进行warning了 * update todo * modify bioyond/plr converter, bioyond resource registry, and tests * pass the tests * update todo * add conda-pack-build.yml * add auto install script for conda-pack-build.yml (cherry picked from commit172599adcf) * update conda-pack-build.yml * update conda-pack-build.yml * update conda-pack-build.yml * update conda-pack-build.yml * update conda-pack-build.yml * Add version in __init__.py Update conda-pack-build.yml Add create_zip_archive.py * Update conda-pack-build.yml * Update conda-pack-build.yml (with mamba) * Update conda-pack-build.yml * Fix FileNotFoundError * Try fix 'charmap' codec can't encode characters in position 16-23: character maps to <undefined> * Fix unilabos msgs search error * Fix environment_check.py * Update recipe.yaml * Update registry. Update uuid loop figure method. Update install docs. * Fix nested conda pack * Fix one-key installation path error * Bump version to 0.10.7 * Workshop bj (#99) * Add LaiYu Liquid device integration and tests Introduce LaiYu Liquid device implementation, including backend, controllers, drivers, configuration, and resource files. Add hardware connection, tip pickup, and simplified test scripts, as well as experiment and registry configuration for LaiYu Liquid. Documentation and .gitignore for the device are also included. * feat(LaiYu_Liquid): 重构设备模块结构并添加硬件文档 refactor: 重新组织LaiYu_Liquid模块目录结构 docs: 添加SOPA移液器和步进电机控制指令文档 fix: 修正设备配置中的最大体积默认值 test: 新增工作台配置测试用例 chore: 删除过时的测试脚本和配置文件 * add * 重构: 将 LaiYu_Liquid.py 重命名为 laiyu_liquid_main.py 并更新所有导入引用 - 使用 git mv 将 LaiYu_Liquid.py 重命名为 laiyu_liquid_main.py - 更新所有相关文件中的导入引用 - 保持代码功能不变,仅改善命名一致性 - 测试确认所有导入正常工作 * 修复: 在 core/__init__.py 中添加 LaiYuLiquidBackend 导出 - 添加 LaiYuLiquidBackend 到导入列表 - 添加 LaiYuLiquidBackend 到 __all__ 导出列表 - 确保所有主要类都可以正确导入 * 修复大小写文件夹名字 * 电池装配工站二次开发教程(带目录)上传至dev (#94) * 电池装配工站二次开发教程 * Update intro.md * 物料教程 * 更新物料教程,json格式注释 * Update prcxi driver & fix transfer_liquid mix_times (#90) * Update prcxi driver & fix transfer_liquid mix_times * fix: correct mix_times type * Update liquid_handler registry * test: prcxi.py * Update registry from pr * fix ony-key script not exist * clean files --------- Co-authored-by: Junhan Chang <changjh@dp.tech> Co-authored-by: ZiWei <131428629+ZiWei09@users.noreply.github.com> Co-authored-by: Guangxin Zhang <guangxin.zhang.bio@gmail.com> Co-authored-by: Xie Qiming <97236197+Andy6M@users.noreply.github.com> Co-authored-by: h840473807 <47357934+h840473807@users.noreply.github.com> Co-authored-by: LccLink <1951855008@qq.com> Co-authored-by: lixinyu1011 <61094742+lixinyu1011@users.noreply.github.com> Co-authored-by: shiyubo0410 <shiyubo@dp.tech>
8.2 KiB
8.2 KiB
LaiYu_Liquid 液体处理工作站
概述
LaiYu_Liquid 是一个完全集成到 UniLabOS 的自动化液体处理工作站,基于 RS485 通信协议,专为精确的液体分配和转移操作而设计。本模块已完成生产环境部署准备,提供完整的硬件控制、资源管理和标准化接口。
系统组成
硬件组件
- XYZ三轴运动平台: 3个RS485步进电机驱动(地址:X轴=0x01, Y轴=0x02, Z轴=0x03)
- SOPA气动式移液器: RS485总线控制,支持精密液体处理操作
- 通信接口: RS485转USB模块,默认波特率115200
- 机械结构: 稳固工作台面,支持离心管架、96孔板等标准实验耗材
软件架构
- 驱动层: 底层硬件通信驱动,支持RS485协议
- 控制层: 高级控制逻辑和坐标系管理
- 抽象层: 完全符合UniLabOS标准的液体处理接口
- 资源层: 标准化的实验器具和耗材管理
🎯 生产就绪组件
✅ 核心驱动程序 (drivers/)
-
sopa_pipette_driver.py- SOPA移液器完整驱动- 支持液体吸取、分配、检测
- 完整的错误处理和状态管理
- 生产级别的通信协议实现
-
xyz_stepper_driver.py- XYZ三轴步进电机驱动- 精确的位置控制和运动规划
- 安全限位和错误检测
- 高性能运动控制算法
✅ 高级控制器 (controllers/)
-
pipette_controller.py- 移液控制器- 封装高级液体处理功能
- 支持多种液体类型和处理参数
- 智能错误恢复机制
-
xyz_controller.py- XYZ运动控制器- 坐标系管理和转换
- 运动路径优化
- 安全运动控制
✅ UniLabOS集成 (core/LaiYu_Liquid.py)
- 完整的液体处理抽象接口
- 标准化的资源管理系统
- 与PyLabRobot兼容的后端实现
- 生产级别的错误处理和日志记录
✅ 资源管理系统
laiyu_liquid_res.py- 标准化资源定义- 96孔板、离心管架、枪头架等标准器具
- 自动化的资源创建和配置函数
- 与工作台布局的完美集成
✅ 配置管理 (config/)
-
config/deck.json- 工作台布局配置- 精确的空间定义和槽位管理
- 支持多种实验器具的标准化放置
- 可扩展的配置架构
-
__init__.py- 模块集成和导出- 完整的API导出和版本管理
- 依赖检查和安装验证
- 专业的模块信息展示
🚀 核心功能特性
液体处理能力
- 精密体积控制: 支持1-1000μL精确分配
- 多种液体类型: 水性、有机溶剂、粘稠液体等
- 智能检测: 液位检测、气泡检测、堵塞检测
- 自动化流程: 完整的吸取-转移-分配工作流
运动控制系统
- 三轴精密定位: 微米级精度控制
- 路径优化: 智能运动规划和碰撞避免
- 安全机制: 限位保护、紧急停止、错误恢复
- 坐标系管理: 工作坐标与机械坐标的自动转换
资源管理
- 标准化器具: 支持96孔板、离心管架、枪头架等
- 状态跟踪: 实时监控液体体积、枪头状态等
- 自动配置: 基于JSON的灵活配置系统
- 扩展性: 易于添加新的器具类型
📁 目录结构
LaiYu_Liquid/
├── __init__.py # 模块初始化和API导出
├── readme.md # 本文档
├── backend/ # 后端驱动模块
│ ├── __init__.py
│ └── laiyu_backend.py # PyLabRobot兼容后端
├── core/ # 核心模块
│ ├── core/
│ │ └── LaiYu_Liquid.py # 主设备类
│ ├── abstract_protocol.py # 抽象协议
│ └── laiyu_liquid_res.py # 设备资源定义
├── config/ # 配置文件目录
│ └── deck.json # 工作台布局配置
├── controllers/ # 高级控制器
│ ├── __init__.py
│ ├── pipette_controller.py # 移液控制器
│ └── xyz_controller.py # XYZ运动控制器
├── docs/ # 技术文档
│ ├── SOPA气动式移液器RS485控制指令.md
│ ├── 步进电机控制指令.md
│ └── hardware/ # 硬件相关文档
├── drivers/ # 底层驱动程序
│ ├── __init__.py
│ ├── sopa_pipette_driver.py # SOPA移液器驱动
│ └── xyz_stepper_driver.py # XYZ步进电机驱动
└── tests/ # 测试文件
🔧 快速开始
1. 安装和验证
# 验证模块安装
from unilabos.devices.laiyu_liquid import (
LaiYuLiquid,
LaiYuLiquidConfig,
create_quick_setup,
print_module_info
)
# 查看模块信息
print_module_info()
# 快速创建默认资源
resources = create_quick_setup()
print(f"已创建 {len(resources)} 个资源")
2. 基本使用示例
from unilabos.devices.LaiYu_Liquid import (
create_quick_setup,
create_96_well_plate,
create_laiyu_backend
)
# 快速创建默认资源
resources = create_quick_setup()
print(f"创建了以下资源: {list(resources.keys())}")
# 创建96孔板
plate_96 = create_96_well_plate("test_plate")
print(f"96孔板包含 {len(plate_96.children)} 个孔位")
# 创建后端实例(用于PyLabRobot集成)
backend = create_laiyu_backend("LaiYu_Device")
print(f"后端设备: {backend.name}")
3. 后端驱动使用
from unilabos.devices.laiyu_liquid.backend import create_laiyu_backend
# 创建后端实例
backend = create_laiyu_backend("LaiYu_Liquid_Station")
# 连接设备
await backend.connect()
# 设备归位
await backend.home_device()
# 获取设备状态
status = await backend.get_status()
print(f"设备状态: {status}")
# 断开连接
await backend.disconnect()
4. 资源管理示例
from unilabos.devices.LaiYu_Liquid import (
create_centrifuge_tube_rack,
create_tip_rack,
load_deck_config
)
# 加载工作台配置
deck_config = load_deck_config()
print(f"工作台尺寸: {deck_config['size_x']}x{deck_config['size_y']}mm")
# 创建不同类型的资源
tube_rack = create_centrifuge_tube_rack("sample_rack")
tip_rack = create_tip_rack("tip_rack_200ul")
print(f"离心管架: {tube_rack.name}, 容量: {len(tube_rack.children)} 个位置")
print(f"枪头架: {tip_rack.name}, 容量: {len(tip_rack.children)} 个枪头")
🔍 技术架构
坐标系统
- 机械坐标: 基于步进电机的原始坐标系统
- 工作坐标: 用户友好的实验室坐标系统
- 自动转换: 透明的坐标系转换和校准
通信协议
- RS485总线: 高可靠性工业通信标准
- Modbus协议: 标准化的设备通信协议
- 错误检测: 完整的通信错误检测和恢复
安全机制
- 限位保护: 硬件和软件双重限位保护
- 紧急停止: 即时停止所有运动和操作
- 状态监控: 实时设备状态监控和报警
🧪 验证和测试
功能验证
# 验证模块安装
from unilabos.devices.laiyu_liquid import validate_installation
validate_installation()
# 查看模块信息
from unilabos.devices.laiyu_liquid import print_module_info
print_module_info()
硬件连接测试
# 测试SOPA移液器连接
from unilabos.devices.laiyu_liquid.drivers import SOPAPipette, SOPAConfig
config = SOPAConfig(port="/dev/cu.usbserial-3130", address=4)
pipette = SOPAPipette(config)
success = pipette.connect()
print(f"SOPA连接状态: {'成功' if success else '失败'}")
📚 维护和支持
日志记录
- 结构化日志: 使用Python logging模块的专业日志记录
- 错误追踪: 详细的错误信息和堆栈跟踪
- 性能监控: 操作时间和性能指标记录
配置管理
- JSON配置: 灵活的JSON格式配置文件
- 参数验证: 自动配置参数验证和错误提示
- 热重载: 支持配置文件的动态重载
扩展性
- 模块化设计: 易于扩展和定制的模块化架构
- 插件接口: 支持第三方插件和扩展
- API兼容: 向后兼容的API设计