频率调控Matlab代码-Orion5:用于Orion5机械臂的库和其他东西

  • S1_287902
    了解作者
  • 74.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-20 04:27
    上传日期
频率解析Matlab代码Orion5机械臂 在使用Orion5之前,请仔细阅读《快速入门指南》并观看视频。 Orion5快速入门指南: Orion5用户手册: Orion5教程视频: Orion5 Simulator-Windows 如果您是Windows用户,则可以运行最新版本中的.exe安装程序: 此安装程序将自动安装Python3.7和所需的python库。 如果使用模拟器,请跳过下面的其他设置步骤。 模拟器程序在后台运行Orion5Server.py的副本,您可以从Python或MATLAB脚本连接到该副本。 通过模拟器,您可以选择代码是控制模拟的Orion5机械臂,还是控制通过USB插入的真实臂。 例子: 即将推出Linux和MacOS。 安装依赖项 在尝试使用Python或MATLAB库之前,请执行以下步骤 在计算机上安装最新版本的Python 3(在撰写本文时为3.7): Windows用户:确保在安装时选择“将Python添加到PATH”选项。 使用pip3 install pyserial为库安装依赖项。 通过运行python3 -c "import serial"检
Orion5-master.zip
  • Orion5-master
  • Firmware
  • Orion5_Firmware_109_03.bin
    25.6KB
  • Orion5_Firmware_109_01.bin
    25.6KB
  • Python
  • calibrate.py
    4KB
  • Orion5Server.py
    12.8KB
  • example_2.py
    1.2KB
  • QUT_FIRST_UPDATE.pyw
    4.4KB
  • rotary_shuffle.py
    7.2KB
  • example_1.py
    1.5KB
  • ClawEjectScipt.py
    1.5KB
  • FirmwareUpdaterGUI.pyw
    4.1KB
  • MATLAB
  • graphing.m
    1.5KB
  • Orion5.m
    12.6KB
  • example.m
    2.2KB
  • Troubleshootin.md
    7.3KB
  • LICENSE
    1KB
  • README.md
    11KB
  • .gitignore
    1.5KB
