By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Arc Euro Trade

Motor Control

All Topics | Latest Posts

Search for:  in Thread Title in  
Stub Mandrel05/05/2012 20:35:13
avatar
3078 forum posts
255 photos

I'm at the stage of making a motor controller for my 3 1/2" gauge shunter. I'm aware that many small electric models like this simply use a multi-step ressistor ladder. I have the opportunity to be a bit more creative as I'm doing it electronically (with only a 7Ah battery I don't want to waste any watts!) The actual controller is made, but I need to design the handheld 'control box'.

But with no driving experience what sort of controls do I need? I've got two SPDT relays to give reversing and back-emf braking, a 'horn' and I imagine a 'failsafe' that stops everything if handhel controller and engine part company will be essential.

But how should I control the speed. Will an 'up and down' button be the best way, or should it be possible to rapidly go to any setting with a rotary control? If I use +/- buttons, should they respond quickly or take a whiles to ramp up and down?

I can have up to 255 steps from off to full on, but I get the idea that most people only use a few - and fewer steps means faster reaction to the controls.

I won't be in the position of being able to nip back and forth between track and workshop, so a solution that should work reasonable first time is what I'm hoping far!

So , lots of ideas but NO practical experience - all suggestions welcomed.

Neil

Ian S C06/05/2012 11:26:49
avatar
2642 forum posts
93 photos

I wonder if a slider type pot would be better than a rotary one for speed control. Ideally I would imagine a control with foreward on the control, foreward motion, center off, back to reverse. Push button for horn, toggle switch if diesel sound effects are installed. Just my ideas Neil.

Ian S C

Keith Long06/05/2012 12:26:26
356 forum posts
3 photos

Neil

Just a thought - have a look at the motor speed controllers used for RC models generally referred to as "ESC's" (electronic speed contollers). They can handle some VERY impressive currents and do it by pulsing the current to the motor rather than wasting precious battery capacity in resistors. You might have to make up a simple circuit to give it the contol signals it requires (emulating the receiver output) - or just buy a servo tester for about £2.50 and drive it from that.

Have a look on the Model Boats website for a number of suppliers. You'll also find the makers (suppliers) of thse units are very heplful and usually respond well to an e-mail or phone call for advice.

Keith

Les Jones 106/05/2012 14:33:29
793 forum posts
48 photos

Hi Keith,

