-
Notifications
You must be signed in to change notification settings - Fork 22
Endstops are not working #33
Comments
You can just try homing much slower to see if it works. On Thu, Oct 13, 2016 at 10:30 PM, Douglas Pearless <notifications@github.com
Courage et bonne humeur. |
Endstops have completely changed in Smoothie V1, and change here would diverge significantly from smoothie1... which may not be a bad thing. Smoothiev1 does not use interrupts as for some reason the endstops are not assigned to interrupt capable pins. Not sure about Smoothiev2. Ideally the endstops should be on interrupt pins, however debouncing interrupt pins is very hard. |
Yep, tonight's task is slower homing :-) On my Bambino210E I believe that the pins I am using are interrupt capable, pretty easy to move to other pins as required. I agree debouncing in interrupts can be tricky to get right! I cannot comment on the Smoothie2 hardware as I have not seen a circuit diagram :-) |
Wow that is a nice view of what is going on, I expect this sort of stuff On Fri, Oct 14, 2016 at 6:16 AM, Douglas Pearless notifications@github.com
Courage et bonne humeur. |
The tool will enable some empirical measurement of performance and when I have more of the Segger SystemView implemented, then we can really get quality trace data and see what . Then there is also extending this with Impulse from http://toem.de per this post [https://mcuoneclipse.com/2016/07/31/impulse-segger-systemview-in-eclipse/#more-18459] . We will then have a (hopefully) robust platform that we can get plenty of metric to improve and expand Smoothie2, and I can hopefully figure out why endstops are not being triggered! |
Update: Findings:
The RITIMER_IRQHandler works just fine with these added.
Below are some of the changes to change the code to reflect the new Stepper motor code. Is this is the correct way to now stop a stepper motor?
Thoughts? |
Pull request #34 did not solve my issue; this weekend I am focussing on solving this so I can test my Z-Probe (and others) port. |
This is to document the issue and to cover off its resolution.
Issue: The endstops are not triggered during G28 Home.
Scenario: Using a FirePick Rotary Delta and the latest Smoothie2 code base, SilentStepStick at 256 microsteps and 400 step stepper motor.
Investigation:
(1) Using GDB and Segger's JLink I have determined that the loop in 'wait_for_homed' method gets executed only once despite having a endless loop that only exits when 'running' becomes false. It never gets back to the 'while' statement to go repeatedly until it detects the endstop(s) are triggered. Sometimes it only gets as far as the 'THEKERNEL->call_event(ON_IDLE);' statement and never returns to the 'wait_for_homed' code at all.
(2) I am wondering if Smoothie is not able to generate the step rate of some 102400 pulses per revolution for the configuration I have, and therefore does not have enough capacity to run all the other 'tasks' as the interrupt rate could be very rather high for the StepTicker.
(3) Options:
(a) Substantially reduce the resolution of the StepperMotor to (say) 16 microsteps to see if it now works; if this is the case the consider the following:
(i) Migrate the endstops code to use interrupts on the endstop pins rather than polling them, this would include the debounce feature; I have done this for other real-time motor control systems as I have found polling to be too problematic at high work loads. I Note that the MBED interrupt feature for PIN may be too heavy and I may need to write my own ISR to keep it as fast as possible.
(ii) Consider migrating the Step generation and enstops code to the M0 processor, but note that it does not appear to have a SysTick timer on that core.
(iii) Consider moving the endstop code into the StepTicker code so that each time a stepper motor is sent a pulse, the endstop is checked (either the pin itself polled, or a flag set by an interrupt from the pin)
(b) Implement Segger's SystemView code analyser to obtain actual metrics for time spent in interrupts and how often they are occurring (I am part of the way through this but I cannot get the SystemView application to connect to the Smoothie2 target, need too resolve this).
Thoughts?
Cheers
Douglas
The text was updated successfully, but these errors were encountered: