Shop OBEX P1 Docs P2 Docs Learn Events
PWM object — Parallax Forums

PWM object

youngdaveyoungdave Posts: 70
edited 2011-03-26 11:13 in Propeller 1
Dear All
I need to drive two steppers with a square wave signal of user definable frequency, with a user definable duty ratio, and for a user definable number of pulses.
Does anyone know of such an object?
None of the PWM objects I can find seem to have the user definable pulse count.
TIA David Young

Comments

  • idbruceidbruce Posts: 6,197
    edited 2011-03-24 15:24
    Here is one for user defined step count(pulses).

    Bruce
  • youngdaveyoungdave Posts: 70
    edited 2011-03-26 00:49
    idbruce wrote: »
    Here is one for user defined step count(pulses).

    Bruce

    Yes, I have that one. Thanks.
    David Young
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-03-26 03:18
    What are you actually trying to do? It doesn't really make much sense
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-03-26 11:13
    usually for driving stepper-motors a duty-cycle of 50% is enough as everything you need is the frequency.

    Most steppermotor-controls with step/direction-input accept quite short pulses (1µsec to 10µsec).

    For driving stepper-motors for a certain amount of pulses very often a loop is used to create the pulses and have exact control about the number of steps.

    Do you actually run out of cogs that you want a solution that does not require a own cog for creating steps.
    Or do you want to measure the motor-coil-currents through the prop and do the choppering with the prop?

    Of course you can do so but I would choose a stepper-motor-driver-circuit that takes care of the current-choppering.
    What currents are we talking about? For everything up to 1A per coil you can use chips like the L298 or chips from allegro etc.

    best regards

    Stefan
Sign In or Register to comment.