PWMgen Output Type Interpretation

More
21 May 2014 09:29 #47136 by saskrick
Folks

I am a faculty advisor working with some students. We are driving large servo motors (1 kW SEW industrial motors) via PWMgen. The input to this controller is a unipolar analog signal (0 – 10V) and two binary signals (CW and CCW) I am specifying output type "1". The documentation is a bit confusing:

"Output type 1 - PWM/PDM and direction pins. Positive and negative inputs will be output as positive and negative PWM. The direction pin is false for positive commands, and true for negative commands. If your control needs positive PWM for both CW and CCW use the abs component to convert your PWM signal to positive value when a negative input is input."

do I need to use the "abs" component to make the velocity signal always positive? what is "negative PWM" - makes no sense to me....

Regards, Rick Retzlaff

Please Log in or Create an account to join the conversation.

More
21 May 2014 21:06 #47161 by PCW
The manual could be clearer but its spelled out in the section on individual pins:
pwmgen.N.value float in
              Commanded value.  When value = 0.0, duty cycle is 0%,  and  when
              value = +/-scale, duty cycle is +/- 100%. (Subject to min-dc and
              max-dc limitations.)

I would probably change the first section to read:
type 1: pwm/direction
              Two output pins, pwm and dir.  The duty cycle of the pwm varies as a
              function of the absolute value of the input.  dir is low for positive inputs and
              high for negative inputs.

In any case it does what you need without requiring an absolute component added

Please Log in or Create an account to join the conversation.

More
21 May 2014 21:37 #47162 by saskrick
Yes, I like that wording. Thanks. So my HAL code makes sense?:

net Xvel-cmd => pwmgen.0.value
net Xpwm pwmgen.0.pwm
net Xdir <= pwmgen.0.dir
net Xdir => parport.0.pin-02-out
net Xdir => parport.0.pin-04-out
setp parport.0.pin-04-out-invert TRUE
net Xpwm => parport.0.pin-03-out

(I need two DIR output pins for the SEW)

Please Log in or Create an account to join the conversation.

More
21 May 2014 21:45 #47163 by PCW
looks ok to me

Note that you can combine signal assignments in one line if you like:

net Xdir pwmgen.0.dir parport.0.pin-02-out parport.0.pin-04-out

just a matter of personal preference

Please Log in or Create an account to join the conversation.

Time to create page: 0.135 seconds
Powered by Kunena Forum