# Controller Project



## cid (Jul 3, 2014)

> Controller Test<


Another project! Arduino based controller, surprised me by finally working... 😂


----------



## cid (Jul 3, 2014)

The system you see here is fairly simple, a basic PWM reversing controller. Future improvements will include momentum 
and integrated Reversing Section control using under-track detectors. Other kinds of automation are potentially possible.
Another future project hopefully will be a DCC++ base station.


----------



## Severn (May 13, 2016)

I made a DCC++. But have the parts for DCC decoder proj I found online. So this sends some DCC codes onto the track?


----------



## cid (Jul 3, 2014)

No, Severn, it's just a basic DC PWM controller. No smarts or decoder. DCC++ will come later! 😂
What board, motor driver, and code did you use for your base station?


----------



## Severn (May 13, 2016)

I used the pololu motor controller and just a regular arduino uno. all i recall is when you compile the arduino code you must set the flag for the board of interest or it no worky. after that it worked from a PC.

I'm getting ready to use it with raspberry pi i have laying around but have't gotten to it yet -- as the old PC laptop I was using got repurposed... 

so the board with the proper connectors will fit on top of the uno. i messed that up slightly but dont recall the details but got it to work anyway. (if you want to solder a lot of wires and have the bits to hold it all together in some reasonable way you could in my mind use "mini" style arduino board)

i have it here somewhere but it's boxed up at the moment and i can't fish it out just this moment.


----------



## vette-kid (May 2, 2020)

I'm getting ready to build a full Bluetooth DCC controller. Control will be through my phone and I should be into it for about $60-70 including the software license. I'll post a thread for it once I get all the components for it.

Sent from my Moto Z (2) using Tapatalk


----------



## Severn (May 13, 2016)

so the command goes to a box over bluetooth, which injects it onto the track?


----------



## vette-kid (May 2, 2020)

Correct, using an stm32 board as the foundation. Along with a Bluetooth adapter and a few other components.

Sent from my Moto Z (2) using Tapatalk


----------



## Severn (May 13, 2016)

i have a anduino or small board bluetooth adapter ... i got it from ... i think it was pololu. but its not by them. its a "bluesmirf" or something like that. never used it. i had (have) grandiose ideas.

i did make a bit of progress on an o-guage engine. i connected a raspberry pi with a pololu motor control board ... and connected up a ryobu 18v battery to that. it was a little messy. and connected that to "o gauge" test bed -- which basically two motors and the frame and wheel assembly on a track.

then given a wireless keyboard and remote terminal -- it was a x-window remote set up on a windows box from from pi -- and using pololu controller's software they supply -- i was able to primitively move the engine back forth on the track.

i even thought about logging into one of the forums and sending and post from it. but didn't do it.

but i never really went further. it was very clunky and i took all my o-gauge track down, in favor of doing something with HO. it doesn't help that i don't really quite know what i'm doing. i'm not a hardware person and just know enough to smoke a few chips kind of thing.

somewhat related -- there are a few wireless/battery DCC people out there. I'm not sure of the current offerings. One explained to me they send DCC command codes which are transformed into a quasi-track signal through the battery power right into the standard DCC engine controller.

So there's no base here -- it's direct engine control.

I thought that was kind of a nifty solution because it simply re-used all the engine DCC stuff except for the battery and wireless add on etc...


----------



## vette-kid (May 2, 2020)

Severn said:


> i have a anduino or small board bluetooth adapter ... i got it from ... i think it was pololu. but its not by them. its a "bluesmirf" or something like that. never used it. i had (have) grandiose ideas.
> 
> i did make a bit of progress on an o-guage engine. i connected a raspberry pi with a pololu motor control board ... and connected up a ryobu 18v battery to that. it was a little messy. and connected that to "o gauge" test bed -- which basically two motors and the frame and wheel assembly on a track.
> 
> ...


Loco genie would be the way to do that easiest. Uses standard DC controller, but the decoder comes with a remote control that directly controls speed, direction lights and sound (will also work on DCC). There is a user on here doing that setup for battery powered locos. I have a few of them running standard DC, They work great and run about $40/ea on eBay or about $70 retail.

Sent from my Moto Z (2) using Tapatalk


----------



## Severn (May 13, 2016)

i wasn't trying to discourage or sell you -- if you didn't know the info, but you do ... carry on with your own idea. are you thinking of a kind of open source proj maybe? that's what we don't have. lots private solutions.

i myself have the interest in an open source if you will engine dcc controller. i experimented with and made a very basic probably simplistic bemf detector for arduino -- it just reads the residual voltage on the line. when you depower the motor briefly, you see the bemf and can related to speed using various formulas. i spent a lot of time fiddling with this as i didn't really get it for a long time.

but i did this on an arduino and got it seemingly work. i stole another circuit that uses a IR reader, basically a tach similar to read the motor speed and compared them and they compare to me favorably on the "stand".

Anyway with that and a DCC decoder ... a little software maybe i could make the engine go a bit. or that's my idea.

it may be noted that other than typing this out i've done no work on it for months now.


----------



## vette-kid (May 2, 2020)

I'm not that good with stuff! Here's the web page for what I'm doing. I searched the forum and didn't see any on on this setup. He's done all the coding and provides the coding and software for Android, some or windows as well as a build sheet. You buy the hardware, out it together and use the instructions provided. 


Low Cost DCC Controller 

I decided to use this because I'm using the MRC loco genie in several engines. I wanted a cheap way to access the CVs on them and don't run DCC. Basically I'm going for budget setup. Right now I've got about $300 into a setup with about 300ft of track, 15 pieces of rolling stock, one Athern locomotive and several cheap Tyco and Bachmann pieces. All have been restored to running condition and work fairly well. 

Sent from my Moto Z (2) using Tapatalk


----------

