Help needed for my ...
 
Notifications
Clear all

Help needed for my stepper-ballscrew project

132 Posts
9 Users
17 Likes
3,188 Views
(@davee)
Member
Joined: 3 years ago
Posts: 1547
 

Hi @bradscopegems + @will Ron @zander,

   Stepper motors are limited in the speed they can physically rotate, but at the moment it is more likely it is the software not pulsing the step pin as quickly as you would like. As Will has indicated, the software includes a number of parameters, which hopefully you can adjust to improve the situation. Of course, the Arduino Uno has a relatively slow processor, so there will be a performance limit, but I don't know if you are approaching it yet.

---

The other characteristic that stepper motors are known for is the 'cogging' effect due to them abruptly switching from one step position to the next, leading to it sounding rougher than a 2-stroke engine. The vibration can also be a problem in some applications. The A4988 chip supports a limited degree of 'microstepping' .. that is instead of moving a whole step, it moves in half steps or quarter steps or eighth or sixteenth steps. The microstepping is enabled by connecting one or more of the board pins to the +5V (from Arduino) line .. this table was taken from the Pololu website:

https://www.pololu.com/product/1182

image

I have never used the A4988, so I can't pass on any direct experience of this device, but the principle is that by reducing the inertia shock of moving a full step each time, it also reduces the grinding two stroke motor noise. It follows that the software needs to tweaked to increase the number of step pulses ... e.g. setting to quarter step will need 4 times the stepping rate to achieve the same speed, and 4 times as many steps to achieve the same number of rotations.

As my total experience of AccelStepper software is limited to a brief look a few days ago to try to help Will find a bug, and then I was only looking at the step pulses on an oscilloscope, I am not sure how far you will be able to be able to push this with an Arduino Uno. However, if you do hit the processor limits, don't despair (yet), because there  are (low cost) alternatives we can look at if necessary.

In addition, the need to lose the 'two-stroke' effect has also spawned other chips, (typically numbered TMC2xxx, where xxx might be something like 310), and boards that look rather similar to the one you have to house them, which have 'smarter' microstepping and other tricks, that are mainly sold to 3D printer builders, again for modest prices of a few pounds.

Sorry, at the moment my only experience is of a low cost 3D commercial printer, but the stepper motors are nearly silent most of the time - occasionally resonance vibrations will make a little more noise) ... To put the normal noise level when printing in perspective, the cheap, small fans to cool the power supply and print nozzle make more noise than the stepping action for most of the time. Although this is my first 3D printer, my understanding is that the earlier models lacked the smarter devices and were much noisier.

------------

I intend to do some 'bench' tests with some spare parts I have bought to investigate stepper motors further, but not yet had time. Others may be able to offer more advice from their existing experience.

----

My above comments are only intended to give a flavour of what I think can be achieved. I doubt if you will have time to implement my suggestions before your trip to Strathclyde, but I am hoping they will be useful to help you construct a specification, including more precise details of exactly what an upgraded system needs to do, with quantitative data, like number of steps, stepping rate, and so on, assuming you are planning a follow up trip with an improved system in the future. Hopefully, we can help you upgrade the design if we understand your exact requirements.

Please indicate if my suggestions are helpful,

Best wishes, Dave


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2502
 

@davee 

Indeed stepper motors and drivers have long been associated with various humming tones in the past. The pitch is dependant on the delay time in the pulses and leads to such outlandish mis-use of them to the extent of creative people using steppers as musical instruments such as ...

Anything seems possible when you don't know what you're talking about.


   
Inq reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2502
 

Posted by: @bradscopegems

@will  @davee  @zander

    I see that I need to learn how to tweak the code. At present, the motor is terribly slow, even at peak speed. The rate is approximately one rev per second, so it takes about 20sec to go from engaged to disengaged and the noise is a bit like a not-very-distant two-stroke engine. I have tried changing 'max speed' from 250 to 1000 but it was only slightly faster. How high can this go? Am I varying the wrong parameter?

I was curious about why you were not seeing an increase in speed so I just tried bumping all the parameters by a factor of 4 (speed=600, maxSpeed=1000 and acceleration=100) and saw a marked increase in speed in both DEBUG true and false. Not sure why you're not seeing an improvement.

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6530
 

Posted by: @will

Posted by: @bradscopegems

@will  @davee  @zander

    I see that I need to learn how to tweak the code. At present, the motor is terribly slow, even at peak speed. The rate is approximately one rev per second, so it takes about 20sec to go from engaged to disengaged and the noise is a bit like a not-very-distant two-stroke engine. I have tried changing 'max speed' from 250 to 1000 but it was only slightly faster. How high can this go? Am I varying the wrong parameter?

I was curious about why you were not seeing an increase in speed so I just tried bumping all the parameters by a factor of 4 (speed=600, maxSpeed=1000 and acceleration=100) and saw a marked increase in speed in both DEBUG true and false. Not sure why you're not seeing an improvement.

 

I suspect he is using a different motor with different specs.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6530
 

@will Rasputin is going to be rolling in his grave.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2502
 

@zander 

He's absolutely using a different motor but the A4988 should still be pumping out more pulses over the same time period. My stepper isn't actually working (just spinning the shaft) but unless his motor os totally bogged down it should be responding to the speed up in pulses.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2502
 

Posted by: @zander

@will Rasputin is going to be rolling in his grave.

He can keep Beethoven company. It'll more likely be Boney Maroney who complains 🙂

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6530
 

@will Sorry, I don't know anything about them, I just assumed that a motor with different specs might react differently to the controller.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2502
 

Posted by: @zander

I just assumed that a motor with different specs might react differently to the controller.

Unless it's stalled or faced with pulses that are too fast for it to react. It should respond to the pulses as sent. If you increase the rate of them it should increase in speed.

That's why multi stepping slows down the rate at which steppers turn. If it takes 200 steps to turn the shaft once, then with 16-multsteps it takes 16x200 = 3200 steps to turn the shaft once. However, the MCU and driver limit the number of pulses that can be sent in a given time period so the maximum speed of the stepper shaft will be reduced by a factor of 16 as well.

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Bradscopegems
(@bradscopegems)
Member
Joined: 9 months ago
Posts: 25
Topic starter  

@will  @davee  @zander     I am progressing rapidly with Will's code and I think it is now functioning perfectly as required.  The travel on my leadscrew is about 4800 steps (160mm) and I cannot detect any loss of steps with the maximum speed set at 1000 steps per second and the acceleration raised to 100. From IN to OUT now takes about 8 seconds which is perfectly acceptable. The two-stroke effect was partly because I had built the unit in a wooden tray with a thin base, which was acting as a sounding board. A fairly metal baseplate and rubber mounts should take care of the noise but, of course, I will have to slow down if the inertial load is too great.  

      I mounted the limit switch near the motor end of the ballscrew, where the mirror is pulled out of the light path. this means that the home position, determined by the microswitch is not the one that is used when viewing. However, the repeatability of the away-from-home  position is extremely good: I cannot detect any variation, so it is definitely sub-millimeter variation and plus or minus 2mm  would be quite acceptable because of aspects of the optical design.

     It is looking good: tomorrow I will start on mounting the optics on the carriage and will send photos when it is all complete.

Brad


   
DaveE reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6530
 

@bradscopegems Really glad to hear that; congratulations!

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2502
 

@bradscopegems 

Good, we can only envy your inevitable success 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Page 9 / 9