Closed loop servo control with custom driver board

More
16 Feb 2021 20:49 #199108 by HerrNamenlos123
Hmm, i'm close.

I am looking through the hm2_eth driver source, but i can't find exactly where packet data is inserted/parsed...

Please Log in or Create an account to join the conversation.

More
21 Feb 2021 21:31 #199653 by HerrNamenlos123
Alright, i finally have the ability to exchange packets with LinuxCNC.

Everytime i start LinuxCNC it stops right away with an error message after sending dozens of requests. When looking through the source code, i found there is a

" if (debug) "

and lots of log levels everywhere, which prints additional debug information, which would be really valuable to me.

Is there a way to launch LinuxCNC in debug mode to print all messages or to increase the log level?

Please Log in or Create an account to join the conversation.

More
22 Feb 2021 18:19 #199744 by arvidb
I'm not sure about the log level, but I know of two ways to increase the logging verbosity:

* Launching linuxcnc with the -v flag
* Setting the DEBUG variable in the .ini file. This is a bit mask that selects output from different parts of the code, if I have understood correctly; I believe 0x7FFFFFFF gets you everything. The individual bits are defined in a header somewhere.. yes, in here: ./src/emc/nml_intf/debugflags.h. I have not looked into how (or even if) this actually works though.

Please Log in or Create an account to join the conversation.

More
27 Feb 2021 00:40 #200264 by andypugh
The STMBL servo drive does a lot of what you are describing and even uses an STM32 to do it.

Making your own motors and encoders sounds like a fun project. I did it myself once, with mixed success. (I needed a servo-motor with a very large through-bore)

An easy and (now) relatively cheap way to get a target for an optical encoder might be to use a PCB fab house and order a custom solder stencil. They are laser-cut from thin stainless steel, and can be made to any artwork. This is how I had mine made for my motor:

photos.app.goo.gl/UJhu3RTKrto2yRXv7

Please Log in or Create an account to join the conversation.

More
28 Feb 2021 11:01 #200390 by HerrNamenlos123
@arvidb: Thank you for the suggestion, but unfortunately it didn't help anything. It printed more, but entirely not what i was looking for.

I now took the time and compiled LinuxCNC from source and then edited the functions to always print, no matter what log level. Now i get all those prints and i am adding more print statements to further reverse engineer the interface and fully understand it.

@andypugh: Thank you also for your suggestions: STMBL surely looks interesting.

Also, the solder stencil is a really good idea for manufacturing. Up to this point i cut mine manually with a carpet knive in laminated paper and reached up to 200 pulses per revolution. Now i used transparent film and printed the lines with a laser printer, which looks really good and has great accuracy, but it still needs to be tested, if the ink actually blocks infrared light...
The following user(s) said Thank You: arvidb

Please Log in or Create an account to join the conversation.

More
28 Feb 2021 16:06 #200432 by andypugh

but it still needs to be tested, if the ink actually blocks infrared light...


I made a laser-printed reflective encoder target once.
Then I laminated it, and it stopped working. Once laminated the IR reflectance was the same for both black and white.

So, I would not like to predict if your laser printed transparency will work or not.

Please Log in or Create an account to join the conversation.

More
22 Mar 2021 21:40 #203298 by nickom44
I like this idea, a very robust and accurate slotted disk for cost of a PCB , which PCB house did you use?

Please Log in or Create an account to join the conversation.

More
22 Mar 2021 22:52 #203314 by andypugh

I like this idea, a very robust and accurate slotted disk for cost of a PCB , which PCB house did you use?


It was a long time ago, and there turned out to be a company less than a mile from my house that _only_ made PCB stencils.

If I was getting one now, I would probably use seeed. www.seeedstudio.com/stencil.html
The challenge might be getting the pattern needed as a Gerber. But you would get quite a few encoder discs on an 10 x 15 sheet.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.173 seconds
Powered by Kunena Forum