pub struct TogglePress {Show 19 fields
pub a: f64,
pub b: f64,
pub r: f64,
pub c: f64,
pub t0: f64,
pub centre: [f64; 2],
pub j_crank: f64,
pub m_pin: f64,
pub m_upper: f64,
pub m_knee: f64,
pub m_ram: f64,
pub payload: f64,
pub attached: bool,
pub g: f64,
pub smoothing: f64,
pub frame: Option<f64>,
pub crank_torque: f64,
pub rated_force: f64,
pub cam: Option<(Cam, CamMaster)>,
/* private fields */
}Fields§
§a: f64Upper and lower link, crank radius, rod length, m.
b: f64§r: f64§c: f64§t0: f64The crank’s angle (from the scene’s x towards z) at the dead centre, rad.
centre: [f64; 2]The crank’s centre (x, z), m, the top pivot at the origin.
j_crank: f64§m_pin: f64The rod’s crank end, at the pin.
m_upper: f64The upper link, a uniform bar.
m_knee: f64At the knee: the rod’s other end and the lower link’s share.
m_ram: f64The ram and the lower link’s rest, the die (payload) apart.
payload: f64§attached: bool§g: f64§smoothing: f64The process force fades out over this ram speed upwards, m/s.
frame: Option<f64>The frame’s stiffness under the press force, N/m; None with effects.frame_stretch off (a rigid frame).
crank_torque: f64The torque the drive can put on the crank, N m: its peak torque through the gearbox.
rated_force: f64What the frame and the links are rated for, N.
cam: Option<(Cam, CamMaster)>Implementations§
Source§impl TogglePress
impl TogglePress
pub fn from_config(cfg: &Config) -> Result<Self, ConfigError>
Sourcepub fn pose(&self, q: f64) -> Pose
pub fn pose(&self, q: f64) -> Pose
The linkage at the crank angle q (the module’s formulas); NaN where the four-bar does not close.
Sourcepub fn crank_angle(&self, distance: f64, before: bool) -> Option<f64>
pub fn crank_angle(&self, distance: f64, before: bool) -> Option<f64>
The inverse: the crank angle that puts the ram (the links, without the frame’s stretch) distance above the
bottom dead centre, before the dead centre (before, phi > 0) or after it; None beyond the links’ reach or the
crank’s.
Sourcepub fn inertia(&self, q: f64) -> f64
pub fn inertia(&self, q: f64) -> f64
J(q): what the crank feels of crank, pin, links, knee and ram.
Sourcepub fn holding_torque(&self, q: f64, force: f64) -> f64
pub fn holding_torque(&self, q: f64, force: f64) -> f64
The torque the crank needs to hold the ram force force at q against nothing else: F x’.
Sourcepub fn capacity(&self, q: f64) -> f64
pub fn capacity(&self, q: f64) -> f64
The force the press can give at q: the rated force, or less where the drive’s torque through the ratio gives less.
Sourcepub fn press_force_at(&self, d: f64) -> f64
pub fn press_force_at(&self, d: f64) -> f64
The press force at the links’ distance d from the bottom dead centre, before the motion’s share: the root of
F = table(d + F / k), segment by segment of the table (linear there: F = (v_i + s_i (d - d_i)) / (1 - s_i / k)).
Sourcepub fn press_force(&self, q: f64, speed: f64) -> (f64, f64)
pub fn press_force(&self, q: f64, speed: f64) -> (f64, f64)
The press force on the ram (pushing it up) and the frame’s stretch at q and the crank’s speed: the table’s force while the ram moves down or stands, fading out as it rises.
Sourcepub fn link_forces(&self, q: f64, speed: f64, acc: f64) -> [f64; 3]
pub fn link_forces(&self, q: f64, speed: f64, acc: f64) -> [f64; 3]
The forces of the upper link, the lower link and the rod (compression positive), N, at the crank’s angle, speed and acceleration. The ram along z: C_b w / b = m_x x’’ + F - m_x g (w = x - a cos(phi)). The upper link about O: across the link at the knee it pushes T = (-m_up g a sin(phi) / 2 - J_up phi’‘) / a; the knee: m_knee K’’ = C_a u_a + T n_a - C_b u_b + C_rod u_rod + m_knee g, solved for C_a and C_rod.
Trait Implementations§
Source§impl Mechanism for TogglePress
impl Mechanism for TogglePress
Source§fn frame_momentum(
&self,
q: &[f64],
qd: &[f64],
rotor_spin: &[f64],
) -> Option<FrameMomentum>
fn frame_momentum( &self, q: &[f64], qd: &[f64], rotor_spin: &[f64], ) -> Option<FrameMomentum>
In the scene’s frame: the crank turning about -y with the rod’s crank end at the pin, the upper link a bar turning about the top pivot (about -y as phi grows), the knee’s and the ram’s masses, the rotor about the crank’s axis; the press force pushing the ram up.
Source§fn tool_is_joints(&self) -> bool
fn tool_is_joints(&self) -> bool
The speed term of J(q) needs the feedforward’s speed terms.
Source§fn signals(
&self,
q: &[f64],
qd: &[f64],
qdd: &[f64],
force: &[f64],
out: &mut Vec<f64>,
)
fn signals( &self, q: &[f64], qd: &[f64], qdd: &[f64], force: &[f64], out: &mut Vec<f64>, )
The signals along a crank motion without jerk.
Source§fn reads_jerk(&self) -> bool
fn reads_jerk(&self) -> bool
Where the press force fades as the ram rises, the frame’s stretch follows the crank’s speed, so the ram’s acceleration follows the crank’s jerk.
Source§fn scene(
&self,
q: &[f64],
rotors: &[f64],
rotor_speeds: &[f64],
out: &mut Scene,
)
fn scene( &self, q: &[f64], rotors: &[f64], rotor_speeds: &[f64], out: &mut Scene, )
Seen from the front: the crown with the top pivot, the two links to the ram on its guide, the rod from the crank’s pin to the knee, the crank disc with the motor behind it; the bed below the ram’s bottom dead centre.
Source§fn dynamics(&self, q: &[f64], qd: &[f64], mass: &mut [f64], bias: &mut [f64])
fn dynamics(&self, q: &[f64], qd: &[f64], mass: &mut [f64], bias: &mut [f64])
passive_joints), q and q’ hold them after the driven ones, and M and h are of them all.Source§fn potential(&self, q: &[f64]) -> f64
fn potential(&self, q: &[f64]) -> f64
fn set_payload_attached(&mut self, attached: bool)
Source§fn has_process(&self) -> bool
fn has_process(&self) -> bool
process_torque gives: then the machine
reports the power given to it as power.process. None by default.Source§fn process_torque(&self, q: &[f64], qd: &[f64], out: &mut [f64])
fn process_torque(&self, q: &[f64], qd: &[f64], out: &mut [f64])
q and speeds qd to out, positive
turning a joint up. Not conservative and not in dynamics: the torque breakdown counts it among the rest, and
the feedforward leaves it out, as a drive does not know it.Source§fn cam(&self) -> Option<CamMaster>
fn cam(&self) -> Option<CamMaster>
Machine::cam and Machine::cam_at: an electronic cam the mechanism runs as its cycle, its slaves the tool
axes. None by default.fn cam_at(&self, master: f64, out: &mut [[f64; 4]])
fn cam_curve(&self) -> Option<CamCurve>
Source§fn signal_infos(&self) -> Vec<SignalInfo>
fn signal_infos(&self) -> Vec<SignalInfo>
Source§fn signals_with_jerk(
&self,
q: &[f64],
qd: &[f64],
qdd: &[f64],
qddd: &[f64],
_force: &[f64],
out: &mut Vec<f64>,
)
fn signals_with_jerk( &self, q: &[f64], qd: &[f64], qdd: &[f64], qddd: &[f64], _force: &[f64], out: &mut Vec<f64>, )
signals with the joints’ jerk as well, for a mechanism that reads_jerk; zeros where it does not.fn rating_checks(&self) -> Vec<RatingCheck>
Source§fn collision_parts(&self) -> &'static [&'static str]
fn collision_parts(&self) -> &'static [&'static str]
scene draws that move with the load and can hit an obstacle (Machine::collision_bodies).fn scene_point(&self, tool: &[f64]) -> Option<[f64; 3]>
§fn passive_joints(&self) -> Vec<(f64, f64)>
fn passive_joints(&self) -> Vec<(f64, f64)>
§fn passive_signals(&self) -> Vec<SignalInfo>
fn passive_signals(&self) -> Vec<SignalInfo>
swing.<k>.angle.§fn passive_loss_row(&self) -> Option<(&'static str, &'static str)>
fn passive_loss_row(&self) -> Option<(&'static str, &'static str)>
power.<id>) and the owner’s key of the loss row of the passive joints’ dampers: by default the swinging
payload’s. None (no row) only where every passive joint’s damper is zero.§fn passive_rest(&self, _q: &[f64]) -> Vec<f64>
fn passive_rest(&self, _q: &[f64]) -> Vec<f64>
q (a contact pressed in by its load): all zero by
default.§fn passive_shift(&self, _q: &[f64], _passive: &[f64], out: &mut [f64])
fn passive_shift(&self, _q: &[f64], _passive: &[f64], out: &mut [f64])
passive rather than
at zero, into out (zeroed first): a forearm rocking on its rod. Zero by default (a swinging payload’s joints
do not move the flange’s frame).§fn passive_extra_damping(&self) -> Vec<f64>
fn passive_extra_damping(&self) -> Vec<f64>
dynamics applies (not in passive_joints’
pair), in their order, for the modes’ damping figures; missing entries 0.§fn passive_in_modes(&self) -> usize
fn passive_in_modes(&self) -> usize
§fn loss_row(&self) -> Option<(&'static str, &'static str)>
fn loss_row(&self) -> Option<(&'static str, &'static str)>
power.<id>) and the owner’s key; None (no row) by default.§fn loss_power(&self, _q: &[f64], _qd: &[f64]) -> f64
fn loss_power(&self, _q: &[f64], _qd: &[f64]) -> f64
loss_row takes out, W, at all joints’ q and qd (passive ones included): 0 by default.§fn linear_motor(&self) -> bool
fn linear_motor(&self) -> bool
Machine::motor_linear. False by default.§fn links(&self) -> Vec<String>
fn links(&self) -> Vec<String>
Machine::links and Machine::set_link_change: the bodies whose inertial parameters a trace can be fitted for.fn set_link_change(&mut self, _link: usize, _factor: f64, _moment: [f64; 3])
§fn forward(&self, q: &[f64], tool: &mut [f64])
fn forward(&self, q: &[f64], tool: &mut [f64])
§fn inverse(&self, tool: &[f64], q: &mut [f64]) -> bool
fn inverse(&self, tool: &[f64], q: &mut [f64]) -> bool
false where it cannot be reached.§fn memory(&self) -> Vec<f64>
fn memory(&self) -> Vec<f64>
inverse carries from one call to the next (a numerical inverse’s last solution, which the next starts
from), as a fixed count of numbers, for Machine::memory. None by default.§fn set_memory(&self, _memory: &[f64])
fn set_memory(&self, _memory: &[f64])
memory gave (empty: none, as before the first inverse), as inverse keeps it: behind a lock.fn unreachable(&self, _tool: &[f64], _slack: f64) -> Option<&'static str>
§fn condition(&self, _tool: &[f64]) -> Option<f64>
fn condition(&self, _tool: &[f64]) -> Option<f64>
Machine::condition at a tool pose; None where the tool is the joints.§fn rigid_guide_loads(
&self,
_tool: &[f64],
_acc: &[f64],
_out: &mut Vec<[f64; 2]>,
)
fn rigid_guide_loads( &self, _tool: &[f64], _acc: &[f64], _out: &mut Vec<[f64; 2]>, )
Machine::rigid_guide_loads: the loads of the guides among signals, at a tool pose and acceleration.§fn collision_links(&self) -> &'static [&'static str]
fn collision_links(&self) -> &'static [&'static str]
scene draws, in order from the base to the tool, as the links that the check of the
machine’s own parts looks at (Machine::self_collision_capsules): each a capsule of half its width, not an
obstacle’s part. Empty by default: the machine’s own parts are then those of collision_parts.§fn flex_modes(&self) -> Vec<FlexMode>
fn flex_modes(&self) -> Vec<FlexMode>
flex_coupling gives them two-way, else not (one-way, as base::Based). Their count
must not change. Empty by default.§fn flex_loads(&self, _q: &[f64], _qd: &[f64], _qdd: &[f64], _out: &mut [f64])
fn flex_loads(&self, _q: &[f64], _qd: &[f64], _qdd: &[f64], _out: &mut [f64])
flex_modes at the driven joints’ positions q, speeds qd and accelerations qdd, in its
coordinate (N).§fn flex_shift(&self, _q: &[f64], _deflection: &[f64], _out: &mut [f64])
fn flex_shift(&self, _q: &[f64], _deflection: &[f64], _out: &mut [f64])
deflection, into out (zeroed first).§fn static_shift(&self, _q: &[f64], out: &mut [f64])
fn static_shift(&self, _q: &[f64], out: &mut [f64])
out (zeroed first): zero by default.§fn flex_coupling(
&self,
_q: &[f64],
_qd: &[f64],
_d: &[f64],
_dd: &[f64],
) -> Option<FlexCoupling>
fn flex_coupling( &self, _q: &[f64], _qd: &[f64], _d: &[f64], _dd: &[f64], ) -> Option<FlexCoupling>
FlexCoupling). None where they are
one-way (flex_loads), the default.