Nopeusprofiilin generointi liikkuvalle robotille
Lehkonen, Veini (2021)
Lehkonen, Veini
2021
Tietotekniikan DI-ohjelma - Master's Programme in Information Technology
Informaatioteknologian ja viestinnän tiedekunta - Faculty of Information Technology and Communication Sciences
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2021-05-26
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tuni-202105245381
https://urn.fi/URN:NBN:fi:tuni-202105245381
Tiivistelmä
Nopeusprofiili on kuvaus esineen nopeudesta suhteessa aikaan tai esineen tekemään matkaan. Automaattisesti liikkuva robotti voi käyttää nopeusprofiilia nopeutensa asetusarvoina ja ohjata näin omaa liikettään. Tässä työssä esitellään algoritmi, joka laatii nopeusprofiilin reitin nopeusrajojen ja robotin kiihtyvyys- ja nykäysrajoitusten perusteella. Nopeusprofiilin tuottava algoritmi eli nopeusprofiiligeneraattori on osa liikkuvan robotin laajempaa automaatio-ohjelmistoa. Ohjelmiston nykyinen generaattori on monimutkainen ja siitä on löydetty hankalasti jäljitettäviä virheitä. Se halutaan korvata uudella toteutuksella, joka on helpompi ymmärtää ja ylläpitää.
Nopeusprofiilin suunnitteluun tarvitaan tietoja reitistä ja robotin ominaisuuksista. Reitin ominaisuudet voidaan yksinkertaistaa nopeusrajoiksi, joita robotin tulee noudattaa. Robotin ominaisuudet voidaan yksinkertaistaa kiihtyvyys- ja nykäysrajoituksiksi. Esimerkiksi mitä raskaampi robotti on, sitä pidempi aika siltä kuluu kiihdyttämiseen tai hidastamiseen eli nopeutensa muuttamiseen, jos sen moottorin teho on sama. Nykäysrajoitukset rajoittavat kiihtyvyyden muuttumista; jos nykäystä ei rajoiteta, robotin liikkuvat osat voivat iskeytyä toisiaan vasten ja aiheuttaa kulumista.
Automaatio-ohjelmiston nykyinen nopeusprofiiligeneraattori tuottaa ja esittää nopeusprofiilin analyyttisesti eli laskukaavoina. Profiilin voi esittää myös näytejonona, ja sen voi tuottaa yksi näyte kerrallaan. Tässä työssä esitellään erilaisia nopeusprofiilin tuottavia algoritmeja, joita arvioidaan niiden ominaisuuksien perusteella. Yksi niistä valitaan toteutettavaksi ja analysoitavaksi.
Uusi nopeusprofiiligeneraattori kirjoitetaan Haskellilla ja se esittää nopeusprofiilin näytejonona. Uusi algoritmi valitaan pääasiassa sen yksinkertaisuuden vuoksi: se tuottaa profiilin nostamalla näytteiden nopeuksia vähitellen, kunnes ne ovat mahdollisimman suuria ja noudattavat kaikkia rajoituksia. Profiili laaditaan siis iteroimalla: Alussa se tekee profiilin, jonka kaikki nopeudet ovat nollia. Sitten se käy profiilin näyte kerrallaan läpi monta kertaa ja yrittää nostaa nopeuksia niin, että ne vielä noudattavat nopeusrajoja ja kiihtyvyys- ja nykäysrajoituksia. Koska profiilia muokataan aikatasossa, nopeusrajat siirtyvät, kun profiilin nopeus muuttuu. Näin ollen näytteiden nopeuksia joudutaan joskus myös vähentämään.
Uutta nopeusprofiiligeneraattoria testataan erilaisilla rajoituksilla. Sen tuottamat profiilit esitetään kuvaajissa, joista sen toimintaa voi arvioida. Algoritmi tuottaa suhteellisen järkevän näköisiä profiileja. Se nostaa yksittäisen näytteen nopeuden niin suureksi kuin mahdollista, vaikka seuraavien näytteiden nopeuksia joudutaan vähentämään. Tämä toimintaperiaate aiheuttaa profiiliin aaltoilua, joka loppuu, kun algoritmin annetaan vain joko nostaa tai vähentää nopeuksia samalla kierroksella. Nopeusrajojen siirtyminen voi aiheuttaa tilanteen, jossa jokin näyte haluaa nostaa nopeuttaan, vaikka sen pitäisi vähentää sitä, koska osa sen viereisistä näytteistä rikkoo omia nopeusrajojaan. Kun algoritmin annetaan vähentää nopeuksia, vaikka se aiheuttaisikin lievää rajoitusten rikkomista, ongelma korjaantuu. Rikkomukset profiilissa korjaantuvat myöhemmillä iteraatioilla. Nopeusrajojen siirtymisen takia varsinkin reitin loppupuolen nopeudet ovat pitkään jatkuvassa muutoksessa. Ongelma on lievempi, jos reitillä on vähemmän nopeusrajoja.
Uusi nopeusprofiiligeneraattori pystyy tuottamaan käyttökelpoisia nopeusprofiileja, mutta se tarvitsee vielä vähän jatkokehitystä. Se pitää integroida laajempaan automaatio-ohjelmistoon, ja pitää varmistaa, että se kykenee saamaan profiilin valmiiksi. Profiilin valmistumiseen tarvittavien iteraatioden määrää olisi hyvä vähentää. A velocity profile presents velocity of an object as a function of time or distance travelled by the object. A mobile robot can control its movement by using a velocity profile as its velocity setpoints. This thesis is about a new velocity profile generation algorithm that uses restrictions on acceleration and jerk and a velocity limit function to compute a velocity profile. The new velocity profile generator will replace the existing generator of robot control software. The existing generator is complicated and contains errors that are difficult to trace, so the goal is to make a simpler implementation that is easier to maintain.
The velocity profile generator needs information about the robot and its route to make a velocity profile. A velocity limit function is a simplification of the properties of a route. Acceleration and jerk restrictions are a simplification of the robot's properties. For example, if the output of its motor is the same, a heavier robot needs a longer time to accelerate or decelerate. Restricting jerk is important in order to reduce wear and impacts between any moving parts of the robot.
The robot control software's current velocity profile generator creates and presents velocity profiles analytically. A profile can also be made a sample at a time and comprise a sample sequence. This thesis introduces several different algorithms for velocity profile generation and compares them. One of them is chosen for implementation and analysis.
The new velocity profile generator is written with Haskell and presents velocity profiles as sample sequences. The new algorithm generates a velocity profile by simply iterating through the profile's samples and gradually increasing the velocities until they are as high as possible while still adhering to the restrictions on acceleration and jerk. At start, the generator makes a zero velocity profile. Then it goes through the profile one sample at a time multiple times and tries to increase the velocities without breaking any limitations. Since the profile is handled as a function of time, the places of the velocity limits change as the profile's velocities change. Therefore, the generator must also decrease the velocities of the samples sometimes.
Testing of the new velocity profile generator is conducted by giving it several different limitations. The velocity profiles it creates are presented as graphs from which its functionality can be evaluated. The algorithm produces mostly sensible profiles. It increases the velocity of any given sample as high as possible, even if later samples would need to decrease their velocities. This functionality causes oscillations in the profile. To remove them, the algorithm is modified so that on any given iteration, it will only either increase or decrease the velocities. The changing of the velocity limits can cause a sample to be stuck in a place where it wants to increase its velocity but instead it should further decrease its velocity because nearby samples are breaking their velocity limits. To remove this problem, the algorithm is modified to allow to decrease velocities even if doing so causes some limitations to be broken. Further iterations of the profile will fix the broken limitations. The changing of the velocity limits also causes the later end of the profile to constantly change. Having less velocity limits on the route mitigates this problem.
The new velocity profile generator can produce usable velocity profiles but it does need some further development. It needs to be integrated into the robot control software. It needs a verification method to check that it actually completes the wanted profile. It would be beneficial to reduce the amount of iterations needed to complete a profile.
Nopeusprofiilin suunnitteluun tarvitaan tietoja reitistä ja robotin ominaisuuksista. Reitin ominaisuudet voidaan yksinkertaistaa nopeusrajoiksi, joita robotin tulee noudattaa. Robotin ominaisuudet voidaan yksinkertaistaa kiihtyvyys- ja nykäysrajoituksiksi. Esimerkiksi mitä raskaampi robotti on, sitä pidempi aika siltä kuluu kiihdyttämiseen tai hidastamiseen eli nopeutensa muuttamiseen, jos sen moottorin teho on sama. Nykäysrajoitukset rajoittavat kiihtyvyyden muuttumista; jos nykäystä ei rajoiteta, robotin liikkuvat osat voivat iskeytyä toisiaan vasten ja aiheuttaa kulumista.
Automaatio-ohjelmiston nykyinen nopeusprofiiligeneraattori tuottaa ja esittää nopeusprofiilin analyyttisesti eli laskukaavoina. Profiilin voi esittää myös näytejonona, ja sen voi tuottaa yksi näyte kerrallaan. Tässä työssä esitellään erilaisia nopeusprofiilin tuottavia algoritmeja, joita arvioidaan niiden ominaisuuksien perusteella. Yksi niistä valitaan toteutettavaksi ja analysoitavaksi.
Uusi nopeusprofiiligeneraattori kirjoitetaan Haskellilla ja se esittää nopeusprofiilin näytejonona. Uusi algoritmi valitaan pääasiassa sen yksinkertaisuuden vuoksi: se tuottaa profiilin nostamalla näytteiden nopeuksia vähitellen, kunnes ne ovat mahdollisimman suuria ja noudattavat kaikkia rajoituksia. Profiili laaditaan siis iteroimalla: Alussa se tekee profiilin, jonka kaikki nopeudet ovat nollia. Sitten se käy profiilin näyte kerrallaan läpi monta kertaa ja yrittää nostaa nopeuksia niin, että ne vielä noudattavat nopeusrajoja ja kiihtyvyys- ja nykäysrajoituksia. Koska profiilia muokataan aikatasossa, nopeusrajat siirtyvät, kun profiilin nopeus muuttuu. Näin ollen näytteiden nopeuksia joudutaan joskus myös vähentämään.
Uutta nopeusprofiiligeneraattoria testataan erilaisilla rajoituksilla. Sen tuottamat profiilit esitetään kuvaajissa, joista sen toimintaa voi arvioida. Algoritmi tuottaa suhteellisen järkevän näköisiä profiileja. Se nostaa yksittäisen näytteen nopeuden niin suureksi kuin mahdollista, vaikka seuraavien näytteiden nopeuksia joudutaan vähentämään. Tämä toimintaperiaate aiheuttaa profiiliin aaltoilua, joka loppuu, kun algoritmin annetaan vain joko nostaa tai vähentää nopeuksia samalla kierroksella. Nopeusrajojen siirtyminen voi aiheuttaa tilanteen, jossa jokin näyte haluaa nostaa nopeuttaan, vaikka sen pitäisi vähentää sitä, koska osa sen viereisistä näytteistä rikkoo omia nopeusrajojaan. Kun algoritmin annetaan vähentää nopeuksia, vaikka se aiheuttaisikin lievää rajoitusten rikkomista, ongelma korjaantuu. Rikkomukset profiilissa korjaantuvat myöhemmillä iteraatioilla. Nopeusrajojen siirtymisen takia varsinkin reitin loppupuolen nopeudet ovat pitkään jatkuvassa muutoksessa. Ongelma on lievempi, jos reitillä on vähemmän nopeusrajoja.
Uusi nopeusprofiiligeneraattori pystyy tuottamaan käyttökelpoisia nopeusprofiileja, mutta se tarvitsee vielä vähän jatkokehitystä. Se pitää integroida laajempaan automaatio-ohjelmistoon, ja pitää varmistaa, että se kykenee saamaan profiilin valmiiksi. Profiilin valmistumiseen tarvittavien iteraatioden määrää olisi hyvä vähentää.
The velocity profile generator needs information about the robot and its route to make a velocity profile. A velocity limit function is a simplification of the properties of a route. Acceleration and jerk restrictions are a simplification of the robot's properties. For example, if the output of its motor is the same, a heavier robot needs a longer time to accelerate or decelerate. Restricting jerk is important in order to reduce wear and impacts between any moving parts of the robot.
The robot control software's current velocity profile generator creates and presents velocity profiles analytically. A profile can also be made a sample at a time and comprise a sample sequence. This thesis introduces several different algorithms for velocity profile generation and compares them. One of them is chosen for implementation and analysis.
The new velocity profile generator is written with Haskell and presents velocity profiles as sample sequences. The new algorithm generates a velocity profile by simply iterating through the profile's samples and gradually increasing the velocities until they are as high as possible while still adhering to the restrictions on acceleration and jerk. At start, the generator makes a zero velocity profile. Then it goes through the profile one sample at a time multiple times and tries to increase the velocities without breaking any limitations. Since the profile is handled as a function of time, the places of the velocity limits change as the profile's velocities change. Therefore, the generator must also decrease the velocities of the samples sometimes.
Testing of the new velocity profile generator is conducted by giving it several different limitations. The velocity profiles it creates are presented as graphs from which its functionality can be evaluated. The algorithm produces mostly sensible profiles. It increases the velocity of any given sample as high as possible, even if later samples would need to decrease their velocities. This functionality causes oscillations in the profile. To remove them, the algorithm is modified so that on any given iteration, it will only either increase or decrease the velocities. The changing of the velocity limits can cause a sample to be stuck in a place where it wants to increase its velocity but instead it should further decrease its velocity because nearby samples are breaking their velocity limits. To remove this problem, the algorithm is modified to allow to decrease velocities even if doing so causes some limitations to be broken. Further iterations of the profile will fix the broken limitations. The changing of the velocity limits also causes the later end of the profile to constantly change. Having less velocity limits on the route mitigates this problem.
The new velocity profile generator can produce usable velocity profiles but it does need some further development. It needs to be integrated into the robot control software. It needs a verification method to check that it actually completes the wanted profile. It would be beneficial to reduce the amount of iterations needed to complete a profile.