My understanding is that Neil has built the speed controller. (I suspect from other posts and that he has 255 steps on the speed control he is probably using one of the Atmel range of microcontrollers to implement PWM motor control.) I think he just wants others opinions on the design of the user interface. ( Like Ian's suggestions.)

Les.

AndyP06/05/2012 15:24:29
111 forum posts
4 photos

Neil,

My little electric has a rotary pot for speed, DPDT switch on the loco for forward/reverse, I find the pot is really a two handed job so not ideal, it also means the youngest driver can throw the switch at full speed for some dramatic effects!

Our club loco has a sprung lever throttle which is very nice to drive and if you drop the controller the loco stops!

Loco looking excellent btw.

Andy

Andrew Johnston06/05/2012 16:13:17
avatar
1095 forum posts
139 photos

Ideally one would use a slide potentiometer; but quality ones are expensive and they're vulnerable to getting crap in the works. From a practical point of view I'd use a sealed cermet rotary potentiometer.

I wouldn't have thought that 255 steps would be a problem vis-a-vis response time. At any decent repetition rate one should be able to keep up with the potentiometer. You don't have to use all the steps in sequence. One could always use a 'look-ahead' term to anticipate fast movement of the potentiometer - a sort of electronic turbo charger.

Regards,

Andrew

Bazyle06/05/2012 19:52:29
609 forum posts
30 photos

A rotary control is the easiest and perfectly satisfactory as uses on 90% of model loco controls. However if you have children using it then firstly a spring is sensible and secondly a sector plate on the knob that covers the reversting swtich except at zero.

Another consideration is a cutout linked to a breakaway cable that can also be used for disabling the loco if you need to leave it for a minute but with everything else connected.

Stub Mandrel06/05/2012 20:47:43
avatar
3078 forum posts
255 photos

Thanks folks.

Les is right, I've built a PWM controller using an AVR that works the same way as an ESC with plenty of 'headroom'.

I have started playing around with toggle switches one biased to the centre up for faster, down for slower, the other forwards/off/reverse. the nice thing about filtering these through a chip is that you can make sure it waits a few seconds between direction changes. I also think an emergency stop that won't let you restart until the direction switch is put on off would be wise.

But I've already discovered that with a toggle switch setting the PWM speed quickly and accurately is not easy! I think some sort of cleverness where a brief click advances it slowly, hold on it goes faster, might help.

I like the idea of a sprung lever on a potentiometer, with a nice brass lever on it. Es[pecially like the chance to build in some engineering!

It means I'll have to redesign the controller with a chip with A2D on board though. I can have instant response or build in a time delay.

I will make it so the loco stops if the signal from the control box stops. As the loco will supply power to the box, it will always poautomatically start up in the 'safe' condition.

Neil

Les Jones 107/05/2012 14:13:31
793 forum posts
48 photos

Hi Neil,

In the code that looks at the switch you could have a timming loop (Or use one of the timers) that increments a counter while the switch is closed. If the counter reaches a prest value the code could then start incrementing the set speed value. ( You could even have a higher preset value that would increase the speed at a higher rate but I don't think that would be needed in your application.) If the switch opens before the preset count is reached then you would just increment the speed value by one. I think I have written code to run on a PIC for this sort of thing. Let me know if you would like me to try to find it.

Les.

Edited By Les Jones 1 on 07/05/2012 14:16:14

Skarven07/05/2012 14:30:49
avatar
82 forum posts
11 photos

-----

It means I'll have to redesign the controller with a chip with A2D on board though. I can have instant response or build in a time delay.

-----

You could make simple AD converter with a capacitor, resistor and an IO pin switched between Output for discharging the C and threstate input for reading when it is charged to the point where the input changes from one state to the other. This is not difficult to program and uses only one pin on the micro.

Ady107/05/2012 15:00:11
657 forum posts
39 photos

Have a look at the systems they use for electric scooters and bikes

Stub Mandrel07/05/2012 21:38:38
avatar
3078 forum posts
255 photos

Hi folks,

Some thought on the technical suggestions:

I have two on-off-on switches, on locking (direction) one momentary (speed +/-) and two momentary push buttons (horn, brake). Every ms an interrupt does a scan of the switches and sets various flags. Once every 250 ms an LCD display module is updated to acknowledge the various switch settings and show a bar graph and % for the PWM, it sends the flags and speed setting to the motor controller. That means a 0.25s latency, which is frequent enough for this kind of task, I feel. The motor controller will report on battery condition and adujsts PWM, direction etc. and moderates sudden changes of direction.

Skarven - I know the system you mean, but it would mean a new board and I don't like resoldering smt chips - at least not for a second time

I have come up with a neat bodge - hang a 555 of a potentiometer and time the pulses - remove the +/- switch and I have access to an external interrupt, and I have a spare 16-bit counter so getting the resolution will be OK. I can then scale the zero and 100% points in software.

If all that sounds very expert - I spent hours failing to get the boards to communicxate this evening. I finally checked the pin assignments in the software and found I am trying to send data out the receiver pin...

Neil

Stub Mandrel16/06/2012 20:49:06
avatar
3078 forum posts
255 photos

I haven't done the potentiometer mod yet, but it all works so when the weather looks a bit better I'll be off to spend an evening at Burton MES to see if it will pull me along!

Neil

All Topics | Latest Posts

Please login to post a reply.

Login/Create Account
Email address
Password
 Forgotten Login?

Not got an account?

Why join?

Latest "For Sale" Ads
Latest Posts
Subscription Offers


ME & MEW Digital Archive Subscription

 

Latest "Wanted" Ads
Social Networking
Follow us on Facebook

 Twitter Logo

Model Engineer Exhibition

Visit The New
Model Engineer
Exhibition Website

Support Our Partners
RDG Tools
ArcEuro Trade
Diamond Engineering
Warco
G and M tools
TRANSWAVE Converters
emcomachinetools
Allendale Electronics
Advertise With Us
Drives Direct Ltd
Avanquest