jaebarn
Hello,
 
I'm building a PID test rig where I'm wanting to experiment with control loops. I'm using a Arduino Mega as the controller as I will be using a lot of IO and will be using proportional valves for controlling the flow rates. I'm planing to use the halls effect turbine pulse flow meters to measure the flow for the flow rate PID feedback. The max pulse frequency is 264 Hz but I don't expect to be running any higher than 150 Hz.
 
I plan to use an Arduino Extension / C++ Function block for the flow meter interface code however from what I can see in the Aduino pulse flow meter example code, they use the interrupt functions to measure the pulses.
 
Am I right in thinking that using interrupts will affect the PLC code / scan time? I want to avoid slowing down the other process like the PID control.
 
Is there any way to do the pulse counting in the back round and only have the flow rate update at the same speed as the scan time?
 
I have seen in historic posts on this forum there was talk about modify the Arduino firmware to buffer the AI input but not sure if that is still relevant or if there is a better way to do this will the latest OpenPLC Editor.  
 
I had though another way would be to use another controller (possibly ESP32) to do the flow rate calculation and send the calculated flow rates to the Mega via Modbus but this may be over complicating things.
Reply 0 0
thiagoralves
Hello,
The OpenPLC forum has a new home: AutonomyEdgehttps://edge.autonomylogic.com. We migrated every member, profiles, topics, categories and attachments. Please redo your post on the new forum so we can continue our conversation.
Note: If you already have an Autonomy Edge account, you can simply login with your credentials to have access to your forum profile and posts. If you don't have an Autonomy Edge account, we ask you to set a fresh password on first sign-in using the same e-mail you used on this forum.
To set a fresh password, access the link https://edge.autonomylogic.com/forgot-password and insert the e-mail address used on this forum. You will receive an e-mail on your inbox with a link to choose a new password. Once you reset your password you will be able to loginonedge.autonomylogic.comusing your new credentials.
Reply 0 0
jaebarn
Hello,
 
I'm trying to post on the new forum but the publish topic button is greyed out and won't let me post. Why would that be?
 
[203128%2F9844917%2Fmceclip0]
Reply 0 0
jaebarn
Forget that, my mistake, it needed a title before I could post.
Reply 0 0
Reply