Gilles Gagnon replied to the topic 'INDI & Arduino' in the forum. 2 years ago

Hi Tom, thanks for your reply.

I use a 'DIRECTION' as well as an 'ACTIVATION' relay to open or close the roof.

To open, I only activate the ACTIVATION relay as the NC position of the DIRECTION relay wires the power of the linear actuators (I have 2) to extend. To close, the DIRECTION relay is activated prior to the ACTIVATION relay, to reverse the polarity of the actuators, thus retracting it. The actuators have limit switched to turn them off when the end-of-course is attained but I do not have access to those. I know that the roof is opened or closed when the respective roof limit switches are set to ground (pull-up used) but the Arduino code needs to wait a few more seconds as the roof hits the limit switches before being fully opened or fully closed. The opening and closing functions are blocking so I can't really issue an abort or stop command unless I make some changes that may be a bit more complex. I hope my explanations are clear, if not do not hesitate to let me know.

To sumarize:
Open: DIRECTION relay OFF, ACTIVATION relay ON
Close: DIRECTION relay ON, ACTIVATION relay ON
Abort: ACTIVATION relay OFF

Is there a regular polling of the limit switches from the indi driver? If so, I can simplify my code and rely on the driver to know if the roof is fully opened or fully closed. That would simplify things.

Thanks for the help.
Gilles

Read More...