Notifications
Clear all

XODding for Arduino

5 Posts
2 Users
0 Reactions
1,140 Views
(@toolmaker)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

Hello Everyone, I am Steve, 73yr old from Fremantle, Western Australia, currently working on an automatic turntable for my train club and stumbled onto Bill's tutorials on XOD programming. I struggled with C++ coding to instruct my arduino to rotate it so I am hoping somebody can assist with XOD nodes. I am still willing to stick with C++ if there is anybody with enough patience to teach me.

Kind regards from Downunder

Steve


   
Quote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 
Posted by: @toolmaker

I am still willing to stick with C++ if there is anybody with enough patience to teach me.

Hi Steve,

I'd be glad to take a look at what you're doing.  If you can post some information about your turntable.  What model of turntable are you using?  Is it a home-built turntable or a kit?   Can you provide any wiring information you have concerning how your table table is wired and how you know when it has turned to a new position? 

You should probably start a thread on this in the Model Railroading section here: Model Railroads.

There are other model railroaders here as well.  I'm sure someone can help you out.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@toolmaker)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@robo-pia 

Hi James,

Thank you for your interest in my problem. I will prepare some data and diagrams and re-post it. I am building this for my local railway club and there is no urgency involved at all. Very basically, I have a custom built turntable in N-Guage and I have designed the trackpositions around a proprietry 6-stall model engine stable which has each entry track at 7.5 degress radially spaced. The other exits and entries are all denominations of 7.5 degrees ie; 90, 45 and 15. My idea was to have 5 press buttons on a breadboard labelled ACW 7.5 - ACW90-HOME- CW90 and CW7.5.  I would require the HOME button to send the stepper (28BYJ-48) to a nominated entry track position after the system is made active. Then if I pressed the ACW7.5 say 3  times, the stepper should travel 22.5 degrees anticlockwise, similarly, if I pressed the CW90 it would go 90 degrees clock-wise. Any time I press HOME it must go to the entry track again. That is a nutshell description of my needs and I have an Arduino Uno clone(freetronics eleven) with stepper driver mini-board. I have succeeded in making the Stepper go using the sketches in Arduino library with C++ but I have given myself a headache trying to program my above instructions. LOL'.

Kindest regards, Steve


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 
Posted by: @toolmaker

I would require the HOME button to send the stepper (28BYJ-48) to a nominated entry track position after the system is made active.

Getting the thing to know when it's in the home position is the key here.   Stepper motors don't know where they are at when they are first turned on.    So you would need to have some way of detecting that the turntable is in the HOME position.   Once you have a method of sensing this then you can do all your other rotations relative to the home position.

So the first thing I would suggest is to set up way to have the Arduino know when the turntable is in the HOME position.   This can be done many different ways.  Probably the simplest way would be to use an LED and light sensor.   Although you could also use a magnet and reed switch, or a hall effect switch, etc.   You could even use a mechanical switch that is somehow set up to only be turned on when the track is in the HOME position.

The method you use to detect the home position is up to you.   But that would be the first thing you'd need to do.  Once you can tell when the turntable is in the HOME position, then everything else can be done by just counting the numbers of steps to the next position.    Then once you know that the turntable is in that position you can go to any other position from that  position in the same way.

But  you'll need to have a way to verify that you are in the home position at startup.   Or if you aren't at the HOME position at start up, then you'll need to have a way for the Arduino to detect it so if can find the HOME position.

You can't just tell a stepper motor to go to a "HOME" position because they don't have a HOME position to go to.   That has to come from the device the stepper motor is driving.   In this case that would be your turntable.

 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@toolmaker)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

Thanks James, I will test out a way of "homing" onto the entry track as it needs to be pretty accurately lined up.Maybe someone in the model railway forum will point me. How do I copy my post to there.

Cheer,

Steve


   
ReplyQuote