marginallyclever / gcodecncdemo Goto Github PK
View Code? Open in Web Editor NEWa simple example of making a CNC machine from an Adafruit Motor Shield
a simple example of making a CNC machine from an Adafruit Motor Shield
the error message is
src\main.cpp: In function 'float parsenumber(char, float)':
src\main.cpp:50:15: error: 'serialBuffer' was not declared in this scope
char *ptr = serialBuffer;
^
pls help me
Hello, i want to ask.
If i not use adafruit motor shield, how i can modify your code? thank you
Hi,
I am using your GcodeCNCDemo to control two stepper motors to move a solenoid into a specific position to move a chess figure.
I worked a lot of things out like implementing a servo to lift up the solenoid and different lights for different players.
The only problem I need to solve, is the homing at the start of the program.
As far as I know it should be in line 108, but I can't work out how it should look like.
I don't understand the Marlin Firmware so I can't even try to work out how they fixed the problem.
Could you give me a hint how to work it out?
Thanks already
Hello,
I get the following messages when trying to compile the code for the 2-Axis Demo:
GcodeCNCDemo2Axis.ino: In function 'float parseNumber(char, float)':
GcodeCNCDemo2Axis:180: error: 'serialBuffer' was not declared in this scope
GcodeCNCDemo2Axis.ino: In function 'void processCommand()':
GcodeCNCDemo2Axis:239: error: 'parsenumber' was not declared in this scope
What can I do to fix this?
Thank you very much for taking the time to write the code and to make it available for everyone interested.
All the Best, Björn
Hi!
First off, I just want to thank you for creating this awesome project, I really appreciate it!
But unfortunately I have run into an issue.
I am using the GcodeCNCDemo4AxisCNCShield with Arduino Uno and a CNC Shield v3.0
When I send some GCODE to the Arduino with the Serial Monitor the motors don't turn, they just vibrate/buzz.
And my question is, what could be causing that? Have I not configured something, did I miss a step somewhere? I have confirmed that the wiring and hardware works using GRBL, so that can't be the problem
Video:
https://user-images.githubusercontent.com/33597575/152638911-0a5f1f6e-c925-4647-94f8-6572b7c71100.mp4
GCODE that was sent: G00 X0 Y100 Z100 E0 F10;
Thanks in advance for the help! :D
Hi!
I downloaded the GcodeCNCDemo4AxisRAMPS.ino from your github site and modified to add 5th stepper motor.
When i try to run, i here humming noise from stepper motors.
I tried all combinations of steps and feed rate.
Enclosed is my modified file.
Please help me with values of feedrate that will work.
Also help me with the logic behind the feed rate calculation and step delay.
What is the feed rate in g00 command.
Thanks & Regards
Balaji
Hello,
I am trying to use your program GcodeCNCDemo2Axis.ino for a stepper motor drive of a DVD sled. Thank you very much for the informative web page and the programs.
In order to make the program work I needed to make a modification:
line 185 must read: ptr=strchr(ptr,' ')+1;
A compiler warning can be avoided, when you write in line 181
while((int)ptr>1 && *ptr && ptr<buffer+sofar) { // cast to int
One question about scaling. The stepper motor in use needs 20 steps for one turn,
and moves the head on the spindel 3 mm (from datasheet).
When in config.h I adopt: #define STEPS_PER_TURN (20)
I get with the command: G01 F10 X30; (30 mm?) a movement of about 5 mm.
When I try to scale with the parameter STEPS_PER_TURN (xx) it behaves strange.
How can I scale Xmm to the actual movement?
Another question is MICROSTEP. The actual movement with module AMS1
(adafruit motor control V1 with 74HCT595) sounds like SINGLE stepping.
I have used from adafruit the program "steppertest.pde" which goes endless forth
and back 100 steps in different step modes.
Regards, Rudolf
p.s. I wrote an issue, because the "Reply" function on the web page
https://www.marginallyclever.com/2013/08/how-to-build-an-2-axis-arduino-cnc-gcode-interpreter/
does not work. The "Post Comment" button overlaps the captcha field.
Thanks for sharing how to write a gcode intepretor. I tired GcodeCNCDemo code in my Arduino Mega+RAMPS board using A4988 and DRV8825 stepper motor drivers. I uploaded the code, I get the Info message But then I tried to move motors
This is the command I used
G00 X10 Y10 F500;
But it doesn't work.
Hi
I'd like to know how to add a simple servo to the GcodeCNCDemo4axisV2 code.
Any help would be much appreciated
Hello
Thank you very much for this wonderful work
But
The code works in a new way With tb6560 stepper motor driver
Doesn't work with tb6600 stepper motor driver
Can you help?
Hi
I am using the code [GcodeCNCDemo4AxisCNCShield]
I am unable to control the amount of braking
Can you help me with how to control the amount of braking?
float parsenumber(char code,float val) {
char _ptr=buffer;
while(ptr && *ptr && ptr<buffer+sofar) {
if(_ptr==code) {
return atof(ptr+1);
}
ptr=strchr(ptr,' ')+1;
}
return val;
}
if strchr() does not find ' ' it returns null (0) and ptr becomes 1. while(ptr) would not stop the loop.
while(ptr... should be while(ptr>1...
Hi
I've been Hot wire CNC'ing for a several years now and get quite a lot of feed back on my website https://www.rckeith.co.uk Your GcodeCNCDemo for 4 axis on the RAMPS look very good, but could you use the Arduino Mega without the RAMPS board and plug the TB6560 modules in to it.
I use NEMA23 on my machine with a parallel controller. It look lik a RAMPS board with the A4988 or DRV8825 drivers can't handle the current on my steppers, rated at 2.8Amps.
I've dabbled with Arduino, but not that much. I just retired from work as a Linux System Admin so I'm fairly OK with coding, but perhaps I need to get more into Arduino.
Thanks for nay advice
Keith
Now, I'm troubled with coding the X-Y motion when my project focuses on the kind of Corexy motion please help me to some instruction about it !. Thank you !
Please let me know why is this error, thanks in advance.
Arduino:1.6.6 (Windows 7), Carte : "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
C:\Users\Michael\Documents\Arduino\GcodeCNCDemo-master\GcodeCNCDemo2Axis\GcodeCNCDemo2Axis.ino: In function 'float atan3(float, float)':
GcodeCNCDemo2Axis:119: error: 'float atan3(float, float)' was declared 'extern' and later 'static' [-fpermissive]
static float atan3(float dy,float dx) {
^
GcodeCNCDemo2Axis:41: error: previous declaration of 'float atan3(float, float)' [-fpermissive]
^
C:\Users\Michael\Documents\Arduino\GcodeCNCDemo-master\GcodeCNCDemo2Axis\GcodeCNCDemo2Axis.ino: In function 'void arc(float, float, float, float, float)':
GcodeCNCDemo2Axis:132: error: 'void arc(float, float, float, float, float)' was declared 'extern' and later 'static' [-fpermissive]
static void arc(float cx,float cy,float x,float y,float dir) {
^
GcodeCNCDemo2Axis:42: error: previous declaration of 'void arc(float, float, float, float, float)' [-fpermissive]
^
C:\Users\Michael\Documents\Arduino\GcodeCNCDemo-master\GcodeCNCDemo2Axis\GcodeCNCDemo2Axis.ino: In function 'void where()':
C:\Users\Michael\Documents\Arduino\GcodeCNCDemo-master\GcodeCNCDemo2Axis\GcodeCNCDemo2Axis.ino:206:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
output("X",px);
^
C:\Users\Michael\Documents\Arduino\GcodeCNCDemo-master\GcodeCNCDemo2Axis\GcodeCNCDemo2Axis.ino:207:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
output("Y",py);
^
C:\Users\Michael\Documents\Arduino\GcodeCNCDemo-master\GcodeCNCDemo2Axis\GcodeCNCDemo2Axis.ino:208:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
output("F",fr);
^
exit status 1
'float atan3(float, float)' was declared 'extern' and later 'static' [-fpermissive]
Ce rapport contiendrait plus d'informations si l'option
"Montrer les informations de sortie pendant la compilation"
était activée dans Fichier > Préférences.
Hi. Thank you for your code. I tried GcodeCNCDemo4AxisRAMPS.ino with no problem.
Since ramps1.4 have two extruder. I wanted to use the E0 and E1 as well so that we can have 5axis.
I changed the whole sketch to take E1 as G letter but nothing happened to E1. Motor not moving.
I know the pin number of E1 and I know how to add the 5axis argument as I am a programmer.
I wonder if there is a limitation in the sketch that are unable to active the 5axis?
I am trying to get the 2 axis code to work on an arduino UNO.
Whilst trying to upload/compile the sketch i get the error that a couple of functions are an undefined reference. These are the four references which have "extern void" before them in the conig.h. Error message:
C:\Users\arjan\AppData\Local\Temp\ccA5BIH1.ltrans0.ltrans.o: In function `line(float, float)':
D:\Users\arjan\Documents\Arduino\DR\GcodeCNCDemo-master\GcodeCNCDemo-master\GcodeCNCDemo2Axis/GcodeCNCDemo2Axis.ino:92: undefined reference to `m1step(int)'
D:\Users\arjan\Documents\Arduino\DR\GcodeCNCDemo-master\GcodeCNCDemo-master\GcodeCNCDemo2Axis/GcodeCNCDemo2Axis.ino:96: undefined reference to `m2step(int)'
D:\Users\arjan\Documents\Arduino\DR\GcodeCNCDemo-master\GcodeCNCDemo-master\GcodeCNCDemo2Axis/GcodeCNCDemo2Axis.ino:103: undefined reference to `m2step(int)'
D:\Users\arjan\Documents\Arduino\DR\GcodeCNCDemo-master\GcodeCNCDemo-master\GcodeCNCDemo2Axis/GcodeCNCDemo2Axis.ino:107: undefined reference to `m1step(int)'
C:\Users\arjan\AppData\Local\Temp\ccA5BIH1.ltrans0.ltrans.o: In function `processCommand':
D:\Users\arjan\Documents\Arduino\DR\GcodeCNCDemo-master\GcodeCNCDemo-master\GcodeCNCDemo2Axis/GcodeCNCDemo2Axis.ino:271: undefined reference to `disable()'
collect2.exe: error: ld returned 1 exit status
I have attached a .zip file with the demo code and the config.h I am currently using. The only thing I have changed to the code is the fix for the serialBuffer and parse(N)number, which has been described in another thread.
I hope somebody can help me get this code working.
GcodeCNCDemo2Axis.zip
i get this error on compiling gcodedemo2axis
iso C++ forbids comparison between a point and a integer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.