内容介绍
# Orion5 Robotic Arm _Please read through the Quick Start Guide and watch the videos before using Orion5_ ### Orion5 Quick Start Guide: https://goo.gl/DQm3x3 ### Orion5 User Manual: https://goo.gl/h3i2br ### Orion5 Tutorial Videos: https://goo.gl/5tkjUF ## Orion5 Simulator - Windows If you're a Windows user, you can run the .exe installer available in the latest release: https://github.com/rawrobotics/Orion5/releases/latest This installer will install the Python3.7 and the required python libraries automatically. Skip the other setup steps below if you are using the simulator. The simulator program runs a copy of the Orion5Server.py in the background, which you can connect to from either your Python or MATLAB script. The simulator lets you choose if your code should control a simulated Orion5 robotic arm, or a real one that is plugged in via USB. Example: https://youtu.be/yubWzbC6mr4 Coming to Linux and MacOS soon. ## Install Dependencies _Follow these steps before attempting to use the Python or MATLAB libraries_ 1. Install the latest version of Python 3 (3.7 at the time of writing) onto your machine: https://www.python.org/downloads/ 2. *Windows users*: Make sure to select the "Add Python to PATH" option while installing. 3. Install dependencies for libraries using `pip3 install pyserial`. 4. Check if pyserial was installed correctly by running `python3 -c "import serial"` if you see no error message, it worked! 5. If the pip3 command is not found or the library is not available, navigate to your Python install directory, on Windows this is usually `C:\Users\<username>\AppData\Local\Programs\Python\Python37`, enter the `Scripts` directory and launch a PowerShell/cmd window using `Shift + RightClick`, and then try `./pip3 install pyserial`. 6. If Orion5 robotic arm is not being recognised by Orion5Server.py or coming up as "not recognised" by your machine, you may need to update your Virtual COM Port (VCP) driver, find the appropriate installer for your machine here: https://www.ftdichip.com/Drivers/VCP.htm ## MATLAB Library _In order to use the MATLAB library, the `Orion5Server.py` Python program is required to run in the background; it acts as an interface between MATLAB and the Orion5 Robotic Arm_ ### Python Server 1. The program `Orion5Server.py` is required to be running in the background to use the MATLAB library. 2. If the 'Install Dependencies' steps above have been completed, launch the `Orion5Server.py` program by double clicking it or by running `python3 Orion5Server.py` in the Libraries directory. 3. The server will print out `Waiting for connections` if it is running correctly. You will see a `Connection from 127.0.0.1:XXXX` when either MATLAB script or Python script connects to the server. 4. If your MATLAB script crashes midway or does not call the `<library_reference>.stop()` function correctly upon completion, a socket may be kept open from MATLAB to `Orion5Server.py`. This may appear as an `OS Error` in python, or a `socket error` in MATLAB next time you run your script. Simply call the `<library_reference>.stop()` function in the MATLAB console to cleanly exit the Orion5.m library. 5. Press `Ctrl+C` to quit the server cleanly. ### Basic Usage The library pings the Python server every second if no other library functions are being called, this is like a watchdog timer, if Python server doesn't hear anything for 5 seconds, it will return to waiting for a new connection. The MATLAB script `test_script.m` demonstrates some of the functionality. #### Create an instance of the library ```matlab orion = Orion5(); ``` #### Cleanup and quit an instance ```matlab orion.stop(); ``` #### Joint ID constants Use these constants to select which joint to interact with. ```matlab Orion5.BASE Orion5.SHOULDER Orion5.ELBOW Orion5.WRIST Orion5.CLAW ``` #### Notes about control mode The smart servos used in Orion5 have a number of control modes; namely `POS_SPEED`, `POS_TIME` and `VELOCITY`. **POS_SPEED:** The servo will move towards the desired goal position (set using `setJointPosition`) at the desired speed (set using `setJointSpeed`) after moving through its acceleration profile. **POS_TIME:** The servo will move towards the desired goal position (set using `setJointPosition`) and arrive there in a specified amount of time (set using `setJointTimeToPosition`). Time is passed to the function as seconds, and the time can have a resolution of 100ms. **VELOCITY:** In this mode the servo will move at the speed set by `setJointSpeed` or `setAllJointsSpeed` and ignore desired position and hard angle limits set in the servo by the embedded electronics. Users must make sure to read servo positions in a high frequency control loop to avoid driving joints through each other. There is no acceleration profile in this mode; so users will have to consider this in their control system implementations - Otherwise inertia of moving joints will damage gearboxes and make for not-very-smooth motion. _(Embedded processor enables Orion5 to prevent users from driving joints through each other. However do not rely on this in your control loop as it enables emergency stop mode, requiring user intervention to resolve. See the user manual (https://goo.gl/h3i2br) for more details.)_ #### To set the control mode for each joint The following constants are available in the Orion5.m library. ```matlab Orion5.POS_SPEED Orion5.POS_TIME Orion5.VELOCITY ``` This function will set the desired control mode for a specified joint. ```matlab orion.setJointControlMode(Orion5.BASE, Orion5.POS_TIME); ``` ### Getters and Setters for all joints #### Read all joint positions This will return an array of 5 angles in degrees in the range 0-359 for all joints. You can use the Joint ID constants to index this array. ```matlab all_positions = orion.getAllJointsPosition(); ``` #### Read all joint speeds This will return an array of 5 speeds, servo speed is represented as a 10 bit number (0-1023). The conversion to RPM is shown in the example below. You can use the Joint ID constants to index this array. ```matlab all_speeds = orion.getAllJointsSpeed(); shoulder_speed_RPM = all_speeds(Orion5.SHOULDER) * 0.110293; ``` #### Read all joint loads This will return an array of 5 values representing the current load on each joint. Load for the G15 servos is an arbitrary value representing the electrical current through the motor. The load value is a 10 bit number (0-1023). You can use the Joint ID constants to index this array. ```matlab all_loads = orion.getAllJointsLoad(); ``` #### Set all joint positions This function takes an array of 5 angles in degrees, in the range 0-359, and sets the position for all joints in one function call. This method is several times faster than calling the `setJointPosition` function separately for each joint. ```matlab positions = [0 216.8 62.5 225.94 30]; orion.setAllJointsPosition(positions); ``` #### Set all joint speeds This function takes an array of 5 speeds, in the range 0-1023, and sets the speed for all joints in one function call. This method is several times faster than calling the `setJointSpeed` function separately for each joint. **Set the direction of the velocity by wrapping the desired speed with the `CWVelocity(v)` and `CCWVelocity(v)` functions - for clockwise, and counter-clockwise movement respectively.** _(A future update will use the sign of the velocity to determine the direction)_ **Make sure to set control mode to `Orion5.POS_SPEED` or `Orion5.VELOCITY` before calling this function.** _Read more about control mode at the top of this file_ ```matlab speeds = [0 0 CWVelocity(120) CCWVelocity(90) 0]; orion.setAllJointsSpeed(speeds); ``` #### Set all joints torque enable setting The G15 servos have a torque enable setting, if enabled in position mode this means the servos will hold their position using motor torque. Be aware that if torque is disabled in position mode the servo will still m
评论
    相关推荐
    • SynergyPro 1.10.0 MacOS+Windows.zip
      此版本为stable_b39-275cdc1c Synergy Pro版本,包含了WindowsMACOS版本
    • VLC windows Macos
      VLC应用,平常下载比较慢,现在下载下来方便使用 VLC windows Macos
    • windows下制作macOS安装U盘,绝对简单好用
      windows下制作macOS安装U盘,绝对最简单最好用!!! 很多人苹果的系统起不来了,想重装又苦于没有系统安装U盘。 这时,你如果有另外一个能用苹果的系统,那么制作安装U盘非常简单。 如果你只有windows的环境,那么我...
    • Windows远程桌面连接工具 for MacOS
      Windows远程桌面管理工具for MacOS,可以在MacOS中远程连接到Windows机器,可以保存多个远程连接
    • alt-tab-macosmacOS上的Windows alt-tab
      AltTab AltTab将Windows alt-tab的功能引入macOS
    • soundcleod, 用于 macOSWindows的SoundCloud.zip
      soundcleod, 用于 macOSWindows的SoundCloud 什么是 SoundCleod?SoundCleod是一个桌面应用程序,它将 SoundCloud 到 macOSWindows,无需使用浏览器。为什么 这样 做好 ?没有'正在尝试在哪个选项卡上运行'...
    • MacOs.zip,windows
      windows中安装mac系统,体验mac系统功能, 在windows中安装mac系统,体验mac系统功能 在windows中安装mac系统,体验mac系统功能 在windows中安装mac系统,体验mac系统功能
    • soundcleod, 用于 macOSWindows的SoundCloud.zip
      soundcleod, 用于 macOSWindows的SoundCloud 什么是 SoundCleod?SoundCleod是一个桌面应用程序,它将 SoundCloud 到 macOSWindows,无需使用浏览器。为什么 这样 做好 ?没有'正在尝试在哪个选项卡上运行'...
    • c代码-windows no,macOS yes
      c代码-windows no,macOS yes
    • Synergy 1.8.8 MacOS
      该资源为MAC OS稳定版本的Synergy 1.8.8 版本,可以配合我之前上传的Windows版本同时使用,亲测可用