That was just tremendous Mister.
Im very very thankful to u for this.
Now im getting that this is really possible to control the cycles in HPWM.
Now i have some important questions prevailing in my mind rite now.Hope u would not mind answering them.
About this coding, i want to ask u that no matter that our sensors will be working while the motor is runnig. But if we take the scenario apart from my sensors. and come towards running a third motor in between then what would u say???HPWM 1,127,1000 ' Start Motor1
Hpwm 2,127,1000 ' Start Motor2
For Msec=0 to 300
PauseUS 10 ' 10uSec * 300 = 3mSec = 3 Cycles
If SensorX=Something then Doplahplah
If sensorY=Somethingelse then DoAnotherPlahPlah
next
I mean that this is the scenario:
my both motors are running with HPWM command, let us suppose they are made to make 3 revolutions.
now in between those three revolutions, if i want to run a 3rd motor (not thru HPWM) so how i would be using this??????
I mean should i use it like this that
HPWM 1,127,1000 ' Start Motor1
Hpwm 2,127,1000 ' Start Motor2
For Msec=0 to 300
PauseUS 10 ' 10uSec * 300 = 3mSec = 3 Cycles
If SensorX=Something then Doplahplah
If sensorY=Somethingelse then DoAnotherPlahPlah
next
CCP1CON=0 'stop PWM 1
CCP2CON=0 'stop PWM 2
HPWM 1,127,1000 ' Start Motor1
Hpwm 2,127,1000 ' Start Motor2
For Msec=0 to 300
PauseUS 10 ' 10uSec * 300 = 3mSec = 3 Cycles
pwm portB.0, 127, 2000 ' run the motor connected on portB.0 with pwm
next
CCP1CON=0 'stop PWM 1
CCP2CON=0 'stop PWM 2
Now what im saying that dont u think that it is working still sequentially.
I think im just unable to make u understand thru coding that what im trying to make. Because im still in the process of learning.
I can present to u a scenario.
here it is:
I HAVE PROGRAMMED MY BOTH DRIVE MOTORS TO TAKE THREE REVOLUTIONS. NOW DURING THESE THREE REVOLUTIONS I WANT TO START A THIRD OPERATION LETS SAY STARTING A THIRD MOTOR WITH NORMAL PWM COMMAND. hOW I WILL DO THIS?
if u will post a code example, i shall be able to understand it quickly and will be greatly thankful to u.
Thanks in advance!
Bookmarks