Tuesday 1 November 2022

Second try at CTC DIY 3D printer Z-axis wobble fix

25/3/2023 Don't bother reading this. I gave up when I never could communicate via the Arduino to the ANET board.

-------------- ------------------- -------------- --------------- 


I am going to try and start again. 

I think that I have prepared the Arduino Uno for use as a downloading tool.

I now need to find the Library/Hardware data for this ANET  V1.5.

Basic configuration:

/Home/peterm/Arduino/arduino-ide_nightly-20221020_Linux_64bit.AppImage

/Home/peterm/Arduino/Hardware/anet

/Home/peterm/Arduino/libraries

/Home/peterm/Arduino/Marlin-2.1.1

Set Preferences Additional Board Manager to https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json

 And installed in Boards Manager the MightyCore.

Then in Boards Manager I was able to select ATMega1284 which is what this ANET card has. 

I think that I have to load some additional Configuration files from somewhere to select the file for my ANET board. Need to look that up again. 

Found that here: https://github.com/MarlinFirmware/Configurations

Following along from this, with modifications.

https://www.youtube.com/watch?v=38PkynA1uGI&t=157s   at 3:00 in

His file links:     * Software links

Marlin firmware https://github.com/MarlinFirmware/Marlin Marlin Default Configuration Files https://github.com/MarlinFirmware/Con...

from 5  minutes in, he wants you to download Visual Studio. It is available for linux. 
https://visualstudio.microsoft.com

Just after 8:00 mins he refers to another link in order to get the bootloader onto the  ANET board. I may have to do this first. 

------------ ----------- ------------ -----------
2022-11-04
Going back a step to get the bootloader in. 
https://www.youtube.com/watch?v=RQIizXtf9oo&t=0s

This also does the MArlin firmware to the printer, after getting the bootloader in. 
3:10 Arduino as Programmer to 4:40
4:45 wiring to ANET board
5:30 Burning bootloader
6:10  burning MArlin firmware to board. 


at 5:42 cannot find the ANET  optiboot in the boards manager. 
from the comments:
Arduino 1.8.5 it didn't have the anet boards listed. I found how to add those at https://github.com/SkyNet3D/anet-board. [ 2023/7/14 This link has disappeared]
Followed these instructions, but I had already done them, but the IDE does not seem to find the hardware folder.

BAH: Its a known fault: https://forum.arduino.cc/t/hardware-folder/699133

------------ -------------- -------------- ----------
2022-11-06
- removing Arduino IDE 2  Appimage
- removing /Hardware directory
- removing /Library directory

Download Arduino IDE 1.8.19  https://www.arduino.cc/en/software
There is a link to the installation instructions
Open console, run sudo sh install.sh
Now to find Hardware folder. 

OK, it's in /Arduino/Hardware and I have added the ANET stuff. 


2022-11-28 
It looks like the Marlin firmware compiles /verifies Ok with the MightyCore  Atmega chip specified, but it won't download via the Arduino. I will have to rewatch the video.  

2022-12-01
IT verifies and tries to load only if the capacitor to the reset pin is not connected to ground.  

error message:

avrdude: Expected signature for ATmega1284P is 1E 97 05

Double check chip, or use -F to override this check.


Two things I have learnt today. 


Folder /peterm/Arduino/hardware must have a lower case h on hardware. 

Putting the Anet folder from /home/peterm/3D_Printing/CTC-Prusa-i3-Pro-B-Anet-board  

into the hardware  folder means that Arduino IDE finds the ANET boards. 


This does Verify, but doesn't download because of 

Arduino: 1.8.19 (Linux), Board: "Anet V1.0"


Sketch uses 54624 bytes (43%) of program storage space. Maximum is 126976 bytes.

Global variables use 2475 bytes of dynamic memory.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c

An error occurred while uploading the sketch



This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.


So I need to find out how to get it in sync.

I had the connector to the ANET board in the wrong position (one set of pins down from where it should be.) When I put it in the right place I fried the UNO.

Thought: I had the MISO/MOSI pins in the wrong places. 

-------------- -----------
Now to try using the special card that I bought. 
referring back to this:
https://www.youtube.com/watch?v=oZVTYpHnpIw  

I somehow need to determine the use of the pins on this USB to TTL device.

One reference: 
https://support.th3dstudio.com/helpcenter/anet-bootloader-flashing-guide-usbasp/





