Page 1 of 1

PWM problems

Posted: Sat Jul 29, 2017 1:11 pm
by Bachman
Hello!

I made a little PWM test and i found two problems. See attached program.

First problem: When i power up the controller, after the PWM enable, it's turns on as full duty until it's get another command.
Trun_ON_1.jpg
Trun_ON_1.jpg (69.87 KiB) Viewed 4662 times
Turn_ON_2.jpg
Turn_ON_2.jpg (65.27 KiB) Viewed 4662 times

Re: PWM problems

Posted: Sat Jul 29, 2017 1:12 pm
by Bachman
Second problem: Set the duty to 255, simulation shows az 100 %, but in the real HW, it's not 100 %.
Duty_255_1.jpg
Duty_255_1.jpg (65.37 KiB) Viewed 4661 times
Duty_255_2.jpg
Duty_255_2.jpg (64.54 KiB) Viewed 4661 times

Re: PWM problems

Posted: Mon Jul 31, 2017 2:45 pm
by Benj
Hello,

I can maybe see why you are not getting 100% duty on. You are writing to the PWM duty register even when the duty remains constant so maybe this is causing the problem.

If you move the SetDutyCycle call into the decision icons yes branches then does this solve the problem?

Re: PWM problems

Posted: Tue Aug 01, 2017 11:19 am
by Bachman
It's doesn't matter, where is the SetDutyCycle command. After the PWM enabled, the output goes to full duty until it's got another SetDutyCycle command. I've tested it on Flowcode 5, on that version, only the second problem exists, set duty to 255 is not 100 % duty on the HW.