Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't Activate - New Firmware? #2

Open
joeljacobs opened this issue Feb 6, 2018 · 16 comments
Open

Won't Activate - New Firmware? #2

joeljacobs opened this issue Feb 6, 2018 · 16 comments

Comments

@joeljacobs
Copy link

I have followed your example and schematic as perfectly as possible. Quntuple-checking every connection, but the desk never moves. I have switched back and forth to the built-in controller, and it always works, but the Arduino never does. Is it possible the firmware changed on the desk?
I am also using an MCP2003 (not 2003B.) It doesn't seem like that should make a difference, but could it? The B supports LIN 2.2, and the one I have supports up to 2.1, but I can't imagine that's an issue.
Any hints? I can't troubleshoot it the way I understand, because the serial port is in use for the LIN chip.
I tried switching (using an arduino mega) to other serial pins using the constants, but it always outputted on the usb serial when connected.
I also ensure the usb serial is disconnected before testing.
Any advice would be great.

@trainman419
Copy link
Owner

If you have one, your best bet would be to hook up an oscilloscope on the LIN bus and see that there's traffic (it should look similar to normal RS-232 traffic).

Trying an Arduino Mega is also an excellent debugging idea; but in addition to changing the pins ( https://github.com/trainman419/bekant/blob/master/bekant.ino#L22-L23 ) you'll also need to change the serial port used by the LIN library: https://github.com/trainman419/bekant/blob/master/bekant.ino#L26

@gcormier
Copy link

Having issues as well.

Still troubleshooting... not sure if you've made any progress @joeljacobs ?

My first lead... if I put a logic analyzer on the RX/TX of my MCP2003B, I can see when it polls ID 8 and 9. ID 8 does not respond, 9 does.

image

So this confirms the LIN interface is talking at least. I'm not sure why that motor doesn't try to move.

@gcormier
Copy link

gcormier commented Mar 4, 2018

Solved the issue. @joeljacobs not sure if you are still working on this.

The schematic in the project is missing two key diodes. (The MCP2003B reference diagram is also wrong). The official LIN spec is where I figured it out. Here's the correct way :

image

You MUST have these two diodes in serial tapped in this manner to provide the proper voltage drop.

I think otherwise, the behaviour is erratic - we can assume @trainman419 had a fully functional setup without them. I had a half functional setup, with one motor responding and the other not. Probably depends on if other parts of the circuit induce some voltage drop.

@trainman419
Copy link
Owner

I never saw any signal integrity issues without the diodes that you're mentioning, and I don't remember seeing them in the LIN bus specification. Can you provide a link to documentation about these diodes, or measurements that demonstrate why they're necessary?

I do know that there is some setup that is performed by the desk's original controller that I haven't emulated yet, and I remember trying to power my desk on without the original controller would result in only a single working motor.

Usually I power on the desk with the original controller, then unplug it and plug in my Arduino.

@gcormier
Copy link

gcormier commented Mar 5, 2018

Interesting on the initial setup - I will have to try it out. One thing I noticed is it seems to run fine without the 6 empty pulses being sent.

image

Two pages down it says the diodes are mandatory.

image

@gcormier
Copy link

gcormier commented Mar 5, 2018

Damn, I just tried it out - indeed, does not work without initially having the IKEA controller plugged in first. Sigh. Time to figure out the initialization routine!

@jeffreypriebe
Copy link

@gcormier Any luck on figuring out the initialization routine?

I presume "power desk on" is referring to plugging in the desk. That is, the following should work:

  1. Plug in desk (with normal desk controller)
  2. Disconnect the controller
  3. Attach this controller

However, reversing steps 2 & 1 will make it fail.

@gcormier
Copy link

Yes I got it going. I started a project with memory functions, PCB and functional controller.

https://github.com/gcormier/megadesk

@gcormier
Copy link

Oh and looking back at this issue, the diodes might not have been the root cause as I was unaware of the initialization routine. However still good to include them.

@luckydonald
Copy link

Is that starting sequence now brought back into this arduino project or only available at megadesk one?

If I read @gcormier's code correctly, that's the part of https://github.com/gcormier/megadesk/blob/39d9ab13acb1d6baa30617af4301626e288f1aac/Code/megadesk.ino#L472-L565, yes?

@trainman419
Copy link
Owner

I haven't ported @gcormier 's changes back to this repository. I'd be happy to accept a pull request if someone else wants to do it.

@slaesh
Copy link

slaesh commented Feb 7, 2020

i am currently working on a complete replacement..
including a display, wifi and a custom enclosure! :)
just remove the old controller, replace with the new one and keep on going! ;)

will keep you guys updated =)

image

@rhannink
Copy link

rhannink commented May 5, 2021

Hello,
I have built a LIN controller as shown in the schematic. I only use an mcp2003 e/p instead off an MCP2003B.
I have the Bekant desk plugged in with the original controller, next I remove the original controller an plug in the Arduino controller still with the Bekant desk powered on.

The desk does not respons to and button press. I see the Arduino Led lightning up when I press a button. I have also connected a logic analyser to the RX and TX pin (0 and 1) and I see LIN protocols going by. I think I even see LIN respons to ID 0x08 and LIN respons to ID 0x09. So I guess the LIN part and the MCP2003 transceiver are working ok.

And idea what i might be doing wrong or how I can do further debugging?

Gr. Remco
response-to-08
response-to-09

@trainman419
Copy link
Owner

As noted before, there's an initialization sequence for the motors that I haven't reverse-engineered or implemented, but it looks like @gcormier has. I suggest you copy that init code over into this project and give it a try: https://github.com/gcormier/megadesk/blob/39d9ab13acb1d6baa30617af4301626e288f1aac/Code/megadesk.ino#L472-L565

@rhannink
Copy link

rhannink commented May 5, 2021

Thank for your response, but I read everywhere that starting up with the original controller and then switch to the new controller should do the trick.

I am not a (real) programmer so adding the startup code is not trivial for me, but I will give it a try.

@trainman419
Copy link
Owner

You write code? That makes you a programmer.

I'll tell you a little secret. I have a very fancy title at my day job and I still look things up on google and stack overflow all the time.

I tried my controller with a new desk, maybe a year or two ago, and ran into the same problem here. Couldn't get it to sync and didn't have the tools to look into it at the time.

I don't have one of these desks handy at the moment so you're probably in a better position to fix it than I am. It looks like you've got a nice logic analyzer there. I'd probably start by trying to copy or modify @gcormier's code into the arduino setup() function here. If that doesn't help, you could use your logic analyzer to capture the power-on command sequence from the original controller and modify the code here until it produces the same power-up sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants