The tense relationship between Turkey and the US started after the coup in 2016. The reason for the coup which was quite crazy is the presence of NATO in the Turkish military. Erdogan knows this too and really took the coup personally.
The alleged organiser of the coup is in the US. Erdogan wants him back. The US, of course, doesn’t give him back. Turkey in return, has prisoned an American pastor for terrorism charges.
Other reasons are the Turkey new alliance with Iran and Russia. These two countries even though they were having notably tough relation at the time of coup with Erdogan over Syria but still offered support to him at the time, especially Iran which was directly involved in every minute and hour at the night of coup with Erdogan and his security team, indeed as it turned out, Iran was the only country in the region that sticked up with Turkey that night.
Trump foolishly wants to destroy the Turkish economy and bring them to submission but what it will really achieve is the removal of US forces in Turkey which is one of the main goals of Iran and Russia for a long time! Indeed, the US has already begun to remove some of its fighter jets to Greece, just yesterday.
Turkey also wants to get the famous Russian S400 which is a big no-no for the US and EU! This system can also protect Iran from Israel in the Future and that is what the NATO is really worried about since Erdogan seems to have changed some of its policy from pro- EU to pro-Palestinian which is a more natural and longer-lasting strategy for a Muslim country.
Another reason is the fact that Turkey announced it won’t comply with US sanction on Iran. Turkey is a large nation, they need gas and oil. Iran has provided them for years. They cannot just halt their long healthy relations with their neighbour as soon as the US felt like it.
Of course Turkey won’t submit to the US because they did once and the result was an organised coup! They will have a closer tie with Iran and Russia. Turkey and Iran can help each other a lot considering the wealth and natural resources they both posses.
I think if the US goes too far to sanction Turkey similar to Iran one day, they will only make the fall of Dollar quicker.