I find a few threads and a couple of libraries concerning these chips on Arduino. Michel_F's library was particularly useful in getting the iron spinning. Many thanks.
Having spend many months hacking around I'm fairly happy with the SPI exchanges and have an interrupt set up to catch the FLAG line and check the chip status byte etc.
However, I just can't get a sensible amount of current into the motors. I suspect this may be a less than optimal configuration of the many timing parameters these chips have.
I'm using Wantai NEMA23 1.8 degree motors which the manufacturer says have an impedance of 68 uH 1.6mH and a DC resistance of about 1 ohm. I'm powering them with a stack lead acid batteries which gives around 52V. This should allow me to kick some serious current into the motors. But the most I have measured is 2.5A at 1400 mm/min ( GRBL talk ).
I'm running half-step mode on a 5mm pitch lead screw. I make that 373 pps , right down the bottom of the manufacturer's torque curve.
the inductance should be of order 0.1 ohm at that speed and the powerSTEP01 is supposed to be able to deliver 6A .
Does any one have actual measured currents higher that about 3A going into a motor using either of these chips?
ardnut:
I'm using Wantai NEMA23 1.8 degree motors which the manufacturer says have an impedance of 68 uH and a DC resistance of about 1 ohm. I'm powering them with a stack lead acid batteries which gives around 52V. This should allow me to kick some serious current into the motors. But the most I have measured is 2.5A at 1400 mm/min ( GRBL talk ).
The important data for a stepper motor is the design current - which you have not mentioned. Post a link to the motor datasheet.
What stepper motor driver are you using - post a link to its datasheet. You MUST set the current limit in the stepper driver to match the motor.
firstly I was mis-recalling the impedance ! it's 1.6mH. That brings impedance at 1400 up to about 3.75 ohm plus the wire = 1R. The graph is labelled as 3A @ 30V which is presumably the max torque at the low end, close to where I'm measuring.
The most I got into the board ( STM eval IHMO ) was 2.9A @ 800 mm/min = 213pps. nominal inductance = 2.14 R.
I'm measuring the voltage across a 50mohm resistance in series with Vin , using a DVM.
Any slower and it basically does not run properly even in half-step mode.
TVAL/HOLD =126 = 10A on STEP01
I've typically been testing much lower TVAL but just pushed it max to get a definitive reading.
My main problem is not low end but higher speeds. It stalls far too easily to be much use and this seems to be because , even with 52V on it , I'm not getting the current into the windings. Again I tried driving with a 30V PSU initially but recently boosted to try and stuff a bit more juice in there.
A similar problem was occurring with the L6474 eval boards. I use TVAL on that and HOLD on STEP01 since I am providing step pulses GRBL style, not using the internal motion engine.
Yes it uses SPI for configuration of things like the timing of the control waveform, max current etc. L6474 has step and dir pins like a classic GRBL / polulu set up. powerStep uses SPI for direection too. I assumed since you were replying that your were familiar with one or both of these chips indicated in the title.
What current limit have you set for the driver board?
Why have you not provided this information before I had to ask?
What other useful information do you have?
I did provide this info. it is set to 10A ,Since the titile refers to the two chips I presumed that anyone attempting to answer would know what TVAL referred to. if you do not understand some of the information provided please ask. There is an over-current alarm which I have set at 5A and this is not being triggered. It is unclear in the datasheet what these two currents are; maybe the OC is full cycle average and 10A is instantaneous peak.
Post your Arduino program.
I'm using a modified GRBL,which has about 30 files I don't think there is much point in posting all that. I can post the config section where I set up the timing values via SPI but if you are not familiar with the chips that is unlikely to be informative.
I have a 'scope. The waveform on the windings is quite complex since the current is modulated during each individual pulse. I suspect the problem may be with complex config of the timing parameters , which is why I posted asking for anyone with specific practical knowledge and experience of these chips.
I used a DVM to assess the overall energy going into the board at different step speeds since this allows me to quickly measure at several different pulse rates and confirms that the problem is that not enough current is being delivered.
If you have no knowledge of these chips maybe you can point out some other factor I'm over-looking.
52 / (5.36+1) = 8.17 A cf 2.9A measured being pulled from the supply , feeding two phases. One or other phase should be energised at any time, or both at 70% during a half step. So the supply draw should be somewhat more than the simple phase current. The chip is designed to ramp up I max and then pulse modulate to keep it there. That modulation is where all the timing params come in. I'm unsure whether that is optimally set up.
The motor is 6 wire bipolar, I am assuming that the 1.6mH is each of phase two windings, not each half measured at the centre tap. The measurement technique is not specified.
It would not be desirable to push more than 3A RMS into the windings since they will saturate, but I should be able to get 3A at a higher speed and this is not happening.
Unless I am misunderstanding something this is silly. The motor spec says 3 amps.
Since the titile refers to the two chips I presumed that anyone attempting to answer would know what TVAL referred to. if you do not understand some of the information provided please ask
Your motor driver is not the sort of product that is regularly used by Arduino hobbyists so don't assume that anyone is familiar with it.
No, I certainly don't want you to post the GRBL code. You did mention it in your Original Post but only very obliquely. I had assumed you were using your own software.
If your problem really lies within the GRBL software then you will need to ask on some Forum that is specifically familiar with that. This Arduino Forum is for helping people write their own Arduino programs.
Unless I am misunderstanding something this is silly. The motor spec says 3 amps.
see the last line of my last post !
This Arduino Forum is for helping people write their own Arduino programs.
Not just write programs but interface with hardware. This section is entitled "Motors, Mechanics, and Power" not software. But it's fine if you can't help. Thanks for trying.
I have no issues with GRBL, and if I did I would be on their github page. The part I am having trouble with is driving motors plugged into a Uno. In fact I'm just using GRBL as command console to generate pulse streams in this context.
There are a couple of libraries posted for these chips so I guess there is at least some experience here using them. Now it may well be that this is not an issue with the chips/boards at all and I'm expecting something unrealistic from these motors, or I'm messing up my calculations.
Hopefully someone with more experience will be able to help.
Still does not make sense. If the motor driver limit is set to the max for the motor (3 amps) then I believe it is safe to assume that the driver is applying the limit correctly.
The part I am having trouble with is driving motors plugged into a Uno.
That statement does not make sense either because one NEVER "plugs motors into an Uno". You are not describing your problem with sufficient precision.
Maybe it would help to explore the motor's and driver's capabilities with a simple program such as in my link in Reply #1 without the complexity of GRBL getting in the way.
Thanks, I had not noticed those links in #1 , I just thought it was a sig. or part of the forum padding . After someone signs off, I stop reading.
... without the complexity of GRBL getting in the way.
GRBL is not getting in the way, it is being very useful. It provides acceleration which is tested with my h/w then a few seconds of constant pulses, the speed of which I set with a gcode command. $110=1400 , for ex.
Also I have added SPI communication and an IRQ to handle error conditions on the chip when they occur. and I've extended the GRBL gcode with a few commands to allow me to set the various registers on the driver chip . This is very necessary for the testing I am doing.
$P0:9=64 , for ex. sets TVAL
The GRBL code itself in no way affects the current control of the driver board, so is not "getting in the way".
I have just re-run tests with a different motor with lower nominal voltage ( 1.65V ) . It is a SLO-SYN , made in USA. I get essentially the same current limitations. That has expelled the doubts I had about the chinese motor being a factor.
here is a graph of the current going into the board using the chinese motor. There is a curious plateau. This is not reproduced with the US motor, which is more monotonic.
Without a great deal more information about how you are gathering that information I can't see how anyone can comment.
To be honest, I can't understand what your problem is. Is it that the motor is not delivering the specified torque? Or is it simply that some electrical measurements are not what you expect?
If my motor was performing properly I would not care what the measurements were saying. As you, yourself said in Reply #6 "The waveform on the windings is quite complex since the current is modulated during each individual pulse"
I do not have a calibrated brake to measure the torque. but the motor seems to stall too easily and has a very low rate at which it will reliably run off load. That led me to start looking at current values and check TVAL and friends.
When I see that upping TVAL does not change anything I wonder why not. If I limit the current output I would expect what I am getting : weak motor and low stall. If raising TVAL does not change anything then that means that something is limiting the current other than TVAL. A rough estimation of the impedance does not seem to be the limiting factor either.
When I see a very different motor showing almost identical power consumption, again it does not seem to be the motor.
I have also measured with a 10 mohm resistor in series with one of the phase windings. This is showing some odd variation of the winding current with different values of TVAL at the same speed. 2nd and 3rd column are current x10 in each direction. up/dn differences presumably due to motor geometry.
ardnut:
I do not have a calibrated brake to measure the torque. but the motor seems to stall too easily and has a very low rate at which it will reliably run off load.
How about providing some hard data.
If you use a simple program that you can post here how many steps per second can the motor operate at?
OK, having spent all day splashing around in phase space, I've got a substantial improvement. First I ran a range of TVAL settings at a low speed ( 1200 mm/min = 800 pps ) and found a sweet spot where it was getting more current into the motor.
$110=20000 = 13300pps = 4000 rpm.
who says stepper motors don't turn fast ?
That's about 10 times faster than it was going this morning :o and I'm getting some sensible current into it. I stopped at 4000 rpm since I don't know how fast the armature can stand. That's already twice the speed of the end of the published torque curve.
It will still stand light frictional load at that speed, so there is a little torque to spare still.
Now I know why I chose these driver boards instead of Pololus.
ardnut:
Now I know why I chose these driver boards instead of Pololus.
I never suggested that a Pololu driver would be better, or even that it would be suitable for your motor. However without doing like-for-like comparisons one cannot say that X is better than Y.
And this Thread is certainly not an introductory tutorial to your chosen driver.
I never suggested that you suggested ... neither did I suggest this was a tutorial. I came here hoping to find some one with knowledge of these chips who could give me some pointers.
I did consider Pololu at first since it is a frequently used and cheap solution but I did not think the current capacity was enough and I did not like the idea that if they end up pushing more that 2A you blow and throw. This inevitably means that you have to under-rate the already light current supply to maintain a margin.
One of the nice features of the STM chips is that they just shut down instead of burning themselves out. There is also a pre-emptive thermal warning before thermal shut down. When this triggers the interrupt line, I tell GRBL to do a controlled stop which maintains the machine position and does not ruin the work piece.
It's been quite a lot of work but it's starting to pay off. This looks about ready to bolt back on to the machine and get those ball-screws spinning.
The above data shows what looks like a resonance around 10k and the 50V starting warm the core as the motor slows down. [ re-ran and did not find the 10k peaks, maybe spurious ]
Also ran at 37V but stalls easily 3k-4k and this is useful cutting speeds. Odd the current drops this low.
That was the voltage across a small 10 mohm resistor in series with one of windings.