Reply by Mike Perks April 16, 20052005-04-16
I said,

> ... "Hardware design is REALLY the same as software design. You
> steal someone else's idea, make a few mods and viola you are done."
>

I'm sorry that was a very poor choice of words. Copy, reuse and get
inspiration from are all better and actually what I meant. The whole
history of mankind has been built on improving on someone else's idea.

I believe in things like open source and I think I have shared quite a
bit of what I have learnt with the rest of group. I do not claim that
anything I have done is original but the investigative work did take
time and effort and hopefully is useful for other people.

What started as a simple joke about hardware versus software design has
backfired on me.

Sincere apologies,
Mike



Reply by Tom Becker April 16, 20052005-04-16

I'm sure Mike added the tag line in jest, of course; the humor is in
it's sardonic truth, but that does not lessen its universal wrongness. Tom
Tom Becker
--... ...--
GTBecker@GTBe... www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700


Reply by tombhandley April 16, 20052005-04-16

re: "Hardware design is REALLY the same as software design. You
steal someone else's idea, make a few mods and viola you are done."

Tom, I hope I don't 'touch a raw nerve' here but while I can't speak
for Mike, I think the word; "inspired" should be substituded
for "steal" ;-)

I've learned so much from other folk's examples and have used them in
many designs. But they were examples, not IP (Intellectual Property).
I still had to adapt them to my environment using good engineering
practices. Now, at age 55, I've been giving away a lot of my stuff
which takes a lot of my time. My motivation is that my stuff is one,
accurate, and two, may help others. If we all had to start
from 'scratch', we would probably still be studying vacuum tubes and
thermionic emission ;-) Yes, I did that and remember
Tektronix curve tracers with both vacuum tubes and early
transistors ;-)

- Tom

--- In basicx@basi..., "Tom Becker" <gtbecker@r...> wrote:
> > ... "Hardware design is REALLY the same as software design. You
steal
> someone else's idea, make a few mods and viola you are done."
>
> Boo!
>
> What's this? A page from the Lauton State Penetentiary Pre-Release
> Engineering Rehabilitation course?
>
> Learn from other's designs but don't steal them. Some have lost
> original ideas to intellectual thieves and will not, again, find it
> amusing. Grrrr. > Tom




I'm sure Mike added the tag line in jest, of course; the humor is in it's...

Reply by tombhandley April 16, 20052005-04-16

Mike, thanks. I have a much better idea of what you are doing.

You can implement all the states with two pins/motor from the host
including breaking. The chip already has the 'steering logic'.

As far as current sensing, I see your point. Again while the BX-xx is
great, I would 'farm-out' these functions where a slave chip sends
one interrupt and the host asks the slave for the interrupt source
which is what I'm doing in my latest robot.

Given the motor specs, I would normally recommend the TI SN754410
which is a 'beefed up' version of the 'classic' L293D. But since you
want ability to 'scale-up' your motors, it would probably not be a
good choice.

While I'm an old PIC guy, since you started down the AVR path, I
would persue that before committing to your current design. You can
do all that you desire with a simple H-Bridge controller chip and
eliminate all that 'glue'... You would only need a simple serial
interface which is why there are so many cheap motor control modules
out there that use PICs and AVRs...

- Tom

--- In basicx@basi..., Mike Perks <basicx@a...> wrote:
> Tom,
>
> Thank you for looking at this and providing some insights.
[snip]


Reply by Tom Becker April 16, 20052005-04-16
> ... "Hardware design is REALLY the same as software design. You steal
someone else's idea, make a few mods and viola you are done."

Boo!

What's this? A page from the Lauton State Penetentiary Pre-Release
Engineering Rehabilitation course?

Learn from other's designs but don't steal them. Some have lost
original ideas to intellectual thieves and will not, again, find it
amusing. Grrrr. Tom
Tom Becker
--... ...--
GTBecker@GTBe... www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700


Reply by Mike Perks April 16, 20052005-04-16
Tom,

Thank you for looking at this and providing some insights.

>
> Mike, I've had more time to look at the L6205 data sheet. Before I go
> any farther, have you looked at the following ST Micros' App note
> AN1762? There is a wealth of info inlcuding schematics of their demo
> boards. You can find it here:
>
> http://www.st.com/stonline/books/pdf/docs/9944.pdf


Yes I have seen this and I think every other ST App note. Where you do
think I copied my ideas from :) I would really like one of their eval
boards.

Application note AN240/1288
(http://eu.st.com/stonline/books/pdf/docs/1681.pdf ) gives a circuit for
current sensing and short circuit protection (which I don't need with
the L6205). It then uses diodes to pull down the input lines. I haven't
done this but I think I will but to enable instead. They are easy to add
and I would still get the initial pulse to the BX-24 interrupt pin.

>
> re: 1.
> Combinational logic gates that convert the sign/magnitude and brake
> signals to the appropriate inputs to the L6205N chip.
> [snip]
>
> Why not let the host processor handle that? You have two pins and
> four states for each bridge and it will still require four pins
> total. You can easily implement Sign-Magnitude control in software.
> Keep the Enables active and apply PWM to the appropriate input. This
> is why I would not use a BX-xx for this... I would use a dedicated
> controller or program a PIC (or AVR) for this...

I also want Brake as well. With my new combinational logic I plan to
keep enable high (perhaps using one BX output) and feed PWM either into
IN1 or IN2 depending on Direction. I have now successfully built my own
dual PWM generator (based on NE556 and LM324) so I will need some logic
to combine that in. I have additional logic for the Brake so when it is
high both inputs are high (or at least have PWM rather than 0. The logic is:
InA = (PWM And Direction) or (PWM And Brake)
InB = (PWM And Not Direction) or (PWM And Brake)

>
> re: 2.
> Current sensing logic that compares the sense resistor voltage and
> uses a comparator schmitt trigger to signal the BX-24. The idea is
> that if the motors get stalled, I want to know about it and cut the
> power to prevent burnout.
> [snip]
>
> I see your point. I would take a look at the MAX471 (or similar
> current sensing chips). The MAX471 has a built-in current sense
> resistor that can handle up to 3A. The MAX472 uses an external sense
> resistor for higher currents. Both provide a voltage output so you
> will need two A/D channels. They come in 8-pin packages. There are
> also many other similar chips from various vendors. Unless you are
> really addicted to 'solder fumes' I vote for reduced parts count ;-)

After the current sense amplifier I have a test point that I can feed
into a A/D. However I like the idea of getting an interrupt rather than
polling an A/D. Also the A/D provides an "instant in time" reading. The
schmitt trigger, once triggered will stay low until the voltage
(current) really drops down again past the hysterical point - I mean
hysteresis. Again I like AppNote 240/1288 with its diodes and
essentially binary signal.

>
> re: 3.
> Opto-isolators that allow 2 different voltage supplies - one for the
> BX-24 and one for the motor controller. I have heard that noise can
> travel through ground as well so I wanted complete ground isolation.
> [snip]
>
> Again, I just don't see why you need them here but I really don't
> know your application in detail. This is something that needs to be
> tested in a `real-world' environment. From what you have described
> and looking at your schematic, your power supply design does a good
> job of isolating the motor and logic supplies. One key point is
> connecting all the grounds to a common power supply ground where the
> regulators are connected to the external supply.

I think I have the grounds straight in my physical layout. As you say
getting that right is key. I think I just wanted an extra safety margin
and this might be over-engineered :)

>
> Finally, what motors are you using? What is the typical current? What
> is the Stall current? There are a lot of H-Bridge controller chips
> that are a lot easier to use than the L6205...
>
The motors are in the link I previously sent you
(http://www.lynxmotion.com/Product.aspx?productID&CategoryID ).
The stall current is 1.5A. I'm also thinking about the future when I
move to bigger motors and eventually 4 motors. Obviously for 4 motors I
will need my own PWM generators. I think if someone gave me the source
code for an AVR one (say on a ATMega8) I would build it. I just haven't
quite got to more complex AVR programming myself yet. I would use 4
outputs for PWM and 4 outputs for servo pulses. I built myself a
programmer now so who knows I might do this next :)

I looked at both the L298 and LMD18200. In the end the decision came
down to bending pins or not :) Not to mention that two LMD18200's are
really expensive. I wanted to breadboard and then transfer to stripboard
and solder. The DIL packaging of the L6205 is just easier to handle. So
I think I'm going to plow through this (I have it all working so
actually I'm really done except for building it) and perhaps I will look
at these other chips at another time. I don't think I am ever going to
use a simple FET bridge because of all the added capabilities of these
kinds of chips.

Thanks again,
Mike

"Hardware design is REALLY the same as software design. You steal
someone else's idea, make a few mods and viola you are done"



Reply by tombhandley April 16, 20052005-04-16

Mike, I've had more time to look at the L6205 data sheet. Before I go
any farther, have you looked at the following ST Micros' App note
AN1762? There is a wealth of info inlcuding schematics of their demo
boards. You can find it here:

http://www.st.com/stonline/books/pdf/docs/9944.pdf

re: 1.
Combinational logic gates that convert the sign/magnitude and brake
signals to the appropriate inputs to the L6205N chip.
[snip]

Why not let the host processor handle that? You have two pins and
four states for each bridge and it will still require four pins
total. You can easily implement Sign-Magnitude control in software.
Keep the Enables active and apply PWM to the appropriate input. This
is why I would not use a BX-xx for this... I would use a dedicated
controller or program a PIC (or AVR) for this...

re: 2.
Current sensing logic that compares the sense resistor voltage and
uses a comparator schmitt trigger to signal the BX-24. The idea is
that if the motors get stalled, I want to know about it and cut the
power to prevent burnout.
[snip]

I see your point. I would take a look at the MAX471 (or similar
current sensing chips). The MAX471 has a built-in current sense
resistor that can handle up to 3A. The MAX472 uses an external sense
resistor for higher currents. Both provide a voltage output so you
will need two A/D channels. They come in 8-pin packages. There are
also many other similar chips from various vendors. Unless you are
really addicted to 'solder fumes' I vote for reduced parts count ;-)

re: 3.
Opto-isolators that allow 2 different voltage supplies - one for the
BX-24 and one for the motor controller. I have heard that noise can
travel through ground as well so I wanted complete ground isolation.
[snip]

Again, I just don't see why you need them here but I really don't
know your application in detail. This is something that needs to be
tested in a `real-world' environment. From what you have described
and looking at your schematic, your power supply design does a good
job of isolating the motor and logic supplies. One key point is
connecting all the grounds to a common power supply ground where the
regulators are connected to the external supply.

Finally, what motors are you using? What is the typical current? What
is the Stall current? There are a lot of H-Bridge controller chips
that are a lot easier to use than the L6205...

- Tom


Reply by Mike Perks April 15, 20052005-04-15
tombhandley wrote:

> My first question is why all the 'glue' logic? This seems to be way
> too complicated for such a simple task even with monitoring motor
> stall current. I have no experience with the L6205N but after
> glancing over the data sheet, I will probably order some for my
> projects. One thing that 'caught my eye' was it's thermal shutdown
> mode and the ability to monitor it. I think you can eliminate a lot

I experienced shutdown once while testing. I thought I had fried the
L6205 (no heatsink on the breadboard). It took about a minute to
recover. I want to avoid the shutdown situation (probably doesn't do the
chip much good) by monitoring earlier. In my view this is the difference
between a flaky circuit and a robust circuit. The same applies to
writing software as well.

> of analog 'glue' by monitoring the "EN" pin. As far as optoisolators,
> I just can't see a need for them in this application if you use a
> sepatate supply for the motors and good grounding practice. Again,
> I've just had a 'glance' at your design but if you want wheel
> feedback, I would use shaft encoders, not relying on measuring back-
> EMF.
>
> The bottom line... I'm impressed with your effort (we hardware guys
> normally don't trust software guys with a soldering iron ;-). But I
> just can't understand why all the extra 'glue'...

Thanks. As I joked with someone else, I miss the smell of soldering and
need a fix soon.

Mike


Reply by Mike Perks April 15, 20052005-04-15
Tom,

Good idea but as noted in my original append, I really need two
independent PWMs (one for each wheel) otherwise turning gets a bit hard
- not quite impossible but hard.

> > ... a conflict with InputCapture...
>
> There's an eight-bit PWM available from Timer2 on pin 25, but not dual
> PWM like Timer1 offers. I just moved a 112Hz DC motor PWM to Timer2 so
> I could use Timer1 as a 16-bit internal timebase. Somehow it feels nice
> to have three timers running. > Tom
>



Reply by Tom Becker April 15, 20052005-04-15
> ... a conflict with InputCapture...

There's an eight-bit PWM available from Timer2 on pin 25, but not dual
PWM like Timer1 offers. I just moved a 112Hz DC motor PWM to Timer2 so
I could use Timer1 as a 16-bit internal timebase. Somehow it feels nice
to have three timers running. Tom
Tom Becker
--... ...--
GTBecker@GTBe... www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700