copy sketch from arduino to arduino

Hey guys,

@my work we use arduino's in our 3D printers for moving our axes. Now 2 of our printers are showing problems thanks to the arduino. We have to reset it after every start of the build. We now want to upload the sketch from these "non functional" ones towards a "functional" arduino to see if it's the arduino itself thats broken or not. Any way's to do this?

I myself have NO experience with arduino but am eager to learn.

Arduino is DIY. Who Did It for You? He has the source code.

Juraj:
Arduino id DIY.

? ? ?

@jokke3D, it is not possible to transfer a program from one Arduino board direct to another.

If you are sufficiently expert you may be able to download the program HEX code from an Arduino to your PC and then upload the same HEX code to another Arduino. But that assumes that every single thing about the new Arduino is identical to the previous one.

The best thing to do is to upload the program from the source code.

If the problem Arduino can drive the printer properly for a complete print then I doubt if there is a problem with the Arduino. Can you describe in more detail how the problem has evolved. Has anything been changed? even the smallest thing?

...R

jokke3D:
2 of our printers are showing problems thanks to the arduino. …

ok

… to see if it’s the arduino itself thats broken or not.

I thought that the failure was determined in step #1 ?

in the real world, things happen for a reason.
if the unit is shutting off, there may be a bad end-switch or the emergency override may be faulty.
maybe the units have been powered for more than 45 days and the timing is messing with the internal clock ?

if the fault is with any external devices, swapping out one arduino for another would only duplicate the failure.

Juraj:
Arduino is DIY. Who Did It for You? He has the source code.

Well the guy before me is not working here anymore and left us no data.

Robin2:
? ? ?

@jokke3D, it is not possible to transfer a program from one Arduino board direct to another.

If you are sufficiently expert you may be able to download the program HEX code from an Arduino to your PC and then upload the same HEX code to another Arduino. But that assumes that every single thing about the new Arduino is identical to the previous one.

The best thing to do is to upload the program from the source code.

If the problem Arduino can drive the printer properly for a complete print then I doubt if there is a problem with the Arduino. Can you describe in more detail how the problem has evolved. Has anything been changed? even the smallest thing?

...R

well the main problem is that after avery print the arduino doesn't know his axes positions anymore so we have to reset it and home the axes again. My intuition would be that the pulses from the stepper motors are maybe pulsing too fast for the arduino to folow?

they are still the old MEGA 2560 8AU board. could it be by changing them to an 16AU board would "solve" the problem.
the stepper isn't directly onto the arduino though.

dave-in-nj:
ok

I thought that the failure was determined in step #1 ?

in the real world, things happen for a reason.
if the unit is shutting off, there may be a bad end-switch or the emergency override may be faulty.
maybe the units have been powered for more than 45 days and the timing is messing with the internal clock ?

if the fault is with any external devices, swapping out one arduino for another would only duplicate the failure.

