# Smoothly Change Trajectory with RAPID

**URL:** <https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953>\
**Category:** Robot Controller\
**Created:** [June 27, 2012, 10:17pm UTC](https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953 "2012-06-27T22:17:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![msv](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@msv](https://tech-community.robotics.abb.com/u/msv)\
**Post date:** [June 27, 2012, 10:17pm UTC](https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953/1 "2012-06-27T22:17:57Z")

</div>

Hey all,

So I’m trying to accomplish the following: I want to be able to start my arm moving in a trajectory. The arm at some point in this trajectory receive an input signal. At this point I want to immediately (as quickly as possible) change my trajectory. Does anyone have any suggestions to accomplish this?

Thanks,

---

<div class="post-metadata">

**Author:** ![Henrik\_Berlin](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/henrik_berlin/32/1011_2.png) [@Henrik\_Berlin](https://tech-community.robotics.abb.com/u/Henrik_Berlin)\
**Post date:** [June 28, 2012, 4:33am UTC](https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953/2 "2012-06-28T04:33:30Z")

</div>

Moved to RobotWare forum.

---

<div class="post-metadata">

**Author:** ![SjoLi](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/sjoli/32/3340_2.png) [@SjoLi](https://tech-community.robotics.abb.com/u/SjoLi)\
**Post date:** [June 28, 2012, 3:57pm UTC](https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953/3 "2012-06-28T15:57:27Z")

</div>

You can use a traproutine for this.  
In this trap u can put the instructions you want.

Then you can connect the input to the traproutine.

examples can be found in the RAPID manual

---

<div class="post-metadata">

**Author:** ![SjoLi](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/sjoli/32/3340_2.png) [@SjoLi](https://tech-community.robotics.abb.com/u/SjoLi)\
**Post date:** [June 28, 2012, 4:06pm UTC](https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953/4 "2012-06-28T16:06:15Z")

</div>

!! Progstop is an Intnum DATA !!

PROC main()  
CONNECT ProgStop WITH Stop\_Programma;  
ISignalDI diProgStop, 1, ProgStop;  
… ;  
IDelete ProgStop;  
ENDPROC

TRAP Stop\_Programma  
Stopmove;  
WaitDI diProgStart, 1;  
Startmove;  
ENDTRAP

---

<div class="post-metadata">

**Author:** ![zuldgreat](https://avatars.discourse-cdn.com/v4/letter/z/e68b1a/32.png) [@zuldgreat](https://tech-community.robotics.abb.com/u/zuldgreat)\
**Post date:** [July 9, 2012, 10:41am UTC](https://tech-community.robotics.abb.com/t/smoothly-change-trajectory-with-rapid/4953/5 "2012-07-09T10:41:54Z")

</div>

You can use “SearchL”  
This instruction reads an input while the robot moves linearly, or “SearchC” if you need circular motion.  
The robot can be stoped immediately when the input toggled to specified condition.
