I’m trying to control with an ESP32 via Home Assistant the position of a linear actuator with feedback. The linear actuator sends pulses as it travels back and forth.
Their is a total of 800 pulses from the retracted position to the fully extended position. I tried using the Pulse_counter and it counts the pulses but I cannot figure out how to automatically reverse the count depending on the direction of the actuator.
For testing I’m using two switches, open and close.
I tried using a directional variable that gets set depending on witch switch I pressed but I don’t know how to incorporate it into the Pulse_counter function. can any one help me out or suggest a different approach. Thanks
Can you post a pic or something of your actuator? I pulled these off an adjustable bed someone was throwing away but, for the life of me I cant find any data sheet for these based on the information on the sticker.
I did figure out that white/blue are my In/Out or +/- but after testing it and extending one actuator, now I cant get it to retract. I assume it has to do with the position feedback but im not sure how this works as far as if it uses analog signals(resistance) or some other method.
I would estimate that blue and brown are 24Vfor motor, others for low voltage feedback, like 5v, gnd and potentiometer output for feedback. So reversing polarity of blue and brown would drive that motor forward and backward independently of feedback.
Edit: I didn’t notice that black wire, so it has more complicated circuit. And I don’t even see white wire…
Ya, i figured out the wires for moving it but its stuck fully extended now and reversing polarity doesnt retract. Initially I had movement both ways and then I fully extended it and it wont move at all now.
I was hoping they could still be used without the feedback hooked up but, doesnt appear so.
No. I said White and Blue earlier but, I meant Brown and Blue wires are what drives the motor. Hhhmm… I extended it all the way untill it hit its internal limit switch and stopped. It wont retract now so, I was trying to figure out if it had something to do with its feedback system.
Ive only ever used “dumb” actuators and these are unfamiliar to me.
Although that sounds perfectly reasonable. Im not sure how its possible to hit the limit switch too hard. It operartes at 1 speed, slow!
Thanks for the docs though, ill definitely look through there. I do suspect it has something to do with the feedback or the limit switch. It probably requires a signal to release snd retract.
There was some sort of control box they plugged into but the person already threw it away and i didnt get it.
Newer opened one like this, but those 5-wire ones with feedback, don’t have any limit switch reset functionality. I suspect that when you drive these with feedback attached, control board doesn’t allow you to crash to limits at full speed.
The two higher gage wires power the motor, the other 3 are for the hall sensor.
I’m still having problems with the espHome pulse_counter doing a forward and reverse count on the hall sensor. all a get is a continuing total pulse count. Cant seem to get it to substract the pulses when in reverse.
I hadnt considered a hall sensor being in mine, nice call! I need to just get my meter out and motivate myself!
Ive never needed or tried to use pulse_counter for 2 directions but, the documentation mentions count_mode and increment/decrement. One direction will be rising-falling for example and youd increment on that pattern. If its a falling-rising then decrement the total count.
A simpler way would be to use the extend/retract switches instead.
While extend switch is_on - then - add pulses
While retract switch is_on - then - subtract pulses