hey yeah my bad i just asumed (shouldn't do that).

seeing you're talking about powered on more then 45 days... wel they actually stay on constantly. some even for a year already. and yeah that is why we want to swap the arduino to see if it is external seeing these parts are more expensive and we already have a few boards in stock. the unit stay's on though loses his axes positions during builds (i got a bit deeper into it and just found this out).

jokke3D:
Well the guy before me is not working here anymore and left us no data.

That's a tough lesson for your managers to learn - but, next time make sure you get the source code while the job is being developed so it is always possible to salvage the situation if someone leaves or gets ill or injured. What's happened to you is the equivalent of forgetting to back-up your hard disk.

well the main problem is that after avery print the arduino doesn't know his axes positions anymore so we have to reset it and home the axes again. My intuition would be that the pulses from the stepper motors are maybe pulsing too fast for the arduino to folow?

IMHO that is not a reasonable conclusion. If the 3D print was completed properly then the Arduino was at ALL times perfectly in sync with the positions of the motors. And an Arduino can "think" 1000 times faster than the pulses for a motor. The only way it would be out of sync would be if the motor was missing steps and then the 3D print would be all wrong.

Based on what you have said I reckon the problem is outside the Arduino.

Have you changed anything about the system? - For example a new version of the program that controls the printing process. You have not told us how that is done. I would expect your control software to demand a re-home before every new print. Maybe that is not now happening?

My wild guess is that something is causing the Arduinos to reset when they are NOT at the home position which causes them to think they are at the home position - hence your need to make them go through the homing process.

Going back to the business of the missing source code. Maybe the Arduinos are loaded with one of the common 3D printer programs such as Marlin or Repetier. If so you can just download the source code from the internet. HOWEVER I am not suggesting this as a remedy for the problem. Do NOT try to change the code on the Arduinos until you are sure that is where the problem lies.

...R

Robin2:
That's a tough lesson for your managers to learn - but, next time make sure you get the source code while the job is being developed so it is always possible to salvage the situation if someone leaves or gets ill or injured. What's happened to you is the equivalent of forgetting to back-up your hard disk.

IMHO that is not a reasonable conclusion. If the 3D print was completed properly then the Arduino was at ALL times perfectly in sync with the positions of the motors. And an Arduino can "think" 1000 times faster than the pulses for a motor. The only way it would be out of sync would be if the motor was missing steps and then the 3D print would be all wrong.

Based on what you have said I reckon the problem is outside the Arduino.

Have you changed anything about the system? - For example a new version of the program that controls the printing process. You have not told us how that is done. I would expect your control software to demand a re-home before every new print. Maybe that is not now happening?

My wild guess is that something is causing the Arduinos to reset when they are NOT at the home position which causes them to think they are at the home position - hence your need to make them go through the homing process.

Going back to the business of the missing source code. Maybe the Arduinos are loaded with one of the common 3D printer programs such as Marlin or Repetier. If so you can just download the source code from the internet. HOWEVER I am not suggesting this as a remedy for the problem. Do NOT try to change the code on the Arduinos until you are sure that is where the problem lies.

...R

thanks for the info, learning to think beter here because of it.

how do you cut my messages if i may ask?

indeed a tough lesson to learn, specialy because i'm new here and have no experience at all. but with 600 employees and fairly 100 IT's with "no time" to help. their priority's lay with the customers. Communication here is a bit lacking but we are working on it.

Well as i typed my previous answer someone came in with a piece that "crashed" during the build and told me this wasn't the first time (wich implements my previous line about communication). As you said "if the stepper is missing a few steps this might happen as well". I will check the motor as soon as i can (probably next week). however this isn't every build.

what happened to the systems -> nothing has been updated recently. we actually have our own 3d printing programs and the arduino is completely written by the previous person based on our programs. Our company is Materialise.

I also asked my manager to order pieces and kits for me to learn more about arduino so this would help in the future. As I said: i have NO experience at all.

My appologies for the typos. i'm from belgium and am typing this during my work.

Hi,
Have you checked power supplies on all the printers?
A power supply loosing regulation can cause stepper problems and sensor malfunctions.

Was the development of the code done in house, if so where is the PC that did the coding and loading?

Also is there enough ventilation for cooling of the electronics and steppers?

Has there been a maintenance routine for your printers, with regard to checking belts, steppers, slide bearings to see if there is any jumping or binding?

Tom... :slight_smile:

jokke3D:
thanks for the info, learning to think beter here because of it.

how do you cut my messages if i may ask?

The right-most icon is "View Source" and that lets you see the tags that are used. I just put a [/quote] tag at the end of a piece that I want to refer to. Note also that there is a [nobbc][/nobbc] tag to allow tags to be displayed that would otherwise be interpreted.

I think it will be very hard to figure out your 3D printing problems without actually being there. Maybe it would make sense to hire a local expert for a few days and get the system put to rights.

...R

Robin2:
The right-most icon is "View Source" and that lets you see the tags that are used. I just put a

[/quote]

tag at the end of a piece that I want to refer to. Note also that there is a [nobbc][/nobbc] tag to allow tags to be displayed that would otherwise be interpreted.

[/quote]

thanks.

[quote author=Robin2 date=1510914715 link=msg=3490121]
I think it will be very hard to figure out your 3D printing problems without actually being there. Maybe it would make sense to hire a local expert for a few days and get the system put to rights.

...R
[nobbc][/quote]

yeah the point should be that i become the expert :stuck_out_tongue: but maybe going to ask around see what i can figure out. thanks for all the info you got me. always helpfull.

TomGeorge:
Hi,
Have you checked power supplies on all the printers?
A power supply loosing regulation can cause stepper problems and sensor malfunctions.

All power supplies have been checked and are fine.

TomGeorge:
Was the development of the code done in house, if so where is the PC that did the coding and loading?

done in house but the person that did this hasn't saved a thing in his procces and has now left.

TomGeorge:
Also is there enough ventilation for cooling of the electronics and steppers?

ventilation is ok seeing that 14 other printers are ok and at the same temp intern. steppers don't feel hot.

TomGeorge:
Has there been a maintenance routine for your printers, with regard to checking belts, steppers, slide bearings to see if there is any jumping or binding?

we just started building up a nice solid maintenance routine. They all look well maintained. just going to check the stepper next week to see if anny steps are missing.

jokke3D:
done in house but the person that did this hasn't saved a thing in his procces and has now left.

I've been thinking more about this.

Writing a 3D printer firmware program is not a trivial task. Have you any reason to believe that the person who created your system actually wrote the code himself? Maybe he just used some of the Open Source code that is available.

If the 3D printer connects to a PC with a USB connection I would be tempted to connect it to a PC which has the Arduino IDE installed and see what comes up in the Arduino Serial Monitor when the printer is reset. It my give you a clue as to what program is running.

You haven't told us how you interface with your 3D printers - how you get a design to print on one of them. That process might also provide a clue to what program is on the Arduino.

While it is reasonable for your company to elevate you to "expert" status you should make them aware that there is also a risk of you not being available (even if you are just away on vacation). And, together with the company, you should develop a strategy that you can manage and which at the same time is not 100% dependent on you. This will probably not appear to be the cheapest solution. But, believe me, it will be over the long term.

...R

Robin2:
I've been thinking more about this.

Writing a 3D printer firmware program is not a trivial task. Have you any reason to believe that the person who created your system actually wrote the code himself? Maybe he just used some of the Open Source code that is available.

well the company actually has 3 devisions. software, medical, manufacturing and provides software to make your own made printer (industrial) work, but as i said they are "too busy" to help our manufacturing devision out. we have our "legacy" software that puts the 3d desing into the machine. the arduino is only in there to operate the axes. an in between of the PC and axes. they wrote the code themself on the arduino to be sure it can operate with the legacy. in our big printers (car bumpe sprint size) we operate the axes through a beckoff (wich i'll eventually have to learn as well)

Robin2:
If the 3D printer connects to a PC with a USB connection I would be tempted to connect it to a PC which has the Arduino IDE installed and see what comes up in the Arduino Serial Monitor when the printer is reset. It my give you a clue as to what program is running.

I'll try this next build. is there maybe a code so the movements get recorded? maybe then i can see the in and outputs recorded during the build

Robin2:
You haven't told us how you interface with your 3D printers - how you get a design to print on one of them. That process might also provide a clue to what program is on the Arduino.

They prepare the build with our Matrix software, then load it into the legacy software (wich operates the machine's laser, security, etc. and arduino). the arduino gets info from the legacy and then sends the requested movements to the axes.

jokke3D:
we have our "legacy" software that puts the 3d desing into the machine. the arduino is only in there to operate the axes. an in between of the PC and axes. they wrote the code themself on the arduino to be sure it can operate with the legacy.

That opens up a whole other avenue of ideas.

I have written some Arduino code to drive the stepper motors on a small lathe. The Arduino code is very simple and all the hard work of interpreting the G-Code etc is done in a Python program on my PC. If your system has a similar division of tasks then you really are in deep doo doo without the source code.

well the company actually has 3 devisions. software, medical, manufacturing

If the company is that big why is it coming here looking for free help instead of hiring professional help? It sounds a bit unfair unless the company has something in mind to contribute to the OpenSource community.

You might actually do yourself a big favour within a large company by digging your heels in and telling them they need professional help. In my experience big companies have little respect for amateurs, how ever well meaning and competent the amateur may be.

...R

I bet its running some modified version of marlin firmware, nobody is going to re-invent the wheel...

I also bet it has nothing to do with the arduino. The arduino controls the stepper therefore its impossible for the arduino to "lose track of pulses." If the motor shaft slips for any number of reasons, then you lose track of where you are in space. But typically the arduino has no feedback other than a home limit switch.

I would ohm out the phases of the stepper motors. If one is shorted, it will miss steps and likely reset the adruino. Then look at the stepper drivers, see if there is any current adjustments on the driver, increase the current if possible.

In my experience, look for anything that an operator could have come in contact with and see how they could have messed it up.

good luck.

I agree. Not a good idea to operate without having the source code. If the arduino did fail for some reason, then that's the end of it.

At this point, it will be necessary for the company to have a real back-up plan in case something really does fail. And at the same time, if they want to continue to use arduino, they better get started with getting source code - even if they have to have a fresh start. This could mean get another printer and arduino system, for development and testing.

The source code should also ideally need to be complemented by adequate documentation - enough details (flow diagram, flow-chart, motor details, timing, etc etc etc) for experienced people to follow and work on it (if needed).

dustin02rsx:
I bet its running some modified version of marlin firmware, nobody is going to re-invent the wheel...

It depends what wheel needs to be re-invented. If the company has a big investment in its own code then Marlin (or similar) might not have been an option.

And much of the complexity in Marlin is due to it being able to work with a wide range of hardware.

...R

Taking loing shots sometimes pays off.
did the IT guys back up his computer ? you may be lucky and find the source code.

also, as was stated, the only way to get a good part is if the system was in full control and never lost steps.

I would assume that there is a HOME function and that you need to move to HOME and then it will re-zero and then start running properly again.

At this point, the program is in a HEX file that will look like pure gibberish.

it may take longer to reverse enginner that to be able to scour it for mistakes, than to start fresh.

Also, did you let the system finish ?
I mean, did it stop the project, then pause, then 'go home'
but you killed it before it made it's final moves ?

Based on some of the comments, it may be that the program is working perfectly, but there is some step no taken by humans.

Robin2:
That opens up a whole other avenue of ideas.

I have written some Arduino code to drive the stepper motors on a small lathe. The Arduino code is very simple and all the hard work of interpreting the G-Code etc is done in a Python program on my PC. If your system has a similar division of tasks then you really are in deep doo doo without the source code.
If the company is that big why is it coming here looking for free help instead of hiring professional help? It sounds a bit unfair unless the company has something in mind to contribute to the OpenSource community.

You might actually do yourself a big favour within a large company by digging your heels in and telling them they need professional help. In my experience big companies have little respect for amateurs, how ever well meaning and competent the amateur may be.

...R

Hey man sorry for the late answer. I did some internal research and apparently they did an update on all the arduino's without telling what they did. now what they did not know is that not every machine was the same build although they look the same. so now i'll update all the machines so they all have the same components and the same functions. this should fix the problem.

I also asked for professional help in the future to learn more about arduino and the programs, they agreed (thumbs up) !!!!