02-14-2022 04:07 PM
Hey members,
I need help implementing stop end switches for a project. I was wondering how I can implement two stop end switches for a microscope stage moving on the x-axis. I am working on a project to automate this microscope using a motor. I need the motor to continuously move and when hits the stop end switch, it immediately changes the direction. I was also wondering what is the most efficient way to communicate the stop end switches using a pcb board NI-6251. Let me know if I am missing any information.
Thank you,
Ash
02-14-2022 06:18 PM
Please provide more information on the existing setup,
02-14-2022 07:15 PM - edited 02-14-2022 07:17 PM
Well a stop switch is just a Boolean that is either on or off, right?
Your NI-6251 has 24 DIO ports, use two of them one for each switch.
Initialize two DIO ports as inputs with internal Pull-up resistors.
Connect one side of switch to the DIO input.
Then connect the other side of the switch to ground.
When the switches are open the input of the DIO will be high because of the internal pull-up.
When a switch is closed the input of the DIO will be low and the switch is pulling it to ground.
Now is where it gets tough(er) you have to decide on how to monitor the DIO's for switch closure.
If you are moving in small increments, it could be as easy as:
Of course that is way over simplified but I think you get the idea...
A better way would be to create a separate process that constantly reads the DIO ports and uses a Messenger Channel or perhaps a Notifier to signal a motor control process to change directions or stop.
02-16-2022 03:54 PM
Power supply voltage DC: 6.5V-27V
The output voltage of our power supply is between 0V-18V
Our motor is 12V, 1.2A, 50 rp
The model is 7A/160W dual DC motor drive
We are using a motor driver connected to a NI-6251 board. The motor is currently controlled using Ni-daqmx digital signal.
The larger goal is to automate the motor to move a microscope stage with two stop end switches connected to the two ends of the x-axis plane. So far We figured out how to change the direction of the motor. Next, step is to implement the stop end switches which is what I am stuck on.
Thank you,
Ashiful
02-16-2022 03:55 PM
Thank you sir, I think this will be a useful guide for me to continue on my research.
02-16-2022 05:21 PM
In the case of end-stop switches, given your powerful motor, the reaction time has to be split second. If the motor controller is not directly monitoring the switch states and you might potentially damage your x-y stage or overload the motor.
In the case of a stepper motor, you can do this end-stop switch state check before sending a step signal, but given your motor is a geared DC motor, you've to check if your motor driver has such end-stop switch control for a faster response.
02-16-2022 06:22 PM
You are completely missing the basic premise of a stop end switch.
The switch should be installed so that it interrupts motor drive power. No software involved. It is advisable to MONITOR the switch state in your program but, the hardware must fail safe itself.
Now, some systems also employ a software drive limit that depends on position feedback and prevents the endstop from actually being reached but, that is not a end stop.