19
MMA092 Björn Pålsson & Stephan Struggl Rigid body dynamics 2012/2013 Version 1.1 The Matchstick Segway A computer exercise in Adams/View Department of Applied Mechanics Chalmers University of Technology GÖTEBORG July 2012 Assistants: Björn Pålsson [email protected], phone: 031-772 1491 Stephan Struggl [email protected], phone: 031-772 1497

The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

  • Upload
    others

  • View
    8

  • Download
    2

Embed Size (px)

Citation preview

Page 1: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

MMA092 Björn Pålsson & Stephan Struggl

Rigid body dynamics 2012/2013 Version 1.1

The Matchstick Segway

A computer exercise in Adams/View

Department of Applied Mechanics

Chalmers University of Technology

GÖTEBORG

July 2012

Assistants: Björn Pålsson [email protected], phone: 031-772 1491

Stephan Struggl [email protected], phone: 031-772 1497

Page 2: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

Cover: Model of a Segway type vehicle built in Adams/View

This document is based on previous project formulations for the Adams project in

MMA092.

Page 3: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

Contents

Introduction.......................................................................................................................... 1 1

Description of the Segway model ........................................................................................ 3 2

The assignment..................................................................................................................... 5 3

3.1 Tasks ................................................................................................................................ 5

3.2 The report ........................................................................................................................ 6

Adams modelling guidelines ............................................................................................... 7 4

4.1 Starting and setting up Adams/View ............................................................................... 7

4.2 Editing ............................................................................................................................. 7

4.3 Building the model .......................................................................................................... 9

4.4 Motion control ............................................................................................................... 11

4.5 Analysis ......................................................................................................................... 13

Optional Assignment: Adams Controls Toolkit .............................................................. 14 5

Checklist ............................................................................................................................. 16 6

Page 4: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

1

Introduction 1

Automatic Dynamic Analysis of Mechanical Systems (Adams) is a program for analysis of

non-linear dynamic events in mechanical systems. Adams/View is the graphical user interface

for model construction and general analysis, with seamless connection to post processing and

visualization tools. Adams/View has a vast array of modelling options. From simple part

creation, i.e. blocks, cylinders and links, to import of geometry from major CAD formats.

From standard joints definition, i.e. hinges and ball joints to general holonomic and non-

holonomic constraints definitions. Standard linear force elements such as springs, dampers,

bushings etc. can be implemented as well as general force definitions by differential equations.

The program has the ability to perform for example static, kinematic, transient and dynamic

analyses of systems. These results can then be animated, with the possibility to export the

animation to a movie clip, and numerical results can be plotted using the postprocessor. Also,

if desired, the numerical data can be exported to a file for external analysis.

A general modelling process is described below.

Pre-processing:

• Create a new database (model) and adapt the settings of the program

• Build design points

• Create parts and define their geometry

• Add constraints

• Add (if needed) inertia data manually

• Add external forces and motions (gravity included)

• Prescribe initial conditions (if needed)

• Save model (often, and sometimes under a new name)

Analysis:

• Create measures & sensors

• Verify the model (i.e. number of DoF, mass etc.)

• Run (analyze) the model

Post processing:

• Animate the result

• Create graphs

• Write report

Page 5: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

2

Adams/View can be controlled via the menu system, but the user should be aware that the

program really is controlled by text commands. The menu commands are all macros

(sometimes interactive) connected to a button or a menu. All commands performed are logged

to the “Command window” which can be toggled on and off with key F3. It is recommended

that you have a look at the command window to see how commands are performed. However,

all tasks required for this assignment are available in the menu system so there will be no need

to write commands using text code. Also important is to keep in mind that Adams is not a tool

developed for CAD, but for mechanical analysis.

To solve this assignment it is intended that the knowledge gained from the introductory task

together with basic engineering curiosity should be enough. This guide does not provide step

by step instruction to the solving of the assignment but merely guidelines. For additional

information see the Adams manual (which is easily accessible from the help menu via Adams

Help). During the computer sessions it will also be possible to ask the assistants for help.

To pass the assignment a report must be submitted with a general description of the system,

answers to questions and documentation required according to Chapter 3. Beside the report the

model must also be shown to one of the assistants. Presence during the computer sessions is

not required for a pass on the assignment. However, it is recommended to attend for smart and

fast solving. As the computer resources and assistance are limited during this course it is highly

recommended that the assignment is solved in groups of two. Reading all tips and tricks in this

guide before asking will also reduce the overall waiting time.

Page 6: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

3

Description of the Segway model 2

In this lab a simple rigid body model of a Segway type vehicle with driver will be built and

analysed. It is based on the Segway in the analytical task of the course. The model is depicted

in Figure 1 and Figure 2 and coordinates for the design points are given in Table 1. The chassis

base plate is kept more or less horizontal by retaining drive torques applied to the wheels. The

stick driver can rotate relative to the chassis in a prescribed manner around an axle going

through the chassis and wheel centres. The vehicle can therefore be accelerated and decelerated

through the movement of the stick driver’s centre of mass. The vehicle can be steered through

the introduction of drive torques of opposite signs on the two wheels.

Figure 1: Side, front and top view of the Segway model with driver

Figure 2: Side view of the Segway with local coordinate systems

x2

x1

z1

z2

Page 7: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

4

Table 1: Coordinates of design points in the design position

Point name X (mm) Y (mm) Z (mm)

x1y1z1 0 0 240

x2y2z2 0 0 1240

Segway_base_front 200 0 240

Segway_base_rear -200 0 240

Segway_base_right 0 -300 240

Segway_base_left 0 300 240

Reference_point 0 0 0

Wheel_center_right 0 350 240

Wheel_center_left 0 -350 240

Segway_handlebar_center 250 0 1250

Segway_handlebar_right 250 -300 1250

Segway_handlebar_left 250 300 1250

Driver_head 0 0 1900

The Segway is built in a design position above the origin of the global reference frame. A

contact algorithm will be implemented between wheels and ground to model the wheel-ground

interaction. The geometry of the chassis, wheels, and driver will here only be used for

visualization. All components should have property values according to Table 2. In analogy

with the analytical task, gravity is assumed to affect the Segway in the negative z direction

with 9.81 m/s2. The centre of mass of the chassis is located at the origin of x1y1z1. The centre

of mass of the driver is located at the origin of x2y2z2. It is also with respect to these coordinate

systems that the inertias of the bodies are given. The local coordinate systems should have the

same orientation as the inertial system in the design position.

Table 2: Parameter values for parts and driver

Other data Value Unit

Wheel masses mw 2 kg

Wheel Inertia Irot

(around joint rotation axis) 0.1 kgm2

Wheel Inertia Iradial 0.05 kgm2

Wheel radius R 240 mm

Chassis mass mc 40 kg

Chassis Inertia Icx 1.5 kgm2

Chassis Inertia Icy 1 kgm2

Chassis Inertia Icz 0.5 kgm2

Driver mass md 70 kg

Driver Inertia Idz 1.5 kgm2

Driver Inertia Idx,Idy 15 kgm2

Page 8: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

5

The assignment 3

The idea of this assignment is to give an introduction to how advanced multi body dynamics

problems can be analysed using an industry grade commercial software. You will build a

simplified model of a Segway type vehicle with driver, perform simulations, and be introduced

to different functionalities in ADAMS at the same time. The assignment can be solved in

(preferably) groups of two students or individually. Build a model in Adams according to

the description in Chapter 2 using the knowledge you have acquired from the introduction task

and using the guidelines in Chapter 4. Verify that the model is neither over- nor under-

constrained and that it behaves as might be expected before performing the simulations.

3.1 Tasks

1. Build the model in Adams/View and validate it to make sure that it is properly

constrained. How many degrees of freedom does the model have?

2. Determine suitable levels for k1 and k2 in the equations for the retaining torques

(� � ��� � ����) applied to the wheels by studying the model’s response to a step input

in driver (forward) inclination of e.g. 0.05 radians.

3. Import the file ice_cream_counter which includes geometry. Prescribe inputs on driver

inclination relative to the chassis and torque split between the wheels as functions of

time to drive from the origin to the counter. It is recommended that you do the journey

by first accelerating the Segway to a constant velocity, perform a 90º turn at a suitable

location and then decelerate in front of the counter. You should stop within half a metre

from the stop_marker (marked by a red cylinder) with the chassis’s centre of mass

marker. Use the STEP function to create the inputs. Include the expressions for the

prescribed motions and torques in the report. Create design variables for all parameters

that you introduce. Also include a screen dump picture of the Segway in front of the

counter and the time histories of the x1y1z1 position in the XY plane. It is recommended

that you show your model to an assistant before you move on to task 4.

4. Save the model from Task 3 under a new name. Delete the ice_cream_counter

geometry and ground plane from the model and import the file jump. Reduce the radius

of the circular wheels and instead implement tyres built by torus geometry. Define new

