THAT FIXED IT!!

man, thanks, and pardon my blindness. i did not know that the pid filter takes care of all the math! every little bit! the more reason of printing these pid filter code, framing it and hanging it on the wall next to the family portraits!!!

i had it like that to fix a problem, when using two hpwm's the duty cycle would shift over to pwm2, from pwm1, and vice versa at position roll-over, no matter where setpoint was. that problem has dissapeared also.

thats one hurdle over, and now over to implementing the power control on the same chip, to drive a h-bridge driver.

this chip has 8 pwm outputs (4 complementary pairs) ill try as much as possible to implement full motor control from this same chip, as opposed to using a separate driver, like the lmd18200.

thanks
david m