Another useful site for Arduino, but no help with my current problem

https://www.circuito.io/blog/arduino-uno-pinout/


I will try TX to MISO, and RX to MOSI
TX is Blue to pin 3, 
GND is Grey to pin 8
and RX is purple to pin 6

6/12/2022  Discussion at DLUG Meeting. to use MISO/MOSI i use a JTAG protocol.
I will be sent some information. 


22/12/22 
Some links found by Ben
https://www.thingiverse.com/groups/anet-a8-prusa-i3/forums/general/topic:33728


https://anet3d.com/blogs/download/open-source-firmware-of-a8


14/1/23  
After blowing up the Arduino Uno,
I am preparing another with an ICSP cable as per this:

https://www.instructables.com/Arduino-ICSP-Programming-Cable/






Summary:
Bootloader is downloaded to Arduino UNO.
Cable as above connects to ANET board. 
Marlin 2 Firmware compiles
MArlin firmware fails to download to board with error 
 -    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
and I don't know which item is not in sync. 

Question. Is the fact that  the Arduino is connected to the ANET board via the ICSP connections inhibiting the connection? 

Question 2: I have uploaded the AVRISP firmware to the arduino to act as the bootloader for the ANET board, but is the next step to use this to upload a bootloader to the ANET board and then use that to upload the Marlin Firmware?   I'll have to review one of the videos. 

2023/1/18 Discovered an error in creating that cable. I should disconnect the +v line so that the Arduino is not getting power from both the USB and the destination card.  I will replace the pin with a dummy one.   And another. The -ve side of the capacitor was connected to the grey (MOSI) wire, not the white ground wire. I blame that on the poor lighting. 

2023-1-20   Created a straight through  5 pin cable with a dummy pin holder where the +V is labelled.
It 'nearly' worked. I have seen this error before. 
"avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
An error occurred while uploading the sketch
         this check."

I need to find this previous occurrence and see what I can do.  It wasn't far back, but didn't give me a solution.
I notice that the screen is flashing alternate lines. 

One solution suggested was to use a capacitor on the reset pin, As I have tried. 
Another was to reduce the version of the AVR tools to 1.6.9. That had exactly the same error so I reverted to the highest version. 

I might look at the software for the  device signature. 

Tried to burn a bootloader. Got error:
"Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override   this check.  "

Not quite sure where to report this in order to ask for help.

23/1/2023
Removed the Reset line from the ICSP and connected it to pin 10. 

Then set  it up and got this error:
"avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.
Wrong microcontroller found.  Did you select the right board from the Tools > Board menu?"

Seen this before. 

But, it's RTFM time. I found this:
https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP
and at one point it says:
Going through the lines of the sketch you find a number of parameters that need to be set according to the target board. These parameters are, however, set by a specific file available for each bootloader/board supported by the Arduino Software (IDE). 

So do I need to edit this file?   No, I don't think so.


24/1/2023   I swapped the lines  MISO/MOSI  so that they are a crossover cable , but got the same error.

Looking around  for ways to read the signature for my ANET I found this: 

https://arduino.stackexchange.com/questions/23751/using-arduino-uno-to-retrieve-atmega328p-pu-chip-signature

https://www.instructables.com/How-to-Fix-Expected-Signature-for-ATMEGA328P-Is-1E/


20/3/2023  Had a thought about whether I could use my USB to TTL adapters to program the ANET card. The answer is NO. They do not support I2C communications. No clock line. 

Continue with Arduino UNO. 

ANET                                                                               UNO


o                      o                                                      o                    o
                                                            (violet)    MISO             VCC


o                      o                                                      o                    o
GND             Reset                              (black)    SCK      (blue) MOSI
(grey)            (brown

o                      o                                                      o                    o
MOSI            SCK                                              RESET      (grey) GND
(violet)          (black

o                      o                                                      
VCC              MISO
N/C                (blue)

o                      o                                                      

------------------------- ------------------------ -------------------



Today I am thinking of working through this to put a bootloader onto the ANET board. 
https://www.thingiverse.com/thing:4462696

see other blogs
-------------------------

6 October 2023
Bought  a metre long M8 threaded rod from Jewsons and cut it into 3. Replaced riser rods with these in other universal joints. It still wobbled. It is to do with the motors and connection to the rods - needs thought.












No comments: