584,849 active members*
3,985 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Dmm Technology > analog control in position mode in dyn4
Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2016
    Posts
    6

    Question analog control in position mode in dyn4

    Hi All,

    I have a question regarding the analog control in position mode in dyn4. In position mode, the analog input voltage between AIN+ and AIN- on JP4 of dyn4 can control the rotation angle of motor. Given specific gear ratio, 10 V voltage between AIN+ and AIN- will rotate the motor axis for certain degrees, i.e., n turns. Smaller voltage will rotate proportionally less. This seems that the rotation of the motor axis can never go beyond n turns, if the control voltage is limited to up to 10 V. However, the travel of axis connected to motor may require the motor to move more than n turns to reach the destination. In other words, is it possible to let the motor run at constant speed using analog control in position mode? I can understand that this can be achieved using dir/pul, A/B, or CW/CW control, since these will rotate the motor continuously if pulses are sent to the drive continuously.

    I believe I have serious misunderstanding here. I appreciate any helpful comments to help me to understand. Thanks!

  2. #2
    Join Date
    Sep 2008
    Posts
    229

    Re: analog control in position mode in dyn4

    Typically you would use a PID controller to control motor position. The drive would be set to velocity mode, and the PID controller sends a velocity command to the drive proportional to the error from the setpoint (and zero velocity command when at the setpoint).
    There is actually a stack of PID controllers on top of each other in a typical motor drive.
    A controller varies the excitation duty cycle of the motor to achieve the commanded current.
    a second controller varies the commanded current to achive the required torque
    a controller varies the commanded torque to achieve the set velocity
    another controls the velocity to put the system in the required position.
    and the top level controller controls positions to make parts.

    Some of these layers might be missing from any particular system, for example my milling machine has a PID controller that uses position error to send motor current commands directly, and it works fine, though it would probably work better if I inserted a second PID controller in the middle, ie a velocity command - current output PID.

    PID works best when there is a single time-order difference between the command/feedback and the output. So, velocity output to control position, acceleration (torque) output to control velocity and so-on.

    If you use the DYN4 drive in absolute position mode then all the control loops are inside the drive. The problem you would find in this mode is that you only have the same position accuracy as the accuracy of the analogue to digital convertors. if you have a 12-bit analogue output then you can only really ask for 4096 different positions of the motor. (and there will be dither and noise making that closer to 1024 positions in practice).

    If you use velocity mode and high-resolution encoders you can count multiple encoder rotations in the digital realm and achieve far better resolution.

    To make a concrete example: 1000mm length of 5mm leadscrew with a 1024 count encoder on the motor.
    Absolute position gives you a position resolution of about 0.5mm. Velocity mode drive and PID position loop based on encoder feedback gives you a position resolution of about 0.02mm. (and if you use a high-count encoder, it gets a lot better)

  3. #3
    Join Date
    Mar 2016
    Posts
    6

    Re: analog control in position mode in dyn4

    Thank you Andy for such a nice tutorial oriented reply.

    Now I think I understand the correct way to control the motor. The velocity PID control is done inside the motor drive which is in position mode, while the position PID control is done by another controller such as linuxcnc + some hardware. This will make the wiring quite simple.

    I am a little confused about the math for the example you provided. I suppose the position resolution is not related to the length of the leadscrew, but to the pitch, e.g., 5 mm you mentioned in the example. Suppose the leadscrew is ideal and there is no backlash. For 1024 count encoder on the motor, the PID position loop driven by velocity mode would offer a position accuracy of 5/1024 ~ 0.005 mm. If the AD converter gives 12-bit analog control output (in the range of 0 - 10 V), and 10 V is corresponding to exactly 360 degree rotation, I would expect similar position resolution for analog control in position mode. For DYN4 with 16 bit encoder on the motor, the PID position loop driven by velocity mode would offer a position accuracy of 5/16384 ~ 0.0003 mm. Please correct me on the math if I made any mistake. Thanks!

  4. #4
    Join Date
    Jan 2005
    Posts
    15362

    Re: analog control in position mode in dyn4

    Quote Originally Posted by jiuning View Post
    Thank you Andy for such a nice tutorial oriented reply.

    Now I think I understand the correct way to control the motor. The velocity PID control is done inside the motor drive which is in position mode, while the position PID control is done by another controller such as linuxcnc + some hardware. This will make the wiring quite simple.

    I am a little confused about the math for the example you provided. I suppose the position resolution is not related to the length of the leadscrew, but to the pitch, e.g., 5 mm you mentioned in the example. Suppose the leadscrew is ideal and there is no backlash. For 1024 count encoder on the motor, the PID position loop driven by velocity mode would offer a position accuracy of 5/1024 ~ 0.005 mm. If the AD converter gives 12-bit analog control output (in the range of 0 - 10 V), and 10 V is corresponding to exactly 360 degree rotation, I would expect similar position resolution for analog control in position mode. For DYN4 with 16 bit encoder on the motor, the PID position loop driven by velocity mode would offer a position accuracy of 5/16384 ~ 0.0003 mm. Please correct me on the math if I made any mistake. Thanks!
    The PID loop is either controlled in the Drive, or with the Control, if you try and control the PID loop with the Control and with the Drive this is not an easy task, the two will fight each other, to control the PID loop either way to control the PID loop works just as well, there is not one way that is better than the other, most high end systems control the PID loop with the Control, they usually have servo Drives without the the PID loop control feature, or they have to dumb down, the Servo Drive to make it work, here is a good description of how a servo system works, this is basic, but all that is needed to understand how they work

    Something to note the Dmm Drives have adaptive control so tuning is not so critical, this is a feature very few servo system have

    A correction with your encoder resolution 16 Bit= 65,535 resolution not 16,384 which is for a 14 Bit Encoder


    A reference input (typically called a velocity input) is sent to the servo amplifier, which controls the speed of the servomotor. Directly mounted to the machine (or to the servomotor) is a feedback device (either an encoder or resolver). This device changes mechanical motion into electrical signals and is used as a feedback loop. This feedback loop is then sent to the error detector, which compares the actual operation with that of the reference input. If there is an error, that error is fed directly to the amplifier, which makes the necessary corrections.

    In many servo systems, both velocity and position are monitored. (Note: In servo systems, the word "velocity" is often used to describe speed control. Velocity indicates a rate of change of position, with respect to time. It also indicates a rate of motion in a particular direction, with respect to time.) The velocity loop control may take its command from the velocity loop feedback device-a resolver or tachometer mounted directly to the motor. The position loop control may take its command from the position feedback device-an encoder. Depending on the system, both devices may be mounted to the actual machine or controlled device.

    The stability of the entire system is dependent upon the tuning of the components in the system and how well those components are matched. Tuning the system involves working with a PID (proportional integral derivative) control. This type of closed loop control is standard on all high accuracy systems. The main factors in this closed loop system are the gain, integration time, and derivative time of the loop.

    The amplifier gain must be set satisfactorily. The gain sets how responsive the amplifier will be during changes in error signal. A high gain will cause the motor to overshoot the intended speed target. Too low of a gain may mean that the target is reached late in the cycle, or possibly not at all.

    The integration time allows the amplifier to respond to changes in the error signal, mostly at zero speed. The zero speed error signal is multiplied by the gain setting, and results in increased motor responsiveness (stiffness) and accuracy.

    The derivative function is the most difficult to accurately adjust. This controls the dampening or oscillations of the system. This function basically dictates the amount of correction given per unit of error. The error signal can be corrected immediately (in milliseconds), or throughout a longer period of time (seconds).

    If there is a difficult part to the tuning task, it would be during the derivative setup. The gain and integration time is interactive. One setting affects the other. Proper setup of the derivative function involves multiplying the position error by the position error rate (how much correction should take place per unit of time). If the system components are not matched, oscillations, overshoot, or undershoot of velocity can result, which means unstable operation.

    Servomotors are special electromechanical devices that operate in precise degrees of rotation. This type of motor quickly responds to positive or negative signals from a servo amplifier. Fast and accurate speed, torque, and direction control are the mark of a servomotor's characteristics. Very high starting torque must be obtained from the servomotor. The standard AC induction motor's torque is measured in pound-feet. By contrast, the servomotor's torque is measured in inch-pounds.
    Mactec54

  5. #5
    Join Date
    Sep 2008
    Posts
    229

    Re: analog control in position mode in dyn4

    Quote Originally Posted by jiuning View Post
    If the AD converter gives 12-bit analog control output (in the range of 0 - 10 V), and 10 V is corresponding to exactly 360 degree rotation, I would expect similar position resolution for analog control in position mode.
    Yes, but if you set it up so that 10V == 360 degrees you can only turn the motor one revolution, so can only move 5mm total. If you change the gearing (physical or electronic) so that you can travel the full length of the 1000mm screw then that is 200 full revolutions, so your resolution-per-bit is 200x worse.

    I will point out that analogue-input position servo mode is a very uncommon way to drive a motor. It would allow you to use a potentiometer to rotate a remote actuator, but that seems an expensive way to have a cheap command source.

  6. #6
    Join Date
    Jan 2005
    Posts
    15362

    Re: analog control in position mode in dyn4

    Quote Originally Posted by andypugh View Post
    Yes, but if you set it up so that 10V == 360 degrees you can only turn the motor one revolution, so can only move 5mm total. If you change the gearing (physical or electronic) so that you can travel the full length of the 1000mm screw then that is 200 full revolutions, so your resolution-per-bit is 200x worse.

    I will point out that analogue-input position servo mode is a very uncommon way to drive a motor. It would allow you to use a potentiometer to rotate a remote actuator, but that seems an expensive way to have a cheap command source.
    It does not work like that,

    Also analog systems have been in use for CNC controls, since the beginning of time, for machine servo motor controls, and are still used in most machines today

    If 10v was applied to the servo drive it would run at max speed, until it was told to stop, which would be Zero Volts at stop,10v does not mean or equal 360 deg,and would not be used like this in any analog/servo system

    The traditional analog drive, the desired motor velocity is represented by an analog input voltage usually in the range +/-10 volts. Full forward velocity is represented by +10v and full reverse by -10v. Zero volts represents the stationary condition and intermediate voltages represent speeds in proportion to the voltage.
    Mactec54

  7. #7
    Join Date
    Sep 2008
    Posts
    229

    Re: analog control in position mode in dyn4

    Quote Originally Posted by mactec54 View Post
    It does not work like that
    I did say that it would be unusual, but it is a control mode available with the Dyn4 and seemed to be what the OP was proposing to use.
    If 10v was applied to the servo drive it would run at max speed, until it was told to stop, which would be Zero Volts
    In analogue velocity mode, yes. But the Dyn4 drive has analogue modes for torque, velocity _and_ position.

    For a CNC machine analogue velocity is probably the one to use. I think this has advantages over digital (step/dir) position mode in that you can take advantage of feedforward in the control PC.

  8. #8
    Join Date
    Jan 2005
    Posts
    15362

    Re: analog control in position mode in dyn4

    Quote Originally Posted by andypugh View Post
    I did say that it would be unusual, but it is a control mode available with the Dyn4 and seemed to be what the OP was proposing to use.

    In analogue velocity mode, yes. But the Dyn4 drive has analogue modes for torque, velocity _and_ position.
    They still operate the same way, it makes no difference what modes they are working in,

    The DYN4 servo drive accepts industry standard pulse/analog commands. Pulse format include PULSE+DIR, CW+CCW, A+B Phase Quadrature. Servo control modes including Position, Speed and Torque. Standard line drive encoder output provide position feedback to host controller.
    Mactec54

  9. #9
    Join Date
    Jan 2005
    Posts
    15362

    Re: analog control in position mode in dyn4

    I see what you are saying now,about what he was asking, that would be using a PWM control with just using 0-10v,

    It is there in there manual, I had just not taken any notice of it, this could be used for spindle orientation, rigid tapping etc

    Analog Input in Position Servo Mode In position servo mode, the controller can use 0 ~ 10VDC analog input to turn the motor. 0 ~ 10VDC analog input commands motor from 0 ~ 90*4,096/Gear number (degrees). Ex. if Gear_Num=8,192, a 5.5V input will move the motor 24.75degrees.
    Mactec54

  10. #10
    Join Date
    Mar 2016
    Posts
    6

    Re: analog control in position mode in dyn4

    That is where my question comes when I read that part.

  11. #11
    Join Date
    Mar 2016
    Posts
    6

    Re: analog control in position mode in dyn4

    Quote Originally Posted by andypugh View Post
    Yes, but if you set it up so that 10V == 360 degrees you can only turn the motor one revolution, so can only move 5mm total. If you change the gearing (physical or electronic) so that you can travel the full length of the 1000mm screw then that is 200 full revolutions, so your resolution-per-bit is 200x worse.

    I will point out that analogue-input position servo mode is a very uncommon way to drive a motor. It would allow you to use a potentiometer to rotate a remote actuator, but that seems an expensive way to have a cheap command source.
    Now I understand the numbers you got in the example. Everything makes sense to me now. Thanks!

  12. #12
    Join Date
    Jan 2005
    Posts
    15362

    Re: analog control in position mode in dyn4

    Quote Originally Posted by jiuning View Post
    That is where my question comes when I read that part.
    The main uses for this function/mode of operation, is mostly for a single programed command, for Robot positioning, it has many other uses as well, it's just another mode of operation there drives can do
    Mactec54

Similar Threads

  1. What is - Torque Mode? Position Mode? Speed/Velocity Mode?
    By sunmix in forum Servo Motors / Drives
    Replies: 48
    Last Post: 01-20-2024, 10:34 AM
  2. Dyn4 analog speed command null adjust?
    By JPMach in forum Dmm Technology
    Replies: 5
    Last Post: 04-02-2017, 12:48 AM
  3. Problem with Analog Input mode
    By speedydumpster in forum CNC Machine Related Electronics
    Replies: 6
    Last Post: 05-14-2012, 07:03 PM
  4. Fagor 8055TC tool change position in Cycle mode?
    By sealive in forum Fagor Automation
    Replies: 2
    Last Post: 08-22-2010, 03:05 PM
  5. servo drive position control by analog 0-10Vdc or 4-20Ma
    By rai in forum Servo Motors / Drives
    Replies: 3
    Last Post: 01-09-2010, 05:11 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •