Showing posts with label L298. Show all posts
Showing posts with label L298. Show all posts

Friday, 3 January 2014

And now it's all running nicely...

I've finally wired in the Arduino Mega 2560, the Pololu servo controller, a relay board to control the track blocks and the L298 motor system to drive the trains and the tram. 

It's all nicely tucked away under the layout and finally all trackwork is in place and a demo program is running which allows the train to run on every track section, exercise all the points etc.

I'll post more still shots later but for now, here's a video...




Next will have to be the 'real' software which allows for 3 engines to run on the layout at once.

Sunday, 6 May 2012

Arduino and Shift Registers - How Fast Is It?

I'm currently driving my test layout using an old Arduino Diecimila and a L298 dual motor controller shield from DFRobot.

This simply won't cut it in the long run. I will need to run more motor controllers and I want some flexibility around how to mount the motors - not as a shield. I found some very nice cheap controllers on DealExtreme for the outrageous price of $6.70 each. For this you get a full dual motor driver which can also be used for steppers. Only problem is it takes 6 lines to drive (3 per motor) instead of the 4 of the Shield. I need to drive the PWM direct from the Arduino. However, the direction logic now uses 2  lines per motor, not just 1, so I will need to use more shift registers to handle this to keep as many other I/O pins as possible free on the Arduino.

I now have a total of 48 bits of output from shift registers driven by 2 3 pin interfaces. Thats for bits of output for only 6 pins.

The real issue for me is how fast I can hammer the pins on a shift register from an Arduino. It turns out, pretty fast. Fast enough to do basic PWM with an LED.


You can see that the LED on the top left is pulsing in brightness. The LED on the right is simply flashing on and off as a heart-beat.

This is a nice little 24-bit setup. Looks like I can run 2 lots of 24-bits very effectively.

Next time I will test 48 bits from 3 pins on the Arduino.