Jump to content
 

DCC Controlled (PECO) Turntable Project using a Arduino Uno


Recommended Posts

The enable pin shuts down the FET's entirely, so there is no power to the stepper at all.  That might be a useful feature for manually positioning the table but it doens't provide any holding current.  That is what I'm excited about with the DRV8880.  For years, I've used driver boards using the older A3977 for my former Sherline CNC lathe and mill, and current lathe, with the enable line jumpered "on".  With open-loop control one just can't take the risk of powering down the stepper and hoping nothing moves...

 

Randy

Edited by zephyr9900
Link to post
Share on other sites

The enable pin shuts down the FET's entirely, so there is no power to the stepper at all.  That might be a useful feature for manually positioning the table but it doens't provide any holding current.  That is what I'm excited about with the DRV8880.  For years, I've used driver boards using the older A3977 for my former Sherline CNC lathe and mill, and current lathe, with the enable line jumpered "on".  With open-loop control one just can't take the risk of powering down the stepper and hoping nothing moves...

 

Randy

Ah, OK. I see where you are coming from.

Link to post
Share on other sites

Before I found the DRV8880 I was thinking--maybe I could disconnect the current-setting pot of an A4988 or similar from Vref, and supply a Vref replacement by a PWM output from the Arduino keeping a small cap charged for smoothing...  That would theoretically allow setting the stepper current through software.  But that's crazy thinking. ;)

 

Randy

Edited by zephyr9900
  • Like 1
Link to post
Share on other sites

Rigid, that's a nice little backplane you've made.  Smart design--not threading traces between the pads etc.--I'll probably do something similar for my setup.  I have a small desktop CNC and can do boards by trace isolation routing with a sharp V-bit, which doesn't lend itself to traces between pads.

 

And I like the bellows coupling you used in lieu of the more common helical-beam.  When you're going to the trouble of backlash compensation in the software, things like that just complete the package.

 

Randy

Link to post
Share on other sites

Rigid, that's a nice little backplane you've made.  Smart design--not threading traces between the pads etc.--I'll probably do something similar for my setup.  I have a small desktop CNC and can do boards by trace isolation routing with a sharp V-bit, which doesn't lend itself to traces between pads.

 

And I like the bellows coupling you used in lieu of the more common helical-beam.  When you're going to the trouble of backlash compensation in the software, things like that just complete the package.

 

Randy

 

Thanks Randy, No point doing half a job :)

Link to post
Share on other sites

I have had a fair bit of interest in the board I made.
Pricing is as follows:

 

Bare board - £20 Incl. P&P

Complete kit (less Nano but including A4988) unassembled - £30 Incl. P&P

Complete kit (less Nano but including A4988) assembled and tested- £40 Incl. P&P

 

Comparable pricing with Uno and Adafruit shield pricing but in a neater package with a DCC interface. :)

I have a few boards/kits left and if there is interest I will get some more in. I may start using the Micro Pro board as it has more interrupts (the Nano and UNO only have 2 I/O ports capable of interrupt!).

It will require some minor design changes but it is possible to hook up some of the I/O to pins to enable them to be user configured.

 

If anyone has any requests I might look at doing other DCC Arduino project PCB boards for lights or signalling?

 

Where is the best/most convenient place to upload my AccelStepper libraries with 'setBacklash'?

Regards,

Edited by Rigid Collision
  • Like 1
Link to post
Share on other sites

  • 3 weeks later...

I have a small desktop CNC mill (Nomad 883) and have just started to experiment with "trace isolation routing" fabrication of single-sided PC boards.  This involves drawing the traces in CAD, and using a small cutter (in my case 0.50mm) to rout the trace outlines just through the copper layer.  The turntable driver is my first fully-successful board.  It does not have DCC capability (which would be easy to add with a slightly revised board) but my use will be by manually throwing a momentary toggle switch on the fascia.

 

post-5795-0-14684000-1465675720_thumb.jpg

 

post-5795-0-24221800-1465675801_thumb.jpg

 

Pins 2 through 9 of the Arduino connect directly across to pins EN (enable) through DIR on the DRV8880, other than SLP (sleep) which I hard-wired to the +5V supply to keep the board "awake" permanently.  (I offset the DRV8880 strictly for space requirements so it appears that the pins are off registration.)  I am supplying the 5V logic supply using a Power Trends PT5101 switching regulator that I had surplus from an old CNC stepper driver.  This supplies enough current that I'll connect it to a bus under the upcoming layout to supply the 5V for the main DCC++ Arduino board.

 

