Welcome! Log In Create A New Profile

Advanced

Controlling mostfets with motor driver board to increse amp range?

Posted by jatmega 
Controlling mostfets with motor driver board to increse amp range?
February 27, 2013 08:25PM
Hi
To get to the poin look in the last section.

I am building my first 3D printer and I was stupid enough to buy some weak stepper motors for the job, nema 17 .4Nm at 1.7 Amp. To add to this stupidity I bought 5 stepstick controllers who only supports 1 amp atm, and I dont have the money to re build them to support 1.5 amps. I am basing the build on Ramps 1.4 board, arduino mega 2560 R3, Tr 10x2 Ø10 2mm pitch trapezoidal threadroads for linear movement, and my own casted hotend. Since I chose the threadrods to do the linear motion I expect to get very nice resolution, and not to much backlash, but i gues this wil require a bit more torque than i can squese out of the motors with 1 of 1.7 amps. I am studing mechanical engeneering at the University of Stavanger in Norway, and one of my clases is basic electronics. From this class i have learned of the n-mosfet transistors, and i bought some for a LED-cube project .

I just realised that i might would be able to use the n-mosfets to transfere the amperage needed to the motors. Anyone got any experience with using the motor driver board to controll n mostefs like this?

Apreciate any help, and apologizes for my bad english.

JAT
Re: Controlling mostfets with motor driver board to increse amp range?
February 27, 2013 11:32PM
We normally run 0.4Nm 1.7A motors at about 1A. The 1.7A rating is at a temperature rise of 80C, which would melt the plastic brackets.

There is plenty of torque at 1A for a typical Reprap with belts. Threaded rod should be less torque as it is geared down more. The issue is the speed, and to get more speed you need higher voltage, not current.


[www.hydraraptor.blogspot.com]
Re: Controlling mostfets with motor driver board to increse amp range?
February 28, 2013 03:29AM
I agree with Nophead, 17.4 Nm is a huge torque for stepper motors. What are the inductance and resistance of the coils? You may have a problem driving them quickly.
Re: Controlling mostfets with motor driver board to increse amp range?
February 28, 2013 04:13AM
Thanks for a quick replys both of you, really appreciate it.

These are the specs of my motors:

Model No.: PHB42S40-402
Frame Size: 42×42mm (NEMA 17)
Step Angle: 1.8 Degree
Wire Connection: Bipolar
Current:1.7 A
Voltage: 2.55 V
Resistance: 1.5 Ω
Inductance: 2.8 mH
Holding Torque: 40 N.cm (56.6 oz-in)
Detent Torque: 2.2 N.cm (3.1 oz-in)
Rotor Inertia: 54 g.cm2
Weight: 0.28 Kg
Motor Length: 40 mm
Lead Wire No.: 4
Wire Length: 30 cm
Wire Connector: None
Shaft Length: 24 mm
Shaft Diameter: Ø5 mm

I thought it might needed more torque because of the friction between the threads an the nut, but I dont have to much experience with torque in real life.
Re: Controlling mostfets with motor driver board to increse amp range?
February 28, 2013 10:12AM
Motors specs actually look good, and are the right type (low coil resistance/inductance types).

Motors in range of 1Nm to 3Nm are for milling machines, and informatively they weight between 0.7 and 1.7kg ... each. Three motors like that would break a prusa by just looking bad at it.

Aha, i just read again what you said about 10x2 trapezoidal rods and yes, the motors are good and thats typical belt driven reprap, but probably wont be good enough for your rods. Probably somebody gave you this feedback by looking at rods and and your motors. Probably trapeze screw means also heavier moving parts in your setup. I also think that would be true and to drive 10x2 rods you probably want some beefier motors, typically nema34 are 1Nm and up. And probably other drivers and other psu than 12v, because if you put 12w/nema34 is same as 12w/nema17. Steppers will only eat what drivers give them, and for bigger motors to give more power you need to feed them more, else its pointless to change them in the first place.

Edited 1 time(s). Last edit at 02/28/2013 11:07AM by NoobMan.
Re: Controlling mostfets with motor driver board to increse amp range?
February 28, 2013 05:44PM
Once again thanks for a quick answer. I believe that the motors might be strong enough if i drive them at 1.-1.5 amps, and might even at 1 amps. It all comes down to lubrication. I dont have any big or heavy parts to move, it should be nearly the same as a mendel, but i just wanted the added precision/resolution that i could get with threadrods.

