Raspberry Pi Zero Controlling Things

IBT_2 HIGH CURRENT 30A DC MOTOR DRIVER
Logic Voltage 3.3 to 5V.
Operating Voltage 5 to 27V (B+).
Control motor speed by PWM up to 25 kHz.
Motor forward and backward motion control.
Switched mode current limitation for reduced power dissipation.
Current limitation level of 30 A Current sense capability.
Over-‐temperature shut down.
Over-‐voltage lock out.
Large size heat sink is mounted to driver.

This driver uses two high current half bridge Infineon BTS 7960 chip for motor drive applications, containing one p-channel high side MOSFET and one n-channel low side MOSFET with an integrated driver IC in one package.
Interfacing to a Arduino UNO for DCC++ http://www.trainelectronics.com/DCC_Arduino/DCC++/index.htm, I also included a Green led and a 100 ohm resistor connected between GND and Pin 3 on the Arduino, as a visual aid to confirm the IBT_2 was operating correctly as in On or Off from JMRI.

...snip...

Very nice, John! I do have the IBT_2 Motor Driver already. Looks like you are a few steps ahead of me. I was planning on using the RPi3B in place of the Aurduino (might be more trouble than it is worth. Might just get an Arduino for that part, not sure yet.) and then use a few RPi Zero W's as the JMRI host and access point. I've been following Dave's site as well.
Again, I'm not as far along as you and Dave are so please keep up on the updates of your progress. As I head down my path, after I actually start building things rather than just plugging in USB cables, I'll provide updates as well.
 
At the risk of adding yet another American Greg here, last Saturday I attended a workshop on Arduino. RPI was briefly mentioned there and Arduino has been briefly mentioned here. What is the difference between the two? Pros? Cons?
 
At the risk of adding yet another American Greg here, last Saturday I attended a workshop on Arduino. RPI was briefly mentioned there and Arduino has been briefly mentioned here. What is the difference between the two? Pros? Cons?

I think there are more pips in a Raspberry Pie? :confused:
;):giggle:
 
We tend to think of pips more in terms of Gladys Knight than Raspberries, so, yeah, I’m a bit confused but I think it means Arduino is a bit less seeds between the teeth?
 
Hmm, haven't been by this site in a while. But this sort of thing is certainly near and dear to my heart!

Thought y'all might want to see what I've been up to. I'll confess that I've been trying to get something that I could put into production and perhaps make a few dollars from but for now it's just in beta test.

I've designed a board, similar to an ardunio (same processor atmega328) that accepts commands from an Android App (I have a couple of em) to drive DCC decoders using battery power. Communication is via Bluetooth. Here is a link to my latest install- it's a SoundTraxx TSU-4400 decoder, the GE version in an Aristo U25B. There is a quick video at the end of me honking the horn and such.

http://martinsant.net/?p=3682
 
i know everyone else is doing well with this arrangement, but I am not. Got the Arduino controlling the motor drivers and the Pi (in my case, a Nano W) doing the JMRI thing with my phone as the controller via WiThrottle.
Issue I have is that WiThrottle, or even JMRI when I install it on another RPi and connect thru USB, appears to toggle power on any of the motor shields.
The standard DCC++ code uses pins 3 and 11 as "enable" for power. This works thru the software... I can send the <1> (power on) and <0> (power off) via the serial interface in IDE, but when I use the regular implementation and attempt to use WiThrottle (or even JMRI on a connected RPi) I do not get the power to actually turn on.
To top this off, I was able to get this arrangement to work correctly when I connected a SPROG II (via USB) to the system. That would work correctly.
But when I substitute my Arduino/DCC++ BaseStation, I cannot turn on the power.

Please, please!!! Somebody tell me I'm an idiot and missed something blatantly obvious and I will happily learn my lesson and go on, powering trains...

At the moment, very, frustrated. I really, really do not want to have to pick apart JMRI ...
 
Thanks John!

I think it was more the calm cadence of your various steps than the actual checkpoints, but in going over everything I got it all working!!! Sometimes I just need to take a step back, start at the beginning, and look at it again without putting the "find what's wrong" glasses on.
Now to figure out some of the funny little quirks (I'm talking decoders here) that I'm pretty sure are attributed to the particular manufacturer and not the DCC++ system. One example so far is that an electric locomotive (panto-graphs) I have has an LGB 55027 decoder in it. I have functions 1, 2, 3, and 4 operating relays to move up and down the front and rear panto-graphs. Those all work fine. But the front and rear lights, all on the "lights" or "F9" function, do not work at all with the DCC++ controller. Lights on my other locos do work fine so I'm sure it is something with how the 55027 is translating the inputs.
If I find the results interesting, I'll certainly post them.
 
Very interesting thread. I'm using ESP8266s (Wemos D1 mini pro) to control my locos over my local network extended into the garden. Not DCC, no JMRL (had to google that!), just bespoke software with a hand-held controller and tablet/pc/phone option. Works well.

Michael
 
Last edited:
Try this....
Open Throttle for this particular Loco, click on Lights button for properties, by default Function Number is 0, change to 9?

Hi John,

Thanks for the suggestion. I had actually tried F9 originally as well as the Lights (F0) button with no success. I did try your suggestion as well, but it also did not work.
I do remember other folks having issues with lights going on and off on various speed steps and this was a result of some conflict between the 14 and 28 speed step settings with LGB equipment and CV29 (and I'm implying a huge "I think" in there...). I'm thinking the 128 speed steps of DCC++ are messing with the 55027 a bit. I haven't checked the settings of that decoder but have a feeling the issue is probably hidden within its various quirks of trying to obey many masters. At the moment, it's not critical. I'm still getting up to speed on JMRI and getting panels and throttles set up so they show up as I want on WiThrottle. I've used DecoderPro for a while but didn't dive into panel and throttle control at the time. I just liked the fact I could run my SPROG and program decoders consistently!
 
Indeed to get F0 ligths working properly with my non-MTS system (Lenz) I always have to switch the loco to 28 speed steps.
 
Yup, that was it. For some reason I had left the 55027 on 14 speed steps. Shoulda known better! I still like my old LGB MTS stuff, but the old 14 step limitation of MTS is just such a PITA.
Or, I guess I should say, "colorful characteristic".
One of the minor reasons I'm building a DCC++/JMRI controller!
 
Back
Top Bottom