MPPT program

Hello i have 2 question,

  1. how to generate 100Khz PWM(variable) in arduino uno.
  2. how to product two analog voltage and current, and depends upon the previous and present value need to change the duty cycle of the PWM.
    i am using resistance load not battery.

For 100kHz PWM you have to change the timer prescaler, to e.g. 1:1 for 16MHz, then the limit register (ICR) to the counter top value, i.e. TOP=16M/100k=160. Depending on the selected PWM mode, half of that value may be required. Then you can specify the duty cycle (0 to TOP) in OCRA and OCRB, for two PWM outputs. See the controller data sheet for details.

For the analog voltage output you need a low pass filter (R+C), for analog current also a voltage-to-current converter.

Thanks for ur help if u have circuit for rc filter for arduino pls send me, i have both current and voltage sensors.