I still wonder on my first question, if it is possible to make the stepper driver board output control n-mosfet transistors to provide adequate amps for the motors?
I also wonder if i will get more torque if i use higher voltage?
Re: Controlling mostfets with motor driver board to increse amp range?
February 28, 2013 08:02PM
No you can't add external transistors to these stepper drivers, you need a chip designed to drive external transistors.

Higher voltage reduces the rate the torque drops off with speed. It doesn't affect the torque at low speed.


[www.hydraraptor.blogspot.com]
Re: Controlling mostfets with motor driver board to increse amp range?
March 01, 2013 05:25AM
NoobMan Wrote:
-------------------------------------------------------
> Motors specs actually look good, and are the right
> type (low coil resistance/inductance types).
[ . . . ]
> Steppers will
> only eat what drivers give them, and for bigger
> motors to give more power you need to feed them
> more, else its pointless to change them in the
> first place.

Exactly.

There is a problem however. That is the backemf of the motor. Now, I would appreciate it if someone can check my math, but this is what I've got with the research I've done.

The table below is in Full Steps/second. The top headings are the torque the motor can sustain. T/4, for example, would be 0.1Nm (10 N-cm)
[edit:] The correct table is in a later post

The math behind the table is:

I = (V-K/t)/R * (1-exp(-t*R/L))
where I is the maximum coil current
V is the driver voltage
R is the winding resistance
L is the winding inductance
K is the torque constant

K is derived from the holding torque and coil current:
K = (T Max)/(I Max) * pi * step_angle/180

I solved each cell in the table for t numerically, but the number in the table is 1/t. Values for I were set by multiplying I Max by T/(T Max).

Edited 1 time(s). Last edit at 03/01/2013 10:20AM by Annirak.
Re: Controlling mostfets with motor driver board to increse amp range?
March 01, 2013 08:26AM
I may be missing something coz I dont see why bemf would be an issue to bother much with. First you probably get around most of it if via SR or external diodes, some chips now have internal diodes. Second, bemf is probably an issue at braking and not a concern under normal operation; and braking is actually sort of helped mechanically by frictions, especially with screw actuators that makes the leverage ratio favorable, e.g. screw blocking or breaking. Third the breaking bemf effect depends on the deceleration ratio coz its squared, probably more than the mass of parts which means you can have a quite a huge impact on it simply by adjusting firmware parameters. Forth, if you are worried about bemf showing up at power input, you can put a zenner with its leg into a resistor + a power transistor and that will short all waves above the normal V+; this is a classic. Or a transil diode, but that is not precise and has leakages, so that has to be like +20% rating over what is normal level, but its still gonna take peaks down when they pop out above that level. Again maybe i am missing something on the topic of bemf.

If i would bother with low level and hardcore math like that applied to reprap and motors torque, i would rather start over with detent torque and weights of belt/screw+rotor_weight itself, and that body * certain speed has to be compared to the detent torque in particular, which should give an ideea about top speeds and accelerations, coz that is what we are going for in reprap. The way you did math is referenced to holding torque, which i think is a way to do this math, probably more suitable for a milling machine with a screw actuator, coz they go low accelerations e.g. they dont care for it (=not an objective of the design), but instead they care much for toolhead applied force onto workpiece, so milling being referenced to holding torque makes some sort of sense this way. And imho, 3d printing would be then be referenced to detent torque instead, coz we *should* actually aim the design for accelerations and speeds, thats more relevant in our case since 3d printing means zero force on toolhead. Well i doubt this actually helps with anything but at least that is the approach that makes sense to me in the context. Just an opinion.
Re: Controlling mostfets with motor driver board to increse amp range?
March 01, 2013 10:19AM
Back EMF is a problem in all motors, since it is the limiting factor, it causes torque rolloff as speed increases.

Here's a quick back EMF primer:

