Skip to main content

Crate sim_components

Crate sim_components 

Source
Expand description

Components: belt span, friction contact, gearbox, rotary joint, motor, drive, profile generator, encoder. Know no machine.

Re-exports§

pub use control::Command;
pub use control::CommandError;
pub use control::Controller;
pub use control::LimitViolation;
pub use control::StopCategory;
pub use control::check_limits;
pub use drive::DriveMode;
pub use sim::Contact;
pub use sim::Sim;
pub use sim::Snapshot;
pub use sim::config_hint;
pub use sim::load_config;
pub use sim::schema;
pub use sim::set_config;
pub use sim::set_config_text;

Modules§

accuracy
Static positioning accuracy and repeatability (study), judged along ISO 230-2 (a numerically controlled axis) and ISO 9283 (the pose of a robot’s tool): the machine runs to a line of targets along each tool axis, approaching each target several times from below and from above, and the tool’s real pose at rest is compared with the target.
analysis
Analysis for motor sizing: peak and RMS torque per cycle, operating points against the torque-speed curve, and the mechanical frequency response.
base
A compliant base under any machine (effects.base_compliance): the frame or stand the whole machine stands on, a rigid body on springs in up to six directions, translation along x, y, z and a small tilt about x, y, z through base.pivot_m, in the frame of the tool pose (FrameMomentum). Each direction with a stiffness above zero is a mass (base.mass_kg, or base.inertia_<x|y|z>_kgm2 for a tilt), a spring and a damper of its own:
beam
Euler-Bernoulli beams for the structure’s bending (effects.link_bending, the gantry’s beam and Z axis): a tube’s second moment of area, a cantilever’s first bending mode as one modal coordinate (its tip’s deflection), and the compliance of a simply supported span under a point load.
cam
Electronic cam (a CAM table): the slave’s position as a function of a master’s, as a drive’s cam technology runs it (SIMOTION, TIA Portal’s technology objects, the “Kurvenscheibe”). The master is a virtual axis or the web or conveyor the slave works on; its speed sets how fast the slave moves: slave speed s’(m) m’, acceleration s’‘(m) m’^2 + s’(m) m’‘, jerk s’‘’(m) m’^3 at steady master speed. Knows no machine.
catalog
The component catalogue as the simulator uses it: a part named by its article number puts its catalogue values into a config, and a search tries every motor (and every axis) on a machine’s cycle.
chain
A machine of joints, each driven by a motor through a transmission (joint::RotaryJoint): the machine for every mechanism that can say its dynamics in joint coordinates, M(q) q’’ + h(q, q’) = tau. A joint’s coordinate is an angle (rad) or a travel (m); its gearbox’s ratio is motor radians per unit of it, so a ball screw is a gearbox of ratio 2 pi / lead (times any reduction before it), a rack 1 / pinion radius, a linear motor 1 (its “rotor” the forcer, its torques forces). Stiffness, backlash, friction and stops are those at the joint, in its unit.
charts
The numbers behind the views that show a drive’s real torque and the tool’s real error, for the app and the sizing report alike: the torque-speed chart per motor with its limits, the RMS point, the tool’s error split normal and tangential to the path, a histogram, the torque split stacked, the utilisation of the drive over time, and the spectrum. Everything works on a run’s signals as columns (one value per millisecond, the first column the time).
collision
Obstacles of the config and the clearance the machine keeps from them: along a path before it runs (check_path, check_cycle), and in the simulation as it runs (Sim). The machine tells which of its parts can hit an obstacle (Machine::collision_bodies, collision_capsules); obstacles are boxes along the scene’s axes, the parts boxes too or, slanted, capsules.
control
Motion controller: plans in tool coordinates, transforms to motor setpoints, and runs one drive per motor. It works on any machine through the machine interface.
conveyor
Picking from a moving belt conveyor: parts ride on a belt through a pick window; the tool meets each part with the belt’s speed, moves with it while the gripper closes, lifts off and places it at a fixed place or onto a second moving belt. Works on any machine whose tool axes are Cartesian positions (a delta, a gantry), through the tool pose alone; all vectors are tool poses or tool velocities, one value per axis (0 on a rotation axis).
dataset
Published measured datasets (datasets/<id>/): a dataset.toml with the metadata, a README, and per recording a trace file with its mapping. check says what keeps a folder from being published; the format is described in datasets/README.md.
drive
Servo drive: cascaded position (P, the Kv factor), velocity (PI) and current (PI) control on the motor’s own encoder, with feedforward, measurement effects and torque limits. One switch each.
fault
What trips a drive and how it stops then, as servo drives do it (Siemens SINAMICS names the parameters given here): each drive watches its following error against a window (p2546), its following error at standstill against a tighter one (p2542, after p2543), whether it is held at its torque limit at low speed for longer than a time (F07900 “motor blocked”, p2175 and p2177), and optionally its torque against the model’s expected torque (as a robot controller detects a collision). The first monitor that trips a drive stops all of them, each by its own fault reaction (Reaction). On with effects.drive_monitoring; the controller runs it (Controller::update).
gripper
The gripper of a pick-and-place cycle (effects.gripper_time, [gripper]): how long it takes to grip and to let go, and for a vacuum gripper what it holds (the verdict “gripper-hold”).
identify
Fitting a config to a measured machine, in stages: first the rigid values of each axis from a drive trace (or, where the motors do not turn in proportion to the axes, of each motor: fit_joints), then the load’s resonance on the belt from a frequency sweep, or its stiffness from a move’s trace (fit_move_stiffness). Nothing here edits a config; the results say what the config would have to be. sim-cli fit --write writes the one result that is a single key of the config (the factor on a stiffness) back, with its error band as [bounds]; the others are lumped values of several keys.
import
Drive traces as the drives’ and controllers’ own tools export them, turned into a Trace at the motor shaft (rad, rad/s, N m, s) by a mapping file that names the signals and says how to scale them.
induction
Induction motor on a frequency converter (motor.kind = “induction”): the standard d-q model, V/f control (open loop) or field-oriented control (rotor flux, under the drive’s speed and position loops).
joint
A motor-driven rotary joint: motor, gearbox (ratio, torsional stiffness, backlash, efficiency), holding brake, the motor’s own friction and torque ripple, friction in the joint itself and end stops on its angle. What a machine of arms that turn about their joints needs per joint; it knows no machine.
mech
Mechanical components: belt, guide friction, shaft friction, gearbox, torque ripple, tooth meshing, hard stops, cable chain, holding brake. Each reads its own parameters and its own switch from the config and knows no machine.
motor_fit
Identification that needs no machine model: one motor’s drive train from its own trace, in the motor’s units (rad, rad/s, N m at the shaft). So it works on any imported drive trace, also of a machine the simulator has no config for.
parameters
The drive parameters of a tuned machine: for each motor, the numbers of the config’s drive settings as the drive takes them, with the parameter’s number, name and unit (SINAMICS S120 servo and S210). The mapping is data, the tables catalog/siemens/parameters_s120.csv and parameters_s210.csv, each row with the page of the Siemens document it comes from; this module reads the config as resolved (the parts applied, each motor’s own [drive.<id>] over the shared one) and converts. A setting the table has no parameter for is listed as such, never with a guessed number.
path
Paths of straight lines, circular arcs and smooth curves through via points in tool coordinates, and the planning of the timing along them. Both planners give poses at times, one per profile cycle, which Command::Trajectory runs.
pneumatic
Pneumatic cylinders beside the servo axes: a double-acting cylinder moved by a directional valve, not by a drive. attach puts the cylinders of a config on any machine; each brings states of its own after the machine’s, its signals (cylinder.<id>.*) and its checks (cushion-energy, load-factor). The cycle commands it by its valve (a segment’s valves) and waits for its end-position sensors (a segment’s wait), see control.
profile
Motion profiles: the jerk-limited seven-segment S-curve, the sin² profile (Bestehorn), the polynomial motion laws 3-4-5 and 4-5-6-7 of VDI 2143, braking slower or faster than speeding up, and synchronised multi-axis moves.
program
Programs read into path pieces (path::Piece) for the path planner: a subset of G-code (DIN 66025 / ISO 6983), robot moves as CSV, and subsets of KUKA KRL and ABB RAPID. read picks the reader by the file’s extension.
report
The sizing report a customer signs: the machine, plots of the cycle, every verdict with its value, limit and margin, the error bands, where each input comes from ([catalogue], [estimate], [cad] in the config’s comments) and a sign-off block. One document model, written as self-contained HTML (plots as inline SVG) or as PDF. The PDF is written here: A4, the standard Helvetica fonts, no compression, so no dependency is needed.
rigid
Rigid bodies in a serial chain: read from a URDF file, with their dynamics by the recursive Newton-Euler algorithm (Luh, Walker and Paul 1980; Craig, “Introduction to Robotics”, chapter 6). A chain of revolute and prismatic joints on a fixed base; fixed joints are merged into the body before them.
search
The catalogue search as a workflow: which drive works best with which path and kinematics. catalog::search tries the parts; this module gives each candidate the figures of a wide table (Figures), judges it over a duty mix (mix_verdicts), ranks by one criterion or a weighted mix of them (rank_by), marks the non-dominated ones (front), sweeps a gear ratio or pulley radius for the optimum (transmission_sweep), ranks the best again in the error bands (robust_ranking), and runs one tool-space task on several kinematics (compare_kinematics).
sensitivity
Global sensitivity of a cycle’s results to the uncertain values of a config’s [bounds]: which unknown parameters matter, with all of them moving at once (the one-at-a-time analysis::sensitivity and verdict_bands move one).
shaper
Input shapers: trains of impulses that, convolved with a setpoint, cancel the vibration it starts in a mode of known frequency and damping (Singer and Seering 1990, Singhose 1994–1997). Times are in half damped periods of the mode, T_d / 2 = 1 / (2 f sqrt(1 - zeta^2)); amplitudes add up to one.
shapes
What a machine is, beside what it does: its modes with their shapes (from the machine, or from its elastic model linearised at a pose) and the stiffness each mode lives in; how well it moves its tool at a place of its workspace; and the envelope of traces. For the app’s views and sim-cli modes --shapes and workspace. No machine is named: everything comes through the Machine interface and the config.
sim
A machine, its controller and the integrator, stepped together. Every front end runs this.
stepper
Stepper motor (motor.kind = “stepper”): a two-phase hybrid stepper behind an open-loop step and direction drive.
stop
How far a machine travels after a stop (Command::Halt), triggered at many moments of its cycle or path (study): where each axis is fastest, where the kinetic plus potential energy is largest, and on a grid between. Per moment the distances the tool and each axis travel, the stopping time, the peak deceleration, whether an axis went beyond its stroke into a hard stop, and the DC link’s peak voltage and the braking resistor’s energy; the worst moment judged.
trace
Drive traces: what a drive’s scope exports, read from CSV and replayed through the simulator.
transmission
Transmissions that turn a motor’s rotation into the motion of a load, beside belts and planetary gearboxes: ball screw, rack and pinion, linear motor, worm gear and strain wave gear. Each gives what the simulation needs (ratio from motor radians to the load’s coordinate, efficiency, stiffness, inertia, drag) and the ratings its maker checks a cycle against, with the maker’s published formulas. They know no machine; chain::JointMachine puts them on a joint.
tune
Tuning of the velocity loops from their measured margins: the procedure the shipped gains were found with by hand (sim-cli margins at every pose of the cycle, the gain raised until 35 degrees and 6 dB are the least left, the notch put where a resonance holds the gain back), run by the program.

Statics§

I18N
(language code, translation file contents) for everything the components name.

Functions§

refuse_unmodelled
Refuses each of effects (effects.<name>) switched on in cfg (error-effect-not-modelled): switches a machine’s config has with the others of its crate but that this machine does not model, so that one turned on is not silently without effect.