Understanding pwm value to get desired voltage from MOSFET?

Hi I have been playing around with the L298N motor controller. I found this equation to find the pwm needed for a desired output voltage.

I have a 11.1v lipo but my motors are only rated for 9v.

Pwm = (Vout/battV)*255

And this has worked for me so far, but when i made my own motor controller using D90NH 24v 60A power mosfet from old rcboat this calculation did not work. Can anyone explain why this is the case?

PS a friend said to set my arduino pwm to high pwm but I didn't understand how that works.

Thanks :)

but when i made my own motor controller using D90NH 24v 60A power mosfet from old rcboat this calculation did not work.

Do you mean you connected directly into the FETs in an ESC, or you controlled the ESC using PWM?

toby-wan: Hi I have been playing around with the L298N motor controller. I found this equation to find the pwm needed for a desired output voltage.

I have a 11.1v lipo but my motors are only rated for 9v.

That's perfect then, the L298 will drop about 2V anyway.

The PWM ratio only controls the output effective voltage linearly when using the correct "decay mode"(*), otherwise the response is non-linear (and can depend on the PWM frequency). How have you wired up the PWM signals to the L298?

Given the many variables involved the PWM to output-speed curve is best determined by experiment rather than calculation I think...

(*) "synchronous rectification" where one switch is on the other off at all times.