When a wire moves through a magnetic field, or a magnetic field moves past a wire, a voltage is induced, which opposes the direction of motion, according to the right-hand-rule. When this is applied to a motor, what it tells you is that the faster a motor turns, the harder you have to fight to turn it faster. In literal terms, here's the math:

F = ILB
back EMF = vBL

where F is force applied to the wire,
I is current in the wire
L is the length of the wire
B is the magnetic field strength
v is the velocity of the wire.

So if you have a wire moving through a magnetic field, you can be sure that it will hit a maximum speed when
F = 0
Which implies I = 0.

Assuming the wire has some resistance, R, the steady-state current in the wire will be:
I = (V - back EMF)/R, so the

Now, with stepper motors, the situation (and the math) is more complex, since you need to generate a rapidly changing waveform. In addition to this, stepper motors have a large inductance to contend with.

The current in an L-R circuit is:
I = V/R * (1 - e^(-t*R/L))


But we also have the back EMF to consider:
back EMF = Ke / t_step

Here, Ke is the step-wise toque constant

Ke = Tmax/Imax * pi * step_angle / 180
***Note that there was an error in my previous table, as this wasn't calculated correctly. This creates a huge difference.

So the actual formula for I with the back EMF taken into account is:

I = (V - Ke/t_step)/R * (1 - e^(-t*R/L))

Now, you care about the time for one full step, which is the time required to go from I=0 to I = Imax. Now, torque is proportional to current, so if you derate the toque, then the time required for a step also drops.

Fixing the error from my previous calculations, the updated table for the quoted motor parameters is below.

Full steps/second:
+-------+-----+-----+-----+-----+-----+
|Voltage|Stall| T/4 | T/2 | 3T/4|  T  |
+-------+-----+-----+-----+-----+-----+
|    9  | 1218| 1008|  849|  723|  621|
|   12  | 1623| 1359| 1158| 1000|  872|
|   15  | 2029| 1709| 1466| 1275| 1121|
|   18  | 2435| 2059| 1773| 1550| 1369|
|   21  | 2841| 2408| 2081| 1824| 1617|
|   24  | 3247| 2758| 2388| 2098| 1865|
|   27  | 3653| 3108| 2696| 2373| 2113|
|   30  | 4058| 3458| 3003| 2647| 2360|
|   33  | 4464| 3807| 3310| 2921| 2607|
|   36  | 4870| 4157| 3617| 3194| 2854|
+-------+-----+-----+-----+-----+-----+

Edited 1 time(s). Last edit at 03/01/2013 10:21AM by Annirak.
Re: Controlling mostfets with motor driver board to increse amp range?
March 01, 2013 01:45PM
For me to understand your math, i need to understand its meaning. I can recognize the form of value_x * (1-e^-t/tau) is a general rising form with a time constant, and your time constant accounts for inductor, so you have a first order system. If there would be also a capacitance in the model would of been second order. Also if it would be falling edge it would of been without 1-, and with e^-t/tau only. The falling edge formula is excluded probably for simplicity, as rising times are guaranteed bigger than falling ones hence are the relevant ones.

So basically your last formula is the formula for rising edge of ... something, anything, be it a voltage on a cap or current trough an inductor, and for a moving (t) you get the value of that something at a certain point in time, before it stabilizes at its final or max value. That is assuming the initial condition is zero. Cause the complete formula with different initial state is I(time) = I(initial)*e^(-t/tau) + I(final)*(1-e^(t/tau)). So your last formula and table looks like what i believe its called the "rising edge" or "rise time" of some current I (initial condition zero), with different final values mostly changed by ohms law. It appears to include some shiftter Ke over something, which you call bemf/step, but very well could be anything, say Ke can very well be some error or voltage ripple or some form of iron losses. The different levels of I seem to come mostly from ohm's law, thats what the table seem to show. Since that formula is not an equation and actually its a function of t, i dunno what happened to t which is like the main variable, but lets say i get the big picture. Ok, so i hope i got it so far.

I am no expert, not smart nor wise, but i think modeling bemf like a first order RL circuit is probably ok-ish for something like a dc or even ac motor, so i think something like that must have been your inspiration. Lets think about it and see if it is suitable at all for stepper motors. There are rotor magnets which move around their magnetic field so they "bathe" the coils in it. That sounds like your model so far.