contacts. Drive the Segway straight ahead over the jump and stop on the other side. At

what velocity does the Segway loose contact with the ground? How high can you jump

and still come to a controlled stop on the other side? Include these answers in your

report, as well as plots of the wheels normal contact forces and vertical position of the

x1y1z1 system.

5. Demonstrate the model to one of the assistants. It is mandatory to do this before you

submit the report.

6. Write a report according to section 3.2 and submit it at the latest on Friday 19th

of

October.

7. Optional: The Adams Controls Toolkit task in Chapter 5.

Page 9: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

6

3.2 The report

The report should be brief and concise. There is no need to explain the history of the Segway,

vehicle dynamics and Adams etc. Put name(s), personal ID number(s) (or birth date), e-mail

address(es), course name and id (MMA092) and the date of submission on the front-page. Put

answers (and plots) to each question on individual pages. The first page (after the front page)

should contain a description of the system consisting of screenshots (with joints and other

icons visible) and a short text describing it (degrees of freedom, total mass, etc). The result of a

Model Verify should be pasted here as well.

Also present all assumptions made (if any), together with a short motivation.

Last date of submission of report is Friday 19th

of October. Before this, the model has to be

shown to one of the assistants. Resubmissions shall be submitted at the latest on the 2nd

of

November.

Page 10: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

7

Adams modelling guidelines 4

Read these guidelines before and while building the model. If you want you may discuss your

strategy with one of the helpers/assistants at any time. Make use of the assistants during the

sessions! For further on-your-own studying, the Getting started with Adams/View is

recommended. It is accessible from Help – Adams/View Help. In the web browser: click

Examples of using Adams/View and then Getting started with Adams/View. Keywords that

shall/can be used in the Adams software are in this guide given a bold face. It is recommended

that you work through the Getting started with Adams/View before starting this assignment

if you have not worked with Adams/View before.

4.1 Starting and setting up Adams/View

• Windows: Trough the Start menu – All programs – MSC.Software – MSC.Adams 2011 –

AView – Adams View

or (depending on the version installed)

Start menu – All programs – MSC.Software – MD Adams R3 – AView – Adams View

Note: If a model is created in Linux environment the only way to open it in Windows

environment is by exporting it as an Adams command file (.cmd) file, a procedure which

exports model objects but not all objects of a model database, i.e. customized menus,

macros etc. The model database file (.bin) cannot be opened directly under a different

operating system. The same goes if you start in Windows and want to shift to Linux. Best is

obviously to stick to the same operating system during the whole project.

• Create a New model, MKS units (i.e. SI units, very important as you will import

geometry).

• Gravity is needed during this task. Select other when creating the model, or specify

gravity in the z-direction under Settings – Gravity.... menu after the model is created.

• Using the working grid can speed up the design process. It is set up under Settings –

Working grid. It is recommended that you start with the working grid oriented in the X-Y

plane.

• To change view easily you can use the keyboard keys R, Z and T combined with the left

mouse button to rotate, zoom in and out and to translate/pan the view respectively.

4.2 Editing

• Right click over part

• Edit menu

• Tools menu

• Model navigator

• Construction of parts consisting of multiple geometries can be done by selecting add to

part in the Main Toolbox just before clicking out the new geometry in the model.

Page 11: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

8

• Moving geometry (also points) between parts (ground included) is done with Rename.

This means that if geometry needs to be merged to another part the easiest way is to click

rename on the geometry and then change name of the part (the middle word), see Figure 3 .

The “empty” parts that are left over must then be deleted.

Figure 3: Using rename to move geometry between parts

• Other ways to combine geometry are to use the Boolean functions:

• To delete an object in the model/database deselect any object by pressing the arrow in the

Main toolbox or an empty part of the modelling space. Then go to Edit – Delete. The

database navigator will show up and there the object wished to be deleted can be browsed.

If an object is selected, it will be deleted when you chose Edit – Delete.

• When a part is created its centre of mass marker is oriented automatically according to its

geometry, which (together with a default material) by default decides the mass and inertia

properties of a part. When assigning a mass with User input it is important to make sure

that the centre of mass marker (by default named cm) is oriented as intended. To make for

example the Z-axis or a marker oriented parallel to a line between two points it is possible

to set the markers orientation property to the function ORI_ALONG_AXIS(ground.A1,

ground.B1, "Z") instead of the coordinates. If you want to orient a marker manually, the

order of rotation is 313. You can thus not make a rotation around the local 2 (y) -axis

directly but can use for example a 90,90,-90 rotation to obtain a 90 degree rotation around

