Digital stand-alone turntable controller with automated indexing and stepper motor
A. Introduction
- The purpose of this project is to create a stand-alone and automated model railroad (any scale) turntable controller
- Hardware:
a. stepper motor: project is usable for any type of stepper motor but prefered option is the use of a 17HS2408 motor (NEMA17).
b. stepper motor driver: any motor driver module can be used but prefered option is a module with an onboard A4988 chip (https://lastminuteengineers.com/a4988-stepper-motor-driver-arduino-tutorial/).
c. indexing sensor: optical HC-020K sensor with accurate positioning sensing; only the sensor (no perforated disks). Hall effect is exluded due to its inacurate sensing repeatability and wide detection range. The turntable disk should be equipped with just one small protruding object that passes through the sensor "eye", mounted underneath the framework, out of sight. The purpose being that this object passes through the sensor eye once every 360 degree rotation of the turntable. This object may even be the size of a nail; as long as it passes through the sensor lips.
d. 4x4 keypad with pushbuttons (no membrane keypad).
e. a custom designed PCB (all required info for manufacture is included in this project file).
f. LCD display with 20x4 characters.
g. a 3D printable casing for this project, downloadable .stl files.
h. turntable track polarity control: ACS712-based sensor controls the DCC track polarity. Omron G6S-2 5VDC relay. Measured reaction time is 2 microseonds (using AVR AtMega328 at 16MHs)! Therefor it beats every short-circuit or overload detection including the DCC-EX Command Station.
- Software a. C++ custom software with a very wide range of options and features b. All software is freely downloadable from this project file
B. Description of features:
- Any size of turntable can be controlled
- Automated initial indexing and storage in eeprom is provided. Due to the very high accuracy (+/- 1 micrometer) of the optical sensor the repeatability is < 5 micrometer.
- Fast index location and programming for outgoing/incoming tracks is provided, storage in eeprom. The turntable will always move CW or CCW after the algorithm included calculates the shortest/fastest rotation
- Automated "shortest rotation" algorithm is included in the software
- Photo-electric sensor (based on HC-020K module) http://tinyurl.com/2ce3v4j9 or http://tinyurl.com/3nykkvw3 used for indexing calibration
- button A: assign the current position to an index number in eeprom
- button B: move to whatever position by using the keypad
- button C: calibration
- button D: designate a position (current position) from eeprom to current turntable indexed position
- button #: select an index position to be moved to
- Button *: select index position + 180° to be moved to.
- enter # or * before index selection so that the turntable alligns at 0° or 180°
- Rotary encoder rotation of turntable; RE button serves to set speed x10 or regular
- a "long press" of (adjustable) 500ms is included to prevent inadvertent keypresses
- include, upon calibration, the option to make a full 360° in order to calculate the stepper motor steps for a full 360° rotation.
- EEPROM storage of programmed track index positions
C. Documents
stepper motor 17HS2408-MotionKing.pdf
stepper motor driver A4988.pdf
Uploading stepper motor 28BYJ-45 12V.pdf…