Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-08-15 17:07:28

windoze
Member
Registered: 2018-08-15
Posts: 1

Accessing User Functions with rexduino

Hi,
I am very new to this system so facing a steep learning curve. I want to convert a stand alone arduino boiler controller to integrate it into the rexduino system and be able to control it remotely and easily set temperature and power profiles. It will also be easy to add safety interlocks into the system. Now my existing system controls a 3kw heater and the power output can be set in 30w steps (1% increments). It works by detecting zero crossing via INT 0 and outputting a trigger pulse for a triac just after the zero crossing point. The system supplies full cycles to the heater and spreads the cycles evenly over 100 mains cycles. I.E. for a 2% output the heater receives one cycle per second and for 3% one cycle every 666ms (on average). This complexity is to try to minimise the effect of the load on lighting connected to the same mains phase.
I have had success in modifying the slave arduino program to detect the zero crossing and output the pulses to the trial in the background using interrrupts on pin 2.
I cannot see any examples of where the rex system can pass a value to the arduino which is what I want for the control of the power level of the heater. To save me some coding I am trying to modify the user function "U" as the way of passing the data. How do you access this when designing the control system using rex studio? Apologies if this is a stupid question!

Offline

#2 2018-08-17 08:26:50

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: Accessing User Functions with rexduino

Hi,
not stupid at all. User data is passed via the userSend input of the block in REXYGEN algorithm. In the current implementation, only the lowest byte of the signal entering the block is sent. Connect a CNI block and enter the desired value 0..100.

In the REXduino slave, this value appears as the byte "microseconds" entering the function commandU in REXduino_commands.ino. There you can process the value and use it to control your heater.

You can also change the data which is returned to the REXduino master. By default, uptime in milliseconds (userSend!=0) or microseconds (userSend==0) is returned and this data appears at the userRecv output of the master block in REXYGEN algorithm.

Hope this answers your question.

Jaroslav

Offline

Board footer

Powered by FluxBB