the original y-axis.

• Renaming various parts can be done most efficiently with Tools - Database navigator

with Rename selected in its top drop down list. If the checkbox Highlight is checked the

(in Database Navigator) selected object will light up in the model.

• The Database Navigator is useful to get an overview of the model topology. Use

Graphical Topology to check how the different parts are connected. This is one of the

tools available to verify that the model has been constructed according to plan.

• Colour and transparency of graphics is changed with the Appearance, when changing

properties of many parts it is smart to, also here, use the Database Navigator.

• If the icons (joints, markers, points etc) are annoyingly large or too small their size can be

changed with Settings – Icons…

• The command Tools – Model Verify gives useful information about the mechanical

system and returns errors and warning if something is wrong. Also the number of degrees

of freedom of the model is shown there.

Page 12: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

9

• Simulate the model by pressing and animate the result using . Set the end time

and number of steps to control the resolution. Simulating the model once in a while to see

that the model is designed in a feasible manner, even if it just falls down due to the gravity,

is a good practice.

4.3 Building the model

• Start by building the points and parts according to the instructions below. It is

recommended that you start with the chassis.

• Give all objects (model, parts, joints) names that make them easier to recognize. Blanks,

dots, commas, colons and Swedish alphabet characters like å ä ö are not allowed.

• By using Construction points for all geometrical positions and later placing the parts

between these points all parts can become parameterized. Parameterized positions means

that they will move with the points if they are moved. Note however that centre of mass

markers will not follow the geometry if the mass and inertia properties have been defined

manually.

• Construction Points can be used to create the points in Table 1 by first clicking the

icon and then position them on the working grid with a left button click, or, by doing a

right-click and using the Event Location box. At time of construction the Add to part or

Add to ground options control where the point belongs. Points are with a few exceptions

always best to add to ground to start with and in this assignment all of them can belong to

ground.

• Another (recommended) way to create construction points is to go to Tools – Table editor.

There selecting Points at the bottom. In the point table, create all the desired number of

points before editing their coordinates. A point may be renamed by right clicking outside

the rightmost column and selecting Rename Object: POINT_N. By clicking the Filters…

button the three columns can be changed to one single column for easier editing.

• The chassis is best constructed using the command Rigid body:Plate* connecting the four

base points as a start. Rename the part to chassis and add the inertia properties. Then create

the steering column and handlebar by using Rigid body: Cylinder and select add to part

and choose the chassis. In this way you will add geometry to an already existing part and

only one set of properties needs to be specified for the whole chassis. If you create the

additional geometry before specifying the inertia properties you will have to adjust the

position of the cm marker of the chassis manually. Create the stick driver by using Rigid

body: Link or Cylinder and add head geometry to the part by using Rigid body:Sphere.

*The orientation of the plate is (as for the link) governed by the working grid/camera view.

If the working grid is orthogonally orientated with respect to the plane of the points an

error message will be returned. To make sure that the plate is created as intended:

Page 13: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

10

− Rotate the view so that it is orthogonal to the plane to be created (with the working

grid off) using for example the view buttons.

or

− Change the orientation of the working grid to coincide with the desired plane of the

plate surface.

• The wheels will first be constructed for task 3 using ideal shapes and axle geometry. On

each side, create a wheel part by constructing a wheel axle using Rigid body: Cylinder

between the left and right plate base points and the wheel centre points. Create a marker

belonging to the wheel part at each wheel centre. Let the markers z-axis point along the

wheel axle (other directions arbitrary). Select Orientation Z-axis in the drop-down menu for

easy positioning. Create wheel circles with the radius as given in Table 2 using the

command shown in Figure 4 having the created markers as the centre markers. Don’t forget

to add the circles to the wheel parts.

Figure 4. Command Navigator

• Also create a plane using “geometry create shape” command. Make this belong to the

ground and with corner coordinates [-1,2,0],[30,2,0],[30,25,0],[-1,25,0]

• Use Joint: Revolute to build joints between chassis and wheels and chassis and driver.

Later the Impose Motion option in the joints will be used to create driver motion and

wheel torques. For testing purposes a prescribed constant angle can be specified in the joint

definition between driver and chassis.

Page 14: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

11

• Define contacts between the wheel circles and the ground plane via . Use Curve to

Plane as contact type. You can use the default contact settings, but it is recommended that

you increase the dynamic and static friction coefficients to 0.8.

• Create a reference marker in the global origin and make sure it has the same orientation as

the global coordinate system.

