REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at

Looking forward to meeting you there!

#1 2017-03-12 10:06:50

Registered: 2017-03-08
Posts: 2

PWM basic project help

Hi everyone,

I am quite new to Raspberry Pi projects so I apologise in advance if I miss some background ^^.

I want to set up a basic temperature control using a DS18B20 and a servo motor that will control a gas valve.
Today, I followed the tutorial "REX Getting Started" and the temperature acquisition is working.
But I have more problems regarding the output of the PID block.

Is there any schematic or REX file about a typical PWM function.
I don't know which blocks and settings to use to practice PWM.

For example what kind of block should I use at the ouput of PWM module (2 outputs)?

What is the range value of output RPI__PWM18?

Thanks a lot for your help.

Last edited by povniouk (2017-03-12 12:31:22)


#2 2017-03-13 14:54:21

tomáš čechura
Registered: 2016-02-22
Posts: 371

Re: PWM basic project help

Hi povniouk,

glad that your temperature readings are working well.

Typical function of PWM function block can be derived from PWM examples at our GitHub repository: … dard/PWM_1 or … dard/PWM_2.

Raspberry Pi PWM output from REX (RPI__PWM18) has 0-1023 range. You can use LIN function block to convert PIDU output to the PWM range.

For proper function of Raspberry Pi PWM output on GPIO pin 18 switch Raspberry Pi audio output to HDMI (using "sudo raspi-config").
Reboot is needed afterwards.

PWM frequency is set by OS and is variable by default (dynamically set according to desired PWM output)

What servomotor do you want to interface with?

If I can be of assistance, please do not hesitate to contact me.

Regards, Tomas


#3 2017-04-02 08:52:19

Registered: 2017-03-08
Posts: 2

Re: PWM basic project help

Thanks Tomas. I'll check this out and come back to you wink


Board footer

Powered by FluxBB