RobotStudio event

IRC5 to control stepper motor for 3d printing

Options
Hello everybody,

i was new at this robotic arm world, especially at rapid programing. I want to use the robot to control stepper motor for 3d printing extruder, we had irc 5 controller, with rw 5.x on it, with dsqc652 as the i/o card. we had a concept with the rapid program to send Analog Output (E_Value)  Signal and will accept by another controller, maybe Arduino or PLC , but dsqc652 in data sheet didn't have Analog output, so how I'm supposed to control the stepper without Analog Output, or can i control it with Digital output or need to buy additional hardware?  any suggestion how to do it? maybe some rapid example and reference will be grateful. sorry for my newbie question, Thanks

Regards,
Irham

Best Answers

  • lemster68
    lemster68 ✭✭✭
    Answer ✓
    Options
    You don't actually have to have the analog output.  You can map a group output but tell the robot to treat it as if it were an analog signal.  I know that more than one time I have posted examples, a search should turn up those and more.
    Lee Justice
  • lemster68
    lemster68 ✭✭✭
    Answer ✓
    Options
    Look here:
    https://forums.robotstudio.com/discussion/comment/33768#Comment_33768

    You can manually edit the eio file or change it with robotstudio.  When using robotstudio you are effectively editing the eio, as well.
    Lee Justice

Answers

  • Irham
    Options
    So, the output still use dsqc 652 then will be received by plc/ Arduino? what was the ABB manual instruction explain about it? 

    Irham
  • Irham
    Irham
    edited August 2023
    Options
    So i was read more post about i/o group on abb forum ,  if i want send the 0-255 data value, so i use 8 bit grouping "0-7" ,so in dsqc652 i will set 8 digital output ,maybe D0_0 to D0_7 to represents that unit 0 to 7. then the group output (all 7 output pin) will be send to plc /arduino and will be read as binary value. Then will change the binary to decimal again in plc/arduino, so it would control the stepper with that value, am i at the right path or there more simple solution? pls correct me if wrong .  

    And to set that group i/o to robot controller, am i had to set it in EIO.cfg or can set via RobotStudio? Thanks

    Irham
  • Irham
    Irham
    edited August 2023
    Options
    Hello @lemster68

    I Was succeeded to use Group Output to send extruder Value to PLC/Arduino. But There is one problem, when i pressed the pause button the "GO" not change to 0. Then i use trap with system output "Mechanical Unit Not Moving" , i already can change the digital output value that attach with system output, but GO not changed too. GO supposed to be 0 when paused was pressed , and continue the last value before pause .

    PROC Main()
    ConfJ \On;
    ConfL \Off;
            IDelete tryProgram;
            CONNECT tryProgram WITH stopValue;
            ISignalDO do_Stop,1,tryProgram;
    ...
    ...
    ...
    ENDPROC

        TRAP stopValue
            IDelete tryProgram;
            CONNECT tryProgram WITH stopValue;
            ISignalDO do_Stop,1,tryProgram;
            SetGO Group_D,0;
        ENDTRAP 

    That was my trap routine, is there something wrong that my GO no change the value when paused ?

    Are that will be same trap when using  Emergency Stop /stop button so the GO reset to 0?

    regards,
    Irham 
  • lemster68
    Options
    There are going to be several ways you might deal with this.  First, set up an event routine instead of the trap.  The problem with the trap is that the program is no longer executing.  Use both the Stop and Quickstop events to set the group value to zero.
      Alternatively, you might consider using the system output for TCP reference speed.  You would have to play around with the scaling to get it to behave like you want.  You would then not even have to use the SetGO instructions in your program.  The values automatically rise and fall based on the tcp velocity.  AND, if it stops or e-stops, the value automatically goes to zero.
    Latly, you could add a relay to your output power for the IO board such that when there is an e-stop, the power is deenergized, causing the outputs to not be ON.
    Lee Justice
  • Irham
    Irham
    edited August 2023
    Options
    I Was used the system input for qstop and stop. How to use it in rapid program especially in Virtual Teach Pendant, are they act same with the real one? And in i/o simulation there was the system input , when i click the stop and qstop the robot was stop, but the GO not be  "0" . I Think there is something missing, because im not declare it on program or not in stop or qstop program routine below? how to program to trigger the routine when stop button was pressed? can you give me a little example

        PROC STOP() ;
            SetGo Group_D,0;
        ENDPROC
        PROC QSTOP()
            SetGo Group_D,0;
        ENDPROC  

    are the event routine look like that? i was copying from this post https://forums.robotstudio.com/discussion/2475/reset-output-values-to-zero
    sorry for my newbie question. Thanks for your help before. 

    the easiest one was the last solution you mentioned before, using a relay, or read digital output signal to enable and disable the stepper program.
  • lemster68
    Options
    The event routines look fine.  You just have to set the parameters to run those on the specified events.  They are under the controller topic.
    Lee Justice
  • Irham
    Options
    Hello,

    I was talk to ABB representative, they say we can use  dsqc 652 directly to control stepper/servo motor, but from this post https://forums.robotstudio.com/discussion/10994/synchronizing-stepper-motor-to-robot-movements they cant produce PWM, so am i really need PLC/ maybe industrial Arduino like my post before? my robot had devicenet option. maybe you can help what component we need to add. Thanks
  • lemster68
    Options
    What exactly does PWM pulsed output mean?  What data/signals does the stepper controller or Arduino need?
    Lee Justice
  • Irham
    Options
    I'm sorry i think im misunderstand about PWM at stepper motor (cmiiw), because the stepper driver can be drive with ON OFF of digital signal. for Arduino just need digital signal. and output it to stepper driver (pulse pin) if we didnt connect directly the stepper to dsqc652. i think maybe there is some possible rapid program if some function was called, the digital output from robot will on off with some delay between it continuously to drive the stepper driver , are you think it is possible? maybe you can help us with that rapid example? Thanks
  • lemster68
    Options
    "the digital output from robot will on off with some delay between it continuously to drive the stepper driver"

    I don't fully understand what you mean and what you want it to do.
    Lee Justice
  • Irham
    Options
    This is what my program looks like to control the stepper driver directly with dsqc652 and blinking the signal very fast in microsecond.

    proc main()
    .
    .
    MoveL ....
    Speed 12.000; // when program reach this point it stuck in while loop and didn't continue to next line 
    MoveL .....
    Speed 14.000;
    .
    .
    endproc
    .
        PROC Speed(num pulseDelay) // function to control the speed of stepper directly into the driver
            VAR bool direction:=TRUE;
             pulseDelay := pulseDelay * 10000;
              WHILE TRUE DO
                IF direction THEN
                  SetDO driverDIR, 1;
                  SetDO driverPUL, 1;
                  WaitTime pulseDelay / 1000000;
                  SetDO driverPUL, 0;
                  WaitTime pulseDelay / 1000000;
                ELSE
                  SetDO driverDIR, 0;
                  SetDO driverPUL, 0;
                  SetDO driverPUL, 0;
                ENDIF
              ENDWHILE
        ENDPROC
    .
    .
    how to make the speed function not trap in while loop and can execute in background then just change the value when the speed variable was change? 

    and i get this warning. how to prevent this happen or how to changes the logical upper and lower value?
    ''
    Description
    The value 0.57882261 for the System Output TCP Speed, signal ao_tcp, is outside its limits (logical min: 0 m/s, logical max: 0.54000002 m/s).
    Consequences
    The new value is not set; the previous value of the analogue signal is preserved.
    Causes
    The logical upper and/or lower limit for the signal may be defined wrongly.
    Actions
    Adjust the values of the logical upper and/or lower limit for the signal and restart the controller.
    ''

    or my program was already wrong? can you help me with correct solution, or another suggestion. thanks
  • lemster68
    Options
    WHILE TRUE DO is an infinite loop.  Substitute a condition which needs to be no longer TRUE or NOT TRUE for the TRUE in the WHILE DO loop.
    Example:
    WHILE TestDI(driverPUL) DO
    ENDWHILE

    WHILE NOT TestDI(driverPUL) DO
    ENDWHILE

    In some of your code you are doing things just for the sake of doing things.  You pass a numeric value for a wait time, multiply it, and then divide it.  The only thing needed is to pass the desired value in and then use it.
    You may want to use the optional argument for a delay with your SetDO instruction.  I am not sure if that is what you need but I am telling you so you know it is available.  Also, read up on the instruction, PulseDO.  It may also be of use to you.
    The error with your TCP speed is because the value is higher than allowed.  You need to adjust your scaling for that signal.
    Lee Justice