Jump to content
 

Arduino Applications and Programs


Simond
 Share

Recommended Posts

5 hours ago, Warwick said:

Hello, I am new to  the use of Arduino's and having quite a bit of a headache.  I want to simply control my 00 gauge turntable.  I bought a Nema 17 stepper motor and a Dual H Bridge L298N Stepper Motor Driver Controller.

I used a sketch for a small stepper motor with shield (28BYJ-48 Stepper Motor)  A sketch  worked with this stepper motor but not with the Nena 17.  I have used the example sketch in the IDE sketches but the stepper gets very hot when stopped.

I only want to make the turntable go clockwise and anticlockwise and stop at my track on a turntable.  I haven't found a simple sketch to do this, later I would like to programme stopping points

Can anyone help, I am useless at sketch writing and learning is not coming easily to me.

Have a look at this topic.

It's been done to death.

There's several options from several contributors to the thread.

My latest incarnation uses a Arduino Nano and A4988 driver.

Link to post
Share on other sites

  • RMweb Premium
6 hours ago, Robin2 said:

An L298N is a very poor choice for a stepper motor driver. You should get a specialised stepper motor driver such as a Pololu DRV8825. A specialised driver has the ability to limit the current to protect the motor
 

Not strickly true as L298 is sold as a stepper motor controller and does have the ability to limit the current.

It is intended to be used with a L297 (or similar) which offers full control of the signals:

aKyKm.jpg

 

 

The two sense inputs are used to control the current in the motor coils

Link to post
Share on other sites

17 hours ago, melmerby said:

Not strickly true as L298 is sold as a stepper motor controller and does have the ability to limit the current.

 

Alas, the marketing guys got their hands on the typewriter :)

 

...R

Link to post
Share on other sites

  • 2 weeks later...

The L298 is a very dated product . It does not have any instrinic current control . It has over temp protection but only on a short term basis , it provides a sense current oupu5 , but that in itself isn’t current control 

 

there are far better driver chips these days 

Link to post
Share on other sites

23 hours ago, Junctionmad said:

The L298 is a very dated product . It does not have any instrinic current control . It has over temp protection but only on a short term basis , it provides a sense current oupu5 , but that in itself isn’t current control 

 

there are far better driver chips these days 

For us un-initiated name one or two.  Thks

  • Agree 1
Link to post
Share on other sites

  • RMweb Premium

The L298 is indeeded somewhat dated but IMHO should not be just dismissed offhand.

 

It is the stepper motor driver used in the official (and many unofficial) Arduino stepper motor shields. I have a Velleman one and it works just fine.

 

It is intended however to be used with a driver IC (normally L297 etc.) which controls many aspects of how it drives the coils of the motor including full drive current control.

If used on it's own it is very basic and lacks much of that control more modern all-in devices can give.

 

EDIT

IMHO Starting from new I would buy a more up to date controller chip.

Edited by melmerby
Link to post
Share on other sites

12 hours ago, Theakerr said:

As I understand it the Pololu DRV8825. is specifically for a stepper motor.  The L298 on the other hand will drive a servo or, my special interest, a small DC motor.  So is their a better unit than the dated L298?

Thanks

The Pololu website has a wide range of DC motor drivers as well as stepper drivers. Equivalent products are also available elsewhere.

 

...R

Edited by Robin2
  • Thanks 1
Link to post
Share on other sites

On 19/08/2020 at 20:09, Theakerr said:

As I understand it the Pololu DRV8825. is specifically for a stepper motor.  The L298 on the other hand will drive a servo or, my special interest, a small DC motor.  So is their a better unit than the dated L298?

Thanks

What do you mean by “ servo “ , 

Link to post
Share on other sites

J, should have said RC Servo motor as Simond explained.  The only benifit i can see to using a L298 to drive a servo is you can do other things at the same time and whilst i am not sure I think it would be difficult to drive two servo motors doing different things at the same time.  Back to my challenge, I did do some looking on both the Pololu and HobbyTronics pages and if I am reading the data correctly none will do what I want.  Specifically I want to bring a small DC motor to a programmed gentle stop and a programmed gentle start.  All the units there appear to cut off at about 4 volts, so they will go from 4 to 0 directly.

Link to post
Share on other sites

13 hours ago, Theakerr said:

 and whilst i am not sure I think it would be difficult to drive two servo motors doing different things at the same time. 

An Arduino Uno can control up to 12 servos at the same time and a Mega can control even more without needing any shield or motor driver.

 

...R

  • Agree 1
Link to post
Share on other sites

  • RMweb Premium
43 minutes ago, Robin2 said:

An Arduino Uno can control up to 12 servos at the same time and a Mega can control even more without needing any shield or motor driver.

 

...R

Providing the servo power is provided seperately and not from the Arduino itself.

 

 

  • Agree 2
Link to post
Share on other sites

  • RMweb Premium
14 hours ago, Theakerr said:

J, should have said RC Servo motor as Simond explained.  The only benifit i can see to using a L298 to drive a servo is you can do other things at the same time and whilst i am not sure I think it would be difficult to drive two servo motors doing different things at the same time.  Back to my challenge, I did do some looking on both the Pololu and HobbyTronics pages and if I am reading the data correctly none will do what I want.  Specifically I want to bring a small DC motor to a programmed gentle stop and a programmed gentle start.  All the units there appear to cut off at about 4 volts, so they will go from 4 to 0 directly.

You need 3 connections to a servo; Power, Ground and Signal. The signal determines the position.

A L298 is not really any good for servos but will drive 2 ordinary dc motors.

 

But If you use a Mosfet to drive a motor it can be controlled from an Arduino with a PWM signal

Edited by melmerby
  • Agree 2
Link to post
Share on other sites

  • RMweb Premium
3 hours ago, Donw said:

If you want a bit more power there is the option of the IBT-2

 

Don

How much more power do you want?:jester:

Handy module though.

 

£9.26 & free postage on AliExpress

https://www.aliexpress.com/item/1900887029.html?algo_pvid=ccd09e71-e5c2-4ecd-8bb2-a265759ee25d&algo_expid=ccd09e71-e5c2-4ecd-8bb2-a265759ee25d-7&btsid=0b0a119a15981259209671537eb5c8&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

 

Edited by melmerby
Link to post
Share on other sites

  • RMweb Premium
10 hours ago, Donw said:

well it quotes 43A I think . Probably needs a water cooled heatsink :jester:

Certainly could handle 5A or so which is more thn the drivers quoted.

 

Don

If its power Mosfet output transistors it probably doesn't need excessive heatsinking.

Power is only dissipated if there's current flowing through a resistance and power Mosfets have very low ON resistance (possibly 0.01 ohm), control would be PWM so the Mosfet would be either on or off

Even the full 43A (at 100% drive) through 0.01ohm would only dissipate 18.5W (43*43*0.01)

With 5A only 0.25W.

Link to post
Share on other sites

I have played around using a L298 and the output was of course a PWM signal.  The problem is that at low RPM as in a small DC brushed or can loco motor coming to a stop, i.e going through the 4V to 0V range or any loco that require less than 4V and starting from a stop (if it will start) the motor literally screams and will if not careful (according to what I have read) can burn a motor out.   I have read that changing the PWM frequency can potentially eliminate this problem and I understand that later Arduino have the ability to change the PWM frequecy.  However, I have not found a sketch that does this and i don't have the skill to develop my own.  Background to all this is that I wanted a station stop module but could not find one that met all my criterea of which the biggest was I did not want to make any track cuts.  As a result I have built a station stop module that uses a servo motor directly connected , as in mechanically, to a controller.  It works pretty well but I cannot help but feel there is a better way.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...