Skip to content
Snippets Groups Projects
Commit dcfa3fd9 authored by Ouhouuhu's avatar Ouhouuhu
Browse files

essais réels data + scripts

parent 0ecfd629
Branches
No related tags found
No related merge requests found
{
"essai": "46",
"PID": {
"P": 100,
"I": 0.2,
"D": 257
},
"run": [
{
"input": {
"cercle": "d",
"r": 1.2,
"theta": 0.0
},
"pos": {
"x": 1.0,
"y": 0.5
},
"dist": 0.0,
"cp": 0,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.16,
"theta": -25.0
},
"pos": {
"x": 1.0619512362656192,
"y": 0.7042654931746715
},
"dist": -0.040000000000000036,
"cp": 0,
"lap": -1,
"order": {
"speed": 10,
"direction": 86
}
},
{
"input": {
"cercle": "d",
"r": 1.16,
"theta": -50.0
},
"pos": {
"x": 1.1893193219848393,
"y": 0.8702548141741727
},
"dist": -0.040000000000000036,
"cp": 0,
"lap": -1,
"order": {
"speed": 10,
"direction": 96
}
},
{
"input": {
"cercle": "d",
"r": 1.17,
"theta": -70.0
},
"pos": {
"x": 1.3332651801287365,
"y": 0.9581001526331303
},
"dist": -0.030000000000000027,
"cp": 0,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.18,
"theta": -90.0
},
"pos": {
"x": 1.5,
"y": 0.9916666666666667
},
"dist": -0.020000000000000018,
"cp": 0,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.2,
"theta": -105.0
},
"pos": {
"x": 1.6294095225512604,
"y": 0.9829629131445341
},
"dist": 0.0,
"cp": 1,
"lap": -1,
"order": {
"speed": 10,
"direction": 105
}
},
{
"input": {
"cercle": "d",
"r": 1.2,
"theta": -135.0
},
"pos": {
"x": 1.8535533905932737,
"y": 0.8535533905932737
},
"dist": 0.0,
"cp": 1,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.19,
"theta": -155.0
},
"pos": {
"x": 1.9493776110723389,
"y": 0.7095482214464301
},
"dist": -0.010000000000000009,
"cp": 1,
"lap": -1,
"order": {
"speed": 10,
"direction": 97
}
},
{
"input": {
"cercle": "d",
"r": 1.17,
"theta": 175.0
},
"pos": {
"x": 1.985644915319726,
"y": 0.4575115754105164
},
"dist": -0.030000000000000027,
"cp": 1,
"lap": -1,
"order": {
"speed": 10,
"direction": 92
}
},
{
"input": {
"cercle": "d",
"r": 1.16,
"theta": 145.0
},
"pos": {
"x": 1.8959234880730125,
"y": 0.22277138909699423
},
"dist": -0.040000000000000036,
"cp": 1,
"lap": -1,
"order": {
"speed": 10,
"direction": 94
}
},
{
"input": {
"cercle": "d",
"r": 1.17,
"theta": 115.0
},
"pos": {
"x": 1.706026402598591,
"y": 0.05817495381963311
},
"dist": -0.030000000000000027,
"cp": 1,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.18,
"theta": 85.0
},
"pos": {
"x": 1.4571484264824015,
"y": 0.010204273438225109
},
"dist": -0.020000000000000018,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.18,
"theta": 45.0
},
"pos": {
"x": 1.1523391659166142,
"y": 0.15233916591661412
},
"dist": -0.020000000000000018,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 98
}
},
{
"input": {
"cercle": "d",
"r": 1.16,
"theta": 15.0
},
"pos": {
"x": 1.0331358506269503,
"y": 0.3749041282004483
},
"dist": -0.040000000000000036,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 91
}
},
{
"input": {
"cercle": "g",
"r": 1.21,
"theta": 5.0
},
"pos": {
"x": 1.0022481602879219,
"y": 0.5439410203019444
},
"dist": 0.010000000000000009,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -24
}
},
{
"input": {
"cercle": "g",
"r": 1.15,
"theta": 10.0
},
"pos": {
"x": 0.9718870483183497,
"y": 0.5832064184654041
},
"dist": -0.050000000000000044,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -10
}
},
{
"input": {
"cercle": "g",
"r": 1.11,
"theta": 20.0
},
"pos": {
"x": 0.9346078371134827,
"y": 0.6581843162881218
},
"dist": -0.08999999999999986,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -11
}
},
{
"input": {
"cercle": "g",
"r": 1.07,
"theta": 40.0
},
"pos": {
"x": 0.8415281475572111,
"y": 0.7865761426519154
},
"dist": -0.1299999999999999,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -7
}
}
]
}
\ No newline at end of file
{
"essai": "47",
"PID": {
"P": 100,
"I": 0.2,
"D": 257
},
"run": [
{
"input": {
"cercle": "d",
"r": 1.18,
"theta": 75.0
},
"pos": {
"x": 1.372747302824594,
"y": 0.025086468741208123
},
"dist": -0.020000000000000018,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 93
}
},
{
"input": {
"cercle": "d",
"r": 1.13,
"theta": 40.0
},
"pos": {
"x": 1.1393207413648145,
"y": 0.19735416710592113
},
"dist": -0.07000000000000006,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 81
}
},
{
"input": {
"cercle": "d",
"r": 1.15,
"theta": 15.0
},
"pos": {
"x": 1.0371605415698215,
"y": 0.37598254088837546
},
"dist": -0.050000000000000044,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 100
}
},
{
"input": {
"cercle": "d",
"r": 1.16,
"theta": 2.0
},
"pos": {
"x": 1.0169611002741037,
"y": 0.4831319099271245
},
"dist": -0.040000000000000036,
"cp": 2,
"lap": -1,
"order": {
"speed": 10,
"direction": 99
}
},
{
"input": {
"cercle": "g",
"r": 1.22,
"theta": 2.0
},
"pos": {
"x": 1.0080236704013736,
"y": 0.517740577490438
},
"dist": 0.020000000000000018,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -17
}
},
{
"input": {
"cercle": "g",
"r": 1.15,
"theta": 15.0
},
"pos": {
"x": 0.9628394584301785,
"y": 0.6240174591116245
},
"dist": -0.050000000000000044,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": 2
}
},
{
"input": {
"cercle": "g",
"r": 1.14,
"theta": 40.0
},
"pos": {
"x": 0.8638711104815145,
"y": 0.8053241146011061
},
"dist": -0.06000000000000005,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -12
}
},
{
"input": {
"cercle": "g",
"r": 1.17,
"theta": 65.0
},
"pos": {
"x": 0.706026402598591,
"y": 0.9418250461803668
},
"dist": -0.030000000000000027,
"cp": 3,
"lap": -1,
"order": {
"speed": 10,
"direction": -24
}
}
]
}
\ No newline at end of file
This diff is collapsed.
{"essai": "5", "PID": {"P": 54.11317513, "I": 0.522774415, "D": 257.9071004}, "run": [{"input": {"cercle": "d", "r": 1.19, "theta": 80.0}, "pos": {"x": 1.413899445240147, "y": 0.01169948913144686}, "dist": -0.010000000000000009, "cp": 1, "lap": -1, "order": {"speed": 10, "direction": 87}}, {"input": {"cercle": "d", "r": 1.18, "theta": 65.0}, "pos": {"x": 1.2922126879774893, "y": 0.05439867137364712}, "dist": -0.020000000000000018, "cp": 2, "lap": -1, "order": {"speed": 10, "direction": 87}}, {"input": {"cercle": "d", "r": 1.21, "theta": 50.0}, "pos": {"x": 1.1759279134497032, "y": 0.11378592659418191}, "dist": 0.010000000000000009, "cp": 2, "lap": -1, "order": {"speed": 10, "direction": 98}}, {"input": {"cercle": "d", "r": 1.23, "theta": 30.0}, "pos": {"x": 1.0561619805604752, "y": 0.24375000000000002}, "dist": 0.030000000000000027, "cp": 2, "lap": -1, "order": {"speed": 10, "direction": 96}}, {"input": {"cercle": "d", "r": 1.24, "theta": 20.0}, "pos": {"x": 1.0144921459272807, "y": 0.3232895926150712}, "dist": 0.040000000000000036, "cp": 2, "lap": -1, "order": {"speed": 10, "direction": 94}}, {"input": {"cercle": "d", "r": 1.27, "theta": 5.0}, "pos": {"x": 0.9728469722597847, "y": 0.4538800861293642}, "dist": 0.07000000000000006, "cp": 2, "lap": -1, "order": {"speed": 10, "direction": 101}}, {"input": {"cercle": "g", "r": 1.17, "theta": 10.0}, "pos": {"x": 0.9800937795934515, "y": 0.5846534866126285}, "dist": -0.030000000000000027, "cp": 3, "lap": -1, "order": {"speed": 10, "direction": 27}}, {"input": {"cercle": "d", "r": 1.27, "theta": 20.0}, "pos": {"x": 1.0027459881674567, "y": 0.31901434082350033}, "dist": 0.07000000000000006, "cp": 3, "lap": -1, "order": {"speed": 10, "direction": -49}}, {"input": {"cercle": "g", "r": 1.32, "theta": 45.0}, "pos": {"x": 0.8889087296526013, "y": 0.8889087296526013}, "dist": 0.1200000000000001, "cp": 3, "lap": -1, "order": {"speed": 10, "direction": -39}}, {"input": {"cercle": "g", "r": 1.29, "theta": 60.0}, "pos": {"x": 0.76875, "y": 0.9654886545341359}, "dist": 0.09000000000000008, "cp": 3, "lap": -1, "order": {"speed": 10, "direction": -18}}, {"input": {"cercle": "g", "r": 1.23, "theta": 80.0}, "pos": {"x": 0.5889946910543018, "y": 1.0047139734187567}, "dist": 0.030000000000000027, "cp": 3, "lap": -1, "order": {"speed": 10, "direction": -7}}, {"input": {"cercle": "g", "r": 1.2, "theta": 100.0}, "pos": {"x": 0.41317591116653485, "y": 0.9924038765061041}, "dist": 0.0, "cp": 4, "lap": -1, "order": {"speed": 10, "direction": -13}}, {"input": {"cercle": "g", "r": 1.17, "theta": 115.0}, "pos": {"x": 0.29397359740140905, "y": 0.9418250461803669}, "dist": -0.030000000000000027, "cp": 4, "lap": -1, "order": {"speed": 10, "direction": -11}}, {"input": {"cercle": "g", "r": 1.14, "theta": 1.25}, "pos": {"x": 0.9748869628629568, "y": 0.5103620703914166}, "dist": -0.06000000000000005, "cp": 5, "lap": -1, "order": {"speed": 10, "direction": -10}}, {"input": {"cercle": "g", "r": 1.14, "theta": 140.0}, "pos": {"x": 0.1361288895184855, "y": 0.8053241146011063}, "dist": -0.06000000000000005, "cp": 5, "lap": -1, "order": {"speed": 10, "direction": -17}}]}
\ No newline at end of file
{"essai": "9", "PID": {"P": 54.11317513, "I": 0.222774415, "D": 257.9071004}, "run": [{"input": {"cercle": "d", "r": 1.19, "theta": 0.0}, "pos": {"x": 1.0041666666666667, "y": 0.5}, "dist": -0.010000000000000009, "cp": 0, "lap": -1, "order": {"speed": 10, "direction": 87}}, {"input": {"cercle": "d", "r": 1.18, "theta": -20.0}, "pos": {"x": 1.0379844614469285, "y": 0.6681599038017871}, "dist": -0.020000000000000018, "cp": 0, "lap": -1, "order": {"speed": 10, "direction": 87}}, {"input": {"cercle": "d", "r": 1.18, "theta": -35.0}, "pos": {"x": 1.0972502448912458, "y": 0.7820084145392643}, "dist": -0.020000000000000018, "cp": 0, "lap": -1, "order": {"speed": 10, "direction": 89}}, {"input": {"cercle": "d", "r": 1.2, "theta": -60.0}, "pos": {"x": 1.25, "y": 0.9330127018922193}, "dist": 0.0, "cp": 0, "lap": -1, "order": {"speed": 10, "direction": 95}}, {"input": {"cercle": "d", "r": 1.25, "theta": -75.0}, "pos": {"x": 1.3651984140091038, "y": 1.0030863678588897}, "dist": 0.050000000000000044, "cp": 0, "lap": -1, "order": {"speed": 10, "direction": 105}}, {"input": {"cercle": "d", "r": 1.3, "theta": -90.0}, "pos": {"x": 1.5, "y": 1.0416666666666667}, "dist": 0.10000000000000009, "cp": 0, "lap": -1, "order": {"speed": 10, "direction": 108}}, {"input": {"cercle": "d", "r": 1.3, "theta": -105.0}, "pos": {"x": 1.640193649430532, "y": 1.0232098225732456}, "dist": 0.10000000000000009, "cp": 1, "lap": -1, "order": {"speed": 10, "direction": 95}}, {"input": {"cercle": "d", "r": 1.32, "theta": -115.0}, "pos": {"x": 1.7324400439573846, "y": 0.9984692828701576}, "dist": 0.1200000000000001, "cp": 1, "lap": -1, "order": {"speed": 10, "direction": 101}}, {"input": {"cercle": "d", "r": 1.32, "theta": -125.0}, "pos": {"x": 1.8154670399930752, "y": 0.9505336243589457}, "dist": 0.1200000000000001, "cp": 1, "lap": -1, "order": {"speed": 10, "direction": 96}}, {"input": {"cercle": "d", "r": 1.32, "theta": -130.0}, "pos": {"x": 1.8535331853275967, "y": 0.921324443715438}, "dist": 0.1200000000000001, "cp": 1, "lap": -1, "order": {"speed": 10, "direction": 96}}]}
\ No newline at end of file
File added
...@@ -12,6 +12,7 @@ class PidController: ...@@ -12,6 +12,7 @@ class PidController:
def get_control(self, process_value): def get_control(self, process_value):
error = self.set_point - process_value error = self.set_point - process_value
print(f"error: {error}")
control = self.p_gain * error + self.i_gain * self.integrated_error + self.d_gain * (error - self.previous_error) control = self.p_gain * error + self.i_gain * self.integrated_error + self.d_gain * (error - self.previous_error)
self.previous_error = error self.previous_error = error
self.integrated_error += error self.integrated_error += error
......
0 0 0 10 0 0
\ No newline at end of file \ No newline at end of file
...@@ -76,13 +76,15 @@ def checkpoints(n): ...@@ -76,13 +76,15 @@ def checkpoints(n):
if n==0: if n==0:
return points[:11] return points[:11]
elif n==1: elif n==1:
return points[11:29] return points[10:29]
elif n==2: elif n==2:
return points[29:47] return points[28:38]
elif n==3: elif n==3:
return points[47:65] return points[37:47]
elif n==4: elif n==4:
return points[65:]+points[1:11] return points[46:65]
elif n==5:
return points[64:]
return points return points
def is_in_track(x,y): def is_in_track(x,y):
...@@ -92,7 +94,7 @@ def is_in_track(x,y): ...@@ -92,7 +94,7 @@ def is_in_track(x,y):
if __name__ =="__main__": if __name__ =="__main__":
points = create_track(0.5,0,0, (0,0))[:-1]+[(1,0.5)] points = create_track(0.5,0,0, (0,0))[:-1]+[(1,0.5)]
cp_points = checkpoints(1) cp_points = checkpoints(5)
plt.plot([x for x,y in cp_points], [y for x,y in cp_points], 'or') plt.plot([x for x,y in cp_points], [y for x,y in cp_points], 'or')
plt.plot([x for x,y in points], [y for x,y in points]) plt.plot([x for x,y in points], [y for x,y in points])
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment