Arduino Mega problem.

134 views
Skip to first unread message

Buddhafragt

unread,
Mar 6, 2011, 11:06:49 AM3/6/11
to rstep
Hello all,

I try to get rstep running on a Arduino Mega, but have no sucess..
Here is my config:

//my config
#define ENABLE 13 //low enabled
#define MS1 0
#define MS2 0
#define RST 0
#define SLP 0
#define STEP_X 12
#define STEP_Y 10
#define STEP_Z 8
#define DIR_X 11
#define DIR_Y 9
#define DIR_Z 7
#define MOTOR_PIN 0


#define SCK 0
#define MOSI 0
#define MISO 0
#define SS 0
#define MSP4351_CS 0


/* specify the port and pin numbers - you need to look this up
** on the schematic for the particular arduino */
#define _STEP_PORT PORTB
#define _STEP_DDR DDRB // DDB = IO Resister Atmega
#define _STEP_X (1<<6) // definition Port B6
#define _STEP_Y (1<<4) // definition Port B4
#define _STEP_Z (1<<2) // definition Port B2


// specify min-max sense pins or 0 if not used
// active low is prefered as it will cause the AVR to use it's
internal pullups to
// avoid bounce on the line. If you want active_high, then you must
add external pulldowns
// to avoid false signals.
#define MINMAX_X 0
#define MINMAX_Y 0
#define MINMAX_Z 0
#define ESTOP 0

Is something wrong here?

greetings
Buddhafragt

NULL

unread,
Mar 6, 2011, 8:28:23 PM3/6/11
to rstep
i think it is this
#define MS1 4
#define MS2 2
#define RST 3
#define SLP 3
insted of this
#define MS1 0
#define MS2 0
#define RST 0
#define SLP 0

Buddhafragt

unread,
Mar 7, 2011, 11:47:17 AM3/7/11
to rstep
Thank you,

but still not working...
I can hear only a buzz at one stepper motor, if I test the output with
a scope, I see only uneven peaks!
What is it??

greetings
Buddhafragt

Reza Naima

unread,
Mar 7, 2011, 1:06:15 PM3/7/11
to rs...@googlegroups.com
What controller are you using?  I think you might have your stepper motor hooked up incorrectly if it's buzzing. -r



Buddhafragt
Monday, March 07, 2011 8:47 AM

Thank you,

but still not working...
I can hear only a buzz at one stepper motor, if I test the output with
a scope, I see only uneven peaks!
What is it??

greetings
Buddhafragt




NULL
Sunday, March 06, 2011 5:28 PM

i think it is this
#define MS1 4
#define MS2 2
#define RST 3
#define SLP 3
insted of this
#define MS1 0
#define MS2 0
#define RST 0
#define SLP 0



Buddhafragt
Sunday, March 06, 2011 8:06 AM

Buddhafragt

unread,
Mar 8, 2011, 2:40:07 AM3/8/11
to rstep
Controller??
Arduino Mega2560!
Thge steppers hooked up correctly, with a other software it works....
so the hardware is OK!





On 7 Mrz., 19:06, Reza Naima <r...@reza.net> wrote:
> What controller are you using?  I think you might have your stepper
> motor hooked up incorrectly if it's buzzing. -r
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>
> > Monday, March 07, 2011 8:47 AM
>
> > Thank you,
>
> > but still not working...
> > I can hear only a buzz at one stepper motor, if I test the output with
> > a scope, I see only uneven peaks!
> > What is it??
>
> > greetings
> > Buddhafragt
>
> > ------------------------------------------------------------------------
>
> >    NULL <mailto:bigbodysmallbr...@gmail.com>
> > Sunday, March 06, 2011 5:28 PM
>
> > i think it is this
> > #define MS1 4
> > #define MS2 2
> > #define RST 3
> > #define SLP 3
> > insted of this
> > #define MS1 0
> > #define MS2 0
> > #define RST 0
> > #define SLP 0
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>

Andrew D.Mathison

unread,
Mar 8, 2011, 7:27:20 AM3/8/11
to rs...@googlegroups.com
Just because another software runs correctly, does not mean that the motor
is corrected properly!

You appear to have forgotten that a different software may use different
port pins for different jobs.......

You just need to change the pin setup to reflect the way the motors are
connected, this is usually done in the software, but may need to be done in
hardware........

Using the infos from the software that is running correctly will surely get
you on the right road!

Regards

Andy

Reza Naima

unread,
Mar 8, 2011, 10:07:25 PM3/8/11
to rs...@googlegroups.com
By controller, I mean what hardware is the arduino connected to?  And what software works correctly?  Can you provide me with more information about the other software that works correctly and the configuration you are using?

reza



Buddhafragt
March 7, 2011 11:40 PM

Controller??
Arduino Mega2560!
Thge steppers hooked up correctly, with a other software it works....
so the hardware is OK!







Reza Naima
March 7, 2011 10:06 AM

What controller are you using?  I think you might have your stepper motor hooked up incorrectly if it's buzzing. -r



Buddhafragt
March 7, 2011 8:47 AM

Thank you,

but still not working...
I can hear only a buzz at one stepper motor, if I test the output with
a scope, I see only uneven peaks!
What is it??

greetings
Buddhafragt




NULL
March 6, 2011 5:28 PM

i think it is this
#define MS1 4
#define MS2 2
#define RST 3
#define SLP 3
insted of this
#define MS1 0
#define MS2 0
#define RST 0
#define SLP 0



Buddhafragt
March 6, 2011 8:06 AM

Buddhafragt

unread,
Mar 9, 2011, 5:10:09 AM3/9/11
to rstep
Dear,

before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs"
http://forums.reprap.org/file.php?156,file=3396,filename=reprap_new_firmware_arc.zip,download=1
So I know, the stepper motors and drivers connected correctly.
(of shure, I dont know if the pins configured correctly, this was the
reason, I asked for help).
I use the Pololu drivers A4983, connected to:
STEP_X 12
STEP_Y 10
STEP_Z 8
DIR_X 11
DIR_Y 9
DIR_Z 7
Maybe there are some other setups except the part I send above?

regards
Buddhafragt



On 9 Mrz., 04:07, Reza Naima <r...@reza.net> wrote:
> By controller, I mean what hardware is the arduino connected to?  And
> what software works correctly?  Can you provide me with more information
> about the other software that works correctly and the configuration you
> are using?
>
> reza
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>
> > March 7, 2011 11:40 PM
>
> > Controller??
> > Arduino Mega2560!
> > Thge steppers hooked up correctly, with a other software it works....
> > so the hardware is OK!
>
> > ------------------------------------------------------------------------
>
> >    Reza Naima <mailto:r...@reza.net>
> > March 7, 2011 10:06 AM
>
> > What controller are you using?  I think you might have your stepper
> > motor hooked up incorrectly if it's buzzing. -r
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>
> > March 7, 2011 8:47 AM
>
> > Thank you,
>
> > but still not working...
> > I can hear only a buzz at one stepper motor, if I test the output with
> > a scope, I see only uneven peaks!
> > What is it??
>
> > greetings
> > Buddhafragt
>
> > ------------------------------------------------------------------------
>
> >    NULL <mailto:bigbodysmallbr...@gmail.com>
> > March 6, 2011 5:28 PM
>
> > i think it is this
> > #define MS1 4
> > #define MS2 2
> > #define RST 3
> > #define SLP 3
> > insted of this
> > #define MS1 0
> > #define MS2 0
> > #define RST 0
> > #define SLP 0
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>

Reza Naima

unread,
Mar 9, 2011, 5:59:11 AM3/9/11
to rs...@googlegroups.com
What is your configuration? Can you send me the output of the command M201.

-Reza

Buddhafragt <zi...@el-licht.de> wrote:
Dear, before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs" http://forums.reprap.org/file.php?156,file=3396,filename=reprap_new_firmware_arc.zip,download=1 So I know, the stepper motors and drivers connected correctly. (of shure, I dont know if the pins configured correctly, this was the reason, I asked for help). I use the Pololu drivers A4983, connected to: STEP_X 12 STEP_Y 10 STEP_Z 8 DIR_X 11 DIR_Y 9 DIR_Z 7 Maybe there are some other setups except the part I send above? regards Buddhafragt On 9 Mrz., 04:07, Reza Naima <r...@reza.net> wrote: > By controller, I mean what hardware is the arduino connected to?  And > what software works correctly?  Can you provide me with more information > about the other software that works correctly and the configuration you > are using? > > reza > > >
> > >    Buddhafragt <mailto:zi...@el-licht.de> > > March 7, 2011 11:40 PM > > > Controller?? > > Arduino Mega2560! > > Thge steppers hooked up correctly, with a other software it works.... > > so the hardware is OK! > > >
> > >    Reza Naima <mailto:r...@reza.net> > > March 7, 2011 10:06 AM > > > What controller are you using?  I think you might have your stepper > > motor hooked up incorrectly if it's buzzing. -r > > >
> > >    Buddhafragt <mailto:zi...@el-licht.de> > > March 7, 2011 8:47 AM > > > Thank you, > > > but still not working... > > I can hear only a buzz at one stepper motor, if I test the output with > > a scope, I see only uneven peaks! > > What is it?? > > > greetings > > Buddhafragt > > >
> > >    NULL <mailto:bigbodysmallbr...@gmail.com> > > March 6, 2011 5:28 PM > > > i think it is this > > #define MS1 4 > > #define MS2 2 > > #define RST 3 > > #define SLP 3 > > insted of this > > #define MS1 0 > > #define MS2 0 > > #define RST 0 > > #define SLP 0 > > >

Buddhafragt

unread,
Mar 9, 2011, 12:52:34 PM3/9/11
to rstep
Hi Reza,

here is the M201 command :

MSG SBI(4181,654,41984)
MSG MFR(160,160,208)
MSG Cur(2.44,3.23,2.47)
MSG Step(255)
MSG Abs(64)
OK


regards
Buddhafragt

On 9 Mrz., 11:59, Reza Naima <r...@reza.net> wrote:
> What is your configuration? Can you send me the output of the command M201.
>
> -Reza
>
> Buddhafragt <zi...@el-licht.de> wrote:
>
> Dear, before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs"http://forums.reprap.org/file.php?156,file=3396,filename=reprap_new_f...So I know, the stepper motors and drivers connected correctly. (of shure, I dont know if the pins configured correctly, this was the reason, I asked for help). I use the Pololu drivers A4983, connected to: STEP_X 12 STEP_Y 10 STEP_Z 8 DIR_X 11 DIR_Y 9 DIR_Z 7 Maybe there are some other setups except the part I send above? regards Buddhafragt On 9 Mrz., 04:07, Reza Naima <r...@reza.net> wrote: > By controller, I mean what hardware is the arduino connected to?  And > what software works correctly?  Can you provide me with more information > about the other software that works correctly and the configuration you > are using? > > reza > > >_____________________________________________> > >    Buddhafragt <mailto:zi...@el-licht.de> > > March 7, 2011 11:40 PM > > > Controller?? > > Arduino Mega2560! > > Thge steppers hooked up correctly, with a other software it works.... > > so the hardware is OK! > > >_____________________________________________
> > > >    Reza Naima <mailto:r...@reza.net> > > March 7, 2011 10:06 AM > > > What controller are you using?  I think you might have your stepper > > motor hooked up incorrectly if it's buzzing. -r > > >_____________________________________________
> > > >    Buddhafragt <mailto:zi...@el-licht.de> > > March 7, 2011 8:47 AM > > > Thank you, > > > but still not working... > > I can hear only a buzz at one stepper motor, if I test the output with > > a scope, I see only uneven peaks! > > What is it?? > > > greetings > > Buddhafragt > > >_____________________________________________
> > > >    NULL <mailto:bigbodysmallbr...@gmail.com> > > March 6, 2011 5:28 PM > > > i think it is this > > #define MS1 4 > > #define MS2 2 > > #define RST 3 > > #define SLP 3 > > insted of this > > #define MS1 0 > > #define MS2 0 > > #define RST 0 > > #define SLP 0 > > >_____________________________________________

Buddhafragt

unread,
Mar 9, 2011, 12:52:42 PM3/9/11
to rstep
Hi Reza,

here is the M201 command :

MSG SBI(4181,654,41984)
MSG MFR(160,160,208)
MSG Cur(2.44,3.23,2.47)
MSG Step(255)
MSG Abs(64)
OK


regards
Buddhafragt

On 9 Mrz., 11:59, Reza Naima <r...@reza.net> wrote:
> What is your configuration? Can you send me the output of the command M201.
>
> -Reza
>
> Buddhafragt <zi...@el-licht.de> wrote:
>
> Dear, before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs"http://forums.reprap.org/file.php?156,file=3396,filename=reprap_new_f...So I know, the stepper motors and drivers connected correctly. (of shure, I dont know if the pins configured correctly, this was the reason, I asked for help). I use the Pololu drivers A4983, connected to: STEP_X 12 STEP_Y 10 STEP_Z 8 DIR_X 11 DIR_Y 9 DIR_Z 7 Maybe there are some other setups except the part I send above? regards Buddhafragt On 9 Mrz., 04:07, Reza Naima <r...@reza.net> wrote: > By controller, I mean what hardware is the arduino connected to?  And > what software works correctly?  Can you provide me with more information > about the other software that works correctly and the configuration you > are using? > > reza > > >_____________________________________________> > >    Buddhafragt <mailto:zi...@el-licht.de> > > March 7, 2011 11:40 PM > > > Controller?? > > Arduino Mega2560! > > Thge steppers hooked up correctly, with a other software it works.... > > so the hardware is OK! > > >_____________________________________________
> > > >    Reza Naima <mailto:r...@reza.net> > > March 7, 2011 10:06 AM > > > What controller are you using?  I think you might have your stepper > > motor hooked up incorrectly if it's buzzing. -r > > >_____________________________________________
> > > >    Buddhafragt <mailto:zi...@el-licht.de> > > March 7, 2011 8:47 AM > > > Thank you, > > > but still not working... > > I can hear only a buzz at one stepper motor, if I test the output with > > a scope, I see only uneven peaks! > > What is it?? > > > greetings > > Buddhafragt > > >_____________________________________________
> > > >    NULL <mailto:bigbodysmallbr...@gmail.com> > > March 6, 2011 5:28 PM > > > i think it is this > > #define MS1 4 > > #define MS2 2 > > #define RST 3 > > #define SLP 3 > > insted of this > > #define MS1 0 > > #define MS2 0 > > #define RST 0 > > #define SLP 0 > > >_____________________________________________

Reza Naima

unread,
Mar 9, 2011, 3:27:05 PM3/9/11
to rs...@googlegroups.com
that all looks corrupted to me.  Some of those values are not possible.  i would try reconfiguring it.

http://reza.net/wiki/index.php?title=Installation_Instructions

This is the output of mine

MSG SBI(4064,4064,4064)
MSG MFR(15,15,13)
MSG Cur(1.50,1.50,1.50)
MSG Step(16)
MSG Abs(1)
OK


Your main problem is probably the maximum feedrate.  It's defined as inches per minute.   You have it set to travel 3+ inches per second! That's why you are getting the buzzing.  Also the ABS should be 1 or 0.  Step can be 1,2,4,16.  And Cur is a max of 2.0.  I'm not sure how your configuration passed the checksum test.


Reza






Buddhafragt
Wednesday, March 09, 2011 9:52 AM

Hi Reza,

here is the M201 command :

MSG SBI(4181,654,41984)
MSG MFR(160,160,208)
MSG Cur(2.44,3.23,2.47)
MSG Step(255)
MSG Abs(64)
OK


regards
Buddhafragt



Buddhafragt
Wednesday, March 09, 2011 2:10 AM

Dear,

before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs"

Buddhafragt

unread,
Mar 10, 2011, 9:41:52 AM3/10/11
to rstep
Hi Reza,

jupp... now it works! ;-)

One more question: The stepper motor speed is different depends if 1,2
or 3 axis mooving (1 fast, 3 slowest speed).
Is it normal?

Michael


On 9 Mrz., 21:27, Reza Naima <r...@reza.net> wrote:
> that all looks corrupted to me.  Some of those values are not possible.  
> i would try reconfiguring it.
>
> http://reza.net/wiki/index.php?title=Installation_Instructions
>
> This is the output of mine
>
> MSG SBI(4064,4064,4064)
> MSG MFR(15,15,13)
> MSG Cur(1.50,1.50,1.50)
> MSG Step(16)
> MSG Abs(1)
> OK
>
> Your main problem is probably the maximum feedrate.  It's defined as
> inches per minute.   You have it set to travel 3+ inches per second!
> That's why you are getting the buzzing.  Also the ABS should be 1 or 0.  
> Step can be 1,2,4,16.  And Cur is a max of 2.0.  I'm not sure how your
> configuration passed the checksum test.
>
> Reza
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>
> > Wednesday, March 09, 2011 9:52 AM
>
> > Hi Reza,
>
> > here is the M201 command :
>
> > MSG SBI(4181,654,41984)
> > MSG MFR(160,160,208)
> > MSG Cur(2.44,3.23,2.47)
> > MSG Step(255)
> > MSG Abs(64)
> > OK
>
> > regards
> > Buddhafragt
>
> > ------------------------------------------------------------------------
>
> >    Buddhafragt <mailto:zi...@el-licht.de>
> > Wednesday, March 09, 2011 2:10 AM
>
> > Dear,
>
> > before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs"
> >http://forums.reprap.org/file.php?156,file=3396,filename=reprap_new_f...
Message has been deleted

Buddhafragt

unread,
Mar 10, 2011, 3:35:58 PM3/10/11
to rstep
One more question,
I see G2 and G3 is not supported (commented out in code), but in the
Commands Supported list G2 and G3 is on the list.....

Reza Naima

unread,
Mar 10, 2011, 4:04:07 PM3/10/11
to rs...@googlegroups.com
Use the 644 version of the code. The sections were commented out due to not enough space on the 168

-Reza

Reza Naima

unread,
Mar 10, 2011, 4:38:14 PM3/10/11
to rs...@googlegroups.com
The speed is determined by your feedrate (either the one you specify or based on the max feedrate per axis).  If two motors are moving, then they need to move slower to maintain the same feedrate.  

Reza


Buddhafragt
Thursday, March 10, 2011 6:41 AM

Hi Reza,

jupp... now it works! ;-)

One more question: The stepper motor speed is different depends if 1,2
or 3 axis mooving (1 fast, 3 slowest speed).
Is it normal?

Michael



Wednesday, March 09, 2011 9:52 AM

Hi Reza,

here is the M201 command :

MSG SBI(4181,654,41984)
MSG MFR(160,160,208)
MSG Cur(2.44,3.23,2.47)
MSG Step(255)
MSG Abs(64)
OK


regards
Buddhafragt


Wednesday, March 09, 2011 2:10 AM
Dear,

before I run the "CNC Mill G-Code Interpreter With XY, XZ, & YZ Arcs"
Reply all
Reply to author
Forward
0 new messages