Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.

Add G0, G90, G91 - #88

Open
IhorNehrutsa wants to merge 13 commits into
CAP1Sup:devfrom
IhorNehrutsa:G0
Open

IhorNehrutsa wants to merge 13 commits into
CAP1Sup:devfrom
IhorNehrutsa:G0

Conversation

@IhorNehrutsa

Copy link
Copy Markdown

No description provided.

@CAP1Sup

CAP1Sup commented Aug 4, 2021

Copy link
Copy Markdown
Owner

This needs acceleration calculations. All linear movement commands support acceleration and jerk. We'd probably just be best to steal reference code from a project such as Marlin. That way, the code we're getting is known to work. I was going to add this, but I was concerned with the work of acceleration control

@IhorNehrutsa

Copy link
Copy Markdown
Author

Ready for merge

@CAP1Sup

CAP1Sup commented Aug 5, 2021

Copy link
Copy Markdown
Owner

We need acceleration control for G0. With G6, it doesn't matter, as that command is supposed to just execute the steps without caring. However, G0 needs acceleration. We need to have some kind of planner implemented on the step schedule timer that helps to ensure that the correct rates are being used

Comment thread src/software/parser.cpp Outdated
rate = DEFAULT_STEPPING_RATE;
rate = motor.gm_code.rate;
}
else {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't reset the default rate every time. scheduleSteps will handle the rates

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://marlinfw.org/docs/gcode/G006.html

[R] Step rate per second. Last value is cached for future invocations.

It will use the previous rate value

                int32_t rate = parseValue(buffer, 'R').toInt();
...
                if (rate <= 0) {
                    rate = motor.gm_code.rate;
                }
                else {
                    motor.gm_code.rate = rate;
                }

@IhorNehrutsa

Copy link
Copy Markdown
Author

I agree about the acceleration, but I propose to make it in another PR.

@CAP1Sup

CAP1Sup commented Aug 5, 2021

Copy link
Copy Markdown
Owner

I have some changes to finish up and push, then I'll merge

@CAP1Sup

CAP1Sup commented Aug 5, 2021

Copy link
Copy Markdown
Owner

Needs M92 and flash saving of steps/mm. I'll do it over the weekend (hopefully). Steps/mm should be float

@CAP1Sup

CAP1Sup commented Aug 6, 2021

Copy link
Copy Markdown
Owner

Just needs M92 now

@IhorNehrutsa

Copy link
Copy Markdown
Author

It will be well if the rate in Hz or the feedrate in deg/m or mm/m is possible.

G0 [R1000 | F10] A123.45

@CAP1Sup CAP1Sup added the new feature New feature or request label Aug 9, 2021
@CAP1Sup

CAP1Sup commented Aug 9, 2021

Copy link
Copy Markdown
Owner

It will be well if the rate in Hz or the feedrate in deg/m or mm/m is possible.

G0 [R1000 | F10] A123.45

I'll add that back then

@CAP1Sup

CAP1Sup commented Nov 22, 2021

Copy link
Copy Markdown
Owner

I think that we should hold off on the movement gcode for now, just because we have a lot of work to do in the features already implemented. The step correction is still lacking, which I think is the highest priority after the minor step loss issue.

@jlmxyz

jlmxyz commented Apr 3, 2022

Copy link
Copy Markdown

please have a look at the comment on top of parser.cpp in #120, I wanted to perform the same but allow "broadcasting" of move commands on CAN and have the motor select what it requires :

   //  - G20 (ex G20) - set unit to inches
   //  - G21 (ex G21) - set unit to mm
   // - M92 (ex M92 X87.489 Y87.489 Z87.489 E1:34) - Set axis_steps_per_unit
   //  - M579 (ex M579 X1.0127 Y0.998) Scale Cartesian axes (to have motor handle only X commands M579 X1 Y0 Z0)

=> this allow to configure the motor to be able to compute the required move according to it's settings (hardware angle, microstepping and if the Z axis is for example 45deg instead of 90 (for endless printers....) as well it can be used to have the motor ignore information it don't require (for example a X motor don't care about Z move but if the command is broadcasted (for bus efficiency and avoid having to have a master that know what CAN ID is assigned to what axis....) this allow the motor to know what is the information it need to perform the move

   //  - M400: Wait for current moves to finish
   //  - M410: Quick-Stop
   //  - M1000 (ex M1000 234667211432) set or get time information in nanoseconds, not related to an "absolute time" like 2022-05-18 21:03:54.123456, but like a relative time reference
    //  -         setting time can allow slave to compute local clock drift and eventually correct clock settings, getting time will allow master to compute clock drift of slaves and 
    //  - M1001 (ex M1001 234667219999) wait for time - continue move commands processing only after this time others commands are still processed

for synchro >=1000 are non standard but can be used to compute clocks drifts and fix clocks of multi drivers system (needed if distributed motor system)


    //  - M575 (ex M575 P1 B57600 S1) Set serial comms parameters
for allowing to use a stepper as a serial to CAN bridge and use 3Mb/s serial....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants