. .
Page 11 of 22 FirstFirst ... 91011121321 ... LastLast

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    So I've just scoped the DDCS. An axis setup as per my machine, 1610 screw, 16x ustepping -> 320 steps/mm, max speed 10000mm/min.

    As expected step frequency is ~53kHz, half period of 9.375us. Nyquist/Shannon tell us that this needs to be sampled at a minimum of 2f, i.e. 106kHz for perfect reconstruction. Puts an upper bound on my mirror code latency of ~9us, so to be safe say 5us. This is 80 cpu cycles, will it fit?? Should do, got to wire it in and test.

    DDCS defaults set dir 7000ns (7us) ahead of step therefore code running at 5us will always see this. EM806 only requires 2.5us but configuring DDCS to deliver this will risk breaking the contract woth EM806.

  2. The Following User Says Thank You to devmonkey For This Useful Post:


  3. #2
    Interrupt on change of state? Your time-sensitive processing is in the discrete control and not the I2C if you're using the TWI registers.

  4. #3
    Quote Originally Posted by Doddy View Post
    Interrupt on change of state? Your time-sensitive processing is in the discrete control and not the I2C if you're using the TWI registers.
    Yes it is possible you can register for toggle interrupts on any of the IO pins, trouble is my code is written in arduino/cpp at the moment, this means there is a stack to park so there is some overhead from servicing the interrupt. If the current polling approach takes too long will have a look.

  5. #4
    So here is a baseline, the basic axis mirroring with auto squaring, but without I2C. Lag is 600ns after a lot of messing about I just stuck the logic in a lookup table and deleted all my code ;-) Yellow trace is step output from DDCS running at 10000mm/min, blue trace is the arduino step output, lag is shown in 'dt' bottom right.

    Click image for larger version. 

Name:	hantek10_2.png 
Views:	144 
Size:	24.3 KB 
ID:	28337

  6. #5
    You're not going to get better than that!

  7. #6
    Quote Originally Posted by devmonkey View Post
    after a lot of messing about I just stuck the logic in a lookup table and deleted all my code ;-)
    Hahaha love it. Sometimes 'ugly' solutions are just the best.

  8. #7
    Call me stupid, but what exactly do you adjust to make the gantry square once the whole sequence has finished? What is the purpose of step 4? Do you have separate cotrol of the two X distances in 6?
    An optimist says the glass is half full, a pessimist says the glass is half empty, an engineer says you're using the wrong sized glass.

  9. #8
    Quote Originally Posted by Kitwn View Post
    Call me stupid, but what exactly do you adjust to make the gantry square once the whole sequence has finished? What is the purpose of step 4? Do you have separate cotrol of the two X distances in 6?
    Hi Kit,

    Quick answer, once the sequence is finished the gantry is square.

    So the normal single motor home search (used by everything from gbrl on your 3d printer, mach3 and the DDCS) is:
    1. Drive axis until home switch activates (at which point you have likely gone past it)
    2. Retract axis very slowly until home switch releases (you are now at 'home').

    In a setup with two motors one driving each side of the gantry adjust the switches/inductive targets so that when each respective release point is reached the axis is square.

    Challenge now is to 'trick' the controller that is executing the single motor home search algo above into locating the point where both switches exactly release.

    This is what the logic I described does. Step 4 is required during retraction as when a motor's home switch releases that motor is at 'home', whilst the remaining motor isn't yet there so requires more steps. My board never generates steps, it only suppresses steps if required. So in this case DDCS still believes it needs further retraction so continues to generate retraction steps, however my board only passes these onto the motor that has not yet reached 'home'. When this motor does finally activate it's switch both motors are at 'home' and my board signals this to the DDCS.

    If your question was due to believing that because at step 2 both motors have activated their home switch and the DDCS has been signalled meant that the motors were at 'home' then this is not true. It wouldn't work as you may have overshot due to the momentum of the gantry and the angular momentum in the screw and it is highly unlikely the hysteresis of two switches is identical. This is why everyone does the very slow retraction until release which avoids both these problems.

    This whole process will re-square a machine that has gone out of square. The machine only goes out of square if a driver misses some steps due to noise, a motor stalls or if someone turned a ballscrew by hand when the machine was off.
    Last edited by devmonkey; 13-06-2020 at 03:31 PM.

  10. #9
    Quote Originally Posted by devmonkey View Post
    Challenge now is to 'trick' the controller that is executing the single motor home search algo above into locating the point where both switches exactly release.

    This is what the logic I described does. Step 4 is required during retraction as when a motor's home switch releases that motor is at 'home', whilst the remaining motor isn't yet there so requires more steps. My board never generates steps, it only suppresses steps if required.
    I do a similar thing with the Cslabs IP-M controller that doesn't home each axis individual. I just do it using a modified macro which basicly homes twice and controls the drive enable using an output connected to a relay...! . . Simplizzzs
    -use common sense, if you lack it, there is no software to help that.

    Email: [email protected]

    Web site: www.jazzcnc.co.uk

  11. #10
    Quote Originally Posted by Kitwn View Post
    Call me stupid, but what exactly do you adjust to make the gantry square once the whole sequence has finished? What is the purpose of step 4? Do you have separate cotrol of the two X distances in 6?
    Ok your Stupid. . . .But so am I because I'm not seeing it either.?

    To me it's just homing each axis separately, waiting until both inputs go high and backing off until both go low then moving both to a set distance.! It's not doing any individual axis correction and as the switches don't move it's not corrected anything.? Yes, you can square the gantry by offsetting switches using this method, which is how mach3 etc do it but so can any homing system really.!

    If you want a true squaring system then it needs to drive each motor separately and adjust to a set distance. For instance, the CSlabs squaring system gives you options to measure the offset between the switch triggers and gives you the option to apply a correction to a set distance or let the system do it automatically. In which case it drives both motors until the first switch goes high then backs both off until it goes low, then it drives the opposite motor until switch goes high measures the difference and moves that axis only the measured difference. It's strange to watch as it does a little dance and the gantry is then aligned to the first switch.
    If you want to apply an extra offset to twist either side then you can set a +/- distance for either side which it will apply after homing. It then backs both off a set distance if required.
    -use common sense, if you lack it, there is no software to help that.

    Email: [email protected]

    Web site: www.jazzcnc.co.uk

Page 11 of 22 FirstFirst ... 91011121321 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 6 users browsing this thread. (0 members and 6 guests)

Similar Threads

  1. BUILD LOG: 8x4 router build. Steel base & Aluminium gantry gantry
    By D-man in forum DIY Router Build Logs
    Replies: 57
    Last Post: 13-12-2019, 10:43 AM
  2. BUILD LOG: Design stage - All steel - 1200x750x110 - aluminium capable (hopefully)
    By oliv49 in forum DIY Router Build Logs
    Replies: 3
    Last Post: 08-06-2018, 01:18 PM
  3. welding steel base or just getting aluminium extrusion
    By reefy86 in forum Gantry/Router Machines & Building
    Replies: 200
    Last Post: 15-01-2018, 08:55 AM
  4. BUILD LOG: Steel Frame, Aluminium Hybrid Design Thread
    By f1sy in forum DIY Router Build Logs
    Replies: 0
    Last Post: 23-02-2016, 10:04 AM
  5. Steel vs Aluminium
    By gavztheouch in forum Metalwork Discussion
    Replies: 4
    Last Post: 26-05-2014, 10:11 PM

Bookmarks

Posting Permissions

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