ActPack Software

The Dephy Actuator Package—the ActPack—is our fully integrated actuator hardware. The Dephy ExoBoot is our ankle exoskeleton hardware. Both hardware platforms can run on the ActPack Software, which is the subject of this page.

  1. Hardware Platforms
  2. The Dephy Actuator Package (ActPack) is a turnkey mechatronics solution that provides everything needed for most wearable robotic joints. A high-performance brushless motor with its power electronics, sensors, programmable safety features, and open API are all neatly packaged in a minimalist enclosure.

    The Dephy EB60 ExoBoot is built around an ActPack 4.1.

  3. ActPack 0.2(B) ActPack 4.1 EB60
    Sold 2019–2020 Sold in 2021 Sold in 2021
    ActPack 0.2(B) Datasheet ActPack 4.1 Datasheet EB60 Datasheet available upon request (sales@dephy.com)
  4. The three platforms share the same:
    • Cross-platform API
    • High-performance BLDC motor
  5. Features improved for ActPack 4.1 versus ActPack 0.2(B):
    • Smaller form factor
    • Rugged USB-C connector
    • Integrated XT30 power connector
    • Expansion connector
    • Bootloader
    • Bluetooth Smart
    • Three configurations: direct drive, 6:1, and 9:1
  6. Getting Started with the ActPack
  7. You just received a brand new ActPack 4.1! We'll walk you step-by-step through how to connect your ActPack and read sensor data and/or make the motor move. The steps for setting up the GUI and the Scripts may be done either in series or in parallel. We recommend trying both.

    1. Install Software Tools
    2. GUI Scripts
      1. Download the latest GUI release. 1. Install git.
      2. Extract the zip. 2. Clone the repository.
      git clone https://github.com/DephyInc/Actuator-Package.git
      3. Launch Plan4.0.exe. 3. Install the dependencies by following our guide.
    3. Connect ActPack + Read Sensor Data
    4. GUI Scripts
      1. Connect your ActPack to your computer with a USB-C cable.
      2. Hold the button until the ActPack turns on. (User Interface)
      3. Record the serial port assigned to your ActPack (e.g. COM5 or /dev/ttyACM0).
      4. Select the serial port in the dropdown menu. 4. Edit com_template.yaml/com.yaml (guide).
      5. Click "Play" and open the Device Window (under "Add View"). 5. Launch fxMain.py and select "Read Only".
      python fxMain.py
      (Optional)
      6. Adjust low voltage protection (UVLO).
      7. Adjust I²t current limit.
    5. Connect ActPack + Control Motor
    6. GUI Scripts
      1. Secure your ActPack to a working surface.
      2. Connect your ActPack to your power supply with an XT30 connector. Apply a voltage > UVLO.
      3. Hold the button until the ActPack turns ON.
      4. Connect your ActPack to your computer with a USB-C cable.
      5. Record the COM port assigned to your ActPack.
      6. Select the COM port in the dropdown menu. 6. Edit com_template.yaml/com.yaml (guide).
      7. Click "Play" and open the Device Window (under "Add View"). Confirm that you can read the battery voltage. 7. Launch fxMain.py and select "Read Only."
      python fxMain.py
      Confirm that you can read the battery voltage
      8. Open the Device Window (under the Tools menu) 8. Launch fxMain.py and select" "Open Speed." The motor will start moving! (see demo scripts)
      python fxMain.py
      9. Set the controller to "Open."
      10. Click on the slider and enter a max of 3000. Slide to make the motor move.
    7. What Else Can I Do?
    8. Congrats! You now know how to read sensor data and make your motor move. What happens next is up to you! Here are a few ideas to try:

      GUI Scripts
      Using the same Control window, experiment with the various controllers Run the other scripts (current, position, impedance, etc.) (see demo scripts)
      Read sensor data in the Device Window as well as the 2D Plot window Visualize data in the console and in the Matplotlib outputs
      Explore the other tools included with Plan 4 Use our scripts as a starting point for your own experiments!
  8. GUI and Demo Scripts
    1. GUI
    2. The Plan GUI is a graphical dashboard for FlexSEA and Dephy ExoBoot projects. It's a cross-platform program written in C++ with the Qt framework. It allows data visualization, data logging, controller tuning, and much more. Think of it as the combination of an oscilloscope and a software debugger. For 99% of applications, it should be the first thing you use with a new FlexSEA device. The GUI is distributed as a pre-compiled executable (Windows and Linux).

      As an alternative to the Plan GUI, we provide high-level scripts to wrap around the C/C++ FlexSEA stack. The repository is available on git. These scripts are the foundation for clients who desire to write custom controllers. The scripts are distributed as source code — you can (and should!) modify them to fit your needs.

      Both the GUI and the scripts are built on top of the Dephy Stack. Features added to one tool can typically be easily supported in the other as they share a common API.

      Can Can't
      GUI
      • Stream sensor data at hundreds of Hz (USB) or 100 Hz (Bluetooth) while using the Dephy Walking Controller or ActPack firmware; save to CSV logs; visualize in the 2D plot.
      • Send basic motor control command via the Control Loop window.
      • Control experiments via various tools.
      • Modify. This program is closed source.
      • Run your own controller
      Scripts
      • Stream sensor data at hundreds of Hz (USB) or 100 Hz (Bluetooth) while using the Dephy Walking Controller or ActPack firmware; save to CSV logs; visualize in the 2D plot.
      • Send advanced motor control command (refer to the Demo examples).
      • Write your own controller.
      • Modify as much as you want, this is open source.
      • Plot live sensor data unless you write your own tool.
      • By default, the scripts do not support customer-specific tools. We usually build these in specific, private GUIs.
      1. Preparing for GUI Motor Control Experiments
        • Make sure that your ActPack is connected to a battery or power supply. You cannot make the motor move under USB power.
        • Make sure that you are connected to the GUI via USB or Bluetooth and that you can read data.
        • Make sure that the motor is free to spin.
        • Under the Add Control menu, click on Control Loop.
      2. Open Speed
        • Select the corresponding Device ID as your “Active slave.”
        • Select Open in the “Controller” drop-down list.
        • Click "Set Controller."
        • Click on Slider (You can use the Toggle tab or the Slider tab. For Open, Slider might work better.)
        • Enter a max value (mV). 5000mV is a good starting point for benchtop experiments. Press Enter or click “Update Min-Max”.
        • Move the slider and your motor will respond to your input.
      3. Position Controller
        • Select the corresponding Device ID as your “Active slave”.
        • Select Position in the “Controller” drop-down list.
        • Click "Set Controller."
        • Write to Setpoint. Use the same value as the motor position.
          • If Motor Angle is 0 in Device Window type 0 in setpoint. If your initial Motor Angle value point is different from your setpoint, we recommend using the current value as the set point to prevent the motor from jumping when changing setpoints.
        • Write gains.
          • Use these default values: Kp = 25, Ki = 2. Click “Set Gains”.
          • Gains are only sent when you send a new setpoint.
        • Make the motor move by changing the setpoint.
          • 6.1. If Motor Angle is 0, try a Setpoint A = 0 and Setpoint B = 10000.
        • Experiment with gains.
          • 7.1. For example, setting Kp = 50, Ki= 3 will result in steeper motor angles and Kp = 200, Ki = 0 will result in nearly linear moves between setpoints.

        Recommended Position Controller gain ranges are listed below:

        • Proportional gain (Kp): [0 1000]
        • Integral gain (Ki): [0 1000]
        • Differential gain (position control only, Kd): [0 1000], 0 recommended
        • Feed Forward gain (FF): 0 (only active for Current and Impedance)
      4. Current Controller
      5. The Current Control mode is very similar to the Position Control Mode. Kp and Ki gains are still used with the addition of a Feed Forward Gain (FF). For FF, 0 is 0% and 128 is 100%. Note that setting the Feed Forward gain (FF) to 128 may cause instabilities in certain scenarios. Only increase it if the performance is really needed. Recommended Current Controller gain ranges are listed below:

        • Proportional gain (Kp): [0 80], 40 recommended
        • Integral gain (Ki): [0 800], 400 recommended
        • Differential gain (position control only, Kd): 0
        • Feed Forward gain (FF): [0 128], 128 recommended

        In electric motors, current is proportional to torque. With a free spinning shaft (e.g., an ActPack on your benchtop without an attached load), a motor commanding a high current will result in very fast speeds, and likely oscillations. You can test the Current Controller at very low currents (±100mA), or you can load the output (e.g., a pulley and an attached weight). Keep fingers and other objects away from the ActPack in Current Control Mode and do NOT hold the shaft to test the Current Controller!

      6. Impedance Controller
        • Select corresponding Device ID as your “Active slave”.
        • Select Current in the “Controller” drop-down list.
        • Set Proportional (Kp) and Integral (Ki) gains. Kp = 40 and Ki = 400 are good starting points.
        • Click “Set Gains”.
        • Select Impedance in the “Controller” drop-down list.
        • Click “Set Controller”.
        • Set K and B as desired. As a starting point K = 200 and B = 0 will give you a weak spring. Set the Feed Forward, FF = 128.
        • Click “Set Gains”. You can test the weak spring by manually moving the motor.
        • You can continue to change and set the impedance gains as you wish.
          • The following chart displays K and B values that result in 0 overshoot:
            K B
            100 650
            200 1200
            300 1600
            500 2500
            1000 3500
            2000 5500
    3. Demo Scripts
    4. The current scripts consist of 11 demos written in Python. Preliminary support exists for C/C++, MATLAB, and SIMULINK. Reach out to technical@dephy.com if you would like to know more about languages other than Python. Each script shows how to perform various operations using the API. Each of the scripts are functionally equivalent across the languages.

    5. Units and Gains
    6. Please read the Control Gains section. The gains used below are for the latest release of our firmware; you may need very different gains!

      Please see the Units section for more information about the units used in the various sensor readings.

    7. Disclaimer
    8. Most of these scripts make the motor in the Actuator Package move. It is imperative the motor is allowed to spin freely and that the Actuator Package is securely attached to a working surface in order to prevent it from jostling around.

      1. Read Only
        • Controller type: none (CTRL_NONE)
        • Motor: does not move
        • Display: streams many variables, no plots
        • When to use: This should be the first script you run to make sure that your system works well and that you can read data.
      2. Open Control
        • Controller type: open / motor voltage (CTRL_OPEN)
        • Peak voltage: 3000 mV
        • Profile: ramps from 0 to peak then back to 0. Repeats twice.
        • Display: streams many variables, no plots
        • User interaction: none, let the motor speed up and down
        • What can be changed: you can test with a different peak voltage, or with a different ramp speed
      3. Current Control
        • Controller type: current control (CTRL_CURRENT)
        • Current: 1000 mA
        • Profile: holds constant current for 10 seconds then ramps it down to zero.
        • Display: streams many variables, no plots
        • Gains: (Proportional) kp = 40, (Integral) ki = 400, (Feed Forward) FF = 128
        • Motor: motor can be left free (it will spin up fast then stabilize) or held in place. Compare the motor current to the requested current.
        • What can be changed: you can test with a lower or higher current. We do not recommend going above 1000 mA during benchtop experiments. You can also change the gains.
      4. Position Control
        • Controller type: position control (CTRL_POSITION)
        • Position: measures position when the script is launched and uses it as the setpoint
        • Profile: holds a constant position for 5 seconds
        • Display: streams many variables, no plots
        • User interaction: try moving the motor away from its current position. It's a very stiff controller.
        • Gains: (Proportional) kp = 400, (Integral) ki = 50
        • What can be changed: gains

        The Two Devices Position Control variant of this script controls more than one motor.

      5. Two Positions Control
        • Controller type: position control (CTRL_POSITION)
        • Position: measures position when the script is launched and uses it as the initial setpoint. Delta is 10000 ticks.
        • Profile: toggles between two positions every second, initial and initial+delta. Does that for 16 seconds.
        • Display: streams many variables, position plot
        • Gains: (Proportional) kp = 50, (Integral) ki = 0 (soft, smooth 1st order response)
        • What can be changed: gains, timings
      6. Impedance Control
        • Controller type: impedance control (CTRL_IMPEDANCE)
        • Position: measures position when the script is launched and uses it as the initial position. The position change will be 7500.
        • Gains
          • Current controller: kp = 40, ki = 400, FF = 128
          • Impedance: K = 600, B = 300 (initially)
        • Profile: Setpoint toggles between two positions every 800 ms. The impedance damping (B) starts at 300 and increments by 150 every cycle.
        • Display: streams variable, position plot
        • What can be changed: gains, timings
        • What to look for: you will hear the changes in damping. With the Python scripts, a plot will also be generated.
      7. High-Speed Test
      8. This script demonstrates sending commands to and reading data from the FlexSEA device at high (0-1000Hz) speeds. By default, it does this by sending a sinusoidal control signal to the FlexSEA device and reading sensor data to show the response from the FlexSEA device. If using Python or MATLAB, the control signal and the response signal from the FlexSEA device are shown on a generated plot.

        We wrote this script to perform system stability tests. When we release software, we run High Speed Test for 1h on a Raspberry Pi and we make sure that the communication is error free for the entire period.

        Default current control experiment (Python):

        
                              def fxHighSpeedTest(port, baudRate, controllerType = Controller.current,
                                  signalType = signal.sine, commandFreq = 1000, signalAmplitude = 1000,
                                  numberOfLoops = 10, signalFreq = 1, cycleDelay = .1, requestJitter = False, jitter = 20)
                            

        Default position control experiment (Python):

        
                              def fxHighSpeedTest(port, baudRate, controllerType = Controller.position,
                                  signalType = signal.sine, commandFreq = 1000, signalAmplitude = 10000,
                                  numberOfLoops = 10, signalFreq = 1, cycleDelay = .1, requestJitter = False, jitter = 200)
                            

        Parameters:

        • controllerType: can be current or position
        • signalType: sine (sine wave) or line (constant command)
        • commandFreq: frequency at which we write to the device
        • signalAmplitude: for a sine wave it's the peak, for a steady command it's the average/DC
        • numberOfLoops: controls the number of sine waves. In line-mode, it controls the time.
        • signalFreq: sine wave frequency
        • cycleDelay: adds a delay between cycles, as seen on the plot below
        • requestJitter: for line experiments, introducing noise helps to detect a locked-up system. Set to True to enable some jitter.
        • jitter: jitter amplitude

        Other configurations:

        • Autostreaming at 1kHz
        • Always logging
        • Current gains: kp = 40, ki = 400, ff = 128
        • Position gains: kp = 300, ki = 50
      9. High-Stress Test
      10. This script uses current control and applies large commands to the motor which results in high acceleration. These commands are applied in opposite directions, which results in the motor change rotation directions rapidly and undergoing a significant amount of stress. This script was written to simulate typical wearable robotics applications: more than one controller used in a gait cycle, and some sort of closed loop. This is a great starting point for users looking to write their own controller.

        The profile used will regenerate current. Use a linear power supply or a battery. Instability may occur if you use a regular bench-top power supply that is not designed to accept negative currents.

        Values that work well on Windows, ActPack 4.1 and BA30 as the power source:

        
                              def fxHighStressTest(port0, baudRate, port1='', commandFreq=100,
                                  positionAmplitude=10000, currentAmplitude=1500,
                                  positionFreq=1, currentFreq=5, currentAsymmetricG=1.15, numberOfLoops=3):
                            

        Parameters:

        • port0 and port1: ports of the devices being controlled
        • baudRate: communication baudrate
        • commandFreq: frequency at which we write to the device
        • positionAmplitude and currentAmplitude: for a sine wave it's the peak, for a steady command it's the average/DC
        • positionFreq and currentFreq: sine wave frequency
        • numberOfLoops: controls the number of sine waves. In line-mode, it controls the time.
        • Current control gains: kp = 40, ki = 400, ff = 128
        • Position control gains: kp = 100, ki = 10

        Additional Information:

        • The Read & Write rates are not guaranteed
          • On Windows we have difficulty writing at more than 200Hz. The maximum rate attained is system-dependent.
          • The example provided uses 100Hz. Trying to go faster than what the OS can tolerate leads to instability.
          • On a RaspberryPi or other native Linux systems, a rate over 600Hz can be achieved consistently.
        • Other software running on your computer can affect the script performance
      11. Find Poles
      12. To commutate the brushless motor we need to map pole positions to encoder count. In products like the ActPack, the use of an absolute encoder means that this routine is only called once after the package is assembled. Some clients have relative encoders; they need to find poles every time they power the system. The Find Poles script is intended for these customers only. Use with care! If you do a wrong calibration your Package will be unusable until you properly find the poles.

        There is little user interaction although the script in some languages will display a message indicating how long it has been running. Wait for the motor to stop moving before launching other scripts.

      13. Two Devices Position Control
      14. This is a version of the Position Control script described above, but for more than one actuator.

        For each motor:

        • Controller type: position control (CTRL_POSITION)
        • Position: measures position when the script is launched and uses it as the setpoint
        • Profile: holds a constant position for 5 seconds
        • Display: streams many variables, no plots
        • User interaction: try moving the motor away from its current position
        • Gains: (Proportional) kp = 50, (Integral) ki = 3
        • What can be changed: gains
      15. Two Devices Leader/Follower
      16. This script demonstrates how one device is configured as a “controller” for the second device. The position of the first device is used to make the second device follow it. As the user rotates the first device, the second device will rotate an equivalent amount. This demonstrates how a user can build a controller that uses information from one joint to inform a second joint.

        Setup & Usage

        • Power two ActPack and connect them to your computer via USB
        • Edit com.txt to have two COM ports
          • The first COM port will be the Leader
          • The second COM port will be the Follower
        • Launch the “Two Devices Leader-Follower Control” script
        • When asked, enter that you have two devices
        • Move the Leader motor and observe the Follower motor

        Details:

        • Device #1 - Leader
          • Controller type: current control(CTRL_CURRENT)
          • Setpoint: 0mA (the motor can easily be moved by hand, no resistance)
          • Position: measures position when the script is launched and uses it as the initial setpoint
          • Profile: the motor is not controlled, can be moved manually
          • Gains: (Proportional) kp = 40, (Integral) ki = 400, (Feed-forward) ff = 128
        • Device #2 - Follower
          • Controller type: position control (CTRL_POSITION)
          • Setpoint: determined by Leader
          • Position: measures position when the script is launched and uses it as the initial setpoint
          • Profile: holds a constant position. That position comes from the Leader
          • Gains: (Proportional) kp = 50, (Integral) ki = 10
        • Display: streams many variables for each device, no plots.
        • User interaction: Move the Leader motor and observe the Follower motor
        • What can be changed: gains, equation linking both motors (sign, ratio)
  9. Reading & Writing to/from a Device
  10. Can Can't
    USB Without connecting a battery, it can power the logic circuits (no motor power). You can use that to:
    • Test the Read Only script and/or the GUI.
    • Test your own script without making the motor move.
    • Re-program the microcontrollers.
    With a battery connected:
    • Test the Dephy demo scripts and/or the GUI.
    • Test your own scripts.
    • If you use a Raspberry Pi 4, you can use USB to control the motor at 700 Hz+.
    • Go for a walk unless you carry your embedded computer or laptop.
    Bluetooth
    • Test the Read Only script and/or the GUI.
    • Stream sensor data at 100 Hz while using the Dephy Walking Controller.
    • Send control commands at more than 0.1–5 Hz (with variable latency)
  11. Before conducting any experiment, make sure to review dephy.com/safety.
    1. Data Acquisition and GUI
      1. Pair ExoBoot via Bluetooth (Windows)
        • On a Windows device, type Bluetooth in your search bar and go to “Bluetooth and other devices settings”
        • Ensure your Windows device has Bluetooth turned on. Click the large “+” at the top of the screen to add a new device.
        • Select the first option for “Bluetooth” at the “Add a device” window.
        • Your device should appear as “Exo-BLE-####” and “Exo-SPP-####” with the #’s matching the ID on the side of your ExoBoot System. Select Exo-SPP-####, then click connect.
        • In order to connect to the Dephy Plan GUI, you must know the outgoing COM port of your device, this is found by going into the “More Bluetooth options” setting on the far-right side of the “Bluetooth and Other Device Settings” window (this window must be fully expanded to see this option).
        • Once the window is open, select the “COM Ports” tab to see the devices’ Outgoing COM ports as see in the image below:
      2. Connect ExoBoot via USB (Windows)
      3. With recent versions of Windows and ActPack, 95% of users can simply connect their device and use it. If you cannot follow the steps in 4.1.3 (no serial port detected, or no FlexSEA device found) we recommend following these Driver Installation steps first:

        Driver Installation

        FlexSEA-Manage and FlexSEA-Rigid use an STM32 microcontroller. While it supports USB, it requires a special driver on Windows. Without this driver, a COM port will be detected but you will not be able to read/write data.

        Step-by-step:

        • Obtain a copy of the driver.
        • Click Get Software and enter the requested information. An email will be sent to verify your email address.
        • In the email, click Download Now. A zip file containing the driver contents will download.
        • Open the en.stsw-stm32102.zip file and extract the contents.
        • Install the Virtual Com Port driver to be able to connect to the STM32 chip on the FlexSEA. Do this by running the application: VCP_V1.5.0_Setup_<…>.exe where <…> corresponds with your machine OS and architecture.
        • Unplug and re-plug your device. Make sure that Windows detects a valid COM port, the device should appear as “STMicroelectronics Virtual COM Port (COMx)” in the Device manager. If you see a yellow exclamation mark it means that your driver is not properly installed.
      4. Troubleshooting:
      5. In case there is an issue installing the driver, try the following steps:

        • Go to the installation directory, which is most likely: C:\Program Files(x86)\STMicroelectronics\Software\Virtual comport driver\Win8…
        • … and run the application corresponding to your operating system: dpinst_amd64.exe for 64-bit windows. dpinst_x86.exe for 32 bit windows
        • Unplug and re-plug your device. Make sure that Windows detects a valid COM port, the device should appear as “STMicroelectronics Virtual COM Port (COMx)” in the Device manager. If you see a yellow exclamation mark it means that your driver is not properly installed.
      6. Connecting
      7. Access the application named “Plan 4.0” from either the desktop folder, start menu or Windows taskbar.

        If you see the screen below, congratulations! You have accessed Plan GUI. Follow the steps below to connect to the device and begin testing!

        • Select the desired device using its COM port number found while pairing to Bluetooth above.
        • Click the "Connect" button.
        • This box will display the ExoBoot side and ID number. A successful pairing will result in the graphic below.
        • Hit the “Play” button at the end of that row to begin collecting data.
          • You can select the “+” or “-” to add or remove rows from the screen, while the down arrow shrinks the connection options to make more room on the screen.
      8. Sampling Rate
      9. Once connected, the drop-down menu to the right of the Exo ID box can be selected to view Sampling Rate options. If connected via Bluetooth, sampling rates of 1 - 100Hz can be selected. Sampling rates of greater than 100Hz cannot be achieved without a wired USB connection.

      10. Streaming and Visualizing
        • Go to “Add View” to add a 2D plot to begin visualizing your data in real-time.
          • The 2D plot allows you to plot up to 6 variables simultaneously across your connected devices. The Slave ID corresponds to the Exo ID number.
  12. Control Gains
  13. As our clients push the limits of what can be done with the system, we learn and adapt. As a result, the recommended gains depend on the firmware version you are using. Please use this information for releases 4.1+.

    The correct gains depend on your application and your system. The values listed below are only provided as an example to give you an idea of the range.

    1. Firmware
    2. Our controllers' stability is near the maximums. There is also a feed-forward (FF) gain for the commands and controllers. For FF, 0 is 0% and 128 is 100%.

      The current units reflect the Q-axis current in Field Oriented Control. As such, their magnitude is 38% of the units from the firmware before 4.1. This leads to a redefinition of the torque constant since Kt = unit torque per unit current. An older controller that commanded 1000 mA during a phase of the gait now would just need to command 380 mA.

      Release 5.0 uses Q-axis voltage. Previous releases used line-2-line voltage. An older controller that commanded 1000 mV now would just need to command 735 mV.

    3. Typical Values
    4. These values are used in our controller settings and result in a safe operation. Use them as a starting point to adjust the gains of your specific application.

      Note that setting the FF to 128 may cause instabilities in certain scenarios. Only increase it if the performance is really needed.

    5. Current
      • Proportional gain (kp): [0, 80], 40 recommended
      • Integral gain (ki): [0 800], 400 recommended
      • Differential gain (position control only, kd): 0
      • Feed Forward gain (ff): [0 128], 128 recommended
    6. Position
      • Proportional gain (kp): [0 1000]
      • Integral gain (ki): [0 1000]
      • Differential gain (position control only, kd): [0 1000], 0 recommended
      • Feed Forward gain (ff): 0 (only active for Current and Impedance)
    7. The following plot shows a step function with [kp,ki] = [50, 0], [50, 50], [100, 0], [100, 50], [200, 0], [200, 50], [400, 0], [400, 50]. kd is always 0.

      For bench top experiments with an ActPack kp=50 & ki=0 works well (smooth, no overshoot).

    8. Impendance
      • Proportional gain (kp): 40
      • Integral gain (ki): 400
      • Differential gain (position control only, kd): 0
      • Stiffness (impedance control only, K): [0 2000]
      • Damping (impedance control only, B): [0 20000], begins to vibrate around 15000
      • Feed Forward gain (ff): 128
    9. The following pairs represent K and B pairs that result in 0 overshoot:

      Commanded motor current = A × vel × B + C × K × (delta)

      • vel = motor velocity [degrees per second]
      • delta = (setpoint - motor position) [motor clicks → 16384 clicks per rotation]
      • A = 0.00028444
      • C = 0.0007812
      K B
      100 650
      200 1200
      300 1600
      500 2500
      1000 3500
      2000 5500
    10. Physical Correlations
      • Motor velocity units: degrees per second
      • Impedance Setpoint: motor clicks
      • Motor Position: motor clicks
      • Motor click: 16383 clicks per full rotation
      • Motor Torque (mNm) = Commanded current * 0.146
      • B & K were sized to offer sufficient precision within an integer-based embedded system. Please refer to the units above to convert them to physical units if necessary.
    11. For additional information about units, please see the Units section.

  14. Firmware
    1. Firmware, GUI, & Scripts (F, G, S)
    2. Get files from one of the following sources, listed in recommended order:

    3. Firmware Options
    4. The ActPack embedded system uses three microcontrollers: Mn, Ex, and Re. They each need to be programmed with firmware. All hardware comes with firmware installed. Should you need to update your firmware, below are guidelines for selecting the appropriate firmware variant for each microcontroller.

    5. Mn: Manage
    6. For the ActPack hardware:
      • ActPack Firmware. With this firmware, once the device is ON, the motor only moves when you send control commands from the GUI, our sample scripts, or your own scripts.
    7. For the ExoBoot hardware:
      • ActPack Firmware. Same as above. With this firmware, the ExoBoot hardware will behave just like the ActPack hardware.
      • Dephy Walking Controller. This firmware will detect and augment gait out of the box. It is closed-source and only accepts a limited number of external inputs.
      • Custom Walking Controller. This firmware can be customized to accept external inputs for specific needs. For client partnerships.
    8. Ex: Execute
      • Select the firmware that matches your hardware platform version. The .hex file you use must match your FlexSEA-Rigid version (e.g., Rigid 4.1).
    9. Re: Regulate
      • Select the firmware that matches your hardware platform version. The .hex file you use must match your FlexSEA-Rigid version (e.g., Rigid 4.1).
      • Select MultiColor (recommended default) or MonoColor firmware. See User Interface for more info.
      • For special experiments, the .hex filename may contain other descriptor words.
    10. Which firmware do I have?
    11. Manage files use the following naming convention: <Date-Project-Hardware Platform & Version-Option(s)>

      • ex. 20201027-ActPack-rigid0.2.hex: ActPack firmware for a Rigid 0.2 board (used by ActPack 0.2(B))
      • ex. 20201027-Exo-rigid3.0-left.hex: Dephy Walking Controller for a Rigid 3.0 board, left boot

      Execute and Regulate files use the following naming convention: <Date-Project-Hardware Platform-Hardware Version-Option(s)>

      • ex. 20201027-fx-rigid-ex-HW02.hex: Execute for Rigid 0.2
      • ex. 20201027-fx-rigid-re-HW30-MultiColor.hex: Regulate for Rigid 3.0, MultiColor LED
    12. What can I do with the firmware?
    13. Can Can't
      ActPack (software)
      • Control the motor from the GUI.
      • Control the motor from the Dephy demo scripts.
      • Write your own controller in Python, C++, or MATLAB.
      • Detect and augment gait until you write your own controller.
      Dephy Walking Controller
      • Program it on the ExoBoot and go for an augmented walk.
      • Control the motor from the GUI.
      • Control the motor from the Dephy demo scripts.
      • Write your own controller in Python, C++, or MATLAB.
      Custom Walking Controller
      • Conduct a very specific experiment.
      • Control the motor from the GUI.
      • Control the motor from the Dephy demo scripts.
      • Write your own controller in Python, C++, or MATLAB.
    14. Compatibility
    15. Dephy provides firmware as a bundle of 3 files: Mn, Ex, and Re (if you purchased more than one Mn firmware option, you may get 4 files). We highly recommend using the files together and not mixing versions. As we add features, we often make small changes to the interfaces between the different microcontrollers. Using an old Re with a new Mn can prevent you from using new features (best case scenario) or lead to unstable behavior (worst case scenario).

      Question: Can I flash the same ActPack firmware I use on my ActPack on my ExoBoot?

      Answer: No. While they use the same API, the PCB version is likely not the same. To date, most ActPacks released use Rigid 0.2 with a Cortex-M4 microcontroller, while ExoBoots use Rigid 3.0+ with a Cortex-M7 microcontroller. The hex files are very different.

      Follow-Up Question: It's the same PCB! Now, can I use the hex file?

      Answer: Generally, still no. The joint angle sensor used by ExoBoots is different than the encoder supplied as an ActPack accessory and the correct version must be programmed.

      Question: Can I update Mn and leave Ex/Re as is?

      Answer: Only if you are changing to a second Mn file from the same bundle. If not, please follow the steps for Reprogramming Hardware.

  15. Reprogramming Hardware
    1. Manual Process
    2. The Manual Process uses in-circuit programmers, in contrast to using bootloaders. Please note that in many situations, only Mn needs to be changed. Mn's connector is typically exposed and it uses a 0.5 mm pitch FFC (Flexible Flat Cable) connector. Older hardware versions have a 1.0 mm pitch connector.

    3. Full Upgrade
    4. If you are provided with three .hex files, the order of operations is listed below. If you are new to this process, please read the sections below and make sure that you fully understand each step.

      1. High-level order of operations:
        • Program Re
        • Program Ex
        • Program Mn
      2. Detailed order of operations:
        • Power the FlexSEA-Rigid circuit with a USB cable. Do not use battery power.
        • Connect the FFC from the MiniProg3 to the Re connector and program it. See Upgrade Ex or Re below for details.
        • Connect the FFC from the MiniProg3 to the Ex connector.
        • Turn the circuit ON with the pushbutton. Make sure that the LEDs are ON.
        • Program Ex, then disconnect the programmer.
        • Connect the ST-Link to Mn and program it. See Upgrade Mn below for details.
        • Do a full power cycle (not just with the button, remove USB power).

        For all of the details, please refer to the sections below.

      3. Upgrade Ex or Re
      4. Ex and Re use Cypress Programmable System on a Chip (PSoC) microcontrollers. If an update is needed, Dephy will provide you with a hex file. To program it, you will need three tools:

        Before following the step-by-step guide make sure to have all of the tools listed above. We assume that the programmer is connected to your computer, that its drivers are installed, and that you have the correct programming adapter for the task at hand.

        Step-by-step:

        • Connect the FFC (Flat Flexible Cable) from the MiniProg3 to the appropriate Ex or Re connector on the Actuator Package. You will have to remove the enclosure. The FFC contacts have to face the PCB (ie. not visible from above).
        • Power the circuit via USB - no battery.
        • Ex only: Turn the device ON, otherwise Re will keep your device under reset and prevent connection. For Re the circuit can be on or off, as long as it's receiving power it's OK.
        • Open PSoC Programmer and load the hex. Make sure that the settings match the following picture:
          • Note 1: You might have to select your programmer under Port Selection.
          • Note 2: The screenshot shows 5V detected. Some circuits use 3V3. As long as 3V3 or 5V is detected, you are good to go.
        • Click the "Program" icon in the toolbar.
        • When it's done, power cycle.
      5. Upgrade Mn
      6. Mn uses an STM32 microcontroller. To program it, you will need three tools:

        Before following the step-by-step guide, make sure to have all of the tools listed above. We assume that the programmer is connected to your computer, that its drivers are installed, and that you have the correct programming adapter for the task at hand.

        Step-by-step:

        • Connect the 1-mm FFC to the right connector. The connector is exposed, you do not need to remove the enclosure. The FFC contacts have to face the PCB (i.e., not visible from above).
        • Power the circuit via USB - no battery.
        • Turn the device ON, otherwise Re will keep your device under reset and prevent connection.
        • Open the STM32 ST-Link Utility and load the hex.
        • Click "Program" and then "Start".
        • When it's done, power cycle.

        If you are having trouble programming Mn, please review the Settings and Option Bytes sections of the Settings page.

      7. Notes, Conventions, Tips & Tricks
        • FlexSEA-Rigid is the circuit used for ActPacks and ExoBoots.
          • Mn, Ex, and Re are short for Manage, Execute, and Regulate, the three sub-circuits of FlexSEA-Rigid. They each have a microcontroller that may need new firmware at some point.
        • If you receive a .hex/bin file with "HWXX" in the name:
          • "HW" is short for Hardware version.
          • The following numbers are the version: 01 is 0.1, 10 is 1.0, etc. It refers to the FlexSEA-Rigid PCB version.
        • Unless otherwise advised by Dephy, only flash a binary on the proper PCB (HW01 on Rigid 0.1).
        • Re can hold Ex and Mn in reset. To program Ex or Mn, you have to turn Re on first (with the user switch).
    5. Bootloader Process
    6. Starting with release 5.0, all microcontrollers have a bootloader and no programmers are needed to update. If you wish to be an early tester of that feature, please contact us at technical@dephy.com.

  16. Programming Adapters
  17. Two types of microcontrollers are used for the FlexSEA circuits: Programmable System on Chip (PSoC) and STM32. On the FlexSEA-Rigid circuit we use PSoC for motor control (Execute/Ex) and board maintenance and safety features (Regulate/Re). We use STM32 for the application. Depending on what microcontroller you are updating, different adapters have to be used to connect the in-circuit debugger/programmer to the hardware.

    Types of Programming Adapters

    A:
    Microcontroller: STM32 (Mn)
    Programmer: STLINK-V3
    FFC: 0.5mm, integrated. If the contacts are damaged the cable can be cut to expose the next set of contacts.
    Details: Preferred solution to program Mn with an STLINK-V3

    B:
    Microcontroller: STM32 (Mn)
    Programmer: STLINK-V2
    FFC: 1mm connector. Can be used with a 1mm cable, or with a 1mm to 0.5mm adapter cable
    Details: Legacy solution to program Mn with an STLINK-V2. Required to program ActPack 0.2(B) because it supports a 1mm cable.

    C and D:
    0.5 to 1mm FFC adapter. Can be used with B. C is top view, D is bottom.

    E:
    Microcontroller: PSoC (Ex and Re)
    Programmer: MiniProg3 or MiniProg4
    FFC: integrated. If the contacts are damaged the cable can be cut to expose the next set of contacts.
    Details: Preferred solution to program PSoCs.

    F and G:
    1mm FFC cables. Can be used with B to program older ActPack and Exos. For 2021+ products this isn't required. F is top view, G is bottom.

  18. Python Scripts Guide
    1. Important: Compatibility
    2. ⚠️ Not using compatible firmware will result in segmentation faults or unexpected behavior.

      Make sure the Actuator Package repository or flexsea Python package major version matches the major version of the ActPack firmware. This is in accordance with semantic versioning.

      For instance, the flexsea package 6.0.3 is compatible with firmware 6.0 but not with firmware 5.1.

    3. Scripts
    4. The fx_plan_stack API is a suite of functions that configure and control FlexSEA devices. See the full documentation for more information.

      The repo contains the FlexSEA-Rigid Actuator Package library flexsea and sample programs for C/C++, Python, MATLAB and SIMULINK. These scripts are accompanied by and are dependent on pre-compiled libraries for Windows (.dll) or Linux(.so).

    5. Install Python
      1. Linux
      2. Run this script to install the python dependencies before running the python scripts

        
                              ./install_python_deps.sh
                            
      3. Windows 10
      4. On Windows, use this installer to install Python 3.7 and this one to install Git 32-bit. When installing git, select setting the PATH variables, otherwise you'll need to set them manually.

    6. Then, to install the required Python dependencies, run the following command from the root directory of this repository using gitbash:

    7. Install FlexSEA Library
    8. Note: On Windows, replace python3 with python

      
                          # Define your own virtual environment
                          # this is not required but it helps keeping your environment clean
                          $ python3 -m virtualenv --python=/usr/bin/python3.7 actpack
                          # Activate your virtualenv
                          $ source actpack/bin/activate
                          # Once the environment is activated, install the package
                          $ python3 -m pip install --upgrade pip
                          $ python3 -m pip install flexsea
                          # Run your script that uses flexsea
                          # Once you want to stop using the flexsea library and go back to the regular shell
                          $ deactivate
                        

      If flexsea is already installed, and you need to upgrade it, run this:

      
                          # activate your virtual environment if desired as shown above
                          $ python3 -m pip install --upgrade flexsea
                        
      1. Removal
      2. To uninstall flexsea from your computer, run this:

        
                                $ python3 -m pip uninstall flexsea
                              
    9. Getting Started
      1. ActPack
      2. Use this information to set up your ActPack, power it and update its firmware: General information about the Dephy Actuator Package

      3. Get the Demo Scripts
      4. Download the latest release as a zip file.

        Alternatively, use git to clone the repository:

        
                              $ git clone https://github.com/DephyInc/Actuator-Package.git
                              $ cd Actuator_Package
                            
      5. Configuring the Demo Scripts
      6. All scripts can be run on their own. Use --help to see the required command line arguments.

        For your convenience, run_demos.py displays a menu of all available scripts.

        run_demos.py uses ports.yaml to configure the ports used to communicate with the ActPacks.

        You'll need to modify ports.yaml to suit your needs. By default, this files contains the most common Windows configuration along with examples for other platforms.

        To use it, uncomment and/or modify the lines you need. Below is an example of that file used on Windows, with one port (COM3).

        
                              # ports.yaml
                              #
                              # Adjust the baudrate if needed and uncomment or edit the port list.
                              #
                              # Note that commented-out lines start with a "#"
                              # Also the ports list has dashes "-" before the values to signify a list
                              #
                              # See the sample ports values below depending on your platform
                              baud_rate: 230400
                              ports:
                              # Windows
                                - COM3
                                # - COM4
                              # Ubuntu WSL
                                # - /dev/ttyS3
                                # - /dev/ttyS4
                              # Native Linux (e.g. Ubuntu or Raspbian)
                                # - /dev/ttyACM0
                                # - /dev/ttyACM1
                            

        Once you modify your copy of ports.yaml, use the following command to prevent git from tracking the changes.

        
                              $ git update-index --assume-unchanged Python/flexsea_demo/ports.yaml
                            
      7. Running Demo Scripts
      8. Using the Interactive Menu
        • Plug the device in and turn it ON
        • From a terminal, run the Actuator-Package/Python/flexsea_demo/run_demos.py script
          
                                  $ git update-index --assume-unchanged Python/flexsea_demo/ports.yaml
                                  
        • Notice the menu that displays
          
                                    (actpack) ubuntu@PC:~/Actuator-Package/Python/flexsea_demo $ ./run_demos.py
                                     
                                        ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                                        ██░▄▄▀██░▄▄▄██░▄▄░██░██░██░███░██
                                        ██░██░██░▄▄▄██░▀▀░██░▄▄░██▄▀▀▀▄██
                                        ██░▀▀░██░▀▀▀██░█████░██░████░████
                                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                                                  Beyond Nature™          
                                     
                                    STOP!
                                    Read our important safety information at https://dephy.com/start/
                                    before running the scripts for the first time.
                                     
                                    Actuator Package Demo Scripts:
                                    ------------------------------
                                    [0] Read Only
                                    [1] Open Control
                                    [2] Current Control
                                    [3] Position Control
                                    [4] Impedance Control
                                    [5] Two Positions Control
                                    [6] High Speed Test
                                    [7] High Stress Test
                                    [8] Two Devices Position Control
                                    [9] Two Devices Leader Follower Control
                                     
                                    Advanced Utilities:
                                    ------------------------------
                                    [10] Bootloader Check
                                    [11] Find Poles
                                     
                                    Choose experiment number [q to quit]:
                                  
        • Enter the experiment number. Be careful, most of them will make the motor move!

        Alternatively, the run_demos.py script accepts command line arguments. The first argument is the experiment number, and the second (optional) is the number of devices.

        Calling Read Only directly (default = 1 device):

        
                              $ ./run_demos.py 0
                            

        Two Devices Leader Follower is #9, it uses 2 devices. To launch it with one command:

        
                              $ ./run_demos.py 9 2
                            
      9. Launching the Demos Directly
      10. All scripts can be run individually by calling them and passing arguments. Use –help to see usage information. See the example below using high_speed_test.py.

        
                              $ ./high_speed_test.py --help
                              usage: high_speed_test.py [-h] [-b B] Ports [Ports ...]
                               
                              FlexSEA High Speed Test
                               
                              positional arguments:
                                Ports           Your devices' serial ports.
                               
                              optional arguments:
                                -h, --help      show this help message and exit
                                -b B, --baud B  Serial communication baud rate.
                            

        If your ActPack is on port COM3 you can run the script depicted above like this:

        
                              $ ./high_speed_test.py COM3
                            

        With more than one ActPack (e.g., in COM3 and COM4):

        
                              $ ./high_speed_test.py COM3 COM4
                            
    10. Troubleshooting
      • On Windows, if flexsea can't install, or it can't load the libraries, make sure only once version of git and Python are installed as specified ins the installation section.
      • If your device has never had poles configured, you should run “find poles” from the demo script before trying other demos. This is not typical!
      • The leading cause of segmentation faults is a Device Spec mismatch between the embedded system and the scripts. This happens when you use old firmware with new scripts.
  19. Firmware and Software Releases
  20. Latest & Greatest

    Legacy:

  21. Programmable Safety Features
    1. Low Voltage Protection (UVLO)
      • It's possible to start experimenting with USB, then connect a battery (or power supply).
      • Disconnecting or discharging the battery below the minimum voltage will turn off the board. The presence or absence of USB power doesn't matter.
      • By default, the low-voltage detection will only trigger after 5000ms for +VB and 1000ms for +5V
      • Known bug (06/2018): the motor current zero will be wrong if you power by USB first.
      • Not shown on this diagram: a brief press will turn the LED magenta as a confirmation that the software has registered the user input. This can be used to start experiment or to switch mode or control policies.
    2. Changing the Limit
    3. Versions of software stack (> 09/2018) support updating the minimum battery voltage from the Plan 3.0 GUI. Rather than using a fixed value, FlexSEA-Regulate and FlexSEA-Manage will both pull from their non-volatile memory. If a valid value has been programmed they will use it. If not they will send the default value. To change the cutoff voltage, simply open the Calibration Tools. You can read the value, and you can write a new one. Always power-cycle the system twice after doing so to make sure that the non-volatile values get used (some of that code is only called at boot).

    4. I²t Current Limit: Programmable Fuse
    5. Ex and Re have a software I²t protection. This algorithm allows the user to select limits for average and peak currents (of a certain duration). It is essentially a programmable fuse that can be used to protect the circuits, but also systems built with FlexSEA and users testing them.

    6. Theory of Operation
    7. Fundamentals
      • Based on the application we calculate a current-time curve. Similar to the curves found in fuse datasheets, it indicates how long a given current will be allowed to flow before the fuse interrupts the flow (blows). The three most important parameters are:
        • Maximum average current: if the current stays below this value, the protection will never engage
        • Current limit: combined with the time, this determines the maximum pulse supported
        • Time at current limit: combined with the current limit, this determines the maximum pulse supported

        For example, if we program a maximum average current of 5A and a current limit of 30A for 2.5s we obtain the following curve:

      • 5A is on an asymptote: infinite time
      • If 30A flows for more than 2.5s the protection will engage
      • If the pulse is 10A the trip time will be around 30s
    8. Non-linearity
    9. The whole point of the I²t algorithm is to model thermal dissipation and prevent dangerous conditions. Because of the power of two, peaks can lead to significant heating. The current sensors used by FlexSEA have limits ranging from 5A to 30A depending on the hardware version. While they will tolerate peaks above their maximum, they will only report up to their max. Using a 30A sensor as an example, if our current is 42A the energy is doubled versus 30A yet the sensor will report 30A. An optional non-linearity was added to deal with those conditions. Simply, if you get close to the sensor's maximum range you can artificially increase its sensitivity to protect your hardware.

      Without the non-linearity:

      
                        CURR = maxAvgCurrent:1000:30000;
                        tmp = (CURR./SCALE).^2;
                        time = (I2T_LIMIT * dt) ./ ( tmp - I2T_LEAK );
                      

      With the non-linearity:

      
                        CURR = maxAvgCurrent:100:1.5*currentLimit;
                        CURR2 = (max(0,(CURR-NON_LIN_TRESH)));
                        tmp = ((CURR+10*CURR2)./SCALE).^2;
                        time = (I2T_LIMIT * dt) ./ ( tmp - I2T_LEAK );
                      

      As can be seen on the plot below, below the threshold the algorithm behaves the same. Above the threshold (set at 16A in this example) we can see that the protection trips faster with the non-linearity.

      1. Calculating and Programming
      2. To minimize the processor load, we convert the user parameters to constants on a PC. The embedded firmware uses the pre-calculated constants.

        The constants can be obtained from the Plan GUI or from a Matlab/Octave script. The GUI is simpler, but Octave outputs a plot that can help you select the optimal parameters.

        The user parameters are:

        • Maximum average current (mA): if the current stays below this value, the protection will never engage
        • Current limit (mA): combined with the time, this determines the maximum pulse supported
        • Time at current limit (s): combined with the current limit, this determines the maximum pulse supported
        • Non-linear threshold (mA): inflection point for the non-linearity. Must be between the maximum average current and the current limit.
        • Enable non-linearity: check (set to 1) if you want that feature, uncheck (set to 0) if not
        • Shift: conversion from mA to 'ticks'. The algorithm uses 8-bit values (0-255) while the current sensor is rated with real current in mA (ex.: 30000mA). We need to scale down the maximum current accordingly. If your hardware is equipped with a ±30A sensor (±30,000mA) the ratio between 30000 and 256 is 117. For maximum efficiency we use a bit shift instead of a division. The closest (and higher) shift is 7, equivalent to a division by 128. For ActPack users this value will not need to be changed: use the default 7.
      3. Plan GUI
        • Open Plan
        • Tools > "Calibration & System"
        • Safety tab

        The built-in calculator will compute the required constants from the user parameters. The tool can write the values directly to Re. Please note that the Ex I²t is not currently user programmable - contact Dephy if you need different values than the default.

        The settings will be saved in non-volatile memory and will take effect at the next power cycle.

      4. Matlab/Octave
      5. The Matlab/Octave script below allows users to generate the proper constants for the C code. The example uses 10A average, a peak of 15A for no longer than 1s, and a non-linearity at 17.5A.

        
                              % I2t current limit: user
                              % JFDuval, Dephy, Inc. 06/14/2017
                              % Update August 2018: Added non-linearity
                              % Update December 2018: Cleaner code and output
                               
                              % Note: use this file to get your #define values. i2t_1.m can be used to test
                              % your values with different profiles.
                               
                              clc;
                              close all;
                              clear all;
                              format short eng
                               
                              % Period, i2t_compute() call:
                              dt = 100e-3;      %Every 100ms
                              Y_TIME_MAX = 20;  %Max time plotted, in seconds
                               
                              disp('Program these values in i2t-current-limit.h:')
                              disp('============================================')
                               
                              % The algorithm uses 8-bit values: we need to scale down the maximum current
                              % accordingly. It uses real units (mA). Ex.: ±30000mA sensor
                              % 30000/256 = 117 => shift 7 (div by 128). 30A will give us 234
                               
                              % Pocket has a ±5A sensor. 5000/256 = 19.53 => shift by 5 (32)
                               
                              I2T_SHIFT = 7             % Closest bitshift available
                              SCALE = 128;              % (Octave only, avoids bitwise operations)
                              NON_LIN_TRESH = 17500;    % mA
                               
                              % Maximum average current you want to support:
                              maxAvgCurrent = 10000;     %mA
                              I2T_LEAK = (maxAvgCurrent / SCALE)^2
                               
                              % Maximum peak current you want to support, and duration:
                              currentLimit = 15000;       %mA
                              currentLimitTime = 1;     %s
                              I2T_LIMIT = (currentLimitTime / dt) * ((currentLimit/SCALE)^2 - I2T_LEAK)
                               
                              %At what fraction of the max to you want a warning? (0-1)
                              warn = 0.8;
                              I2T_WARNING = warn * I2T_LIMIT;
                               
                              %8-bit non-lin:
                              I2T_NON_LINEAR_THRESHOLD = NON_LIN_TRESH / SCALE
                               
                              % Plotting:
                              CURR = maxAvgCurrent:100:2.5*currentLimit;
                              CURR2 = (max(0,(CURR-NON_LIN_TRESH)));
                              tmp = (CURR./SCALE).^2;
                              tmpNL = ((CURR+10*CURR2)./SCALE).^2;
                              time = (I2T_LIMIT * dt) ./ ( tmp - I2T_LEAK );
                              timeNL = (I2T_LIMIT * dt) ./ ( tmpNL - I2T_LEAK );
                              figure()
                              plot(CURR, time)
                              title('Time before reaching the I2t limit')
                              xlabel('Current (mA)')
                              ylabel('Time (s)')
                              ylim([0,Y_TIME_MAX])
                              xlim([0.9*maxAvgCurrent,1.25*max(currentLimit,NON_LIN_TRESH)])
                              hold on
                              plot(CURR, timeNL, 'r')
                              legend('Original', 'Non-linear')
                               
                              disp('')
                              disp('Time at given current (mA):')
                              CURR = 25000
                              CURR2 = (max(0,(CURR-NON_LIN_TRESH)));
                              tmp = (CURR./SCALE).^2;
                              tmpNL = ((CURR+10*CURR2)./SCALE).^2;
                              time = (I2T_LIMIT * dt) ./ ( tmp - I2T_LEAK )
                              timeNL = (I2T_LIMIT * dt) ./ ( tmpNL - I2T_LEAK )
                            

        The script will output constants and a plot:

        
                              Program these values in i2t-current-limit.h:
                              ============================================
                              I2T_SHIFT = 7.0000e+000
                              I2T_LEAK = 6.1035e+003
                              I2T_LIMIT = 76.2939e+003
                              I2T_NON_LINEAR_THRESHOLD = 136.7188e+000
        
                              Time at given current (mA):
                              CURR = 25.0000e+003
                              time = 238.0952e-003
                              timeNL = 12.6263e-003
                            

        Matlab files available here: i2tmatlab.zip

      6. How to choose the right values
      7. FlexSEA boards such as FlexSEA-Rigid (used by Exo and ActPack) have a surface-mount fuse to protect the board and the user against extreme events. The maximum current supported by that fuse (typically 15A) is much higher than the maximum current needed for most wearable robotics applications. For a given application, aim to use the lowest current possible.

        For example, if you know that your average current is 1A (pro tip: do a quick experiment and look at the average current in the logs) you may decide to pick 1.5A: enough margin to account for errors. If you backtrack your maximum torque to require 10A at the battery for 100ms, use 11A for 150ms.

        These values will make the programmable fuse trip as soon as your system goes past those limits (control algorithm bug, stalled motor, etc.) When that happens, the circuit will turn off.

      8. Pre-computed values (±30A sensor)
      9. 2.5A continuous, 15A for 1s, non-linearity at 22.5A:

        
                              I2C_SHIFT =     7.0000e+000 (7)
                              I2T_LEAK =   381.4697e+000 (381)
                              I2T_LIMIT =   133.5144e+003 (133514)
                              I2T_NON_LINEAR_THRESHOLD =   175.7812e+000 (176)
        
                              Time at given current (mA):
                              CURR =    25.0000e+003
                              time =   353.5354e-003
                              timeNL =    87.7193e-003
                            

        10A continuous, 15A for 1s, non-linearity at 20A:

        
                              I2C_SHIFT =    7.0000e+000 (7)
                              I2T_LEAK =     6.1035e+003 (6104)
                              I2T_LIMIT =    76.2939e+003 (76294)
                              I2T_NON_LINEAR_THRESHOLD =   156.2500e+000 (156)
        
                              Time at given current (mA):
                              CURR =    25.0000e+003
                              time =   238.0952e-003
                              timeNL =    22.6244e-003
                            
      10. Tips and Examples
      11. The examples below are based on a Pocket board with a ±5A sensor, 1.5A continuous and 5A 500ms limit.

        
                              Program these values in i2t-current-limit.h:
                              ============================================
                              I2C_SCALE_DOWN_SHIFT =     5.0000e+000
                              I2T_LEAK =     2.1973e+003
                              I2T_LIMIT =   111.0840e+003
                              I2T_WARNING =    88.8672e+003
                              Time at 1.6A:
                              time =    36.6935e+000
                            
        • The standby current gets added to the load current. On a 30A board that's negligible, but on a ±5A board with a low limit that can be significant. As you can see, adding 100mA to the 1.5A load will make the protection trip after 37s instead of infinity.
        • Why does my board turn off with 1A for 900ms and 5A for 100ms? 1²*0.9 + 5²*0.1 = 0.9 + 2.5 = 3.4, sqrt(3.4) = 1.84A DC. Just the pulse is equivalent to 1.58A DC, enough to kill it.
        • How long do I need to wait between 5A 500ms pulses (assuming 0A the rest of the time)? 25*0.5 = 12.5, and our limit is 1.5. 1.5/12.5 = 12% duty cycle, so you need to wait at least 4.17s (0.5s/0.12) before the next pulse.
  22. User Interface: Button & LEDs
  23. This page covers the hardware user interface on products built with Rigid 4.0+: button & LEDs.

    Products can be programmed with two UI variants: MultiColor and Monocolor. MultiColor uses an RGB LED, while MonoColor uses a single LED (green or red depending on the product generation). By default, all ActPacks use MultiColor while all EB50+ Exos use MonoColor. In both cases, the LED we are referring to is the one on Regulate (Re). It is the only LED visible when the cover is on.

    1. MultiColor
    2. Power On: To turn the board on, press and hold the button for more than 2 seconds. The LED will fade on. When it starts flashing you can release the button.

      Normal Operation: The LED will be aqua (USB power) or green (battery power). The color will not change between fade on and flashing. When the button is released the LED will enter glowing mode.

      Fault Detected: After the fade on, the LED will flash red to indicated that a problem was detected. The board will power off as soon as the button is released.

      Power Off: To turn the board off, press and hold the button for more than 2 seconds. The LED will turn red, and fade off. When the LED is off you can release the button. The board will be off.

      Brief Click: The LED will turn purple.

    3. MonoColor
    4. Power On: To turn the board on, press the button for a brief moment (around 200ms). If you keep pressing, the LED will flash.

      Normal Operation: When the button is released the LED will enter glowing mode.

      Fault Detected: The board will power off as soon as the button is released.

      Power Off: To turn the board off, press and hold the button for more than 2 seconds. The LED will fade off. When the LED is off you can release the button. The board will be off.

      Brief Click: The LED glowing pattern will be briefly altered.

    5. Troubleshooting
    6. Under the Cover While working with a Dephy engineer to troubleshoot an issue you may be asked to report on the status of LEDs other than Regulate's.

      Power Indicator LEDs: When the board is powered they light up for about 5s.

      • On USB, the 5s counter starts the moment the cable is plugged
      • On battery power, the count starts when the button is pressed

      Execute (Ex) LEDs: Execute, the motor driver, has green LED. During normal operation the green LEDs will be flashing.

      Onboard Button: On ActPack a large momentary pushbutton is soldered. It is exposed through the cover. On Exo this button is not soldered and an External UI circuit has to be used.

      Small Onboard Button: A very small button is present on the PCB. It is extremely fragile and should only be used to diagnose a broken external UI circuit.

    7. FAQ
      • My ActPack is programmed with MonoColor. How do I change this to MultiColor?
        • You will need to reprogram Regulate (Re) with the correct file.
      • My EB60 Exo is programmed with MonoColor. How do I change this to MultiColor?
        • The rugged buttons used on exos have a single-color LED, and thus cannot support the MultiColor mode. Programming MultiColor will not break your device, but the UI behavior will be confusing.
  24. Units
  25. The following table is for ActPack firmware. ExoBoot walking controller firmware may differ and documentation will be provided to customers upon shipment.

    Variable Full Name Units Notes
    Timestamp Reception time ms Not filtered
    State_time Internal time ms Not filtered
    Accel X, Y, Z Accelerometer, 3 channels bits Conversion factor of 8192 LSB/g, not filtered
    Gyro X, Y, Z Gyroscope, 3 channels bits Conversion factor of 32.8 LSB/DPS (DPS = degrees per second), not filtered
    Mot_ang Motor angle ticks Not filtered
    Mot_vel Motor velocity deg/sec See Note 1
    Mot_acc Motor acceleration rad/s² See Note 1
    Mot_curr Motor current mA Internally filtered, high bandwidth
    Mot_volt Motor voltage mV Not filtered
    Batt_volt Battery voltage mV Analog: 1st order RC, fc = 3.56kHz. Digital: moving average of 32 samples, equivalent to 138Hz.
    Batt_curr Battery current mA Analog filter, 884 Hz
    Temp Temperature °C Sampled at 10kHz, moving average of 16 (equivalent to 277Hz)
    Genvar 0 - 9 Generic Variable used for Dephy internal development
    Ank_ang Ankle angle deg * 100 Not filtered
    Ank_vel Ankle velocity deg/sec *10 Sampled at 10kHz, moving average of 16 (equivalent to 277Hz)
    Step_energy Step energy mJ Integrated positive power, not filtered

    Note 1: Mot_vel and Mot_acc use custom C filters optimized for speed. We suggest calculating motor velocity and motor acceleration in post-processing if you need them and would like to avoid lag.

  26. Terminology
  27. ActPack Actuator Package.
    (hardware) The Dephy Actuator Package, a fully integrated actuator.
    (software) The API used to control the ActPack hardware or the ExoBoot, which contains the ActPack hardware.
    API Application Programming Interface.
    Defines what commands can be sent to the ActPack and what data can be read from it. (learn more).
    BA30 Dephy's battery v3.0, a UN38.3-certified LiPo battery designed for robotics. Datasheet available on dephy.com/faster.
    Bootloader A small application designed to download firmware in a microcontroller without requiring specialized in-circuit programmers. A device programmed with bootloader code can be reprogrammed via USB (or other common serial protocols).
    Controller The application layer of the system. It can refer to the Dephy Walking Controller (firmware running on Mn), or to your custom controller (C++/Python script running on a separate computer)
    EB60 6th generation ExoBoot. Datasheet available upon request.
    ExoBoot Dephy's ankle exoskeleton
    FFC Flat Flexible Cable
    Firmware Embedded software running in the ActPack's microcontrollers. Often provided pre-compiled in the form of a .hex or .bin file. When using the bootloaders, some proprietary formats such as .dfu (STM) and .cyacd (PSoC) sometimes replace the "plain" hex/bin files.
    Flash v. To program. "Flash firmware on a microcontroller" and "Program firmware on a microcontroller" have the same meaning.
    FlexSEA Flexible Scalable Electronics Architecture
    FlexSEA-Rigid Also known as 'Rigid'. This is the PCBA that you can see on your ActPack or under the cover of your ExoBoot.
    GUI Graphical User Interface
    Mn Manage. One of the three microcontoller systems found in a FlexSEA-Rigid board. This module is centered around a powerful STM32F4 (STM32F7 for v1.0 and above) Cortex-M4 microcontroller. It hosts our high-level walking controllers.
    Ex Execute. One of the three microcontoller systems found in a FlexSEA-Rigid board. This module has one and only one goal: control our brushless motor. It will run fast, low-level controllers, based on the state requested by Manage.
    Re Regulate. One of the three microcontoller systems found in a FlexSEA-Rigid board. This module contains the turn-on/off logic and many sensors to monitor experiments and board state. It supervises Manage and Execute.
  28. Resources
  29. Bug Report
    Please use this form to report bugs.

    Dephy Wiki
    Extended technical information. For full access, contact Dephy to get a free account.

    FASTER
    A safe, high-performance robotics research platform powered by Dephy.

    Safety Guide
    General safety advice regarding FASTER products.

    Still have questions?
    Contact technical@dephy.com