• Use File - Import to import the .cmd files containing geometry for Task 3 and 4 when you

need them. To be able to use the geometry together with the Segway you need to merge the

models. Use Tools - Merge two models to do this using the default settings. You might

have to refresh the view by clicking on the cursor symbol in the top left corner of the main

toolbar to see the content of both models.

• For Task 4 it is necessary to use a solid to solid contact as the surface is non-planar.

Therefore the tires need to be extended to solids as well. It is suggested that you reduce the

radius of the wheel disks to 0.21 m and add toruses (Rigid body:Torus) with major radius

0.21 m and minor radius 0.03 m to the wheel part. Increase the side count for the

perimeters and number of segments in the geometry description to the maximum 99 if you

want really smooth looking tires. For the contact algorithm, the toruses are perfectly round

anyhow. Then redefine the contact to act between the toruses and the jump geometry.

4.4 Motion control

• To keep the chassis upright, retaining drive torques will be implemented in the wheel joints

as in the analytical assignment.

• To calculate the torques, the chassis pitch rotation � and derivative �� are needed. To build

measures for these go to Build - Measure – Function – New and browse in the left

column for an appropriate command (PITCH and angular velocity are good bets). Use the

reference marker in the origin as a reference for the plate’s rotation. Another and less

sophisticated way of obtaining the measurements is to measure the vertical position and

vertical velocity for the front and rear base points of the plate and then use a small angle

assumption to obtain the angles. From the top menu, choose Build - Measure - Point-to-

point - New. Use the reference marker in the origin and create markers in the front and rear

chassis points to create measures for the vertical position and velocity.

• To avoid hard coding of variables, it possible to create design variables in ADAMS via

Build - Design Variable - New. You can use it in an expression by typing

.model_name.design_variable_name (note the dots!). Create design variables k1 and k2 to

be used in the moment expressions. The design variables can then be edited from Tools -

Table Editor and select radio button Variables

• Use to build a torque element and implement one between the chassis and each

wheel. It’s suggested that you orient the axles according to the global system and make the

wheels as action or reaction parts for both torques as this gives a consistent definition of

directions that will be easier to get your head around. The action body will get the moment

Page 15: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

12

applied in the positive rotation direction. Implement restoring moments on the form

� � ��� � ���� using the above design variables and measures. To make your model more

clear by avoiding long expression in your dialog boxes, you can build STATE

VARIABLEs via Build – System Elements – State Variable – New and use them with

the command VARVAL(state_variable_name) in e.g. the torque expressions. Another

possibility is to use Adams Controls Toolkit which offers a variety of standard controllers

(see description of the optional assignment in Chapter 5)

• Experiment to find k-values so that the Segway with driver balances by setting the imposed

motion in the revolute joint between chassis and driver to zero. When the Segway balances

reasonably well you can optimize the parameters by studying the response to constant step

input by imposing a small constant driver inclination (e.g. 0.05 radians).

• When the Segway balances, it is time to drive! To solve task 3 and 4, it is recommended

that you prescribe smooth signals for driver inclination and drive torque split using the

STEP function, see below.

• The step function in ADAMS uses a cubic polynomial to make a transition between two

levels. Its syntax is STEP(x, x0, h0, x1, h1), where x is the independent variable (usually

TIME), x0 is a real variable that specifies the x value at which the lower end saturation

begins. x1 is a real variable that specifies the x value at which the upper end saturation

begins, h0 is the value of the function at the lower saturation point and h1 is the value of

the step function at upper saturation point . For example

h(t)=STEP(TIME, x0, h0, x1, h1) can be seen in Figure 5 below.

Figure 5. STEP function in ADAMS

• An expression for the driver inclination that will first tilt the driver forward and back to an

upright position and make the Segway accelerate to a constant velocity, and then reverse

the inclination and decelerate the Segway back to zero could look like this:

� STEP�����, ������, 0, ������ � ��, �� � STEP�����, ������ � ��, 0, ������ � 2��, ��� -

�STEP�����, ��� ! � 2�, 0, ��� ! � ��, �# � STEP�����, ��� ! � ��, 0, ��� !, �#�

where Tstart and Tend are the times when the Segway should start and stop, ∆T the rise-time

of the step function and A the amplitude of the driver inclination. Note the minus sign

before the second pair of brackets which create the backwards inclination. The expression

Page 16: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

13

is symmetrical and for the ideal case without any tire slip or other disturbances the Segway

should run in a straight line and come to a complete standstill.

• A similar expression can be used to implement steering by the introduction of equal but