The actual purpose of this post is to confirm that the Pololu DRV8880 board's current scaling does work well.  In my simple Arduino sketch, I keep the current at 25% while the turntable is stationary, and immediately before moving set it to 100%, returning to 25% immediately after the movement is complete.  Not an earth-shaking development for sure, but a power and heat savings given that the turntable will spend most of its life standing still.

 

For what it's worth, here my code

 

//Prague_TT
//Code to turn Prague turntable half a turn with momentary switch actuation

#include <AccelStepper.h>
#include <MultiStepper.h>

const int EN=2;
const int M1=3;
const int M0=4;
const int T1=5;
const int T0=6;
const int STEP=8;
const int DIR=9;
const long int target=2000; //steps per half rotation with 5:1 geardown
int Stepping= false; //is the TT in motion?
AccelStepper stepper(1,STEP,DIR); //define the stepper and the pins it will use

void setup(){
  pinMode(EN, OUTPUT); //output enable pin
  pinMode(M1, OUTPUT); //step mode high bit
  pinMode(M0, OUTPUT); //step mode low bit
  pinMode(T1, OUTPUT); //current set high bit
  pinMode(T0, OUTPUT); //current set low bit
  pinMode(STEP, OUTPUT);
  pinMode(DIR, OUTPUT);
  pinMode(10, INPUT_PULLUP); //trigger
  digitalWrite(EN,HIGH); // enable outputs
  digitalWrite(M1,HIGH); //put in 1/4-step mode
  digitalWrite(M0,HIGH);
  digitalWrite(T1,HIGH); //put in quarter-current mode
  digitalWrite(T0,HIGH);
  stepper.setMaxSpeed(9);
  stepper.setAcceleration(1);
  stepper.setCurrentPosition(0);
 }

void loop() {
  if (digitalRead(10) == LOW && Stepping == false)
  {
    Stepping = true;
  }
  if (Stepping == true)
  {
    digitalWrite(T0,LOW); //put into full-current mode
    digitalWrite(T1,LOW);
    stepper.moveTo(-target); //CCW since negative
    stepper.runToPosition(); //turn half a turn
    stepper.setCurrentPosition(0); //zero the position for next time
    digitalWrite(T1,HIGH); //put back into quarter-current mode
    digitalWrite(T0,HIGH);
  Stepping=false;
  }
}

 

Randy
 

Edited by zephyr9900
  • Like 2
Link to post
Share on other sites

  • 3 weeks later...

I have had a fair bit of interest in the board I made.

Pricing is as follows:

 

Bare board - £20 Incl. P&P

Complete kit (less Nano but including A4988) unassembled - £30 Incl. P&P

Complete kit (less Nano but including A4988) assembled and tested- £40 Incl. P&P

 

Comparable pricing with Uno and Adafruit shield pricing but in a neater package with a DCC interface. :)

I have a few boards/kits left and if there is interest I will get some more in. I may start using the Micro Pro board as it has more interrupts (the Nano and UNO only have 2 I/O ports capable of interrupt!).

It will require some minor design changes but it is possible to hook up some of the I/O to pins to enable them to be user configured.

 

If anyone has any requests I might look at doing other DCC Arduino project PCB boards for lights or signalling?

 

Where is the best/most convenient place to upload my AccelStepper libraries with 'setBacklash'?

Regards,

Hello everyone,

I am a model maker Italian excuse my English if not perfect.

Are some months that I follow this thread and am very interested in the next few months I have to command a turntable Peco in DCC.

Rigid you still platelets from vandere? I sent you a private message but I do not know if it arrived.

Thank you

Alessandro

Link to post
Share on other sites

Ciao Alessandro

 

When my command of Italian is better than your command of English, I'll have the opportunity to "excuse you"! It will be a while yet!

 

Meanwhile, just join in!

 

