Linear Actuator PWM control for TV open/ close

Linear Actuator PWM control for TV open and close
Hello,
I have already completed a project that uses relays and a 120v circuit to open/close a set of TV monitors for my church. It's a very simple reversing circuit via the relays means a switch is turned "ON" to open the monitors and "OFF" closes them.
(the 120v system was necessary because of the distance between the switch and the equipment)

The problem, however of the abrupt start and stop of the monitors needs to be fixed.
My Arduino project will use a PWM sequence that I will fine tune to provide a more gradual opening and closing.
(I would also like to add an infrared transmitter mounted to the TV sensors so that I can have them turn on/off as they open/close)
Here is an illustration of how the system currently works:

I have sourced the following items for this build:

  1. 2x Arduino Uno’s
  2. H- Bridge motor driver https://www.amazon.com/gp/product/B01GHKO5O8/ref=oh_aui_detailpage_o06_s02?ie=UTF8&psc=1
  3. Infrared Diode LED IR Emission and Receiver https://www.amazon.com/gp/product/B00EFOQEUM/ref=oh_aui_detailpage_o08_s00?ie=UTF8&psc=1
  4. Limit switches at each end of the Actuators desired stroke.

Features to include:

  1. Interrupt code, if the switch needs to be reversed when the actuator is in motion, there is a brief pause before heading back. (this is really bad for the actuators, but I must leave some safety option)
  2. IR transmission to turn ON/OFF TVs
  3. Recovery protocol if power is cut to the system
    (if a fuse blows mid-path or while the TVs are open, there must be a way for the program to recover)

There challenge in #1 & #3 is that the only input is signals sent to the Arduino based on 2 positions of the switch.
I plan on using the dry contacts of the relays to send 2 signals to the Arduino:
“Open” and “Close”.

Unfortunately these actuators do not include position feedback, so I will use limit switches at each end of the desired stroke to feedback to the Arduino.
I plan on using the opening of the limit switches as a signal to start the timing of my PWM function to properly time the stroke speed.
Here is the order of the Arduino program:

Open TVs

  1. Relay signal "open"
  2. IR signal "TV_ON"
  3. Actuator Powered "Forward"
  4. "full_Closed" Limit switch opens
  5. PWM function
  6. "full_Open" Limit reached
  7. Actuator Power Stops

Close TVs

  1. Relay signal "close"
  2. IR signal "TV_OFF"
  3. Actuator Powered "Reverse"
  4. "full_Open" Limit switch opens
  5. PWM function
  6. "full_Closed" Limit reached
  7. Actuator Power Stops

*Interrupt function = Pause before reversing circuit
*Safety recovery after power blackout

I’m used to programing on PicAxe microcontrollers.
I have ideas about how I would use the interrupts and multitasking to accomplish this type of program, on my old platform, but I’m still learning how to do this on Arduinos, so perhaps you could recommend better procedures than how I propose to accomplish these objectives.

Here is the motor controller I purchased for the job


There is no real documentation with this controller, it appears that a +5v to the "PWM" pin and a ground to the "DIR" pin will allow it to operate at full speed in a particular direction.
(The controllers are coming in the mail tonight and I will test them)

I am grateful for any insight you can offer that will point me in the right direction!
Thank you!
In advance.

If the linear actuators are powered by 120V AC then you can't PWM them. Some AC motors can be speed controlled. Some can't. See if you can find out what kind of motor is inside the actuator. If it is an induction motor, then a fan speed control circuit will probably work. If it is rectified to DC, then has a brushed DC motor you can hack into it and control it from an H-Bridge, except they are probably higher voltage motors than 12V.

That motor driver is for a brushed DC motor.

The DIRection pin will drive the motor forward or backwards depending on whether the pin is high (5V) or low (0V or GND). Use a Digital Output and set it high or low.

Drive the PWM pin with a PWM signal from the Arduino.

Thank you for your reply sdturner!

sdturner:
If the linear actuators are powered by 120V AC then you can't PWM them.

Sorry I did not give the specs of the actuator. It runs on 12V DC @5Amps peak.
(the power supplies in the picture are 12v)
The AC is only for the relay coils to move the dry contacts (that are fed by the 12V supply)
I had to put the power supplies close to the actuators because of the great distance to the switch.

I will now use the contacts on the relay to supply the Arduino the "open" & "close" signals and send the 12V to the controller board in the picture.

sdturner:
The DIRection pin will drive the motor forward or backwards depending on whether the pin is high (5V) or low (0V or GND). Use a Digital Output and set it high or low.

Drive the PWM pin with a PWM signal from the Arduino.

I think you are right. That is what the example circuit seems to indicate, I'll test it out soon when I get the delivery.

My main inquiry is the code.
I need to run a polling function to look for the switch being thrown, whilst running the PWM function.
With PicAxe I would just use the multi-task function, but I don't know where to begin with Arduino.

