Welcome! Log In Create A New Profile

Advanced

Testing the electronics?!

Posted by Bonscha 
Testing the electronics?!
December 07, 2014 12:02PM
Hello,

we just tried to test if the electronics and motors are working.

We own the kit from banggood with an atmega2560 with RAMPS1.4 and the motor drivers, attached all of that and connected it to our computer. After installing the official driver, we were able to flash the marlin firmware without problems.
Connection to pronterface seemed to work.
We connected our PSU and one motor and nothing moved. We tried reconnecting the motor the other way round, on other ports and restartet the whole thing several times. Didn't work, either.

What do you need as an absolute minimum to get one motor working on the boards? What configurations have to be made? Do you have to put all electronics together?

Hope for a quick word of enlightenment. smiling smiley
Re: Testing the electronics?!
December 07, 2014 02:15PM
I hope you powered down the RAMPS board before attatching or removing the stepper motors.
Re: Testing the electronics?!
December 07, 2014 02:19PM
Hi,

what do you mean with "power down"? Unplug the PSU connector?

Can you give me a step by step how to check with a single motor if everything is working?
Re: Testing the electronics?!
December 07, 2014 03:01PM
Power Down means to remove all power supplied to Arduino and RAMPS
Turn OFF motor power, unplug USB (USB provides 5V to power Mega.

Here is link to RAMPS wiring

[reprap.org]

you don't need all motors connected, make sure motor connected has driver plugged in socket.

DO NOT diddle connect/disconnect wiggle wires when POWERED -- good chance of damaging stepper motor driver.

Here is test code for RAMPS

[reprap.org]

confused smiley
Re: Testing the electronics?!
December 07, 2014 03:04PM
So it really should work just connecting a single motor to the boards and run this with flashed test code?

Well, we fried the atmega2560 (doesn't connect anymore via USB ), the new one will be there in 2 days. On the plus side, we seem to have one excess driver and two RAMPS boards, so chances are we have backup when needed.

Edited 2 time(s). Last edit at 12/08/2014 07:01AM by Bonscha.
Re: Testing the electronics?!
December 08, 2014 02:31PM
How do you know you fried the AtMega?

Have you tried the blink or fade sketch? with RAMPs removed
Checked drivers?

You may have to redo bootloader

[arduino.cc]

confused smiley
Re: Testing the electronics?!
December 08, 2014 04:04PM
It does not connect via USB anymore.
I cannot flash another bootloader because it doesn't get recognized, also doesn't show any indication that it is working.
Re: Testing the electronics?!
December 08, 2014 05:21PM
Did you connect any electronics while the power was on it? Like pulling out stepper motor cable while the electronics were on and the PSU was delivering power?

Things like this will fry your board most of the time. Always turn off everything before changing any cables.

Did any of this happen?


http://www.marinusdebeer.nl/
Re: Testing the electronics?!
December 09, 2014 06:52AM
We had a not-so-well made plug which did wiggle a lot, so yeah, probably the motor has disconnected while powered.
Re: Testing the electronics?!
December 09, 2014 02:56PM
Hello again.

The second ATmega2560 came today, and we tried again!

ATmega2560 is okay, connects via USB and is flashable.
I connected it, waited for the drivers to install, then flashed it (using the most recent arduino software) with the RAMPSTestCode.pde.

We have two RAMPS1.4 shields. One of it has a missing LED (the corner red one), which is why we have gotten a free second one. We mounted the second one (the undamaged) on top of the ATmega2560, plugged all 5 drivers onto it (the one we have used for our last test, which may be faulty, plugget to EXTRUDER1, where it isn't used).

Everything blinks and works fine, we can connect PC and flash it. So we disconnected the power and USB again. Then we connected the motor to the X axis controller pins. Power up again, nothing happens.
We changed the pin setting (180° turn of the plug), of course after completely powering it off, but that didn't work either.

Maybe we made a mistake to this point. It gets pretty frustrating, but maybe we missed a point... Any ideas?

By the way, does the flashing LEDs on the RAMPS board tell us anything, or is it just a pretty light show? They blink when test code is flashed, but don't with flashed Marlin firmware.
Re: Testing the electronics?!
December 09, 2014 04:22PM
Not sure what happens, but I would suggest not installing the stepper drivers you're not using.


http://www.marinusdebeer.nl/
Re: Testing the electronics?!
December 09, 2014 04:31PM
Didn't help, either... blinking like a fire truck, but no movement of the motor...

I will post a video so you can look for possibnle mistakes I make while connecting etc...

How can we troubleshoot if drivers or motors are faulty? (Tried on 2 motors and both didn't work).
Re: Testing the electronics?!
December 10, 2014 01:52AM
Here's a video, maybe you see if we do something wrong.
[www.youtube.com]
Re: Testing the electronics?!
December 10, 2014 03:27AM
Quote
Bonscha
Here's a video, maybe you see if we do something wrong.
[www.youtube.com]

First off you have no endstops connected this will inhibit the motors if they are triggered with it all connected as you had it send the ramps a M119 commend to get the states of your endstops and report back?
Re: Testing the electronics?!
December 10, 2014 01:16PM
I just flahed the following test code and tried again in the shown setup (x-axis driver and motor only):

#define X_STEP_PIN         54
#define X_DIR_PIN          55
#define X_ENABLE_PIN       38
#define X_MIN_PIN           3
#define X_MAX_PIN           2

void setup() {
  pinMode(X_STEP_PIN  , OUTPUT);
  pinMode(X_DIR_PIN    , OUTPUT);
  pinMode(X_ENABLE_PIN    , OUTPUT);

   digitalWrite(X_ENABLE_PIN    , LOW);
}

void loop () {
    digitalWrite(X_STEP_PIN    , HIGH);
}

Nothing happened...

What do you suggest doing?
How do I send the M119 command (which application) and what must be flashed for this (Marlin, Testcode...)`?
Vjk
Re: Testing the electronics?!
December 11, 2014 01:07AM
What CAM software are you using? I currently am using Repetier-Host and there is a terminal view that shows what the printer is doing. Error messages, updates, and G-Code are shown here as the machine experiences them. RH also has a custom G-Code entry ability so you can enter the code manually.

This would be a good way to check to see if your endstops are engaged (like dougal1957 suggested)

Another thing to possibly check would be the baud rate. I don't know how much help this would be as it seems like you are not using a computer directly, but I have experienced issues on other equipment because of the wrong baud rate.

If all of the above doesnt help, break out the multimeter and check the voltage and resistance of the stepper drivers and motors. The data sheet for the specific units can be found via a quick google search.

Good Luck!
Re: Testing the electronics?!
December 11, 2014 02:12AM
void loop () {
digitalWrite(X_STEP_PIN , HIGH);
}

this will not work...

the step pin needs a low sometimes, this sets it high, then sets it high again, over and over. It never goes low.
Re: Testing the electronics?!
December 11, 2014 12:12PM
In the video the Atmega appears to have the "Blink" code installed
(the blinking LED)
So RAMPS test code NOT loaded.

In the latest Arduino IDE
the right board and com port selection
Select correct file,
compile and upload the right code with no errors


Other tests
To prove Atmega can be loaded
Remove RAMPS
load fade code --- see if LED fades in out
load blink code --- see if LED blinks

If not -- got a load problem

confused smiley
Re: Testing the electronics?!
December 13, 2014 07:16PM
We have tried to troubleshoot the whole thing today.

It has taken us from 6 pm to 1 am and we didn't get it working, but we have acquired some potentially helpful information.

First, we have had a board with no jumpers preinstaled whatsoever. The faulty board had all jumpers set under the drivers, also the jumper next to the reset button.

Second, we had trouble connecting the whole electronics to the PC, the PC wouldn't recognize it or disconnect it asap.
We found out we had only one driver installed with which it would work (on any driver position). If any of the four other drivers would be plugged on, it wouldn't connect.
Up to this point we had the drivers installed poti facing the PSU connectors, until we dicovered the pins actually are labelled and it should be the other way around (poti away crom PSU connectors). As soon as we turned them, the behaviour changed, and the "faulty" four drivers would work. The one other won't.
Then, the jumpers cane into play and as we jumpered to 1/16 micro stepping (all three), the drivers would connect the other way around or the faulty ones would work if they didn't. I have to retry all of this behaviour, but jumpers definately had an effect in some way...

Can someone please just tell us step by step how to plug/setup/wire all the electronics with the minimum of components to JUST TEST IF THE MOTORS WORK?
We tried pratically every possible configuration and nothing worked.
Also, we didn't have the luck finding data sheets or info about our drivers to measure if these are faulty. We could need info about this, too. We are running out of time until final assembly date, and we really need a hint on how to troubleshoot efficiently.
Most of what has been said lacks basic instructions or requires things working that don't work for us.

I hope someone cal help us out and just tell us for what he would look if he would have to troubleshoot this pile of junk... Thanks in advance and have a nice weekend smiling smiley


edit:
By the way, we do get valid temp measurements and connection to pronterface is possible. And no, blink wasn't flashed in the video, it was the test code which cycles all LEDs.

Edited 2 time(s). Last edit at 12/13/2014 07:17PM by Bonscha.
Re: Testing the electronics?!
December 14, 2014 06:19AM
I have tested the electronics like we did last night, and have photographed and noted the setup and results.

First of all, here is a pic showing our motor connector. It has been shipped that way, so I assume on motor side, the connection is okay. Also you can see the circuit diagram of the motor. How are we supposed to connect the motor to the board? I mean, which color on which pin?
motor_diagram.jpg

Then I made a pic of our driver bays and drivers. It seems the marked pins have to be plugged together, right? We did it the other way around before noticing yesterday.
driver_positioning.jpg

Now, I have also made a pic of the blan board. Where do we have to do something (e.g. setting jumpers)?
blank_board.jpg


Okay, now let's get into my test runs.
The ATmega2560 has been flashed with the RAMPSTestCode.pde.
On the upper part, all three endstops and the two temperature sensors are connected. Should be the correct way, right?
On the lower part, we have power input from a 300W 12V PSU and USB connection. USB gets disconnected from the board, PSU from the wall socket.
In the middle, I vary the driver/jumper setup and only connect motor plugs where a driver is installed.
The one driver with the black mark is the one working (or to put it this way, the one that behaves other than the rest or them).

Here are the results:

PIC 1:
- All jumpers set on all driver bays.
- Fails to connect via USB.

PIC 2:
- All jumpers set on all driver bays.
- Fails to connect via USB.

PIC 3:
- All jumpers set on all driver bays.
- USB connection established (indicated by Windows sound and board behaviour).
- PSU connected.
--> Test cycle LED flashing, no moving motors.
--> Disconnects after around 30-60 seconds, doesn't connect again.
--> Driver pretty hot after these 60 seconds.

PIC 4:
- No jumpers set on any driver bay.
- USB connection established (indicated by Windows sound and board behaviour).
- PSU connected.
--> Test cycle LED flashing, no moving motors.
--> Driver slightly warm after 2-3 minutes, no disconnect. Disconnecting manually.

PIC 5:
- No jumpers set on any driver bay.
- USB connection established (indicated by Windows sound and board behaviour).
- PSU connected.
--> Test cycle LED flashing, no moving motors.
--> Driver slightly warm after 2-3 minutes, no disconnect. Disconnecting manually.

PIC 6:
- Only driver has all three jumpers set.
- USB connection established (indicated by Windows sound and board behaviour).
- PSU connected.
--> Test cycle LED flashing, no moving motors.
--> Driver slightly warm after 2-3 minutes, no disconnect. Disconnecting manually.

PIC 7:
- Only driver has all three jumpers set.
- USB connection established, then disconnects and automatically reconnects. Disconnects again, then doesn't connect again, even if manually re-plugged.
--> While trying to get it connected by plugging USB out and in again, sometimes the Windows sound comes on and the LED blinks, but goeas out after 1-2 seconds.
--> Driver gets feelable warm after around 60 seconds. PSU wasn't connected.

PIC 8:
- Only driver has all three jumpers set.
- USB connection established, then disconnects.
--> Connection fault can be reproduced by re-plugging USB.
--> Driver gets feelable warm after around 60 seconds. PSU wasn't connected.

Edited 2 time(s). Last edit at 12/14/2014 06:25AM by Bonscha.
Re: Testing the electronics?!
December 15, 2014 01:42PM
You are trying to sprint before you can crawl!!!

To prove Atmega can be loaded
Remove RAMPS

Load the arduino IDE 106 and drivers on PC

plug in usb to Atmega
Check devices on PC determine COM port arduino is ON
In Arduino IDE select proper COM port and Board type

Compile and load fade code (from examples)--- see if LED fades in out
Compile and load blink code (from examples)--- see if LED blinks

If not -- got a bootload problem
see:
[learn.sparkfun.com]

if blink and fade sketches work -- ATmega board is OK

Then we can move on to installing RAMPS

confused smiley
Re: Testing the electronics?!
December 15, 2014 01:51PM
I have flashed blink, then the test code, then blink again, in some variations. If blink is flashed, the LED blinks. If another code is flashed, it blinks not or in another interval.
We have working led test cycle when test code is flahed, and we can only connect to pronterface (but are able to connect, we have the right measurements for temps), if marlin is flashed.

This proves that flashing and mega2560 is okay.

Btw, I didn't use blink-fade-blink, because fade requires an external LED on a PWM port, which I do not have at hands!

edit: Please note that we have another, working board after we fried the first. So please forget reviving the old one. We will try when we have time. smiling smiley

Edited 1 time(s). Last edit at 12/15/2014 01:55PM by Bonscha.
Re: Testing the electronics?!
December 15, 2014 02:50PM
When you compile and upload a sketch are any errors shown?

there is a built in LED on pin 13 on most arduinos
If not install LED pin 13 and grnd.

No you may NOT have a loadable arduino

If you load "Fade" and the LED doesn't fade OFF / ON
you haven't loaded a new sketch

Blink is still there in ATmega and you have a load problem

You must SUCCESSFULLY compile and upload a different code to test the ATmega

Are you on skype? We could connect up and I can talk to you.

I am dinkyblink in my lab (my Basement)

confused smiley
Re: Testing the electronics?!
December 16, 2014 02:12PM
From
[reprap.org]

Warnings
Reversing +/- or otherwise incorrectly connecting power can destroy your electronics and cause fire hazard.

Incorrectly inserting stepper drivers will destroy your electronics and cause a fire risk. Always make sure power and USB is disconnected when removing or adjusting stepper drivers. Always make sure to insert drivers in correct orientation and in the socket correctly.

The endstop pins are Signal - GND - VCC, instead of the VCC - Sig - GND like the rest of RepRaps boards. Make sure to wire them correctly. This is done to allow squeezing fatter traces on the printable board.

DON'T secure Arduino/RAMPS with conductive screws through both mounting holes. The screw may cut into the positive trace creating a HIGH current short.


Be sure that the power can output 5A or greater.

See:
[forums.reprap.org]

confused smiley
Re: Testing the electronics?!
December 16, 2014 03:13PM
We just received the second set of motor drivers and did a quick test.

It took us around and about an hour to get better results. We managed to get the motors to turn in a random pattern, quickly back and forth, but not constitently, more like uncontrolled.
After we called it a day, I just made some minor adjustments.

The problem was the pin order of the motor!
We used JK42HS40-1704-13A motors from Banggood.
These motors have the following pin order on the motor plug: BLACK - NONE - RED - GREEN - NONE - BLUE
We had to switch the order to the following on the RAMPS-side plug: BLACK [1B] - GREEN [1A] - RED [2A] - BLUE [2B]
Et voilà, the motor responded correctly to the RAMPS test code (left and right turns) and worked fine on every axis with the new drivers.

Seems like we have killed the old ones plugging them onto the board the wrong way around... the motors wouln't work with these.

At this point I'd like to thank cozmicray for his time and involvement in the skype troubleshooting session last night. I don't think we would have found the error that quick now, and without killing the next set of drivers. Thanks, man! Now we can go ahead building the whole thing. All that's left is looking up the configuration for the Marlin firmware. smiling smiley

Edited 1 time(s). Last edit at 12/16/2014 03:44PM by Bonscha.
Re: Testing the electronics?!
December 16, 2014 05:02PM
Look at Repetier Firmware

Lots of good documentation

[www.repetier.com]

they also have a configuration program

[www.repetier.com]

and
Repetier Host on PC/Mac to control it

winking smiley
Sorry, only registered users may post in this forum.

Click here to login