Linear actuator problem with Atmega 2560 (loaded with Arduino Bootloader)

I’m working with a PCB consisting of Atmega 2560, 16MHz crystal oscillator and other components, I’ve uploaded Arduino bootloader (following steps here: Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer) for simpler programming. Using FTDI to program. See Pic1 for schematic.
I’m using 5 linear actuators by Actuonix (PQ12-P), the motor drivers and corresponding schematic for the same can be found in Pic2. Separate power mechanism has been created for them.

Problem1: While uploading the code, only single actuator (connected to Thumb_13, Thumb_12) starts wobbling/ shaking. See the video: VID_20180127_163445.mp4 - Google Drive. This should not have happened.

Problem2: Some times uploading stops in between and “An error occurred while uploading the sketch” error comes up and when I remove the actuator and again upload the same code, it gets uploaded.

Problem3: After uploading and restarting the system, Pin Thumb_13 goes high and Thumb_12 goes low making the actuator reach its maximum extension and after this the setup() code starts.

All other actuators works just fine, the power mechanism works fine.

Any help is welcome…

I think that your problem is related to the usage of timer 1, which can use these pins for outputs.

DrDiettrich:
I think that your problem is related to the usage of timer 1, which can use these pins for outputs.

Can you please elaborate.
Thanks

Since you didn't post any code, it's impossible to say what you're doing with the timer. The good doctor has just noticed that those particular pins you have problems with are pins which can be used for Timer 1.

MorganS:
Since you didn't post any code, it's impossible to say what you're doing with the timer. The good doctor has just noticed that those particular pins you have problems with are pins which can be used for Timer 1.

It doesn't matter what code I'm uploading, irrespective of whether I'm defining those pins or not that specific actuator keeps wobbling and Problem 1 and Problem 2 persists.

Hi,
Welcome to the forum.

Sadly the resolution of your diagrams is not good.
Do you have bypassing capacitors on the controller IC?
What is your power supply for the mega IC.
It looks like you have the actuator controllers on the same PCB as the mega controller, how have you placed your gnd and power traces.
Can you post diagrams of you PCB pattern, and a higher resolution of your schematics.
Did you screen capture or use your CADs Export function?
The export function should have resolution selection.

Thanks.. Tom.. :slight_smile:

Hey Tom

Please find the file attached to your questions.

PCB-Design.pdf (1020 KB)

Hi,
So you have all the circuitry mounted on one PCB, one side the mega and the other side the three motor controllers.

You have 10nF bypass on the motor controllers, I would be using 100nF

I see no bypassing on the mega side.

In your video I see some electrolytics, where are they on your PCB diagram.

The specs say a stall current of 550mA, your traces do not look heavy enough for that sort of current, even though it is momentary.

Did you have this sort of problem when you bread-boarded it?

Tom.... :slight_smile:

TomGeorge:
Hi,
So you have all the circuitry mounted on one PCB, one side the mega and the other side the three motor controllers.

You have 10nF bypass on the motor controllers, I would be using 100nF

I see no bypassing on the mega side.

In your video I see some electrolytics, where are they on your PCB diagram.

The specs say a stall current of 550mA, your traces do not look heavy enough for that sort of current, even though it is momentary.

Did you have this sort of problem when you bread-boarded it?

Tom.... :slight_smile:

Those polar capacitors are for power circuitry and other modules of the project.
No such problems were there when I was testing it with Arduino Mega.

Yatharthagg:
Those polar capacitors are for power circuitry and other modules of the project.
No such problems were there when I was testing it with Arduino Mega.

Okay, I would start by increasing the 10nF to 100nF and adding them around the powersupply pins of the mega.
Tom.... :slight_smile:

Yes, electronically changes would obviously be made.
But I couldn't understand that why only single actuator behaves in such an abnormal manner and rest works just fine.

Hi,
Which control IC is it on the PCB?
It could be its location or routing of the tracks to it.

Tom… :slight_smile:

As per the schematic, the circuit is logical (i.e. connections and components are OK except 100nF bypasing), and there might be problem with routing - is this what you are suggesting, Tom.

The microcontroller is ATmega 2560 in qfn packaging, locally bought.

I’m also attaching the other PCB schematic as well

PCB-Design - 2 (1).pdf (1.07 MB)

Pb7 is arduino pin 13, which most bootloaders flash at reset.

westfw:
Pb7 is arduino pin 13, which most bootloaders flash at reset.

Good catch... :slight_smile:

westfw:
Pb7 is arduino pin 13, which most bootloaders flash at reset.

Can that be bypassed / or something (any bootloader which doesn't do that) so that it doesn't makes that problem.

Yatharthagg:
Can that be bypassed / or something (any bootloader which doesn't do that) so that it doesn't makes that problem.

Use another pin, its easier.
Tom... :slight_smile:

:smiley: :smiley: :smiley:
But I have my PCBs fabricated...
Could there be any other way.. from software side. :confused:

Hi,
How are you programming the mega, through the Tx/Rx pins via a USB to RS232?
You load the bootloader through the ICSP pins?

If you google you can program the mega with your code through the ICSP, this defeats the bootloader and its pin13 flashing.

I think?

Tom… :slight_smile:

You could build a bootloader that doesn't toggle the pin - it's a compile time option.