Remove loops from a walk I've been playing around with a robot on the coordinate plane. This robot is able to tell me if it goes left, right, up, or down by reporting back a string consisting of the letters L, R, U, and D, such as DLURRDLURDLLLRRLRLDURRU. Each character represents a movement of one unit. However, it seems that the robot is going in loops on the plane, returning to coordinates that it has already visited. I don't want the robot to do that. I'd like the robot to tell me about the path it takes without any loops included - these loops should be removed from left to right in the string. Every step in the string it reports should represent movement to a cell that it has not yet visited before. If the robot ends where it starts, then it should report back an empty string. 

Test cases

ULRURU -&gt; UURU
URDLDRU -&gt; DRU
LLLLRRRL -&gt; LL
LLLULRRRL -&gt; LLLUR
UURDDRULDL -&gt; {empty string}
DLURRDLURDLLLRRLRLDURRU -&gt; R
URULLLDLUULDDLDRDDLLLLLDLLUUULLURU -&gt; URULLLDLUULDDLDRDDLLLLLDLLUUULLURU


This is a standard code golf challenge, where the shortest answer wins. Standard rules apply.
Jelly, 20 bytes

O2ȷ:ı*S
ẆÇÐḟḢ⁸œṣFµÐL


Try it online! Or see the test-suite.

How?

O2ȷ:ı*S - Link 1, distance travelled: list of UDLR characters
O       - ordinals -&gt; U:85 D:68 L:76 R:82
 2ȷ     - 2000
   :    - integer division -&gt; U:23 D:29 L:26 R:24 (Note mod 4 these are 3 1 2 0)
    ı   - square root of -1  - i.e. (0+1j)
     *  - exponentiate -&gt; U:(0-1j) D:(0+1j) L:(-1+0j) R:(1+0j)
      S - sum - 0 iff the path is a loop

ẆÇÐḟḢ⁸œṣFµÐL - Main Link: list of UDLR characters
         µÐL - loop until no change occurs:
Ẇ            -   all sublists
  Ðḟ         -   filter discard those which are truthy (non-zero) under:
 Ç           -     call last Link (1) as a monad
    Ḣ        -   head - X = first, shortest loop (if none this yields 0)
     ⁸       -   chain's left argument
      œṣ     -   split at sublists equal to X
        F    -   flatten