- Posts: 17
- Thank you received: 0
Closed loop servo control with custom driver board
- HerrNamenlos123
- Topic Author
- Offline
- New Member
-
Less
More
5 years 8 months ago #199108
by HerrNamenlos123
Replied by HerrNamenlos123 on topic Closed loop servo control with custom driver board
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...
I am looking through the hm2_eth driver source, but i can't find exactly where packet data is inserted/parsed...
Please Log in to join the conversation.
- HerrNamenlos123
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
5 years 8 months ago #199653
by HerrNamenlos123
Replied by HerrNamenlos123 on topic Closed loop servo control with custom driver board
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?
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 to join the conversation.
5 years 8 months ago #199744
by arvidb
Replied by arvidb on topic Closed loop servo control with custom driver board
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.
* 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 to join the conversation.
5 years 8 months ago #200264
by andypugh
Replied by andypugh on topic Closed loop servo control with custom driver board
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
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 to join the conversation.
- HerrNamenlos123
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
5 years 8 months ago #200390
by HerrNamenlos123
Replied by HerrNamenlos123 on topic Closed loop servo control with custom driver board
@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...
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...
Please Log in to join the conversation.
5 years 8 months ago #200432
by andypugh
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.
Replied by andypugh on topic Closed loop servo control with custom driver board
HerrNamenlos123 wrote: 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 to join the conversation.
5 years 7 months ago #203298
by nickom44
Replied by nickom44 on topic Closed loop servo control with custom driver board
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 to join the conversation.
5 years 7 months ago #203314
by andypugh
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.
Replied by andypugh on topic Closed loop servo control with custom driver board
nickom44 wrote: 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 to join the conversation.
Time to create page: 0.083 seconds
