The Dinobots are heroic Transformers who turn into dinosaurs, or at least things which mostly look like dinosaurs. While they bear the Autobot insignia, calling them a bunch of loose cannons would be an understatement. Answering mostly to their animalistic rage, it would take a serious display of superior might for these guys to follow anyone else's lead.
The Dinobots (some of them, at least) were captured aboard Lockdown's ship as trophies until the Autobots detached that section to free Optimus Prime. When the ship eventually crashed in China, Optimus decided that time had come for reinforcements to battle Galvatron's forces and freed the Dinobots, calling them to join him. Grimlock battled Optimus for dominance, but was beaten, and the Dinobots agreed to help the Autobots. The Dinobots' massive size, strength and ferocity turned the tide of battle in the Autobots' favor in the nick of time, swiftly defeating the prototypes in Hong Kong until Lockdown returned. The Dinobots were trapped in Lockdown's magnetic vortex, but Optimus destroyed it, freeing the Dinobots. The Dinobots helped hold a bridge so that Joshua Joyce could get to safety with the Seed. After the battle, Optimus dismissed the Dinobots from his command, allowing them to roam free on Earth, and the Dinobots parted on good terms with the Autobots and set off on their own.
Like that won't backfire someday.
The Last Knight (2017)
The Dinobots took refuge with the other Autobots in Cade Yeager's junkyard. Since their alternate modes were too conspicuous, they hid themselves by digging underground tunnels and only coming out to feed. At some point, the Dinobots began reproducing through unknown means and gave birth to at least 3 baby Dinobots. Unlike their larger counterparts, baby Dinobots spent most of their time in Cade's house. When the Deceptions found the base and attacked, Grimlock and Slug burst out of hiding to defend their offspring and Autobot friends. After the battle, the Dinobots went back into hiding with most of the Autobot refugees and did not participate in the final battle against Quintessa.