-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Помогите с кодом. #245
Comments
You will have to write a plugin for that. |
stm32 3 axes are used, there, there are also outputs for 2 axes. Is there any instructions on how to use and configure these plugins. I'm not good at programming. it turns out I take a pin with stm32, enter an additional "M * command and when executing Gcode, the command will be executed according to the written conditions and after that it will start executing the following lines of gcode.... Could you please help with writing a plugin, I have no skill in this. |
For the templates instructions are usually in the .c file header. For "active" plugins in hosted separate repositories in the associated readme. Some general informatin can be found in the Wiki.
|
no, I wrote m555 as an example to make it clear in gcode , otherwise you can use any command |
Ok, then you can first try with M66 - wait for input, use the |
by gcode, the engine will turn off and m66 will then wait for the sensor to work on the pin ?! so the engine should reduce to 10 revolutions and rotate until it finds a signal from the sensor, after which it continues to move .. according to the gcode program |
Motion will stop and wait for the sensor. If you are using the spindle signal for something and want to stop that then M66 will not disable the spindle signal.
Is this in the gcode? And is it the same sensor as for the first step? |
there is no gcode, it will just execute commands, after the execution has passed, the engine should spin slowly to find the sensor and stop, it turns out that the needle will come out of the fabric, and will not tear the fabric after gcode continues to work. |
You lost me there - execute what kind of commands? grblHAL understands a number of G- and M-codes plus some $ system commands. How are the commands generated? By a program? Made by you or generally available? |
publicly available. |
What will happen. |
Do you have any links?
So there is defined sequence of actions that has to be taken when executing the new M-code, not only a simple wait? |
what you need, but here the movement is performed by raising the axis of the stepper motor, and I have an asynchronous one, to find the sensor you need low engine speeds, PWM control. |
And how to collect all this in the firmware ?! is it possible with mega2560 and shield ramps 1.4? |
Looking at this video it seems to me that want you want is to run the retract step (pulling the needle up) until a sensor is struck and then continue?
Sorry no, grblHAL does not run on 8 bit processors.
Some boards supported by grblHAL could use this if Ramps 1.4 is similar to 1.6? |
I'll take stm32 well. yes, I watched the video, a stepper motor is used there, and with it there is no sick speed of work, for this the hall sensor will be used to determine and raise the needle to the top and continue working on gcode further |
You are using translation software to english? I am having a bit of trouble understanding everything... You refer to PWM above - does this mean you want to use a RC servo motor for driving the needle? |
Yes, I use google translator. |
You control the motor with the PWM and spindle direction signals - using M3/M4 and S for speed? |
Yes, I would like to use these M codes. I need only one sensor to determine the upper position of the needle, so that the axes move to another location and the code continues to execute. but since I don't have any programming background, I think that I won't understand writing a plugin for such needs. |
Have you made the machine already or is it in the planning stage? These are some of the questions that comes to mind and that has to be answered before any attempt to write a plugin. |
Yes, under development ... I'm waiting for details from China. error:8 - '$' command cannot be used unless controller state is IDLE. Ensures smooth operation during a job. -what should be done? I don't understand |
In the board map file or by using the
Did you compile with the correct MCU selected and bootloader on/off version?
|
I don't know how to enable usb properly. |
$14=78 set, but grblhal does not accept these values, an error is written |
|
USB communication is the default when available. If it is not working it could be due to flashing a version of the firmware that does not match the processor and/or the processor clock (crystal) on the board. |
how to flash stm32f103c8t6 correctly, the assembly from isb works through the site, and if the assembly is done through ide, then it doesn’t work, what am I doing wrong? downloaded grbl hal opened, compiled received a file, format . bin via stm32 loaded the program into the board. |
WhatsApp.Video.2023-03-10.at.6.40.15.PM.mp4i have what you want to do already working, i just want to makeit faster, at least 800 to 1200 STPM i will test with grblHal and see if i can get it to work with M66 Ed |
@Ams-Laser A few questions: Is the current controller running some Grbl version?
You will have to add a definition for an Aux input to the board map, you can do that? Or should I do it? |
Can you zip and add an example gcode file if it gcode is used? Is the sender a dedicated sender with special features? Like handling when the needle in the up position? Is the threading (needle) motor under speed (RPM) control? How are long jumps handled - they may take longer than the time for one stitch (or one revolution of the motor)?
let me know if you need my sender to test and compare Thanks again |
@Ams-Laser I will add an aux input tomorrow, it is getting late here. I came to think of another feature of grblHAL that could be used, it is possible to put the controller in single step mode, toggled on/off either via |
y tried the web builder but the uploader has changed and i could not find instructions on new version |
Done, pin 33 (EXP_1 header, pin 8). Note that this pin does not have a pullup so you have to drive the pin by logic level or add a pullup resistor. I have also added feed hold and cycle start inputs on J2 (I2C header). You can test the aux input by sending From looking at the sigzag gcode file I guess you are using the comments to control the needle motor and set up a wait for trigger. Correct?
You are running on Linux? I've just tested the Windows version and that works fine using the current instruction page. |
Thanks, im still having truble compiling for my dlc32 board , once i get it working ill test the i/o Again, thanks |
@Ams-Laser I've added a sensor on an old PFAFF machine to check timings on my scope - you must have pretty high acceleration and feedrate settings to achieve the speed I see in your video? May I ask what they are? BTW I have added plugin support for Tajima DST files (streaming from SD card only) - I need to add motor control to the sewing machine to complete that, but it looks good. I can even get a 3D view in my sender from translating the DST format to gcode and upload that to the sender: |
Looks Great!!!! Motor speed control done by relay on output pin Can i please try on my machine Tanks |
Not yet - I have to figure out when to cut power the motor first. It should be cut a number of milliseconds before the trigger so that it comes to a stop just after the final encoder signal? Or is motor acceleration so slow that it does not matter for the first stitch after a start? At low stitch rates this might not matter at all, but at higher ones it might? How do you handle this, if at all? Anyway - I am going to the workshop to fetch a relay for the motor... |
Im usinga Servo motor for the sewing machine, it has its own encoder and automatically stops the machine with the neddle in the up position, there are cheaper than closed loop steppers or servos, i just cut off the relay and wait 2 seconds in case the servo was just passed the needle up position and slowly does one last stitch then is safe to move the axis can you share your converted "CUADROS.dst" file so i can see how you are handling the positions, color changes, etc. hope this helps |
Ok, but I guess not everybody will have that. The machine I am testing with is old (50 years+) and uses a tapped resistor for speed control, so I believe I have to be able to calibrate when to cut power.
I do not have such a file, you forgot to attach it? Anyway the conversion to gcode is available just for a sender to fetch (if it wants it) so that it can display the design. Execution is directly from the embroidery file (.dst or .pes) - the plugin reads stitch data from a SD card connected to the controller and calls the appropriate code in the grblHAL core to control the machine. This way I have a lot more control of what is going on than by translating to gcode first and sending that to the gcode parser. |
@terjeio as a solution for the sewin machine control, just use a relay to enable, and use the pedal to set the speed, upon stopping display a message to user asking tu put needle in upper position manualy then pres continue, |
Yes - but not yet from the Web Builder. You have to compile locally for now.
Telnet and Websocket communication is supported so yes?
There are other commands that stops the needle as well, at least trim and jump commands.
Give me a bit of time for that - saving is disabled in my sender for files loaded from the SD card. BTW, I have published the code as it now stands, and opened a discussion where further comments should be made. |
@Ams-Laser Here is the converted file. It is in a minimized format, in legal gcode, to increase upload speed: |
@terjeio Hello, I have a question about the embroidery attachment. How is the motor controlled? Is it controlled by turning it on and off or by PWM? |
You choose. A trigger signal is needed to detect needle position once for every stitch. |
@terjeio |
@pitergus I am not sure I understand what you want to achieve. You want to turn the motor manually while the program is running and at some point start it? |
“Hello, when starting the embroidery, the motor does not activate in PWM mode. I am testing in off/on mode. How do you configure it to use PWM? |
Setting $30=1 may help, it will output a 100% PWM signal when turned on. $30=2 will output a 50% duty cycle signal since the spindle is turned on with a RPM of 1. Duty cycle is 1 / $30 value. |
@terjeio "Hi, I'm using .pes files and it's - working great. https://github.com/user-attachments/assets/9c6ca3d0-186a-4d95-bcb2-110b6d227a89 |
Хочу сделать швейную машинку для вышивания..
как подключить (датчик индуктивности или датчик холла )для установки поднятия иглы ? и прописать его в прошивке
чтоб по команде в gcode m555 двигатель остановился и провернулся до замыкания датчика . ?!?
I want to make a sewing machine for embroidery..
how to connect (inductance sensor or hall sensor) to set the needle lift? and register it in the firmware
so that, at the command in gcode m555, the engine stops and turns until the sensor closes. ?!?
The text was updated successfully, but these errors were encountered: