Homing Strings

Home Forums DIY Sand Table Homing Strings

Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #635
    Matt G
    Keymaster

    I’ll explain my string, and how it works.

    You can look at this file to get an understanding of what is parsed. https://github.com/robdobsn/RBotFirmware/blob/master/PlatformIO/src/RobotMotion/MotionControl/MotionHoming.cpp

    My Homing String
    "FR10;A+10000N;B-10000;#;A+5000n;B-5000;#;B+10000N;#;B+5000n;#;A=h;B=h;$"

    FR10; sets the feed rate to 10. I think I just copied this from Rob. I think you can alter the homing speed with a different feed rate.

    A+10000N;B-10000; rotates the center arm clockwise for 10000 steps (9600 is one rotation) until the end stop is first triggered (N). My center arm is A – you need to home the center arm first – yours may be B depending on what stepper is hooked up to what pins. B is spinning in the opposite direction here just to keep the angle between the arms the same.

    A+5000n;B-5000; Rotate in the same direction until the sensor stops triggering (n). For me, this puts the lower center arm directly in line with the center line of the robot. At the end of this, the center arm should be rotated and stopped so the end of it (the elbow) is near the 2nd sensor

    B+10000N; Rotates the top arm at the elbow for one full rotation until it triggers (N) the 2nd sensor.

    B+5000n; Keeps rotating in the same direction until the sensor stops triggering (n). With sand – this puts me just about dead center.

    A=h;B=h; – set the home position

    Homing will be slightly different with sand than without due to the friction and bending of the arms. You should never have to have one arm rotate more than a full rotation, and you need to make sure your 2nd elbow sensor can be triggered once the first lower center arm is done with its homing – or the top arm will never be able to be homed since it can’t make it to the sensor. I played around with the little sensor arms quite a bit – so you may need to tweak them or distances to the sensor.

    #675
    geri
    Participant

    Hello Matt, I have a few questions about homing
    1. when you turn on the table does it start homing?
    2. is there a homing code or file?
    3. does it automatically start with a pattern after homing?
    4. If I switch off the table during a sample, does it continue to move after switching on or does it start with a new one?
    excuse the many questions 🙂 Thank you Geri

    #677
    Matt G
    Keymaster

    Hi Geri

    1. The table does not automatically home when you start it up. There is a section of the JSON config called “cmdsAtStart”, which is blank in my config. You can add “g28” to this value to home on startup. g28 is the gcode command for home.
    2. The homing string is also located inside the JSON config at the key “homingSeq”. The firmware code file that processes this string is at https://github.com/robdobsn/RBotFirmware/blob/master/PlatformIO/src/RobotMotion/MotionControl/MotionHoming.cpp if you can understand c++ and how it processes that string.
    3. No – you need to start a pattern after homing.
    4. Once you shut the table off – if you have nothing in “cmdsAtStart” in the JSON config, the table will do nothing when you turn it back on, so you will need to re-home and re-start the pattern. Once the stepper drivers lose power, there is no way for them to know what position they are at, so you can not restart the drawing process.

    #755
    HendrikV22
    Participant

    Hi guys, I’m really struggling with the homing function of the bot. So, what happens is the following:

    I start the unit by pressing the ‘home all’ button.

    The main arm (upper arm) starts to rotate until the optical limit switch at the bottom is made – the green light turns on and the arms stops rotating, therefore confirming it is in the ‘home’ position

    The second arm (lower arm) automatically then starts to rotate and when it makes the optical switch (the green light of the switch turns on) it keeps on rotating. Therefore missing the home position. I have also changed the switch with another switch and is still skipping the homing position when the light goes on….

    Here is the part that tickles my brain….

    When I start the homing process and use a piece of plastic arm to trigger the lower arm optical limit switch, all arms stops to rotate. This confirms that the electronics is picking up the lower arm optical switch and therefore something else is causing the problem.

    Is there someone that experienced the same problem or can guide me in rectifying this?

    #756
    HendrikV22
    Participant

    Hi all,

    so I want back to the drawing board….

    1. Deleted all files from my computer
    2. downloaded the latest version of the RBotFirmware from github
    3. reloaded software into the Visual Studio platform
    4. upload new RBotFirmware onto the CPU

    I’m still getting the same issue…. The first step of the homing function works great, the arm rotates and as soon as the optical light has made contact the second arms start to rotate. however, it keeps on kssing the homing position – even though the optical switch is activated (green light comes on).

    I tested the switcha again by activating the homing function and manually activating the second opticl switch with a piece of plastic – Both arms stops to rotate as if it recognises that it is at the home position – confirming that the switch is working….

    Is there someone that can assist me on the programming on where to find the function of the second limit switch? I do not have preally programming skills (apart from REALLY basic Arduino programming)?

    #757
    Matt G
    Keymaster

    If you look in the first post in this thread, there is a link to the actual firmware code that is processing the homing string.

    I’m struggling to figure out how you can get into a situation where manually tripping the optical endstop works, but the arm triggereing it doesn’t.

    Are you waiting until the 2nd arm starts homing before triggering the endstop manually when testing? You would need to make sure the homing is in the same state when the 2nd arm is rotating to properly test.

    Another tip is you could remove the “duplicate” movements in the first portion of the homing string to keep the arms aligned. For example in my example above:

    Changing
    A+10000N;B-10000;#;
    To
    A+10000N;#;
    and so on – just to be sure that A is mapped to the first arm like you expect, and you just don’t happen to be tripping A’s sensor with the B movement.

    You need to make sure that in your string the A commands are moving the bottom arm. It sounds like they are since you mentioned only the top arm moves in the 2nd portion of homing.

    Can you post your homing string here?

    #758
    HendrikV22
    Participant

    Hi @Matt G,

    Thank you for the prompt response. It is much appreciated. Ok, so let’s start from the top:

    1. I reviewed your comments and made the changes to the code as recommended to ensure that A is moving the bottom arm and B is moving the top arm. This has been tested and the motors is connected and working accordingly.

    2. I turned the power off from the unit and restarted everything (the “Have you tried to switch it on OFF and On again” sequence).

    3. On startup, everything seems to be booting up nicely. On the terminal screen I see I’m connected to the WIFI and through the browser I can access the Robot configurator (UI). I can see that the memory card is reading accordingly (32Gb card) and can upload/delete paterns onto the bot. Under the “RobotConfig” row I can see the corresponding code I uploaded as stipulated in the “DIY Kinetic Sand Table Art” as described by you.

    4. I have then set the arms to be at the “11:00” clock position to test whether both the Bottom and Upper arm can be homed automatically.

    5. After that, I pressed the “Home All” button.

    6. The Bottom arms starts to home and as soon as the optical limit switch is activated (the sensor located at the bottom of the bot) the bottom arm stops to move and the Upper arms starts to move.

    7. However, the Upper arms keeps on rotating through the optical sensor even when the sensor is activated (The light of the sensor comes on).

    8. I then thought the sensor is broken and replaced it with a new sensor. However, on activating the homing position again, the Upper arm once again ignored the sensor and keeps on rotating.

    9. I then thought it may be that the signal wire of the sensor is damaged and that the signal is not getting through to the processor. How I tested this was the following:
    * I positioned the arms again to the 11:00 position and activated the homing sequence.
    * Before the Bottom arm could activate the bottom sensor, I manually activcated the upper arm sensor with a piece of plastic – The result was that the Bottom arm stopped moving and the Upper arm did not start to move. According to my understanding is that this is correct. The reason being is that the only possible reason for the Upper sensor to be activated through the auto homing sequence, both the Upper and Bottom arms should be in the home position. Therefore, confirming that both the sensors are working and that the software is picking it up.

    What I do not understand is why the second sensor is ignored when the homing sequence is activated, the Bottom arm gets it auto home position but the Upper arms keeps on rotating….

    I made a video to show what is happening and stored it under the following dropbox link – If you could please have a look and see if something is wrong? I would appreciate it.

    https://www.dropbox.com/sh/jw6l9ahfqmbfo7v/AAAaefnqsJ0Ds3oQRAcNp9TIa?dl=0

    Otherwise, If you have another way for me sharing info to you which might help assist in finding the problem I would gladly do so.

    Kind Regards

    #759
    HendrikV22
    Participant

    Hi Matt,

    sorry I forgot to include the homing string, but as mentioned the homing string is the one that was posted on the forum as per your description. Also, the software that was loaded onto the bot was the version from Github.

    Kind Regards

    #760
    Matt G
    Keymaster

    So if you’re using the same homing string.. I don’t think that interrupting the upper arm sensor while the lower is homing is supposed to stop it. I’m not positive.. I’ll open my table when I have time tomorrow and check.

    Can you try swapping sensor pins? Wondering if the sensor signal pins are swapped.

    Also – I have never tried the home all button on cncUi.html. I always use the home command from sandUi.html – which I believe sends a g28 gcode command. So it’s possible the home all button is doing the same.

    #763
    Matt G
    Keymaster

    So I can confirm that triggering the “elbow” sensor during homing of the bottom arm should not stop homing:

    I have annotated this picture, that goes along with my robot configuration to show which connections go to which motor/sensor for motor A/B and sensor 0/1 alignment

    • This reply was modified 4 months, 4 weeks ago by Matt G.
    #765
    HendrikV22
    Participant

    Hi Matt,

    Thanks for the information. It is much appreciated.

    so I compared the setup according your setup and yes, it is the same which is comforting to know.

    I did find the root cuase for the problem but not sure how to remediate it.

    So, what causes arm B from ingnoring its corresponding sensor and keeps on rotating? IT IS ARM A OPTICAL SENSOR THAT IS STILL ACTIVATED!

    So, How I tested this was the following:

    1. I activated the homing position.
    2. Before Arm A could reach the home position, I manually activated its sensor. This causes Arm A to stop and arm B started to rotate (with the first optical sensor for Arm A not acivated anymore).
    3. I activated arm B optical senos manually and it stopped. Which was great to experience.

    4. Then I resetted the whole system and rotated the arms to the 11:00 position.
    5. I activated the homing sequence and waited until Arm A activated the optical switch. It did, arm A automatically stopped and Arm B automatically started to rotaed. HOWEVER, Arm A’s optical switch is still Activated (green light still on). while the optical switch is still activated, the second optical switch for Arm B is ignored….

    So, what I believe would be the solution is the rotate Arm A for x amount further once optical switch is activated before it is stopped (so that optical switch for arm A is deactivated) before proceding to the next homing sequence for Arm B.

    I have played with the A+5000n;B-5000; Settings but it seems that I’m doing something wrong… I’m not getting the additional split second rotation after the switch is activated.

    Will you be able to assist please?

    Kind Regards

    #766
    Matt G
    Keymaster

    Interesting that you found that out. I would start building the homing string up piece by piece. The A+5000n should be rotating an additional amount until the sensor is un-triggered.

    What type of sensor do you have? It is possible that the sensor’s signal is opposite of mine, so the first big “N” is always tripped, and then the small “n” in the A+5000n is actually being hit when the sensor triggers on.

    So what I would try is start here:

    “FR10;A+10000N#;A=h;B=h;$”

    Make sure that the bottom arm will stop as soon as the sensor is tripped in this scenario. Once verified, you can add on some more…

    “FR10;A+10000N;#;A+5000n;#;A=h;B=h;$”

    To verify that the lower arm the proceeds the additional steps until the sensor un-triggers.

    If the first step fails – then you know that big “N” is not happening when your sensor is triggered.

    To debug that further you can play around with the robot configuration for the endstop in the cncUi.html’s settings area.

    
    			"endStop0": {
    				"sensePin": "36",
    				"actLvl": 0,
    				"inputType": "INPUT_PULLUP"
    			}
    

    You can try changing the active level to see if your sensor’s “default” state is 0, instead of 1 like mine…

    So start out small with the initial steps and build up until you get a string that works for you.

    You could also try

    “FR10;A+10000n#;A=h;B=h;$”

    with a small “n” if the initial big “N” isn’t working in this initial test too.. Let me know how it progresses!

    #767
    HendrikV22
    Participant

    Hi Matt,

    Thank you for the great assistance. I must say, this forum is the first where prompt responses are experienced and help is given.

    The final end result was… Yes… It was the signals from the sensors that were inverted. So I had to change the N and n in the string. After changing it, arm A stopped after the optical switch was deactivated and arm B could home properly.

    I couldn’t find the exact optical sensors which you used, so ordered through banggood the optical switches. Also, for the rest of the people on the forum, I also ordered the Anet A8 plus printer through banggood for this project and all parts were printed with it. Quite happy with the quality compared to the price paid for it.

    Now that I know the bot is working 100% I’m ready to start building the table.

    Now I’m truly excited!

    Thank you again.

    Kind regards

    #768
    Matt G
    Keymaster

    Excellent news.

    I wish everything was standardized to make stuff like this easier to track down, but glad you were able to solve the problem!

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.