Page 1 of 1
Accelerometer option for non-v3
Posted: Thu Dec 08, 2016 1:01 am
by adarcher
Howdy,
I've been going back and forth on getting the new cool v3 effector setup, but i've spent too much time on my e3d-v6 mount and I already had an accelerometer lying around. So, I figured I'd see if I could swap it in.
The cheap distributor is no longer selling it for <$5 but there are still some cheap options:
https://smile.amazon.com/s/keywords=ADXL345
There is a mounting hole on it, so I just strewed that into the top next to the bowden tube. I was originally going to mount it to the bed and isolate it more, but I gave up on that before I figured out the PS_ON switcheroo--I may try that again in the future.
I quickly got it reading taps by changing the i2c registers in the v3 firmware, but got confused about the Z_PROBE_PIN being read, because I didn't notice that they repurposed the PS_ON pin
Anyway, once I hooked up that pin as well, I got it all going. It's a bit more sensitive than the seemecnc guy's choice and it can work with a heated hotend as well.
If people are interested, I could make a fork of the seemecnc firmware, or just post the new accelerometer_* functions with the new register values.
Re: Accelerometer option for non-v3
Posted: Thu Dec 08, 2016 4:36 pm
by Glacian22
I'd be interested in the details.
Re: Accelerometer option for non-v3
Posted: Thu Dec 08, 2016 6:41 pm
by joe
I would interested too! Probably in the fork.
Re: Accelerometer option for non-v3
Posted: Fri Dec 09, 2016 3:48 am
by adarcher
Glacian22 wrote:I'd be interested in the details.
joe wrote:I would interested too! Probably in the fork.
OK, this is a quick commit without checking it if works. It compiles but I have a long-ish print going so I can't upload and make sure. I don't see why it'd not work though, as all I did was clean up some code that would have confused people and wasn't related at all.
That said, this is WIP and there is a bit of me just deleting #ifdef'd blocks of code that don't get used.
If you want, you can just copy the innards of the AccelerometerInit() and put it in the SeeMeCNC original function and change the base i2c address.
Also, I committing my configuration.h which has setting for the e3dv6 temperatures plus a few other things (like faster movements).
https://github.com/adarcher/Firmware-Accelerometer
Re: Accelerometer option for non-v3
Posted: Fri Dec 09, 2016 4:29 am
by adarcher
You probably want to know how to wire it too huh?
The i2c port has four pins, just connect the like-named pins to the accelerometer board. You'll need a 5th to connect the Int1 pin on the accelerometer to the PS_ON pin, the one farthest from the big fuse.
You'll also need to connect 2 set of pins on the accelerometer board. Vcc to CS and Ground to SD0. In other words--ground being pin 0: 0 -> 5 and 1 -> 2
Re: Accelerometer option for non-v3
Posted: Fri Dec 09, 2016 8:53 am
by mhackney
Good luck with this. I experimented with the adxl345 chip last Oct-Dec and even though you can get it to "work" it is not reliable and has some odd sensitivity issues that prevented it from probing consistently all the time (or even 1/2 the time). I think I posted about it and my code either here or on my blog. I could never get the probe to trigger reliably or consistently in this application.
The other thing to keep in mind is that the issue with probing with the hotend hot is due to current running in the wires parallel to the I2C wires from the hot end to the RAMBO. This probe offers no magic solution for that. If you are probing with the hot end "on" with this board, you'll eventually have a problem with a crash. Been there, done that.
I2C is a 2 wire protocol. The other 2 wires are for VCC and GND and again, running those in parallel to I2C over a long run can create problems.
Re: Accelerometer option for non-v3
Posted: Fri Dec 09, 2016 3:28 pm
by adarcher
mhackney wrote:Good luck with this. I experimented with the adxl345 chip last Oct-Dec and even though you can get it to "work" it is not reliable and has some odd sensitivity issues that prevented it from probing consistently all the time (or even 1/2 the time). I think I posted about it and my code either here or on my blog. I could never get the probe to trigger reliably or consistently in this application.
Link to this? Your work is so spread out, it's hard to find it. Sometimes even when you know where it should be. I'd love to compare notes.
The other thing to keep in mind is that the issue with probing with the hotend hot is due to current running in the wires parallel to the I2C wires from the hot end to the RAMBO. This probe offers no magic solution for that. If you are probing with the hot end "on" with this board, you'll eventually have a problem with a crash. Been there, done that.
I2C is a 2 wire protocol. The other 2 wires are for VCC and GND and again, running those in parallel to I2C over a long run can create problems.
Interesting, I had some problems with some unreliable taps and thought it was a lost cause until I noticed my effector was tilted and my ball cup joints were hitting the bed (I've had my hot end tip as high as I could). Shows how much I needed some calibration...
I have my wires loose at the moment, so maybe the hotend current will be a problem if you run it up through the top. I'm either going to pretty up my arm conduit or go try my bed mounting idea again.
I upped my probe speed a bit because I'm impatient and upped the sensitivity threshold as well (around 70). Once I got all that, I haven't had any problems (related to probing) for over a week and I've been testing out the probing for a few hours each night.
Re: Accelerometer option for non-v3
Posted: Fri Dec 09, 2016 3:43 pm
by mhackney
Are you actually printing after you test probe? Many of the issues I observed were due to too much variation from run to run and probe to probe.
Re: Accelerometer option for non-v3
Posted: Fri Dec 09, 2016 4:29 pm
by adarcher
I'll do so more prints over the next few weeks. I was getting consistent values at like settings (temperatures and such). It's hard right now since it's so cold where my printer is that I had to modify the firmware to not mark my thermistors faulty for saying it's <18C
I did have to iterate quite a bit before I got to a good steady place though (something like 20 times). I'd do endstops, then horizontal radius (till both 0), then bed level zero, then repeat. Then I'd make sure all the other calibration dry runs would come up with 0 +/- 2 steps at each probe point.
I believe my tower angles are off though, so I'm just hoping to get "pretty good" prints to get some test prints going.
I really wanted to use this:
http://www.escher3d.com/pages/wizards/wizarddelta.php
But, I'm not using it correctly. I put in my probed points and I iterate, and it seems to blow up, making my angle corrections >5 degrees.
Re: Accelerometer option for non-v3
Posted: Thu Dec 15, 2016 6:42 pm
by adarcher
Yay! Ever since my machine was knocked over I've had calibration issues, and I've finally got somewhat flat printing thanks to this accelerometer and this thread:
http://forum.seemecnc.com/viewtopic.php?f=112&t=11211
So glad I got a printer that is fun and interesting to use and has a knowledgeable and active community
