ambrop72 / aprinter

3D printer firmware written in C++
Other
143 stars 42 forks source link

Is there a way to stop a mouvement ? #28

Open Strophe27 opened 7 years ago

Strophe27 commented 7 years ago

Hi ambrop72,

Something like M112 would be very usefull.

First, thanks 10^100 times for your great work here ! so nice movements and smooth stepper management... and this unique ability to choose what kind of axis per steppers and choose their endstops (it's why I choosed your firmware, and the reliability and softness is the surprise !)... I'm a very happy user

The context :

Maybe there is a M or G code I didn't find... But I tried all GCode given on RepRap Wiki to know better APrinter (and Gcode also because I'm very new in CNC and 3DP world).

Do you think is possible to add a 'ghost' M or G code with a Stop X Y Z A B somewhere in your code ? But first, is it possible for your firmware to manage incoming code while a movement is in progress ? If all 2 are yes, can you inlight me where is the best place to put what kind of instructions (I'm a professional copy/paster and test/hacker untill is work...) ?

Sorry for this long issue, you can quickly reply yes/no and I will do with that. My needs is just for comfort in creating, not for the hard job wich is working so good (very soft movements + video = :1st_place_medal: )

Thanks for all

ambrop72 commented 7 years ago

Hi, Thanks for using my software. However there is currently no way to stop a movement, but I can possibly implement that.

I can implement these things myself (I imagine it's not easy to understand those parts of my code), I've actually been planning that for some time. But you need to let me know if using two command processing channels will work for you or if we also need a feature to send a high-priority command on the same channel as the motion commands.

About your receive-buffer-overrun error, it is because you're sending too many commands at once and overflowing the receive buffer. A reliable way to avoid this is to keep track of the outstanding number of bytes send but not ok-ed, and never send a command if that would make the outstanding number of bytes more than the serial RX buffer size. (or a simpler approach: never send a command before the previous command is OKd).