View Single Post
Old 07-07-2018, 10:36 PM   #3228 (permalink)
thingstodo
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 746
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by ale0502 View Post
I have my motor on a test bench.
On Paulīs code say:
// PWM Initialization

PTPER = 1474; // 29,491,200/((PTPER + 1)*2) = 9997Hz.

I think my pwm resolution is bad.

I change PTPER value but I didn't get better results.
On dspic datasheet say:


thanks
I have not checked the code I'm running. But I expect that Paul has not changed that in some time. I ran through the numbers in the code snippet and I get 9997 Khz as well.

The scope trace I will have to ask some questions about. I see that the 3 channels are all set to 5.00V per division. The time scale shows what looks like 1.00 ms. So each horizontal division should be 1 ms - right? -5 ms to +5 ms is your horizontal scale.

The narrowest of the pulses is far less than 1 ms. It could be near 0.1 ms, which is what would be expected at 10 KHz. I don't see anything that appears to be 3 Khz, or a period of 0.33 ms. What am I missing?

Are your cursors the dotted lines at -1.6 ms and +2.56 ms? I see the values on the right for Type - time, Source Ch1, Delta of 4.16 ms.

Can you capture the signals that are 'wrong' for us and post that picture, with your cursors showing the timing? I'm still confused about what is wrong.

As far as I can see, your board is working beautifully?
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote