Hi all, I want a control module to be implemented in FPGA(Altera Cyclone IV running on NIOS2) using VHDL which controls current flow to a X-Ray tube. The scenario is I have the expected current value say 5mA. The current has to be controlled to 5mA based on the PWM duty cycle %. Also, based on the current and expected current values I want to find the PWM duty cycle required to control the current flow at 5mA to the X-Ray tube. Note: PWM duty cycle is limited to 50% (max).PWM Freq : 150MHz The current value 5mA is the expected current value and it is given as a reference to the control module. At varying PWM% the actual current is compared with the expected current. The current flow increases supposedly with increasing PWM %. The objective of the controller is to find the PWM % at which the current flow is 5mA so that it can be controlled. I hope, I have provided enough information.Since I am a beginner with less knowledge in control theory I need some information on how to approach this. Looking forward to your suggestions. Thankyou!