xinyue-ash / FlexibitWorkshopTool

Visual programming for Arduino. Based on blockly, implements Arduino code generation and facilitates program uploading.
http://ardublockly.embeddedlog.com
Apache License 2.0
0 stars 0 forks source link

Fix time precision #6

Closed xinyue-ash closed 1 month ago

xinyue-ash commented 1 month ago

Tested on multiple target with angle + duration config, if several targets in one sequence, then servo will not stop after (faster) intended duration.

Issue: due to the rounding when calculate speed ( duration / angle) , also the rounding of ellipse time check, as million returns unsign long.

Solution: ~~1. using a fix point arithmetic (AKA store speed as speed * 1000 to preserve the precision)

  1. check the total duration of sequence, instead of checking the time between each degree
xinyue-ash commented 1 month ago

that PR is cancel due to the bug