Problems reversing a field-wound motor driven by an electronic speed controller...

Alec_t

Joined Sep 17, 2013
15,120
We want to detect when the motor is energised in a 'backwards' direction - that is, when polarity changes. That is when the relay needs to switch the coil around.
Precisely so. The forward/backward change point is when the duty cycle is 50%, i.e. half way down the sloping part of the V(inv) waveform in post #54. Anything above 50% is 'forward' and anything below 50% is 'backward'. 50% does not mean 'half power' in this instance. Power increases from zero when duty cycle moves away from 50%, in either direction.
The relay shown is only switching the field coil.
 
Last edited:

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
I couldn't see why the ESC output was connected to a relay switch.

I have tried adding the 3.3k potential divider and the 680k resistor which connects to the signal output - and just got the indicator led on all the time.

Is there anything wrong with the logic:

smooth both PWM signals - compare them - output a signal when one is greater than the other...?
 

shortbus

Joined Sep 30, 2009
10,049
It's true in trucks, cars, boats and most vehicles. Because they are usually optimised to go one direction, and therefore going in reverse usually causes control problems - you have to do it slowly. In boats, for instance, the stern will dig into the water. In cars, steering is trickier. Only in trains is it reasonable to go as fast backwards as forwards. Models simply match their full-size counterparts....


I did not know about a 393. Looks like a redesign is called for...is the 8 pin DIP package basically the same pinout as an LM358?
Not sure but you will need a pull up resistor on the output of a 393 or a 339. Their out put is open collector.
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
do you think I am hitting problems because the expected output from the ESC is plus OR minus 7V, while the comparator is powered by +7V and 0V? Can it work with negative voltages?
 

Alec_t

Joined Sep 17, 2013
15,120
I couldn't see why the ESC output was connected to a relay switch.
Because one terminal of the motor (which the ESC is connected to) is a field coil terminal.
Is there anything wrong with the logic:
smooth both PWM signals - compare them - output a signal when one is greater than the other...?
No. I thought you were only smoothing one and grounding the other.
If you smoothe both, here's what you should get with the circuit modified accordingly :-
ESC-reverser7.PNG
Incidentally, the smoothing resistors are 33k, not 3.3k.
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
Originally I had expected to smooth both, but when I started hitting problems I thought that grounding one would make the comparison and the circuit simpler. I have ordered some comparators to see if they make a difference...
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
I find the circuit diagrams a bit confusing, since they don't seem to match my view of the physical layout. I enclose a sketch showing how the external units fit together. You can see that my view of the electronics is quite simplistic - I am leaving out any components which are there purely for suppression, like the flywheel diode...

P.S - I have added your proposed 680k resistor in red, though I don't know what it does. And for some reason the pdf printer has titled the page as one of my plans - 'OSA Missile Boat'......
 

Attachments

Alec_t

Joined Sep 17, 2013
15,120
That shows the relay switching the rotor connections rather than the field winding connections, but otherwise tallies with the circuit diagram. If it helps, I'll redraw my schematic to match.

Edit: Here you go
ESC-reverser8.PNG
Note that R4 connects back to the opamp (comparator) output, not to ground. It provides the comparator with hysteresis, so that it doesn't dither about the switching point.
 
Last edited:

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
That shows the relay switching the rotor connections rather than the field winding connections, but otherwise tallies with the circuit diagram. If it helps, I'll redraw my schematic to match.

Edit: Here you go
View attachment 165348
Note that R4 connects back to the opamp (comparator) output, not to ground.

I was very impressed by your circuit simulation, which seemeed to have a good positive switch - and went back to building a 2-sensor circuit with your cap and res values. It works well, switching strongly on on negative, though there was a bit of a signal coming through when I went to positive for 0.5V. I wondered if that was what the 680k resistor was for - leaking the cap charge back to earth? Anyway, I didn't have a 680k, so I attached a 330k in the same place, and the little positive spike went away :)

That seems to be a working circuit. I will have to wait for a relay delivery to make the whole thing - but I think it's well on it's way now. Thanks!

I suspect that much of my problem was due to a complete lack of appreciation of component values, coupled with no understanding of the implications of the inverting/non-inverting pins. It would be nice to get a circuit working with only one sensor wire while holding the other pin to earth, however. I was holding the non-inverting pin to earth. Would it work better if I grounded the other?
 
Last edited:

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
I wonder whether we can take the comparator voltages from the coil connections to the relay rather than from the ESC inputs? that would make boat installation a lot easier - less wires to fiddle around connecting, since all the wiring would be on the PCB....
 

Alec_t

Joined Sep 17, 2013
15,120
I wondered if that was what the 680k resistor was for
If you look closely at the blue waveform in post #65, you will see a small kink at the switching point. That's due to the 680k providing a nudge to help the switch-over.
It would be nice to get a circuit working with only one sensor wire while holding the other pin to earth
That ain't gonna work but, if you tie the 'other pin' to half the supply voltage instead, then a 'one sensor wire' circuit should work.
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
If you look closely at the blue waveform in post #65, you will see a small kink at the switching point. That's due to the 680k providing a nudge to help the switch-over.

That ain't gonna work but, if you tie the 'other pin' to half the supply voltage instead, then a 'one sensor wire' circuit should work.

If the voltages could be taken off the back of the coils, at the relay switching position (which would probably be mounted on the PCB with the circuit), then the requirement for any external sensor wires goes away... but that's next to the brushes, and things are a lot more messy there...
 
Last edited:

Alec_t

