Hacking the HP45

Powder and inkjet printing
Donm
Posts: 1
Joined: Thu Aug 22, 2019 1:30 pm

Re: Hacking the HP45

Post by Donm » Tue Sep 17, 2019 2:42 pm

Has anyone else seem the problem where the temp_10x_res is too low, <150 as checked for in the printhead.cpp within HP45_Standalone_V3.00.00 ?
This temp_10x_res value is at 67.4 currently.

Thanks, DonM

Priyashree
Posts: 3
Joined: Wed Jul 17, 2019 8:40 am

Re: Hacking the HP45

Post by Priyashree » Mon Sep 23, 2019 1:12 pm

dragonator wrote:
Thu Jul 18, 2019 4:48 pm
Hello and welcome Priyashree

Do you have any schematics or images of your circuit. The 4017 circuit has not really ever failed me, so I am curious how you are doing it.
Dear Dragonator,

I have used the schematic HP45 standalone version 3.2 as well as ordered PCB from local PCB manufacturer. I didn't found pmv20enr MOSFET so I have used IRLML2505 20v 4.2A MOSFET. Apart from that everything is same.

For testing the nozzles. I have followed teensy 3.2 test v2 source code to fire all the nozzles.

Could you please suggest how you have checked the nozzles it's really difficult to analyze it. May be i am not getting proper way that you have done while development.
Pcb
Pcb
IMG_20190923_184044.jpg (375.75 KiB) Viewed 204 times

User avatar
dragonator
Site Admin
Posts: 428
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking the HP45

Post by dragonator » Tue Sep 24, 2019 4:58 pm

If you are manually triggering, you will need to open the mosfet. Testing it is somewhat complex, but what I usually do first to not have a printhead in and turning known pins high or low. I then measure the right pads to see if there is 12V compared to the ground pads. This is simpler without a connector. To check timings I solder wires to the TLC and 4017 and see how the signals are.

The mosfet should work, though I did not check pin mapping. If you are worried that it might be the culprit you can solder a wire past it. It is only really used to check the nozzles.

I do have to say that troubleshooting this from a distance is really difficult if all I get as input is: I tried to fire using a bit of source code, and it did not fire. I will need more information if you want me to give proper pointers

User avatar
dragonator
Site Admin
Posts: 428
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking the HP45

Post by dragonator » Sun Oct 06, 2019 1:41 pm

Time to pick up where I left off earlier this year. A quick recap of what I have done for the HP45 before the Turret hiatus.

DMA will make the printing process a lot quicker. It will place the 300ms+ function to print away from the processor, and move it to the DMA hardware. This effectively makes it so all I have to do is hit print, and then I can continue with other tasks. To do this, I modified the OctoWS2811 library (https://github.com/PaulStoffregen/OctoWS2811) to control 2 full ports simultaneously. With 2 ports of 8 bits each I can control: 14 primitive data pins, 1 primitive clock pin, and an address clock pin. The thing missing in this list is the primitive clear. I naively assumed that since it was active low, I could actually just tie it to the primitive clock.

I was wrong on this. The clock is rising edge, but the clear is cleared WHILE low, and there is a 250ns propagation delay. I added a monostable multivibrator. When the clock goes from high to low, it instantly gives a 500ns low pulse on the clear, clearing the output, then goes to 1 again making it inactive. I ordered the new PCB's for a properly finished controller and started on the Turret.

Coming back to this project, I started using the new controller. I soldered it, rewrote the firmware to have the right pin mapping, and then, nothing. It communicated, it even checked whether it was working, it read the temperature, but any attempt to make it spit ink was in vain. All of this was done in the normal printhead mode, expecting that the modifications for DMA would not affect this. I also tried printing with DMA. On the test controller it worked fine, on the new prototype, it did not.

I had to wait a little to get close to a scope, but today I finally got one and did some tests. From left to right you are seeing: The old controller, the test controller, and the new prototype controller.
DSC04359s.jpg
DSC04359s.jpg (490.2 KiB) Viewed 102 times
DSC04373s.jpg
DSC04373s.jpg (420.26 KiB) Viewed 102 times
From the top to the bottom, you are seeing: Random primitive data pin, primitive clock, primitive clear. All of the values are completely within spec. Something else was wrong. Now without photos, the test controller showed that the address clock and reset were triggered perfectly, but on the prototype only the clock triggered. Digging around in the code, I found the culprit. I did not update all values, and in DMA print, the address reset was on the wrong pin. This was an easy fix, and sure thing, now the prototype printed fine in DMA mode.

Why did it not print in normal mode then. I did some more tests, and found that the clock pulse length was 8us. 8! What the old code does is: Set clock to 0, set clear to 1, set al the primitive pins, disable interrupts, set clock to 1, wait roughly 1.8us, set clear to 0, set clock to 0 and enable interrupts. Did I mention that I simply set pin 21 to both clock and clear to make the old code work? In hindsight it is obvious. I already set the clear to 1, and then did plenty of other things before setting clock to 1. This meant that 6us of commands were done before I would actually set the clock, thinking that it was not yet set high. I simply disabled the clear commands in the code, and bang, beautiful 1.8us.

Two important things I discovered. First is that the printhead will simply not fire with pulses of 8us. No nozzles are broken, though I suspect that the life will be a bit shortened. I think that the 8us pulses will keep the nozzles too hot to refill with ink, preventing any ink from being ejected. Second, I never did a full timing test of how long a burst took. I simply did the math. 6us of commands between clear = 1 and clock = 1 tells me that there is a full 400us of extra commands for EACH burst (66*6=396). Adding the 4us or so to actually pulse, I am suddenly surprised that I could even manage 50mm/s. The guesstimated to speed would be 50mm/s to 75mm/s.

I will do timing measurements in the future with a logic analyzer to verify. For now, the head is working again, and I can continue getting all other things to work. I want to add virtual speed, software and hardware triggers, printing text and rewrite Oasis controller to something slightly more universal. That will be for the future.

Priyashree
Posts: 3
Joined: Wed Jul 17, 2019 8:40 am

Re: Hacking the HP45

Post by Priyashree » Mon Oct 07, 2019 11:49 am

dragonator wrote:
Tue Sep 24, 2019 4:58 pm
If you are manually triggering, you will need to open the mosfet. Testing it is somewhat complex, but what I usually do first to not have a printhead in and turning known pins high or low. I then measure the right pads to see if there is 12V compared to the ground pads. This is simpler without a connector. To check timings I solder wires to the TLC and 4017 and see how the signals are.

The mosfet should work, though I did not check pin mapping. If you are worried that it might be the culprit you can solder a wire past it. It is only really used to check the nozzles.

I do have to say that troubleshooting this from a distance is really difficult if all I get as input is: I tried to fire using a bit of source code, and it did not fire. I will need more information if you want me to give proper pointers
@Dragonator Please find my code that i am using to fire all the nozzles. but unfortunately i am not getting ink out of the nozzles. If you guide me to find out what would be possible fault i am doing. i doesn't have Oscilloscope with me so i am trying to borrow it from somewhere. Till now checked with multi meter getting voltage around 5 to 7 volts on primitives as well as address pins.

Code: Select all

//Variables ------------------------------------------------------------------------------------------------------------------------------------------------------------
//variables for the printhead commands block
byte printhead_current_address = 0; //0 is off. 1-22 are the addresses

uint8_t pushbutton = 5;

//fire a single row of primitives on the current address and resets the primtives
void printheadFire(uint8_t prm0,uint8_t prm1,uint8_t prm2,uint8_t prm3,uint8_t prm4,uint8_t prm5,uint8_t prm6,
uint8_t prm7,uint8_t prm8,uint8_t prm9,uint8_t prm10,uint8_t prm11,uint8_t prm12,uint8_t prm13,uint8_t prmClr,
uint8_t prmClk)
{
  //set up the primitives that need to be on
  digitalWrite(prmClr, 1);//set clear to 1
  digitalWrite(prmClk, 0);//set clock to 0
  //set primitives
  digitalWrite(prm0, 1);
  digitalWrite(prm1, 1);
  digitalWrite(prm2, 1);
  digitalWrite(prm3, 1);
  digitalWrite(prm4, 1);
  digitalWrite(prm5, 1);
  digitalWrite(prm6, 1);
  digitalWrite(prm7, 1);
  digitalWrite(prm8, 1);
  digitalWrite(prm9, 1);
  digitalWrite(prm10, 1);
  digitalWrite(prm11, 1);
  digitalWrite(prm12, 1);
  digitalWrite(prm13, 1);
  
  //trigger the primitives
  digitalWrite(prmClk, 1);//set clock to 1
  
  delayMicroseconds(3); //delay
  
  digitalWrite(prmClr, 0);//set clear to 0
  digitalWrite(prmClk, 0);//set clock to 0
  
  //clear the primitives
  digitalWrite(prm0, 0);
  digitalWrite(prm1, 0);
  digitalWrite(prm2, 0);
  digitalWrite(prm3, 0);
  digitalWrite(prm4, 0);
  digitalWrite(prm5, 0);
  digitalWrite(prm6, 0);
  digitalWrite(prm7, 0);
  digitalWrite(prm8, 0);
  digitalWrite(prm9, 0);
  digitalWrite(prm10, 0);
  digitalWrite(prm11, 0);
  digitalWrite(prm12, 0);
  digitalWrite(prm13, 0);
}


//address goto next (returns current address)
byte printheadNextAddress() {
  if (printhead_current_address < 22 || printhead_current_address == 255) { //check if the maximum value is already reached
    digitalWrite(3, 1); //address clock pin to high
    delayMicroseconds(1);
    digitalWrite(3, 0); //address clock pin to low
    printhead_current_address++; //add one to the current address
    return printhead_current_address; //return the current address
  }
}

//address reset
void printheadResetAddress() {
  digitalWrite(2, 1); //address reset pin to high
  delayMicroseconds(1);
  digitalWrite(2, 0); //address reset pin to low
  printhead_current_address = 255; //set the current address to 0
}



//control printhead enable
void printheadEnable(byte temp_printhead_enable_state) {
  temp_printhead_enable_state = constrain(temp_printhead_enable_state, 0, 1); //constrain input to 1 or 0
  digitalWrite(23, temp_printhead_enable_state); //set the state of the printhead enable
}


void setup() {
  //portB
  pinMode(3, OUTPUT); //Address clock
  pinMode(2, OUTPUT); //Address reset
  pinMode(23, OUTPUT); //Print enable
  pinMode(22, INPUT); //Nozzle check

  //PORTC
  pinMode(24, OUTPUT); //Primitive 0
  pinMode(28, OUTPUT); //Primitive 2
  pinMode(26, OUTPUT); //Primitive 4
  pinMode(27, OUTPUT); //Primitive 6
  pinMode(8, OUTPUT); //Primitive 8
  pinMode(7, OUTPUT); //Primitive 10
  pinMode(25, OUTPUT); //Primitive 12
  pinMode(29, OUTPUT); //Primitive clock

  //PORTD
  pinMode(16, OUTPUT); //Primitive 1
  pinMode(15, OUTPUT); //Primitive 3
  pinMode(14, OUTPUT); //Primitive 5
  pinMode(20, OUTPUT); //Primitive 7
  pinMode(18, OUTPUT); //Primitive 9
  pinMode(17, OUTPUT); //Primitive 11
  pinMode(19, OUTPUT); //Primitive 13
  pinMode(33, OUTPUT); //Primitive _clear

  pinMode(pushbutton, INPUT); //button

}

void loop() {
  if (digitalRead(pushbutton)){ //as long as the button is pushed, the printhead will eject ink
    printheadEnable(1); //enable the head
    for (int i = 0; i < 10; i++){
      printheadResetAddress(); //set address to 0
      for (byte a = 0; a < 22; a++){ //to 22 is all addresses
        printheadNextAddress(); //goto next address
        delayMicroseconds(3); //addres startup delay
        printheadFire(24,16,28,15,26,14,27,20,8,18,7,17,25,19,33,29); //32639 is fire all nozzles
        delayMicroseconds(5); //address shutdown delay
      }
    }
    printheadEnable(0); //stop the head
  }
}

User avatar
dragonator
Site Admin
Posts: 428
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking the HP45

Post by dragonator » Mon Oct 07, 2019 5:00 pm

I cannot judge whether the pins are connected correctly, but overall it seems like the right thing. I would lower the delay between clock 1 and clear 0 to 2 microseconds, but other than that, it seems fine.

Do wipe the head before printing. It will literally not work without it. Other than that, I cannot see why it would not work.

inkjet
Posts: 0
Joined: Fri Oct 11, 2019 12:19 pm

Re: Hacking the HP45

Post by inkjet » Fri Oct 11, 2019 12:24 pm

good morning i'm new to the forum i have some interesting information about hp45

Post Reply