Homeβ€Ί JGAurora A5S, A1 & A3S-V2β€Ί Modifications & Upgrades

PLANNING: New firmware

13

Comments

  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited February 2019
    The LCD pinout wiring in the HAL files is definitely 100% correct. The problem seems to be the data is out of sync with the start of each line.
    Post edited by Samuel Pinches on
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    I think I figured out the lcd problems.... details to come soon!
    Thanked by 1aestrems
    Post edited by Samuel Pinches on
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    Great job @Samuel PinchesΒ  :) . Compared to my branch what changes did you make? I do not see the marlin information on my LCD and in the pull request you've opened I see only the removal of two comments.

    Is it perhaps the different way to load the firmware? I am loading it via SD and you (I think) via stlink...
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Doh...I have fixed the PR now. Just need to change the PF0 to PG0. I've created a video to show the solution for the lcd, I'll upload that in a sec and post that here.
    Thanked by 1jelot_it
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Incoming video.... Shield's up! :smiley:




    Thanked by 1jelot_it
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    Ok @jelot_it ... I got the on-screen touch buttons working, thanks to the clever work started by jmz52 here - I started by implementing all the changes in their branch related to TFT-touch on the MKS Robin. After that, I made the following additional changes:

    in pins_JGAurora_A5_A1.h
    #define TOUCH_CS PA4
    #define BTN_ENC PA11 // not connected, real pin, stable value

    in xpt2046.h
    Changed SPI to SPI_CLOCK_DIV4
    Changed touch calibration to:
    /* JGAurora A1 */
    #define XPT2046_X_CALIBRATION 20000
    #define XPT2046_X_OFFSET 128
    #define XPT2046_Y_CALIBRATION 15000
    #define XPT2046_Y_OFFSET 128

    in xpt2046.cpp
    x = (uint16_t)(((((int32_t)x)-XPT2046_X_OFFSET) * (int32_t)XPT2046_X_CALIBRATION) >> 16 );
    y = (uint16_t)(((((int32_t)y)-XPT2046_Y_OFFSET) * (int32_t)XPT2046_Y_CALIBRATION) >> 16 );

    if (y < 0 || y > 220) return 0;
    if (x > 0 & x < 200) encoderDiff = - ENCODER_STEPS_PER_MENU_ITEM * ENCODER_PULSES_PER_STEP;
    if (x > 200 & x < 380) encoderDiff = ENCODER_STEPS_PER_MENU_ITEM * ENCODER_PULSES_PER_STEP;
    if (x > 380 & x < 580) return EN_C;

    You can download the zip here of my build env - which is based off your git repo build:

    My motherboard is still out of the case, so I haven't tested anything beyond this, but at this stage I'll start to be putting it back in now...

    SD card is also working beautifully! :smiley:











    Thanked by 2aestrems jelot_it
    Post edited by Samuel Pinches on
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    Amazing work @Samuel Pinches !

    from the video I saw that you have an A1... in the pin file I added this condition found in the original source:

    #if MACHINE_MODEL == A1
    // A1 use X_MAX_PIN to detect homing
    #define X_MIN_PIN -1
    #define X_MAX_PIN PC6
    #else
    #define X_MIN_PIN PC6
    #define X_MAX_PIN -1
    #endif
    it should be correct, but check if it's true.

    I hope to have some time today to work on it and see what has been introduced by you and by jmz52 ;)
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    Β @Samuel Pinches I merged your pull request and I've placed a commit to fix the ram length for the linker.

    this is what I get without making the changes shown in the video ... I probably do not have that problem or, being my LCD inside the case, it has some connected mass that you did not have (or something similar)



    Thanked by 1Samuel Pinches
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Thanks for pulling all that together. I’m going to put my printer together and have a go in the next few days. I wonder, if you get a chance could you take a photo of the motherboard version on your printer? Maybe it is a different revision.
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    edited March 2019
    I am attaching a picture of the silkprint of my "broken motherboard". If you need a complete picture of the board, I can take it apart and do it.



    P.S. the new motherboard has been sent, but the goal is to print something with the broken motherboard before the new one arrives ... I just need to change the pin file to make the z axis move correctly ;)

    [edit]
    Actually I saw from your post above that you have a different version ... your V0.2 vs my V1.0
    [/edit]
    Thanked by 1Samuel Pinches
    Post edited by jelot_it on
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Thanks @jelot_it Β - looks like yours is the newer motherboard V1.0 from June 2018, while mine is V0.2 from Feb 2018.

    I'll try to get another PR setup with the changes for the LCD buttons.
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    I think that for the LCD buttons it is more convenient to have a different branch, so that everything that does not concern the LCD monitor can be merged faster inside the upstream marlin.

    it seems to me that jmz52 has made many changes that could make the integration process inside upstream marlin slower

    if you want I can create a new branch board/jgaurora_a5s_a1_lcd_buttons (or something similar) in my repository or you can create it directly in yours... the important thing is that the changes concerning the operation of everything that is not "lcd" go in the original branch or in separate commits, in this way we can make cherry-picking
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    I agree, this makes sense. I’ll make it happen.
    Thanked by 1aestrems
  • Richy_TRichy_T Posts: 142🌟 Super Member 🌟
    Good work, guys. You have done a lot of work while I was looking away. Odd that the display works normally. Perhaps it uses a slower data rate in the default firmware?
  • Richy_TRichy_T Posts: 142🌟 Super Member 🌟
    Additionally, is there a way to pull the firmware off the board? I understand the A1 firmware isn't generally available?
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    You can dump the firmware using an ST-link device quite easily on PC using the ST-Link utility. That's how I was able to get the bootloader, which is not included in the JGAurora provided updates.
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Unfortunately, I've been stuck on trying to identify the cause of the unresponsive heating pins problem. It occurs as soon as the timers are setup in the
    HAL_timer_start() call. I had a look in the HAL code, but I couldn't see anywhere where values are changed.

    I also learned that the Serial (USART) 2 pins also overlap with those pins too, but I don't think that is the problem.

    I also confirmed with a basic arduino sketch that the pins are not inverted or anything strange like that.
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    @Richy_T - the firmware on my machine is the same as the firmware jgaurora provided to me in dec last year... :disappointed:


  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    Ok, I'm stuck guys. I can't seem to solve the heating problem - as soon as the board boots it starts heating up straight away. Additionally, the mosfets do not turn off when a temperature is set.

    From what I can see, this all happens in the temperature.cpp file, after the thermalManager.init() call is made, which is called during the startup process in marlin.cpp. The HAL_timer_start() call seems to lock the pins from being able to be changed even when manually inserting GPIO value change code right after it : e.g. <br>&nbsp;&nbsp;&nbsp; int PIN_STATUS = 1; <br>&nbsp;&nbsp; (PIN_MAP[HEATER_BED_PIN].gpio_device->regs->BSRR = (1U << PIN_MAP[HEATER_BED_PIN].gpio_bit) << (16 * (bool)PIN_STATUS));

    Inside the HAL_timer_start() call, if I comment out the timer_attach_interrupt() then the code above is able to change the pin status, but I still cannot control the mosfet from marlin when setting temperatures.

    Strangely, in the Marlin firmware, I think the pin values DO seem to be be inverted for some reason??

    Post edited by Samuel Pinches on
  • Richy_TRichy_T Posts: 142🌟 Super Member 🌟
    I still think the firmware should be the same because same boards and similar hardware but I guess we will see.

    I need to follow up on an issue where the extrude icons work opposite to how they are labelled (does this happen on yours?). Perhaps that would cause them to release newer firmware. Personally, I'm mostly using Octoprint now so it's a bit less critical.
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    @Richy_T - the motherboards should be the same, I think just that mine is an earlier version.

    The firmware is also the same, but the A1 has the x-axis reversed, so they need to make a separate version with that change included. They probably just haven't bothered. I have verified you can run the A5S firmware on the A1, but the x-motor moves the wrong way.

    I didn't notice that problem, but unfortunately my printer is in pieces at the moment while I'm doing heart surgery working on the firmware for the motherboard.
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Ok, solution to problem 1: the min temp in config.h needs to be lower than the probe temp for temperature control to work... grrrr wasted so much time on this one...
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    happy to hear progress on this, but what is the temperature of the probe?

    yesterday I received the new motherboard. I'm in the middle of my first print with this printer. As soon as the print ends, I go back to working on the firmware ;)

    P.S. if you can, avoid updating platformio and our dependencies... today I did it and now I have some problems of compilation (partly solved, but not completely)
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    @jelot_it that's good news :smile:

    Getting the sensor readings working is the next problem, and then testing EEPROM support. I verified they do work in a simple sketch.

    You can specify the version of things to use in platformio, to avoid problems, e.g.:

    platform = ststm32@5.1.0

    Post edited by Samuel Pinches on
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    Some big wins today :smiley:github changes
    Got the temperature measurements working (took absolutely forever to diagnose this one, so many hours!!), along with fixing the fan being inverted.

    I did fix the heating problem, but I seem to have broken that again... working on it.

    Edit: I fixed the spontaneous heating problem too, I think it is a legitimate order-of-operations bug that I will push upstream.
    Thanked by 1jelot_it
    Post edited by Samuel Pinches on
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    OK! AWESOME NEWS TIME: WE HAVE WORKING (VERY VERY BETA) COMMUNITY FIRMWARE!!!! :smiley::sunglasses:

    If you want to risk your printer catching fire :flushed:, and burning your house to the ground :anguished: , and your cat spontaneously combusting :dizzy: , then you are welcome to try the beta 1 firmware here: BETA 1 DOWNLOAD

    • Turn off printer, and leave off for 30 seconds, for internal capacitor to discharge
    • Copy the correct firmware file for your printer onto SD card
    • Insert SD card into printer
    • Turn on printer
    • Wait for flashing to commence

    To restore to factory firmware, do the same steps as above, but use the OEM factory firmware here.

    I haven't even tried printing with this yet myself! But I'm going to bed.... 😴😴

    Still Things We Need Todo:
    • EEPROM
    • Testing
    • Testing
    • Tuning
    • Testing
    • Mesh Bed Levelling
    • Power Outage Recovery
    • Filament Run Out
    • Filament Changing
    • Testing
    ANY HELP IS VERY WELCOME!!!


    !


    Post edited by Samuel Pinches on
  • jelot_itjelot_it Posts: 25Member, 🌟 Super Member 🌟
    great job @Samuel Pinches

    I also saw the history of your PR on upstream... awesome B)

    I restored the history of my branch that I had modified due to an upstream rebase... in this way we have again the same hashes.

    I saw that some of your commits have parts for the buttons and for the configuration mixed together...

    Tonight I would align the branch with upstream (through merge :# ) and I would like to extract from your commits what is needed to do a PR (for now without the part of the buttons). Is it good for you?

    Thanked by 1aestrems
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    Go for it! I tried to PR the main core marlin & HAL changes, so I don't think you will need to make many, if any, changes to your build (except small changes in conf.h & conf_adv.h) if you apply the changes I submitted upstream. :smiley:

    I think if we can get EEPROM working, then most of the other functions should fall into place fairly easily. Unfortunately I'm short on time, so if you're able to have a go at that, that would be awesome.
    Thanked by 1aestrems
    Post edited by Samuel Pinches on
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited March 2019
    I turned EEPROM on, along with a few other features (PWM, mesh bed etc) but have not tried it, if anyone wants to check it for me (A5S only).
    Thanked by 1aestrems
    Post edited by Samuel Pinches on
  • aestremsaestrems Posts: 33🌟 Super Member 🌟
    First impression before printing.

    Installation really easy +1
    Bed mesh leaving done without problems, the only thing that I notice is that for the last 4 point the nozzle goes really on the limit maybe few mm less to the border will be appreciated +1
    Now the printer is heating and preparing for the print cube


Sign In or Register to comment.