Joined Sep 17, 2013
15,120
I wonder whether we can take the comparator voltages from the coil connections to the relay rather than from the ESC inputs?
You can indeed. Simulation shows that will work ok.
Here's the circuit updated to use a connection from the relay for one comparator input and a half-supply voltage as the other input. The comparator here is a LM339 with a 10k output pull-up resistor, but a '358 would do as the comparator as previously shown.
ESC-reverser9.PNG
Since your scope shots show the +ve rail is clean, I've omitted the smoothing cap from the non-inverting input. This speeds up the switching and reduces jitter. As a result the cap previously connected to the relay was found to be unnecessary and is now omitted.
The sim doesn't take account of any brush noise. If that proves troublesome then some suppression components will likely be needed.
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
Emboldened by your simulation, I connected the twin-sensor circuit to a motor at the brush position, and found that it worked fine. Then I took my most noisy motor, connected that up with no suppression and ran it. The switching circuit switched solid in 'reverse', and stayed off for most of 'forward' - though with some slight flickering on the LEDs at full speed. I am not surprised - the respective scope shots are below!

While that was going on I had a servo connected to the receiver - that went mad and started running in continual circles, and my mouse stopped working. So I can safely say that it was a very poor RFI environment indeed - in fact, I could probably sell it to the military as a jammer :) But the circuit - without any suppression - seemed very robust.

I am ordering in some PCB mounted relays so that I can use the onboard sensor approach. I had thought that free-standing 10A ones were the way to go, but a 6 or 8 will probably be OK....
 

Attachments

Alec_t

Joined Sep 17, 2013
15,120
I re-ran the sim with 2V of random noise superimposed in series with the rotor. That introduced a bit of dither at the switching point until I increased R1 to 100k to improve smoothing.
Try adding a suppressor (e.g. 100nF in series with 100Ω) directly across the rotor contacts. Is the motor body (assumed metal) connected to circuit ground?
If you've got a fat capacitor (say 100uF) handy, it might improve things too if you strap that in parallel with a 100nF non-electrolytic cap across the power supply to the circuit, very close to the IC supply pins.
By the way, using 330k instead of 680k as the feedback resistor R4 does improve dither reduction by increasing hysteresis, but at the expense of moving the two switching points further away from the ideal 50% position, i.e to points where the motor current is non-minimum.
 
Last edited:

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
This - http://www.modelsoundsinc.com/articles/RFIArticleMarch2006.pdf is quite a good overview of the suppression techniques used in model boats. Much of the RFI issue has gone away with the use of 2.4Ghz for control, but interference carried through the power lines is still important - particularly with IC circuits.

And for Taycols 2v of random noise would not be noticed. There is a huge amount of induction going on. With a suppressor I measure 35v spikes at the brushes with a 7v power feed.

Short lines and separation are two key design issues, and picking up the signal from the brush end of the coils will help here. However, it also introduces a lot of unwanted noise....

I notice that you do not suggest the use of ferrite beads. Any reason? By the way, a small bit of suppression cures the slight instability at full forward perfectly.

I have a 2222 NPN which I think will probably switch the relay coil on its own, but I will need to see what the coil current is. If it is around 500mW, would the 2222 be ok with a 700 ohm resistor, or could you suggest a better single item?
 
Last edited:

Alec_t

Joined Sep 17, 2013
15,120
I notice that you do not suggest the use of ferrite beads. Any reason?
I hadn't got round to it :). I was suggesting suppression components you might already have to hand.
By the way, a small bit of suppression cures the slight instability at full forward perfectly.
That's good.
I have a 2222 NPN which I think will probably switch the relay coil on its own,
It can almost certainly handle the relay coil current, but its base current (normally arranged to be 1/10 the collector current to ensure hard switching with minimum power loss) may be too much for the comparator to source; hence the Darlington arrangement in my circuit.
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
Anyone running Taycols is likely to have:
a) an amateur knowledge of electronics from the 1960s
b) a bewildering array of suppressors and filters, including things like transorbs.. :)

My lack of knowledge tends to push me towards fewer components, and away from the calculations associated with Darlingtons. I do have a TIP115 in my box, but that's a single-pack PNP Darlington. Would I be better off with a MOSFET, as MaxHeadRoom suggested? Incidentally, what is the maximum current from the LM358 (I don't have an LM339, and am waiting for an LM393, but I suppose these are going to be similar to the 358)...
 

Alec_t

Joined Sep 17, 2013
15,120
Incidentally, what is the maximum current from the LM358
According to the datasheet (which I'm sure you've read :) ) it could be as little as 20mA source current and 10mA sink current.
The TIP115 is a PNP type, so the circuit would need a mod to accommodate that. Its collector-emitter drop is around 2V, so a 5V coil relay would suit.
Any MOSFET would need to be a logic-level type, as you have somewhat less than 7V to drive the gate.
The LM393, like the LM339, can sink only 20mA but can't source current. That means the transistor base current has to come via the pull-up resistor on the comparator output, so is limited effectively to 20mA too.
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
According to the datasheet (which I'm sure you've read :) ) it could be as little as 20mA source current and 10mA sink current.
.........
I read it - but it looked to me as if the max current was 60mA. What I need is a solid-state switch which will carry up to about 1A, and can be switched by 5-10V at 10mA. Something like a TIP120 would switch the relay coil, but it seems to require 60v? Seems a bit powerful. I was hoping that the same circuit would do for boats running on 6V to 12V - different relay coils, obviously.
 
Top