Software Support > Automated Projects

Beginner's Guide (Inputs)

<< < (6/6)

DaOld Man:
Ok, sorry about the long pause between posts.
I think we were ready to move to the inputs.
Why do we need inputs? Well, there is an option where you dont need inputs at all with MRotate.
You can use the built in timers to stop the rotation, you just have to disable the warning messages that would pop up when a maximum time limit is reached.

I dont recommend this because in the real world the time it takes to rotate your monitor can vary. Timers on the other hand are precise. So if something slows down your rotation MRotate could time out too early, resulting in a monitor that is not quite horizontal or vertical when it stops rotating, or the monitor could travel faster, causing the monitor to be past the desired position.

In my opinion, the best way is to have switches that activate when the monitor has reached its end of travel.
A switch works in the real world.
These switches tie back to your computer to signal when they are activated.
While the monitor is rotating, Mrotate is scanning the input pins on the printer port for the pin being activated. When it sees the input change states, MRotate turns off the drive outputs, thus stopping the motor.
The time limits in MRotate are designed to stop the motor after a period of time. If the switch is not activated within that time limit, then MRotate assumes something is wrong, IE the motor or the rig has locked up, or the power to the motor is bad.
So even though the time limits in MRotate can be used to stop the motor normally, the preferred method is to use switches that activate when the monitor has reached its end of travel rotation.
The time limits are really a safety function.

The switches (or limits) signal the computer by changing the state of one of the printer ports input pins.
The printer port has five pins that are easy to use as inputs.
These are pins numbered 10, 11, 12, 13, and 15.
These pins normally return a "high" to the computer when connected to nothing. But when connected to ground (pins 18 through 25 of the printer port), they return a "low".
This is true for all pins except pin 11. Pin 11 is inverted (or opposite). It normally returns a low, but when connected to +5VDC, returns a high.
Using the printer port pins as inputs for our MRotate is very simple. Connect the common on the switch to the printer ports ground and the NO or NC on the switch to one of the input pins.

The printer port pins that Mrotate uses are:
Pins 2 through 9: Outputs (Turns something on)
Pins 10 through 13 and 15: Inputs (Monitors something).
Pins 18 through 25 are grounds.

Now that you understand inputs, Mrotate allows you to utilize 2 as horizontal and vertical limits and 1 as a stop button.
MRotate3 has an added feature of allowing you to use an input to monitor a parking brake.

Next I will discuss more about using NO or NC on the switches.


[0] Message Index

[*] Previous page

Go to full version