wernerdaehn / CC3D-CableCam-Controller

CC3D and STM Cube based CableCam controller
Apache License 2.0
37 stars 15 forks source link

Deceleration problem #30

Open Willyfan opened 6 years ago

Willyfan commented 6 years ago

During some test on the rope, I found a little problem with deceleration near to the end points. I see this in autoplay, but it is the same if you drive the cablecam to end points at max speed. The problem is that the deceleration is not smooth, but a bit "choppy". I solved the problem rising the max allowed error parameters from 100 (default) to 300. Now the deceleration is smooth, but when the cablecam arrive to the end point speed is not zero (anyway is NEAR to zero) and it stop abruptly. My mind is that the calculation for deceleration have some kind of error, so, if allowed error is low the board try to adjust speed creating the "choppy" deceleration. When max error is higher, The deceleration go until the cablecam don't is on the end point, but because this error speed is not zero, so the board brake in order to don't go over the end point. My guess is that deceleration start too late, Or is less that we need. Maybe also cablecam inertia do something, anyway, is not possible to have a parameter for "anticipate" a bit the deceleration? Just for debug...

DmitriySurin commented 6 years ago

Соnfirm the same issue at high speed. May be that happens when the main wheel is blocked by the motor but the cablecam steel moving under the own mass.

wernerdaehn commented 6 years ago

We need to separate here between VESC and RC ESC. With the RC ESC there is not much I can do. I can put the stick slowly towards neutral - little brake force - or put it in idle - strong brake force. There is no proportional brake in forward/reverse mode. Hence the best is a narrow max-pos-error of 100 to switch between both brake modes more often.

With the VESC we have conflicting requirements. We want to stop at the end point, we want not to drive over the end point and we don't know the inertia of the cablecam. (Also the inertia is not static - driving up/downhill, rope tension etc). I have tried multiple things like setting the end point 100 step early and drive at low speed to the very end. Nothing really did work well.

Which of the two modes are we talking about and what is the suggestion? Also a video would be nice to agree it is the above or something that can be optimized.

Willyfan commented 6 years ago

I'm using vesc and not rc esc. I have a video on my phone. I'll publish it in the afternoon, but on video is not so clear what I mean.

DmitriySurin commented 6 years ago

And I am using esc from skyrc. From my side I can say that long acceleration and decceleration affect more choppy brake. Like abs on the car. When I put low accell and deccel value my cablecam slide on the rope at high speed while braking but there is no choppy effect discribed above. My suggestion to separate accel and deccel value for manual mode and for automatic braking near end points. Also it would be nice if we could independently adjust accel and deccel value.

DmitriySurin commented 6 years ago

Hence the best is a narrow max-pos-error of 100 to switch between both brake modes more often. What does it mean? In my cablecam construction there is big gear ratio and I am using 4-6s battery. So from the esc side the brake force is strong enaphf to hold the cablecam via big gear ratio.

Willyfan commented 6 years ago

This is a video where you can see that the Cablecam brake an go during deceleration. https://youtu.be/pfnLFQlCc9I As you can see, the Cablecam jump slightly near to the end point. No problem with accelleration. The video is with max error at default value 100. Raising at 300 (or more) the deceleration is always smooth, but when the camera is at the endpoint speed is not zero, so it brake abruptly. This is not a big problem, but if is possible reach speed zero without this effect (also if the camera went slightly over the endpoint, all is better.

Anyway, is better the results with hight max error value than the choppy deceleration, for quality of video.

wernerdaehn commented 6 years ago

What are the drag brake and initial brake settings on the ESC itself? Rather high values or low?

Imagine the following situation: CableCam is 5m away from the endpoint and according to the accel settings it has to brake now. In the next cycle it is 4m away and the speed has not been reduced significantly. The brake distance calculation shows it will overshoot the end point by 0.5m. As you see, moving the stick slowly to neutral does not cause the cablecam to brake enough. What signal should I send to the ESC?

A few cycles later, it is exactly at the endpoint but has some excess speed left. It will overshoot the endpoint by 1m. What should I send to the ESC?

Willyfan commented 6 years ago

What are the drag brake and initial brake settings on the ESC itself? Rather high values or low?

I'm using a VESC6, so I don't set drag brake and initial brake. Now, I tested the cablecam far from end point. If I move the stick at center, the cablecam decelerate very smooth and stop (after I released the stick). But I guess that this is a combination from deceleration and camera inertia, and I can't know how much distance the camera stop from where I released the stick. There is a difference from teorical distance based only on deceleration and true distance. A good results near to end point should be the same, move the stick at center (stop) just in time for stop the camera on the end point. Maybe with a corrector parameter?

Willyfan commented 6 years ago

About vesc6 I opened a issue about configuration some days ago. Maybe I'm using vesc6 in wrong way. I set it in FOC, How do you set your VESC?

DmitriySurin commented 6 years ago

I use high values for brake. Also I can very smooth stop my cablecam manually moving slow the stick to neutral. Also the braking distance from what I can see during my tests not longer than at operational mode. So the main question for me why under the same condition the result is too different?

DmitriySurin commented 6 years ago

Also I dont understand how the cable cam can know the speed if the diameter of the halls wheel and the distance between the magnets can be so different from cable cam to cablecam? What is the frequency of calculation the braking distance? One hall step or what?

Willyfan commented 6 years ago

@DmitriySurin The cablecam don't know the absolute speed in m/s, but at pulse/second. As also distance in measured in pulse and not metres, it's ok

wernerdaehn commented 6 years ago

@Willyfan Okay, will document my settings on the VESC next weekend.

@DmitriySurin The statement "I can smoothly stop my cablecam manually moving the stick to neutral" is not a fair comparison. The controller does not let the motor slow down with its settings but by the programmed acceleration value. A fair comparison would be you want to stop the motor faster than with drag brake alone, hence you have to put the stick in neutral once a while. This would obviously not be as smooth as the drag brake alone. I'd like to proof that by you setting a lower acceleration value in the controller. This should then never kick in the emergency brake. What I wonder about is the slow speeds and slow accel I see in your video. I hope it is not something else. Do you have bluetooth working meanwhile? Would be interesting to see the emergency brake output during the drive.

DmitriySurin commented 6 years ago

I try lower accell settings and have the same result. Actually I have to spikes during braking. After applaying emergency brake the board immedeatly realease brake to the actual or lower position of stick and let the cablecam moving and then cycles this one more time before reaching end point. The lower accell value the bigger distance between thoose two choppy spikes. But thoose spikes, errors, choppy braking or whatever it calls is still here. I have function called "servo speed" in my radio so I can emulate boards accell values. My bluetooth is working so I send you the log of the braking cycle. What video you mean?

Willyfan commented 6 years ago

@wernerdaehn Video is mine....

Willyfan commented 6 years ago

I had some logs about my deceleration. I remember you that I'm using VESC connected in UART. I tried with tolerated error 100 and 300, and in left and right direction. This is the log

Tolerated error 100 - to left
Endpoint brake on. Distance= 866.000, calculated braking distance= 917.956
Endpoint brake on. Distance= 848.000, calculated braking distance= 908.956
Endpoint brake on. Distance= 830.000, calculated braking distance= 899.956
Endpoint brake on. Distance= 811.000, calculated braking distance= 940.453
Emergency brake on 
Endpoint brake on. Distance= 789.000, calculated braking distance= 1077.946
Emergency brake on 
Endpoint brake on. Distance= 765.000, calculated braking distance= 1163.941
Emergency brake on 
Endpoint brake on. Distance= 743.000, calculated braking distance= 1055.946
Emergency brake on 
Endpoint brake on. Distance= 721.000, calculated braking distance= 1044.946
Emergency brake on 
Endpoint brake on. Distance= 699.000, calculated braking distance= 1033.946
Emergency brake on 

Tolerated error 100 - to right

Endpoint brake on. Distance= 866.000, calculated braking distance= 911.739
Endpoint brake on. Distance= 848.000, calculated braking distance= 902.739
Endpoint brake on. Distance= 830.000, calculated braking distance= 893.739
Endpoint brake on. Distance= 811.000, calculated braking distance= 933.891
Emergency brake on 

Tolerated error 300 - To left
Endpoint brake on. Distance= 854.000, calculated braking distance= 917.956
Endpoint brake on. Distance= 836.000, calculated braking distance= 908.956
Endpoint brake on. Distance= 817.000, calculated braking distance= 949.953
Emergency brake on 
Endpoint brake on. Distance= 794.000, calculated braking distance= 1138.444
Emergency brake on 
Endpoint brake on. Distance= 771.000, calculated braking distance= 1126.944
Emergency brake on 
Endpoint brake on. Distance= 749.000, calculated braking distance= 1066.946
Emergency brake on 
Endpoint brake on. Distance= 727.000, calculated braking distance= 1055.946
Emergency brake on 
Endpoint brake on. Distance= 705.000, calculated braking distance= 1044.946
Emergency brake on 
Endpoint brake on. Distance= 684.000, calculated braking distance= 986.949
Emergency brake on 
Endpoint brake on. Distance= 634.000, calculated braking distance= 697.463
Emergency brake on 

tolerated error 300 -  to right 
Endpoint brake on. Distance= 861.000, calculated braking distance= 864.998
Endpoint brake on. Distance= 843.000, calculated braking distance= 906.880
Endpoint brake on. Distance= 824.000, calculated braking distance= 947.762
Emergency brake on 

What I not understand is that the braking distance aftewr a while seem to raise and not lower, and this is impossible because the cablecam slow the speed.

Willyfan commented 6 years ago

Analyze for example this log:

Endpoint brake on. Distance= 866.000, calculated braking distance= 917.956
Endpoint brake on. Distance= 848.000, calculated braking distance= 908.956
Endpoint brake on. Distance= 830.000, calculated braking distance= 899.956
Endpoint brake on. Distance= 811.000, calculated braking distance= 940.453
Emergency brake on 
Endpoint brake on. Distance= 789.000, calculated braking distance= 1077.946
Emergency brake on `

At begin the distance to the endpoint and braking distance decrease, but not how much it need. Anyway, the error is less than 100. Note that distance decrease at double that braking distance, maybe is random? At the fourth cycle, the breaking distance increase suddenly. this is a no sense because to have this result the cablecam must accelerate. but I see that cablecam is in deceleration. At fifth cycle is increased again a lot, and so on for other 4 or five cycles. but at this point the brake stop the camera finally. I don't know what happen, but there is a error in braking distance calculation. I see no other explanation.

wernerdaehn commented 6 years ago

I agree. In order to narrow it down, I will add more information.

The distance is calculated in those lines:

float time_to_stop = abs_d(getStick()/controllerstatus.stick_max_accel);
float distance_to_stop = controllerstatus.speed * time_to_stop / 2.0f;

I suspect that the speed is not accurate enough. For example it might switch between the values 5 and 6 and that might be enough to cause that. I have a second way of measuring the speed, that is by measuring the time between two Hall pulses. This way it is not old_pos-current_pos every 0.02s and therefore never a decimal but a natural number.

Willyfan commented 6 years ago

Ok. I think that to do a complete debug we need for every cycle also: Virtual stick value, or the erpm sent to vesc Real speed. The fact is that the deceleration, when I release the stick at zero is very, very smooth, so I'm sure that we can have the same results at the endpoint. Please let me know, I can try again from next Monday. I have also some other ideas (like hyperlapse function), but I will explain later.

Willyfan commented 6 years ago

How is calculated the value for stick_max_accel? Because, we input a value from 0.001 to 1, but in your code you transform it with line activesettings.stick_max_accel = p[0]*CONTROLLERLOOPTIME_FLOAT; What value is CONTROLLERLOOPTIME_FLOAT ? I found it in config.h: #define CONTROLLERLOOPTIME_FLOAT 0.02f but I don't understand how work ...

Willyfan commented 6 years ago

Ok, understood. The loop time is 20 ms, so if the input value is 1 (max) the cam decelerate in 1 sec. If the value is 0.5, the cam decelerate in 2 seconds ans so on. Stick can have value from 0 to 1, so you subtract every loop cycle the max_accel value in order to go at 0 in definited time (or, better with a definited ramp, time depends from stick_last_value). I want check if on my setup this is real. I will put max acc at 0.5, pot at max and try to release the stick, to see if the camera stop in 2 seconds, and how much distance. I can measure, roughly my setup is 175 pulse for meters. Just to have some more info.

Willyfan commented 6 years ago

Some test done. with max speed at around 0.25 and max acc to 0.5, when I release the stick the camera stop in 2 seconds (so, it's correct). In 2 seconds the camera runs 4metres and 20 cm, around 735 pulse in my config (so, I guess that speed read before I move the stick was 14 or 15 pulse in a cycle, not so much) unfortunately in my garden my rope is only 10 meters long, so I can't do better test. I tried also at lower speed (lowered with pot). Camera stop in similar time (maybe a bit less but I'm not sure) but runs less on the rope. In this situations the deceleration is always smooth. Goal is start with deceleration around end point with this value. As I don't know the speed read when I released the stick, I can't do more. Foa a complete debug we need a log with speed, and a more precise time (for this test, I'm moving the stick with a hand and start chronometer on phone with other, not so reliable).

wernerdaehn commented 6 years ago

Okay, I made a few changes:

  1. The more accurate speed measurement using the time between pulses instead of testing in 20ms intervals.
  2. The end point brake and the emergency brake print out all details now. Note that these print out something only the first time the brake kicks in. If you have multiple lines, that means that in one cycle it did brake because of the endpoint, in another cycle the speed was low enough to not reach the endpoint, another cycle it had to brake again.
  3. The command $d P enables to print out above position messages in every single cycle. Good for debugging. (A temporary setting only, not effected by $w)
Willyfan commented 6 years ago

Don't work... I tried at low speed, because with high speed the cam overshoot the end point a lot (some metres) and I have not so much rope in my garden. I tried at 2 different acceleration value, 1 (max) and around 0,5 (pot at mid). The cam seems not decelerate, or not in the same way when I put the stick in mid pos. $d P don't work, or I don't see any different result in debug. This is my log: with acceleration at 1:

Endpoint brake on. Distance= 321.000, calculated braking distance= abs( -0.958[%] ) / 1.000[%/s] * 666.667[steps/s] / 2 = 325.896
Emergency brake on. Distance= 139.000, calculated braking distance= abs( -0.698[%] ) / 1.000[%/s] * 666.667[steps/s] / 2 = 245.896

With acceleration at 0.5:

Endpoint brake on. Distance= 767.000, calculated braking distance= abs( 0.965[%] ) / 0.501[%/s] * 800.000[steps/s] / 2 = 779.358
Endpoint brake on. Distance= 712.000, calculated braking distance= abs( 0.965[%] ) / 0.501[%/s] * 800.000[steps/s] / 2 = 779.358
Endpoint brake on. Distance= 643.000, calculated braking distance= abs( 0.965[%] ) / 0.501[%/s] * 666.667[steps/s] / 2 = 649.465
Emergency brake on. Distance= 617.000, calculated braking distance= abs( 0.955[%] ) / 0.501[%/s] * 800.000[steps/s] / 2 = 779.358
Endpoint brake on. Distance= 535.000, calculated braking distance= abs( 0.925[%] ) / 0.501[%/s] * 666.667[steps/s] / 2 = 629.465
Emergency brake on. Distance= 510.000, calculated braking distance= abs( 0.915[%] ) / 0.501[%/s] * 666.667[steps/s] / 2 = 622.798

In last case, deceleration is choppy. the thing that does not convince me at all is the speed value read: 800 step or 666.667 step in this direction. In the other direction I have also some other values but always inconsistent:

Endpoint brake on. Distance= 324.000, calculated braking distance= abs( 0.955[%] ) / 1.000[%/s] * 666.667[steps/s] / 2 = 325.159
Endpoint overshot. Distance= -1.000, calculated braking distance= abs( 0.455[%] ) / 1.000[%/s] * 363.636[steps/s] / 2 = 82.814

I don't understand what happen, please let me know if I can do other test in order to understand.

wernerdaehn commented 6 years ago

Okay. One more question: What is the $a value?

Willyfan commented 6 years ago

$a value is 1, but I done test with pot at max (so is 1) and pot at mid, so is at 0.5 or so (I read 0,501 in debug, I think is correct value). If you like, I can disable pot and put a precise value for $a. Please let me know.

wernerdaehn commented 6 years ago

You are right, it was stupid asking. You said the accel is 1.0 at 100% poti, hence I could have known already. I would love to test that with lower speeds. Assuming the top speed is 50'000erpm for the VESC, a value of 1 would mean it stops from 50'000 to 0 in 1 second. That is significant. If your actual speed is just 5'000rpm and you drive against the end point it would stop in 1/10th of a second. That is a deceleration way more than physically possible. Hence I would like to set the baseline to something smaller. In my case I have $a 0.5 0.5 which is quite a lot as well and then the poti is at 50%. That gives an effective acceleration of 4 seconds from 0 to max erpm. More reasonable.

How about the following: You limit the max erpm in the controller, say $e 5000. Hence the UART output will be a speed command of 5000rpm at the most. Something you feel comfortable as top speed given the line of the rope. And then way play with smaller accelerations.

I agree with you that above readings are not what I want to see either. What I don't know is if they are a side effect or the root cause. If you want to stop 10kg of mass from 60km/h to 0 within one second, yes the deceleration will not look nice. Simply because you trip the failsafes constantly. Even if you drive just with 6km/h it will not look nice because you essentially stop within one controller cycle. Hence not much difference in output when printing the debug values in every control cycle or not.

Knot some towels at the ends of your rope so even if you drive over the end point, there is a cushion of some kind stopping the cablecam?

Willyfan commented 6 years ago

Tomorrow morning I will try with max ERPM at 5000 (actually is at 35000) but: 1) My test was at not higher speed, but with pot at less than half. I don't know the exact value because the curve for this pot is not linear but expo (programmed in the radio). If I try with high speed the cam go some metres over endpoint, As I told before. 2) If I release the stick in the mid of rope, the cam stop in 2 seconds (as expeted) with acceleration at around 0,5, without problem and very smoothly. Obviusly, it go more metres as the speed is higher. So, I think that the problem is not the inertia of the camera, it CAN stop at the speed I try. 3) in my garden I have a 14 metres rope, not more. So, I'm unable to go at very high speed because the cam have not time for accelerate. Anyway, the goal is have the same stop at end points as when I release the stick. 4) Today, at same speed that I test the end point, in the mid of rope when I release the stick the cam stop in 2 second and in around 2 metres or little more. As my cabelcam have around 175 pulse/metres, I expected the braking distance to be around 350 or 400 pulses, but it seems to be much more from debug info (800 pulse). Probably there is still a problem of calculating the speed. Tomorrow I try also to take a video, so you can see the speed of the camera.

wernerdaehn commented 6 years ago

The 400 pulses expected vs the 800 pulses calculated I can explain, I believe. I have configured the encoder so that one pulse is a rising and falling flank in either of the two Hall sensors. So when one magnets does pass, it is 4 steps, not two. (Encoder Mode X4)

Regarding the 2 seconds with a=0.5: Keep in mind, it should be two seconds from full speed (stick=100%), not from the current speed/stick.

Willyfan commented 6 years ago

Yes, I know, but my evaluation take account of this. I have 175 pulse / meters read from the board. A magnet pass every around 12mm, so if I count the magnets pass they are half then the 175 value. I will do some other test with low speed in the morning. I let you know asap. Also stick, I use stick at 100%, I reduced max speed with pot. When you say "full speed" you mean absolute max speed (for example 50000 erpm) or only stick at maximum?

wernerdaehn commented 6 years ago

Reducing the speed with the dial is fine as well. The logic is 100% stick = max_erpm * dial%.

Willyfan commented 6 years ago

I done some test, with erpm at 5000 and also erpm at 10000 because at 5000 is very slow. Speed pot always at max, acc pot at mid (around 0,5). I used autoplay for most test and to take some video, I will upload in some minutes. First of all: I noticed that in autoplay the speed is lower than with stick. With stick the cablecam stop very bad at the endpoint, with erpm at 10000. But as you will see in the video, also in autoplay with erpm at 5000 don't stop well. It seems that the cablecam don't decelerate at all before endpoint, and stop only when it brake. I mean, whne I release the stick I see the camera decelerate. Near to the end point the camera DON'T decelerate, and when speed is slow it stop abrupltly when the endpoint is overshot, with higher speed it brake many times (like a car with abs) and decelerate only becauuse this brake, not the smooth deceleration. Anyway, this is some logs: At 5000 erpm in autoplay mode (note that stick is at 0,675 and not near 1 like when I use the manual stick)

Endpoint brake on. Distance= 125.000, calculated braking distance= abs( 0.675[%] ) / 0.503[%/s] * 190.476[steps/s] / 2 = 129.540
Endpoint overshot. Distance= -1.000, calculated braking distance= abs( 0.262[%] ) / 0.503[%/s] * 88.889[steps/s] / 2 = 23.119

another at 5000 rpm, other direction:

Endpoint brake on. Distance= 128.000, calculated braking distance= abs( -0.675[%] ) / 0.503[%/s] * 190.476[steps/s] / 2 = 129.540
Endpoint overshot. Distance= 0.000, calculated braking distance= abs( -0.252[%] ) / 0.503[%/s] * 88.889[steps/s] / 2 = 22.230

and one test at 10000 ERPM

Endpoint brake on. Distance= 271.000, calculated braking distance= abs( 0.675[%] ) / 0.503[%/s] * 400.000[steps/s] / 2 = 272.034
Endpoint brake on. Distance= 241.000, calculated braking distance= abs( 0.675[%] ) / 0.503[%/s] * 400.000[steps/s] / 2 = 272.034
Endpoint brake on. Distance= 227.000, calculated braking distance= abs( 0.665[%] ) / 0.503[%/s] * 363.636[steps/s] / 2 = 247.304
Endpoint brake on. Distance= 212.000, calculated braking distance= abs( 0.655[%] ) / 0.503[%/s] * 400.000[steps/s] / 2 = 268.034
Endpoint brake on. Distance= 199.000, calculated braking distance= abs( 0.645[%] ) / 0.503[%/s] * 363.636[steps/s] / 2 = 240.031
Endpoint brake on. Distance= 185.000, calculated braking distance= abs( 0.634[%] ) / 0.503[%/s] * 363.636[steps/s] / 2 = 236.395
Endpoint brake on. Distance= 171.000, calculated braking distance= abs( 0.624[%] ) / 0.503[%/s] * 400.000[steps/s] / 2 = 256.034
Endpoint brake on. Distance= 157.000, calculated braking distance= abs( 0.614[%] ) / 0.503[%/s] * 363.636[steps/s] / 2 = 229.122
Endpoint brake on. Distance= 143.000, calculated braking distance= abs( 0.604[%] ) / 0.503[%/s] * 363.636[steps/s] / 2 = 225.485
Endpoint brake on. Distance= 130.000, calculated braking distance= abs( 0.594[%] ) / 0.503[%/s] * 333.333[steps/s] / 2 = 203.362
Endpoint brake on. Distance= 117.000, calculated braking distance= abs( 0.584[%] ) / 0.503[%/s] * 333.333[steps/s] / 2 = 200.028
Emergency brake on. Distance= 104.000, calculated braking distance= abs( 0.574[%] ) / 0.503[%/s] * 363.636[steps/s] / 2 = 214.576
Emergency brake on. Distance= 91.000, calculated braking distance= abs( 0.564[%] ) / 0.503[%/s] * 333.333[steps/s] / 2 = 193.362
Emergency brake on. Distance= 79.000, calculated braking distance= abs( 0.554[%] ) / 0.503[%/s] * 333.333[steps/s] / 2 = 190.028
Emergency brake on. Distance= 67.000, calculated braking distance= abs( 0.544[%] ) / 0.503[%/s] * 307.692[steps/s] / 2 = 172.334
Emergency brake on. Distance= 57.000, calculated braking distance= abs( 0.534[%] ) / 0.503[%/s] * 285.714[steps/s] / 2 = 157.167
Emergency brake on. Distance= 46.000, calculated braking distance= abs( 0.524[%] ) / 0.503[%/s] * 285.714[steps/s] / 2 = 154.310
Emergency brake on. Distance= 35.000, calculated braking distance= abs( 0.514[%] ) / 0.503[%/s] * 266.667[steps/s] / 2 = 136.023
Endpoint brake on. Distance= 27.000, calculated braking distance= abs( 0.504[%] ) / 0.503[%/s] * 235.294[steps/s] / 2 = 117.667
Endpoint brake on. Distance= 19.000, calculated braking distance= abs( 0.493[%] ) / 0.503[%/s] * 200.000[steps/s] / 2 = 98.017
Endpoint brake on. Distance= 11.000, calculated braking distance= abs( 0.483[%] ) / 0.503[%/s] * 222.222[steps/s] / 2 = 106.686
Emergency brake on. Distance= 1.000, calculated braking distance= abs( 0.473[%] ) / 0.503[%/s] * 222.222[steps/s] / 2 = 104.463

for all test I set $d P

Willyfan commented 6 years ago

A important note: in the debug I see the stick value that decreases but non in the right way. For example, in my last test: when endpoint brake start, we are at 271 pulse distance from the endpoint. Stick is at 0,675 (in play mode is max value, I don't know why) and calculate breaking distance is 272, so is ok. But when we are at half distance, for example at 130 pulse from endpoint, I expected that stick is half than start, so around 0,340. Instead, it is at 0,594. It is decreased, but not as we need. Beside, speed calculation have some problems: when endpoint breaking start is at 400.000 step (very strange this number), It decrease at 363,636 but raise again at 400,000 and decrease at 363,636, after that 333.333 and so on. And note that speed decrease only when emergency brake is activated.

wernerdaehn commented 6 years ago

Okay, that gives me something to think about. One suspection I have is around the direction, the $r setting. The cabelcam has to brake when driving towards the endpoint, not away from one.

Can we check that setting one more time? You execute $p. Note the current position. Then you put the stick forward and write down the current position again. And with $i I'd like to know if stick forward is above or below neutral. Finally the value of $r itself.

To me it looks as if you are driving into one direction, say from pos=0 to pos=1000. After a while you have a high speed, one that has a brake distance of 200. And now the brake kicks is because you are only 190 steps away from the start position. But that is the wrong comparison, you are 810 steps away from the end position you are driving towards.

A second test is to manually pull the cablecam over the endpoint. Can you drive it back into the save zone with the stick but not further over the end point? That would indicate that $r is correct.

One thing I will do for sure is add the direction as another information to the end point brake output. Should I do that right away and you update the firmware?

Willyfan commented 6 years ago

Videos: stop at 5000 erpm: https://youtu.be/_DdwgY-AjL8 another stop at 5000 erpm: https://youtu.be/rhBIw9xJVUs stop at 10000 erpm: https://youtu.be/i4BbIEvY5mY

Willyfan commented 6 years ago

A second test is to manually pull the cablecam over the endpoint. Can you drive it back into the save zone with the stick but not further over the end point? That would indicate that $r is correct.

Just done this test, is ok, If I put cablecam over the endpoint I'm able to go only in safe direction

Willyfan commented 6 years ago

Now I do also the other test, But I'm sure that $r is correct, because with $r in other direction the camera don't work at all... And, sure, i will update firmware and test. A question: your cablecam don't have this problems? I have a friend that he built a cablecam like yours, but he had same problems at the endpoint....

wernerdaehn commented 6 years ago

Hm, good point. In my tests I have $r -1. Do you have as well or is $r +1 in your case?

Willyfan commented 6 years ago

I have $r set to +1. I done some other test but I used my app because for some strange reason the terminal raed debug but not command so i don't lost much time. I put the cablecam on the rope, switcht it on and move it slightly by hand check position give me -60 1716 -11 I put stick to to the first end point. Cablecam stop and position check give me -60 1716 -63 In this position cablecam go only to the last endpoint (to right in my set). I put the stick for some second and stop it. Check pos give me -60 1716 515 $i give me for channel 1 the value of 1014 (this is strange because all other channel in mid position give me 992, but I think that this is not the problem). And $r is set to +1, as i just told at begin of this post.

wernerdaehn commented 6 years ago

Okay, I suspect I have a problem in the code when $r +1. I can test that here on the bench myself. Will work on it in the next minutes.

DmitriySurin commented 6 years ago

I have the same problems whitin the regular esc too as discribed above.

wernerdaehn commented 6 years ago

I can't see the problem on my bench test. Can you please try with the firmware I just uploaded. I have added better output when using $d P.

Willyfan commented 6 years ago

please give me one hour and I send you a log.

Willyfan commented 6 years ago

Ok, updated firmware and tried. the logs (always at erpm max 10000, and in manual mode, not autoplay). I done some test without gimbal, and some test with additional weight of gimbal. No gimbal, to left direction

Startpoint brake on. pos-brakedistance= -47663.000 - 563.947 = -48226.945 < -48220.000, braking distance= abs( -0.990[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 563.947
Startpoint brake on. pos-brakedistance= -47736.000 - 563.947 = -48299.945 < -48220.000, braking distance= abs( -0.980[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 563.947
Startpoint emergency brake on. pos-brakedistance= -47762.000 - 558.233 = -48320.234 < -48220.000, braking distance= abs( -0.970[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 558.233

no gimbal to right direction:

Endpoint brake on. pos+brakedistance= -47177.000 + 563.947 = -46613.055 > -46625.000, braking distance= abs( 0.990[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 563.947
Endpoint brake on. pos+brakedistance= -47117.000 + 563.947 = -46553.055 > -46625.000, braking distance= abs( 0.990[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 563.947
Endpoint emergency brake on. pos+brakedistance= -47081.000 + 558.233 = -46522.766 > -46625.000, braking distance= abs( 0.970[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 558.233

with gimbal left direction:

Startpoint brake on. pos-brakedistance= -47667.000 - 563.947 = -48230.945 < -48220.000, braking distance= abs( -0.990[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 563.947
Startpoint emergency brake on. pos-brakedistance= -47823.000 - 501.090 = -48324.090 < -48220.000, braking distance= abs( -0.868[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 501.090

with gimbal right direction:

Endpoint brake on. pos+brakedistance= -47186.000 + 563.947 = -46622.055 > -46625.000, braking distance= abs( 0.990[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 563.947
Endpoint brake on. pos+brakedistance= -47123.000 + 558.233 = -46564.766 > -46625.000, braking distance= abs( 0.970[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 558.233
Endpoint emergency brake on. pos+brakedistance= -47048.000 + 529.661 = -46518.340 > -46625.000, braking distance= abs( 0.919[%] ) / 0.507[%/s] * 571.429[steps/s] / 2 = 529.661

In every test I can see the intervention of the emergency brake (also for the "sound" of motor). As usual, I also test to release the stick in the mid of rope, and camera stop smoothly in around 2 seconds and maybe 3 metres.

Willyfan commented 6 years ago

The strange thing is that speed is always 571.429 step/s. There is something wrong in this.

wernerdaehn commented 6 years ago

Please reduce the accel significantly and also $d P so we can see the intermediate values.

While you are driving the output of $p would be interesting as well as I print out the two speeds, based on the interrupt and based on the pos difference. Maybe that gives an indication if the speed is correct or not and which.

It can be that the speed remains the same. As the speed is primarily the time between two hall pulses (rising flank), if there is no hall puls, the value is not updated. And after 2 seconds I assume a speed=0. Can't see why it should remain 571 for more than two cycles but....

Willyfan commented 6 years ago

I suspect that from bluetooth terminal the command $d P don't work. I try to put command with putty, and I don't switch off the board.

wernerdaehn commented 6 years ago

Also, this might be too much text for the bluetooth connection...

Willyfan commented 6 years ago

It's start to rain, so I had time only for a quick test. But, I solved the problem with terminal (missed carriage return) and put the debug ON Accelerate is at around 0.25. In this situation, when the camera decelerate jump a lot. I have a video for this, i upload it after. You changes something about position, now don't start from zero anymore, a bit dangerous if you try to use same endpoint... Here, two logs, one to right e one to left:

pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.002[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.007[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.012[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.018[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.023[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.028[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.034[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.039[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.044[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.050[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.055[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.060[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.066[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.071[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.076[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.081[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.087[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.092[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659609.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.097[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -659608.000 brakedistance= 0.008 start= -659592.000 end= -657909.000, braking distance= abs( 0.103[%] ) / 0.266[%/s] * 0.042[steps/s] / 2 = 0.008
pospos= -659606.000 brakedistance= 0.032 start= -659592.000 end= -657909.000, braking distance= abs( 0.108[%] ) / 0.266[%/s] * 0.156[steps/s] / 2 = 0.032
pospos= -659604.000 brakedistance= 0.033 start= -659592.000 end= -657909.000, braking distance= abs( 0.113[%] ) / 0.266[%/s] * 0.156[steps/s] / 2 = 0.033
pospos= -659601.000 brakedistance= 11.737 start= -659592.000 end= -657909.000, braking distance= abs( 0.119[%] ) / 0.266[%/s] * 52.632[steps/s] / 2 = 11.737
pospos= -659598.000 brakedistance= 15.534 start= -659592.000 end= -657909.000, braking distance= abs( 0.124[%] ) / 0.266[%/s] * 66.667[steps/s] / 2 = 15.534
pospos= -659595.000 brakedistance= 16.200 start= -659592.000 end= -657909.000, braking distance= abs( 0.129[%] ) / 0.266[%/s] * 66.667[steps/s] / 2 = 16.200
pospos= -659591.000 brakedistance= 18.400 start= -659592.000 end= -657909.000, braking distance= abs( 0.135[%] ) / 0.266[%/s] * 72.727[steps/s] / 2 = 18.400
pospos= -659588.000 brakedistance= 19.849 start= -659592.000 end= -657909.000, braking distance= abs( 0.140[%] ) / 0.266[%/s] * 75.472[steps/s] / 2 = 19.849
pospos= -659584.000 brakedistance= 22.286 start= -659592.000 end= -657909.000, braking distance= abs( 0.145[%] ) / 0.266[%/s] * 81.633[steps/s] / 2 = 22.286
pospos= -659579.000 brakedistance= 24.609 start= -659592.000 end= -657909.000, braking distance= abs( 0.151[%] ) / 0.266[%/s] * 86.957[steps/s] / 2 = 24.609
pospos= -659575.000 brakedistance= 26.637 start= -659592.000 end= -657909.000, braking distance= abs( 0.156[%] ) / 0.266[%/s] * 90.909[steps/s] / 2 = 26.637
pospos= -659571.000 brakedistance= 26.934 start= -659592.000 end= -657909.000, braking distance= abs( 0.161[%] ) / 0.266[%/s] * 88.889[steps/s] / 2 = 26.934
pospos= -659566.000 brakedistance= 31.300 start= -659592.000 end= -657909.000, braking distance= abs( 0.167[%] ) / 0.266[%/s] * 100.000[steps/s] / 2 = 31.300
pospos= -659562.000 brakedistance= 34.919 start= -659592.000 end= -657909.000, braking distance= abs( 0.172[%] ) / 0.266[%/s] * 108.108[steps/s] / 2 = 34.919
pospos= -659556.000 brakedistance= 36.000 start= -659592.000 end= -657909.000, braking distance= abs( 0.177[%] ) / 0.266[%/s] * 108.108[steps/s] / 2 = 36.000
pospos= -659551.000 brakedistance= 38.112 start= -659592.000 end= -657909.000, braking distance= abs( 0.183[%] ) / 0.266[%/s] * 111.111[steps/s] / 2 = 38.112
pospos= -659546.000 brakedistance= 41.530 start= -659592.000 end= -657909.000, braking distance= abs( 0.188[%] ) / 0.266[%/s] * 117.647[steps/s] / 2 = 41.530
pospos= -659540.000 brakedistance= 41.486 start= -659592.000 end= -657909.000, braking distance= abs( 0.193[%] ) / 0.266[%/s] * 114.286[steps/s] / 2 = 41.486
pospos= -659534.000 brakedistance= 48.130 start= -659592.000 end= -657909.000, braking distance= abs( 0.199[%] ) / 0.266[%/s] * 129.032[steps/s] / 2 = 48.130
pospos= -659528.000 brakedistance= 49.420 start= -659592.000 end= -657909.000, braking distance= abs( 0.204[%] ) / 0.266[%/s] * 129.032[steps/s] / 2 = 49.420
pospos= -659522.000 brakedistance= 49.126 start= -659592.000 end= -657909.000, braking distance= abs( 0.209[%] ) / 0.266[%/s] * 125.000[steps/s] / 2 = 49.126
pospos= -659516.000 brakedistance= 53.734 start= -659592.000 end= -657909.000, braking distance= abs( 0.215[%] ) / 0.266[%/s] * 133.333[steps/s] / 2 = 53.734
pospos= -659509.000 brakedistance= 59.001 start= -659592.000 end= -657909.000, braking distance= abs( 0.220[%] ) / 0.266[%/s] * 142.857[steps/s] / 2 = 59.001
pospos= -659502.000 brakedistance= 60.429 start= -659592.000 end= -657909.000, braking distance= abs( 0.225[%] ) / 0.266[%/s] * 142.857[steps/s] / 2 = 60.429
pospos= -659496.000 brakedistance= 61.858 start= -659592.000 end= -657909.000, braking distance= abs( 0.231[%] ) / 0.266[%/s] * 142.857[steps/s] / 2 = 61.858
pospos= -659489.000 brakedistance= 65.630 start= -659592.000 end= -657909.000, braking distance= abs( 0.236[%] ) / 0.266[%/s] * 148.148[steps/s] / 2 = 65.630
pospos= -659482.000 brakedistance= 69.693 start= -659592.000 end= -657909.000, braking distance= abs( 0.241[%] ) / 0.266[%/s] * 153.846[steps/s] / 2 = 69.693
pospos= -659475.000 brakedistance= 68.593 start= -659592.000 end= -657909.000, braking distance= abs( 0.247[%] ) / 0.266[%/s] * 148.148[steps/s] / 2 = 68.593
pospos= -659467.000 brakedistance= 75.681 start= -659592.000 end= -657909.000, braking distance= abs( 0.252[%] ) / 0.266[%/s] * 160.000[steps/s] / 2 = 75.681
pospos= -659460.000 brakedistance= 80.501 start= -659592.000 end= -657909.000, braking distance= abs( 0.257[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 80.501
pospos= -659452.000 brakedistance= 82.167 start= -659592.000 end= -657909.000, braking distance= abs( 0.263[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 82.167
pospos= -659444.000 brakedistance= 83.834 start= -659592.000 end= -657909.000, braking distance= abs( 0.268[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 83.834
pospos= -659436.000 brakedistance= 89.218 start= -659592.000 end= -657909.000, braking distance= abs( 0.273[%] ) / 0.266[%/s] * 173.913[steps/s] / 2 = 89.218
pospos= -659428.000 brakedistance= 90.957 start= -659592.000 end= -657909.000, braking distance= abs( 0.279[%] ) / 0.266[%/s] * 173.913[steps/s] / 2 = 90.957
pospos= -659419.000 brakedistance= 96.910 start= -659592.000 end= -657909.000, braking distance= abs( 0.284[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 96.910
pospos= -659410.000 brakedistance= 103.429 start= -659592.000 end= -657909.000, braking distance= abs( 0.289[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 103.429
pospos= -659401.000 brakedistance= 105.334 start= -659592.000 end= -657909.000, braking distance= abs( 0.295[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 105.334
pospos= -659392.000 brakedistance= 107.239 start= -659592.000 end= -657909.000, braking distance= abs( 0.300[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 107.239
pospos= -659383.000 brakedistance= 109.144 start= -659592.000 end= -657909.000, braking distance= abs( 0.305[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 109.144
pospos= -659374.000 brakedistance= 116.601 start= -659592.000 end= -657909.000, braking distance= abs( 0.311[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 116.601
pospos= -659364.000 brakedistance= 124.843 start= -659592.000 end= -657909.000, braking distance= abs( 0.316[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 124.843
pospos= -659354.000 brakedistance= 126.948 start= -659592.000 end= -657909.000, braking distance= abs( 0.321[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 126.948
pospos= -659344.000 brakedistance= 129.054 start= -659592.000 end= -657909.000, braking distance= abs( 0.326[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 129.054
pospos= -659334.000 brakedistance= 131.159 start= -659592.000 end= -657909.000, braking distance= abs( 0.332[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 131.159
pospos= -659323.000 brakedistance= 140.668 start= -659592.000 end= -657909.000, braking distance= abs( 0.337[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 140.668
pospos= -659312.000 brakedistance= 151.295 start= -659592.000 end= -657909.000, braking distance= abs( 0.342[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 151.295
pospos= -659302.000 brakedistance= 137.475 start= -659592.000 end= -657909.000, braking distance= abs( 0.348[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 137.475
pospos= -659291.000 brakedistance= 156.001 start= -659592.000 end= -657909.000, braking distance= abs( 0.353[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 156.001
pospos= -659280.000 brakedistance= 158.354 start= -659592.000 end= -657909.000, braking distance= abs( 0.358[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 158.354
pospos= -659269.000 brakedistance= 170.751 start= -659592.000 end= -657909.000, braking distance= abs( 0.364[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 170.751
pospos= -659258.000 brakedistance= 163.060 start= -659592.000 end= -657909.000, braking distance= abs( 0.369[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 163.060
pospos= -659246.000 brakedistance= 165.413 start= -659592.000 end= -657909.000, braking distance= abs( 0.374[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 165.413
pospos= -659234.000 brakedistance= 167.766 start= -659592.000 end= -657909.000, braking distance= abs( 0.380[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 167.766
pospos= -659222.000 brakedistance= 180.751 start= -659592.000 end= -657909.000, braking distance= abs( 0.385[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 180.751
pospos= -659210.000 brakedistance= 195.468 start= -659592.000 end= -657909.000, braking distance= abs( 0.390[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 195.468
pospos= -659198.000 brakedistance= 198.135 start= -659592.000 end= -657909.000, braking distance= abs( 0.396[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 198.135
pospos= -659186.000 brakedistance= 200.801 start= -659592.000 end= -657909.000, braking distance= abs( 0.401[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 200.801
pospos= -659173.000 brakedistance= 203.468 start= -659592.000 end= -657909.000, braking distance= abs( 0.406[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 203.468
pospos= -659160.000 brakedistance= 206.135 start= -659592.000 end= -657909.000, braking distance= abs( 0.412[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 206.135
pospos= -659147.000 brakedistance= 208.801 start= -659592.000 end= -657909.000, braking distance= abs( 0.417[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 208.801
pospos= -659134.000 brakedistance= 226.573 start= -659592.000 end= -657909.000, braking distance= abs( 0.422[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 226.573
pospos= -659120.000 brakedistance= 229.430 start= -659592.000 end= -657909.000, braking distance= abs( 0.428[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 229.430
pospos= -659107.000 brakedistance= 216.801 start= -659592.000 end= -657909.000, braking distance= abs( 0.433[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 216.801
pospos= -659094.000 brakedistance= 235.144 start= -659592.000 end= -657909.000, braking distance= abs( 0.438[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 235.144
pospos= -659080.000 brakedistance= 238.001 start= -659592.000 end= -657909.000, braking distance= abs( 0.444[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 238.001
pospos= -659066.000 brakedistance= 240.858 start= -659592.000 end= -657909.000, braking distance= abs( 0.449[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 240.858
pospos= -659052.000 brakedistance= 262.463 start= -659592.000 end= -657909.000, braking distance= abs( 0.454[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 262.463
pospos= -659038.000 brakedistance= 265.540 start= -659592.000 end= -657909.000, braking distance= abs( 0.460[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 265.540
pospos= -659023.000 brakedistance= 268.617 start= -659592.000 end= -657909.000, braking distance= abs( 0.465[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 268.617
pospos= -659009.000 brakedistance= 271.694 start= -659592.000 end= -657909.000, braking distance= abs( 0.470[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 271.694
pospos= -658994.000 brakedistance= 274.771 start= -659592.000 end= -657909.000, braking distance= abs( 0.476[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 274.771
pospos= -658979.000 brakedistance= 277.848 start= -659592.000 end= -657909.000, braking distance= abs( 0.481[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 277.848
pospos= -658964.000 brakedistance= 280.924 start= -659592.000 end= -657909.000, braking distance= abs( 0.486[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 280.924
pospos= -658948.000 brakedistance= 307.668 start= -659592.000 end= -657909.000, braking distance= abs( 0.492[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 307.668
pospos= -658933.000 brakedistance= 311.001 start= -659592.000 end= -657909.000, braking distance= abs( 0.497[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 311.001
pospos= -658918.000 brakedistance= 342.911 start= -659592.000 end= -657909.000, braking distance= abs( 0.502[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 342.911
pospos= -658902.000 brakedistance= 317.668 start= -659592.000 end= -657909.000, braking distance= abs( 0.508[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 317.668
pospos= -658886.000 brakedistance= 350.183 start= -659592.000 end= -657909.000, braking distance= abs( 0.513[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 350.183
pospos= -658869.000 brakedistance= 353.820 start= -659592.000 end= -657909.000, braking distance= abs( 0.518[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 353.820
pospos= -658852.000 brakedistance= 327.668 start= -659592.000 end= -657909.000, braking distance= abs( 0.524[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 327.668
pospos= -658836.000 brakedistance= 361.092 start= -659592.000 end= -657909.000, braking distance= abs( 0.529[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 361.092
pospos= -658819.000 brakedistance= 364.729 start= -659592.000 end= -657909.000, braking distance= abs( 0.534[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 364.729
pospos= -658802.000 brakedistance= 368.365 start= -659592.000 end= -657909.000, braking distance= abs( 0.540[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 368.365
pospos= -658784.000 brakedistance= 409.202 start= -659592.000 end= -657909.000, braking distance= abs( 0.545[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 409.202
pospos= -658768.000 brakedistance= 375.638 start= -659592.000 end= -657909.000, braking distance= abs( 0.550[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 375.638
pospos= -658750.000 brakedistance= 379.274 start= -659592.000 end= -657909.000, braking distance= abs( 0.556[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 379.274
pospos= -658732.000 brakedistance= 382.911 start= -659592.000 end= -657909.000, braking distance= abs( 0.561[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 382.911
pospos= -658714.000 brakedistance= 425.202 start= -659592.000 end= -657909.000, braking distance= abs( 0.566[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 425.202
pospos= -658697.000 brakedistance= 429.202 start= -659592.000 end= -657909.000, braking distance= abs( 0.571[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 429.202
pospos= -658678.000 brakedistance= 433.202 start= -659592.000 end= -657909.000, braking distance= abs( 0.577[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 433.202
pospos= -658660.000 brakedistance= 397.456 start= -659592.000 end= -657909.000, braking distance= abs( 0.582[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 397.456
pospos= -658641.000 brakedistance= 441.202 start= -659592.000 end= -657909.000, braking distance= abs( 0.587[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 441.202
pospos= -658622.000 brakedistance= 445.201 start= -659592.000 end= -657909.000, braking distance= abs( 0.593[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 445.201
pospos= -658604.000 brakedistance= 449.201 start= -659592.000 end= -657909.000, braking distance= abs( 0.598[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 449.201
pospos= -658584.000 brakedistance= 453.201 start= -659592.000 end= -657909.000, braking distance= abs( 0.603[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 453.201
pospos= -658565.000 brakedistance= 457.201 start= -659592.000 end= -657909.000, braking distance= abs( 0.609[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 457.201
pospos= -658546.000 brakedistance= 461.201 start= -659592.000 end= -657909.000, braking distance= abs( 0.614[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 461.201
pospos= -658526.000 brakedistance= 516.890 start= -659592.000 end= -657909.000, braking distance= abs( 0.619[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 516.890
pospos= -658507.000 brakedistance= 521.335 start= -659592.000 end= -657909.000, braking distance= abs( 0.625[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 521.335
pospos= -658487.000 brakedistance= 525.779 start= -659592.000 end= -657909.000, braking distance= abs( 0.630[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 525.779
pospos= -658467.000 brakedistance= 477.201 start= -659592.000 end= -657909.000, braking distance= abs( 0.635[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 477.201
pospos= -658446.000 brakedistance= 534.668 start= -659592.000 end= -657909.000, braking distance= abs( 0.641[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 534.668
Endpoint brake on. pos+brakedistance= -658426.000 + 539.113 = -657886.875 > -657909.000, braking distance= abs( 0.635[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 539.113
Endpoint brake on. pos+brakedistance= -658405.000 + 534.668 = -657870.312 > -657909.000, braking distance= abs( 0.630[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 534.668
Endpoint brake on. pos+brakedistance= -658382.000 + 530.224 = -657851.750 > -657909.000, braking distance= abs( 0.625[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 530.224
Endpoint brake on. pos+brakedistance= -658362.000 + 525.779 = -657836.250 > -657909.000, braking distance= abs( 0.619[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 525.779
Endpoint brake on. pos+brakedistance= -658340.000 + 521.335 = -657818.688 > -657909.000, braking distance= abs( 0.614[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 521.335
Endpoint emergency brake on. pos+brakedistance= -658318.000 + 516.890 = -657801.125 > -657909.000, braking distance= abs( 0.609[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 516.890
Endpoint emergency brake on. pos+brakedistance= -658296.000 + 512.446 = -657783.562 > -657909.000, braking distance= abs( 0.603[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 512.446
Endpoint brake on. pos+brakedistance= -658275.000 + 457.201 = -657817.812 > -657909.000, braking distance= abs( 0.598[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 457.201
Endpoint brake on. pos+brakedistance= -658257.000 + 377.668 = -657879.312 > -657909.000, braking distance= abs( 0.593[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 377.668
Endpoint brake on. pos+brakedistance= -658238.000 + 408.365 = -657829.625 > -657909.000, braking distance= abs( 0.587[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 408.365
Endpoint brake on. pos+brakedistance= -658220.000 + 404.729 = -657815.250 > -657909.000, braking distance= abs( 0.582[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 404.729
Endpoint emergency brake on. pos+brakedistance= -658202.000 + 401.092 = -657800.938 > -657909.000, braking distance= abs( 0.577[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 401.092
Endpoint emergency brake on. pos+brakedistance= -658183.000 + 437.202 = -657745.812 > -657909.000, braking distance= abs( 0.571[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 437.202
Endpoint emergency brake on. pos+brakedistance= -658165.000 + 393.820 = -657771.188 > -657909.000, braking distance= abs( 0.566[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 393.820
Endpoint brake on. pos+brakedistance= -658150.000 + 286.134 = -657863.875 > -657909.000, braking distance= abs( 0.561[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 286.134
pospos= -658138.000 brakedistance= 212.601 start= -659592.000 end= -657909.000, braking distance= abs( 0.566[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 212.601
Endpoint brake on. pos+brakedistance= -658129.000 + 225.896 = -657903.125 > -657909.000, braking distance= abs( 0.561[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 225.896
Endpoint brake on. pos+brakedistance= -658117.000 + 283.468 = -657833.562 > -657909.000, braking distance= abs( 0.556[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 283.468
Endpoint emergency brake on. pos+brakedistance= -658103.000 + 300.858 = -657802.125 > -657909.000, braking distance= abs( 0.550[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 300.858
Endpoint emergency brake on. pos+brakedistance= -658086.000 + 320.924 = -657765.062 > -657909.000, braking distance= abs( 0.545[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 320.924
Endpoint emergency brake on. pos+brakedistance= -658070.000 + 317.847 = -657752.125 > -657909.000, braking distance= abs( 0.540[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 317.847
Endpoint emergency brake on. pos+brakedistance= -658055.000 + 272.801 = -657782.188 > -657909.000, braking distance= abs( 0.534[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 272.801
Endpoint emergency brake on. pos+brakedistance= -658042.000 + 238.354 = -657803.625 > -657909.000, braking distance= abs( 0.529[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 238.354
Endpoint brake on. pos+brakedistance= -658032.000 + 200.601 = -657831.375 > -657909.000, braking distance= abs( 0.524[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 200.601
pospos= -658026.000 brakedistance= 116.824 start= -659592.000 end= -657909.000, braking distance= abs( 0.529[%] ) / 0.266[%/s] * 117.647[steps/s] / 2 = 116.824
pospos= -658021.000 brakedistance= 100.300 start= -659592.000 end= -657909.000, braking distance= abs( 0.534[%] ) / 0.266[%/s] * 100.000[steps/s] / 2 = 100.300
Endpoint brake on. pos+brakedistance= -658014.000 + 150.075 = -657863.938 > -657909.000, braking distance= abs( 0.529[%] ) / 0.266[%/s] * 148.148[steps/s] / 2 = 150.075
Endpoint emergency brake on. pos+brakedistance= -658004.000 + 200.601 = -657803.375 > -657909.000, braking distance= abs( 0.524[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 200.601
Endpoint emergency brake on. pos+brakedistance= -657991.000 + 248.251 = -657742.750 > -657909.000, braking distance= abs( 0.518[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 248.251
Endpoint emergency brake on. pos+brakedistance= -657977.000 + 262.135 = -657714.875 > -657909.000, braking distance= abs( 0.513[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 262.135
Endpoint emergency brake on. pos+brakedistance= -657965.000 + 216.223 = -657748.750 > -657909.000, braking distance= abs( 0.508[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 216.223
Endpoint emergency brake on. pos+brakedistance= -657956.000 + 175.092 = -657780.938 > -657909.000, braking distance= abs( 0.502[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 175.092
Endpoint brake on. pos+brakedistance= -657949.000 + 122.968 = -657826.062 > -657909.000, braking distance= abs( 0.497[%] ) / 0.266[%/s] * 129.032[steps/s] / 2 = 122.968
Endpoint brake on. pos+brakedistance= -657946.000 + 72.539 = -657873.438 > -657909.000, braking distance= abs( 0.492[%] ) / 0.266[%/s] * 76.923[steps/s] / 2 = 72.539
Endpoint brake on. pos+brakedistance= -657943.000 + 71.770 = -657871.250 > -657909.000, braking distance= abs( 0.486[%] ) / 0.266[%/s] * 76.923[steps/s] / 2 = 71.770
Endpoint brake on. pos+brakedistance= -657937.000 + 102.556 = -657834.438 > -657909.000, braking distance= abs( 0.481[%] ) / 0.266[%/s] * 111.111[steps/s] / 2 = 102.556
Endpoint emergency brake on. pos+brakedistance= -657928.000 + 166.001 = -657762.000 > -657909.000, braking distance= abs( 0.476[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 166.001
Endpoint emergency brake on. pos+brakedistance= -657918.000 + 212.472 = -657705.500 > -657909.000, braking distance= abs( 0.470[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 212.472

to left:

pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.005[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.011[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.016[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.021[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.027[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.032[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.037[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.043[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.048[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.053[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.059[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.064[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.069[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.075[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.080[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.085[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.091[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657898.000 brakedistance= 0.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.096[%] ) / 0.266[%/s] * 0.000[steps/s] / 2 = 0.000
pospos= -657899.000 brakedistance= 0.006 start= -659592.000 end= -657909.000, braking distance= abs( -0.101[%] ) / 0.266[%/s] * 0.031[steps/s] / 2 = 0.006
pospos= -657900.000 brakedistance= 10.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.107[%] ) / 0.266[%/s] * 50.000[steps/s] / 2 = 10.000
pospos= -657903.000 brakedistance= 0.024 start= -659592.000 end= -657909.000, braking distance= abs( -0.112[%] ) / 0.266[%/s] * 0.116[steps/s] / 2 = 0.024
pospos= -657905.000 brakedistance= 11.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.117[%] ) / 0.266[%/s] * 50.000[steps/s] / 2 = 11.000
pospos= -657908.000 brakedistance= 11.500 start= -659592.000 end= -657909.000, braking distance= abs( -0.122[%] ) / 0.266[%/s] * 50.000[steps/s] / 2 = 11.500
pospos= -657911.000 brakedistance= 13.913 start= -659592.000 end= -657909.000, braking distance= abs( -0.128[%] ) / 0.266[%/s] * 57.971[steps/s] / 2 = 13.913
pospos= -657914.000 brakedistance= 16.393 start= -659592.000 end= -657909.000, braking distance= abs( -0.133[%] ) / 0.266[%/s] * 65.574[steps/s] / 2 = 16.393
pospos= -657918.000 brakedistance= 17.931 start= -659592.000 end= -657909.000, braking distance= abs( -0.138[%] ) / 0.266[%/s] * 68.966[steps/s] / 2 = 17.931
pospos= -657921.000 brakedistance= 20.377 start= -659592.000 end= -657909.000, braking distance= abs( -0.144[%] ) / 0.266[%/s] * 75.472[steps/s] / 2 = 20.377
pospos= -657925.000 brakedistance= 22.400 start= -659592.000 end= -657909.000, braking distance= abs( -0.149[%] ) / 0.266[%/s] * 80.000[steps/s] / 2 = 22.400
pospos= -657929.000 brakedistance= 26.977 start= -659592.000 end= -657909.000, braking distance= abs( -0.154[%] ) / 0.266[%/s] * 93.023[steps/s] / 2 = 26.977
pospos= -657934.000 brakedistance= 29.268 start= -659592.000 end= -657909.000, braking distance= abs( -0.160[%] ) / 0.266[%/s] * 97.561[steps/s] / 2 = 29.268
pospos= -657938.000 brakedistance= 31.795 start= -659592.000 end= -657909.000, braking distance= abs( -0.165[%] ) / 0.266[%/s] * 102.564[steps/s] / 2 = 31.795
pospos= -657943.000 brakedistance= 32.821 start= -659592.000 end= -657909.000, braking distance= abs( -0.170[%] ) / 0.266[%/s] * 102.564[steps/s] / 2 = 32.821
pospos= -657948.000 brakedistance= 33.846 start= -659592.000 end= -657909.000, braking distance= abs( -0.176[%] ) / 0.266[%/s] * 102.564[steps/s] / 2 = 33.846
pospos= -657954.000 brakedistance= 40.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.181[%] ) / 0.266[%/s] * 117.647[steps/s] / 2 = 40.000
pospos= -657959.000 brakedistance= 38.889 start= -659592.000 end= -657909.000, braking distance= abs( -0.186[%] ) / 0.266[%/s] * 111.111[steps/s] / 2 = 38.889
pospos= -657964.000 brakedistance= 42.353 start= -659592.000 end= -657909.000, braking distance= abs( -0.192[%] ) / 0.266[%/s] * 117.647[steps/s] / 2 = 42.353
pospos= -657970.000 brakedistance= 44.848 start= -659592.000 end= -657909.000, braking distance= abs( -0.197[%] ) / 0.266[%/s] * 121.212[steps/s] / 2 = 44.848
pospos= -657976.000 brakedistance= 44.706 start= -659592.000 end= -657909.000, braking distance= abs( -0.202[%] ) / 0.266[%/s] * 117.647[steps/s] / 2 = 44.706
pospos= -657982.000 brakedistance= 52.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.208[%] ) / 0.266[%/s] * 133.333[steps/s] / 2 = 52.000
pospos= -657988.000 brakedistance= 55.172 start= -659592.000 end= -657909.000, braking distance= abs( -0.213[%] ) / 0.266[%/s] * 137.931[steps/s] / 2 = 55.172
pospos= -657995.000 brakedistance= 56.552 start= -659592.000 end= -657909.000, braking distance= abs( -0.218[%] ) / 0.266[%/s] * 137.931[steps/s] / 2 = 56.552
pospos= -658002.000 brakedistance= 62.222 start= -659592.000 end= -657909.000, braking distance= abs( -0.224[%] ) / 0.266[%/s] * 148.148[steps/s] / 2 = 62.222
pospos= -658008.000 brakedistance= 63.704 start= -659592.000 end= -657909.000, braking distance= abs( -0.229[%] ) / 0.266[%/s] * 148.148[steps/s] / 2 = 63.704
pospos= -658015.000 brakedistance= 62.857 start= -659592.000 end= -657909.000, braking distance= abs( -0.234[%] ) / 0.266[%/s] * 142.857[steps/s] / 2 = 62.857
pospos= -658022.000 brakedistance= 69.231 start= -659592.000 end= -657909.000, braking distance= abs( -0.240[%] ) / 0.266[%/s] * 153.846[steps/s] / 2 = 69.231
pospos= -658030.000 brakedistance= 73.600 start= -659592.000 end= -657909.000, braking distance= abs( -0.245[%] ) / 0.266[%/s] * 160.000[steps/s] / 2 = 73.600
pospos= -658038.000 brakedistance= 75.200 start= -659592.000 end= -657909.000, braking distance= abs( -0.250[%] ) / 0.266[%/s] * 160.000[steps/s] / 2 = 75.200
pospos= -658046.000 brakedistance= 80.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.256[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 80.000
pospos= -658054.000 brakedistance= 85.217 start= -659592.000 end= -657909.000, braking distance= abs( -0.261[%] ) / 0.266[%/s] * 173.913[steps/s] / 2 = 85.217
pospos= -658061.000 brakedistance= 83.333 start= -659592.000 end= -657909.000, braking distance= abs( -0.266[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 83.333
pospos= -658070.000 brakedistance= 85.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.272[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 85.000
pospos= -658078.000 brakedistance= 94.545 start= -659592.000 end= -657909.000, braking distance= abs( -0.277[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 94.545
pospos= -658086.000 brakedistance= 96.364 start= -659592.000 end= -657909.000, braking distance= abs( -0.282[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 96.364
pospos= -658096.000 brakedistance= 102.857 start= -659592.000 end= -657909.000, braking distance= abs( -0.288[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 102.857
pospos= -658105.000 brakedistance= 100.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.293[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 100.000
pospos= -658114.000 brakedistance= 106.667 start= -659592.000 end= -657909.000, braking distance= abs( -0.298[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 106.667
pospos= -658123.000 brakedistance= 114.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.304[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 114.000
pospos= -658132.000 brakedistance= 116.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.309[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 116.000
pospos= -658142.000 brakedistance= 118.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.314[%] ) / 0.266[%/s] * 200.000[steps/s] / 2 = 118.000
pospos= -658152.000 brakedistance= 133.333 start= -659592.000 end= -657909.000, braking distance= abs( -0.320[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 133.333
pospos= -658162.000 brakedistance= 128.421 start= -659592.000 end= -657909.000, braking distance= abs( -0.325[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 128.421
pospos= -658173.000 brakedistance= 130.526 start= -659592.000 end= -657909.000, braking distance= abs( -0.330[%] ) / 0.266[%/s] * 210.526[steps/s] / 2 = 130.526
pospos= -658183.000 brakedistance= 140.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.336[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 140.000
pospos= -658194.000 brakedistance= 150.588 start= -659592.000 end= -657909.000, braking distance= abs( -0.341[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 150.588
pospos= -658205.000 brakedistance= 144.445 start= -659592.000 end= -657909.000, braking distance= abs( -0.346[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 144.445
pospos= -658216.000 brakedistance= 155.294 start= -659592.000 end= -657909.000, braking distance= abs( -0.352[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 155.294
pospos= -658227.000 brakedistance= 157.647 start= -659592.000 end= -657909.000, braking distance= abs( -0.357[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 157.647
pospos= -658238.000 brakedistance= 170.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.362[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 170.000
pospos= -658250.000 brakedistance= 184.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.367[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 184.000
pospos= -658262.000 brakedistance= 175.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.373[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 175.000
pospos= -658274.000 brakedistance= 177.500 start= -659592.000 end= -657909.000, braking distance= abs( -0.378[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 177.500
pospos= -658286.000 brakedistance= 192.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.383[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 192.000
pospos= -658298.000 brakedistance= 194.667 start= -659592.000 end= -657909.000, braking distance= abs( -0.389[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 194.667
pospos= -658311.000 brakedistance= 185.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.394[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 185.000
pospos= -658324.000 brakedistance= 214.286 start= -659592.000 end= -657909.000, braking distance= abs( -0.399[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 214.286
pospos= -658337.000 brakedistance= 233.846 start= -659592.000 end= -657909.000, braking distance= abs( -0.405[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 233.846
pospos= -658350.000 brakedistance= 205.333 start= -659592.000 end= -657909.000, braking distance= abs( -0.410[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 205.333
pospos= -658363.000 brakedistance= 222.857 start= -659592.000 end= -657909.000, braking distance= abs( -0.415[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 222.857
pospos= -658376.000 brakedistance= 210.667 start= -659592.000 end= -657909.000, braking distance= abs( -0.421[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 210.667
pospos= -658390.000 brakedistance= 246.154 start= -659592.000 end= -657909.000, braking distance= abs( -0.426[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 246.154
pospos= -658404.000 brakedistance= 249.231 start= -659592.000 end= -657909.000, braking distance= abs( -0.431[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 249.231
pospos= -658418.000 brakedistance= 252.308 start= -659592.000 end= -657909.000, braking distance= abs( -0.437[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 252.308
pospos= -658431.000 brakedistance= 237.143 start= -659592.000 end= -657909.000, braking distance= abs( -0.442[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 237.143
pospos= -658446.000 brakedistance= 240.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.447[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 240.000
pospos= -658460.000 brakedistance= 242.857 start= -659592.000 end= -657909.000, braking distance= abs( -0.453[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 242.857
pospos= -658474.000 brakedistance= 264.615 start= -659592.000 end= -657909.000, braking distance= abs( -0.458[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 264.615
pospos= -658490.000 brakedistance= 267.692 start= -659592.000 end= -657909.000, braking distance= abs( -0.463[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 267.692
pospos= -658505.000 brakedistance= 293.333 start= -659592.000 end= -657909.000, braking distance= abs( -0.469[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 293.333
pospos= -658519.000 brakedistance= 254.286 start= -659592.000 end= -657909.000, braking distance= abs( -0.474[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 254.286
pospos= -658535.000 brakedistance= 300.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.479[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 300.000
pospos= -658550.000 brakedistance= 303.333 start= -659592.000 end= -657909.000, braking distance= abs( -0.485[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 303.333
pospos= -658566.000 brakedistance= 306.667 start= -659592.000 end= -657909.000, braking distance= abs( -0.490[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 306.667
pospos= -658582.000 brakedistance= 338.182 start= -659592.000 end= -657909.000, braking distance= abs( -0.495[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 338.182
pospos= -658598.000 brakedistance= 341.818 start= -659592.000 end= -657909.000, braking distance= abs( -0.501[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 341.818
pospos= -658614.000 brakedistance= 316.667 start= -659592.000 end= -657909.000, braking distance= abs( -0.506[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 316.667
pospos= -658630.000 brakedistance= 349.091 start= -659592.000 end= -657909.000, braking distance= abs( -0.511[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 349.091
pospos= -658647.000 brakedistance= 352.727 start= -659592.000 end= -657909.000, braking distance= abs( -0.517[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 352.727
pospos= -658663.000 brakedistance= 326.667 start= -659592.000 end= -657909.000, braking distance= abs( -0.522[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 326.667
pospos= -658680.000 brakedistance= 360.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.527[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 360.000
pospos= -658698.000 brakedistance= 363.636 start= -659592.000 end= -657909.000, braking distance= abs( -0.533[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 363.636
pospos= -658714.000 brakedistance= 367.273 start= -659592.000 end= -657909.000, braking distance= abs( -0.538[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 367.273
pospos= -658732.000 brakedistance= 370.909 start= -659592.000 end= -657909.000, braking distance= abs( -0.543[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 370.909
pospos= -658750.000 brakedistance= 374.545 start= -659592.000 end= -657909.000, braking distance= abs( -0.549[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 374.545
pospos= -658767.000 brakedistance= 378.182 start= -659592.000 end= -657909.000, braking distance= abs( -0.554[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 378.182
pospos= -658785.000 brakedistance= 420.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.559[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 420.000
pospos= -658804.000 brakedistance= 424.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.565[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 424.000
pospos= -658822.000 brakedistance= 428.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.570[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 428.000
pospos= -658840.000 brakedistance= 432.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.575[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 432.000
pospos= -658858.000 brakedistance= 396.363 start= -659592.000 end= -657909.000, braking distance= abs( -0.581[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 396.363
pospos= -658877.000 brakedistance= 400.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.586[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 400.000
pospos= -658896.000 brakedistance= 444.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.591[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 444.000
pospos= -658915.000 brakedistance= 497.778 start= -659592.000 end= -657909.000, braking distance= abs( -0.597[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 497.778
pospos= -658934.000 brakedistance= 452.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.602[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 452.000
pospos= -658953.000 brakedistance= 456.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.607[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 456.000
pospos= -658973.000 brakedistance= 460.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.612[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 460.000
pospos= -658992.000 brakedistance= 515.555 start= -659592.000 end= -657909.000, braking distance= abs( -0.618[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 515.555
pospos= -659012.000 brakedistance= 520.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.623[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 520.000
pospos= -659032.000 brakedistance= 524.444 start= -659592.000 end= -657909.000, braking distance= abs( -0.628[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 524.444
pospos= -659052.000 brakedistance= 476.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.634[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 476.000
pospos= -659073.000 brakedistance= 480.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.639[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 480.000
pospos= -659093.000 brakedistance= 484.000 start= -659592.000 end= -657909.000, braking distance= abs( -0.644[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 484.000
Startpoint brake on. pos-brakedistance= -659113.000 - 542.222 = -659655.250 < -659592.000, braking distance= abs( -0.639[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 542.222
Startpoint emergency brake on. pos-brakedistance= -659135.000 - 605.000 = -659740.000 < -659592.000, braking distance= abs( -0.634[%] ) / 0.266[%/s] * 500.000[steps/s] / 2 = 605.000
Startpoint brake on. pos-brakedistance= -659158.000 - 533.333 = -659691.312 < -659592.000, braking distance= abs( -0.628[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 533.333
Startpoint emergency brake on. pos-brakedistance= -659180.000 - 528.888 = -659708.875 < -659592.000, braking distance= abs( -0.623[%] ) / 0.266[%/s] * 444.444[steps/s] / 2 = 528.888
Startpoint brake on. pos-brakedistance= -659202.000 - 472.000 = -659674.000 < -659592.000, braking distance= abs( -0.618[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 472.000
Startpoint brake on. pos-brakedistance= -659221.000 - 425.454 = -659646.438 < -659592.000, braking distance= abs( -0.612[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 425.454
Startpoint brake on. pos-brakedistance= -659240.000 - 421.818 = -659661.812 < -659592.000, braking distance= abs( -0.607[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 421.818
Startpoint brake on. pos-brakedistance= -659258.000 - 418.182 = -659676.188 < -659592.000, braking distance= abs( -0.602[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 418.182
Startpoint emergency brake on. pos-brakedistance= -659278.000 - 456.000 = -659734.000 < -659592.000, braking distance= abs( -0.597[%] ) / 0.266[%/s] * 400.000[steps/s] / 2 = 456.000
Startpoint emergency brake on. pos-brakedistance= -659297.000 - 410.909 = -659707.938 < -659592.000, braking distance= abs( -0.591[%] ) / 0.266[%/s] * 363.636[steps/s] / 2 = 410.909
Startpoint brake on. pos-brakedistance= -659315.000 - 344.615 = -659659.625 < -659592.000, braking distance= abs( -0.586[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 344.615
Startpoint brake on. pos-brakedistance= -659330.000 - 317.143 = -659647.125 < -659592.000, braking distance= abs( -0.581[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 317.143
Startpoint brake on. pos-brakedistance= -659344.000 - 314.286 = -659658.312 < -659592.000, braking distance= abs( -0.575[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 314.286
Startpoint emergency brake on. pos-brakedistance= -659360.000 - 335.384 = -659695.375 < -659592.000, braking distance= abs( -0.570[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 335.384
Startpoint emergency brake on. pos-brakedistance= -659377.000 - 360.000 = -659737.000 < -659592.000, braking distance= abs( -0.565[%] ) / 0.266[%/s] * 333.333[steps/s] / 2 = 360.000
Startpoint emergency brake on. pos-brakedistance= -659393.000 - 305.714 = -659698.688 < -659592.000, braking distance= abs( -0.559[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 305.714
Startpoint brake on. pos-brakedistance= -659405.000 - 201.905 = -659606.875 < -659592.000, braking distance= abs( -0.554[%] ) / 0.266[%/s] * 190.476[steps/s] / 2 = 201.905
pospos= -659413.000 brakedistance= 144.828 start= -659592.000 end= -657909.000, braking distance= abs( -0.559[%] ) / 0.266[%/s] * 137.931[steps/s] / 2 = 144.828
pospos= -659419.000 brakedistance= 141.333 start= -659592.000 end= -657909.000, braking distance= abs( -0.565[%] ) / 0.266[%/s] * 133.333[steps/s] / 2 = 141.333
Startpoint brake on. pos-brakedistance= -659428.000 - 194.545 = -659622.562 < -659592.000, braking distance= abs( -0.559[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 194.545
Startpoint brake on. pos-brakedistance= -659439.000 - 235.556 = -659674.562 < -659592.000, braking distance= abs( -0.554[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 235.556
Startpoint emergency brake on. pos-brakedistance= -659452.000 - 280.000 = -659732.000 < -659592.000, braking distance= abs( -0.549[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 280.000
Startpoint emergency brake on. pos-brakedistance= -659469.000 - 320.000 = -659789.000 < -659592.000, braking distance= abs( -0.543[%] ) / 0.266[%/s] * 307.692[steps/s] / 2 = 320.000
Startpoint emergency brake on. pos-brakedistance= -659486.000 - 294.286 = -659780.312 < -659592.000, braking distance= abs( -0.538[%] ) / 0.266[%/s] * 285.714[steps/s] / 2 = 294.286
Startpoint emergency brake on. pos-brakedistance= -659500.000 - 272.000 = -659772.000 < -659592.000, braking distance= abs( -0.533[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 272.000
Startpoint emergency brake on. pos-brakedistance= -659512.000 - 237.647 = -659749.625 < -659592.000, braking distance= abs( -0.527[%] ) / 0.266[%/s] * 235.294[steps/s] / 2 = 237.647
Startpoint brake on. pos-brakedistance= -659522.000 - 166.667 = -659688.688 < -659592.000, braking distance= abs( -0.522[%] ) / 0.266[%/s] * 166.667[steps/s] / 2 = 166.667
Startpoint brake on. pos-brakedistance= -659527.000 - 123.750 = -659650.750 < -659592.000, braking distance= abs( -0.517[%] ) / 0.266[%/s] * 125.000[steps/s] / 2 = 123.750
Startpoint brake on. pos-brakedistance= -659532.000 - 78.400 = -659610.375 < -659592.000, braking distance= abs( -0.511[%] ) / 0.266[%/s] * 80.000[steps/s] / 2 = 78.400
Startpoint brake on. pos-brakedistance= -659539.000 - 143.704 = -659682.688 < -659592.000, braking distance= abs( -0.506[%] ) / 0.266[%/s] * 148.148[steps/s] / 2 = 143.704
Startpoint emergency brake on. pos-brakedistance= -659548.000 - 174.546 = -659722.562 < -659592.000, braking distance= abs( -0.501[%] ) / 0.266[%/s] * 181.818[steps/s] / 2 = 174.546
Startpoint emergency brake on. pos-brakedistance= -659562.000 - 253.333 = -659815.312 < -659592.000, braking distance= abs( -0.495[%] ) / 0.266[%/s] * 266.667[steps/s] / 2 = 253.333
Startpoint emergency brake on. pos-brakedistance= -659575.000 - 235.000 = -659810.000 < -659592.000, braking distance= abs( -0.490[%] ) / 0.266[%/s] * 250.000[steps/s] / 2 = 235.000
Startpoint emergency brake on. pos-brakedistance= -659588.000 - 206.667 = -659794.688 < -659592.000, braking distance= abs( -0.485[%] ) / 0.266[%/s] * 222.222[steps/s] / 2 = 206.667
wernerdaehn commented 6 years ago

I definitiely don't like the speed reading. Let me revert that back to pos-difference only.

Regarding the "you don't start at zero" we need to keep an eye out. There should not be a difference to before. I certainly don't store the current position anywhere. The only thing that can change the position is when switching $r. Because then the current position is inverted. I'll upload the revised code in a minute.