Thanks a lot anj!! I did that, i.e OSC 20 and HPWM 1 150 16000, but the motors were turning alternatively.. i.e one wud turn, and then the other and this keeps going in a loop as per my code. But they didnt turn together as they should be. (see code above) I then bumped the frequency down to 5000 and both motors worked well and at a good speed and went thro the subroutines well. i.e forward>halt>rev>halt>main. But now my robot is not going straight!!! it seems like both wheels are not going at the same speed or not starting at the same instant. Is this because HPWM 1 starts and is "followed" by HPWM 2 so there is a delay? but it doesnt seem to be just the start time .. i feel the actual speeds differ ... in the forward direction, one motor goes slower, and in the revers direction the other goes slower .. get it? playing with the frequency seems to affect this .. how do find the right frequency? Trial and error?
Thanks a lot for your help!




Bookmarks