James' Scorpion Robot Page @ McGill


Controlling ADAMS models with Matlab/Simulink

I've started to use the "co-simulation" feature within ADAMS that allows models in ADAMS to be controlled within Simulink. It's a nice feature that allows me to take advantage of my experience with Matlab/Simulink.

As you can see in the images below (click to enlarge), I've figured out how to get ADAMS and Matlab/Simulink cosimulations to work. I'm using ADAMS 11.0 (patched with most of the current patches) and Matlab 6. Matlab 5.3 doesn't like the Simulink 4.0 code generated by ADAMS, so I'm sticking to Matlab 6 and Simulink 4.


ADAMS and Matlab/Simulink Cosimulation

The ADAMS/Controls module allows ADAMS to interact with Matlab and Simulink. This is a great feature since it allows me to take advantage of my experience in Matlab. Both "batch" and "interactive" cosimulations are permitted. Batch cosimulation runs the model through the command-line ADAMS/Solver package, resulting in relatively fast results. Interactive cosimulation from Matlab launches the GUI ADAMS/View package and allows you to watch and manipulate the 3D model; the disadvantage is that it runs much slower than in batch mode.

A few words of warning: ADAMS 11.0 has a bug that messes up the formatting of the data between ADAMS and Matlab. Read the technical note in the Knowledge Base for a work-around.

Below is an example of a video generated by ADAMS/Post based on the data generated by Matlab/Simulink using the plant exported by ADAMS/Controls. It's a very simple model with torque control and a sinusoidal input signal for the basalar joint.


ADAMS Simulation Video Using Matlab/Simulink Results and an ADAMS/Controls-Generated Plant

Simple Models (December)

Scorpion Simulation, December, 2002

Working with Macros (April)

I've recently decided that I need to get familiar with macros and command-line functions within ADAMS. The advantage of using macros, as opposed to making models via the GUI, is that variations on the design are relatively quick. The downside is that it takes a little longer to set up, sometimes. Although, I've found that it's great for adding multiples of things like the legs!

I'll continue building the model shown above. It's pretty bare-bones right now, but it's pretty easy to add stuff!

Oh yeah, you'll notice from the header in the screen shot that I'm using ADAMS 12. Although I have not tried to yet, the Controls module is now a plug-in instead of a stand-alone application.


Dynamic Models (April and May)



More Dynamic Models (June)

Scorpion Simulation, June 17, 2002

I've been working on the Adams code. Currently there is no closed-loop (torque) control of the legs; I was having a lot of trouble with bugs in my code (I could only close the loop on half the joints in a Matlab cosimulation). I'm currently defining open-loop trajectories via spline functions for the thoracic and basalar actuators.

The code (June 17) allows easy changes to various variables such as the number of hip pairs.

July's Dynamic Models

Scorpion Simulation (6 legs), July 5, 2002

Scorpion Simulation (8 legs) , July 5, 2002

Here are more attempts to get dynamic motion:

Towards one body length per second

After meeting with Frank, Dirk, Gill and Matt in Boston, the objective is to configure the existing Scorpion robot in such a way as to make one body length per second forward velocity possible. I think that it'll be possible by tilting the thoracic actuators between 30 and 60 degrees (to be determined) and thrusting back with the thoracics while keeping the distal and basalar actuators fixed.

I've now got three actuated degrees of freedom per leg. I'll have to double-check all the dimensions, moments of inertia and masses, but here we are:

Scorpion Simulation (6 legs) with three degrees of freedom, July 13,
  2002

July 14th's work resulted in a simulation that yields half a body length per second. I spent the day verifying various parameters in the simulation. I then redefined the joint trajectory splines for the thoracic and basalar joints. The result is the following animation.

Scorpion Simulation (6 legs) with three degrees of freedom, July 14,
  2002

On July 17th, the simulation is spitting out something that is approaching one body length per second. The Thoracic joints are tilted to 60 degrees. The Distal actuators are brought in 30 degrees, to make them basically vertical. The average forward velocity during the last three-quarters of the three-second simulation is 51 cm/sec (the results from the first quarter of the simulation were ignored as it was accelerating) Here is the animation. The current code is here.

These preliminary results look good. The thoracic torque values produced basically look good, with most not reaching more than +/- 2.5 N*m. Some spikes occur, but I think that they are related to leg impacts. Adding a little more compliance might help this (although the motors should be able to resist the backdrive). Thoracic angular velocities also look good, with none reaching beyond +/- 25 deg/sec. I'll have to compare these to the torque-speed curves of the motors; although, off-the-bat, they should be okay, since Dirk has said that legs can move at over 200 deg/sec, unloaded, and that the Maxon catalogue states that the gearheads can take 2.7 N*m intermittently.

Scorpion Simulation (6 legs) with three degrees of freedom, July 17,
  2002

Scorpion Simulation (6 legs) with three degrees of freedom, July 17,
  2002
Check out the PDF


Scorpion Simulation (6 legs) with three degrees of freedom, July 17,
  2002
Check out the PDF. It has energy information, as well as body and actuator speed, etc.

Information about the current (July 17, 2002) simulation model:

 

  Body
  ------------------------------------------------
  Density             : 7.6923076923E-007 kg/mm**3
  Calculated Mass     : 5.0 kg
  Calculated Volume   : 6.5E+006 mm**3
  Mass Inertia Tensor : 
      IXX             : 1.1917708331E+005 kg-mm**2
      IYY             : 1.1683333333E+005 kg-mm**2
      IZZ             : 1.067708331E+004 kg-mm**2
  Body width	      : 125 mm (hip_block_y)
  Body height	      : 100 mm (hip_block_x)
  Body Length	      : 520 mm (3*hip_block_z+2*body_block_z)
        hip_block_x   : 100 mm 
	hip_block_y   : 125 mm
	hip_block_z   : 20  mm
	body_block_x  : 100 mm
	body_block_y  : 125 mm
	body_block_z  : 230 mm

  Thoracic Actuator
  ------------------------------------------------
  Density             : 1.7622692661E-006 kg/mm**3
  Calculated Mass     : 0.2 kg
  Calculated Volume   : 1.1349003461E+005 mm**3
  Mass Inertia Tensor : 
      IXX             : 274.8666666667 kg-mm**2
      IYY             : 28.9 kg-mm**2
      IZZ             : 274.8666666667 kg-mm**2
  Actuator_length     : 125 mm
  Actuator Radius     : 17 mm

  Basalar Actuator and Small Link
  ------------------------------------------------
  Density             : 1.7622692661E-006 kg/mm**3
  Calculated Mass     : 0.2510380623 kg
  Calculated Volume   : 1.4245159189E+005 mm**3
  Mass Inertia Tensor : 
      IXX             : 327.0514006443 kg-mm**2
      IYY             : 278.8540152826 kg-mm**2
      IZZ             : 81.0847339777 kg-mm**2
  Actuator_length     : 125 mm
  Actuator Radius     : 17 mm
  Small link lengths  : 59 mm
  Small Link radius   : 12.5 mm

  ** note: the small link BEGINS inside the actuator.  Like this.

  Distal Actuator and Small Link (Unsprung)
  ------------------------------------------------
  Density             : 1.7622692661E-006 kg/mm**3
  Calculated Mass     : 0.2510380623 kg
  Calculated Volume   : 1.4245159189E+005 mm**3
  Mass Inertia Tensor : 
      IXX             : 327.0514006443 kg-mm**2
      IYY             : 278.8540152826 kg-mm**2
      IZZ             : 81.0847339777 kg-mm**2
  Actuator_length     : 125 mm
  Actuator Radius     : 17 mm
  Small link lengths  : 59 mm
  Small Link radius   : 12.5 mm

  ** note: the small link BEGINS inside the actuator.  Like this.

  Distal Spring and Sprung Mass
  ------------------------------------------------
  Density             : 8.8573E-007 kg/mm**3
  Calculated Mass     : 0.0999997903 kg
  Calculated Volume   : 1.1290098599E+005 mm**3
  Mass Inertia Tensor : 
      IXX             : 444.7386508011 kg-mm**2
      IYY             : 7.8124836187 kg-mm**2
      IZZ             : 444.7386508011 kg-mm**2
  Distal Sliding link length: 230 mm
  Distal Sliding link radius: 12.5 mm

  Spring	      : 
    stiffness_mode           (linear)
    stiffness_coefficient    (1.0)     [1000 N/m; 1 N/mm]
    stiffness_spline         (no value)
    damping_mode             (linear)
    damping_coefficient      (0.1) [N*sec/mm]
    damping_spline           (no value)

  Toe
  ------------------------------------------------
  Density             : 8.8573E-007 kg/mm**3
  Calculated Mass     : 7.2463616174E-003 kg
  Calculated Volume   : 8181.2308687234 mm**3
  Mass Inertia Tensor : 
      IXX             : 0.4528976011 kg-mm**2
      IYY             : 0.4528976011 kg-mm**2
      IZZ             : 0.4528976011 kg-mm**2
  Toe Radius          : 12.5 mm
  


Scorpion Simulation: Closeup look at Basalar Joint.
Closeup look at Basalar Joint.

Scorpion Simulation: Closeup look at the leg's Basalar and
  Distal components.
Closeup look at the leg's Basalar and Distal components.

July 22, 2002

After some more discussion with Dirk, I've got the model parameters looking more like Scorpion. I'll post the details later. For now, here are some of the results:

July 23, 2002

Scorpion Simulation: July 23, 2002.
Scorpion Simulation: July 23, 2002. Masses and dimensions have been updated.

Scorpion Simulation: July 23, 2002.
Scorpion Simulation Leg: July 23, 2002. Links no longer begin within the actuator.

Average speed: 84 cm/sec. Thoracic actuator period: 0.24 sec. Spring Constant: 0.5 N/mm. Spring Damping Constant: 0.1 N*sec/mm (*it's high*). The motors get saturated in this run.

Average speed: 64.7 cm/sec. Thoracic actuator period: 0.30 sec. Spring Constant: 0.5 N/mm. Spring Damping Constant: 0.1 N*sec/mm (*it's high*).

Average speed: 71.6 cm/sec. Thoracic actuator period: 0.27 sec. Spring Constant: 0.5 N/mm. Spring Damping Constant: 0.1 N*sec/mm (*it's high*). The motor speed-torque curves show a little motor saturation.

Information about the current (July 22 & 23, 2002) simulation model:

 

  Body
  ------------------------------------------------
  Density             : 2.7692307692E-007 kg/mm**3
  Calculated Mass     : 1.8  kg
  Calculated Volume   : 6.5E+006 mm**3
  Mass Inertia Tensor : 
      IXX             : 4.2903749991E+004 kg-mm**2
      IYY             : 4.206E+004 kg-mm**2
      IZZ             : 3843.7499914499 kg-mm**2
  Body width	      : 125 mm (hip_block_y)
  Body height	      : 100 mm (hip_block_x)
  Body Length	      : 520 mm (3*hip_block_z+2*body_block_z)
        hip_block_x   : 100 mm 
	hip_block_y   : 125 mm
	hip_block_z   : 20  mm
	body_block_x  : 100 mm
	body_block_y  : 125 mm
	body_block_z  : 230 mm

  Thoracic Actuator
  ------------------------------------------------
  Density             : 2.523265051E-006 kg/mm**3
  Calculated Mass     : 0.2 kg
  Calculated Volume   : 7.926238265E+004 mm**3
  Mass Inertia Tensor : 
      IXX             : 250.5125  kg-mm**2
      IYY             : 21.025 kg-mm**2
      IZZ             : 250.5125 kg-mm**2
  Actuator_length     : 120 mm
  Actuator Radius     : 14.5 mm

  Basalar Actuator and Small Link
  ------------------------------------------------
  Density             : 2.523265051E-006  kg/mm**3
  Calculated Mass     : 0.35 kg
  Calculated Volume   : 1.3870916964E+005 mm**3
  Mass Inertia Tensor : 
      IXX             : 482.2291129977 kg-mm**2
      IYY             : 273.7778688525 kg-mm**2
      IZZ             : 252.7416129977 kg-mm**2
  Actuator_length     : 120 mm
  Actuator Radius     : 14.5 mm
  Small link lengths  : 61 mm
  Small Link radius   : 17.6126351814 mm  (calculated during simulation)

  Distal Actuator and Small Link (Unsprung)
  ------------------------------------------------
  Density             : 2.523265051E-006  kg/mm**3
  Calculated Mass     : 0.35 kg
  Calculated Volume   : 1.3870916964E+005 mm**3
  Mass Inertia Tensor : 
      IXX             : 482.2291129977 kg-mm**2
      IYY             : 273.7778688525 kg-mm**2
      IZZ             : 252.7416129977 kg-mm**2
  Actuator_length     : 120 mm
  Actuator Radius     : 14.5 mm
  Small link lengths  : 61 mm
  Small Link radius   : 17.6126351814 mm  (calculated during simulation)


  Distal Spring and Sprung Mass
  ------------------------------------------------
  Density             : 1.6557978366E-006 kg/mm**3
  Calculated Mass     : 9.3064210241E-002 kg
  Calculated Volume   : 5.6205056068E+004 mm**3
  Mass Inertia Tensor : 
      IXX             : 105.3099092387 kg-mm**2
      IYY             : 7.2706414251 kg-mm**2
      IZZ             : 105.3099092387 kg-mm**2
  Distal Sliding link length: 114.5 mm
  Distal Sliding link radius: 12.5 mm

  Spring	      : 
    stiffness_mode           (linear)
    stiffness_coefficient    (0.5)     [500 N/m; 0.5 N/mm]
    stiffness_spline         (no value)
    damping_mode             (linear)
    damping_coefficient      (0.1) [N*sec/mm]
    damping_spline           (no value)

  Toe
  ------------------------------------------------
  Density             : 2.74E-006 kg/mm**3
  Calculated Mass     : 1.1477285161E-002 kg
  Calculated Volume   : 4188.7902047864  mm**3
  Mass Inertia Tensor : 
      IXX             : 0.4590914064 kg-mm**2
      IYY             : 0.4590914064 kg-mm**2
      IZZ             : 0.4590914064 kg-mm**2
  Toe Radius          : 12.5 mm
  


August 5, 2002

The model has been changed to allow for less spring damping. Currently, the damping is on the scale of 1/100 of the spring constant. Today, I tried spring constants around 2000 N/m. The most successful trial involved a spring constant of 1750 N/m, with a thoracic actuation period of 0.2 seconds. The average forward speed of the simulated robot was about 78 cm/sec. The robot demonstrates a decent amount of pitch, so the motion is becoming more dynamic. Motor torques remain below the 1.2 Nm (for the Basalar and Thoracic) and 1.8 Nm (for the Distal) continuous operation limit.

My recommendation is to install springs with a spring constant in the neighborhood of 1750 to 2000 N/m. Spring constant higher than that will require a slower thoracic swing in order to keep impact torques low. (One of the trials involved a 2000 N/m spring and required a 0.25 second thoracic period. The result was acceptable since the motors remained within the torque-speed limits but forward speed was limited to about 48 cm/sec). Spring constants much lower than 1750 N/m and with insufficient damping will make the legs too compliant for reasonably sized leg potentiometers.

Below, you can find information about some of the trials conducted today:


Leg Permutations

I'm looking at the possible permutations for three actuated degrees of freedom, using revolute actuators only. So far, I've found that there are only 16 permutations that are suitable for Scorpion. Of these, there are six major permutations; the rest are similar but limb length varies.

Below, are the 16 permutations. The six major ones are at the end and have AVI videos illustrating a leg moving through the workspace. The videos were generated in Matlab.

PermutationWorkspace (AVI video)
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a

More work has to be done on studying these permutations. As it gets done, I'll add the information here.


People Involved


Other thoughts...

Similar Models / Projects

check out the ADAMS model of Sprawlita

Software and Hardware

Simulation

ADAMS is currently being used to model Scorpion by Ralf Linnemann.

Simulation Environments
Open Source Projects

Perhaps a little out there... what about trying the open-source

Perhaps the code that Dr. Angeles uses for the Intro to Robotics Course: Robotic Visualization System

RVS is a little dated and has some missing features. It hasn't been worked on in a while.

A good place to look is the Matlab Robotics Toolkit. It's primarily designed for analysis and design of serial manipulators. There are some good links from this page and the project seems to be well maintained. The latest revision is April, 2001 and it's been going on for about 10 years or so.

On the Matlab front, it seems to be pretty easy to make exportable animations. Here are two pages: Matlab help and a user's tips on exporting in Unix or Windows. There are also lots of links on Google.

SourceForge is a good place to look for open source projects. Check out the following projects:

Linear Acutuators: Kollmorgan just bought a company called IDC which makes small linear actuators. Stephan Bilodeau at Rotalex (514-341-3685) distributes them.


Alright, I need to start looking for papers relevant to the work on Scorpion. A possible research direction is the student of "Swept Volume" (the page has tutorials, papers, etc.).