Skip to main content

Module cam

Module cam 

Source
Expand description

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.

A cam is periodic: over one master period the slave rises by advance (0 for a slave that swings back, one turn for a knife that turns on). It is made of segments (Segment) with the motion laws of VDI 2143 (Law), or of a table of points (parse_table, Cam::from_table) through which a cubic runs.

Where two segments meet, the slave’s slope over the master is that of the one that sets it: a straight segment (Law::Linear, a synchronous run) or a dwell; between two motion laws the slave is at rest there (rest in rest). A motion law between neighbours that move (velocity in velocity, VDI 2143) keeps their slopes v0 and v1 at its ends and has no acceleration there: s(u) = dm (v0 u + (v1 - v0) g(u)) + c f(u), u the share of the segment run, f the law normalised from rest to rest, g(u) = u^3 - u^4 / 2 (whose slope 3 u^2 - 2 u^3 blends v0 into v1), and c = ds - dm (v0 + v1) / 2 what the law itself has to rise.

The seam to profile: the polynomial laws (3-4-5, 4-5-6-7) and the sine laws are written here once more, normalised in Law::normalised; once profile has them as functions of a share of the run, that is the one place to call them.

Structs§

Cam
A periodic cam: its pieces over one master period from 0, and what the slave rises by over the period.
Segment
One segment of a cam: over master of the master the slave rises by slave along law.

Enums§

Law
A motion law of VDI 2143, from rest to rest over u in [0, 1].

Functions§

master_at
The master’s travel, speed and acceleration t seconds after it starts from rest: up to speed in ramp seconds by a sin^2 speed ramp (no jump in acceleration), steady, and from stop seconds on down to rest by the mirror ramp. A stop asked for during the run-up begins once the master is up to speed.
master_change
The master’s travel, speed and acceleration t seconds after its speed is set from from to speed: the same sin^2 ramp between the two over ramp seconds (master_at is the one from rest), travel from (from + speed) ramp / 2 at its end; then steady, and from stop on down to rest from speed.
parse_table
Rows of a cam table in CSV: master, slave and optionally the slope of the slave over the master, comma separated. A line that does not start with a number (a header, a comment beginning with #, an empty line) is skipped. An error gives the number of the line (from 1) that has a number first and then something that is not one (or is NaN or infinite), or too many fields.
slave_motion
The slave’s position, speed and acceleration from the cam’s [s, s’, s’‘, s’‘’] and the master’s [m, m’, m’’].