HELP - 4x DigitalOutput - BeginSetDutyCycle()

Supporting Visual Studio on Windows
Post Reply
Sam Bhanji
Fresh meat
Posts: 1
Joined: Fri Jul 09, 2021 5:05 am
Contact:

HELP - 4x DigitalOutput - BeginSetDutyCycle()

Post by Sam Bhanji »

Hello,

Please bear with my questions as I am new to Phidgets.

I am trying to use the 4x Digital Output Phidget to control a servo motor that has built-in driver with the ability to accept Step/Dir pulses (like a stepper motor).

Due to the built-in driver, I am not able to use the Stepper Motor Phidget, so I am limited to using the DigitalOutput Phidget to generate the STEP and DIR pules which I have been successful in developing. What I am struggling with is how to precisely command the motor to move a certain amount of STEPS?

The motor is configured for 200 steps/revolution, and I am trying to set the DigitalOutput (ch 1) to send 2000 pulses to rotate the shaft 10 revolutions. I currently use DutyCycle=0.5, and Frequency=2000 which sets the motor's speed to turn about 10 revolutions/second. But how do I command it to stop after turning the shaft 10 revolutions???

I see that there is a BeginDutyCycle() that accepts a deligate but not sure of this can be used as I may not fully understand the design correctly.

Any assistance is greatly appreciated?

Thanks,
Sam.
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: HELP - 4x DigitalOutput - BeginSetDutyCycle()

Post by Patrick »

You can't precisely control the number of pulses on a PWM digital output. Does your driver accept any other types of control input?

-Patrick
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests