Results 1 to 9 of 9

Thread: info request for controlling a PWM Channel through multi points

  1. #1
    Join Date
    Oct 2012
    Posts
    9

    Default info request for controlling a PWM Channel through multi points

    Hi there,
    I intend to control a PWM hydropump in 3 way using a single PWM channel of CR0020 PLC :
    1-Control manually using a joystick
    2-Closed loop control with the hydromotor(which is supplied through the PWM pump) shaft RPM feedback (adjust the shaft RPM to a given RPM value)
    3- Closed loop control with the output pressure feedback (adjust the pressure to a given pressure value).

    the question which arises is that, how must I assign the PWM channel to the aforementioned paths?.
    For example when I initiated the channel for joystick operation how can i disconnect it from the joystick functions (OCC control and JOYSTICK1) and reassign it to a PWM1000 block which gets its input from a PID1 block?
    and will be there any conflict doing so or not?
    thanks very much.

  2. #2
    Join Date
    Aug 2009
    Location
    ifm Exton, PA
    Posts
    196

    Default

    First, I would recommend using the Codesys PID block located in the 3S utility library. This block has better performance.

    The PWM1000 block would then be assigned to the output channel that corresponds to the pin it is wired to. When looking at the datasheet for the controller the PWM channels start at 0 and increment.

  3. #3
    Join Date
    Oct 2012
    Posts
    9

    Default

    thanks for your response
    the problem that I have is that I must control single PWM channel in 3mode corresponding to the operator choice
    1-through a joystick function manually
    2-a closed loop for speed control of hydro motor (speed control)
    3-closed loop for pressure control(pressure control)
    so we have one OCC_Control that controls the PWM channel current directly and 2 PID control blocks which send values to a PWM1000 block.
    my problem is that I need to enable one of the mentioned paths and disable the two others.
    please tell me how can i ,for example disable the joystick and speed control paths and enable the pressure control mode when needed .(i wonder if there will be a conflict among function blocks that have been initiated to control the same PWM chanel?).
    best regards.

  4. #4
    Join Date
    Aug 2009
    Location
    ifm Exton, PA
    Posts
    196

    Default

    It can be tricky if you want to use a PWM block and OCC on the same channel. The selected block initializes the output at a hardware level so only one block can have control of the channel. I would recommend running all modes in either current control or PWM.

    As far selecting the mode there are many ways this can be achieved. Use some form of selection statement to determine which input device is used to control the output.

    What are you using to select the control mode?

  5. #5
    Join Date
    Oct 2012
    Posts
    9

    Default

    so do you think that i must neglect the JOYSTICK and OCC blocks and recondition the input signal of the joystick input myself and supply it beside the outputs of the PID blocks through a multiplexer to the PWM1000 block?
    or i can do the job by reinitiating the PWM channel for the desired mode when it is requested by the operator.

    as answer for your question ,this is for an excavator machine that its drill can be controlled by the user through a joystick or it can be operated in constant desired pressure or constant desired speed and the mode will be selected using a rocker switch or op panel
    thanks for your attention.

  6. #6
    Join Date
    Aug 2009
    Location
    ifm Exton, PA
    Posts
    196

    Default

    I this can be done with a single OCC block for each coil. You would just change the input values feeding the block based on the requested control mode. Scale all your input values to the current control range.

  7. #7
    Join Date
    Oct 2012
    Posts
    9

    Default

    Dear jeremy,
    Can i feed the occ block from a PID block by just scaling the output of PID block(0~65535) to the current range of the coil(0~85mA)?
    And will not be there any conflict between the OCC block and PID block (as we are adding an extra element(OCC block) in the control loop of PID).
    Thank you for considering my request.

  8. #8
    Join Date
    Aug 2009
    Location
    ifm Exton, PA
    Posts
    196

    Default

    Actually, if you are using the PID block included in the Codesys util library you can set the Y_MIN and Y_MAX to the range of the valve directly and no scaling is needed. (This is the PID block you should be using. Not the ones included in the controller library).

    See the help files included in codesys.
    (CoDeSys Libraries>Util.lib>Controllers>PID).

  9. #9
    Join Date
    Oct 2012
    Posts
    9

    Default

    Dear jeremy
    your guidances helped me much.
    thank you for considering my requests.

Posting Permissions

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