Skip to content

Commit 573d13c

Browse files
committed
add docstrings
1 parent 5730541 commit 573d13c

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

ext/Render.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ function render!(scene, ::Union{typeof(P.Spring), typeof(P.SpringDamper)}, sys,
814814
true
815815
end
816816

817-
function render!(scene, ::Union{typeof(P.Wheel), typeof(P.SlipBasedWheelJoint)}, sys, sol, t)
817+
function render!(scene, ::Union{typeof(P.SimpleWheel), typeof(P.SlipBasedWheelJoint)}, sys, sol, t)
818818

819819
r_0 = get_fun(sol, [sys.frame_a.x, sys.frame_a.y])
820820
rotfun = get_rot_fun_2d(sol, sys.frame_a)

src/PlanarMechanics/PlanarMechanics.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export Frame, FrameResolve, PartialTwoFrames, ZeroPosition, ori_2d
1717
include("utils.jl")
1818

1919
export Fixed, Body, FixedTranslation, Spring, Damper, SpringDamper
20+
export SlipBasedWheelJoint, SimpleWheel
2021
include("components.jl")
2122

2223
export Revolute, Prismatic

src/PlanarMechanics/components.jl

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,27 @@ Linear 2D translational spring damper model
414414
end
415415

416416

417+
"""
418+
SimpleWheel(; name, radius = 0.3, color = [1, 0, 0, 1], μ = 1e9)
419+
420+
Simple wheel model with viscous lateral friction and a driving torque
421+
422+
# Connectors:
423+
- `frame_a` (Frame) Coordinate system fixed to the component with one cut-force and cut-torque
424+
- `thrust` (RealInput) Input for the longitudinal force applied to the wheel
425+
426+
# Parameters:
427+
- `μ`: [Ns/m] Viscous friction coefficient
428+
- `radius`: [m] Radius of the wheel
429+
- `color`: Color of the wheel in animations
430+
431+
# Variables:
432+
- `θ`: [rad] Wheel angle
433+
- `Vx`: [m/s] Longitudinal velocity (resolved in local frame)
434+
- `Vy`: [m/s] Lateral velocity (resolved in local frame)
435+
- `Fy`: [N] Lateral friction force
436+
- `Fx`: [N] Applied longitudinal wheel force
437+
"""
417438
@mtkmodel SimpleWheel begin
418439
@structural_parameters begin
419440
friction_model = :viscous
@@ -503,7 +524,43 @@ end
503524
@register_symbolic limit_S_triple(x_max::Real, x_sat::Real, y_max::Real, y_sat::Real, x::Real)
504525
@register_symbolic limit_S_form(x_min::Real, x_max::Real, y_min::Real, y_max::Real, x::Real)
505526

527+
"""
528+
SlipBasedWheelJoint(;
529+
name,
530+
r = [1, 0],
531+
N,
532+
vAdhesion_min,
533+
vSlide_min,
534+
sAdhesion,
535+
sSlide,
536+
mu_A,
537+
mu_S,
538+
render = true,
539+
color = [0.1, 0.1, 0.1, 1],
540+
z = 0,
541+
diameter = 0.1,
542+
width = diameter * 0.6,
543+
radius = 0.1,
544+
w_roll = nothing,
545+
)
546+
547+
Slip-based wheel joint
548+
549+
The ideal wheel joint models the behavior of a wheel rolling on a x,y-plane whose contact patch has slip-dependent friction characteristics. This is an approximation for wheels with a rim and a rubber tire.
550+
551+
The force depends with friction characteristics on the slip. The slip is split into two components:
552+
553+
- lateral slip: the lateral velocity divided by the rolling velocity.
554+
- longitudinal slip: the longitudinal slip velocity divided by the rolling velocity.
506555
556+
For low rolling velocity this definition become ill-conditioned. Hence a dry-friction model is used for low rolling velocities. For zero rolling velocity, the intitialization might fail if automatic differentiation is used. Either start with a non-zero (but tiny) rolling velocity or pass `autodiff=false` to the solver.
557+
558+
The radius of the wheel can be specified by the parameter `radius`. The driving direction (for `phi = 0`) can be specified by the parameter `r`. The normal load is set by `N`.
559+
560+
The wheel contains a 2D connector `frame_a` for the steering on the plane. The rolling motion of the wheel can be actuated by the 1D connector `flange_a`.
561+
562+
In addition there is an input `dynamicLoad` for a dynamic component of the normal load.
563+
"""
507564
@component function SlipBasedWheelJoint(;
508565
name,
509566
r = [1, 0],

0 commit comments

Comments
 (0)