opposite drive torques on the wheels. Introduce suitable variable(s). Also here the state

variables might be useful.

• Tune the variables to reach the designated area in front of the stand in an ordered fashion.

(Only three of the introduced variables need to be (finely) tuned to perform this task. It is

suggested that you first tune the steering so that the Segway can make a 90º turn and then

tune the timing of the turn and the stop time to reach the counter as intended.

• If desired, there is a built in optimiser in ADAMS that can help to tune the variables under

Simulate > Design Evaluation

• For Task 4, go to Settings > Solver > Dynamics and select the integrator HASTIFF. It is

recommended to test different error tolerances in factor of ten steps to see that the achieved

simulation results converge.

• For task 4 it can also be helpful to implement sensors that stop the simulation if the Segway

deviates too much from a straight line or runs off the platform. Go to Simulate > Sensor >

New to create a sensor and create its functionality.

4.5 Analysis

• It is recommended that you calculate the static equilibrium before starting the actual

simulation to find the static normal contact forces between wheels and ground. At static

equilibrium there will be a deflection in the tires, or rather the contact definition, compared

to the design position.

• After running a model, a lot of data is generated giving detailed information on the

dynamics of every part and joint in the system. All this data can be studied trough the

postprocessor which is accessible via Review – Postprocessing... or . Here resulting

kinematics of all parts, dynamics and kinematics of joints and forces can be viewed. By

selecting Object in the source most resulting data is visible. Angular displacements of

parts are available under Result Sets.

• To extract pictures of the curves from the Post processor, go to File – Print… and select

File under Print to:. A suitable format is PNG which gives nicely compressed picture

files. Never ever use JPG for plots of curves. The JPG file format should be used for

photos only!

Page 17: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

14

Optional Assignment: Adams Controls Toolkit 5

This chapter will describe the implementation of a control gain as shown in Figure 6 by using Adams

Controls Toolkit.

Figure 6. Control loop

To access the tools we are going to use go to the Build menu, and select Controls Toolkit, and then select Standard Controls Blocks. This will open up the Create Controls Blocks dialog box.

θθθθdesired - Theta desired: Click on the upper left tool, "Create an input-signal block."

Change the following settings:

Name: .Segway.theta_desired

Function: 0.0

Hit Apply

θθθθactual - Theta actual:

Click on the "Create an input-signal block" tool again and change the following settings.

Name: . Segway.theta_actual

Function: <Open the function builder using a right mouse click>

Use the angular position of the cassis

Hit Apply

θθθθerror - Theta error:

Click on the "Create a summing-junction block" tool, which is the tool with the Σ on it.

Change the following settings:

Name: . Segway.theta_error

Input 1: right click to and select controls_input from the pop-up menu,

then select Browse, and choose theta_desired

Input 2: right click to and select controls_input from the pop-up menu,

then select Browse, and choose theta_actual

Toggle the plus sign on for Input 2 to a minus sign

Hit Apply

Page 18: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

15

ττττ - Torque: Click on the "Create a gain block" tool, which is the one with a K on it.

Change the following settings:

Name: . Segway.torque_gain

Input: right click to and select controls_sum from the pop-up menu

then select Browse, and choose theta_error

Gain: 1e9

Hit Apply

Call on the measure inside the TORQUE elements

Right click on the TORQUE element and choose Modify.

Right click in the "F(time,?) =" field to open the function builder

Delete the zero that is currently in the editor above

Near the middle of the dialog box, under "Getting Object Data,"

>set the menu to Measures

Right click in the field next to the menu, and select Runtime Measure

then select Browse.

The Database Navigator should have opened.

Double click on the torque_gain,

then select the torque_gain, which is listed underneath that.

Click "Insert Object Name" button.

Now the name of the measure should appear in the editor above.

Hit OK (to complete the function building)

Hit OK (to complete the TORQUE modifying)

Test the model

Page 19: The Matchstick Segway - Chalmerspaja/RBD/Handouts/ADAMSLab2012.pdf · 2 Description of the Segway model In this lab a simple rigid body model of a Segway type vehicle with driver

16

Checklist 6

Task # Make sure that you have... Done

1 Built the model in Adams/View and validated it to make sure that it is

properly constrained. Determined how many degrees of freedom it has.

2 Determined the stiffness (k1) and damping (k2) for the retaining torque

expression

3 Completed the ice cream task and answered the related questions

4 Completed the jump task and answered the related questions

5 Demonstrated the model to an assistant

6 Submitted the report at the latest on Friday19th

of October