How about a solenoid that clicks into holes in the base, and only when moving do you activate the solenoid for just long enough to disengage it, then stop when it clicks into the next hole?
I feel like that could be the most accurate and "solid"
How about a solenoid that clicks into holes in the base, and only when moving do you activate the solenoid for just long enough to disengage it, then stop when it clicks into the next hole?
I feel like that could be the most accurate and "solid"
One thing puzzles me: in my mind a controller is a panel with buttons, a microcontroller board or a combination thereof.
If this is super dodgy, why replace motor and encoder?
Other questions:
Does your turntable have a locking mechanism to position and lock at every exit?
Are the exits evenly spaced (like Fleishmann 15°, Märklin 12°)?
Will it be manual control (stop at the next exit) or automated (house end or non-house end at exit number #)?
It is a button directly connected between the power supply and a motor.
The current system is garbage. The motor is a little 5v thing that is gutless, the belt drive slips if it's loose enough not to break, and breaks if it's tight enough not to slip. It is not smart, rather you hold a button down till it's the right spot and then release.
Yes, it currently has a solenoid that clicks in, when it stops moving, you release the button. To move to the next spot, you have to press and hold the button again.
Unfortunately, no. It has been customized.
We want it automated. Press a button, and it automatically moves to the corresponding spot. Or to just turn 360 for turning the train around. I was thinking one button per track, and one extra as a 360 button.
It is for a HO scale layout.
For an automated system I suggest not those buttons.
To start a movement: push a button for house end or one for non-house end and one for the exit desired.
A button for 360° is useless, you might wish to turn the table 180°, but that can be done with the buttons here above.
Whether you count the exits passed or use an encoder, the ‘zero’ problem remains.
You addressed two different (independent) problems: motor and control.
Automation of control is a wish, solving the motor problems is a necessity.
I assume that the motor, flimsy as it may be, is strong enough to move the turntable.
I also assume the driving belt is a V-belt, it may have teeth for use with smaller belt wheels, but it’s not a timing belt (correct me if I’m wrong).
A small amount of grease may cause slippage of a V-belt.
Unfortunately, cleaning agents you might use for cleaning the wheels may attack the belt itself.
I’m looking at the Fleishmann stuff for ideas, they have more experience with model trains than I have (duh).
Fleishmann wants the user to release the knob before the desired position is reached.
From your description I understand that in your case the user releases the knob (or button) after the turntable got locked.
This causes the belt to slip every time, smoothing the sides of the belt, making it lose friction.
Depending on the actual control mechanism, saving the next V-belt may be in educating the user.
You make it so that when the lock engages, the motor is turned off, no matter what position the button is in.
Tom..
I’m not gonna buy an item of several hundreds of dollars to study it, so I’m making a (educated) guess as how the Fleishmann turntable works.
When the user pushes the knob the lock is pulled and the motor starts running.
When the user releases the knob the motor and lock coil are no longer energized, but the turntable will keep on moving on inertia, the lock pin comes out and slides along the wall until it finds a hole to lock in.
The user will learn by experience to watch the movement of the turntable and not release the knob too soon.
Yes, but I think a simple light barrier consisting of an LED and a phototransistor is sufficient.
I don't think you need that, because with a geared stepper motor you can align the tracks suffiently exact. And if your stepper controller knows at which position to stop it can start decelerating early enough.
You might find this thread interesting and applicable.
The OP has gone but some interesting thoughts here.
I can think up a control system for lightbarriers:
The user switches on the LED at the desired exit.
When the phototransistor in the moving part sees the LED, the motor is switched off.
A bit more sophisticated: a phototransistor behind a wide slit for deceleration and one behind a narrow slit for positioning.
Still the user needs to choose to start CW or CCW, so no automation.
I am using MobaTools for my N-scale turntable with great results including Homing at startup. I am wanting to add a button for Homing in case the table gets off-sink during use but have been unable to get it to work. When the button is pushed, it only moves a small distance.
Here is my code:
/* Position a stepper according to buttonpresses
* The stepper is connected by means of a step/dir driver
* The buttons are connected between pins and GND ( using internal pullups )
*/
#include <MobaTools.h>
const int stepRev = 1600; // steps per revolution ( 1/16 microsteps )
// adjust stepper pins to your needs
const byte dirPin = 11;
const byte stepPin = 12;
const byte enablePin = 8;
// create stepper object
MoToStepper myStepper( stepRev, STEPDIR );
// create button objects
const byte buttonPins[] = { 6,40,42,44,38,52,50 }; // adjust pins to your needs
const long stepperPositions[] = { 0,65, 213, 242, 258, 274, 295 }; // in degrees, must be same number of elements as buttonPins
const byte buttonCnt = sizeof(buttonPins); // number of buttons/positions
const byte halPin = 7; //Hal effect Pin sensor
const byte homePin = 46; //Homing button Pin
MoToButtons myButtons( buttonPins, buttonCnt, 20, 500 );
// ******* Home Function *****
void homing() {
myStepper.rotate(1); // myStepper.doSteps( stepsPerRev );//Should work also, at least after one revolution the sensor should be hit.
while ( digitalRead(halPin) ); // wait until we pass the sensor
myStepper.doSteps(50); //PUT 50 IN HEAR AS A FINE TUNE AND LINES UP PERFECT
while ( myStepper.moving() ); // wait until movement is finished
myStepper.setZero();
}
void setup() {
Serial.begin(9600);
myStepper.attach(stepPin, dirPin);
myStepper.setSpeed( 50 ); // = 60 rpm
myStepper.setRampLen( 100 ); // 100 steps to achive set speed
pinMode(homePin, INPUT_PULLUP);
//myStepper.attachEnable( enablePin, 100, LOW ); // if you want to switch off power when stepper reached position
homing(); // CALL HOMING FUNCTION
}
void loop() {
myButtons.processButtons(); // Check buttonstates
for( byte pos= 0; pos<buttonCnt; pos ++ ) {
if ( myButtons.pressed(pos) ) {
// Button was pressed, move stepper to the according position
myStepper.write( stepperPositions[pos] );
}
}
if (digitalRead(homePin) == LOW){
homing(); }
}
Any thoughts?
Hi,
it isn't a good idea to hijack an old thread for your problem. It would be better to open a new topic.
At first glance I cannot see a problem in your code. May be some Serial prints - especially in the homing() function - are an idea for debugging?
I am sorry for this. I have attempted 2 previous new posts without any responses. I’ll add some tags to them to see if that helps.
Thanks!
Where did you publish these posts? I can't see any posts from you other than the ones in this thread.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.