Page 1 of 1

MIO PWMout not changing frequency

Posted: 15 Jan 2024, 17:53
by albertobueno
Dear all,

I have recently started playing with the MIO module to activate a relay using a the PWMout signal. I am connecting the GPO 3 to the positive side of the relay and the 0 V of the relay to one of the 0 V pins in the analogue output from the MIO module as instructed in the documentation.

In Codesys I am setting the type PWMout for the correct channel. The frequency using the formula in te documentation and the duty cycle of 500 (50%).

When I run the program not matter what frequency integer I gave between 100 and 60000 the output frequency always stays at 2 Hz.

As extra info the firmware of the MIO module is 1.0

Is there something that I am missing?

Re: MIO PWMout not changing frequency

Posted: 19 Jan 2024, 15:42
by albertobueno
UPDATE:

Today I did an update to the latest image.

I can confirm if I configure the MIO module as follows in pictory the frequency output of GPO3 works as expected:
m_0_IO_Mode_3: pwmOut
m_0_FpwmOut_3: 60
PwmDutycycle_0_3: 500

As soon as I upload the following configuration with Codesys I get an PWM frequency of 2 Hz no matter what frequency I set.
FpwmOut_Ch3: 60
Digital_IO_Mode_Ch3: pwmOut
PwmDutycycle_Ch3: 500

I confirmed the frequency using an oscilloscope.

Using piTest -r m_0_FpwmOut_3 (with pictory configuration):
2 Byte-Value of m_0_FpwmOut_3: 0 dez (=0000 hex)

Using piTest -r m_0_FpwmOut_3 (with Codesys configuration):
2 Byte-Value of m_0_FpwmOut_3: 0 dez (=0000 hex)

Is it a revolutionpibridge V1.4.1.0 bug?

Best regards

SECOND UPDATE:
After playing for a while I realize that the mapping of FpwmOut_Ch1_Ch2, FpwmOut_Ch3, FpwmOut_Ch4 has the wrong offset.

If I configure in Codesys FpwmOut_Ch4 to 60 Hz then pin 1 in connector X2 of the MIO is set to 60 Hz and pin 2 and 3 remain at 2 Hz.
piTest results after configuring FpwmOut_Ch4=60 :

piTest -r m_0_FpwmOut_12:
2 Byte-Value of m_0_FpwmOut_3: 60 dez (=000f hex)

piTest -r m_0_FpwmOut_3:
2 Byte-Value of m_0_FpwmOut_3: 0 dez (=0000 hex)

piTest -r m_0_FpwmOut_4:
2 Byte-Value of m_0_FpwmOut_4: 0 dez (=0000 hex)

Definetely a bug in revolutionpibridge V1.4.1.0 using Codesys 3.5 SP19 Patch 4.