But what doesnt show up in your model, is that those coils also have a bipolar feedback controlled electromagnetic field of their own, which changes its shape and direction about a few thousands times faster than rotor moves. It kinda makes those rotor moves rather less relevant. To me that feels like a lot, and does not appear in your model, not at all. Lets think of those sense resistors which which also do not appear in your model. Can we assume that bemf shows up on sense resistors, and if so, could it be that the ic would take it in when doing control? Also not in your model, but if i put diodes on outputs, or if i have any other form of voltage clamps, how does that work with bemf? That RL first order circuit is the simplest possible model, and applied to the most inappropriate scenario, where among other things we have a dynamical control with a closed loop feedback for coils current, and possibly other things like voltage clamps, and the said model has no provisions for such. So i dont think its suitable. I do know that ppls can use bemf as feedback for an usual dc, or ac, or even bldc motor. But i personally dont think it can be feasable with steppers, because its an entirely different thingy, so i cant see it happening. Well, all this is just my opinion, so by all means dont take it personally or some other way. Just a different point of view.
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 08:58AM
I think that you're right that there's an error in my reasoning. Stepper motor back-emf should be sinusoidal, whereas I've assumed it is constant. This will take some more work to analyse properly.

In the mean-time, here are the core assumptions:

The position of the rotor is proportional to the arctangent of the currents in the two coils. There is no debate about this, this is the physics of a stepper motor.

angle = 2n/steps arctan(Ia/Ib)

Where angle is the rotor position,
n is an integer, indicating the set of 2 full steps that the rotor is in,
steps is the number of steps (e,g, 200 for a 1.8deg motor)
Ia and Ib are the phase currents.

From that, we can determine that what limits step rate is rate of change of current. The simplest range of current to look at is a single full step. One phase current will go from 0 to +/- Imax while the other phase current does the opposite.

If no bemf were present, the change rate would be:
I = V/R * (1-exp(t * R/L))
t = L/R log(1- Imax * R/V)

When the stepper motor is fully loaded (i.e. about to stall), the back emf will be in phase with, and proportional to the phase current. The magnitude of the vector sum of the two back-emf voltages is constant, and it is given by:

|back emf| = Ke / t_step
Ke = Tmax/Imax * pi * step_angle / 180

Note that back emf is a vector, formed by the sum of bemfA and bemfB, the two phase back emf quantities and that only its magnitude is given in the previous equations.

Given the sinusoidal nature of the per-phase back emf, this is quite complicated. It will be interesting to see if back emf has much effect.
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 01:48PM
> The simplest range of current to look at is a single full step.

Imho step size is rather irrelevant, simply too big. During this time all currents in the coils have changed tens thousands times. And there is no current or voltage or no electrical effect to speak of that lasts from the start till the end of this period.

To make myself more blunt, this formula:
I = V/R * (1-exp(t * R/L))
does not exist at step-scale.

This is not an equation, it is a continuous function of (t), time, usually at nanoseconds or microseconds scale for t. It is the formula for the rising edge of the current inside the coil, that is at the on-time part of the bipolar switching frequency (or what that frequency is called).

This is a part of the more generic function of time I(t) = I(initial)*e^(-t/tau) + I(final)*(1-e^(t/tau)), where tau is time constant L/R or R*C for first order circuits, and has many applications. Applied to rising edge with zero initial condition first term is null, and time constant for RL circuits gives your expression.

It computes different values of rising I for different (t) times, or viceversa. When t goes to high value, the e^(...) part goes to zero and I goes to I=V/R which is the value I was "aiming" for. Thats perhaps reached for other motors, but in our case it never reaches that coz driver switches the current when Imax is sensed. So the way we can apply it in our case is to set the drive to Imax, and then compute the time it takes to reach Imax, which gives us perhaps an idea for the minimum on-time so you know what frequency to set, if the driver allows changing frequency. Or vice-versa, to set the parameters for given inductance of the motors. Probably its more useful to use the full expression on the falling edge to get an idea about decay time and setting, again if driver allows changing decay mode. Getting a minimum blank time or offtime from a formula like this should be neat. However both I max and on-time are more or less sort of given settings for the stepper driver, if you want to look at other things when it is functioning.