since mine is mainly a programing question, should I post to that forum instead?

Thank You

I've received my Motor Controllers and I ran into a problem.
Other buyers have reported this driver gets extremely hot.
Before I write my Arduino program, I tested the driver circuit with the included example test circuit.

When connected to "Motor2" (as per the diagram) the circuit works, however when you supply +5Votls to the "Dir2" pin Mosfet "Q1" (shown by the red arrow) gets SUPER HOT. However, when you put "DIR2" pin low the circuit works and all of the components are cool to the touch.

I tried the same circuit on "Motor1" and this time +5Volts was fine, however -5Volts on "Dir1" pin caused Mosfet "Q7" to overheat.
I've tired to limit the current to the direction pin by putting a 10K resistor in series, this makes no difference.

I've noticed that when the 12volt motor line voltage is switched "OFF" there is no overheating on the mosfets. This leads me to guess that the design of this board is causing some misoperation with the Gate and Drain of the Mosfets, and the effect is mirrored on each motor path.
Unfortunately I'm not smart enough to come up with the specific location of the fault.
This board has been sold many times and has positive feedback, so I'm not sure how others are using it without this problem . . . (could that be an hint as to a work around?)

Another thought I had was that perhaps somehow the diodes built into the limit switches of the Linear actuator could only cause the problem with these actuators and not regular motors. I don't have any other motors I could test it with, but I kind of doubt this is the problem.

You can tell by the traces how the "H" bridge is arranged, but if you wish I can also include a picture of the under side of the board.
I'm sure this would be a simple problem to solve for someone familiar with advanced "H" bridge design. Any insight would be greatly appreciated.
Is there a way I can work around this problem?
I purchased other motor drivers, but these were much more expensive and higher current rated, it's a shame that they are the ones to cause an issue.

Hi,
I see that you are testing with PWM pin connected to +5V
I found this in a review of the board.

So far, so good.Running two 12V linear actuators off of i ( 0.65 Amps with no load, max of 5A).Note *: If you are using an arduino , do not set the PWM pin to 255! This is rated up to 99% of PWM, you will see a significant voltage drop if you maintain 255. 252 is the max I run it at.

So if you connect it to your Arduino and drive it properly, with less than 255 PWM, it may work.
I wonder if this PCB suffers H-Bridge Shoot Through at full 5V on PWM input pin.

Tom.... :slight_smile:

TomGeorge:
Hi,
I see that you are testing with PWM pin connected to +5V
I found this in a review of the board.
https://www.desertcart.ae/products/31838000-uniquegoods-h-bridge-dc-dual-motor-driver-pwm-module-dc-3-36v-15a-peak-30a-irf3205-high-power-control-board-for-arduino-robot-smart-car

So if you connect it to your Arduino and drive it properly, with less than 255 PWM, it may work.
I wonder if this PCB suffers H-Bridge Shoot Through at full 5V on PWM input pin.

Tom.... :slight_smile:

Thanks Tom.
I saw that post as well. I intend to use that seeing as the upper limit of my PWM . However, since one direction works fine with +5 volts and the 0 volts causes the heat issue I'm doubtful that the pwm adjustment will fix it. However I will try it and see.

What concerns me, if you are right, then this board is incapable of proper operation without a specific PWM being used.
It seems like the simple test circuit displayed should work as advertised. . .

Anyway, I guess we will see when I try it. I might be able to get it working this evening.
I'll report back with the results.

I contacted the seller this was my message:
Hello,
For your Motor controller I set up your test circuit. Other buys reported "Motor controller gets extremely hot", they are right. I found one source of the problem.
I used an Arduino for the 5Volts and a 12V supply to control a motor in a 5 Amp max Linear Actuator.
I used 3Amp fuses, so the power was never too much for the driver.
The Dir2 pin controls the direction. The circuit works in both directions with the test circuit, however, when Dir2 (or Dir1) is set "high" with 5 volts then "Q1" Mosfet gets SUPER HOT (I can smell it!)
I have tried putting a 10K resistor on the +5 volts to limit current, but the same results.
Next I tried using the "Motor 1" side.
This time when "Dir1" = LOW then Q7 Mosfet gets SUPER HOT.
Please tell me, Is there a way to correct the Motor Driver by adding components, or is there no way to fix this bad design?

His reply:
"Add a heat sink"

Lol, NO!!
I told him 4 reasons why strapping a heat sink will not make this problem go away and requested a schematic.
Here it is:

I'm not sure how useful this schematic is in troubleshooting, because this only shows 1 channel, so I'm sure a lot of other things are missing.
Also, why doesn't this say: " +36 volts" since that is what the board is advertised as?
Anyone smarter than me see any smoking guns from this though?
Or is this how the board 'should' have been designed?
Did this guy just throw me a generic diagram?