For the control of an induction motor (IM), there exist different approaches to control thetorque. These include the classical field-oriented controller (FOC), but also other methodssuch as a model predictive controller (MPC). Both control methods have in common thatan exact knowledge of the system parameters is necessary. As these are often not exactlyknown and the system behavior is nonlinear, an optimal control of the motor is difficultto reach. Therefore, a data-driven control method is presented in this thesis. This isbased on reinforcement learning (RL), which has been used for the last few years for thecontrol of technical systems. Previous research has shown that this control method canalso be used for the control of motors, such as the permanent magnet synchronous motor(PMSM).Furthermore, a data-driven approach for estimating the magnetic flux is presented. Becausean RL agent does not consider limitations when selecting an action, a system model isidentified in parallel. This model is used to predict the following state, in order to decidewhether an action is safe or not. As there are many suitable RL algorithms, four algorithmsare compared in an extended hyperparameter optimization. It has been observed that theProximal Policy Optimization (PPO) agent shows the best control performance. Finally,the performance of the RL controller is compared simulatively with an FOC. It is shownthat the RL controller can follow the reference quite well, but cannot achieve the efficiencyof the FOC.