Bottom line is that more or less I dont think we get across each other. I'll stop this, coz perhaps i am wrong or hard to get to. However i shall try to recap my point one last time, in a different way:

- I would think of it like this: rotor magnet(s) have rather low field, and them moving 1.8 degree would induce a theta emf force in a coil nearby. But during that exact time, the driver changes the current in that coil 50000 times/second. And its current peak (Imax) is precisely controlled to a certain level, and in each of those 50.000 cycles the current has been actively driven through zero. What could the rotor induce in this context? Doesnt feel like much, actually sort of feels like nothing.

- Whatever that theta force was, its quite irrelevant by now, when you think like that. Each of those 50k+ cycles was controlled by precise sensorial feedback that would includes that theta condition or and then whatever errors on top. You want to model this as the effect of 1.8 degree move, but that is not comparable and cant be related to anything that happens in the given interval.

- If you do actually want to model it then you have to go down to what happens in each cycle of current, ontime and offtime, decay and blank time or whatever named, and check what happens in each part of this cycle, to each coil. And when you go down the scale from step size, to frequency size, that bemf effect kinda dissapears being broken down in pieces and "eaten" by the active control via the feedback loop.

To put things in perspective or scale, if we would have a situation where coils would be capable to induce a force into rotor magnets, they would induce 100k times more force into magnets than what magnets would be capable to induce into coils. Nothing even has to move for this, it suffice that coil current changes direction through zero and makes fields pulsate and "bathe" still neighbors in their changing field. The induced effect is same either if a wire moves through a field or if the field moves through the wire. Sort of speaking at normal rpm the iron losses or eddy currents in the metal vecinity parts should be many many times higher than normal circumstances bemf.

I am talking about something like this as a reference for what i name coils or rotor. Not to mention the circular geometry of the two coils which actually are multiple coils in series and sort of circularly placed. Not to mention that while in normal ac or dc or bldc or any other motor type the startup capacitors are almost never used, for steppers they are always capacitors used. And fets actually complete the circuit to discharge those caps into coils, so as a result we have both caps and inductors, so just for starters we perhaps should use a switched second order model.

My (ofc personal) conclusion is that from all motor types in the world, the stepper is perhaps the worst one to talk about bemf, for reasons above. I know there are bemf models to be used as encoders or complementary info for motors like ac/dc/bldc, etc. This is not the case of steppers. And its impossible to take bemf modelling from other motors and use them with steppers. Steppers are simply way too different. Good thing is steppers dont even need encoders, not to even mention bemf feedback loops. Its like talking about the 6th wheel of a cart that already has the 5th. Sort of speaking.

You asked for feedback on the topic, so this is mine and reflects nothing more than just my opinon ofc. I have quite a good ideea how hard is to construct something and how easy is for somebody to just come and criticize it down. So by all means dont be downed by anything i said, i can always be wrong. I was only trying to be constructive, i wouldnt bother otherwise, i personally dont like to argue. Cheers!
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 03:50PM
Noobman,
Thank you for your feedback. It made me realise the error I had made about sinusoidal back emf. I will make one more attempt to get my point across.

Before I address back-emf, I think I need to talk about how stepper motor drivers actually work.

TL;DR: At stall speeds, individual microsteps don't matter anymore; when a microstep is missed, recovery is possible but when a full step is missed, no recovery is possible.

Stepper motor drivers are just H-bridge MOSFETs with a control scheme added. There's nothing more to it than that. If you look at microstepping drivers, all they do is turn the MOSFETs on and off quickly to control the current. But if the current is increasing too slowly, all that these drivers can do is indicate a stall condition.

Why do I look at full-steps rather than microsteps? Because when it comes to working out the stall speed of the stepper motor, the limiting factor is the full step rate. If you miss a microstep, you lose some precision, but you can recover. If you miss a full step, you cannot recover without external feedback. Therefore, full-steps are important to consider. If you have an adaptive driver (such as the L6470) it can be programmed to skip from microstepping to full stepping when it reaches a given speed. Thus, again, the full step rate is what is important to determine stall speed.

