A controlled substance is generally a drug or chemical whose manufacture, possession, or use is regulated by a government, such as illicitly used drugs or prescription medications that are designated by law. Some treaties, notably the Single Convention on Narcotic Drugs, the Convention on Psychotropic Substances, and the United Nations Convention Against Illicit Traffic in Narcotic Drugs and Psychotropic Substances provide internationally agreed upon "schedules" of controlled substances, which have been incorporated into national laws, however national laws usually significantly expand on these international convention.
Some precursor chemicals used for the production of illegal drugs are also controlled substances in many countries, even though they may lack the pharmacological effects of the drugs themselves. Substances are classified according to schedules and consist primarily of potentially psychoactive substances. The controlled substances do not include many prescription items such as antibiotics.
In the United States, the Drug Enforcement Administration is the federal government agency responsible for suppressing illegal drug use and distribution by enforcing the Controlled Substances Act, which regulates both the drugs themselves and certain precursors. Some U.S. states have additional restrictions for substances which might or might not be regulated by the federal government. During the Obama Administration, the federal government also voluntarily suspended enforcement of federal laws restricting marijuana where people were operating in compliance with state law.
Some states in the U.S. have statutes against health care providers self-prescribing and/or administering substances listed in the Controlled Substance Act schedules. This does not forbid licensed providers from self-prescribing medications not on the schedules.
In the United Kingdom, the term "controlled drug" (CD) is used for substances governed by the Misuse of Drugs Act 1971. Other national drug prohibition laws include the Controlled Drugs and Substances Act (Canada) and the Misuse of Drugs Act 1975 (New Zealand), among many others.
Within Europe controlled substance laws are legislated at the national rather than by the EU itself, with significant variation between countries in which and how chemicals are classified as controlled. Only drug precursor laws are legislated for at the European level
A common misunderstanding amongst researchers is that most national laws allow the use of small amounts of a controlled substance for non-clinical / non-in vivo research without licences. A typical use case might be having a few milligrams or microlitres of a controlled substance within larger chemical collections (often 10K's of chemicals) for in vitro screening. Researchers often believe that there is some form of “research exemption” for such small amounts. This incorrect view maybe further re-enforced by R&D chemical suppliers often stating and asking scientists to confirm that anything bought is for research use only.
A further misconception is that controlled substances laws simply list a few hundred substances (e.g. MDMA, Fentanyl, Amphetamine, etc.) and compliance can be achieved via checking a CAS number, chemical name or similar identifier. However, the reality is that most countries enact “generic statement" or “chemical space” laws, which aim to control all chemicals similar to the “named” substance. These either provide detailed descriptions similar to Markushes, or simply state analogues are also controlled. In addition, control of most named substances is extended to control of all of their ethers, esters, salts and stereoisomers.
Due to this complexity in legislation the identification of controlled chemicals in research is often carried out computationally, either by in house systems maintained a company's sample logistics department or by the use commercial software solutions. Automated systems are often required as many research operations can often have chemical collections running into 10Ks of molecules at the 1–5 mg scale, which are likely to include controlled substances, especially within medicinal chemistry research. These may not have been controlled when created, but they have subsequently been declared controlled.
Has limited exemptions to some Directory E substances, but which substances are covered and what the exemption allows depends on the substance, for example compounds similar to Fentanyl allow for “Von der Kontrolle ausgenommen ist die industrielle und die wissenschaftliche Verwendung. Der private Gebrauch ist nicht von der Kontrolle ausgenommen” or “Excluded from the control is the industrial and scientific use. Private use is not exempt from the control.” The exemption wording for Cyclohexylphenols is “Cyclohexylphenole sind von der Kontrolle nach den Kapiteln 5 und 6 der Verordnung über die Betäubungsmittelkontrolle vom 25. Mai 2011 ausgenommen, wenn sie von Unternehmen mit einer Betriebsbewilligung für den Umgang mit kontrollierten Substanzen des Verzeichnisses e industriell eingesetzt werden. Für Substanzmengen bis zu 100 g benötigen diese Unternehmen keine Ein- oder Ausfuhrbewilligung.” or “Cyclohexylphenols are exempted from the control under Chapters 5 and 6 of the Narcotics Control Ordinance of 25 May 2011 if they are used industrially by undertakings holding an operating license for the handling of controlled substances in Inventory e. For substance quantities of up to 100g, these companies do not require an import or export license”. In addition, import or export authorization is not required in case of controlled substances for analytical purpose in concentrations up to 1 mg/ml. (Art 23, Abs. 2b, BetmKV) 
Further qualifications apply e.g. yearly limits as well individual shipment limits
There are no specific research exemptions in the Misuse of Drugs Act. However, the associated Misuse of Drug Regulations 2001 does exempt products containing less than 1 mg of a controlled substance (1 ug for lysergide and derivatives) so long as a number of requirements are meet, including that it cannot be recovered by readily applicable means, does not pose a risk to human health and is not meant for administration to a human or animal.
Although this does at first seem to allow research use, in most circumstances the sample, by definition, is “recoverable” - in order to prepare it for use the sample is ‘recovered’ into an assay buffer or solvent such as DMSO or water. In 2017 the Home Office also confirmed that the 1 mg limit applies to the total of all preparations across the entire container in the case of sample microtitre plates. Given this, most companies and researchers choose not to rely on this exemption.
According to Home Office licencing, "University research departments generally do not require licences to possess and supply drugs in schedules 2, 3, 4 part I, 4 part II and schedule 5, but they do require licences to produce any of those drugs and to produce, possess and/or supply drugs in schedule 1".
United States of America
In the US no general research exemptions are known to exist, at least at the federal level and the Controlled Substances Act.
The Gesetz über den Verkehr mit Betäubungsmitteln (Betäubungsmittelgesetz - BtMG) / (Law on the Traffic in Narcotic Drugs (Narcotics Act - BtMG) has a partial exemption that might apply to certain research areas.
For each schedule the act allows for
the preparations of the substances listed in this Appendix if they are not
a) without being applied to or in the human or animal body, for diagnostic or analytical purposes only, and their content of one or more anesthetics not exceeding 0.001 per cent, or isotope-modified in the preparations, or
b) are particularly excluded;
die Zubereitungen der in dieser Anlage aufgeführten Stoffe, wenn sie nicht
a) ohne am oder im menschlichen oder tierischen Körper angewendet zu werden, ausschließlich diagnostischen oder analytischen Zwecken dienen und ihr Gehalt an einem oder mehreren Betäubungsmitteln jeweils 0,001 vom Hundert nicht übersteigt oder die Stoffe in den Zubereitungen isotopenmodifiziert oder
b) besonders ausgenommen sind;
The exact percentage various for each schedule. Also whether the ‘0.001%’ allows the rest to be an assay solvent or medium, or whether a licence is needed if you have some solid, e.g. 1 mg of sample before its diluted is not clear.