This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

clock syncronisation

hello everyone,
i am using cygnal controller i.e c8051f020.
i am running 3 motors all together
all motors clock is of different timer
each timer has its own priority
i want to know is there any possibility to sycronization of clocks of all motors.
because i want to run some cycles which is required in project and i want to start the motors together to see if they are in same phase. but i still get lead/lag problem in the mechanism
can you suggest how to minimise this problem
pls let me know if any more information is needed
thank you all
take care

Parents
  • i want to know is there any possibility to sycronization of clocks of all motors.

    first, the obvious approach is to have a timer clock at the least common denominator for the timings aned do the resolution in the ISR.
    That can easily backfire by the ISR being overloaded, but if your frequencies are in the Hz to low kHz it should work.

    If you get marginal on this, switch to the f12x/f13x.

    another issue here is how much you need to do outside the ISR, which you do not say.

    Erik

Reply
  • i want to know is there any possibility to sycronization of clocks of all motors.

    first, the obvious approach is to have a timer clock at the least common denominator for the timings aned do the resolution in the ISR.
    That can easily backfire by the ISR being overloaded, but if your frequencies are in the Hz to low kHz it should work.

    If you get marginal on this, switch to the f12x/f13x.

    another issue here is how much you need to do outside the ISR, which you do not say.

    Erik

Children
  • hi erik,
    thanks for reply
    my system is cycle based system
    i have 4msec isr in which i load the clock values in the clock timer
    eg: 4msec isr is of timer0 and clock timer is of timer1
    i have code memory in which clock values are saved
    in 4msec isr i pick these values and load in the clock timer.
    and in the clock isr i just complement the clock pin
    this just i do.
    same for other two motors i.e timer3 and pcatimer
    which are present in the f020ic
    i want to know if i start all motors at the same time then will all the cycles will remain at the same phase
    i.e all steps in the cycles will be same for all 3.
    or will there be any difference in the running. as i get this issue (i.e up and down motion of motors are not hapening at the same time)
    am i missing any clock values,if yes then how to avoid it? or any interrupt missing?
    i am running microcontroller at 24Mhz crystal.
    to avoid this i want to know the solution through software
    thank you
    any more information needed from my side then pls let me know
    take care