Go Down

Topic: Projector ballast bypass (Read 5796 times) previous topic - next topic

Riva

Try the below code.
You will need to adjust the timing arrays to match you findings but it now does all the values in an array and not just the first one over.
Don't PM me for help as I will ignore it.

frankwilsonshat

Have updated your code with my new timings.
Had to experiment a little with the numbers to get as close a match to the original signal as possible as this seems quite critical to the projector.
Your code works 100%, no issues at all with that:-)
The projector now starts up as it would when the bulb and ballast are good, albeit with the ballast disconnected and the bulb removed.
Where I'm running into problems is with the repeating sequence, there seems to be more to this than just a regular pulse, the timings possibly.


I have added more lines of code to try and emulate the timings of the original;

delay(3528);

  xSend 3 bytes
 
delay(3108); 

 xSend 3 bytes

delay(3239)
etc,etc            (May have to run original again for longer to check for repetition, can't see any so far)


before I did this it was getting to this point and cutting off, now it does run for longer, however it is still cutting off so I am looking at running the SA again on the complete projector for a closer look.
I have a number of options here, suffice to say I'm fairly confident the projector is very close to staying on.
I may even do what I did before and run it next to the good projector with the ballast wire and gnd wires linked over to check what happens on a longer run time etc.

 

Riva

As the signal your trying to emulate is a serial signal it might have both the RX & TX connected, and maybe the module/thing that is sending it only does so when requested by the ballast?
might be worth looking for a return serial signal (or maybe something as simple as a line pulsed high/low) from the ballast that is a request signal.
Don't PM me for help as I will ignore it.

frankwilsonshat

Quote
As the signal your trying to emulate is a serial signal it might have both the RX & TX connected
That's what it's doing, I'm going to have to reorganise my setup and take another look, not had a chance to do much at the moment.

There's a 2400 baud signal being sent out by the projector to the ballast, will write back as soon as I've got an idea on the bytes being sent.

frankwilsonshat

Sorry for the delay on this, after moving to a more practical area to continue with this project I am getting plagued with noise on the signal analyser, however after applying a glitch filter to the data I can confirm it is indeed just a single pulse that is being sent from the projector to the ballast.
I'm thinking that some sort of amendment to the code like this might be worth a try,


  if DigitalRead = HIGH then

  xSend(x22D, s22D);
  xSend(x139, s139);
  xSend(x2C1, s2C1);
 
  if DigitalRead = HIGH then

 
  xSend(x20C, s20C);
  xSend(x2C1, s2C1);
 
  if DigitalRead = HIGH then
 
  xSend(x02C, s02C);
  xSend(x20C, s20C);


 

Riva

Does the serial data transmission start on the rising edge of the pulse or the falling edge? The pseudo code you posted is the right idea but you might need to wait for the pin to go low after sending a serial burst else the code might move on to the next section while the pulse pin is still high.
Code: [Select]
if DigitalRead = HIGH then

  xSend(x22D, s22D);
  xSend(x139, s139);
  xSend(x2C1, s2C1);

 while (DigitalRead == HIGH){};

Don't PM me for help as I will ignore it.

frankwilsonshat

From what I can see the logic level starts high (normal) then drops low, back to high, then the ballast sends back the 9bit serial data 22D,139,2C1 etc.
So every time pin 1 goes low and back to high the data is sent, if that makes sense?

Riva

#22
Aug 09, 2016, 11:18 am Last Edit: Aug 09, 2016, 11:19 am by Riva
From what I can see the logic level starts high (normal) then drops low, back to high, then the ballast sends back the 9bit serial data 22D,139,2C1 etc.
So just reverse the logic and have something like this before each sequence send
Code: [Select]

while (DigitalRead == HIGH){};// Wait till pin goes low
while (DigitalRead == LOW){};// Wait till pin goes high
Don't PM me for help as I will ignore it.

frankwilsonshat

I've changed over to another projector due to various problems, now I'm getting a clean signal into the Saleae.
I can now see a 9bit serial signal (2400/9-N-1) on the tx pin, I've provisionally unplugged all unnecessary cables. From the picture I took, it looks like the projector is sending out this two byte signal expecting the ballast to send back(Arduino code).
All is not lost though as I expect the state change routine I posted before will still be valid as all that is required is a timing reference for sending the three byte sequence.

Is is possible to get the Arduino to monitor say pin 8 for these 9bit bytes, before starting its output?

Riva

You might be as well just using one of the available modified hardware serial libraries that allow 9 bit serial send and receive and then your responding to the correct commands instead of just hoping the message you receive is what your expecting.
Don't PM me for help as I will ignore it.

frankwilsonshat

I had a look at the 9bit serial option when you first mentioned it and from what I've read it looks like more trouble than it's worth.
However since the 9bit tx from the projector is purely needed as a timing reference I have found that it is reliably being interpreted on 2400n1 (8bit) as decimal 81 and 13.
Further to that I accidentally discovered that all the projector needs to start up is the 3 byte sequence, the bytes before that could be some sort of status signal for the lamp as it warms up.

I have also changed the delay from 3.1 seconds on this loop to about 900 milliseconds and it more or less stays on,
it would be much better if I could read the 81 and 13 on the tx line and sync it to the loop, something like this possibly;

if serial read = 13 then

  xSend(x22D, s22D);
  xSend(x139, s139);
  xSend(x2C1, s2C1);

 if serial read = 81 then "go to 10"

I've tried doing it by modifying the "while" loop you posted but did not have any success, apart from my accidental 3 byte "shortcut"

Riva

Try this one. It just replaces the loop code you used for reading the values using serial and all the xSend routine.
Code: [Select]

while(Serial.available > 0){  // Serial byte(s) available?
  if(Serial.read() == 13){  // Yes, Is it 13
    xSend(x22D, s22D);  // Yes, so send reply
    xSend(x139, s139);
    xSend(x2C1, s2C1);
  }
}


Don't PM me for help as I will ignore it.

frankwilsonshat

Lost interest on this but I eventually have the leds I wanted,  have them mounted on heatsinks inside the lightbox
red green and blue.
Will post pictures if all goes to plan.

 

Riva

Lost interest on this but I eventually have the leds I wanted,  have them mounted on heatsinks inside the lightbox
red green and blue.
Will post pictures if all goes to plan.
That would be good to see the final project. Is the code working as expected now?
Don't PM me for help as I will ignore it.

frankwilsonshat

#29
Dec 30, 2016, 08:04 pm Last Edit: Dec 30, 2016, 08:41 pm by frankwilsonshat
I'm having to tidy the projector away until after the New Year, so here are two pictures in the meantime.

Been having problems getting the rx opto-isolation part running, however I'm certain your code is going to be 
okay, so will work on that part once I have tidied all the wires up and installed a usb port for 5V.
(Possibly to add Firestick etc...)

The red led is one of those pinkish type colours, it will be getting swapped out for a red led that I have ready to go in.

I've got quite a bright white light coming out of the lens once it's in place, however due to heat constraints I may have to move the leds back from the polarizer filters (plastic frames). If that is the case then there is the possibility for radically expanding the case and fitting 100w leds with condenser lenses.

I have disconnected all non essential fans and run the tacho wires from a working fan to the disconnected tacho lines and the board is happy to run like this, except the main lamp fan which seems to have a different tacho signal, I would like to completely remove this fan, will check it with the SA next year. Could I run some code concurrently with the bit-banging routine, or would I just be as well to use another Arduino?

Happy New Year for now





Go Up