Controlling vacuum pump with duet - Gcode sample



  • Hi to all.
    We are testing one big rotary based delta robot. Unfortunately duet is missing FW for rotary based designs but i hope that this will be solved soon. I dont know if this is an "issue" in firmware or just my lack of knowlage in g-code programming but am having some problem when i try to activate the pump. In other words, pump is activated but in some random order and not as it should be in this example.

    Example:
    G28
    G0 Z50
    M42 P60 S255
    G0 Z-50
    M42 P60 S0

    Is this correct approach to move head down, start the pump, move the head up, shutdown the pump ?

    Arnix


  • administrators

    Yes, that's the correct approach. Unless you are using very old firmware, the M42 commands should be executed in sync with the G0 commands. Your pump probably needs some time to start up and stop, so you may need a G4 command to insert a delay between the M42 command and the following G0 command.



  • Hi DC and than you for reply !

    PUMP --> when i run this:
    G28
    G00 Z25
    M42 P60 S255
    G4
    G00 Z-25

    Pump starts almost immediately but when i add M42 P60 S0 after G0 Z-25 pump wont start at all (or it starts / stops very fast ). I test it with and without G4 command. Btw. robot head is moved up and down correctly, each time.
    Btw.2 --> if necessary, N-FET that am using is IRLR2905Z 55V / 42A, 110W.


    I have read your footer several times 🙂 and i really dont wont to disturb you in your vacation time, but can we hear us per PM. Of course, when you find time.

    Thank you in advance for your support !

    Arnix


  • administrators

    Which firmware version are you running? Also:

    • The G4 command takes a parameter to say how long you want to delay for. See the GCode wiki page for details.
    • If you don't have movement working yet then your G1 commands may be failing immediately with an error message; in which case they will execute very quickly, giving no time for the pump to start.


  • FW:
    FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 1.21 ELECTRONICS: Duet Ethernet 1.02 or later FIRMWARE_DATE: 2018-03-21

    G4 command:

    • this worked like a charm !

    When i run this pump is activated and shut down:
    G28
    G0 Z30
    G4 P300
    M42 P60 S255
    G0 Z-15
    G4 P200
    M42 P60 S0
    Result ( turn on the sound ) : http://tinypic.com/player.php?v=2434wpk>&s=9

    I noticed that the robot is shaking more then before, can this be also corrected in software ?
    One strange thing ( for me at least ) is that when i run script several times in row ( like in video ), position of the robot isnt always the same ( hight and movement on X , Y direction ). I was thinking that after homing position position of the robot will be reseted on start position ? Btw. my knowledge of G-Code is equal to zero, so maybe am missing something.

    If you don't have movement working yet then your G1 commands...
    *** I am not sure what you mean under movement but if this has to do with rotary delta design, then i must inform you that till now we didnt write any firmware for this part.
    This is main reason why i want to talk to you ( it considers this and future projects).

    Regards !
    Arnix


  • administrators

    Perhaps you have the speed or acceleration set too high so that your motors are missing steps?

    I don't run Flash player for security reasons, so I can't view your video.



  • Flash -- > OK i understand.
    I would upload it here but it looks like i can not upload movies so i put it on
    https://uploadfiles.io/oxnp1. It's free and secure site ( just click on slow download ).

    Btw. how can i loop this gcode commands so that the robot can continuously move up / down.
    Just for test purposes...

    I made some additional tests meanwhile, but it look i have some problems in setup.
    Just one question before i explain in detail...

    As you know, am using linear delta FW at the moment but i have rotary delta design.
    How does your FW "understands " if i send linear or rotary data ? E.g.

    • if i send x50 ( as linear delta) this would be equal to X38 in rotary ?

    In other words if i enter X38 robot should move 5 cm on X position, is this correct ?
    Am asking this because if i run this command:
    G28 X0 Y0
    G1 X38

    Robot is moving up / down and in multiple directions at the same time 🙂
    I can not move it lineary from some point X to some other point, on the same axes.

    Regards !
    Arnix



  • UPDATE to last post.
    I spend whole day testing your suggestion ( reducing acceleration ) and you ware wright ! Now i noticed few problems but the speed is main one.

    updated video of robot moving on X axe :
    https://ufile.io/27dhv

    This is the code that am using:
    G28
    G00 X35
    G00 Z-5 ;HIGH CORRECTION
    G4 P100
    G00 Z0
    ;G4 P50
    G00 X0
    ;G4 P50

    G00 X-35
    G00 Z-5 ;HIGH CORRECTION
    G4 P100
    G00 Z0
    ;G4 P50
    G00 X0
    ;G4 P50

    Problems:
    --> i have tested bunch of options and it looks like that this is the maximum speed that i can get before robot starts to "loose himself".
    --> i hope that this can be tweaked somehow because if this can not go faster than i must change the motors and add external drivers
    --> i noticed that robot starts to loose himself when head is near or over maximum radius and sometimes it looks that it has not enough power.
    --> speaking of that, could it be that the speed of the robot is reduced just because of lacking some stronger external power supply ?
    --> or maybe this could be because am using rotary delta and the firmware is for linear setup ?

    Btw. weight of arms and head is 100 grams, so this can not be a problem regarding speed....

    Arnix


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.