Chinese Ramps 1.6

This topic contains 67 replies, has 12 voices, and was last updated by  Jeff 8 months, 1 week ago.

Viewing 30 posts - 31 through 60 (of 68 total)
  • Author
    Posts
  • #57624

    David Rabbit
    Participant

    FYI, I notice that some of the sellers are selling the TMC2130 with a “stepstick protector”.  Anyone know what those are?  Is it just a gimmick, or does it provide real value/protection?

    https://www.aliexpress.com/item/-/32850180071.html?spm=a2g0s.13010208.99999999.262.6eAz3N

    #57625

    Jeffeb3
    Participant

    Strange. The description for the protector on its own suggests they are for the tmc 2100, but I don’t know what they even do.

    I really like how those 1.1 ones have most of the soldering done right. Someone’s been paying attention.

    #57629

    David Rabbit
    Participant

    Well, what could it be?  I’m thinking flywheel diodes and/or overcurrent protection.  Anything else?  I would say overheating protection, but wouldn’t that require a temperature sensor on the TMC2130 module itself?

     

    I suppose it could have polarity protection also, in case it was plugged in wrong.

     

    Anything else?

    #65964

    Jason
    Participant

    I wanted to chime in and add if your are sold on the tmc’s consider using a flyback diode system, or freewheeling diodes with them. It doesn’t make that big of a difference on the 12v system, but with 24v you need them or back emf will burn them up. Probably why they were so hot.

    There either called tl-smoothers or silent stepstick protector. Make sure to get the ones with eight diodes. Watterott carries them.

    Sorry to bump an old thread. Thanks.

    #78659

    James Jarosz
    Participant

    Just a few things that I have been finding though my v1.6 research, since I have a RAMPS v1.6 board.

    YouTube video: https://www.youtube.com/watch?v=p649C7m61qA

    I’m pretty impressed with Alex Kenis.  He pulls boards apart to check components.  The above is his review of a v1.6 board.  Yes, it appears that we can convert to 24v too.  He explains in the video.

    RepRap Wiki just added a v1.6 page: https://reprap.org/wiki/RAMPS_1.6

    BIQU – I found some info, although not a complete board layout on their site: https://www.biqu.equipment/products/biqu-3d-printer-electronic-parts-ramps-1-6-upgrade-on-the-basis-of-ramps-1-4

    #86227

    Mike Pensinger
    Participant

    I guesss there’s no benefit in powering it from 24v though, is there? After all, the board will just have to down convert it.

    In any case, I’m now going to order a full set of TMC2130 modules.

    The higher voltage will make the steppers move faster. Whether you need them to go faster or not is a matter of debate. Also if you can run your heatbed on 24V it will heat faster.

    #86281

    Jeffeb3
    Participant

    The higher voltage will make the steppers move faster. Whether you need them to go faster or not is a matter of debate. Also if you can run your heatbed on 24V it will heat faster.

    I can’t remember if I posted this somewhere or not. I was a bit confused about exactly what the 24V would do, since they are limiting the current output. When the driver is outputting it’s current, and let’s assume it’s on a full step, it’s sending the input voltage, until the current reached is it’s desired setting. It does that for a moment, with the length of the moment determined by it’s PWM frequency, not the speed of the motors. It will do that even if the motor is stationary.

    So then how does that have any benefit, unless it was taking more than 100% duty cycle to reach the limited current? It will reach the current limit faster, but it will just have half the duty cycle, unless it gets saturated.

    #86282

    Ryan
    Keymaster

    Heffe I don’t really understand it fully either. It was one of Ed’s articles in the magazine though. He also has two posts explaining it but I don’t that have that deep of an electrical understanding.

    MPCNC: A4988 Driver Microstep Waveforms

    MPCNC: 12 V Supply vs. Stepper Current vs. Axis Speed

    #86285

    Ryan
    Keymaster

    Dang actually here is another one, https://softsolder.com/2017/11/08/mostly-printed-cnc-stepper-drive/

    I need to try and understand this.

    #87541

    Ed Nisley
    Participant

    A higher motor supply voltage improves the current waveform’s rise time, so the driver can support higher step rates. My post from some years ago (*) shows current vs. time for 9 V and 18 V supply voltages at a constant step rate; you can see why lower voltage won’t support faster steps.

    The general idea is to apply enough voltage to let the current reach the commanded value for each step “quickly” in comparison with the step time. The driver controls the absolute winding current, but it can’t work miracles, because the voltage determines the rate at which the current changes.

    Pondering the actual current waveforms dispels many mysteries … [grin]

    (*) For motors similar to those in my old Thing-O-Matic, but the same principles apply to MPCNC motors.

    2 users thanked author for this post.
    #87599

    Jeffeb3
    Participant

    Which part of the puzzle am I missing? You say you’ve measured 6Ohms with all the connectors and wires, but at 1A limits and 12V supply, you’re going to be at 50% duty cycle. Why does it matter if you can get to 1A with 25% duty cycle?

    It seems a bit like driving faster towards a stop light.

    I’m quite sure I’m just not thinking of some part, but my napkin math just doesn’t add up.

    #87675

    Ed Nisley
    Participant

    Why does it matter if you can get to 1A with 25% duty cycle?

    The controller has no trouble keeping the winding current at the setpoint when the motor is at rest, assuming the total resistance allows at least a few volts of headroom at the setpoint current.

    When the motor is turning, however, back EMF further reduces the voltage available to change the winding current. As the speed increases, the reduced supply voltage means the current can’t change fast enough to produce the expected torque during each (micro)step and, at some speed, the motor stalls.

    For example, the long current ramp during the second (micro)step limits the available torque to maybe 3/4 of the expected value:

    Current rise - 9 V 1 A 3RPS

    At twice the speed, back EMF further reduces the available voltage, so the current couldn’t reach the commanded value during the half-as-long (micro)step. The next step requires even more current, so the winding current falls further behind the setpoint level until the motor stalls.

    A higher power supply voltage gives the controller more headroom against wiring resistance and back EMF. As long as you keep the motor speed low enough, there’s no problem with a 12 V supply, but it limits the available torque at even moderate speeds.

    More voltage → faster current change → more torque at speed → better performance → happier user!

    1 user thanked author for this post.
    #87682

    Jeffeb3
    Participant

    Thanks for the thoughtful explanation. You don’t have to spend time educating a complete stranger on the interwebs, and it’s appreciated. I saw that graph in your last link, and maybe I’m making a mistake understanding what you’re trying to illustrate.

    I assume the PWM on the bottom represents the step signal, so on a rising edge, it’s trying to go to the next microstep. I am also assuming the other line, with the dramatic slope is the current. It looks like the width of the PWM is 200us? I’m not sure what the amplitude of the slope is, but in your description you mention 220mA and 1/8th microstepping (if it was 1/1, then it would try to get all the way to 1A, but have 8x time to do it).

    When the current graph climbs, the slope is higher in the 18V case, which is what you’re trying to point out, I think. But when it stops rising, and goes into the saw tooth pattern, that’s the driver already reaching it’s set point. So in both these graphs it’s made it to the set point before the next step. Right?

    So the argument is that if the step times are smaller than the amount of time of the first climb, then it wouldn’t reach full current before the next step. The 9V graph is about 135us, or 7400ish steps/s. This is the microstep, but I would guess that the finer the steps, the smaller the current needs to go each step, so it’s probably close to a wash. You also said 1/8 microstepping (which seems about right for 200mA on the first jump). At 1/8 microstepping, that’s 50steps/mm(MPCNC), so 7400steps/s / 50steps/mm = 148mm/s max at 9V. Any faster than that and you won’t get full current.

    Getting to the set point earlier than the next step doesn’t make anyone happier, except electronics manufacturers. :). (Glib comment aside, thanks again for talking through this with me, seriously).

    #87692

    Jeffeb3
    Participant

    OR, is the point that the total torque is proportional to the area under the current graph, and so there is more power if it climbs faster?

    #88110

    Ed Nisley
    Participant

    The general idea goes like this:

    Motor torque is proportional to winding current, as is the IR loss due to wire resistance, while back EMF is proportional to rotational speed. The voltage available to drive the winding current is thus the power supply voltage reduced by the IR loss and back EMF.

    The steppers have 200 full steps per revolution, with the controller dividing each full step into microsteps, typically 16 or 32, for a total of 3200 or 6400 microsteps/rev. Each microstep has a specific relation between the two winding currents, defined as the sine and cosine of an angle running from 0° to 360° every four full steps.

    The vector sum (RMS value) of the two currents adds up to the nominal winding current set by the twiddlepot on the driver board. For example, a 1 A setpoint will produce 0.71 A current in both windings during the 45°, 135°, 225°, and 315° microsteps. Anything that changes the relationship between the two winding currents will affect the direction of the force applied to the rotor and disturb its rotation.

    The controller must change the winding currents at the start of each microstep, then stabilize the currents at their new values, by applying the power supply voltage to the ends of the wires leading to the motor. Because the motor winding inductance limits the current’s rate-of-change, the controller uses PWM to switch the voltage much faster than the winding’s time constant to make the average current closely track the desired setpoint. That’s the sawtooth part of the waveform, over on the right side:

    Current rise - 18V 1A 3 RPS

    Here’s how it all fits together.

    The long rising slope in the middle of the screen shows this equation in action:

    V = L Δi/Δt

    Where L = winding inductance and Δi/Δt = current rate-of-change.

    The effective voltage V at the winding is the supply voltage reduced by the IR loss and the back EMF. You can’t measure the effective voltage directly, but it pops out of the equation when you know the inductance (from the motor datasheet) and measure the Δi/Δt from the rising slope. The linkie above the picture has the calculations for a different motor & supply voltage.

    So the power supply voltage, current setpoint, and back EMF determine Δi/Δt. The current setpoint comes from the motor datasheet (it’s a “1.0 A” or “1.5 A” or “2 A” motor), so you know the IR loss in the wires. The back EMF comes from the motor speed, which you pick to be faster than anybody else’s MPCNC [grin].

    As long as the speed remains low enough, the controller can change and regulate the winding currents during each step. When the speed gets too high, the controller loses control and produces the wreckage in the middle of this trace:

    MPCNC X 10mm 60mm-s 500mA-div

    The bottom trace shows the controller’s PWM switching, which should always be similar to the narrow spikes over on the left. In the middle, where the motor reaches 60 mm/s, the “PWM” degenerates into wide pulses as the increasing back EMF reduces the available voltage, the Δi/Δt falls, and the current can’t reach the proper value during each microstep. Because the current doesn’t reach the setpoint (the peak values as the motor starts and stops), the torque drops and the motor tends to stall in the middle of the move.

    I picked absurdly high speeds to show the effects for the Circuit Cellar column, but when folks kvetch about “missed steps” and suchlike, you’re seeing the equation in real life. If the motor speed remains low enough, then a low power supply voltage works just fine.

    However, the power supply voltage provides the only knob available when you feel The Need For Speed or the need for more torque at a given speed. In round numbers, going from 12 V to 24 V adds enough headroom to make 133 mm/s = 8000 mm/min traverse speeds possible, if not practical.

    I did an analysis of the crappy stepper motors Makerbot used in the original Thing-O-Matic, back in the day, with truly grisly detail. It’s more than you really want to know, but provides more info on most of the topics. The comments were enlightening, too.

    (Ryan: This may be a dupe, but might be better worded than my earlier attempts)

    1 user thanked author for this post.
    #88125

    Jeffeb3
    Participant

    SO where is the speed limit? It looks like if the slope is longer than the step period, you get the wreckage in your graph. There’s probably a reduction of power approaching that, but getting to the sawtooth phase is enough to reach the desired current (if only for a moment).

    My current mental model is that with higher voltage, the slope will rise faster, and the area under the curve will be larger, so you’ll get some drop in total current for the step with lower voltages. At some point, the slope won’t be enough to reach the set point in time, and it will then dramatically lose current, torque, and power, right? So what speed is that drop off? The first graphs, with the comparison between 9V and 18V slopes led me to think that was at 148mm/s (did I do that math right?). The wreckage graph is only at 60mm/s (which is still at 100 16ths steps/mm). It’s important to know about where it is, because a significant drop in torque at 40mm/s is enough for me to look into 24V. A drop at 150mm/s doesn’t matter to me at all.

    Usually, when I skip steps, I’m moving at 10mm/s, and milling, but I haven’t tried to max out my rapids either.

    #88127

    BT
    Participant

    How much of that waveform is dependent on actual physical motion of the stepper?  Isn’t there a lag due to physical inertia/resistance/friction involved in here somewhere and how much does actual stepper ability to follow the changing magnetic field affect the magnetic field?

    #88135

    Jeffeb3
    Participant

    while back EMF is proportional to rotational speed

    How much of that waveform is dependent on actual physical motion of the stepper?

    So Ed talks about the back EMF being proportional to speed. The other side of the problem is that when the stepper hits resistance, the amount of torque is either enough to move the motor shaft forward enough to the next step, or it’s not, and the external torque will win and send the motor shaft back to the previous step. In that sense, the fact that the sine wave in the wrecked graph has lower peaks means that there’s smaller torque getting to the shaft, and the smaller the external torque needs to be to overcome the motor torque and make it miss a step.

    #88144

    Ed Nisley
    Participant

    a lag due to physical inertia/resistance/friction

    On the scale of the PWM pulses, the motor speed (and, thus, back EMF) is pretty much constant, so you can make a bunch of simplifying assumptions and not be too far wrong.

    getting to the sawtooth phase is enough to reach the desired current

    Timing, however, is everything. The motor must have the proper winding currents during essentially all of each microstep in order to produce its rated torque. To the extent the currents aren’t correct, the motor doesn’t operate properly. To the extent the currents don’t reach the proper value, the motor can’t generate the proper torque.

    So what speed is that drop off?

    It depends on what you consider to be “isn’t operating properly”, of course!

    Let’s run the numbers for your example:

    moving at 10mm/s, and milling

    Suppose that’s along the X axis:

    • 10 mm/s → 0.3 rev/s = 19 RPM
    • Back EMF = 0.4 V drop
    • 1.5 A setpoint → 9.0 V IR loss (worst case)
    • Effective voltage at winding = 2.6 V = 12 – 0.4 – 9.0
    • Δi/Δt = V/L = 2.6 / (2 × 4.8 mH) = 270 A/s
    • 1:32 microstep mode → 2000 step/s = 500 µs/step
    • Max current change per step = 135 mA = 270 A/s × 500 µs

    At the end of the first few microsteps:

    1. Need 1.5 A × sin(11.25°) = 290 mA, have 135 mA
    2. Need 570 mA, have 270 mA = 2 * 135 mA
    3. Need 833 mA, have 405 mA = 3 * 135 mA

    The current never reaches the proper value, even at the top of the sine wave, so the overall waveform becomes triangle-ish, the motor runs at half-or-less of the current you expect, and the rotor isn’t being positioned correctly due to the severe current distortion.

    No wonder it stalls!

    a significant drop in torque at 40mm/s is enough for me to look into 24V

    Soooo, it looks like wreckage at 10 mm/s. I’d expect something like the triangles two or three cycles in  from the ends, where it’s running relatively slowly:

    MPCNC 12V 10mm 60mm-s 500mA-div

    Double the supply voltage to 24 V (modulo the usual caveats about expecting too much from Chinesium) and see what happens. I’d expect a dramatic improvement with no other tweakage.

    Caveat: I’ve been wrong doing calculations in real time, so don’t be surprised if a number’s off by a bit (or a lot). The general principle holds, however; run your own numbers and see what pops out.

    1 user thanked author for this post.
    #88148

    Jeffeb3
    Participant

    I’ll be looking carefully at that math, after I spend a minute finding the right gif, I will check that out.

    #88152

    Jeffeb3
    Participant

    1.5 A setpoint → 9.0 V IR loss (worst case)

    I don’t have a 1.5A, I have a 1A, but the 6x doesn’t seem right. You measured 6Ohms across the wires and everything, and 2.2Ohms is the motor coil, so it should be:

    1.0A (or 1.5A, sure) * (6Ohms – 2.2Ohms) = 3.8V (or 5.7 for 1.5A)

    amiright?

    Δi/Δt = V/L = 2.6 / (2 × 4.8 mH) = 270 A/s

    I’m not sure why there is a 2x in the inductance value. Also, that’s higher than your motors, which are 2.6mH, right?

    If I used 1A, 3.8Ohms, and 2×2.4mH, then that ends up with 1625 A/s.

    Need 1.5 A × sin(11.25°) = 290 mA, have 135 mA

    One whole step is from 0 degrees to 90 degrees, right? So it should be 1.5A * sin(2.815)? or just 7.5ma

    A whole step would take 160ms, and using the rest of your math, we could achieve 43A/whole step, which is far greater than the required 1.5A, so something seems wrong with the microstepping math. I understand that if it was on the hairy edge that would be the difference between a sine wave and a triangle wave, but 30x seems like plenty of headroom.

    #88154

    Jeffeb3
    Participant

    Also, I feel like saying that I am really enjoying this, and I understand 30x more than I did a few days ago. Thank you so much for sticking around here.

    #88164

    Jeffeb3
    Participant

    One whole step is from 0 degrees to 90 degrees, right? So it should be 1.5A * sin(2.815)? or just 7.5ma

    I did this sine wrong, it’s actually 75 mA, which sounds about right, since 1500mA/32 is 47mA, and the first step would be the biggest.

    #88167

    Ed Nisley
    Participant

    Remember: the motors are in series, so you have twice the resistance and inductance for one motor, plus resistance in the harness to / between the controller and the motors. I measured 6 Ω end-to-end and the motor datasheet says 4.8 mH/phase, but your setup will surely be different.

    The model for each motor winding is a resistor (the winding wire resistance) in series with an inductor (the coily winding), so, for two motors in series, you have three series resistors: one wiring harness and two winding resistances. The voltage available for each inductor is the supply voltage minus the total IR drop in all the resistors, then divided by two to pu half the voltage in each motor. Plenty of simplifying assumptions, but pretty close to reality.

    Pondering the stepper controller datasheets (TI DRV8825 and Allegro A4988, modulo the usual warnings concerning knockoffs) will help understand microstepping, because they have prettier pictures & graphs than I can draw. Those scope shots came from a variety of test setups and I’d be unsurprised to discover I used the wrong microstepping count somewhere along the way.

    Hey, look, somebody’s wrong on the Internet! [grin]

    #88173

    Jeffeb3
    Participant

    1.0A (or 1.5A, sure) * (6Ohms – 2.2Ohms) = 3.8V (or 5.7 for 1.5A)

    amiright?

    So, nope. Strike one:

    The model for each motor winding is a resistor (the winding wire resistance) in series with an inductor (the coily winding), so, for two motors in series, you have three series resistors: one wiring harness and two winding resistances. The voltage available for each inductor is the supply voltage minus the total IR drop in all the resistors, then divided by two to pu half the voltage in each motor. Plenty of simplifying assumptions, but pretty close to reality.

    I’m not sure why there is a 2x in the inductance value. Also, that’s higher than your motors, which are 2.6mH, right?

    Nope, strike two:

    Remember: the motors are in series

    One whole step is from 0 degrees to 90 degrees, right? So it should be 1.5A * sin(2.815)?

    I still think this is right (except it leaves us with 73mA, instead of my original math). One full step is switching current through coil A to coil B, which is 90 degrees of the circle. Here’s 1/4 stepping from the a4988 doc:

    miceosteps_fourths

    There are 4 steps from 0 to 1, and 4 more from 1 to 0, and 4 more from 0 to -1. You can also see clearly that the first step requires the largest gain/step, since the slope is highest when crossing zero.

    For 1/32 stepping, the current change needed is Amax * 0.05
    For 1/16 stepping, the current change needed is Amax * 0.10
    For 1/8 stepping, the current change needed is Amax * 0.20
    For 1/4 stepping, the current change needed is Amax * 0.38

    I agree with the rest of the math.

    #88177

    Jeffeb3
    Participant

    This is really interesting…

    I made a spreadsheet with different speeds, going through these numbers. I got the same answer for 10mm/s, but with my edits for microstepping phase.

    https://docs.google.com/spreadsheets/d/1J_x99-ODZUWbPLjpOhB9Y12wsMvDvVEOTyRxZYLCHvw/

    (I think you can save a copy and edit the stuff on the left to see how things change stuff.)

    Interestingly, the dropoff is between 16 and 17mm/s.

    For the google adverse:

    motor_calcs

    I guess the next step for me is to measure or get the numbers from my actual machine, and see if this is close. I wish I had a good way to measure current like in your graphs. I would be pleased as punch to measure the current at 16mm/s and see it just barely make it in time.

    Attachments:
    #88181

    Jeffeb3
    Participant

    Something must go wrong with the model when the back emf is high enough that the voltage for the inductance goes negative? Now I have to run my CNC at 80mm/s and see what happens.

    BTW, for any readers who have made it this far, remember that this doesn’t negate any of the work done in the gallery at 12V. There are plenty of examples of peole running these machines at fast travel speeds without skipping steps.

    #88183

    Jeffeb3
    Participant

    Another question. The voltage drop due to IR is 1.5A * 6Ohms, but when taking the first microstep, it’s actually going from 0A to just 74mA. When it gets closer to 1.5A, the steps are smaller. On the last 1/32nd step it goes from 1.499A to 1.5A. The voltage drop due to internal resistance should be a lot smaller then, right?

    Another issue is that if the motors are wired in series (or not, really) then the max current is set to 900mA. It used to be set closer to 1.5A, but that was for parallel motors.

    #88184

    Jeffeb3
    Participant

    If I plug in 900mA, I get the cutoff moved to 53mm/s.

    #88194

    Ed Nisley
    Participant

    Looks like I used a 1:8 microstep picture with 1:16 figures; things go downhill from there.

    Remember, all of this modeling boils down to rule-of-thumb approximations. The real test is to measure the actual current, which requires somewhat more test gear than can reasonably be expected, to see what’s going on.

    If you’re feeling adventurous, you can use one wire of the harness as a current-sensing resistor: measure the wire resistance, connect a scope across the wire, and the waveform will give you the current. For example, a 0.25 Ω wire will give you a 250 mV/A = 4 A/V waveform. Note that the wire has nothing in common with circuit “ground”: connecting the ground clip of a line-operated scope probe to the wire will kill the driver chip stone cold dead.

    For back EMF, feed motor speed into the measured values for the motor, then knock that value off the supply voltage; worry about the phase angle between the back EMF and the microstep angle at some point. As the effective voltage goes down, the current goes down, and the motor stalls: the controller can’t produce more back EMF than that.

    The IR drop varies with the current, so it’s a minimum when the sine wave crosses zero and maximum at the peaks. However, when you’re looking for trouble, don’t start by minimizing the trouble. You’re not showing why something works, but why it might not; always expect reality to be worse than your assumptions.

    Accelerating that huge mass hanging on the gantry requires more torque than cruising along at top speed, which means the acceleration limits influence the results. A sufficiently low acceleration may prevent the motor from reaching top speed during a short move, which will screw up all your calculations.

    Basically, you cannot determine a hard speed limit from these simple models. What you can get is a better understanding of how speed, torque, and supply voltage interact, which is nothing to sniff at!

Viewing 30 posts - 31 through 60 (of 68 total)

You must be logged in to reply to this topic.