Level crossing gates controlled by an Arduino (part 2)
As I mentioned in my previous entry, one of the issues with a stepper motor is that you can only tell it to step! You can't get it to go to a certain position unless you have some mechanism to set a 'datum' point first. This often means that you have some kind of limit switch which you can run the motor against so you 'know' you have reached the limit of travel, and therefore, know that if you move a certain number of steps you will also be at a known position.
The practical issue with my first test rig was that if someone turned the power off while the gates were in anything other than the 'normal' position then on powering up the unit would think it was in the normal position even though it wasn't. This could mean that you then drive the linkage further than it should be driven.
To fix this I have laser cut a little unit which holds a micro-switch against a cam on the motor drive. The coding on the arduino now looks at start up to see if the micro-switch is on or off and runs the motor until it changes. The result is that now the unit resets the gates to a datum point on start up.
I have a base plate and some gates drawn up now so hope to have something that actually looks like a level crossing soon.
David
- 4
3 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now