Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of 6DOF robot #29

Merged
merged 28 commits into from
Sep 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2d4a3d8
WIP implementation of 6DOF robot
baggepinnen Apr 26, 2023
9cafe4a
format
baggepinnen Apr 26, 2023
ed082ca
add MechanicalStructure
baggepinnen Apr 26, 2023
24b011c
bump compat MTKstdlib
baggepinnen Apr 27, 2023
3efcd21
update motor
baggepinnen Apr 27, 2023
47eb592
update controller
baggepinnen Apr 27, 2023
a3607a0
update AxisType2
baggepinnen Apr 27, 2023
a0fe14f
update gear
baggepinnen Apr 27, 2023
9f5bf6c
add OneAxis and ControlBus
baggepinnen Apr 27, 2023
3d66ffa
add FullRobot
baggepinnen Apr 27, 2023
8a4aea5
add path planning utilities
baggepinnen Apr 27, 2023
fc0804d
add PathToAxisControlBus
baggepinnen Apr 27, 2023
8968141
update PathToAxisControlBus
baggepinnen Apr 27, 2023
64dfa99
add simple quintic trajectory planner
baggepinnen Apr 27, 2023
d164f05
add passthrough
baggepinnen Apr 28, 2023
069e463
move compoenet instantiation to test file
baggepinnen Apr 28, 2023
ef648db
use 5:th order traj plan instead of min-time
baggepinnen Apr 28, 2023
b1c0aad
FullRobot instantiates
baggepinnen Apr 28, 2023
03760d9
replace trajectory spline with constants for now
baggepinnen Apr 28, 2023
812670b
forget not the world which we live in
baggepinnen Apr 28, 2023
ff70d01
comments
baggepinnen Apr 28, 2023
d62e668
Full robot simplifies 🎉
baggepinnen Apr 28, 2023
f6a5cb3
import all packages
baggepinnen Apr 28, 2023
6dce247
avoid using parameters in components for now
baggepinnen May 2, 2023
faf7682
SymbolicIR -> JSCompiler
baggepinnen Sep 26, 2023
dad15ea
Fix Spring
YingboMa Sep 26, 2023
73e3015
SymboliucIR -> JuliaSimComp
baggepinnen Sep 28, 2023
d7e876c
Merge branch 'main' into robot
baggepinnen Sep 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add FullRobot
baggepinnen committed Apr 27, 2023
commit 3d66ffa36e221e12e76385d0858f2f58dc79fa9e
156 changes: 156 additions & 0 deletions examples/robot/FullRobot.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
include("components.jl")

function FullRobot(; name)
@parameters begin
mLoad = 15, [description = "Mass of load"]
rLoad[1:3] = [0.1, 0.25, 0.1],
[description = "Distance from last flange to load mass"]
g = 9.81, [description = "Gravity acceleration"]
refStartTime = 0, [description = "Start time of reference motion"]
refSwingTime = 0.5,
[
description = "Additional time after reference motion is in rest before simulation is stopped",
]
startAngle1 = -60, [description = "Start angle of axis 1"]
startAngle2 = 20, [description = "Start angle of axis 2"]
startAngle3 = 90, [description = "Start angle of axis 3"]
startAngle4 = 0, [description = "Start angle of axis 4"]
startAngle5 = -110, [description = "Start angle of axis 5"]
startAngle6 = 0, [description = "Start angle of axis 6"]
endAngle1 = 60, [description = "End angle of axis 1"]
endAngle2 = -70, [description = "End angle of axis 2"]
endAngle3 = -35, [description = "End angle of axis 3"]
endAngle4 = 45, [description = "End angle of axis 4"]
endAngle5 = 110, [description = "End angle of axis 5"]
endAngle6 = 45, [description = "End angle of axis 6"]
refSpeedMax[1:6] = [3, 1.5, 5, 3.1, 3.1, 4.1],
[description = "Maximum reference speeds of all joints"]
refAccMax[1:6] = [15, 15, 15, 60, 60, 60],
[description = "Maximum reference accelerations of all joints"]
kp1 = 5, [description = "Gain of position controller"]
ks1 = 0.5, [description = "Gain of speed controller"]
Ts1 = 0.05, [description = "Time constant of integrator of speed controller"]
kp2 = 5, [description = "Gain of position controller"]
ks2 = 0.5, [description = "Gain of speed controller"]
Ts2 = 0.05, [description = "Time constant of integrator of speed controller"]
kp3 = 5, [description = "Gain of position controller"]
ks3 = 0.5, [description = "Gain of speed controller"]
Ts3 = 0.05, [description = "Time constant of integrator of speed controller"]
kp4 = 5, [description = "Gain of position controller"]
ks4 = 0.5, [description = "Gain of speed controller"]
Ts4 = 0.05, [description = "Time constant of integrator of speed controller"]
kp5 = 5, [description = "Gain of position controller"]
ks5 = 0.5, [description = "Gain of speed controller"]
Ts5 = 0.05, [description = "Time constant of integrator of speed controller"]
kp6 = 5, [description = "Gain of position controller"]
ks6 = 0.5, [description = "Gain of speed controller"]
Ts6 = 0.05, [description = "Time constant of integrator of speed controller"]
end

systems = @named begin
mechanics = MechanicalStructure(mLoad = mLoad,
rLoad = rLoad,
g = g)
pathPlanning = PathPlanning6(naxis = 6,
angleBegDeg = [
startAngle1,
startAngle2,
startAngle3,
startAngle4,
startAngle5,
startAngle6,
],
angleEndDeg = [
endAngle1,
endAngle2,
endAngle3,
endAngle4,
endAngle5,
endAngle6,
],
speedMax = refSpeedMax,
accMax = refAccMax,
startTime = refStartTime,
swingTime = refSwingTime)

axis1 = AxisType1(w = 4590,
ratio = -105,
c = 43,
cd = 0.005,
Rv0 = 0.4,
Rv1 = (0.13 / 160),
kp = kp1,
ks = ks1,
Ts = Ts1)
axis2 = AxisType1(w = 5500,
ratio = 210,
c = 8,
cd = 0.01,
Rv1 = (0.1 / 130),
Rv0 = 0.5,
kp = kp2,
ks = ks2,
Ts = Ts2)

axis3 = AxisType1(w = 5500,
ratio = 60,
c = 58,
cd = 0.04,
Rv0 = 0.7,
Rv1 = (0.2 / 130),
kp = kp3,
ks = ks3,
Ts = Ts3)
axis4 = AxisType2(k = 0.2365,
w = 6250,
D = 0.55,
J = 1.6e-4,
ratio = -99,
Rv0 = 21.8,
Rv1 = 9.8,
peak = 26.7 / 21.8,
kp = kp4,
ks = ks4,
Ts = Ts4)
axis5 = AxisType2(k = 0.2608,
w = 6250,
D = 0.55,
J = 1.8e-4,
ratio = 79.2,
Rv0 = 30.1,
Rv1 = 0.03,
peak = 39.6 / 30.1,
kp = kp5,
ks = ks5,
Ts = Ts5)
axis6 = AxisType2(k = 0.0842,
w = 7400,
D = 0.27,
J = 4.3e-5,
ratio = -99,
Rv0 = 10.9,
Rv1 = 3.92,
peak = 16.8 / 10.9,
kp = kp6,
ks = ks6,
Ts = Ts6)

controlBus = ControlBus()
end

eqs = [connect(axis2.flange, mechanics.axis2)
connect(axis1.flange, mechanics.axis1)
connect(axis3.flange, mechanics.axis3)
connect(axis4.flange, mechanics.axis4)
connect(axis5.flange, mechanics.axis5)
connect(axis6.flange, mechanics.axis6)
connect(controlBus, pathPlanning.controlBus)
connect(controlBus.axisControlBus1, axis1.axisControlBus)
connect(controlBus.axisControlBus2, axis2.axisControlBus)
connect(controlBus.axisControlBus3, axis3.axisControlBus)
connect(controlBus.axisControlBus4, axis4.axisControlBus)
connect(controlBus.axisControlBus5, axis5.axisControlBus)
connect(controlBus.axisControlBus6, axis6.axisControlBus)]

ODESystem(eqs, t; systems, name)
end
33 changes: 14 additions & 19 deletions examples/robot/OneAxis.jl
Original file line number Diff line number Diff line change
@@ -32,27 +32,22 @@ function OneAxis(; name, mLoad = 15, kp = 5, ks = 0.5, Ts = 0.05, startAngle = 0
refAccMax = refAccMax, [description = "Maximum reference acceleration"]
end


systems = @named begin
axis = AxisType1(
w = 5500,
ratio = 210,
c = 8,
cd = 0.01,
Rv0 = 0.5,
Rv1 = (0.1 / 130),
kp = kp,
ks = ks,
Ts = Ts,
)
axis = AxisType1(w = 5500,
ratio = 210,
c = 8,
cd = 0.01,
Rv0 = 0.5,
Rv1 = (0.1 / 130),
kp = kp,
ks = ks,
Ts = Ts)
load = Inertia(J = 1.3 * mLoad)
pathPlanning = PathPlanning1( # TODO: not yet implemented
swingTime = swingTime,
angleBegDeg = startAngle,
angleEndDeg = endAngle,
speedMax = refSpeedMax,
accMax = refAccMax,
)
pathPlanning = PathPlanning1(swingTime = swingTime,
angleBegDeg = startAngle,
angleEndDeg = endAngle,
speedMax = refSpeedMax,
accMax = refAccMax)
controlBus = ControlBus()
end
eqs = [