(By the way [bTW] you don't mean "command", you mean "order" :))

 

Best

Simon

Link to post
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Did anybody get a PCB from Rigid Collision, still haven't received the PCB promised and not replying to PM.

Hi, Apologies, been in and out of hospital rather a lot and on heavy medication (morphine). Busted my leg up real fine!

 

I have put two boards in the post to you, one blank PCB and one fully made up.

Link to post
Share on other sites

In other news... I have been testing other Stepper drivers and can confirm the DRV8825 and DRV8824 seem to work nicely.


 


The DRV8824 is a really good driver board if you have low amp stepper motors. I have tested it with 0.4a and 0.6a motors and it performs really well. It seems to eliminate microstepping inaccuracies that can be found with the A4988 (which manifest themselves as uneven microsteps). Fortunately the Polulu boards are all interchangeable (whew!).

Link to post
Share on other sites

Hi

I have been following this topic - Really good info, so I now have an operating turntable - Similar to original but have used a QRD114 infrared detector for indexing - works good. I have a Peco TT and the sensor just sits underneath the deck.I do have trouble with the bearing which is binding despite attempts to align nicely. 

 

I wanted to ask Rigid Collision where he got his PCB's done? I have been playing with eagle and I wanted a drive controller similar to his but with some extras ( I2C interface for things like a display) I have the board done and I am ready to have it built. I have only used soldering iron or wire wrap before so this is all new and I would like a good company to use. I am in NZ so China is OK for me.

 

Any help appreciated

thank you

Colin

 

ps first time using RM web so hopefully this message will arrive.

 

 

  • Like 1
Link to post
Share on other sites

Hi

I have been following this topic - Really good info, so I now have an operating turntable - Similar to original but have used a QRD114 infrared detector for indexing - works good. I have a Peco TT and the sensor just sits underneath the deck.I do have trouble with the bearing which is binding despite attempts to align nicely. 

 

I wanted to ask Rigid Collision where he got his PCB's done? I have been playing with eagle and I wanted a drive controller similar to his but with some extras ( I2C interface for things like a display) I have the board done and I am ready to have it built. I have only used soldering iron or wire wrap before so this is all new and I would like a good company to use. I am in NZ so China is OK for me.

 

Any help appreciated

thank you

Colin

 

ps first time using RM web so hopefully this message will arrive.

Hiya,

I used ALLPCB www.allpcb.com.

These guys were GREAT. Good communication fast production and despatch; just 5 days from submission online to receipt via DHL!

 

You are brave using EAGLE I tried to get to grips with it and found it mind blowingly buggy and awful. Having said that, my experience of delving into the world of PCB production was like turning the clock back 15 years software-wise. The world of PCB design seems to be populated with buggy and troublesome products that are hard to use and don't always deliver. Considering my 20 years designing 3d software (which is far mare complicated) I don't think it was my lack of ability and I was left totallyunderwhelmed.

 

In the end I used DipTrace, I ditched the idea of circuit diagrams and adding components in favour of just using DiptTace rather like a glorified version of Illustrator. It allowed me to simply draw a board and add pads and traces whilst snapping to a grid. It allowed me to add silk screen details easily and it exported flawlessly into Gerber files with a drilling file. All-in-all much less hassle that 'designing' a board and specifying components and circuits!

 

Regards

 

Link to post
Share on other sites

Hiya,

I used ALLPCB www.allpcb.com.

These guys were GREAT. Good communication fast production and despatch; just 5 days from submission online to receipt via DHL!

 

You are brave using EAGLE I tried to get to grips with it and found it mind blowingly buggy and awful. Having said that, my experience of delving into the world of PCB production was like turning the clock back 15 years software-wise. The world of PCB design seems to be populated with buggy and troublesome products that are hard to use and don't always deliver. Considering my 20 years designing 3d software (which is far mare complicated) I don't think it was my lack of ability and I was left totallyunderwhelmed.

 

In the end I used DipTrace, I ditched the idea of circuit diagrams and adding components in favour of just using DiptTace rather like a glorified version of Illustrator. It allowed me to simply draw a board and add pads and traces whilst snapping to a grid. It allowed me to add silk screen details easily and it exported flawlessly into Gerber files with a drilling file. All-in-all much less hassle that 'designing' a board and specifying components and circuits!

 

Regards

 

 

Hi

Many thanks for the info, by coincidence I found ALLPCB  on the web, before hearing back from you, and sent off a board, So will see how it goes. Eagle is quirky and a bit pedantic and it took me quite a while to get to grips. I like the way it goes from a schematic to a board, so it is easy to check. 

I will investigate DipTrace at some stage. Although having invested some time with Eagle I will persevere unless there are problems with the board

 

best regards

Link to post
Share on other sites

Hi, Apologies, been in and out of hospital rather a lot and on heavy medication (morphine). Busted my leg up real fine!

 

I have put two boards in the post to you, one blank PCB and one fully made up.

PCB's arrived, will order the parts to finish off the board over the next few days and hopefully get one up and running.

Many thanks, the boards look great.

 

It's been some time since I last played with the Arduino IDE, hope it still works after a Windows 10 upgrade on the laptop.

 

Ray.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...