Author Topic: PWM and STEPMODE  (Read 14720 times)

acxysty

  • Newbie
  • Posts: 35
  • I'm a llama!
    • View Profile
PWM and STEPMODE
« on: February 02, 2022, 07:27:08 AM »
Dear all
We are trying to use both PWM and STEPMODE mode in the same program in order to drive a motor in one way or in another, the motor being wired on a single output.
We achieve easily both mode but we are facing some issues when changing from one mode to the other mode.
Shifting STEPMODE  -> PWM mode works fine
Shifting PWM mode ->  STEPMODE does not work.

At the end of the PWM mode we use instruction SETPMW ch,0,0 on order to stop the motor, followed by  new STEPSEED + SETPMOVE instrictions but the output does deliver any signal...

It looks like the SETPWM mode cannot be overwrite ?
Any suggestions
Thank you in advance
Regards
Thierry

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: PWM and STEPMODE
« Reply #1 on: February 02, 2022, 10:43:19 AM »

SETPWM  ch, duty, freq

If you set the duty to < 0 it will reset the PWM channel

so please try:  SETPWM 1, -1, 0

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

acxysty

  • Newbie
  • Posts: 35
  • I'm a llama!
    • View Profile
Re: PWM and STEPMODE
« Reply #2 on: February 03, 2022, 10:46:20 PM »
Thank you for your feedback.
We will try that and report.
Regards
Thierry

acxysty

  • Newbie
  • Posts: 35
  • I'm a llama!
    • View Profile
Re: PWM and STEPMODE
« Reply #3 on: February 07, 2022, 07:05:08 AM »
It works fine now using SETPWM 1,-1,0.
Thank you
Regards
Thierry