element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Sixth Sense Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sixth Sense Design Challenge
  • More
  • Cancel
Sixth Sense Design Challenge
Blog R2B4 #5 - L298 Troubles
  • Blog
  • Forum
  • Documents
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: 14rhb
  • Date Created: 24 Feb 2019 10:48 AM Date Created
  • Views 288 views
  • Likes 8 likes
  • Comments 8 comments
  • l298
  • sixth_sense
  • r2b4
  • robot
  • stepper motors
  • nema17
  • sixth sense design challenge
Related
Recommended

R2B4 #5 - L298 Troubles

14rhb
14rhb
24 Feb 2019

      • 1.     Background
      • 2.     Circuit Requirements
      • 3.     An Easier Solution?
      • 4.     Drivebelts
      • 5.    Conclusions of #5
      • 6.     What Next

1.     Background

I had planned on driving the NEMA-17 stepper motors from my Sealed Lead Acid (SLA) 12v battery via a pair of L298 modules; these seemed to be idea from the specifications but fellow Element14 members commented and that got me looking around the internet to soon find they were inadequate (eg threads like this). I did do a short test run having remade my drivebelts and I'll detail a bit about those below.

 

2.     Circuit Requirements

At this point I think I need to make my own driver circuits so had a look around the internet at what schematics were available. I found this one particularly useful:

[Source: http://www.circuitdiagramworld.com/uploads/allimg/201411/A3952S-bipolar-stepper-motor-driver_463104501.jpg  ]

 

and this one:

[Source: https://www.researchgate.net/figure/H-bridge-Stepper-motor-driver-circuit_fig5_308859906 ]

 

 

Both schematics show I need four active 'switch' components per phase; eight in total. The switching of these should not be a problem as I will likely offload that from the STM32Nucelo board to a PIC microcontroller. I can see I will need four inputs for each motor. I could use bipolar transistors like the heavy duty TIP142 (10A collector current) or a suitably rated MOSFET. What is not so clear from the diagrams above is the current limiting circuitry, I will need to limit my current to 2A per coil and will accomplish that by working a simple BJT and limiting resistor into the circuit to ground.

 

In the design stages I was unsure what voltage drops would be across each component, if the constant current circuit works correctly there should be 2A flowing. AT the very worst case, with no voltage drop on the stepper coil, that means almost half of my 12v supply would be dropped across each of the two MOSFET devices...that would amount to 12W each, so those MOSFETs could get quite warm.

 

My NEMA-17 stepper is rated at 2A and 2.8v (from the spec sheet) and therefore including the 0.6v drop across the current generator, then 8.6v (12 - 3.4v) is shared between the MOSFET devices....4.3v each at 2A = 8.6W

 

This is the bit I am unsure about - does the motor coils drop 2.8v at 2A or does the MOSFET voltage drop come into play due to the gate-source voltage applied? I need to do some tests !

 

3.     An Easier Solution?

Realising that I'm deviating way off the course of this challenge I recalled the small A4988 module that I used for My First Stepper Motor - a quick check of the specifications seems to show it can provide up to 2A per coil with cooling and will run from a 12v supply. Anyone with a Reprap style 3D printer will be familiar with these and that is why I have some as well (as for the last 2-3 years my attempt at making my own 3D printer has sat on the worktop under construction).

 

Therefore for now the A4988 module is what I am going to try using, I already have some of the modules and I won't have to spend valuable programming time making a new driver circuit. An article on the A4988 can be found here. Testing them out I get the following results by using an Arduino Uno to control each stepper's direction and speed:

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

As you can see, it moves....but only just. The driving program also includes some turns where one side is driven in the opposite direction to the other. R2B4 doesn't seem to like turning like this which maybe is a function of the carpet friction and the double drive wheels.

{gallery} Driving R2B4

R2B4 - A test run of motor torque

The drive and temporary tensioning (aka 4mm croc clip)

4.     Drivebelts

My first two homemade GT2 drivebelts fell apart. One was made by using rubber glue and a 50mm overlap whilst the other was a clean butt slice with superglue. To make them stronger I decided to stitch them together using a needle and some strong thread. These seem to be holding up much better. To align the belt I used a small offcut as a temporary guide.

 

5.    Conclusions of #5

I found that a bit disappointing and had hoped R2B4 would have more torque than it did - being able to turn would have been great. However this is also the first contraption I have ever made that moves along and therefore I kind of think of it as a success as well....eg I've learned quite a lot. There are a few things I need to try like measuring the current to ensure the A4988 modules are running at maximum current. I need to add proper belt tensioning (rather than the screwdriver and 4mm croc clip) and I need to secure the driver boards.

 

6.     What Next

I think from the start I was stating I needed to do some actual code dev on the STM32 boards (Nucleo and SensorTile) and with this chassis "almost usable" that is what I will concentrate on in blog #6.

Anonymous

Top Comments

  • dubbie
    dubbie over 3 years ago +6

    Rod,

     

    I wondered what the screwdriver was for!..

     

    I did find that getting these kind of step motors to work was a real dog, as you seem to be experiencing and really take some work to get going properly. I…

  • jw0752
    jw0752 over 3 years ago +6

    Hi Rod,

     

    I really like that you have fabricated so much of the structure yourself. It reminded me of a time when I was a child and a neighbor kid and I decided to build a go-kart. We had everything we needed…

  • 14rhb
    14rhb over 3 years ago in reply to jw0752 +6

    Thanks for your encouragement John.

     

    Your go-kart sounds great, like all great things that come from childrens' imagination and determined ingenuity - and probably echoes many engineers' early days …

  • 14rhb
    14rhb over 3 years ago in reply to shabaz

    Hi Shabaz,

     

    That is a really clear explanation, thank you. I didn't realise that there was PWM during each step, it makes far more sense now. I'll also have a look at the voltage on that via to see what the current setting is and adjust up to the maximum 2A per coil if possible.

     

    I did have another go with mbed but had the same issues of not understanding how to build and expand on the STM32CubeL4 example codes. So I'm back in TrueStudio and am attempting to modify the Datalog example to use a UART or the I2C - then I can send the data from the SensorTile and to the Nucleo carrier board. I've managed to include a 1ms timer  into the SensorTile example and additionally control the built in LED, so little steps but in the right direction.

     

    Thanks again for your words of encouragement and help.

     

    Rod

    • Cancel
    • Up +5 Down
    • Reply
    • More
    • Cancel
  • shabaz
    shabaz over 3 years ago

    Hi Rod,

     

    It was great to see the video of it in action : )

    Regarding the MOSFET and voltage, the MOSFET will switch on hard, so it will apply the full power supply voltage, but the current will ramp up over time due to the inductance of the motor. The 2.8V is relevant if the coil was permanently energised by the user connecting it to a battery and then at that voltage, the rated current would be measurable. Instead, the stepper driver will send PWM pulses, to keep the current at the expected value. In other words, per step, the driver is sending lots of pulses, and measuring the current, and aiming to adjust the pulses (e.g. pulse width) to keep the current at a defined value. So, the supply to the MOSFET can be larger than 2.8V (and may need to be even higher than 12V, for more torque). The diagram below, from Jones on Stepping Motor Current Limiting   shows the concept (the top part of the diagram shows the current, and the bottom shows the voltage - 25V in this example, so quite high, even though the actual motor may have a rating of say 3V etc). The driver will measure until the desired current (1A in this diagram) is ramped up to, and then the output will switch off.

    The entire diagram is for a single step.

     

    I've not used that chip, but this web link mentions some Vref pin that can be measured to determine the current: https://www.pololu.com/product/1182 (about 3/4 of the way down the page) if you get time.

    Anyway, looking forward to seeing how you get on with the coding! I hope you get a chance to try out mbed too - it could speed up development since there are libraries and examples for virtually everything in mbed, just like Arduino.

    • Cancel
    • Up +5 Down
    • Reply
    • More
    • Cancel
  • 14rhb
    14rhb over 3 years ago in reply to michaelkellett

    Hi Michael,

     

    Good points, thank you. I did try measuring the torque a few days ago by winding string around the GT2 pulley and lifting bottles of water/washing detergent. I'll have to find the notes I made but I was getting reasonable results I recall. Once the stepper power was off it dropped the weight. The gearing is another good way - I used something similar on my "Peter the Pumpkin" turntable and just need to get another large GT2 pulley to match the one I already have (and remake those drive belts to suit). I'm surprised the belts are holding up as I hand stitched them together and they are only 6mm wide with a 2mm pitch.

     

    I've decided to dive into the STM32 side for a while.

     

    Rod

    • Cancel
    • Up +5 Down
    • Reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 3 years ago in reply to 14rhb

    If you are using a typical 3D printer type stepper motor the low speed torque should be about 40N/cm, your wheels look about 5cm diameter, 2.5cm radius so the push should be about 16N or about 1.6kg.

    I'm guessing that your drive and wheel toothed pulleys are the same diameter.

    Try checking the torque (wind a string (thin) round a wheel a few times and see how much weight it can lift.) - If the torque is lower than expected your motors or drive may not be well matched to the battery.

    If the torque is correct but the performance bad you could increase the torque at the wheels by using bigger wheel pulleys.

     

    MK

    • Cancel
    • Up +5 Down
    • Reply
    • More
    • Cancel
  • 14rhb
    14rhb over 3 years ago in reply to jw0752

    Thanks for your encouragement John.

     

    Your go-kart sounds great, like all great things that come from childrens' imagination and determined ingenuity - and probably echoes many engineers' early days

     

    Like you I often made things, this was long before I earned any pocket money (and never dared ask for money) to get bits....I think this is why I still keep 'junk' and make things out of it rather than buying new.

     

    Rod

    • Cancel
    • Up +6 Down
    • Reply
    • More
    • Cancel
>
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube