This is how Thunderwing takes control of Twilight and Twilight finds Dark Energon shard goes in Thunderwing Returns
[Twilight sees one of Ratchet's tools]
Thunderwing: [in Twilight's mind] Yes. Go on, Princess. Obey my will.
[Twilight's eyes then turn purple as she crushes Ratchet's tool]
[Twilight's eyes return to normal as she turns to see Ratchet and Princess Luna]
Ratchet: I needed that!
Twilight Sparkle: [looks at the tool] Really?
Princess Luna: What has gotten into you?
Twilight Sparkle: I don't know but Thunderwing has been talking to me in my mind recently.
Princess Luna: You're seeing Thunderwing's face?
[at the medical bay]
Princess Luna: Twilight's complaining of intermittent visions -- Waking nightmares, if you will.
Starlight Glimmer: Will she be okay?
Trixie: I hope so.
[Ratchet then leaves with Princess Luna to fix his tool, leaving Starlight and Trixie alone with Twilight. Hours later Twilight wakes up but with purple eyes and walks by Starlight and Trixie.]
Starlight Glimmer: Uh, Twilight? Where are you going?
[Twilight activates the Groundbridge and runs through it]
Starlight Glimmer: Wait! Come back!
Princess Luna: What are you doing?!
[At location where Thunderwing, half buried in the Dark Energon meteor, landed]
Twilight Sparkle: [with Thunderwing's voice] Where is it? Where?!
[A flashback shows Thunderwing, after draining Tirek of his power, breaking out of the Dark Energon meteor, sending Dark Energon shards everywhere, with one going into the ground. Flashback ends. Twilight looks at one area where the ground is glowing purple and walks to it and uses Dark Magic to pull it out, revealing it to be the same shard that went into the ground.]
[Back at the Autobot base, Ratchet, Luna, Starlight, and Trixie wait for Twilight and she comes back throught the Groundbridge]
Princess Luna: Twilight what have you been doing? [sees Twilight has purple eyes and using Dark Magic and has Dark Energon in its grasp] Dark Energon?
[Twilight knocks out Luna and Ratchet with a blast of Dark Magic]
Starlight Glimmer: Luna! Ratchet!
[Twilight then looks at Starlight and Trixie]
Starlight Glimmer: Twilight!
[Twilight ignores them as she walks to the Groundbridge controls and puts in different sets of coordinates and runs through the Groundbridge again and the Groundbridge closes]
Starlight Glimmer: Something's really wrong with her.
Ratchet: The only one who knew of the shard...was Thunderwing.
Starlight Glimmer: Twilight has Thunderwing's memories?
Ratchet: Worst. Thunderwing is occupying Twilight's mind.
Starlight Glimmer: [gasps] What?
Princess Luna: Somehow, the servant of Unicron found a way into Twilight's mind.