Indeed, microstepping drivers control the current many times per second. But it's important to understand just how they do this. Since all that these drivers are is H-bridges, their control method is simply turning off the voltage applied to a coil if its current exceeds the threshold current which is set for the current microstep. If the coil current doesn't exceed the threshold current, then the controller just holds the drive voltage on, and the whole system breaks down to a RL circuit.

If we are looking at the stall speed of a stepper motor, then we can safely assume that the current is lagging sufficiently that it is in the RL drive mode.

So hopefully, that addresses why I'm looking at the RL drive mode and why I'm looking at full steps instead of microsteps.


TL;DR: at high step rates, backemf becomes significant.

Now, to look at back-emf, the magnitude of back-emf is directly related to torque and motor speed. There is no guesswork or opinion involved here, this is just the simple physics.

The torque constant of a stepper motor is:
Kt = Tmax/Imax
The units of Kt are:
Newtons*meters*seconds/Coulomb

Rearranging, we get:
Joule-seconds/Coulomb = Volt-seconds

You see, then that the backemf constant, Ker is not just related to the torque constant; it is the torque constant.

The step-wise backemf constant is just a unit conversion from the backemf constant:
Ke = Ker * pi * step-angle / 180

Again, this is just the physics of the stepper motor. Here's a reference, though note that this reference uses ksteps/second instead of steps/second, so there's a stray factor of 1000 in some of their calculations.

Note that this is the magnitude of backemf-vector and that the back-emf of each phase is sinusoidal (Figure 10 is particularly relevant).

So, how big is the back emf?
For the motor which was quoted at the start of this thread and a 1kHz step rate:
Ke = 0.4Nm/1.77A * pi * 1.8/180 = 0.00701 Volt-seconds/step
bemf = Ke * Fstep = 0.00701 Volt-seconds/step * 1000 steps/second = 7.01V

On a 12-V stepper motor driver, I think a backemf of 7V is significant, but remember that this is at 1000 steps/second, which is 5 revs/second = 300 rpm.

Edited 2 time(s). Last edit at 03/04/2013 03:52PM by Annirak.
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 04:40PM
There are two BEMFs, one sinusoidal one from the motor acting as a generator and the other exponential from the inductive effect of the coils.

When the transistors are on the generator BEMF subtracts from the supply voltage and reduces rise rate of the current. You can see this on a scope of the current waveform and you can see it change as the motor is loaded and starts to lag.

When the transistors are off during fast decay after the initial inductive spike the voltage settles to the generated EMF so you can see that on the voltage waveform. Again I think you could measure that to get the rotor position and by measuring the lag you could see when it was approaching stall.

I think anti-resonance drives look at one or other of these waveforms to add some positional feedback to dampen oscillation.

I have seen odd things when two motors are wired in parallel to one driver. If you stall one the other stalls. In the stalled state (when they are vibrating on the spot) if you turn one slowly the other follows.


[www.hydraraptor.blogspot.com]
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 07:01PM
> Here's a reference....
quote:
"Because this algorithm looks for BEMF only when the phase is not being driven, you have a short window during which to “look.”

1) first part of that theory is basically more or less like the reactive currents when the current leads the voltage or else, including the 90 deg phase shift and rest. Actually a complex theory, mostly deals with complex numbers and utterly complicated stuff. All that theory to later say ... just look for bemf when the coils are to be "zero" feels like lol.

2)What they say is look for bemf after during off-time, blanking, etc, in that period. Presumably after all decay has taken place. Thats when no currents should be anywhere. But the interest is to make that time smallest possible, not bigger. And i dont really pretend to be able to understand enough to make the difference of decay waves between a "motor stands still" decay to "motor moves x rpm" decay. And i would bet under normal operation when one coil is zero level, there is more current from crosstalk with the other coil than induced by rotor. Good question is how to really make the differences and determine what is decay or not and how to single out bemf, for example without knowing load (in the article they assume to know it). Or what is the sampling rate one needs to take that input in. Or how much processing power to compute that in a time window that would be useful in adjusting drive parameters to that. Look for bemf when its "not being driven". Easier said than done.

Edit: Sry havent seen mr Nophead post in time.

