FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


demodescriptions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
demodescriptions [2019/03/19 13:53]
jfduval
demodescriptions [2019/10/07 17:31] (current)
jfduval [Find Poles]
Line 3: Line 3:
  
  
-The current scripts consist of seven demos in three languages ([[pythonscripts2|Python]],​ [[c_c_scripts|C/​C++]],​ [[matlabsscripts|MATLAB]]). Each script shows how to perform various operations using the [[fx_plan_stack|fx_plan_stack API]]. Each of the scripts are functionally equivalent across the languages. ​+The current scripts consist of 10 demos in languages ([[pythonscripts2|Python]],​ [[c_c_scripts|C/​C++]],​ [[matlabsscripts|MATLAB]], [[simulinkmodel|SIMULINK]]). Each script shows how to perform various operations using the [[fxapifunctions|fx_plan_stack API]]. Each of the scripts are functionally equivalent across the languages. The [[controlgains|Control Gains]] page serves as a reference for values you can try.
  
 +**One device:**
   * [[#Read Only|Read Only]]   * [[#Read Only|Read Only]]
   * [[#Open Control|Open Control]]   * [[#Open Control|Open Control]]
   * [[#Current Control|Current Control]]   * [[#Current Control|Current Control]]
-  * [[#Hold Position|Hold Position]]+  * [[#​Position ​Control|Position ​Control]] 
 +  * [[#Two Positions Control|Two Positions Control]] 
 +  * [[#​Impedance Control|Impedance Control]] 
 +  * [[#High Speed Test|High Speed Test]]
   * [[#Find Poles|Find Poles]]   * [[#Find Poles|Find Poles]]
-  * [[#Two device Position Control|Two device Position Control]] 
-  * [[#Two device Leader/​Follower|Two device Leader/​Follower]] 
  
-===== Read Only =====+**Two devices:​** 
 +  * [[#Two device Position Control|Two Devices Position Control]] 
 +  * [[#Two device Leader/​Follower|Two Devices Leader/​Follower]]
  
 +===== Read Only =====
  
-This script ​demonstrates how to configure the FlexSEA device in order to read information from it. It will configure the device to stream multiple variables, then read and display them.+  * Controller type: none (CTRL_NONE) 
 +  * Motor: does not move 
 +  * Display: streams many variables 
 +  * 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.
  
 ===== Open Control ===== ===== Open Control =====
  
- +  * Controller type: open / motor voltage (CTRL_OPEN) 
-This script demonstrates how to configure the FlexSEA device ​to enable the motor and start it spinningIt ramps the motor voltage ​up then down. This is repeated twice. At the endthe motor is turned off.+  * Peak voltage: 3000 mV 
 +  * Profile: ramps from 0 to peak then back to 0Repeats twice. 
 +  * User interaction:​ none, let the motor speed up and down 
 +  * What can be changed: you can test with a different peak voltageor with a different ramp speed
  
 ===== Current Control ===== ===== Current Control =====
  
 +  * Controller type: current control (CTRL_CURRENT)
 +  * Current: 1000 mA
 +  * Profile: holds constant current for 10 seconds then ramps it down to zero.
 +  * Gains: kp = 50, ki = 32
 +  * 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.
  
-This script demonstrates how to configure the FlexSEA device for current control mode. It programs an initial hold current and keeps it there for 10 seconds. The hold current is then ramped down to zero and the device is disabled.+===== Position Control =====
  
-===== Hold Position =====+  * Controller type: position control (CTRL_POSITION) 
 +  * Position: measures position when the script is launched and uses it as the setpoint 
 +  * Profile: holds constant position for 5 seconds 
 +  * User interaction:​ try moving the motor away from its current position 
 +  * Gains: kp 50, ki 
 +  * What can be changed: gains
  
 +===== Two Positions Control =====
  
-This script demonstrates how to configure the FlexSEA device to hold a specified ​position and return to it when the user moves it. The script ​first reads the initial position then loops displaying ​the data. If the user changes ​the position ​of them device, it will return ​the initial position.+  * 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 4 seconds. 
 +  * Gains: kp = 25, ki = 2000 
 +  * What can be changed: gains, timings 
 + 
 +{{ :​posctrlplot.png?​800 |}} 
 + 
 +===== Impedance Control ===== 
 + 
 +  * Controller type: impedance control (CTRL_IMPEDANCE) 
 +  * Position: measures position ​when the script is launched and uses it as the initial position. Position change will be 7500. 
 +  * Gains 
 +    * Current controller: kp = 100, ki = 32 
 +    * Impedance: K = 325, B = 0 (initially) 
 +  * Profile: Setpoint toggles between two positions every 800 ms. The impedance damping (B) starts at 0 and increments by 125 every cycle. 
 +  * 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. 
 + 
 +{{ :​impedancedemo.png?​800 |}} 
 + 
 +===== High Speed Test ===== 
 + 
 +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 ​the response signal from the FlexSEA device are shown on a generated plot. 
 + 
 +Default current control experiment (Python): 
 +<​code>​def fxHighSpeedTest(port,​ baudRate, controllerType = Controller.current,​ signalType = signal.sine,​ commandFreq = 1000, signalAmplitude = 1000, numberOfLoops = 10, signalFreq = 1, cycleDelay = .1, requestJitter = False, jitter = 20)</​code>​ 
 +Default ​position ​control experiment (Python): 
 +<​code>​def fxHighSpeedTest(port,​ baudRate, controllerType = Controller.position,​ signalType = signal.sine,​ commandFreq = 1000, signalAmplitude = 10000, numberOfLoops = 10, signalFreq = 1, cycleDelay = .1, requestJitter = False, jitter = 200)</​code>​ 
 + 
 +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 peakfor a steady command ​it'​s ​the average/​DC 
 +  * numberOfLoops:​ controls the number of sine wavesIn 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 detecting a locked-up system. Set to True to enable some jitter. 
 +  * jitter: jitter amplitude 
 + 
 +Other configurations:​ 
 +  * Autostreaming at 1kHz 
 +  * Always logging 
 +  * Current gains: kp = 100, ki = 30 
 +  * Position gains: kp = 300, ki = 50 
 + 
 +{{ :​highspeed2.png?​800 |}} 
 + 
 +Additional Information:​ 
 +  * The Read & Write rates are not guaranteed 
 +    * On Windows we have difficulty writing at more than 200Hz 
 +    * On a RaspberryPi we can usually reach above 500Hz 
 +  * Other software running on your computer can affect the script performance
  
 ===== Find Poles ===== ===== Find Poles =====
  
 +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.
  
-This script demonstrates how to run the internal calibration routine of the FlexSEA device. ​There is little user interaction although the script ​is some languages will display a message indicating how long it has been running. ​The user will note that the FlexSEA device will make some noise as this routine is executing.+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.
  
-===== Two Device Position Control ===== 
  
 +===== Two Devices Position Control =====
 +
 +<color #​ed1c24>​*** Incomplete description ***</​color>​
  
 This script demonstrates how two devices can be configured to maintain their current position. The initial position for each device is read and the position is returned to as the user rotates the device. This script demonstrates how two devices can be configured to maintain their current position. The initial position for each device is read and the position is returned to as the user rotates the device.
  
-===== Two Device ​Leader/​Follower =====+===== Two Devices ​Leader/​Follower =====
  
 +<color #​ed1c24>​*** Incomplete description ***</​color>​
  
 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 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. ​
  
 ===== Notes ===== ===== Notes =====
-  ​Two Device scripts ​do not require one board to be Manage 2, they can both be Manage 1+ 
 +  ​Scripts using two devices ​do not require one board to be Manage 2, they can both be Manage 1
   * [[userrw|User R/W variables]]   * [[userrw|User R/W variables]]
demodescriptions.1553003610.txt.gz · Last modified: 2019/03/19 13:53 by jfduval