Shop OBEX P1 Docs P2 Docs Learn Events
Using an encoded DC motor as a stepper equavalent. CNC. — Parallax Forums

Using an encoded DC motor as a stepper equavalent. CNC.

HarpritHarprit Posts: 539
edited 2010-06-27 18:45 in Propeller 1
I am developing the SPIN code needed to use a servomotor in the place of a stepper motor.
There are tremendous advantages and high speeds can be achieved.
And of course there are problems!

I was unable to find others who may have worked on this problem.
I do not want to reinvent the wheel.

Can someone shed some light on this.

If there is not one else working on this, I will discuss this rather interesting subject further
on this forum. I have discovered that it is not a trivial conversion.

Harprit

Post Edited (Harprit) : 6/20/2010 4:04:56 PM GMT
«13

Comments

  • whickerwhicker Posts: 749
    edited 2010-06-20 16:09
    Typically the next step up would be going to three-phase brushless motors when switching from steppers.
    is this what you mean by servomotor?

    Otherwise if you're talking about brushed permanent magnet DC motors, there are some severe low-speed standstill disadvantages, and it's going to be tough to control overshoot on the high-end.



    If you are talking about brushless motors, then it becomes a whole science of current control loops, speed control loops, phase angle considerations, and tuning, along with the higher-level position control and speed/acceleration ramp generation.
  • HarpritHarprit Posts: 539
    edited 2010-06-20 16:20
    Whicker:

    I plan to use a DC motor with a gearbox and an attached encoder.
    I would define a servomotor as a motor that is under the control of a master signal. A Master - Slave relationship
    Pretty much the standard definition. (The idea that only Hobby R/C motors are servos are to be called servos
    is counter productive.)

    As for the stand still and high speed problems, if the errors are within acceptable limits then things may be considered
    to be under control. The usual case for most problems.

    All the problems mentioned in the third paragraph have to be addressed and that is what makes it an interesting problem.

    Harprit

    Post Edited (Harprit) : 6/20/2010 4:43:59 PM GMT
  • pjvpjv Posts: 1,903
    edited 2010-06-20 16:39
    Harpit;

    As Whicker said, you are in for quite a challenge. I presume you will be using ball screws, likely and with a pitch of 8 or so TPI. That means for 1 thou positioning accuracy you need to park the armature within 2.88 degrees.... similar as to what would be needed in the case of a stepping motor.

    But you are right on the speed issue as well as torque at high RPM. I too will be pursuing this after I first finish my project with steppers, but I will be using brushless motors and encoders. The three phase drive issues will be more difficult than they first appear.

    However, good luck!

    Cheers,

    Peter, (pjv)
  • HarpritHarprit Posts: 539
    edited 2010-06-20 16:47
    Lets keep it simple. No machinery right now. Lets get the motor under our control first.
    Lets start with (we can change it later).

    Direction signal 0 or 1
    Speed pulses from 1 to 100_000 pulses per second.
    Resolution 0.0005 inches

    Do it, complete compliance
    Don't miss a count/pulse.

    Harprit
  • pjvpjv Posts: 1,903
    edited 2010-06-20 17:29
    Harpit;

    I have previously experimented with the motors, and have for now settled on using steppers.

    I'm presently working on the mechanics, and to get precision that is already quite a challenge. I see you have specced one half thou.... that will be incredible if you can actually achieve that. Even commercial (at least, affordable) lead screws with ball nuts spec 4 thou per foot accuracy, but the rpeatability is good. I'm targeting a modest 3 thou and will be ecstatic if I get 2. And all that is with only modest forces of a pound or two. We'll see how it turns out as I continue to make changes to the design.

    Cheers,

    Peter (pjv)
  • T ChapT Chap Posts: 4,223
    edited 2010-06-20 17:36
    I have a product that uses a single brushless dc motor with a 12.5:1 gearbox and encoder, plus PID following a pulse/profile generator that defines the acceleration curves, decel, speeds, destination. With a 1" diameter pulley attached to the motor/gbox, the resolution is 1/600 of an inch using a timing belt. So, if you are using a lead screw, you would have a much better precision. I don't think you can start with the software only until you know what your hardware is going to be, then work backwards from the hardware, or at least work both sides at the same time. The 3 phase drive is nailed down, I use MC33035 3phase driver but for the actual Mosfet drive state I use HIP4086 drivers being controlled by the MC33035. Using IRF540's it is a robust solution. With the gearbox you lose speed but greatly simplify things, as at low speeds it is hard to park the motor on a line on the encoder without oscillation, but with the gearbox you can create a deadband of say a few lines, but never see that on the output. You create a pulse generator on one cog in the propeller, then have a PID loop chase the error on another cog. Now, syncing 3 or 4 to run together is a whole 'nother task. I suggest you really think about how many 100's of hours this will take you, I would say I have 1000's of hours into it for one motor. A stepper CNC is an afternoon casual project. What you are describing is a massive undertaking.

    Post Edited (Todd Chapman) : 6/20/2010 5:42:00 PM GMT
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-20 17:53
    Could you use a hefty cordless drill as the motor?

    It's already geared down, quite powerful, and should
    be easy to add an encoder onto to tell position. You
    could control it using 2 pins connected to an H-bridge
    circuit and PWM. Perhaps a very fast back and forth
    pulse series would serve to act as a brake? I don't know
    much about this but this seems a cheap approach. smile.gif

    Powerful, reversible, controllable, cheap..and it already
    has a chuck thing to tighten onto a shaft...seems perfect.


    I bet if you opened one up you could find a good way to
    add an optical encoder setup at a point that would give
    really good fine resolution.

    Post Edited (HollyMinkowski) : 6/20/2010 6:00:25 PM GMT
  • James NewmanJames Newman Posts: 133
    edited 2010-06-20 18:52
    You just need to make a closed loop PID controller using the the encoder and voltage/current sent to the motor. Once that is tuned well and working, just make a small software layer that takes the step/direction signals and generates the proper values for your PID loop.

    Not sure if anyone here has done it, but it's a pretty common thing. Gecko drives are driven by step/dir for example.
  • HarpritHarprit Posts: 539
    edited 2010-06-20 19:30
    So far so good but we need a more thorough understanding of the task at hand.

    The mechanical resolutions are not of interest to us at this time. Mechanical slop has its problems but not now!
    I included the resolution to allow us to estimate what kind of encoder counts, gear box reductions etc. we would need to have a realistic situation
    We can ignore that till the motor is under adequate control.

    Here is what my mind experiments have yielded.
    So this is what I am working on in the software and hardware.

    The problem that has to be resolved is the problem that arises when the motor direction bit changes.
    Assume you get pulse, pulse,.......direction change, pulse, pulse......
    You cannot execute the direction change till all the initial pulses have been executed or the machine will not be doing what was intended
    100 positive moves and one negative move does not equate to 99 positive moves.
    So each pulse stream between direction changes has to be accumulated in a register that the motor is emptying.
    (We cannot change direction till the one register goes to zero. In the mean while the next register is filling up.)
    So as soon as the direction changes, we start accumulating into the next register. And so on. We go to this register after the
    last one has been satisfied.

    What are the dynamics of the requirements to fulfill these requirements?
    Am I on the right track?
    Is there an easier way to do this?
    Have I seen the problem clearly?
    What to the extreme margin conditions look like?
    What kind of errors are likely to arise in such a scheme?
    The solution must be in SPIN and must be learner friendly.

    @ Holly, drill is not a good idea. Bin there, done that.
    @James, its more complicated.
    @ Todd, I'm not looking for a commercial solution, just one we hobbyists will find competent and acceptable.
    The code crunchers can take it from there once we define the fundamentals properly.

    The running of the motors is pretty well understood. PID loop etc. Gearbox slack etc in not important right now, we will get to it later.

    My motor has a 19.5 to 1 gearbox and 500 encoder counts per rev. It stops to within + or - 4 counts and can be held there with ease.

    Harprit.

    Post Edited (Harprit) : 6/20/2010 7:35:23 PM GMT
  • HarpritHarprit Posts: 539
    edited 2010-06-20 19:52
    There is a limit to how fast a stepper motor will accept pulses under a specific load.
    Where is this defined in a real world situation.
    It has to be defined somewhere or there will be slip.
    Is it defined in the set up of the software that sends out the pulses?
    We need to define this number realistically as a part of our problem definition.
    We could do it arbitrarily for now. Lets say 1000 pulses a second.

    Harprit
  • James NewmanJames Newman Posts: 133
    edited 2010-06-20 20:43
    That number is defined in software, because it's dependent on the mechanical qualities of the system. That is that motor torque, current speed, load, etc change all of that. Also note that stepper motors aren't driven by step/direction. The controller for a stepper is, internally the controller keeps track of the state of everything, and drives the motor accordingly. This is really no different than with a dc motor, except that your using a closed loops system with encoder feedback instead of an open loop system.

    It is not more complicated at all...

    Take the number of steps per revolution with the stepper, that is the same as the number of pulses on your encoder. Scale accordingly if needed. Now when a step signal is given, take the direction and either add or subtract this from your current position. Now take the current position and the target position (both in steps/encoder counts) and throw that into a PID function. What you get back is a value that is used to drive the motor. There is scaling to get that right for any physical system, that's what PID tuning is for.

    You don't have to keep track of direction changes. If any of the motor controllers on market are given 100+ steps then a -1 step, they don't wait, they just go to the current position stored internally. It's the job of the controller above that (CNC) to wait for it to be at a position before starting another. Infact if you do that (100+ then -1) on a _stepper_ controller you will loose steps on most of them. You can't even send 2 steps without the controller being done with the last step. The reason is that the step frequency going out to the controller is also determining the speed of the motor in a step/dir control scheme. If you send 100 steps, the controller will try to move to those 100 steps as fast as it can, which will be faster than the physical limitations of the motor. You will miss steps.

    There are a _few_ stepper controllers that can be configured to buffer steps and limit their max speed. For a servo controller, this is all irrelevant however. Since you have feedback, all you have to do is keep track of the current position (via encoder) and the target position (accumulation of steps with direction). The PID loop will generate the appropriate error signal scaled by tuning parameters to a signal that can be fed back into the motor. It really is that _simple_. Also note that I keep saying PID, but the same is true for any closed loop control method. A simple P(gain) loop would work, but you would have a motor speed completely proportional to the difference between the current and target locations. This will mean that you either slowly creep up to the desired position, or you approach it quickly and overshoot, then oscillate. The I will help your error signal adjust depending on the accumulation of error. It adds a sort of acceleration that trys to ramp up and down. The D will adjust your error signal even more taking into account the change in error, or it's slope. Really it's too much for me to explain here...

    Once again, all you need is a PID controller with a simple step/direction interface for modifying the target position. The only difference is that instead of setting the target location directly, your setting it through an accumulation of +1/-1 pulses.
  • pjvpjv Posts: 1,903
    edited 2010-06-20 20:49
    Harpit;

    A real machine will have considerably more complicated requirements than your description suggests. Principally it relates to getting X,Y andZ pulses (assuming direction is already set) out at exactly the right times, relative to each other. This is called linear interpolation for straight lines in 3 axex simultaneously, and circular interpolation for curved lines in 3 dimensions. Imagine your cutter needing to trace the path of a helix..... xyz all at the same time with varying speeds. NOT TRIVIAL. I believe this to be more easily accomplished, at least initially with steppers. Faster performance, if required can be attempted with brushless motors later, and besides, perhaps 48 volt on the steppers will be sufficient for my market.

    Contrary to yourself, I believe it is ALL about the mechanics and slop etc. If these are not adequately held within your desired tolerances, then there is no point in proceding with the electronics or harware. Well, crappy mechanical, I've "Bin There". I'm building a respectable machine that I expect to sell on the commercial hobby market.

    At 24 Volts, with the drivers I built, and acceleration software I wrote, so far the steppers seem happy to run up to 4000 steps/s, and can be nudged to 5000 steps/sec. Tweaking can get me to 7000, but there is not enough torque left to be reliable. Upping the voltage to 48 should give a buch more speed, but first I need to get some logic FETs with higher voltge.

    Now, back to the mechanics.......

    Cheers,

    Peter (pjv)
  • HarpritHarprit Posts: 539
    edited 2010-06-20 21:06
    I want the think about what James and Peter have said in some detail before I write again.

    I have two CNC systems that use stepper motors, neither one has encoder feed back for the motors
    (I have not put either one in use at this time but am getting ready to, on a mill).
    The motors do not have encoders on them in any case. There is no connection for encoders either.
    Pulse and direction pins only for each axis (and micro switch limits).
    Neither one has a way to tell the PC that a move/step has been completed, no acknowledge pin for that
    Maybe these are old technology.
    I do not at this time completely understand what comes from the PC and how it might be configured.

    I'll be back, and I very much appreciate your thoughtful responses. This is great.

    Harprit
  • James NewmanJames Newman Posts: 133
    edited 2010-06-20 22:04
    The simple(money over time) way to do it would just to replace the motors and step/direction controllers with one from say gecko. Their servo drives take step/direction inputs just like most stepper drives, and are relatively cheap. Infact possibly cheaper than a diy approach. The PC is going to be the one sending the step/direction signals, and somewhere in the software (mach or emc maybe? or a 'professional' one like burny?) you tell it how fast to send these. It must send them slow enough that the stepper controller can keep up, so as soon as it's done sending the last step of a move (+the time between steps) it's ready for the first step of the next move. The pc software should also send the steps in such a manner that interpolation is handled decently, by adjusting the frequency of steps to each axis.

    I will agree somewhat that the physical components are of little matter at the moment. (Especially if it's a system that is already built and running.) Your PC software will have a configuration area to set how many steps/counts per unit of travel are needed. Backlash and other things like it are a physical problem unrelated to the electronics, and so are a different battle. Ofcourse a small amount of backlash can be less of a problem with a bit of backlash compensation in the pc software. Once again, should already be there somewhere.

    I would get a cheap servo, or just hook a dc motor to an encoder. (Though real servos have much better physical and electrical properties like inertia and such, due to being made to be driven in a back-forth manner.) Then build the electronics to be able to move that motor with variable speed/torque. (H-Bridge with pwm or scr based drive system.) Then use the obex encoder object to get keep count on your encoder. Then write software in the prop to keep a variable, and add/subract 1 from it based on the pulse/direction pins. Then write a PID loop that takes that variable and the current encoder value and generates a value that is fed into your pwm/scr control software. Optionally if you've never written a PID loop, write a P one. That's a simple as taking the difference between the current location, and the target location, and scaling it by some value (make this adjustable via a pot or something so you can tune it during operation), then feeding that into your pwm/scr driver.

    Hope that helps, and when you get it working, take some pics and video for us all. [noparse]:)[/noparse]

    Edit: Ohh, forgot to mention that if the servos aren't permanent magnet based, then you'll also have a field to take care of. I would just run it with a constant voltage that the motors field is rated at. After you get everything working like that, you can do some research into field weakening and get some higher speeds. This is a trade-off for torque, but only after you hit the motors rated speed. You probably won't use it for servos, but for a spindle that's another story.

    Post Edited (James Newman) : 6/20/2010 10:10:54 PM GMT
  • HarpritHarprit Posts: 539
    edited 2010-06-23 21:30
    Time out guys.
    OK
    I have thought about it enough to reply intelligently.

    I am taking about using a servo motor to replace a stepper motor. The posters are talking about
    making it easy to do it all with steppers. Wrong focus. Therefore: ?? answer.

    As I said I have two stepper based CNC kits. They are good to go. I want to investigate what it takes
    to use a servo with the express purpose of improving the high speed end of the operations. So far
    I have every reason to believe that I will be successful. I actually built a one axis drive to experiment with.
    Photo attached. I can really get the thing going. Very good response and very, very fast but I am diriving it
    direct from the motor, no gearbox.

    Now to determining if it works just as well under load. I will report back. Then I will actually build a
    simple CNC machine to see how well the "composite machine" works.
    I will report back on that too. We may well change they way things are done in hobby CNC.

    Thoughts, comments, discussion and ideas are as always, welcome.

    Harprit.
    2048 x 1536 - 672K
    2048 x 1536 - 776K
    2048 x 1536 - 740K
  • Chris_DChris_D Posts: 305
    edited 2010-06-23 21:40
    Harprit,

    You should be able to do it, there isn't any reason I can think of why it won't work.· Gecko makes a step and direction input drive for servos which is what you are describing.· There are other servo drives that also use step and direction inputs.· The last step and direction servo drive I assembled was "controlled" by an Atmel Atiny micro which is far less powerful than a propeller.·

    Chris
  • James NewmanJames Newman Posts: 133
    edited 2010-06-23 22:22
    *sigh*... I give up... Nobody can say I didn't try. I don't do this sort of thing for a living or anything...
  • rpdbrpdb Posts: 101
    edited 2010-06-25 20:46
    I am using USDigital encoders on DC motor shafts that couple through a 450:1 gear box (my nieces old "power-wheels"). Lots of torque for a small motor. I am reading 80_000 ticks per wheel revolution or 222.22 ticks per degree of wheel turn. The motor controll is a pair of HB25s which accept standard servo signals. They are on a wheel bot now, but I could see using them for a CNC at least for a circuit board router.

    I am working on the code and have posted a request on the Propeller forum for help converting the positionController from C to SPIN, and then eventually to PASM.

    This might be "the droid you're looking for".





    ps Take a look at Probotix.com for an inexpensive (less than $1000 mill).
  • HarpritHarprit Posts: 539
    edited 2010-06-25 20:51
    I've been working with the Probotics gang.
    Good group of guys.
    H
  • evanhevanh Posts: 15,848
    edited 2010-06-26 12:21
    The control isn't that hard to do. There is some getting your head around it all but there is far tougher coding being dealt with in the Prop forum than coding up a servo.

    As for results, yes, you'll wip the *** off a stepper any day. But, as has been said, mechanical rigidity is number one for performance.

    What you do is virtualise the stepping function and feed that to your internal servo routine. Have one Cog just for the servo even. So, no external stepping would occur. Instead, you are controlling the motor current with a DAC, amplifier/drive operates in current mode, and monitoring the position of the encoder making sure it is staying where the desired position says it should be.

    Holding the actual position steady wrt to the target position, even when it is a moving target, is the function of the PID code. Once that is stable then you are free to create elaborate motion profiles that can give rather impressive accuracy at high speed.

    A nice side effect of being in the servo loop like that is you can truly examine any inaccuracies of the motor motion and determine if an imperfection is coming from the control or the mechanics. And, of course, can make changes to improve the handling and even maybe compensate.

    Stripped timing belts, bound slip plates and jammed ball screws ... always best if the motor stalls before breaking the equipment! Heh, lots of fun. Highly recommended exercise.
  • evanhevanh Posts: 15,848
    edited 2010-06-26 12:56
    Looking at that encoder in your pictures - it looks pitifully low res, sorry, in the region of 40 to 44 lines? Pitch of the thread is about 6 mm? So that's 0.15 mm per line, with tight tuning that will audibly tick and visibly show on the work, just like a stepper, also need a few lines for noise floor which means you can expect 1 mm or more of slop in the servo. Yes, this is zeroed out by a part of the PID function but it is not eliminated under all conditions.

    Be wary of using low res encoders.
  • ManAtWorkManAtWork Posts: 2,175
    edited 2010-06-26 14:36
    Hello Harprit,

    I don't want to discourage you. Your project might be some great chance to learn something about control theory and what it takes to make a good CNC system. However, I doubt that it makes much sense from the technical point of view. I don't see a reason why you want to replace stepper motors of a hobby or small commercial cnc machine.

    A well designed stepper drive can reach speeds of 2000 to 3000 RPM. With a ball screw of 5mm pitch and 1/10 microstepping this means a resolution of 1/400mm or around 0.0001" and a top speed of at least 10m/min or almost 400 IPM. Servo motors can spin a little faster (4000 to 6000 RPM) but have less torque for the same motor size. So you need a gear which cancels out the speed advantage.

    IMHO,·you need a very precise and expensive mechanical system and low inertia brushless servos to see any benefit from a servo. Affordable "low end" servo drives typically have inferior stiffness and make more noise than a good stepper system with comparable price. Only if you need high power (>200W mechanical output per motor) steppers get expensive (and hot) so servos may be the better choice.

    BTW, I sell stepper and servo drives for a living. I have a propeller based stepper drive (http://forums.parallax.com/showthread.php?p=870152, look at the videos in post 4/1/2010) and I'm currently developping a brushless servo controller with a propeller inside. I use encoders with at least 2000 CPR.

    Cheers

    Post Edited (ManAtWork) : 6/26/2010 2:41:06 PM GMT
  • HarpritHarprit Posts: 539
    edited 2010-06-26 15:44
    Guys

    I personally don't learn much by buying tricky high tech goodies.
    I have to build it and discover what the problems are for myself.
    I already said I understood about the need for a precision machine. Its not about the machine at this time.
    For me this is about learning what the real world software problems are.
    Once I understand that, expensive hardware can follow.
    My experience has been that steppers are woefully inadequate at high speed and under high loads.
    No large industrial machines that I know of use steppers. None of the fast pen plotters used steppers.
    I'm going to leave it at that for now. I'm busy writing code and building my machine
    Report back to you guys later, pictures maybe, but its bye of now.

    Thanks for all the great feedback.
    Regards
    Harprit
  • fullspecengfullspeceng Posts: 76
    edited 2010-06-27 02:06
    Brushless DC motors really aren't that complicated.

    They normally have 3 coils.· Each coil can be forward/reverse or off.

    You need 3 H bridges to control the 3 motors.

    That's really all you need to know [noparse]:)[/noparse]

    Figure out the inductance of each coil and relate the current to a pwm frequency to the current you want to pop through it.

    You can read the position of the encoder/hall effect sensors·and figure out the position.

    Implement a PID loop to control the velocity.

    You probably want an DC and current sense resistors to figure out the voltage.

    It's interesting because a stepper motor is simply a 2 phase brushless DC motor.·

    Other people have used H bridges to put stepper motors into·brushless·DC·control (vector drive):
    http://www.quicksilvercontrols.com/SP/WP/QCI-WP003_ServoControlOfMicrostepMotor.pdf

    Look at the picture and it's very simple: two LMD18200 H bridges and a MCU (well they throw a dsp on there but it's not necessary).

    Here is a 100% complete reference design:
    http://www.luminarymicro.com/products/rdk_bldc.html

    It's very easy to change it over to step/direction controller.

    I have it and it works great to 60,000 rpm.

    You can just read the code and translate it to propeller speak [noparse]:)[/noparse]

    Board layout is already done for you along with the complete BOM.
    ·
  • LeonLeon Posts: 7,620
    edited 2010-06-27 03:40
    Microchip has a lot of useful info on motor control, as well, with hardware and software details:

    www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2125&param=en026178

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • James NewmanJames Newman Posts: 133
    edited 2010-06-27 06:04
    Or is a stepper motor just a really high pole count ac motor? [noparse];)[/noparse]
  • HarpritHarprit Posts: 539
    edited 2010-06-27 12:33
    @ evanh

    My home made encoder has 42 slots in it, it can be read to 4 times that many counts. I have sold these
    all over the world. They are quite inexpensive and therefore popular. See encodergeek.com
    The purpose of these encoder motor combinations is to actually allow one to see the encoder move a
    single count and come back to where it was to make sure that the commands are being executed to one's
    satisfaction. You can actually see the motor oscillate if you over control etc etc.

    Once the problems have been all sorted out, it will be time for higher counts and smooth tight moves.
    Thank you for your caveats.

    Harprit

    Post Edited (Harprit) : 6/27/2010 6:56:22 PM GMT
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2010-06-27 18:04
    I'm surprised by the negativity towards this project, seems totally doable you just need some decent power electronics and PID.

    Good luck.

    Graham
  • HarpritHarprit Posts: 539
    edited 2010-06-27 18:45
    Graham:

    Considering that I already have it working pretty well, I don't understand it either.
    I will post the results of my experiments after all the bugs are worked out and
    I have a table to prove that the software and hardware together. I need control from a PC
    too and I have not started on that yet so there is still quite a lot of work to be done.

    I'll need some pics and some movies. It'll be a while.
    Stay tuned.
    Thanks for your thoughtful comments.

    Harprit.
  • Hi Harprit
    I realize this in an old thread I know I'll probably go under fire for trying to revive it, but I've been trying to get my head around this and I'm sure I can learn from your experience.
    The more I research the more questions I have :(
    I have good quality medical dc motors with gear box and quad encoder and would like these to be a direct replacement for a stepper motor.
    Basically I'd like to give it step and direction control signals, obviously the DC motor has to respond and settle in a very short time in order to not miss steps. or if a step is missed, do i just increment a position counter in my controller and the motor will catch up when it can?. I calculated a 'step' is only 6 pulses on the encoder so i doubt the motor would ever move at full speed. Is this the correct approach?
    My other question is about PID control. the 'I' term is confusing me, seems to me like the 'I' would be useful when there's a higher load on my motor, say I'm only a count out so normally my pwm_min would be enough to get it back into location, but with the load at the PWM i'm not moving at all, in this case 'I' would accumulate and contribute to a higher PWM until I'm back on track.... but once I'm on track, my 'I' term would continue to contribute to my output, which I now want to be 0pwm... do I just 0 that value?? is this 'pure' PID ? I'm confused cause I can see that I need 'I' sometimes but not all the time...

    Anyway if you do find time to reply I'm looking forward to it.
    Cheers
Sign In or Register to comment.