Edited 2 time(s). Last edit at 03/04/2013 07:12PM by NoobMan.
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 08:15PM
If you look at the waveforms on a scope I think you will see the generated BEMF is far more significant than the crosstalk between coils. It doesn't look that hard to be able to sample it and get meaningful results. Either measure the voltage when not driven or look at the changes in mark space ratio due to the different rise rates.

Some examples where you can see the BEMF sine wave in between the switching here: [plus.google.com]

Edited 1 time(s). Last edit at 03/04/2013 09:07PM by nophead.


[www.hydraraptor.blogspot.com]
Re: Controlling mostfets with motor driver board to increse amp range?
March 04, 2013 09:14PM
Interesting i was at least partially missing out, started to have a hint at "not driven" thingy but that window time first looked crazy small to me. Still does, sort of.

But still. Its one think to "look" at it ad literam, and one thing to make use of it. To do that, would need to measure dynamical cos(phi) (i'd say sci-fi sort of?) or at least like last posts simply direct dv/dt fall during off/blank time. So to use that as an indication of the load level, i think thats quite a high sample rate, to be able to interpolate good enough. Then need to compute it all fast enough to be able to actually use the results in a window time small so conclusions are still meaningful for next move(s). How does one across that. I think i have a window like 10^-5 or less and probably need like 100-1k readings there? I think a driver would need a clock of guessing 500Mhz~1Ghz or something like that to do something like this effectively, possibly more? Is this estimation in range or off by much?
Re: Controlling mostfets with motor driver board to increse amp range?
March 05, 2013 12:13PM
As the sinusoid is plainly visible on the scope I think all you need to do is sample just before a transistors turn on to be able to reconstruct it enough to work out its phase relative to the step cycle. The difference gives you a torque measurement. A sample and hold circuit driven by the chopper circuit would give quite a low frequency waveform, easily sampled by a micro.


[www.hydraraptor.blogspot.com]
Re: Controlling mostfets with motor driver board to increse amp range?
March 05, 2013 12:23PM
If you want two data points so that you can get a slope, you can always use two sample & holds.
Re: Controlling mostfets with motor driver board to increse amp range?
March 05, 2013 07:13PM
So i think of two points of interest: time when current died, and then time when bemf goes to zero. Making the difference to get the phase shift ~ proportional to load up to stall. But i dont know load condition, that depends on inertia under the abrupt deceleration, so i dont know exactly when to measure, so i need to be able to sample across entire interval, looking for it, and with an interval small enough to interpolate with a good confidence. Allright if the interval was 1 second. But for a ~microsec for the entire interval where i need to catch the bemf going to zero inside it, that has to be more trickier. I imagine i would need stuff like stray capacitance accounted for, etc, impedance matching etc. Sry but some time ago i lost this battle to a thermocouple which didnt wanted to get rid of something like 5mv noise, with everything i could trow at it. So in the context of sensorial business being a very tricky domain (for me at least), my scars say to not trust it like that. Not in my wheelhouse i believe the expression is. Others could, but not for me.

On second though, perhaps an analog circuit like an op amp integrator triggered by comparator across rsense when current reaches zero, integrating the bemf voltage to be read by adc later. Better than discrete time sampling. More freedom, more consistency even in errors .... but dunno how to switch it off, i mean how to anticipate the bridge fets switching on. For a random driver that is.

Edited 1 time(s). Last edit at 03/05/2013 07:15PM by NoobMan.
Re: Controlling mostfets with motor driver board to increse amp range?
March 05, 2013 08:36PM
I think it is easier to do with the voltage waveform. Sample it at whatever speed you like and reject all the samples that are close to the supply rail or ground. The ones in between correspond to the transistors being off and are the sinewave BEMF. From that deduce its phase. I don't think zero crossing is going to be accurate enough. You need take into account all the samples in some sort of averaging way.

You then compare the phase with where the stepper is in its cycle. Some have a zero position output. Others you have to count from reset.


[www.hydraraptor.blogspot.com]
Re: Controlling mostfets with motor driver board to increse amp range?
March 06, 2013 05:22AM
nophead Wrote:
-------------------------------------------------------
Sample it at whatever speed you like and
> reject all the samples that are close to the
> supply rail or ground.

Wow, nophead, that's a really elegant solution! I like it!
Sorry, only registered users may post in this forum.

Click here to login