-
Notifications
You must be signed in to change notification settings - Fork 90
Spindle sync discussion #50
Comments
@hubbuis wrote here:
G33, G76 etc. are already implemented in the grblHAL core, they require driver support to be activated. The MSP432 MCU is the only driver that has code for that for now. There is specific pulse start functions for normal motion and spindle synced motion, the driver will switch between them as needed by changing the HAL entry point that the core calls when it is time to start a pulse. The pulse start function gets a pointer to the current segment and and can use data contained in that to perform a lot more than just setting the direction pins and outputting step pulses if it so desires. The spindle sync version is a lot more complex than the "normal one: grblHAL/drivers/MSP432/driver.c Lines 351 to 443 in 0c0d6af
Central to spindle sync is a way to determine the angular position of the spindle, grblHAL has a entry points that needs to be provided by the driver for this and other purposes. These are: grblHAL/drivers/MSP432/driver.c Lines 729 to 798 in 0c0d6af
The grblHAL core does not care about the underlying hardware employed to get the required data, only that the API contract is fulfilled. These functions or rather parts of them could possibly be moved out to a plugin, but since they reference MCU specific hardware I have found it a bit tricky to so without adding processor specific code in the plugin or adding unneccesary overhead.
here. |
I am still waiting for DB25 connectors (got wrong once) to be able to easy change the lathe controllers and do some real testing! In the mean time, I started analyzing the G33 code. For me, it is quit difficult to understand the code in driver.c, have to spent more time on that part
The G33 is executed between to waits for moves to finish. Doesn't this block all requests for status updates (Command ?)? |
Code in driver.c changes the timing of segments in order to keep the position correct at all times. Segment time from stepper.c is a nearly constant 5ms so that is used as the basis for the PID sampling time. If logging is enabled log data can be fetched and plotted, nice for visualizing the PID response. My g-code sender has a tab for that.
No, it does not. |
I had to find this answer my self! Next week I will implement G33 for the SAMD21 driver. I can not test it on my lathe (yet) because my lathe has a 5 volt logic interface. I will test it on the bench. |
I finally have a working spindle sync version of the SAMD21. I have (only) tested it on the bench and it performed the same as the GRBL-L-Mega version (probably because I implemented it this way). I wasn't "a walk in the park". However I think that if we make this part more HAL, than it would take just a few hours per board to add this feature to the existing boards. |
hi! your work is great! but i like more grbl. and what about backlash? is there a idea to use backladh comp? |
@hitchhiker85 The iMXRT1062 and STM32F4xx drivers are on my todo list for spindle sync. FYI a breakout board for Nucleo-64 is nearing completion: 4-axis, Polulu, Trinamic 2130 or external drivers, optocoupled input and outputs++. Preliminary rendering of board: I want this to be able to handle encoder input (minimum 2 pins) as well - and if possible a SD-card header... Backlash compensation is already in the core, but I have not tested it - uncomment this line to enable: Line 284 in 511ef39
|
this is great! breakoutboard is not important for me! i use tb6600 stepperdrivers and ky003 hall ic (3144 IC). i have make a own pcb.... its mote a adapter to use screwclamps for each pin. you write drivers in progress for the 411? its only the spindle sync what must done? if only the spindle sync is missed i can test all other operation.. right? thanks for g76 threading what is realy required? spindke sync via 1 hall ic and 1 magnet? thanks |
Yes, and perhaps a pin mapping file for your pcb.
Yes.
The current implementation (for MSP432) uses two inputs, an index pulse and n-pulses per revolution (PPR) input. |
ok i understand. i must wait but g76 is in progress. i need 2 hall ic right? 1 hole for the rpm what do you think is the best value for N holes? then it give us the chance to use the lathe as AAxis? if we use a servo (nema23) we can drive to a position? right? its far away but possible? Swap Axis! like a extra Command to switch Spindle to AAxis and back. if this is possible you go near to mach3! but how can grbl see if its turn forward or reverse? my pinout is direct to the pins on the f411. |
Good question, maybe it could work with only one like Mach3?
More is better? Up to a point? I have an optical encoder disc on my lathe with 120 holes in it so 120PPR. See the videos linked above.
You mean a stepper for the spindle motor? grblHAL can set any axis to infinite length by setting the max travel distance to 0. Using a stepper for the spindle could possibly simplify the spindle sync code, but I have not looked into that.
If the spindle motor is under grbl control then it knows already. If not then a quadrature encoder can be used or, if available, direction input from the motor controller. If you are thinking of hand tapping by turning the spindle manually then that would require a high resolution encoder and code changes - not something I have considered for grblHAL. |
I started GRBL threading by using a stepper (Y-axis) on the spindle. Very accurate and I still use it to "repair" threads. It makes it easy to pickup the thread because you can stop (pause) at any point. |
hello again ;) i test arround and... its great.. now i am waiting for spindle sync! thanks |
I am working on an easier way to implement spindle sync on supported hardware. When it is done, it would only take a few hours to implement it for an other board. I scheduled it to be ready this year. |
ok... which msp432 would work?msp432p401r? the i will give it a try! |
Not too long, but I will have to put it on top on my todo list to get it done quickly. If you are able to test then this could be soon as I want to verify my ST morpho breakout design for spindle sync if there is interest (verify with my simulator).
This is the one I have in my lathe: MSP432P401R LaunchPad
Any code made public yet? |
good morning
testing on the f411re is no problem!
i will machine a sync disc with 1 hole for rpm with a magnet and 18 holes for position.
i use optical sensors for position
and for rpm the hall ic.
all work with 5v.
let me know if its ready. i am waiting.
i order the msp432!
thanks
Von meinem Samsung Galaxy Smartphone gesendet.
…-------- Ursprüngliche Nachricht --------
Von: Terje Io <[email protected]>
Datum: 27.10.20 08:13 (GMT+01:00)
An: terjeio/grblHAL <[email protected]>
Cc: hitchhiker85 <[email protected]>, Mention <[email protected]>
Betreff: Re: [terjeio/grblHAL] Spindle sync discussion (#50)
any idea how long it will take??
Not too long, but I will have to put it on top on my todo list to get it done quickly. If you are able to test then this could be soon as I want to verify my ST morpho breakout design for spindle sync if there is interest (verify with my simulator).
ok... which msp432 would work?msp432p401r?
This is the one I have in my lathe: MSP432P401R LaunchPad<http://www.ti.com/tool/MSP-EXP432P401R>
I have setup a development environment for the MSP432 (just compiling), STM32, SAMD21, ESP32 and made the first suggestion.
Any code made public yet?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANXN35AJRONZNBTE6JJHI7DSMZXH7ANCNFSM4NHDPMJA>.
|
I have not published the code because it has a lot of (now needless) changes introduced to get things working. Only the SAMD21 is tested on the bench and just for G33. The changes could have introduced new bugs. |
Do not forget that most ARM processors do not have 5V tolerant GPIO... |
gave you a wiring diagramm? thanks
Von meinem Samsung Galaxy Smartphone gesendet.
…-------- Ursprüngliche Nachricht --------
Von: Terje Io <[email protected]>
Datum: 27.10.20 10:58 (GMT+01:00)
An: terjeio/grblHAL <[email protected]>
Cc: hitchhiker85 <[email protected]>, Mention <[email protected]>
Betreff: Re: [terjeio/grblHAL] Spindle sync discussion (#50)
all work with 5v.
Do not forget that most ARM processors do not have 5V tolerant GPIO...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANXN35EDPR6HVWJREO3C53DSM2KSXANCNFSM4NHDPMJA>.
|
i dont understand.
all my sensors work with 5v supply voltage.
not good?
Von meinem Samsung Galaxy Smartphone gesendet.
…-------- Ursprüngliche Nachricht --------
Von: Terje Io <[email protected]>
Datum: 27.10.20 10:58 (GMT+01:00)
An: terjeio/grblHAL <[email protected]>
Cc: hitchhiker85 <[email protected]>, Mention <[email protected]>
Betreff: Re: [terjeio/grblHAL] Spindle sync discussion (#50)
all work with 5v.
Do not forget that most ARM processors do not have 5V tolerant GPIO...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANXN35EDPR6HVWJREO3C53DSM2KSXANCNFSM4NHDPMJA>.
|
Not good for connecting directly to GPIO pins - a fair chance that the processor will let out the magic smoke and die. However, a level shifter will fix that - can be as simple as two resistors for input signals, or if a bit of signal conditioning is desirable an IC with a schmitt-triggered input such as 74LVC1G17. |
and pure 3.3v supplyed sensors?
i have seen in the datasheet it can work from 3.3v up to 5v.
can you please show me a pinout for the msp432?
where can i find which pin is used for what?
thanks
Von meinem Samsung Galaxy Smartphone gesendet.
…-------- Ursprüngliche Nachricht --------
Von: Terje Io <[email protected]>
Datum: 27.10.20 12:04 (GMT+01:00)
An: terjeio/grblHAL <[email protected]>
Cc: hitchhiker85 <[email protected]>, Mention <[email protected]>
Betreff: Re: [terjeio/grblHAL] Spindle sync discussion (#50)
all my sensors work with 5v supply voltage.
not good?
Not good for connecting directly to GPIO pins - a fair chance that the processor will let out the magic smoke and die.
However, a level shifter<https://www.google.com/search?q=level+shifter+5v+to+3.3v> will fix that - can be as simple as two resistors for input signals, or if a bit of signal conditioning is desirable an IC with a schmitt-triggered input such as 74LVC1G17<https://www.google.com/search?q=74LVC1G17>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANXN35ECRIKN3DBIJA64CSLSM2SKBANCNFSM4NHDPMJA>.
|
That will be ok.
Here are mappings for my CNC BoosterPack, also linked to from the driver page. The index and PPR (RPM_COUNTER) pin assignments are somewhat hidden in driver.h:
|
ok thanks!
6.3 and 7.2 are the solderjoints right?
then i can etch my own breakoutboard befor the msp432p401r board me arrived.
thanks
Von meinem Samsung Galaxy Smartphone gesendet.
…-------- Ursprüngliche Nachricht --------
Von: Terje Io <[email protected]>
Datum: 27.10.20 15:50 (GMT+01:00)
An: terjeio/grblHAL <[email protected]>
Cc: hitchhiker85 <[email protected]>, Mention <[email protected]>
Betreff: Re: [terjeio/grblHAL] Spindle sync discussion (#50)
and pure 3.3v supplyed sensors?
That will be ok.
can you please show me a pinout for the msp432?
where can i find which pin is used for what?
Here<https://github.com/terjeio/CNC_Boosterpack/blob/master/LaunchPad%20pin%20assinments.md> are mappings for my CNC BoosterPack, also linked to from the driver page<https://github.com/terjeio/grblHAL/tree/master/drivers/MSP432>. The index and PPR (RPM_COUNTER) pin assignments are somewhat hidden in driver.h<https://github.com/terjeio/grblHAL/blob/master/drivers/MSP432/driver.h>:
#define RPM_COUNTER_PN 7 (port)
#define RPM_COUNTER_PIN 2
#define RPM_INDEX_PN 6 (port)
#define RPM_INDEX_PIN 3
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANXN35APFQOUVT37WSFIIT3SM3M2RANCNFSM4NHDPMJA>.
|
You mean every index pulse? You are only using input from the index pulse for your calculations? Tell me a bit about your simulator. Mine reads the commanded RPM from the PWM output after RC filtering it and passing it to an ADC. It has a command interface where I can change parameters such as adding an offset to to the RPM input. Adding an offset can be used to check how the control loop behaves. Both with a constant offset and a step change. So a robust way of handling encoder input is required. There are a number of options available for this depending on processor peripherals. I order to support encoders with a wide range of PPR I currently feed the encoder pulse to a counter and generate interrupts from that only after a predefined number of pulses has been counted (using a compare register). This effectively acts as a prescaler, but without loosing the accuracy of high PPR encoders, this since the actual count is available when called for. A "simple" input pin generating interrupts directly is also an option, but IMO that should be avoided if possible as high PPR encoders may cause too much overhead. Some processors have quadrature decoder peripherals that can be used as well, the encoder interface should support that option too. It is on my todo list for the iMXRT1060 to explore that. Down the line this could be used for tapping and hand turning of the spindle and have the Z-axis tracking the spindle movement... I have cleaned up the spindle sync code a bit and moved data structure definitions to the core. I will commit those changes soon so you can have look. BTW I get this result from the MSP432 driver after tweaking the encoder pulse handling code, don't know if I should believe this... |
Every encoder pulse the z-axis speed is calculated to be (try) in sync at the next encoder pulse. The setup used is to minimize floating points calculations to suit low speed processors without FPU.
It is a simple arduino program that generates the pulses. On the ATTiny85 I used, I can't get the speed below 60 RPM, I don't know why. For the next setup i will try the arduino nano I used before.
My greatest worry is picking up noise on the index or encoder signals. To avoid having to make an electronic filter, a debounce filter in software is needed (like on other inputs) that fits most users that use a simple low resolution encoder.
On a simulated environment, these results are probably good. A 0.01 mm error is totally acceptable for threading.
That is on my "maybe" list because it requires ball screws and this results in no manual control of the lathe.
I will do that By the way, I like your approach to visualize grbl data. |
@HuubBuis updated code just commited.
I see that you do more calculations in the spindle pulse ISRs than I do. I wonder if some of these could be moved to the foreground process? The latest iterations of the core has a new entry point for enqueuing a callback to be executed from the foreground protocol loop. However, it could well be that the delay incurred using this is too large for spindle sync.
Perhaps tuning a PID loop for spindle sync is not so scary then? ;-) |
hi! have you some news about the stm port of your grbl version?? thanks! |
@hitchhiker85 The breakout board is ready and I will order a small batch of 10 initially, tomorrow? And I have spindle sync working with simulator input - code just committed for that. The pin map that supports spindle sync is in st_morpho_map.h, note that the pin used for the spindle encoder pulse is fixed ( If you want to test this code then be aware that I regard it as alpha quality. Be extremely careful if doing so when connected to a lathe! Dry runs with a hand on the estop button recommended. My breakout board has 5V tolerant input buffers for the spindle encoder signals, the dev board on its own is limited to 3.3V. |
In the stepper pulse interrupt there is a float addition and In the Encoder interrupt, there a few float calculations. These can sure be moved to the foreground process (where the new z-axis rate is set).
Still scary but I am a bit more assured. The real test starts when using this with the default values.
Looking at the graph, increasing the I value 5 times, would bring the error fluctuating around 0 in about 2 mm z-axis travel. |
Buy yourself a MSP-EXP430G2 LaunchPad and use my code? I have just finished tuning the simulator code, most of the noise seen was not due to ADC jitter, it was bad programming. I use two PWM generators for generating the pulse outputs, what I did wrong was that I updated PWM registers asynchronously to pulse output generation leading to random changes in pulse width. Changing to synchronous updates cured that. I have also changed the main pulse output to be 50% duty cycle. With a bit of tweaking it should be possible to simulate a quadrature encoder as well?
Adding software debounce is not what I would do - as it will add more jitter to pulse timing? IMO it is better to clean the signals electronically if required. Ferrites on the cables is the first ting to try.
I have not spent much time on PID loop tuning yet - my main focus has been on encoder pulse handling. Counting the main pulse should be done on the rising edge and index pulse on the falling edge? Or vice versa depending on the encoder? Or perhaps taking care to get the related interrupt priorities right? As I wrote above I want robust encoder pulse handling. |
It would make things a lot easier if I could also test grblHAL using your board. I have looked for a MSP432P401 board but in the Netherlands I have to order 3 of them to reach the minimum order limit. As soon as I can reach this order limit by adding other things I need, I will order one.
I think most grbl users have no tools or skills to solve glitches this way. Software debounce solved problems on both of my lathes.
As long as the time between the index and the encoder pulse is long enough to do the threading preparations, it doesn't matter. The location of the index magnet is between the encoder magnets on my lathes, so I can change the spindle direction for left hand threading!
me to! |
I do not think so, it is a 16 bit processor with limited RAM (up to 512 bytes) and flash. IMO perfect for the simulator. I could have used a 8 bit processor and the Arduino IDE. But I want to be able to properly debug so not an option for me. Did you follow the link I provided?
That is your encoder, some commercial encoders are build differently, as is mine that is based on photo interrupters and where the index pulse coincides with a count pulse. Limiting spindle sync to a specific type of encoder is not what I want, grblHAL should support both home made and commercial ones. There are commercial encoders out there capable of delivering > 300K pulses per second at 6000 RPM and above (not that I am aiming to support those). At least some of the grblHAL drivers should be able to handle 1024 PPR as a minimum, or perhaps up to 4096 PPR? |
I am considering bringing back the error flag and adding it to the status report so it can be displayed in the sender. MSP432 index pulse handler:
|
That shouldn't be a problem if you trigger on the same edge and the interrupt for the encoder pulse has a higher priority than the interrupt for the index pulse. Than after waiting for the index pulse, followed by waiting for next encoder pulse, all threading starts at the same point.
That could give a problem when there is an encoder pulse during the processing of the report. But that depends on the interrupt priority of the index pulse. When the Z-axis is running in sync, I can hear that the encoder magnets (lathe original rpm measurement) are not placed well. I am making a new UHMPE encoder disk where the 16 magnets (3 mm) are placed in drilled holes. The holes will be tight enough to hold the magnets while running but the magnets can still be moved away or towards the sensor. This will allow adjusting the timing a bit. |
I'll go for the pulse edges as I cannot guarantee that the pulses arrive at the same time with sub microsecond accuracy. E.g the STM32F446 runs at 180 MHz...
I am not going to add this to my sender unless it is just a sequence of numbers to be picked up from the console. A better alternative could to add it to my spindle linearization application that is built on top of the sender libraries. This since the task at hand is to be performed once and does not require full gcode sending capability. I have not yet published this application, should perhaps have done so earlier as I moved the data points required for spindle linearization from
I do not understand this, the report is generated in the foreground and does not block interrupts. Transmitting the characters does but not for long enough to be an issue.
That will depend on the PPR. I timestamp both pulse events with at least microsecond resolution (but not accuracy) and use this when calculating the angular position. By doing so the resolution of this calculation is better than the resolution that the encoder provides. For some processors it may even be possible to timestamp the events with absolute accuracy by routing the pulse signals to trigger capture events for the timestamp timer. However that is likely to be an overkill - but would be fun to try one day... FYI the SAMD21 has a 32 bit timer for the real-time clock that can be used to generate timestamps with ~30us resolution. |
There is no need to change the sender. I will modify the SAMD21 version tomorrow.
You are right,
I mean that the threaded bar will show the missing pulse at the first cut because one of the pulses will be twice as long, the z-axis speed will drop and the thread will look awful (for low resolution encoders). |
I have modified the SAMD21 version to measure the pulse width from the encoder. I also changed the spindle simulator to make the first pulse after the index pulse 10 us longer (pulse time 250 us). When requesting the PID log a second time, without doing a new threading pass, the measured pulse width is send (actual position). The first pulse width after the index pulse is used as reference (target). Result for the command G91 G33 Z-15 K1.5 running at 60 RPM, one pulse 10 ms longer: |
Your code with my 120PPR simulated encoder and a MKRZERO board: Spindle speed does not report live at all times as it should since you have modified the real time reporting. Also the RPM reported when it does is off by some 20% - don't know yet if this is the PWM output beeing off spec or your RPM calculation beeing incorrect. The missing debugger in the Arduino IDE is a pain... If you want me to do a code review the please update to the latest version of grblHAL and add your changes to that so I can find them without hunting around. |
The change should show the measured RPM if the RPM is not controlled by grbl. This is done because the RPM shown on my lathe have a slow response.
The index pulse frequency measured on my oscilloscope is 0.988 Hz, your sender reports 59 RPM. I can't reproduce this error!
Have you committed these changes yet?
Would it help if i added the complete Atmel Studio 7 project in a zip file? |
Well, as I wrote it could be the PWM beeing off. I am interested in seeing the changes you have made to the core before I am spending more time on your implementation. It looks like you are not using the HAL API as you should. E.g spindle sync and spindle at speed capabilities are not communicated to the core, and it seems to me that you have added another way to detect the initial index pulse before starting a synced move? IMO we need to discuss the reasons for any core changes since it is shared among all drivers, perhaps you can use the existing API for some of them?
Yes.
No, there is no way to debug the MKRZERO that I have that I am aware of. And I need a new development machine - disks are near capacity so I am not going to install another IDE on it. I will order one soon, but do not look forward to setting it up... |
I made a lot of changes, not because they are better but just to get things working. In the end, I tried threading the way it is implemented in grbl-L-Mega. I now have a "working" totally messed up threading implementation. This code is not suitable to merge in grblHAL but the exercise helped me understand (a bit) how you have done it.
I think in general your implementation is OK and on some points better than mine in grbl-L-Mega. I am concerned about the CPU load for processors that don't have a FPU and the debouncing of signals. The only way to check this is by "fully" implementing you API, measure how long calculations are on different boards and do a real test on a lathe.
I will have a look at the changes. Are these changes in the Master or the Test branch?
There are smd pads for a debug header on the bottom. In general I don't use boards that don't have a debug header.
I have the same problem. I have to reserve a week to do a clean install but I try to postpone this as long as possible. |
Start with implementing the basics first. This is the code needed to calculate RPM, the angular position and to query the pulse counts.
In the master. Use the STM32F4xx or iMXRT1062 driver as a reference, not the MSP32 as this has code for closed loop spindle RPM handling that may be confusing.
Thanks, I was not aware of that.
What could be useful is somehow moving the floating point calculations to the foreground. Eg. the ESP32 crashes if a floating point variable is even accessed in an ISR... And performing floating point calculations in an ISR using a software library is IMO not desirable. |
The RPM is calculated based on the time between pulses (tics) and the encoder revolution. The calculation itself is the same for all drivers and could be part of the core. This could also be applied to the angular position. Example: On the receive of an Index pulse, the driver (ISR) signals the core (API call) the receive of an Index pulse. The core decides what information should be requested (current time tics) and query's the driver for this information. The core keeps track of the index pulse interrupt count and timer tic count.
I think this is possible and it fits my idea to separate tasks:
Correct me if I am wrong:
I aggree. |
It could but I have decided to do this is the driver as the code is small and MCU registers are accessed. Moving it to the core will add a call to get the register data too. I have decided against adding spindle sync as a plugin for the same reason.
I had a callback in an early version but removed it since it went unused. Can be added back, but I believe it is not needed since it is not possible (or neccesary) to adjust the feed rate for a segment once it is executing.
Every encoder pulse: this is perhaps ok for low PPR encoder but IMO not for high PPR ones. Every encoder pulse interrupt could be ok if "prescaling" is used by routing the pulse signal to the input of a counter and use compare to trigger the interrupt. This allows a wide range of encoder PPR to be handled with a similar interrupt load. The "Prescaling" will limit pin selection for the main pulse input and may not even be possible to add if a suitable timer is not available. I do not see that as a problem, IMO it is not neccesary to add spindle sync capability to all drivers as the user numbers are going to be low. In fact I prefer to not add spindle sync to all, support beeing the main reason.
I do not get this, no way the calculations are going to take 5 ms. |
I haven't measured the calculation time yet but if so, calculations at the start of every new segment could be the way for all processors. I found this for FPU on ESP32 https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/freertos-smp.html |
Calculation time should be less than 100 microseconds even without a FPU? And there is always an option of using fixed point math in the driver. Another reason to do the calculations there?
Interestingly all of the other 32-bit ports of grbl I have looked at uses the double variants of library calls, IMO for no good reason. A spillover from 8-bit? BTW 8-bit Arduino libraries does not support double precision, they use single precision for both. ARM M7 processors such as iMXRT1060 has a FPU capable of handling double, at some point the core should get a compile time option for using that instead of float? |
It was not to do the calculations there but the trigger when to do a new calculation. |
Why not bypass the encoder steps/sec -> RPM -> feed/rpm calcs and calculate a Bresenham slope directly between spindle encoder counts and feed steps? Then the float calc for the gear ratio/Bresenham slope only need to happen once per G-code, and the encoder can trigger steps or not based on the Bresenham deviation while in spindle sync mode. |
By using a software controlled PLL to generate the step interrupts? FYI I am only using the measuered RPM to set the initial feed rate, angular position is used in the feedback loop. |
Thanks. I was misreading the code. I think I see it around grblHAL/drivers/MSP432/driver.c Line 362 in 93c1294
cycles_per_tick is modified.
|
For implementing spindle sync for further drivers.
The text was updated successfully, but these errors were encountered: