Limit switch in MEGA2560

Thread Starter

LAOADAM

Joined Nov 21, 2018
879
Like I posted before I'm making a many limit switch project, it is kind of mess to post diagram here, let me try to descript the situation.
One of the limit switch named as UP, paired use with DOWN, these two switches control the U/D motor.
Now, the motor turning Clockwise when the limit switch UP trig , it is right; but the motor did nothing when the limit switch DOWN trig, and designed the motor should turning counterclockwise.
All condition same, wiring same, sketch set same, what can be the reason then?
Thanks
Adam
 

ScottWang

Joined Aug 23, 2012
7,400
I’ll second that opinion. I couldn’t make sense out of your verbal description.
I’ll third that opinion, because everyone see the schematic, can be focus on the same picture, but only the description may causing many different viewpoints from different imagination, that will be waste time and can't be catch the right thought of TS which from his description.
 

MisterBill2

Joined Jan 23, 2018
18,505
Providing a USEFUL verbal description takes both skill and practice, as well as understanding what you are describing. Draw out the circuit using standard electrical symbols, and then either scan it or take a picture of it and post that.

But the reason your circuit does not work in reverse is because the reverse connections are not being made through that limit switch.
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
879
Thanks for all.
Sorry of my poor English.
I replaced a piece of wire - say use B replaced A - solved the problem, the limit switch working well now. I still didn't figure out the reason yet, the A is measured good, just can't make the machine running, it even CAN make the limit switch function well. anyway.
Best to all.
 

MisterBill2

Joined Jan 23, 2018
18,505
This gas happened before, And I have had it happen to me. Especially solid wire can develop an internal break and only when installed the break opens up, but when you go to check the wire the insulation pulls the ends to touching. The second cause is the test clip leads that are such skinny wire that they will not carry any load.
 
You can't have a limit switch determine the direction. It can determine what direction it can't go.
You have something like:
1 0 at up
0 1 at down
00 somewhere in the middle
11 something bad happened - you should probably stop.

Watch for motor over-runs if your not using dynamic braking. Your motor can overshoot the limit.
DC motor control with SPDT relays generally uses two of them. One for UP and one for DOWN. The common of the relays are grounded. Each relay can apply +V or ground to the motor. When no relay is active, the motor is operating into a short as a generator and stops very quickly. When they are both on, the same thing happens.
 

MisterBill2

Joined Jan 23, 2018
18,505
Certainly it is possible to have limit switches set the direction. Not as common a setup, and a bit more complex logic, and definitely not the traditional approach.
And to avoid overshooting limits the switches would be positioned to allow a coast to a stop, or else to enable dynamic braking. Both schemes can work well. but both are definitely not the traditional approach.
 

MaxHeadRoom

Joined Jul 18, 2013
28,687
I replaced a piece of wire - say use B replaced A - solved the problem, the limit switch working well now. I still didn't figure out the reason yet, the A is measured good, just can't make the machine running, it even CAN make the limit switch function well. anyway.
The very first thing in any project, such as logic control etc, unless extremely trivial, is to make a drawing, preferably in a recommended format with suitable labels etc..
Not only for when seeking help but for your own reference for installation, wiring and any future maintenance. :cool:
Max.
 
Top