-
Notifications
You must be signed in to change notification settings - Fork 4
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
Configuration in progress #37
Comments
I have managed to flash the code and land all the wires on the ESP32. Unfortunately, I have been unable to make the frontend work so I can't test it. I'm out of my depth here, I think we could help each other, but like I said, I don't know what I'm doing. I am poorly self taught I guess you could say. I gave it two solid evenings and I'll keep trying, but my confidence is shaken. Sorry. |
what have you tried? did you set the esp32 IP address in the networking section? How are you running the frontend, or are you using the s3 version? |
odd, i can't reproduce this, but when I first checked out the s3 link it sent me to https, but you have to be regular http because the esp32 doesn't doe TLS and it will make a cors error if you try to go from https source to http websocket. Easy way to see this is via the browser's developer tools, the page is blank and the console says the following the url should be "http://espels.s3-us-west-2.amazonaws.com/release_0_0_3/index.html" not "https://espels.s3-us-west-2.amazonaws.com/release_0_0_3/index.html". I need to load the latest release since i'm running an expirimental branch and there are some CORS issues with SSE that don't exist in the latest release and this forces me to run it from npm locally. |
It's not an S3, it's a node mcu wroom piece that I have a couple of. I have others which are s3's but they're minis and don't fit the breakout I have. The frontend issue is somewhat like you describe, I tried to run it from vs code as well as the node js directory but no dice. It's important that you know that our skills might be exactly reversed; I am a good toolmaker and not a moron but some of this system stuff has me stumped. I started on a nextion project as a stop gap measure because I already have the display installed anyway. |
Elecrow also sells a display that uses an esp32 as it's mcu with a few it's. I wonder. |
That was meant to be IO's. I also don't see what I expected on the serial monitor. It appears to be reporting the die temperature every couple seconds. In degrees Fahrenheit oddly. |
can you paste in this issue the output from the serial console? You can use markdown to format it, here is a guide https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet Can you also paste in here your config.ini, please redact your wifi password.
when I say S3, I mean the url I provided. it is hosted on AWS's S3 storage platform. I see now that it is easily confused with esp32-S3. I've not tested S3, only the older dual core esp32s. The web frontend is just javascript, it only needs to be able to get to the ELS's IP via a http websocket. so no "server" is really needed to interact with, just load the html, css, and javascript. This is all bundled and available here: "http://espels.s3-us-west-2.amazonaws.com/release_0_0_3/index.html" You can also run it locally from any web server or local file but it needs to be "bundled", You need to setup react and npm and node to run it in development mode. Easiest just to run it via the link above, just ensure the prefix is "http" and not "https" Regarding the frontend, if you use the http (not https) link above you should be able to load the UI. You then tell it what IP address your esp32 is via the network tab. You should see the IP in the serial console when the esp32 boots. Here you can see mine was set to 192.168.1.87 in the webUI. Note the ws:// and the trailing /els path. these are both needed. To get the browser developer console press the keys all at once with the browser in focus. The browser console should look like this: your serial output should look something like:
the numbers it spits out are some old debugging stuff, it is:
so on first boot, 0 0 -56 where the first zero is run mode 0, the second 0 the stepper position, and finally -56 RSSI the wifi strength in db |
Good news, frontend is up and connected. Bad news is that nothing works, which is kind of par for the course on these things. I don't screw movement with venc or RPM in the app, I'll get the scope out and make sure it's clean going in. I probably need to make some adjustments to the resistor values, the arduino was 5vdc. My lathe has a feed lever and power cross feed along with the half nut. My lead screw has a keyway cut it's entire length to facilitate this. The intent is to preserve the lead screw threads for thread cutting. So the question is will the leadscrew stay in sync with the spindle at all times so you can use the half nut and thread dial? As I said, I have the old hall sensor from the original tach still installed, could you use a pulse from it to reset the sync cycle every rotation? With an interrupt I mean. If that's a dumb question, remember I don't know nearly what you do about this stuff. I didn't make any changes to anything but the config file, most of the trouble was a new workstation that was hijacked for a short time by one drive so the directories weren't where they were supposed to be. Sorry to be so long winded. |
the esp32 is 3.3v. what stepper controller are you using?
as soon as you disengage the half nut you lose sync. In practice you'll still use it but only when it is ok to loose sync.
I have not yet tested an encoder with an index pulse, but I do have one now and was planning on playing around with this. In several years of using it I haven't needed the index pulse.
Please paste the config, you have to configure the encoder pins and the step/dir pins to match your setup unless you set them up the same as in the example config.ini Also, I notice your lathe has a gearbox. the setup is only for one ratio of spindle to leadscrew and there is no way to let the controller know you changed gears. This could be added as a feature but right now it is assumed you will always have the same spindle to leadscrew ratio and so you should always have the same gear selected when you are running it. Finally, how did you try to run it, can you detail it step by step? in "startup" mode You should be able to see the rev counter when turning the encoder or turning on the virtual encoder. This also should show up in the debug page with the "Encoder Pulses" field updating Once we can confirm the encoder is working and has the roughly the right counts we can move on to the stepper. |
The motor is an integrated "servo" with drive attached, was quiet and happy running the old system. The encoder is bog standard 360 cpr but driven x2 for 720 cpr. The lathe had a gearbox that was noisy and obnoxious, what you see now is an empty box with the two rotary switches inside described above. I modified them to use the original handles. When I learn how to modify your code I'll turn them into feed direction and rapid. Here';s the config: [env:ESPelsOTA] build_src_flags = [env:ota] #[env:ESPelsOTA] |
Oh, yes there are pullups. I'm going to look at the waveforms now to see if I need to do anything. I think they're 4.7k. |
I have pulse and direction signals from the controller but no movement, so I have a problem on my end. After all this the wire management is looking decidedly "prototype" so I'll probably find it here in a minute. The encoder pulse count keeps climbing without resetting, this inhibits jogging and throws an error message. I also need to figure out ota flash, I noticed a problem with my config while scrolling past it here. |
I had to put in a level shifter to bring the jolts up to something the drive can see, but after doing so the MCU wont connect to wifi. Total mystery. I downloaded a fresh zip file from your repo, changed the config, and tried to compile it. Just like last time it failed to start ninja. I thought this was a result of my inexperience but it could be related to Microsoft requiring admin rights to run powershell on win 11. I got it to work last time but it was tedious and took forever. I'm working on it, sorry for the delay. |
what level shifter are you using? That is strange that it would effect wifi. Wifi is the biggest power draw, maybe your power supply for the esp32 is too small? should have 1A of 5v power. regarding Ninja, I don't think i'm using that. are you using vs code + platformIO extension? that is what i'm using. For any build system you shouldn't have to reinstall, you should be able to run a One thing i noticed was that the new arduino esp32 library in platformio has problems with the deprication of the RMT library in platformio.ini i set it to use the older version, 5.4
here is my build out put dependency graph
|
This sounds crazy but I built this in the ESP-IDF. No wonder it was so hard to round up dependencies and get it to work. I guess I did something really hard and thought it was my incompetence. Go figure. |
wow, ummm, wow I gave that a try once, gave up pretty quickly.... kinda amazed it works at all. |
I'm still having some issues with the pio build. It seems that the config.ini is not being read. I have only altered the config.ini.template.ini and renamed it. There's no place to paste it. what directory is it supposed to live in? |
it should be in the same directory as your platformio.ini |
It is. What does your platform.ini have in it? |
I tested the release version in this repo, it works fine for me. you need to update the OTA stuff like IP address but otherwise it should be fine. The only change is to add the older espressifArduino tag, you can try to change the name of the config.ini, it is specified in the extra_configs option per below.
|
I assume your development platform has been optimized for this kind of thing, so maybe that's why I'm struggling. All the errors I get are from the values declared in the config.ini. The file is in the ELS0.0.3 directory. I have deleted and re-downloaded this thing a dozen times and changed it until I couldn't track the changes then reverted, then downloaded again to be sure. It has to be a missing call because it throws an alarm for every single variable in the file. |
paste in the errors you are seeing. Please also show the build dependency output, in particular what version do you see in the packages section
|
There you go again... what makes you think I have any idea where to find that? I've made parts that are still working in space. It amazes me that I've invested so many hours and made zero progress since last night. Frustrating. |
to get to the build menu you have to click on the alien thing on the left when you click build under the ESPels env, as below then you have the output under "terminal" , there is also a list of tasks to the right, one of them is the build output. You may have to scroll up to get to the beginning and to see the package section. |
Scanning dependencies... [env:ESPels] build_src_flags = [env:ota] [env:ESPelsOTA] |
I need the version above the dependencies you pasted, it should be at the top under PACKAGES
I also have no idea why it is not compiling because I can't see any of the errors. While you may see lots of errors for the config.ini, it may actually be something else. The first errors typically are most important and then c++ just vomits out tons of other stuff that may or maynot be related. |
This is the entire output from the terminal. If it says "packages" I missed it. My platform.ini has a bunch of stuff in it which I replaced with yours containing almost nothing copied from this chat. It made matters far worse so I started adding sections back in. There is also an "ESPels_Master" in the repo which looks different. I must be driving you nuts, It pisses me off that I had the damnmed thing working last night and I can't even change the controller because I'm too dumb to compile the code. Weeping Jesus on the cross.
Warning!
|
the package is in there, it shows PACKAGES: framework-arduinoespressif32 @ 3.20011.230801 (2.0.11) This is good! the error that is catching my eye is: src/src/led.cpp:23:22: error: 'wifi_led' was not declared in this scope try adding these to your config.ini with the rest of the -D lines.
this is for a blink code, you can change the pins and add an LED which may help you see issues. Sorry, it doesn't appear it is in the default config.init template. |
Okay, I apparently killed the first controller. I was finally able to upload to a new one. The pins are in different places, as soon as I wire it up we should be back at last night. |
Hang in there! I spent the last 2 days slogging through some tough
troubleshooting with linuxcnc-rio and finally just got it working.
- "It's not that I'm so smart, it's just that I stay with problems longer."
- Albert Einstein
-
…On Sun, Dec 10, 2023 at 5:49 PM defazioa ***@***.***> wrote:
Okay, I apparently killed the first controller. I was finally able to
upload to a new one. The pins are in different places, as soon as I wire it
up we should be back at last night.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAE6LZSQ7C3YYQW54ZLEGLYIZRC5AVCNFSM6AAAAABAIX3NTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGIYDCNBYGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Here's the status: Finally compiled and uploaded the project. When I ping the address I usually get 2 echoes out of four. I don't know how I'm connected to it but it's likely not peer to peer, but through the router. It did connect with the app briefly, but the readings were spurious. It looks like the reason is the nvconfig. It still has the wrong pins for step and direction according to the debug tab. Why would that be? I also had this error at the very tail end of the build: Processing ESPelsTest (platform: native)Verbose mode can be enabled via Processing ota ()UndefinedEnvPlatformError: Please specify platform for 'ota' environment
|
that looks like the native test mode, you shouldn't need to run that ESPelsTest environment. It is for development testing and runs some generalized unit tests on your PC which needs a compiler setup for x86. In the platformio menu (on the left, when you click on the alien icon tingy) each build environment has a toggle (to expand the selection), you only really need to run, build, upload, monitor, and maybe clean in each environment. You should be using build/upload in the ESPels env, or if you have setup the OTA partitions then you can try to upload over the network via the ESPelsOTA env. You shouldn't run "Build All" in the default environment. regarding ICMP ping, i'm not sure how well it should perform but it sounds like you have packet loss over your network. What RSSI strength do you see in the console (the third number it spits out)? |
I didn't think it was important right now. I appreciate your patience, I have learned quite a lot in the last couple of weeks. The signal strength is somewhat below what I anticipated, it hovers around -65. I think it will be fine for now, later I will figure out how to implement a wired solution, otherwise I have a big hole in the front of my machine. It also seems like the right thing to do for peace of mind. I'll find my step and direction signals this afternoon and we'll see how it does. I saw a library in the Arduino docs called AccelMotor that will gear a motor's speed and position to an encoder at a given rate, held within a range of pulses that you specify. When I read it I thought "it can't be that simple." All of the ELS projects I've seen have a complex scheme to sync and keep pace, this is what I had in my mind when I started thinking about doing this. Just make it do what a lathe gearbox does, just minus the noise and change gear aggravation. I don't see any reason you couldn't add turning to a shoulder routines with homing and backlash compensation. Beyond that it seems like one would be better off going full cnc, which I have plenty of at work. |
that should be fine, my machine in the garage is -71
Are you able to connect the UI and see it update the spindle position?
Hard to tell since the libary is mostly in russian but it seems to use a PID, from my testing a PID doesn't quite work for this application.
I've not seen anyone develop a working ELS in less than 6-9 months. You would learn a lot in the effort but I doubt it would be a quick project. I started this project 3 years ago and it took quite a while to get it in it's current state. Mine works, it can machine up to a shoulder, thread etc and I find it much easier to use than my cnc lathe for one off turning projects. It works well for semi-manual turning and almost obviates the need for a DRO on the Z. Regarding the stepper pins, if you go to the Conf tab in the UI, and then NV Config, you can see the "raw nvconfig" at the bottom, ZP, and ZD should be the stepper pins ZP: pules, and ZD: dir for your motor. This should match your config.ini like so
|
I am at the office right now, do I need to manually change those somewhere when I get home? Please don't take my comments the wrong way, I chose this solution for a number of reasons, so thank you. It can not come as a surprise to you that sometimes others don't appreciate the complexity of this kind of work. I have a long background in process automation and almost any associated process you can think of. Most people just aren't interested in what it takes to make the things they use everyday. I hope that gives you some insight and I will be willing to help in any way I can, although I'm not sure how that would be other than to try to break it. You could be surprised at the new tricks old dogs can learn though... |
It works! Thank you, and you were right, it does exactly what I really wanted; the feedscrew will turn all the time at arbitrary speed. In move/sync mode the distance to go counts up, not toward zero, so it never comes to a stop. It's just a weird thing, I know I have something wrong with the microstep math and I was hoping to find clues there. Since I have a DRO I'll be able to tell how far I've traveled. I'll figure it out, for now I don't care. I'm very happy with the result, it's as quiet as a grave even at ridiculous speed, and that was paramount for me. |
Just reverse the motor direction, should be a switch on the controller to
do it, or swap the encoder signals.
…On Thu, Dec 14, 2023, 7:16 PM defazioa ***@***.***> wrote:
It works! Thank you, and you were right, it does exactly what I really
wanted; the feedscrew will turn all the time at arbitrary speed. In
move/sync mode the distance to go counts up, not toward zero, so it never
comes to a stop. It's just a weird thing, I know I have something wrong
with the microstep math and I was hoping to find clues there. Since I have
a DRO I'll be able to tell how far I've traveled. I'll figure it out, for
now I don't care. I'm very happy with the result, it's as quiet as a grave
even at ridiculous speed, and that was paramount for me.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAE6LZHLENHG2KRMX6Y6GDYJO6JJAVCNFSM6AAAAABAIX3NTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXGIYDKNBRGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Why didn't I think of that? Just kidding, the leadscrew reverses when the spindle does, the "distance to go" counter only counts in one direction and never resets or loads the distance to travel variable. |
were you able to get this worked out? Wondering what documentation we can create from your experience to smooth out the process. |
I have some notes, I'll get back to you. It is working, although I'm still
unable to get the "distance to go" value to do anything but increase. I
have tried reversing, both at the drive and in the app, swapped encoder
leads and rise detect to fall detect and back again. Still broken, so I
can't speak to the bounce function and there is limited threading
functionality. The biggest problem for a near novice is there is a steep
learning curve for understanding what the thing wants when you build it.
It's all in there, but if you try to be cute and choose your own
directories when extracting you will likely get into path trouble you won't
understand. I know this is elementary stuff, but it's a stumbling block for
the masses. I'm not sure about the web interface, it's a mystery box if it
doesn't connect. The ESP32's are great and fast, but somewhat sensitive to
noise and require a level shifter which isn't especially friendly if you
aren't familiar. If there's a glitch and the radio doesn't start you're
left scratching your head. I'm committed to trying my feeble hand at using
this hall switch as an index pulse. This way you can sync to the spindle
every rotation and use the thread dial if you have one. Only speaking for
myself, I prefer at least a few controls I can put my hands on. It seems
best that even though the method of gearing is totally different at the
core, the end user experience remains as unchanged as is practical. But
this is a philosophical matter.
…On Wed, Dec 20, 2023, 7:58 AM Jesse Schoch ***@***.***> wrote:
were you able to get this worked out? Wondering what documentation we can
create from your experience to smooth out the process.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWPRPONUVY3VDCXCK2ZSOATYKMDJ3AVCNFSM6AAAAABAIX3NTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUG4ZTGNZXGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
great, any notes would be appreciated
You may need to swap them both. Here are a few things to try:
did you hook up any LED's to the LED pins?
my stepper controller doesn't need a level shifter, what model are you using? Also I've read the pins are 5v tolerant (undocumented feature) and i think you could pull them up to 5v if it is the right kind of controller connect (open collector?)
I'm not quite sure how that would work, if you use the threading dial and disengage the leadscrew you lose position. this would be ok for "feed mode" but not for the moveSync modes. Maybe worth opening another issue to discuss this as well as what would be needed for the encoder to use an index pulse. Right now there is no logic to deal with that and we'd need to setup another interrupt. |
closing this out now. |
Here are a few photos and some questions:
As you can see, I got lucky and was able to shoehorn the servo in the unused space under the headstock on this particular lathe. The levers on the front are three position switches; one on the right is maintained and the left one is momentary. I would like the maintained one to determine direction. I was also thinking that the existing hall sensor that was used by the factory tachometer could be put to work as an index pulse to synchronize the carriage
The text was updated successfully, but these errors were encountered: