Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Garyhlucas on February 21, 2025, 08:20:10 AM
-
We have a project building a test setup for a customer. The desired output is PWM but they would like to be able to vary the frequency as well as pulse width. The current plan is to use multiple PWM outputs with preselected frequencies selected by a recipe since the PWM block doesn't allow a variable for the frequency, only a constant. Is there some programable method to do this? I am kind of think maybe using a high speed pulse output combined with a high speed timer for pulse width, essentially building a PWM output of our own.
On a really positive note we are really pleased with the BRX PLCs. We keep throwing all kinds of strange requirements at them and they just DO-MORE. Vendors come in and ask why we aren't using X,Y or Z and are always impressed when we explain how capable the BRX is. A recent request for us to use a different PLC shows it will cost about $4000 more to get what we need!
-
The PWM block doesn't allow a variable for the frequency, only a constant.
Sorry about that. PWMOUT was set up to provide a simple way to set up a PWM with a constant frequency but be able to change the duty cycle. I would recommend not using the PWMOUT but just manipulate the PERIOD (not frequency) as an INTEGER in MILLISECONDs or MICROSECONDs (units are DYNAMIC - see the .PeriodScale in the PWM Out heap item, e.g. $PWMOut1.PeriodScale.)
Look at Help Topic DMD0408 BRX Pulse Width Modulated Outputs for how to easily control the "frequency" as a Period in milliseconds or microseconds. The .PeriodScale manipulation is CRITICAL (along with the proper unit value for .Period) when manipulating the Frequency at runtime.
PWMOUT was also created as a place holder for Cross Reference of your PWM configuration. You could technically still use it, just make sure your PWMOUT box is BEFORE the direct manipulation of the $PWMOut1 structure members (last one wins).
-
We have a project building a test setup for a customer. The desired output is PWM but they would like to be able to vary the frequency as well as pulse width. The current plan is to use multiple PWM outputs with preselected frequencies selected by a recipe since the PWM block doesn't allow a variable for the frequency, only a constant. Is there some programable method to do this? I am kind of think maybe using a high speed pulse output combined with a high speed timer for pulse width, essentially building a PWM output of our own.
On a really positive note we are really pleased with the BRX PLCs. We keep throwing all kinds of strange requirements at them and they just DO-MORE. Vendors come in and ask why we aren't using X,Y or Z and are always impressed when we explain how capable the BRX is. A recent request for us to use a different PLC shows it will cost about $4000 more to get what we need!
The PWMOUT box just sets the structure fields of the structure associated with the PWM...it's simply a convenience. You can set the frequency directly in the structure...and yes, it is a variable.
-
Great!
Check off another box on the Can-Do list.